@backstage/frontend-plugin-api 0.8.0 → 0.9.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/dist/apis/definitions/AppTreeApi.esm.js.map +1 -1
- package/dist/components/ErrorBoundary.esm.js.map +1 -1
- package/dist/frontend-internal/src/wiring/InternalExtensionDefinition.esm.js +7 -16
- package/dist/frontend-internal/src/wiring/InternalExtensionDefinition.esm.js.map +1 -1
- package/dist/frontend-internal/src/wiring/InternalFrontendPlugin.esm.js +9 -0
- package/dist/frontend-internal/src/wiring/InternalFrontendPlugin.esm.js.map +1 -0
- package/dist/index.d.ts +28 -189
- package/dist/index.esm.js +1 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/opaque-internal/src/OpaqueType.esm.js +103 -0
- package/dist/opaque-internal/src/OpaqueType.esm.js.map +1 -0
- package/dist/wiring/createExtension.esm.js +27 -25
- package/dist/wiring/createExtension.esm.js.map +1 -1
- package/dist/wiring/createExtensionBlueprint.esm.js +20 -15
- package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
- package/dist/wiring/createFrontendModule.esm.js +2 -2
- package/dist/wiring/createFrontendModule.esm.js.map +1 -1
- package/dist/wiring/createFrontendPlugin.esm.js +13 -9
- package/dist/wiring/createFrontendPlugin.esm.js.map +1 -1
- package/dist/wiring/resolveExtensionDefinition.esm.js +2 -2
- package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
- package/package.json +7 -7
- package/dist/wiring/createExtensionOverrides.esm.js +0 -22
- package/dist/wiring/createExtensionOverrides.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @backstage/frontend-plugin-api
|
|
2
2
|
|
|
3
|
+
## 0.9.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4a5ba19: Removed deprecated `namespace` option from `createExtension` and `createExtensionBlueprint`, including `.make` and `.makeWithOverides`, it's no longer necessary and will use the `pluginId` instead.
|
|
8
|
+
|
|
9
|
+
Removed deprecated `createExtensionOverrides` this should be replaced with `createFrontendModule` instead.
|
|
10
|
+
|
|
11
|
+
Removed deprecated `BackstagePlugin` type, use `FrontendPlugin` type instead from this same package.
|
|
12
|
+
|
|
13
|
+
- bfd4bec: **BREAKING PRODUCERS**: The `IconComponent` no longer accepts `fontSize="default"`. This has effectively been removed from Material-UI since its last two major versions, and has not worked properly for them in a long time.
|
|
14
|
+
|
|
15
|
+
This change should not have an effect on neither users of MUI4 nor MUI5/6, since the updated interface should still let you send the respective `SvgIcon` types into interfaces where relevant (e.g. as app icons).
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 873e424: Internal refactor of usage of opaque types.
|
|
20
|
+
- 323aae8: It is now possible to override the blueprint parameters when overriding an extension created from a blueprint:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
const myExtension = MyBlueprint.make({
|
|
24
|
+
params: {
|
|
25
|
+
myParam: 'myDefault',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const myOverride = myExtension.override({
|
|
30
|
+
params: {
|
|
31
|
+
myParam: 'myOverride',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
const myFactoryOverride = myExtension.override({
|
|
35
|
+
factory(origFactory) {
|
|
36
|
+
return origFactory({
|
|
37
|
+
params: {
|
|
38
|
+
myParam: 'myOverride',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The provided parameters will be merged with the original parameters of the extension.
|
|
46
|
+
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
- @backstage/core-components@0.15.1-next.0
|
|
49
|
+
- @backstage/core-plugin-api@1.10.0-next.0
|
|
50
|
+
- @backstage/types@1.1.1
|
|
51
|
+
- @backstage/version-bridge@1.0.9
|
|
52
|
+
|
|
3
53
|
## 0.8.0
|
|
4
54
|
|
|
5
55
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppTreeApi.esm.js","sources":["../../../src/apis/definitions/AppTreeApi.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { createApiRef } from '@backstage/core-plugin-api';\nimport {
|
|
1
|
+
{"version":3,"file":"AppTreeApi.esm.js","sources":["../../../src/apis/definitions/AppTreeApi.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { createApiRef } from '@backstage/core-plugin-api';\nimport { FrontendPlugin, Extension, ExtensionDataRef } from '../../wiring';\n\n/**\n * The specification for this {@link AppNode} in the {@link AppTree}.\n *\n * @public\n * @remarks\n *\n * The specifications for a collection of app nodes is all the information needed\n * to build the tree and instantiate the nodes.\n */\nexport interface AppNodeSpec {\n readonly id: string;\n readonly attachTo: { id: string; input: string };\n readonly extension: Extension<unknown, unknown>;\n readonly disabled: boolean;\n readonly config?: unknown;\n readonly source?: FrontendPlugin;\n}\n\n/**\n * The connections from this {@link AppNode} to other nodes.\n *\n * @public\n * @remarks\n *\n * The app node edges are resolved based on the app node specs, regardless of whether\n * adjacent nodes are disabled or not. If no parent attachment is present or\n */\nexport interface AppNodeEdges {\n readonly attachedTo?: { node: AppNode; input: string };\n readonly attachments: ReadonlyMap<string, AppNode[]>;\n}\n\n/**\n * The instance of this {@link AppNode} in the {@link AppTree}.\n *\n * @public\n * @remarks\n *\n * The app node instance is created when the `factory` function of an extension is called.\n * Instances will only be present for nodes in the app that are connected to the root\n * node and not disabled\n */\nexport interface AppNodeInstance {\n /** Returns a sequence of all extension data refs that were output by this instance */\n getDataRefs(): Iterable<ExtensionDataRef<unknown>>;\n /** Get the output data for a single extension data ref */\n getData<T>(ref: ExtensionDataRef<T>): T | undefined;\n}\n\n/**\n * A node in the {@link AppTree}.\n *\n * @public\n */\nexport interface AppNode {\n /** The specification for how this node should be instantiated */\n readonly spec: AppNodeSpec;\n /** The edges from this node to other nodes in the app tree */\n readonly edges: AppNodeEdges;\n /** The instance of this node, if it was instantiated */\n readonly instance?: AppNodeInstance;\n}\n\n/**\n * The app tree containing all {@link AppNode}s of the app.\n *\n * @public\n */\nexport interface AppTree {\n /** The root node of the app */\n readonly root: AppNode;\n /** A map of all nodes in the app by ID, including orphaned or disabled nodes */\n readonly nodes: ReadonlyMap<string /* id */, AppNode>;\n /** A sequence of all nodes with a parent that is not reachable from the app root node */\n readonly orphans: Iterable<AppNode>;\n}\n\n/**\n * The API for interacting with the {@link AppTree}.\n *\n * @public\n */\nexport interface AppTreeApi {\n /**\n * Get the {@link AppTree} for the app.\n */\n getTree(): { tree: AppTree };\n}\n\n/**\n * The `ApiRef` of {@link AppTreeApi}.\n *\n * @public\n */\nexport const appTreeApiRef = createApiRef<AppTreeApi>({ id: 'core.app-tree' });\n"],"names":[],"mappings":";;AAiHO,MAAM,aAAgB,GAAA,YAAA,CAAyB,EAAE,EAAA,EAAI,iBAAiB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.esm.js","sources":["../../src/components/ErrorBoundary.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 React, { Component, ComponentType, PropsWithChildren } from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.esm.js","sources":["../../src/components/ErrorBoundary.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 React, { Component, ComponentType, PropsWithChildren } from 'react';\nimport { FrontendPlugin } from '../wiring';\nimport { CoreErrorBoundaryFallbackProps } from '../types';\n\ntype ErrorBoundaryProps = PropsWithChildren<{\n plugin?: FrontendPlugin;\n Fallback: ComponentType<CoreErrorBoundaryFallbackProps>;\n}>;\ntype ErrorBoundaryState = { error?: Error };\n\n/** @internal */\nexport class ErrorBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n state: ErrorBoundaryState = { error: undefined };\n\n handleErrorReset = () => {\n this.setState({ error: undefined });\n };\n\n render() {\n const { error } = this.state;\n const { plugin, children, Fallback } = this.props;\n\n if (error) {\n return (\n <Fallback\n plugin={plugin}\n error={error}\n resetError={this.handleErrorReset}\n />\n );\n }\n\n return children;\n }\n}\n"],"names":[],"mappings":";;AA2BO,MAAM,sBAAsB,SAGjC,CAAA;AAAA,EACA,OAAO,yBAAyB,KAAc,EAAA;AAC5C,IAAA,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,GACjB;AAAA,EAEA,KAAA,GAA4B,EAAE,KAAA,EAAO,KAAU,CAAA,EAAA,CAAA;AAAA,EAE/C,mBAAmB,MAAM;AACvB,IAAA,IAAA,CAAK,QAAS,CAAA,EAAE,KAAO,EAAA,KAAA,CAAA,EAAW,CAAA,CAAA;AAAA,GACpC,CAAA;AAAA,EAEA,MAAS,GAAA;AACP,IAAM,MAAA,EAAE,KAAM,EAAA,GAAI,IAAK,CAAA,KAAA,CAAA;AACvB,IAAA,MAAM,EAAE,MAAA,EAAQ,QAAU,EAAA,QAAA,KAAa,IAAK,CAAA,KAAA,CAAA;AAE5C,IAAA,IAAI,KAAO,EAAA;AACT,MACE,uBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,MAAA;AAAA,UACA,KAAA;AAAA,UACA,YAAY,IAAK,CAAA,gBAAA;AAAA,SAAA;AAAA,OACnB,CAAA;AAAA,KAEJ;AAEA,IAAO,OAAA,QAAA,CAAA;AAAA,GACT;AACF;;;;"}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
const internal = overrides;
|
|
3
|
-
if (internal.$$type !== "@backstage/ExtensionDefinition") {
|
|
4
|
-
throw new Error(
|
|
5
|
-
`Invalid extension definition instance, bad type '${internal.$$type}'`
|
|
6
|
-
);
|
|
7
|
-
}
|
|
8
|
-
const version = internal.version;
|
|
9
|
-
if (version !== "v1" && version !== "v2") {
|
|
10
|
-
throw new Error(
|
|
11
|
-
`Invalid extension definition instance, bad version '${version}'`
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
return internal;
|
|
15
|
-
}
|
|
1
|
+
import { OpaqueType } from '../../../opaque-internal/src/OpaqueType.esm.js';
|
|
16
2
|
|
|
17
|
-
|
|
3
|
+
const OpaqueExtensionDefinition = OpaqueType.create({
|
|
4
|
+
type: "@backstage/ExtensionDefinition",
|
|
5
|
+
versions: ["v1", "v2"]
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export { OpaqueExtensionDefinition };
|
|
18
9
|
//# sourceMappingURL=InternalExtensionDefinition.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalExtensionDefinition.esm.js","sources":["../../../../../frontend-internal/src/wiring/InternalExtensionDefinition.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n AnyExtensionDataRef,\n ApiHolder,\n AppNode,\n ExtensionDataValue,\n ExtensionDefinition,\n ExtensionDefinitionParameters,\n ExtensionInput,\n PortableSchema,\n ResolvedExtensionInputs,\n} from '@backstage/frontend-plugin-api';\n\nexport
|
|
1
|
+
{"version":3,"file":"InternalExtensionDefinition.esm.js","sources":["../../../../../frontend-internal/src/wiring/InternalExtensionDefinition.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n AnyExtensionDataRef,\n ApiHolder,\n AppNode,\n ExtensionDataValue,\n ExtensionDefinition,\n ExtensionDefinitionParameters,\n ExtensionInput,\n PortableSchema,\n ResolvedExtensionInputs,\n} from '@backstage/frontend-plugin-api';\nimport { OpaqueType } from '@internal/opaque';\n\nexport const OpaqueExtensionDefinition = OpaqueType.create<{\n public: ExtensionDefinition<ExtensionDefinitionParameters>;\n versions:\n | {\n readonly version: 'v1';\n readonly kind?: string;\n readonly namespace?: string;\n readonly name?: string;\n readonly attachTo: { id: string; input: string };\n readonly disabled: boolean;\n readonly configSchema?: PortableSchema<any, any>;\n readonly inputs: {\n [inputName in string]: {\n $$type: '@backstage/ExtensionInput';\n extensionData: {\n [name in string]: AnyExtensionDataRef;\n };\n config: { optional: boolean; singleton: boolean };\n };\n };\n readonly output: {\n [name in string]: AnyExtensionDataRef;\n };\n factory(context: {\n node: AppNode;\n apis: ApiHolder;\n config: object;\n inputs: {\n [inputName in string]: unknown;\n };\n }): {\n [inputName in string]: unknown;\n };\n }\n | {\n readonly version: 'v2';\n readonly kind?: string;\n readonly namespace?: string;\n readonly name?: string;\n readonly attachTo: { id: string; input: string };\n readonly disabled: boolean;\n readonly configSchema?: PortableSchema<any, any>;\n readonly inputs: {\n [inputName in string]: ExtensionInput<\n AnyExtensionDataRef,\n { optional: boolean; singleton: boolean }\n >;\n };\n readonly output: Array<AnyExtensionDataRef>;\n factory(context: {\n node: AppNode;\n apis: ApiHolder;\n config: object;\n inputs: ResolvedExtensionInputs<{\n [inputName in string]: ExtensionInput<\n AnyExtensionDataRef,\n { optional: boolean; singleton: boolean }\n >;\n }>;\n }): Iterable<ExtensionDataValue<any, any>>;\n };\n}>({\n type: '@backstage/ExtensionDefinition',\n versions: ['v1', 'v2'],\n});\n"],"names":[],"mappings":";;AA6Ba,MAAA,yBAAA,GAA4B,WAAW,MA6DjD,CAAA;AAAA,EACD,IAAM,EAAA,gCAAA;AAAA,EACN,QAAA,EAAU,CAAC,IAAA,EAAM,IAAI,CAAA;AACvB,CAAC;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpaqueType } from '../../../opaque-internal/src/OpaqueType.esm.js';
|
|
2
|
+
|
|
3
|
+
const OpaqueFrontendPlugin = OpaqueType.create({
|
|
4
|
+
type: "@backstage/FrontendPlugin",
|
|
5
|
+
versions: ["v1"]
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export { OpaqueFrontendPlugin };
|
|
9
|
+
//# sourceMappingURL=InternalFrontendPlugin.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalFrontendPlugin.esm.js","sources":["../../../../../frontend-internal/src/wiring/InternalFrontendPlugin.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n Extension,\n FeatureFlagConfig,\n FrontendPlugin,\n} from '@backstage/frontend-plugin-api';\nimport { OpaqueType } from '@internal/opaque';\n\nexport const OpaqueFrontendPlugin = OpaqueType.create<{\n public: FrontendPlugin;\n versions: {\n readonly version: 'v1';\n readonly extensions: Extension<unknown>[];\n readonly featureFlags: FeatureFlagConfig[];\n };\n}>({\n type: '@backstage/FrontendPlugin',\n versions: ['v1'],\n});\n"],"names":[],"mappings":";;AAuBa,MAAA,oBAAA,GAAuB,WAAW,MAO5C,CAAA;AAAA,EACD,IAAM,EAAA,2BAAA;AAAA,EACN,QAAA,EAAU,CAAC,IAAI,CAAA;AACjB,CAAC;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -277,7 +277,7 @@ type CoreNotFoundErrorPageProps = {
|
|
|
277
277
|
};
|
|
278
278
|
/** @public */
|
|
279
279
|
type CoreErrorBoundaryFallbackProps = {
|
|
280
|
-
plugin?:
|
|
280
|
+
plugin?: FrontendPlugin;
|
|
281
281
|
error: Error;
|
|
282
282
|
resetError: () => void;
|
|
283
283
|
};
|
|
@@ -370,7 +370,7 @@ type JoinStringUnion<U, TDiv extends string = ', ', TResult extends string = ''>
|
|
|
370
370
|
/** @ignore */
|
|
371
371
|
type VerifyExtensionFactoryOutput<UDeclaredOutput extends AnyExtensionDataRef, UFactoryOutput extends ExtensionDataValue<any, any>> = (UDeclaredOutput extends any ? UDeclaredOutput['config']['optional'] extends true ? never : UDeclaredOutput['id'] : never) extends infer IRequiredOutputIds ? [IRequiredOutputIds] extends [UFactoryOutput['id']] ? [UFactoryOutput['id']] extends [UDeclaredOutput['id']] ? {} : `Error: The extension factory has undeclared output(s): ${JoinStringUnion<Exclude<UFactoryOutput['id'], UDeclaredOutput['id']>>}` : `Error: The extension factory is missing the following output(s): ${JoinStringUnion<Exclude<IRequiredOutputIds, UFactoryOutput['id']>>}` : never;
|
|
372
372
|
/** @public */
|
|
373
|
-
type CreateExtensionOptions<TKind extends string | undefined,
|
|
373
|
+
type CreateExtensionOptions<TKind extends string | undefined, TName extends string | undefined, UOutput extends AnyExtensionDataRef, TInputs extends {
|
|
374
374
|
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
|
|
375
375
|
optional: boolean;
|
|
376
376
|
singleton: boolean;
|
|
@@ -379,7 +379,6 @@ type CreateExtensionOptions<TKind extends string | undefined, TNamespace extends
|
|
|
379
379
|
[key: string]: (zImpl: typeof z) => z.ZodType;
|
|
380
380
|
}, UFactoryOutput extends ExtensionDataValue<any, any>> = {
|
|
381
381
|
kind?: TKind;
|
|
382
|
-
namespace?: TNamespace;
|
|
383
382
|
name?: TName;
|
|
384
383
|
attachTo: {
|
|
385
384
|
id: string;
|
|
@@ -403,7 +402,6 @@ type CreateExtensionOptions<TKind extends string | undefined, TNamespace extends
|
|
|
403
402
|
/** @public */
|
|
404
403
|
type ExtensionDefinitionParameters = {
|
|
405
404
|
kind?: string;
|
|
406
|
-
namespace?: string;
|
|
407
405
|
name?: string;
|
|
408
406
|
configInput?: {
|
|
409
407
|
[K in string]: any;
|
|
@@ -418,6 +416,7 @@ type ExtensionDefinitionParameters = {
|
|
|
418
416
|
singleton: boolean;
|
|
419
417
|
}>;
|
|
420
418
|
};
|
|
419
|
+
params?: object;
|
|
421
420
|
};
|
|
422
421
|
/** @public */
|
|
423
422
|
type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefinitionParameters> = {
|
|
@@ -430,7 +429,7 @@ type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefi
|
|
|
430
429
|
optional: boolean;
|
|
431
430
|
singleton: boolean;
|
|
432
431
|
}>;
|
|
433
|
-
}>(args: {
|
|
432
|
+
}>(args: Expand<{
|
|
434
433
|
attachTo?: {
|
|
435
434
|
id: string;
|
|
436
435
|
input: string;
|
|
@@ -445,10 +444,12 @@ type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefi
|
|
|
445
444
|
[KName in keyof T['config']]?: `Error: Config key '${KName & string}' is already defined in parent schema`;
|
|
446
445
|
};
|
|
447
446
|
};
|
|
448
|
-
factory?(originalFactory: (context?: {
|
|
447
|
+
factory?(originalFactory: (context?: Expand<{
|
|
449
448
|
config?: T['config'];
|
|
450
449
|
inputs?: ResolveInputValueOverrides<NonNullable<T['inputs']>>;
|
|
451
|
-
}
|
|
450
|
+
} & ([T['params']] extends [never] ? {} : {
|
|
451
|
+
params?: Partial<T['params']>;
|
|
452
|
+
})>) => ExtensionDataContainer<NonNullable<T['output']>>, context: {
|
|
452
453
|
node: AppNode;
|
|
453
454
|
apis: ApiHolder;
|
|
454
455
|
config: T['config'] & {
|
|
@@ -456,9 +457,10 @@ type ExtensionDefinition<T extends ExtensionDefinitionParameters = ExtensionDefi
|
|
|
456
457
|
};
|
|
457
458
|
inputs: Expand<ResolvedExtensionInputs<T['inputs'] & TExtraInputs>>;
|
|
458
459
|
}): Iterable<UFactoryOutput>;
|
|
459
|
-
} &
|
|
460
|
+
} & ([T['params']] extends [never] ? {} : {
|
|
461
|
+
params?: Partial<T['params']>;
|
|
462
|
+
})> & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>): ExtensionDefinition<{
|
|
460
463
|
kind: T['kind'];
|
|
461
|
-
namespace: T['namespace'];
|
|
462
464
|
name: T['name'];
|
|
463
465
|
output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
|
|
464
466
|
inputs: T['inputs'] & TExtraInputs;
|
|
@@ -478,31 +480,7 @@ declare function createExtension<UOutput extends AnyExtensionDataRef, TInputs ex
|
|
|
478
480
|
}>;
|
|
479
481
|
}, TConfigSchema extends {
|
|
480
482
|
[key: string]: (zImpl: typeof z) => z.ZodType;
|
|
481
|
-
}, UFactoryOutput extends ExtensionDataValue<any, any>, const TKind extends string | undefined = undefined, const
|
|
482
|
-
config: string extends keyof TConfigSchema ? {} : {
|
|
483
|
-
[key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
|
|
484
|
-
};
|
|
485
|
-
configInput: string extends keyof TConfigSchema ? {} : z.input<z.ZodObject<{
|
|
486
|
-
[key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>;
|
|
487
|
-
}>>;
|
|
488
|
-
output: UOutput;
|
|
489
|
-
inputs: TInputs;
|
|
490
|
-
kind: string | undefined extends TKind ? undefined : TKind;
|
|
491
|
-
namespace: string | undefined extends TNamespace ? undefined : TNamespace;
|
|
492
|
-
name: string | undefined extends TName ? undefined : TName;
|
|
493
|
-
}>;
|
|
494
|
-
/**
|
|
495
|
-
* @public
|
|
496
|
-
* @deprecated namespace is no longer required, you can safely remove this option and it will default to the `pluginId`. It will be removed in a future release.
|
|
497
|
-
*/
|
|
498
|
-
declare function createExtension<UOutput extends AnyExtensionDataRef, TInputs extends {
|
|
499
|
-
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
|
|
500
|
-
optional: boolean;
|
|
501
|
-
singleton: boolean;
|
|
502
|
-
}>;
|
|
503
|
-
}, TConfigSchema extends {
|
|
504
|
-
[key: string]: (zImpl: typeof z) => z.ZodType;
|
|
505
|
-
}, UFactoryOutput extends ExtensionDataValue<any, any>, const TKind extends string | undefined = undefined, const TNamespace extends string | undefined = undefined, const TName extends string | undefined = undefined>(options: CreateExtensionOptions<TKind, TNamespace, TName, UOutput, TInputs, TConfigSchema, UFactoryOutput>): ExtensionDefinition<{
|
|
483
|
+
}, UFactoryOutput extends ExtensionDataValue<any, any>, const TKind extends string | undefined = undefined, const TName extends string | undefined = undefined>(options: CreateExtensionOptions<TKind, TName, UOutput, TInputs, TConfigSchema, UFactoryOutput>): ExtensionDefinition<{
|
|
506
484
|
config: string extends keyof TConfigSchema ? {} : {
|
|
507
485
|
[key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
|
|
508
486
|
};
|
|
@@ -511,8 +489,8 @@ declare function createExtension<UOutput extends AnyExtensionDataRef, TInputs ex
|
|
|
511
489
|
}>>;
|
|
512
490
|
output: UOutput;
|
|
513
491
|
inputs: TInputs;
|
|
492
|
+
params: never;
|
|
514
493
|
kind: string | undefined extends TKind ? undefined : TKind;
|
|
515
|
-
namespace: string | undefined extends TNamespace ? undefined : TNamespace;
|
|
516
494
|
name: string | undefined extends TName ? undefined : TName;
|
|
517
495
|
}>;
|
|
518
496
|
|
|
@@ -534,11 +512,10 @@ interface Extension<TConfig, TConfigInput = TConfig> {
|
|
|
534
512
|
readonly configSchema?: PortableSchema<TConfig, TConfigInput>;
|
|
535
513
|
}
|
|
536
514
|
/** @ignore */
|
|
537
|
-
type ResolveExtensionId<TExtension extends ExtensionDefinition,
|
|
515
|
+
type ResolveExtensionId<TExtension extends ExtensionDefinition, TNamespace extends string> = TExtension extends ExtensionDefinition<{
|
|
538
516
|
kind: infer IKind extends string | undefined;
|
|
539
|
-
namespace: infer INamespace extends string | undefined;
|
|
540
517
|
name: infer IName extends string | undefined;
|
|
541
|
-
}> ? [string
|
|
518
|
+
}> ? [string] extends [IKind | IName] ? never : (undefined extends IName ? TNamespace : `${TNamespace}/${IName}`) extends infer INamePart extends string ? IKind extends string ? `${IKind}:${INamePart}` : INamePart : never : never;
|
|
542
519
|
|
|
543
520
|
/**
|
|
544
521
|
* Feature flag configuration.
|
|
@@ -570,7 +547,9 @@ type FrontendFeature = FrontendPlugin | ExtensionOverrides;
|
|
|
570
547
|
/** @public */
|
|
571
548
|
interface FrontendPlugin<TRoutes extends AnyRoutes = AnyRoutes, TExternalRoutes extends AnyExternalRoutes = AnyExternalRoutes, TExtensionMap extends {
|
|
572
549
|
[id in string]: ExtensionDefinition;
|
|
573
|
-
} = {
|
|
550
|
+
} = {
|
|
551
|
+
[id in string]: ExtensionDefinition;
|
|
552
|
+
}> {
|
|
574
553
|
readonly $$type: '@backstage/FrontendPlugin';
|
|
575
554
|
readonly id: string;
|
|
576
555
|
readonly routes: TRoutes;
|
|
@@ -580,13 +559,6 @@ interface FrontendPlugin<TRoutes extends AnyRoutes = AnyRoutes, TExternalRoutes
|
|
|
580
559
|
extensions: Array<ExtensionDefinition>;
|
|
581
560
|
}): FrontendPlugin<TRoutes, TExternalRoutes, TExtensionMap>;
|
|
582
561
|
}
|
|
583
|
-
/**
|
|
584
|
-
* @public
|
|
585
|
-
* @deprecated Use {@link FrontendPlugin} instead.
|
|
586
|
-
*/
|
|
587
|
-
type BackstagePlugin<TRoutes extends AnyRoutes = AnyRoutes, TExternalRoutes extends AnyExternalRoutes = AnyExternalRoutes, TExtensionMap extends {
|
|
588
|
-
[id in string]: ExtensionDefinition;
|
|
589
|
-
} = {}> = FrontendPlugin<TRoutes, TExternalRoutes, TExtensionMap>;
|
|
590
562
|
/** @public */
|
|
591
563
|
interface PluginOptions<TId extends string, TRoutes extends AnyRoutes, TExternalRoutes extends AnyExternalRoutes, TExtensions extends readonly ExtensionDefinition[]> {
|
|
592
564
|
id: TId;
|
|
@@ -599,11 +571,6 @@ interface PluginOptions<TId extends string, TRoutes extends AnyRoutes, TExternal
|
|
|
599
571
|
declare function createFrontendPlugin<TId extends string, TRoutes extends AnyRoutes = {}, TExternalRoutes extends AnyExternalRoutes = {}, TExtensions extends readonly ExtensionDefinition[] = []>(options: PluginOptions<TId, TRoutes, TExternalRoutes, TExtensions>): FrontendPlugin<TRoutes, TExternalRoutes, {
|
|
600
572
|
[KExtension in TExtensions[number] as ResolveExtensionId<KExtension, TId>]: KExtension;
|
|
601
573
|
}>;
|
|
602
|
-
/**
|
|
603
|
-
* @public
|
|
604
|
-
* @deprecated Use {@link createFrontendPlugin} instead.
|
|
605
|
-
*/
|
|
606
|
-
declare const createPlugin: typeof createFrontendPlugin;
|
|
607
574
|
|
|
608
575
|
/** @public */
|
|
609
576
|
interface CreateFrontendModuleOptions<TPluginId extends string, TExtensions extends readonly ExtensionDefinition[]> {
|
|
@@ -619,24 +586,10 @@ interface FrontendModule {
|
|
|
619
586
|
/** @public */
|
|
620
587
|
declare function createFrontendModule<TId extends string, TExtensions extends readonly ExtensionDefinition[] = []>(options: CreateFrontendModuleOptions<TId, TExtensions>): FrontendModule;
|
|
621
588
|
|
|
622
|
-
/**
|
|
623
|
-
* @deprecated Use {@link createFrontendModule} instead.
|
|
624
|
-
* @public
|
|
625
|
-
*/
|
|
626
|
-
interface ExtensionOverridesOptions {
|
|
627
|
-
extensions: ExtensionDefinition[];
|
|
628
|
-
featureFlags?: FeatureFlagConfig[];
|
|
629
|
-
}
|
|
630
|
-
/**
|
|
631
|
-
* @deprecated Use {@link createFrontendModule} instead.
|
|
632
|
-
* @public
|
|
633
|
-
*/
|
|
634
|
-
declare function createExtensionOverrides(options: ExtensionOverridesOptions): ExtensionOverrides;
|
|
635
|
-
|
|
636
589
|
/**
|
|
637
590
|
* @public
|
|
638
591
|
*/
|
|
639
|
-
type CreateExtensionBlueprintOptions<TKind extends string,
|
|
592
|
+
type CreateExtensionBlueprintOptions<TKind extends string, TName extends string | undefined, TParams, UOutput extends AnyExtensionDataRef, TInputs extends {
|
|
640
593
|
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
|
|
641
594
|
optional: boolean;
|
|
642
595
|
singleton: boolean;
|
|
@@ -647,7 +600,6 @@ type CreateExtensionBlueprintOptions<TKind extends string, TNamespace extends st
|
|
|
647
600
|
[name in string]: AnyExtensionDataRef;
|
|
648
601
|
}> = {
|
|
649
602
|
kind: TKind;
|
|
650
|
-
namespace?: TNamespace;
|
|
651
603
|
attachTo: {
|
|
652
604
|
id: string;
|
|
653
605
|
input: string;
|
|
@@ -672,7 +624,6 @@ type CreateExtensionBlueprintOptions<TKind extends string, TNamespace extends st
|
|
|
672
624
|
/** @public */
|
|
673
625
|
type ExtensionBlueprintParameters = {
|
|
674
626
|
kind: string;
|
|
675
|
-
namespace?: string;
|
|
676
627
|
name?: string;
|
|
677
628
|
params?: object;
|
|
678
629
|
configInput?: {
|
|
@@ -697,8 +648,7 @@ type ExtensionBlueprintParameters = {
|
|
|
697
648
|
*/
|
|
698
649
|
interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionBlueprintParameters> {
|
|
699
650
|
dataRefs: T['dataRefs'];
|
|
700
|
-
make<
|
|
701
|
-
namespace?: undefined;
|
|
651
|
+
make<TNewName extends string | undefined>(args: {
|
|
702
652
|
name?: TNewName;
|
|
703
653
|
attachTo?: {
|
|
704
654
|
id: string;
|
|
@@ -708,31 +658,12 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
|
|
|
708
658
|
params: T['params'];
|
|
709
659
|
}): ExtensionDefinition<{
|
|
710
660
|
kind: T['kind'];
|
|
711
|
-
namespace: undefined;
|
|
712
661
|
name: string | undefined extends TNewName ? T['name'] : TNewName;
|
|
713
662
|
config: T['config'];
|
|
714
663
|
configInput: T['configInput'];
|
|
715
664
|
output: T['output'];
|
|
716
665
|
inputs: T['inputs'];
|
|
717
|
-
}>;
|
|
718
|
-
/** @deprecated namespace is no longer required, you can safely remove this option and it will default to the `pluginId`. It will be removed in a future release. */
|
|
719
|
-
make<TNewNamespace extends string | undefined, TNewName extends string | undefined>(args: {
|
|
720
|
-
namespace?: TNewNamespace;
|
|
721
|
-
name?: TNewName;
|
|
722
|
-
attachTo?: {
|
|
723
|
-
id: string;
|
|
724
|
-
input: string;
|
|
725
|
-
};
|
|
726
|
-
disabled?: boolean;
|
|
727
666
|
params: T['params'];
|
|
728
|
-
}): ExtensionDefinition<{
|
|
729
|
-
kind: T['kind'];
|
|
730
|
-
namespace: string | undefined extends TNewNamespace ? T['namespace'] : TNewNamespace;
|
|
731
|
-
name: string | undefined extends TNewName ? T['name'] : TNewName;
|
|
732
|
-
config: T['config'];
|
|
733
|
-
configInput: T['configInput'];
|
|
734
|
-
output: T['output'];
|
|
735
|
-
inputs: T['inputs'];
|
|
736
667
|
}>;
|
|
737
668
|
/**
|
|
738
669
|
* Creates a new extension from the blueprint.
|
|
@@ -740,7 +671,7 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
|
|
|
740
671
|
* You must either pass `params` directly, or define a `factory` that can
|
|
741
672
|
* optionally call the original factory with the same params.
|
|
742
673
|
*/
|
|
743
|
-
makeWithOverrides<
|
|
674
|
+
makeWithOverrides<TNewName extends string | undefined, TExtensionConfigSchema extends {
|
|
744
675
|
[key in string]: (zImpl: typeof z) => z.ZodType;
|
|
745
676
|
}, UFactoryOutput extends ExtensionDataValue<any, any>, UNewOutput extends AnyExtensionDataRef, TExtraInputs extends {
|
|
746
677
|
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
|
|
@@ -748,7 +679,6 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
|
|
|
748
679
|
singleton: boolean;
|
|
749
680
|
}>;
|
|
750
681
|
}>(args: {
|
|
751
|
-
namespace?: undefined;
|
|
752
682
|
name?: TNewName;
|
|
753
683
|
attachTo?: {
|
|
754
684
|
id: string;
|
|
@@ -785,57 +715,8 @@ interface ExtensionBlueprint<T extends ExtensionBlueprintParameters = ExtensionB
|
|
|
785
715
|
output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
|
|
786
716
|
inputs: T['inputs'] & TExtraInputs;
|
|
787
717
|
kind: T['kind'];
|
|
788
|
-
namespace: undefined;
|
|
789
|
-
name: string | undefined extends TNewName ? T['name'] : TNewName;
|
|
790
|
-
}>;
|
|
791
|
-
/** @deprecated namespace is no longer required, you can safely remove this option and it will default to the `pluginId`. It will be removed in a future release. */
|
|
792
|
-
makeWithOverrides<TNewNamespace extends string | undefined, TNewName extends string | undefined, TExtensionConfigSchema extends {
|
|
793
|
-
[key in string]: (zImpl: typeof z) => z.ZodType;
|
|
794
|
-
}, UFactoryOutput extends ExtensionDataValue<any, any>, UNewOutput extends AnyExtensionDataRef, TExtraInputs extends {
|
|
795
|
-
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
|
|
796
|
-
optional: boolean;
|
|
797
|
-
singleton: boolean;
|
|
798
|
-
}>;
|
|
799
|
-
}>(args: {
|
|
800
|
-
namespace: TNewNamespace;
|
|
801
|
-
name?: TNewName;
|
|
802
|
-
attachTo?: {
|
|
803
|
-
id: string;
|
|
804
|
-
input: string;
|
|
805
|
-
};
|
|
806
|
-
disabled?: boolean;
|
|
807
|
-
inputs?: TExtraInputs & {
|
|
808
|
-
[KName in keyof T['inputs']]?: `Error: Input '${KName & string}' is already defined in parent definition`;
|
|
809
|
-
};
|
|
810
|
-
output?: Array<UNewOutput>;
|
|
811
|
-
config?: {
|
|
812
|
-
schema: TExtensionConfigSchema & {
|
|
813
|
-
[KName in keyof T['config']]?: `Error: Config key '${KName & string}' is already defined in parent schema`;
|
|
814
|
-
};
|
|
815
|
-
};
|
|
816
|
-
factory(originalFactory: (params: T['params'], context?: {
|
|
817
|
-
config?: T['config'];
|
|
818
|
-
inputs?: ResolveInputValueOverrides<NonNullable<T['inputs']>>;
|
|
819
|
-
}) => ExtensionDataContainer<NonNullable<T['output']>>, context: {
|
|
820
|
-
node: AppNode;
|
|
821
|
-
apis: ApiHolder;
|
|
822
|
-
config: T['config'] & {
|
|
823
|
-
[key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
|
|
824
|
-
};
|
|
825
|
-
inputs: Expand<ResolvedExtensionInputs<T['inputs'] & TExtraInputs>>;
|
|
826
|
-
}): Iterable<UFactoryOutput> & VerifyExtensionFactoryOutput<AnyExtensionDataRef extends UNewOutput ? NonNullable<T['output']> : UNewOutput, UFactoryOutput>;
|
|
827
|
-
}): ExtensionDefinition<{
|
|
828
|
-
config: (string extends keyof TExtensionConfigSchema ? {} : {
|
|
829
|
-
[key in keyof TExtensionConfigSchema]: z.infer<ReturnType<TExtensionConfigSchema[key]>>;
|
|
830
|
-
}) & T['config'];
|
|
831
|
-
configInput: (string extends keyof TExtensionConfigSchema ? {} : z.input<z.ZodObject<{
|
|
832
|
-
[key in keyof TExtensionConfigSchema]: ReturnType<TExtensionConfigSchema[key]>;
|
|
833
|
-
}>>) & T['configInput'];
|
|
834
|
-
output: AnyExtensionDataRef extends UNewOutput ? T['output'] : UNewOutput;
|
|
835
|
-
inputs: T['inputs'] & TExtraInputs;
|
|
836
|
-
kind: T['kind'];
|
|
837
|
-
namespace: string | undefined extends TNewNamespace ? T['namespace'] : TNewNamespace;
|
|
838
718
|
name: string | undefined extends TNewName ? T['name'] : TNewName;
|
|
719
|
+
params: T['params'];
|
|
839
720
|
}>;
|
|
840
721
|
}
|
|
841
722
|
/**
|
|
@@ -851,39 +732,10 @@ declare function createExtensionBlueprint<TParams extends object, UOutput extend
|
|
|
851
732
|
}>;
|
|
852
733
|
}, TConfigSchema extends {
|
|
853
734
|
[key in string]: (zImpl: typeof z) => z.ZodType;
|
|
854
|
-
}, UFactoryOutput extends ExtensionDataValue<any, any>, TKind extends string,
|
|
855
|
-
[name in string]: AnyExtensionDataRef;
|
|
856
|
-
} = never>(options: CreateExtensionBlueprintOptions<TKind, undefined, TName, TParams, UOutput, TInputs, TConfigSchema, UFactoryOutput, TDataRefs>): ExtensionBlueprint<{
|
|
857
|
-
kind: TKind;
|
|
858
|
-
namespace: undefined;
|
|
859
|
-
name: TName;
|
|
860
|
-
params: TParams;
|
|
861
|
-
output: UOutput;
|
|
862
|
-
inputs: string extends keyof TInputs ? {} : TInputs;
|
|
863
|
-
config: string extends keyof TConfigSchema ? {} : {
|
|
864
|
-
[key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
|
|
865
|
-
};
|
|
866
|
-
configInput: string extends keyof TConfigSchema ? {} : z.input<z.ZodObject<{
|
|
867
|
-
[key in keyof TConfigSchema]: ReturnType<TConfigSchema[key]>;
|
|
868
|
-
}>>;
|
|
869
|
-
dataRefs: TDataRefs;
|
|
870
|
-
}>;
|
|
871
|
-
/**
|
|
872
|
-
* @public
|
|
873
|
-
* @deprecated the namespace is no longer required, you can safely remove this option and it will default to the `pluginId`. It will be removed in a future release.
|
|
874
|
-
*/
|
|
875
|
-
declare function createExtensionBlueprint<TParams extends object, UOutput extends AnyExtensionDataRef, TInputs extends {
|
|
876
|
-
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
|
|
877
|
-
optional: boolean;
|
|
878
|
-
singleton: boolean;
|
|
879
|
-
}>;
|
|
880
|
-
}, TConfigSchema extends {
|
|
881
|
-
[key in string]: (zImpl: typeof z) => z.ZodType;
|
|
882
|
-
}, UFactoryOutput extends ExtensionDataValue<any, any>, TKind extends string, TNamespace extends string | undefined = undefined, TName extends string | undefined = undefined, TDataRefs extends {
|
|
735
|
+
}, UFactoryOutput extends ExtensionDataValue<any, any>, TKind extends string, TName extends string | undefined = undefined, TDataRefs extends {
|
|
883
736
|
[name in string]: AnyExtensionDataRef;
|
|
884
|
-
} = never>(options: CreateExtensionBlueprintOptions<TKind,
|
|
737
|
+
} = never>(options: CreateExtensionBlueprintOptions<TKind, TName, TParams, UOutput, TInputs, TConfigSchema, UFactoryOutput, TDataRefs>): ExtensionBlueprint<{
|
|
885
738
|
kind: TKind;
|
|
886
|
-
namespace: TNamespace;
|
|
887
739
|
name: TName;
|
|
888
740
|
params: TParams;
|
|
889
741
|
output: UOutput;
|
|
@@ -915,7 +767,7 @@ interface AppNodeSpec {
|
|
|
915
767
|
readonly extension: Extension<unknown, unknown>;
|
|
916
768
|
readonly disabled: boolean;
|
|
917
769
|
readonly config?: unknown;
|
|
918
|
-
readonly source?:
|
|
770
|
+
readonly source?: FrontendPlugin;
|
|
919
771
|
}
|
|
920
772
|
/**
|
|
921
773
|
* The connections from this {@link AppNode} to other nodes.
|
|
@@ -1056,7 +908,7 @@ declare function useComponentRef<T extends {}>(ref: ComponentRef<T>): ComponentT
|
|
|
1056
908
|
*
|
|
1057
909
|
* @remarks
|
|
1058
910
|
*
|
|
1059
|
-
* The type is based on SvgIcon from Material UI, but
|
|
911
|
+
* The type is based on SvgIcon from Material UI, but we do not want the plugin-api
|
|
1060
912
|
* package to have a dependency on Material UI, nor do we want the props to be as broad
|
|
1061
913
|
* as the SvgIconProps interface.
|
|
1062
914
|
*
|
|
@@ -1067,8 +919,6 @@ declare function useComponentRef<T extends {}>(ref: ComponentRef<T>): ComponentT
|
|
|
1067
919
|
* @public
|
|
1068
920
|
*/
|
|
1069
921
|
type IconComponent = ComponentType<{
|
|
1070
|
-
fontSize?: 'large' | 'small' | 'default' | 'inherit';
|
|
1071
|
-
} | {
|
|
1072
922
|
fontSize?: 'medium' | 'large' | 'small' | 'inherit';
|
|
1073
923
|
}>;
|
|
1074
924
|
|
|
@@ -1238,7 +1088,6 @@ declare function useAnalytics(): AnalyticsTracker;
|
|
|
1238
1088
|
*/
|
|
1239
1089
|
declare const ApiBlueprint: ExtensionBlueprint<{
|
|
1240
1090
|
kind: "api";
|
|
1241
|
-
namespace: undefined;
|
|
1242
1091
|
name: undefined;
|
|
1243
1092
|
params: {
|
|
1244
1093
|
factory: AnyApiFactory;
|
|
@@ -1260,7 +1109,6 @@ declare const ApiBlueprint: ExtensionBlueprint<{
|
|
|
1260
1109
|
*/
|
|
1261
1110
|
declare const AppRootElementBlueprint: ExtensionBlueprint<{
|
|
1262
1111
|
kind: "app-root-element";
|
|
1263
|
-
namespace: undefined;
|
|
1264
1112
|
name: undefined;
|
|
1265
1113
|
params: {
|
|
1266
1114
|
element: JSX.Element | (() => JSX.Element);
|
|
@@ -1281,7 +1129,6 @@ declare const AppRootElementBlueprint: ExtensionBlueprint<{
|
|
|
1281
1129
|
*/
|
|
1282
1130
|
declare const AppRootWrapperBlueprint: ExtensionBlueprint<{
|
|
1283
1131
|
kind: "app-root-wrapper";
|
|
1284
|
-
namespace: undefined;
|
|
1285
1132
|
name: undefined;
|
|
1286
1133
|
params: {
|
|
1287
1134
|
Component: ComponentType<PropsWithChildren<{}>>;
|
|
@@ -1302,7 +1149,6 @@ declare const AppRootWrapperBlueprint: ExtensionBlueprint<{
|
|
|
1302
1149
|
/** @public */
|
|
1303
1150
|
declare const IconBundleBlueprint: ExtensionBlueprint<{
|
|
1304
1151
|
kind: "icon-bundle";
|
|
1305
|
-
namespace: undefined;
|
|
1306
1152
|
name: undefined;
|
|
1307
1153
|
params: {
|
|
1308
1154
|
icons: {
|
|
@@ -1329,7 +1175,6 @@ declare const IconBundleBlueprint: ExtensionBlueprint<{
|
|
|
1329
1175
|
*/
|
|
1330
1176
|
declare const NavItemBlueprint: ExtensionBlueprint<{
|
|
1331
1177
|
kind: "nav-item";
|
|
1332
|
-
namespace: undefined;
|
|
1333
1178
|
name: undefined;
|
|
1334
1179
|
params: {
|
|
1335
1180
|
title: string;
|
|
@@ -1360,7 +1205,6 @@ declare const NavItemBlueprint: ExtensionBlueprint<{
|
|
|
1360
1205
|
*/
|
|
1361
1206
|
declare const NavLogoBlueprint: ExtensionBlueprint<{
|
|
1362
1207
|
kind: "nav-logo";
|
|
1363
|
-
namespace: undefined;
|
|
1364
1208
|
name: undefined;
|
|
1365
1209
|
params: {
|
|
1366
1210
|
logoIcon: JSX.Element;
|
|
@@ -1388,7 +1232,6 @@ declare const NavLogoBlueprint: ExtensionBlueprint<{
|
|
|
1388
1232
|
*/
|
|
1389
1233
|
declare const PageBlueprint: ExtensionBlueprint<{
|
|
1390
1234
|
kind: "page";
|
|
1391
|
-
namespace: undefined;
|
|
1392
1235
|
name: undefined;
|
|
1393
1236
|
params: {
|
|
1394
1237
|
defaultPath: string;
|
|
@@ -1411,7 +1254,6 @@ declare const PageBlueprint: ExtensionBlueprint<{
|
|
|
1411
1254
|
/** @public */
|
|
1412
1255
|
declare const RouterBlueprint: ExtensionBlueprint<{
|
|
1413
1256
|
kind: "app-router-component";
|
|
1414
|
-
namespace: undefined;
|
|
1415
1257
|
name: undefined;
|
|
1416
1258
|
params: {
|
|
1417
1259
|
Component: ComponentType<PropsWithChildren<{}>>;
|
|
@@ -1436,7 +1278,6 @@ declare const RouterBlueprint: ExtensionBlueprint<{
|
|
|
1436
1278
|
*/
|
|
1437
1279
|
declare const SignInPageBlueprint: ExtensionBlueprint<{
|
|
1438
1280
|
kind: "sign-in-page";
|
|
1439
|
-
namespace: undefined;
|
|
1440
1281
|
name: undefined;
|
|
1441
1282
|
params: {
|
|
1442
1283
|
loader: () => Promise<ComponentType<SignInPageProps>>;
|
|
@@ -1457,7 +1298,6 @@ declare const SignInPageBlueprint: ExtensionBlueprint<{
|
|
|
1457
1298
|
*/
|
|
1458
1299
|
declare const ThemeBlueprint: ExtensionBlueprint<{
|
|
1459
1300
|
kind: "theme";
|
|
1460
|
-
namespace: undefined;
|
|
1461
1301
|
name: undefined;
|
|
1462
1302
|
params: {
|
|
1463
1303
|
theme: AppTheme;
|
|
@@ -1478,7 +1318,6 @@ declare const ThemeBlueprint: ExtensionBlueprint<{
|
|
|
1478
1318
|
*/
|
|
1479
1319
|
declare const TranslationBlueprint: ExtensionBlueprint<{
|
|
1480
1320
|
kind: "translation";
|
|
1481
|
-
namespace: undefined;
|
|
1482
1321
|
name: undefined;
|
|
1483
1322
|
params: {
|
|
1484
1323
|
resource: TranslationResource | TranslationMessages;
|
|
@@ -1519,8 +1358,8 @@ declare function createComponentExtension<TProps extends {}>(options: {
|
|
|
1519
1358
|
singleton: boolean;
|
|
1520
1359
|
}>;
|
|
1521
1360
|
};
|
|
1361
|
+
params: never;
|
|
1522
1362
|
kind: "component";
|
|
1523
|
-
namespace: undefined;
|
|
1524
1363
|
name: string;
|
|
1525
1364
|
}>;
|
|
1526
1365
|
/** @public */
|
|
@@ -1531,4 +1370,4 @@ declare namespace createComponentExtension {
|
|
|
1531
1370
|
}, "core.component.component", {}>;
|
|
1532
1371
|
}
|
|
1533
1372
|
|
|
1534
|
-
export { type AnalyticsApi, AnalyticsContext, type AnalyticsContextValue, type AnalyticsEvent, type AnalyticsEventAttributes, type AnalyticsTracker, type AnyExtensionDataRef, type AnyExternalRoutes, type AnyRouteRefParams, type AnyRoutes, ApiBlueprint, type AppNode, type AppNodeEdges, type AppNodeInstance, type AppNodeSpec, AppRootElementBlueprint, AppRootWrapperBlueprint, type AppTree, type AppTreeApi, type
|
|
1373
|
+
export { type AnalyticsApi, AnalyticsContext, type AnalyticsContextValue, type AnalyticsEvent, type AnalyticsEventAttributes, type AnalyticsTracker, type AnyExtensionDataRef, type AnyExternalRoutes, type AnyRouteRefParams, type AnyRoutes, ApiBlueprint, type AppNode, type AppNodeEdges, type AppNodeInstance, type AppNodeSpec, AppRootElementBlueprint, AppRootWrapperBlueprint, type AppTree, type AppTreeApi, type CommonAnalyticsContext, type ComponentRef, type ComponentsApi, type ConfigurableExtensionDataRef, type CoreErrorBoundaryFallbackProps, type CoreNotFoundErrorPageProps, type CoreProgressProps, type CreateExtensionBlueprintOptions, type CreateExtensionOptions, type CreateFrontendModuleOptions, type Extension, type ExtensionBlueprint, type ExtensionBlueprintParameters, ExtensionBoundary, type ExtensionBoundaryProps, type ExtensionDataContainer, type ExtensionDataRef, type ExtensionDataRefToValue, type ExtensionDataValue, type ExtensionDefinition, type ExtensionDefinitionParameters, type ExtensionInput, type ExtensionOverrides, type ExternalRouteRef, type FeatureFlagConfig, type FrontendFeature, type FrontendModule, type FrontendPlugin, IconBundleBlueprint, type IconComponent, type IconsApi, NavItemBlueprint, NavLogoBlueprint, PageBlueprint, type PluginOptions, type PortableSchema, type ResolveInputValueOverrides, type ResolvedExtensionInput, type ResolvedExtensionInputs, type RouteFunc, type RouteRef, type RouteResolutionApi, type RouteResolutionApiResolveOptions, RouterBlueprint, SignInPageBlueprint, type SubRouteRef, ThemeBlueprint, TranslationBlueprint, analyticsApiRef, appTreeApiRef, componentsApiRef, coreComponentRefs, coreExtensionData, createComponentExtension, createComponentRef, createExtension, createExtensionBlueprint, createExtensionDataRef, createExtensionInput, createExternalRouteRef, createFrontendModule, createFrontendPlugin, createRouteRef, createSubRouteRef, iconsApiRef, routeResolutionApiRef, useAnalytics, useComponentRef, useRouteRef, useRouteRefParams };
|