@backstage/frontend-plugin-api 0.14.2-next.0 → 0.15.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 +144 -0
- package/dist/alpha.d.ts +6 -71
- package/dist/alpha.esm.js +4 -0
- package/dist/alpha.esm.js.map +1 -1
- package/dist/analytics/useAnalytics.esm.js +2 -0
- package/dist/analytics/useAnalytics.esm.js.map +1 -1
- package/dist/apis/definitions/AlertApi.esm.js +3 -2
- package/dist/apis/definitions/AlertApi.esm.js.map +1 -1
- package/dist/apis/definitions/AnalyticsApi.esm.js +3 -2
- package/dist/apis/definitions/AnalyticsApi.esm.js.map +1 -1
- package/dist/apis/definitions/AppLanguageApi.esm.js +3 -2
- package/dist/apis/definitions/AppLanguageApi.esm.js.map +1 -1
- package/dist/apis/definitions/AppThemeApi.esm.js +3 -2
- package/dist/apis/definitions/AppThemeApi.esm.js.map +1 -1
- package/dist/apis/definitions/AppTreeApi.esm.js +4 -1
- package/dist/apis/definitions/AppTreeApi.esm.js.map +1 -1
- package/dist/apis/definitions/ConfigApi.esm.js +3 -2
- package/dist/apis/definitions/ConfigApi.esm.js.map +1 -1
- package/dist/apis/definitions/DialogApi.esm.js +3 -2
- package/dist/apis/definitions/DialogApi.esm.js.map +1 -1
- package/dist/apis/definitions/DiscoveryApi.esm.js +3 -2
- package/dist/apis/definitions/DiscoveryApi.esm.js.map +1 -1
- package/dist/apis/definitions/ErrorApi.esm.js +3 -2
- package/dist/apis/definitions/ErrorApi.esm.js.map +1 -1
- package/dist/apis/definitions/FeatureFlagsApi.esm.js +3 -2
- package/dist/apis/definitions/FeatureFlagsApi.esm.js.map +1 -1
- package/dist/apis/definitions/FetchApi.esm.js +3 -2
- package/dist/apis/definitions/FetchApi.esm.js.map +1 -1
- package/dist/apis/definitions/IconsApi.esm.js +3 -2
- package/dist/apis/definitions/IconsApi.esm.js.map +1 -1
- package/dist/apis/definitions/IdentityApi.esm.js +3 -2
- package/dist/apis/definitions/IdentityApi.esm.js.map +1 -1
- package/dist/apis/definitions/OAuthRequestApi.esm.js +3 -2
- package/dist/apis/definitions/OAuthRequestApi.esm.js.map +1 -1
- package/dist/apis/definitions/PluginHeaderActionsApi.esm.js +3 -2
- package/dist/apis/definitions/PluginHeaderActionsApi.esm.js.map +1 -1
- package/dist/apis/definitions/PluginWrapperApi.esm.js +7 -3
- package/dist/apis/definitions/PluginWrapperApi.esm.js.map +1 -1
- package/dist/apis/definitions/RouteResolutionApi.esm.js +3 -2
- package/dist/apis/definitions/RouteResolutionApi.esm.js.map +1 -1
- package/dist/apis/definitions/StorageApi.esm.js +3 -2
- package/dist/apis/definitions/StorageApi.esm.js.map +1 -1
- package/dist/apis/definitions/SwappableComponentsApi.esm.js +3 -2
- package/dist/apis/definitions/SwappableComponentsApi.esm.js.map +1 -1
- package/dist/apis/definitions/ToastApi.esm.js +11 -0
- package/dist/apis/definitions/ToastApi.esm.js.map +1 -0
- package/dist/apis/definitions/TranslationApi.esm.js +3 -2
- package/dist/apis/definitions/TranslationApi.esm.js.map +1 -1
- package/dist/apis/definitions/auth.esm.js +33 -22
- package/dist/apis/definitions/auth.esm.js.map +1 -1
- package/dist/apis/system/ApiRef.esm.js +28 -20
- package/dist/apis/system/ApiRef.esm.js.map +1 -1
- package/dist/apis/system/useApi.esm.js +2 -1
- package/dist/apis/system/useApi.esm.js.map +1 -1
- package/dist/blueprints/AnalyticsImplementationBlueprint.esm.js +1 -1
- package/dist/blueprints/AnalyticsImplementationBlueprint.esm.js.map +1 -1
- package/dist/blueprints/ApiBlueprint.esm.js +1 -1
- package/dist/blueprints/AppRootElementBlueprint.esm.js +1 -1
- package/dist/blueprints/NavItemBlueprint.esm.js +1 -1
- package/dist/blueprints/NavItemBlueprint.esm.js.map +1 -1
- package/dist/blueprints/PageBlueprint.esm.js +17 -6
- package/dist/blueprints/PageBlueprint.esm.js.map +1 -1
- package/dist/blueprints/PluginHeaderActionBlueprint.esm.js +3 -1
- package/dist/blueprints/PluginHeaderActionBlueprint.esm.js.map +1 -1
- package/dist/blueprints/PluginWrapperBlueprint.esm.js +4 -2
- package/dist/blueprints/PluginWrapperBlueprint.esm.js.map +1 -1
- package/dist/blueprints/SubPageBlueprint.esm.js +3 -1
- package/dist/blueprints/SubPageBlueprint.esm.js.map +1 -1
- package/dist/components/ExtensionBoundary.esm.js +3 -2
- package/dist/components/ExtensionBoundary.esm.js.map +1 -1
- package/dist/components/PageLayout.esm.js.map +1 -1
- package/dist/components/createSwappableComponent.esm.js +2 -0
- package/dist/components/createSwappableComponent.esm.js.map +1 -1
- package/dist/frontend-internal/src/apis/OpaqueApiRef.esm.js +9 -0
- package/dist/frontend-internal/src/apis/OpaqueApiRef.esm.js.map +1 -0
- package/dist/frontend-internal/src/wiring/InternalExtensionDefinition.esm.js.map +1 -1
- package/dist/frontend-internal/src/wiring/InternalFrontendPlugin.esm.js.map +1 -1
- package/dist/index.d.ts +380 -1457
- package/dist/index.esm.js +3 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/routing/useRouteRef.esm.js +2 -0
- package/dist/routing/useRouteRef.esm.js.map +1 -1
- package/dist/schema/createSchemaFromZod.esm.js +1 -1
- package/dist/schema/createSchemaFromZod.esm.js.map +1 -1
- package/dist/translation/useTranslationRef.esm.js +2 -0
- package/dist/translation/useTranslationRef.esm.js.map +1 -1
- package/dist/types/alpha.d-DzeiOzxk.d.ts +1425 -0
- package/dist/wiring/createExtension.esm.js +6 -0
- package/dist/wiring/createExtension.esm.js.map +1 -1
- package/dist/wiring/createExtensionBlueprint.esm.js +2 -0
- package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
- package/dist/wiring/createExtensionDataRef.esm.js.map +1 -1
- package/dist/wiring/createFrontendModule.esm.js +1 -0
- package/dist/wiring/createFrontendModule.esm.js.map +1 -1
- package/dist/wiring/createFrontendPlugin.esm.js +6 -0
- package/dist/wiring/createFrontendPlugin.esm.js.map +1 -1
- package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
- package/dist/wiring/resolveInputOverrides.esm.js.map +1 -1
- package/package.json +11 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,149 @@
|
|
|
1
1
|
# @backstage/frontend-plugin-api
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5fd78ba: Renamed `PluginOptions` to `CreateFrontendPluginOptions` and deprecated the old name. Removed `ResolvedExtensionInputs` from the main entry point; it is still available as an inline type in extension factory signatures.
|
|
8
|
+
- 72991a5: Removed the `ResolvedExtensionInput` and `ExtensionDataRefToValue` helper types from the public API surface to reduce top-level API clutter. These types were internal plumbing that are not needed by plugin authors. If you were relying on `ResolvedExtensionInput`, use the `ResolvedExtensionInputs` type instead, which maps a full set of inputs. If you were using `ExtensionDataRefToValue`, replace it with `ExtensionDataValue` combined with inferred types from your `ExtensionDataRef`.
|
|
9
|
+
- 9508514: **BREAKING**: Promoted `PluginWrapperApi`, `pluginWrapperApiRef`, `PluginWrapperBlueprint`, and the new `PluginWrapperDefinition` type from `@alpha` to `@public`. These are now available from the main package entry point rather than only through `/alpha`.
|
|
10
|
+
|
|
11
|
+
The `PluginWrapperApi` type now has a required `getRootWrapper()` method that returns a root wrapper component. The `pluginWrapperApiRef` ID changed from `core.plugin-wrapper.alpha` to `core.plugin-wrapper`.
|
|
12
|
+
|
|
13
|
+
The `PluginWrapperBlueprint` now accepts `PluginWrapperDefinition` as the loader return type, which supports an optional `useWrapperValue` hook that allows sharing state between wrapper instances.
|
|
14
|
+
|
|
15
|
+
- 6573901: **BREAKING**: Removed the deprecated `AnyExtensionDataRef` type. Use `ExtensionDataRef` without type parameters instead.
|
|
16
|
+
- a9440f0: **BREAKING**: Simplified the `ExtensionAttachTo` type to only support a single attachment target. The array form for attaching to multiple extension points has been removed. Also removed the deprecated `ExtensionAttachToSpec` type alias.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- e26e3de: The `icon` field on `AuthProviderInfo` now accepts `IconElement` in addition to `IconComponent`, letting you pass `<MyIcon />` instead of `MyIcon`.
|
|
21
|
+
- eea95b8: Deprecated `AlertApi` in favor of the new `ToastApi`.
|
|
22
|
+
|
|
23
|
+
`AlertApi` is now deprecated and will be removed in a future release. Please migrate to `ToastApi` which provides richer notification features.
|
|
24
|
+
|
|
25
|
+
**Why migrate?**
|
|
26
|
+
|
|
27
|
+
`ToastApi` offers enhanced capabilities over `AlertApi`:
|
|
28
|
+
|
|
29
|
+
- **Title and Description**: Display a prominent title with optional description text
|
|
30
|
+
- **Action Links**: Include clickable links within notifications
|
|
31
|
+
- **Status Variants**: Support for neutral, info, success, warning, and danger statuses
|
|
32
|
+
- **Per-toast Timeout**: Control auto-dismiss timing for each notification individually
|
|
33
|
+
- **Programmatic Dismiss**: Close notifications via the `close()` handle returned from `post()`
|
|
34
|
+
|
|
35
|
+
**Migration Guide**
|
|
36
|
+
|
|
37
|
+
| AlertApi | ToastApi |
|
|
38
|
+
| -------------------------------------------- | ------------------------------------------ |
|
|
39
|
+
| `message: string` | `title: ReactNode` |
|
|
40
|
+
| `severity: 'error'` | `status: 'danger'` |
|
|
41
|
+
| `severity: 'success' \| 'info' \| 'warning'` | `status: 'success' \| 'info' \| 'warning'` |
|
|
42
|
+
| `display: 'transient'` | `timeout: 5000` (or custom ms) |
|
|
43
|
+
| `display: 'permanent'` | omit `timeout` |
|
|
44
|
+
| `post()` returns `void` | `post()` returns `{ close(): void }` |
|
|
45
|
+
|
|
46
|
+
**Example Migration**
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// Before (AlertApi)
|
|
50
|
+
import { alertApiRef, useApi } from '@backstage/core-plugin-api';
|
|
51
|
+
|
|
52
|
+
const alertApi = useApi(alertApiRef);
|
|
53
|
+
alertApi.post({
|
|
54
|
+
message: 'Entity saved successfully',
|
|
55
|
+
severity: 'success',
|
|
56
|
+
display: 'transient',
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// After (ToastApi)
|
|
60
|
+
import { toastApiRef, useApi } from '@backstage/frontend-plugin-api';
|
|
61
|
+
|
|
62
|
+
const toastApi = useApi(toastApiRef);
|
|
63
|
+
const toast = toastApi.post({
|
|
64
|
+
title: 'Entity saved successfully',
|
|
65
|
+
status: 'success',
|
|
66
|
+
timeout: 5000,
|
|
67
|
+
});
|
|
68
|
+
// Later: toast.close() to dismiss programmatically
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Note**: During the migration period, both APIs work simultaneously. The `ToastDisplay` component subscribes to both `AlertApi` and `ToastApi`, so existing code continues to work while you migrate incrementally.
|
|
72
|
+
|
|
73
|
+
- 8a3a906: Deprecated `NavItemBlueprint`. Nav items are now automatically inferred from `PageBlueprint` extensions based on their `title` and `icon` params.
|
|
74
|
+
- b15a685: Deprecated `withApis`, use the `withApis` export from `@backstage/core-compat-api` instead.
|
|
75
|
+
- 0452d02: Add optional `description` field to plugin-level feature flags.
|
|
76
|
+
- 1bec049: Fixed inconsistent `JSX.Element` type reference in the `DialogApiDialog.update` method signature.
|
|
77
|
+
- 9c81af9: Made the `pluginId` property optional in the `FrontendFeature` type, allowing plugins published against older versions of the framework to be used without type errors.
|
|
78
|
+
- 2c383b5: Deprecated `AnalyticsImplementationBlueprint` and `AnalyticsImplementationFactory` in favor of the exports from `@backstage/plugin-app-react`.
|
|
79
|
+
- dab6c46: Deprecated the `ExtensionFactoryMiddleware` type, which has been moved to `@backstage/frontend-app-api`.
|
|
80
|
+
- aa29b50: Pages created with `PageBlueprint` now render the plugin header by default in the new frontend system.
|
|
81
|
+
- 3f36ce1: Clarified the `IconElement` sizing contract for the new frontend system and aligned legacy system icon rendering with the new icon API.
|
|
82
|
+
- cc459f7: Added a builder form for `createApiRef` in the new frontend system and deprecated the direct `createApiRef({ ... })` call in favor of `createApiRef().with({ ... })`. The builder form now also preserves literal API ref IDs in the resulting `ApiRef` type.
|
|
83
|
+
|
|
84
|
+
The `createApiRef().with({ ... })` form can also use an explicit `pluginId` to declare API ownership without encoding the plugin ID into the API ref ID, while keeping that metadata internal to runtime handling.
|
|
85
|
+
|
|
86
|
+
- 5b160f9: Added support for `if` predicates on `createFrontendPlugin` and `createFrontendModule`, applying shared conditions to every extension in the feature. Plugin and extension overrides can now also replace or remove existing `if` predicates.
|
|
87
|
+
- d0206c4: Removed the deprecated `defaultPath` migration helper from `PageBlueprint` params.
|
|
88
|
+
- edb872c: Renamed the `PageTab` type to `PageLayoutTab`. The old `PageTab` name is now a deprecated type alias.
|
|
89
|
+
- a49a40d: Updated dependency `zod` to `^3.25.76 || ^4.0.0` & migrated to `/v3` or `/v4` imports.
|
|
90
|
+
- 7e743f4: Introduced a new `ToastApi` for displaying rich toast notifications in the new frontend system.
|
|
91
|
+
|
|
92
|
+
The new `ToastApi` provides enhanced notification capabilities compared to the existing `AlertApi`:
|
|
93
|
+
|
|
94
|
+
- **Title and Description**: Toasts support both a title and an optional description
|
|
95
|
+
- **Custom Timeouts**: Each toast can specify its own timeout duration
|
|
96
|
+
- **Links**: Toasts can include action links
|
|
97
|
+
- **Status Variants**: Support for neutral, info, success, warning, and danger statuses
|
|
98
|
+
- **Programmatic Dismiss**: Toasts can be dismissed programmatically using the `close()` handle returned from `post()`
|
|
99
|
+
|
|
100
|
+
**Usage:**
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { toastApiRef, useApi } from '@backstage/frontend-plugin-api';
|
|
104
|
+
|
|
105
|
+
const toastApi = useApi(toastApiRef);
|
|
106
|
+
|
|
107
|
+
// Full-featured toast
|
|
108
|
+
toastApi.post({
|
|
109
|
+
title: 'Entity saved',
|
|
110
|
+
description: 'Your changes have been saved successfully.',
|
|
111
|
+
status: 'success',
|
|
112
|
+
timeout: 5000,
|
|
113
|
+
links: [{ label: 'View entity', href: '/catalog/entity' }],
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Programmatic dismiss
|
|
117
|
+
const { close } = toastApi.post({ title: 'Uploading...', status: 'info' });
|
|
118
|
+
// Later...
|
|
119
|
+
close();
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The `ToastDisplay` component subscribes to both `ToastApi` and `AlertApi`, providing a migration path where both systems work side by side until `AlertApi` is fully deprecated.
|
|
123
|
+
|
|
124
|
+
- fe848e0: Changed `useApiHolder` to return an empty `ApiHolder` instead of throwing when used outside of an API context.
|
|
125
|
+
- Updated dependencies
|
|
126
|
+
- @backstage/filter-predicates@0.1.1
|
|
127
|
+
|
|
128
|
+
## 0.15.0-next.1
|
|
129
|
+
|
|
130
|
+
### Minor Changes
|
|
131
|
+
|
|
132
|
+
- 6573901: **BREAKING**: Removed the deprecated `AnyExtensionDataRef` type. Use `ExtensionDataRef` without type parameters instead.
|
|
133
|
+
- a9440f0: **BREAKING**: Simplified the `ExtensionAttachTo` type to only support a single attachment target. The array form for attaching to multiple extension points has been removed. Also removed the deprecated `ExtensionAttachToSpec` type alias.
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- 8a3a906: Deprecated `NavItemBlueprint`. Nav items are now automatically inferred from `PageBlueprint` extensions based on their `title` and `icon` params.
|
|
138
|
+
- b15a685: Deprecated `withApis`, use the `withApis` export from `@backstage/core-compat-api` instead.
|
|
139
|
+
- 0452d02: Add optional `description` field to plugin-level feature flags.
|
|
140
|
+
- 1bec049: Fixed inconsistent `JSX.Element` type reference in the `DialogApiDialog.update` method signature.
|
|
141
|
+
- 2c383b5: Deprecated `AnalyticsImplementationBlueprint` and `AnalyticsImplementationFactory` in favor of the exports from `@backstage/plugin-app-react`.
|
|
142
|
+
- dab6c46: Deprecated the `ExtensionFactoryMiddleware` type, which has been moved to `@backstage/frontend-app-api`.
|
|
143
|
+
- d0206c4: Removed the deprecated `defaultPath` migration helper from `PageBlueprint` params.
|
|
144
|
+
- edb872c: Renamed the `PageTab` type to `PageLayoutTab`. The old `PageTab` name is now a deprecated type alias.
|
|
145
|
+
- fe848e0: Changed `useApiHolder` to return an empty `ApiHolder` instead of throwing when used outside of an API context.
|
|
146
|
+
|
|
3
147
|
## 0.14.2-next.0
|
|
4
148
|
|
|
5
149
|
### Patch Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,71 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* @alpha
|
|
8
|
-
*/
|
|
9
|
-
declare const PluginWrapperBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
|
|
10
|
-
kind: "plugin-wrapper";
|
|
11
|
-
params: (params: {
|
|
12
|
-
loader: () => Promise<{
|
|
13
|
-
component: ComponentType<{
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}>;
|
|
16
|
-
}>;
|
|
17
|
-
}) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<{
|
|
18
|
-
loader: () => Promise<{
|
|
19
|
-
component: ComponentType<{
|
|
20
|
-
children: ReactNode;
|
|
21
|
-
}>;
|
|
22
|
-
}>;
|
|
23
|
-
}>;
|
|
24
|
-
output: _backstage_frontend_plugin_api.ExtensionDataRef<() => Promise<{
|
|
25
|
-
component: ComponentType<{
|
|
26
|
-
children: ReactNode;
|
|
27
|
-
}>;
|
|
28
|
-
}>, "core.plugin-wrapper.loader", {}>;
|
|
29
|
-
inputs: {};
|
|
30
|
-
config: {};
|
|
31
|
-
configInput: {};
|
|
32
|
-
dataRefs: {
|
|
33
|
-
wrapper: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<() => Promise<{
|
|
34
|
-
component: ComponentType<{
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
}>;
|
|
37
|
-
}>, "core.plugin-wrapper.loader", {}>;
|
|
38
|
-
};
|
|
39
|
-
}>;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The Plugin Wrapper API is used to wrap plugin extensions with providers,
|
|
43
|
-
* plugins should generally use `ExtensionBoundary` instead.
|
|
44
|
-
*
|
|
45
|
-
* @remarks
|
|
46
|
-
*
|
|
47
|
-
* This API is primarily intended for internal use by the Backstage frontend
|
|
48
|
-
* system, but can be used for advanced use-cases. If you do override it, be
|
|
49
|
-
* sure to include the default implementation as well.
|
|
50
|
-
*
|
|
51
|
-
* @alpha
|
|
52
|
-
*/
|
|
53
|
-
type PluginWrapperApi = {
|
|
54
|
-
/**
|
|
55
|
-
* Returns a wrapper component for a specific plugin, or undefined if no
|
|
56
|
-
* wrappers exist. Do not use this API directly, instead use
|
|
57
|
-
* `ExtensionBoundary` to wrap your plugin components if needed.
|
|
58
|
-
*/
|
|
59
|
-
getPluginWrapper(pluginId: string): ComponentType<{
|
|
60
|
-
children: ReactNode;
|
|
61
|
-
}> | undefined;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* The API reference of {@link PluginWrapperApi}.
|
|
65
|
-
*
|
|
66
|
-
* @alpha
|
|
67
|
-
*/
|
|
68
|
-
declare const pluginWrapperApiRef: _backstage_frontend_plugin_api.ApiRef<PluginWrapperApi>;
|
|
69
|
-
|
|
70
|
-
export { PluginWrapperBlueprint, pluginWrapperApiRef };
|
|
71
|
-
export type { PluginWrapperApi };
|
|
1
|
+
export { A as AnyRouteRefParams, e as ApiHolder, d as ApiRef, b as AppNode, i as AppNodeEdges, j as AppNodeInstance, k as AppNodeSpec, l as AppTree, J as ConfigurableExtensionDataRef, Y as Extension, Z as ExtensionAttachTo, a2 as ExtensionBlueprint, a5 as ExtensionBlueprintDefineParams, a3 as ExtensionBlueprintParameters, a4 as ExtensionBlueprintParams, _ as ExtensionDataContainer, G as ExtensionDataRef, H as ExtensionDataValue, w as ExtensionDefinition, x as ExtensionDefinitionAttachTo, y as ExtensionDefinitionParameters, B as ExtensionInput, E as ExternalRouteRef, c as FrontendPlugin, Q as FrontendPluginInfo, I as IconElement, O as OverridableExtensionDefinition, P as PluginWrapperApi, o as PluginWrapperBlueprint, q as PluginWrapperDefinition, u as PortableSchema, R as RouteRef, S as SubRouteRef, a7 as createExtensionBlueprintParams, p as pluginWrapperApiRef } from './types/alpha.d-DzeiOzxk.js';
|
|
2
|
+
import '@backstage/frontend-plugin-api';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@backstage/types';
|
|
5
|
+
import '@backstage/filter-predicates';
|
|
6
|
+
import 'zod/v3';
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { PluginWrapperBlueprint } from './blueprints/PluginWrapperBlueprint.esm.js';
|
|
2
|
+
import './wiring/coreExtensionData.esm.js';
|
|
3
|
+
import 'zod/v3';
|
|
4
|
+
import 'zod-to-json-schema';
|
|
5
|
+
export { createExtensionBlueprintParams } from './wiring/createExtensionBlueprint.esm.js';
|
|
2
6
|
export { pluginWrapperApiRef } from './apis/definitions/PluginWrapperApi.esm.js';
|
|
3
7
|
//# sourceMappingURL=alpha.esm.js.map
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -18,8 +18,10 @@ import '../apis/definitions/OAuthRequestApi.esm.js';
|
|
|
18
18
|
import '../apis/definitions/RouteResolutionApi.esm.js';
|
|
19
19
|
import '../apis/definitions/StorageApi.esm.js';
|
|
20
20
|
import { analyticsApiRef } from '../apis/definitions/AnalyticsApi.esm.js';
|
|
21
|
+
import '../apis/definitions/ToastApi.esm.js';
|
|
21
22
|
import '../apis/definitions/TranslationApi.esm.js';
|
|
22
23
|
import '../apis/definitions/PluginHeaderActionsApi.esm.js';
|
|
24
|
+
import '../apis/definitions/PluginWrapperApi.esm.js';
|
|
23
25
|
import { useRef } from 'react';
|
|
24
26
|
import { Tracker } from './Tracker.esm.js';
|
|
25
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnalytics.esm.js","sources":["../../src/analytics/useAnalytics.tsx"],"sourcesContent":["/*\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 { useApi } from '../apis/system';\nimport { useAnalyticsContext } from './AnalyticsContext';\nimport { analyticsApiRef, AnalyticsTracker, AnalyticsApi } from '../apis';\nimport { useRef } from 'react';\nimport { Tracker } from './Tracker';\n\nfunction useAnalyticsApi(): AnalyticsApi {\n try {\n return useApi(analyticsApiRef);\n } catch (error) {\n if (error.name === 'NotImplementedError') {\n return { captureEvent: () => {} };\n }\n throw error;\n }\n}\n\n/**\n * Gets a pre-configured analytics tracker.\n *\n * @public\n */\nexport function useAnalytics(): AnalyticsTracker {\n const trackerRef = useRef<Tracker | null>(null);\n const context = useAnalyticsContext();\n // Our goal is to make this API truly optional for any/all consuming code\n // (including tests). This hook runs last to ensure hook order is, as much as\n // possible, maintained.\n const analyticsApi = useAnalyticsApi();\n\n function getTracker(): Tracker {\n if (trackerRef.current === null) {\n trackerRef.current = new Tracker(analyticsApi);\n }\n return trackerRef.current;\n }\n\n const tracker = getTracker();\n // this is not ideal, but it allows to memoize the tracker\n // without explicitly set the context as dependency.\n tracker.setContext(context);\n\n return tracker;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAnalytics.esm.js","sources":["../../src/analytics/useAnalytics.tsx"],"sourcesContent":["/*\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 { useApi } from '../apis/system';\nimport { useAnalyticsContext } from './AnalyticsContext';\nimport { analyticsApiRef, AnalyticsTracker, AnalyticsApi } from '../apis';\nimport { useRef } from 'react';\nimport { Tracker } from './Tracker';\n\nfunction useAnalyticsApi(): AnalyticsApi {\n try {\n return useApi(analyticsApiRef);\n } catch (error) {\n if (error.name === 'NotImplementedError') {\n return { captureEvent: () => {} };\n }\n throw error;\n }\n}\n\n/**\n * Gets a pre-configured analytics tracker.\n *\n * @public\n */\nexport function useAnalytics(): AnalyticsTracker {\n const trackerRef = useRef<Tracker | null>(null);\n const context = useAnalyticsContext();\n // Our goal is to make this API truly optional for any/all consuming code\n // (including tests). This hook runs last to ensure hook order is, as much as\n // possible, maintained.\n const analyticsApi = useAnalyticsApi();\n\n function getTracker(): Tracker {\n if (trackerRef.current === null) {\n trackerRef.current = new Tracker(analyticsApi);\n }\n return trackerRef.current;\n }\n\n const tracker = getTracker();\n // this is not ideal, but it allows to memoize the tracker\n // without explicitly set the context as dependency.\n tracker.setContext(context);\n\n return tracker;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,eAAA,GAAgC;AACvC,EAAA,IAAI;AACF,IAAA,OAAO,OAAO,eAAe,CAAA;AAAA,EAC/B,SAAS,KAAA,EAAO;AACd,IAAA,IAAI,KAAA,CAAM,SAAS,qBAAA,EAAuB;AACxC,MAAA,OAAO,EAAE,cAAc,MAAM;AAAA,MAAC,CAAA,EAAE;AAAA,IAClC;AACA,IAAA,MAAM,KAAA;AAAA,EACR;AACF;AAOO,SAAS,YAAA,GAAiC;AAC/C,EAAA,MAAM,UAAA,GAAa,OAAuB,IAAI,CAAA;AAC9C,EAAA,MAAM,UAAU,mBAAA,EAAoB;AAIpC,EAAA,MAAM,eAAe,eAAA,EAAgB;AAErC,EAAA,SAAS,UAAA,GAAsB;AAC7B,IAAA,IAAI,UAAA,CAAW,YAAY,IAAA,EAAM;AAC/B,MAAA,UAAA,CAAW,OAAA,GAAU,IAAI,OAAA,CAAQ,YAAY,CAAA;AAAA,IAC/C;AACA,IAAA,OAAO,UAAA,CAAW,OAAA;AAAA,EACpB;AAEA,EAAA,MAAM,UAAU,UAAA,EAAW;AAG3B,EAAA,OAAA,CAAQ,WAAW,OAAO,CAAA;AAE1B,EAAA,OAAO,OAAA;AACT;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const alertApiRef = createApiRef({
|
|
7
|
-
id: "core.alert"
|
|
6
|
+
const alertApiRef = createApiRef().with({
|
|
7
|
+
id: "core.alert",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { alertApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertApi.esm.js","sources":["../../../src/apis/definitions/AlertApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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
|
|
1
|
+
{"version":3,"file":"AlertApi.esm.js","sources":["../../../src/apis/definitions/AlertApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 '../system';\nimport { Observable } from '@backstage/types';\n\n/**\n * Message handled by the {@link AlertApi}.\n *\n * @public\n * @deprecated Use {@link ToastApiMessage} from {@link ToastApi} instead. AlertApi will be removed in a future release.\n *\n * Migration guide:\n * - `message` becomes `title`\n * - `severity: 'error'` becomes `status: 'danger'`\n * - `severity: 'success' | 'info' | 'warning'` becomes `status: 'success' | 'info' | 'warning'`\n * - `display: 'transient'` becomes `timeout: 5000` (or custom milliseconds)\n * - `display: 'permanent'` means omitting `timeout`\n */\nexport type AlertMessage = {\n message: string;\n // Severity will default to success since that is what material ui defaults the value to.\n severity?: 'success' | 'info' | 'warning' | 'error';\n display?: 'permanent' | 'transient';\n};\n\n/**\n * The alert API is used to report alerts to the app, and display them to the user.\n *\n * @public\n * @deprecated Use {@link ToastApi} instead. AlertApi will be removed in a future release.\n *\n * ToastApi provides richer notification features including:\n * - Title and optional description\n * - Action links\n * - Custom icons\n * - Per-toast timeout control\n * - Programmatic dismiss via returned key\n *\n * @example\n * ```typescript\n * // Before (AlertApi)\n * alertApi.post({ message: 'Saved!', severity: 'success', display: 'transient' });\n *\n * // After (ToastApi)\n * toastApi.post({ title: 'Saved!', status: 'success', timeout: 5000 });\n * ```\n */\nexport type AlertApi = {\n /**\n * Post an alert for handling by the application.\n */\n post(alert: AlertMessage): void;\n\n /**\n * Observe alerts posted by other parts of the application.\n */\n alert$(): Observable<AlertMessage>;\n};\n\n/**\n * The {@link ApiRef} of {@link AlertApi}.\n *\n * @public\n * @deprecated Use {@link toastApiRef} instead. AlertApi will be removed in a future release.\n */\nexport const alertApiRef = createApiRef<AlertApi>().with({\n id: 'core.alert',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AA+EO,MAAM,WAAA,GAAc,YAAA,EAAuB,CAAE,IAAA,CAAK;AAAA,EACvD,EAAA,EAAI,YAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const analyticsApiRef = createApiRef({
|
|
7
|
-
id: "core.analytics"
|
|
6
|
+
const analyticsApiRef = createApiRef().with({
|
|
7
|
+
id: "core.analytics",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { analyticsApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsApi.esm.js","sources":["../../../src/apis/definitions/AnalyticsApi.ts"],"sourcesContent":["/*\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 {
|
|
1
|
+
{"version":3,"file":"AnalyticsApi.esm.js","sources":["../../../src/apis/definitions/AnalyticsApi.ts"],"sourcesContent":["/*\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 { createApiRef } from '../system';\nimport { AnalyticsContextValue } from '../../analytics/types';\n\n/**\n * Represents an event worth tracking in an analytics system that could inform\n * how users of a Backstage instance are using its features.\n *\n * @public\n */\nexport type AnalyticsEvent = {\n /**\n * A string that identifies the event being tracked by the type of action the\n * event represents. Be careful not to encode extra metadata in this string\n * that should instead be placed in the Analytics Context or attributes.\n * Examples include:\n *\n * - view\n * - click\n * - filter\n * - search\n * - hover\n * - scroll\n */\n action: string;\n\n /**\n * A string that uniquely identifies the object that the action is being\n * taken on. Examples include:\n *\n * - The path of the page viewed\n * - The url of the link clicked\n * - The value that was filtered by\n * - The text that was searched for\n */\n subject: string;\n\n /**\n * An optional numeric value relevant to the event that could be aggregated\n * by analytics tools. Examples include:\n *\n * - The index or position of the clicked element in an ordered list\n * - The percentage of an element that has been scrolled through\n * - The amount of time that has elapsed since a fixed point\n * - A satisfaction score on a fixed scale\n */\n value?: number;\n\n /**\n * Optional, additional attributes (representing dimensions or metrics)\n * specific to the event that could be forwarded on to analytics systems.\n */\n attributes?: AnalyticsEventAttributes;\n\n /**\n * Contextual metadata relating to where the event was captured and by whom.\n * This could include information about the route, plugin, or extension in\n * which an event was captured.\n */\n context: AnalyticsContextValue;\n};\n\n/**\n * A structure allowing other arbitrary metadata to be provided by analytics\n * event emitters.\n *\n * @public\n */\nexport type AnalyticsEventAttributes = {\n [attribute in string]: string | boolean | number;\n};\n\n/**\n * Represents a tracker with methods that can be called to track events in a\n * configured analytics service.\n *\n * @public\n */\nexport type AnalyticsTracker = {\n captureEvent: (\n action: string,\n subject: string,\n options?: {\n value?: number;\n attributes?: AnalyticsEventAttributes;\n },\n ) => void;\n};\n\n/**\n * Analytics implementations are used to track user behavior in a Backstage\n * instance.\n *\n * @remarks\n *\n * To instrument your App or Plugin, retrieve an analytics tracker using the\n * `useAnalytics()` hook. This will return a pre-configured `AnalyticsTracker`\n * with relevant methods for instrumentation.\n *\n * @public\n */\nexport type AnalyticsImplementation = {\n /**\n * Primary event handler responsible for compiling and forwarding events to\n * an analytics system.\n */\n captureEvent(event: AnalyticsEvent): void;\n};\n\n/**\n * The Analytics API is used to track user behavior in a Backstage instance.\n *\n * @remarks\n *\n * To instrument your App or Plugin, retrieve an analytics tracker using the\n * useAnalytics() hook. This will return a pre-configured AnalyticsTracker\n * with relevant methods for instrumentation.\n *\n * @public\n */\nexport type AnalyticsApi = {\n /**\n * Primary event handler responsible for compiling and forwarding events to\n * an analytics system.\n */\n captureEvent(event: AnalyticsEvent): void;\n};\n\n/**\n * The API reference of {@link AnalyticsApi}.\n *\n * @remarks\n *\n * To define a concrete Analytics Implementation, use\n * {@link AnalyticsImplementationBlueprint} instead.\n *\n * @public\n */\nexport const analyticsApiRef = createApiRef<AnalyticsApi>().with({\n id: 'core.analytics',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AAyJO,MAAM,eAAA,GAAkB,YAAA,EAA2B,CAAE,IAAA,CAAK;AAAA,EAC/D,EAAA,EAAI,gBAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const appLanguageApiRef = createApiRef({
|
|
7
|
-
id: "core.applanguage"
|
|
6
|
+
const appLanguageApiRef = createApiRef().with({
|
|
7
|
+
id: "core.applanguage",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { appLanguageApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLanguageApi.esm.js","sources":["../../../src/apis/definitions/AppLanguageApi.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 {
|
|
1
|
+
{"version":3,"file":"AppLanguageApi.esm.js","sources":["../../../src/apis/definitions/AppLanguageApi.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 '../system';\nimport { Observable } from '@backstage/types';\n\n/** @public */\nexport type AppLanguageApi = {\n getAvailableLanguages(): { languages: string[] };\n\n setLanguage(language?: string): void;\n\n getLanguage(): { language: string };\n\n language$(): Observable<{ language: string }>;\n};\n\n/**\n * @public\n */\nexport const appLanguageApiRef = createApiRef<AppLanguageApi>().with({\n id: 'core.applanguage',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AAiCO,MAAM,iBAAA,GAAoB,YAAA,EAA6B,CAAE,IAAA,CAAK;AAAA,EACnE,EAAA,EAAI,kBAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const appThemeApiRef = createApiRef({
|
|
7
|
-
id: "core.apptheme"
|
|
6
|
+
const appThemeApiRef = createApiRef().with({
|
|
7
|
+
id: "core.apptheme",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { appThemeApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppThemeApi.esm.js","sources":["../../../src/apis/definitions/AppThemeApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { ReactNode } from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"AppThemeApi.esm.js","sources":["../../../src/apis/definitions/AppThemeApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { ReactNode } from 'react';\nimport { createApiRef } from '../system';\nimport { Observable } from '@backstage/types';\n\n/**\n * Describes a theme provided by the app.\n *\n * @public\n */\nexport type AppTheme = {\n /**\n * ID used to remember theme selections.\n */\n id: string;\n\n /**\n * Title of the theme\n */\n title: string;\n\n /**\n * Theme variant\n */\n variant: 'light' | 'dark';\n\n /**\n * An Icon for the theme mode setting.\n */\n icon?: React.ReactElement;\n\n Provider(props: { children: ReactNode }): JSX.Element | null;\n};\n\n/**\n * The AppThemeApi gives access to the current app theme, and allows switching\n * to other options that have been registered as a part of the App.\n *\n * @public\n */\nexport type AppThemeApi = {\n /**\n * Get a list of available themes.\n */\n getInstalledThemes(): AppTheme[];\n\n /**\n * Observe the currently selected theme. A value of undefined means no specific theme has been selected.\n */\n activeThemeId$(): Observable<string | undefined>;\n\n /**\n * Get the current theme ID. Returns undefined if no specific theme is selected.\n */\n getActiveThemeId(): string | undefined;\n\n /**\n * Set a specific theme to use in the app, overriding the default theme selection.\n *\n * Clear the selection by passing in undefined.\n */\n setActiveThemeId(themeId?: string): void;\n};\n\n/**\n * The {@link ApiRef} of {@link AppThemeApi}.\n *\n * @public\n */\nexport const appThemeApiRef = createApiRef<AppThemeApi>().with({\n id: 'core.apptheme',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AAoFO,MAAM,cAAA,GAAiB,YAAA,EAA0B,CAAE,IAAA,CAAK;AAAA,EAC7D,EAAA,EAAI,eAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,7 +3,10 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const appTreeApiRef = createApiRef({
|
|
6
|
+
const appTreeApiRef = createApiRef().with({
|
|
7
|
+
id: "core.app-tree",
|
|
8
|
+
pluginId: "app"
|
|
9
|
+
});
|
|
7
10
|
|
|
8
11
|
export { appTreeApiRef };
|
|
9
12
|
//# sourceMappingURL=AppTreeApi.esm.js.map
|
|
@@ -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 '../system';\nimport { FrontendPlugin, Extension, ExtensionDataRef } from '../../wiring';\nimport { ExtensionAttachTo } from '../../wiring/resolveExtensionDefinition';\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: ExtensionAttachTo;\n readonly extension: Extension<unknown, unknown>;\n readonly disabled: boolean;\n readonly config?: unknown;\n readonly plugin: 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 * Get all nodes in the app that are mounted at a given route path.\n */\n getNodesByRoutePath(routePath: string): { nodes: AppNode[] };\n}\n\n/**\n * The `ApiRef` of {@link AppTreeApi}.\n *\n * @public\n */\nexport const appTreeApiRef = createApiRef<AppTreeApi>({
|
|
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 '../system';\nimport { FrontendPlugin, Extension, ExtensionDataRef } from '../../wiring';\nimport { ExtensionAttachTo } from '../../wiring/resolveExtensionDefinition';\nimport { FilterPredicate } from '@backstage/filter-predicates';\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: ExtensionAttachTo;\n readonly extension: Extension<unknown, unknown>;\n readonly disabled: boolean;\n readonly if?: FilterPredicate;\n readonly config?: unknown;\n readonly plugin: 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 * Get all nodes in the app that are mounted at a given route path.\n */\n getNodesByRoutePath(routePath: string): { nodes: AppNode[] };\n}\n\n/**\n * The `ApiRef` of {@link AppTreeApi}.\n *\n * @public\n */\nexport const appTreeApiRef = createApiRef<AppTreeApi>().with({\n id: 'core.app-tree',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AAyHO,MAAM,aAAA,GAAgB,YAAA,EAAyB,CAAE,IAAA,CAAK;AAAA,EAC3D,EAAA,EAAI,eAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const configApiRef = createApiRef({
|
|
7
|
-
id: "core.config"
|
|
6
|
+
const configApiRef = createApiRef().with({
|
|
7
|
+
id: "core.config",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { configApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigApi.esm.js","sources":["../../../src/apis/definitions/ConfigApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 */\nimport {
|
|
1
|
+
{"version":3,"file":"ConfigApi.esm.js","sources":["../../../src/apis/definitions/ConfigApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 */\nimport { createApiRef } from '../system';\nimport type { Config } from '@backstage/config';\n\n/**\n * The Config API is used to provide a mechanism to access the\n * runtime configuration of the system.\n *\n * @public\n */\nexport type ConfigApi = Config;\n\n/**\n * The {@link ApiRef} of {@link ConfigApi}.\n *\n * @public\n */\nexport const configApiRef = createApiRef<ConfigApi>().with({\n id: 'core.config',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AA+BO,MAAM,YAAA,GAAe,YAAA,EAAwB,CAAE,IAAA,CAAK;AAAA,EACzD,EAAA,EAAI,aAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const dialogApiRef = createApiRef({
|
|
7
|
-
id: "core.dialog"
|
|
6
|
+
const dialogApiRef = createApiRef().with({
|
|
7
|
+
id: "core.dialog",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { dialogApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogApi.esm.js","sources":["../../../src/apis/definitions/DialogApi.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\nimport { createApiRef } from '../system';\n\n/**\n * A handle for an open dialog that can be used to interact with it.\n *\n * @remarks\n *\n * Dialogs can be opened using either {@link DialogApi.show} or {@link DialogApi.showModal}.\n *\n * @public\n */\nexport interface DialogApiDialog<TResult = void> {\n /**\n * Closes the dialog with that provided result.\n *\n * @remarks\n *\n * If the dialog is a modal dialog a result must always be provided. If it's a regular dialog then passing a result is optional.\n */\n close(\n ...args: undefined extends TResult ? [result?: TResult] : [result: TResult]\n ): void;\n\n /**\n * Replaces the content of the dialog with the provided element or component, causing it to be rerenedered.\n */\n update(\n elementOrComponent:\n |
|
|
1
|
+
{"version":3,"file":"DialogApi.esm.js","sources":["../../../src/apis/definitions/DialogApi.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\nimport { createApiRef } from '../system';\n\n/**\n * A handle for an open dialog that can be used to interact with it.\n *\n * @remarks\n *\n * Dialogs can be opened using either {@link DialogApi.show} or {@link DialogApi.showModal}.\n *\n * @public\n */\nexport interface DialogApiDialog<TResult = void> {\n /**\n * Closes the dialog with that provided result.\n *\n * @remarks\n *\n * If the dialog is a modal dialog a result must always be provided. If it's a regular dialog then passing a result is optional.\n */\n close(\n ...args: undefined extends TResult ? [result?: TResult] : [result: TResult]\n ): void;\n\n /**\n * Replaces the content of the dialog with the provided element or component, causing it to be rerenedered.\n */\n update(\n elementOrComponent:\n | JSX.Element\n | ((props: { dialog: DialogApiDialog<TResult> }) => JSX.Element),\n ): void;\n\n /**\n * Wait until the dialog is closed and return the result.\n *\n * @remarks\n *\n * If the dialog is a modal dialog a result will always be returned. If it's a regular dialog then the result may be `undefined`.\n */\n result(): Promise<TResult>;\n}\n\n/**\n * A Utility API for showing dialogs that render in the React tree and return a result.\n *\n * @public\n */\nexport interface DialogApi {\n /**\n * Opens a modal dialog and returns a handle to it.\n *\n * @remarks\n *\n * This dialog can be closed by calling the `close` method on the returned handle, optionally providing a result.\n * The dialog can also be closed by the user by clicking the backdrop or pressing the escape key.\n *\n * If the dialog is closed without a result, the result will be `undefined`.\n *\n * @example\n *\n * ### Example with inline dialog content\n * ```tsx\n * const dialog = dialogApi.show<boolean>(\n * <DialogContent>\n * <DialogTitle>Are you sure?</DialogTitle>\n * <DialogActions>\n * <Button onClick={() => dialog.close(true)}>Yes</Button>\n * <Button onClick={() => dialog.close(false)}>No</Button>\n * </DialogActions>\n * </DialogContent>\n * );\n * const result = await dialog.result();\n * ```\n *\n * @example\n *\n * ### Example with separate dialog component\n * ```tsx\n * function CustomDialog({ dialog }: { dialog: DialogApiDialog<boolean | undefined> }) {\n * return (\n * <DialogContent>\n * <DialogTitle>Are you sure?</DialogTitle>\n * <DialogActions>\n * <Button onClick={() => dialog.close(true)}>Yes</Button>\n * <Button onClick={() => dialog.close(false)}>No</Button>\n * </DialogActions>\n * </DialogContent>\n * )\n * }\n * const result = await dialogApi.show(CustomDialog).result();\n * ```\n *\n * @param elementOrComponent - The element or component to render in the dialog. If a component is provided, it will be provided with a `dialog` prop that contains the dialog handle.\n * @public\n */\n show<TResult = void>(\n elementOrComponent:\n | JSX.Element\n | ((props: {\n dialog: DialogApiDialog<TResult | undefined>;\n }) => JSX.Element),\n ): DialogApiDialog<TResult | undefined>;\n\n /**\n * Opens a modal dialog and returns a handle to it.\n *\n * @remarks\n *\n * This dialog can not be closed in any other way than calling the `close` method on the returned handle and providing a result.\n *\n * @example\n *\n * ### Example with inline dialog content\n * ```tsx\n * const dialog = dialogApi.showModal<boolean>(\n * <DialogContent>\n * <DialogTitle>Are you sure?</DialogTitle>\n * <DialogActions>\n * <Button onClick={() => dialog.close(true)}>Yes</Button>\n * <Button onClick={() => dialog.close(false)}>No</Button>\n * </DialogActions>\n * </DialogContent>\n * );\n * const result = await dialog.result();\n * ```\n *\n * @example\n *\n * ### Example with separate dialog component\n * ```tsx\n * function CustomDialog({ dialog }: { dialog: DialogApiDialog<boolean> }) {\n * return (\n * <DialogContent>\n * <DialogTitle>Are you sure?</DialogTitle>\n * <DialogActions>\n * <Button onClick={() => dialog.close(true)}>Yes</Button>\n * <Button onClick={() => dialog.close(false)}>No</Button>\n * </DialogActions>\n * </DialogContent>\n * )\n * }\n * const result = await dialogApi.showModal(CustomDialog).result();\n * ```\n *\n * @param elementOrComponent - The element or component to render in the dialog. If a component is provided, it will be provided with a `dialog` prop that contains the dialog handle.\n * @public\n */\n showModal<TResult = void>(\n elementOrComponent:\n | JSX.Element\n | ((props: { dialog: DialogApiDialog<TResult> }) => JSX.Element),\n ): DialogApiDialog<TResult>;\n}\n\n/**\n * The `ApiRef` of {@link DialogApi}.\n *\n * @public\n */\nexport const dialogApiRef = createApiRef<DialogApi>().with({\n id: 'core.dialog',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AA+KO,MAAM,YAAA,GAAe,YAAA,EAAwB,CAAE,IAAA,CAAK;AAAA,EACzD,EAAA,EAAI,aAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const discoveryApiRef = createApiRef({
|
|
7
|
-
id: "core.discovery"
|
|
6
|
+
const discoveryApiRef = createApiRef().with({
|
|
7
|
+
id: "core.discovery",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { discoveryApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscoveryApi.esm.js","sources":["../../../src/apis/definitions/DiscoveryApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 */\nimport {
|
|
1
|
+
{"version":3,"file":"DiscoveryApi.esm.js","sources":["../../../src/apis/definitions/DiscoveryApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 */\nimport { createApiRef } from '../system';\n\n/**\n * The discovery API is used to provide a mechanism for plugins to\n * discover the endpoint to use to talk to their backend counterpart.\n *\n * @remarks\n *\n * The purpose of the discovery API is to allow for many different deployment\n * setups and routing methods through a central configuration, instead\n * of letting each individual plugin manage that configuration.\n *\n * Implementations of the discovery API can be a simple as a URL pattern\n * using the pluginId, but could also have overrides for individual plugins,\n * or query a separate discovery service.\n *\n * @public\n */\nexport type DiscoveryApi = {\n /**\n * Returns the HTTP base backend URL for a given plugin, without a trailing slash.\n *\n * This method must always be called just before making a request, as opposed to\n * fetching the URL when constructing an API client. That is to ensure that more\n * flexible routing patterns can be supported.\n *\n * For example, asking for the URL for `auth` may return something\n * like `https://backstage.example.com/api/auth`\n */\n getBaseUrl(pluginId: string): Promise<string>;\n};\n\n/**\n * The {@link ApiRef} of {@link DiscoveryApi}.\n *\n * @public\n */\nexport const discoveryApiRef = createApiRef<DiscoveryApi>().with({\n id: 'core.discovery',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AAoDO,MAAM,eAAA,GAAkB,YAAA,EAA2B,CAAE,IAAA,CAAK;AAAA,EAC/D,EAAA,EAAI,gBAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const errorApiRef = createApiRef({
|
|
7
|
-
id: "core.error"
|
|
6
|
+
const errorApiRef = createApiRef().with({
|
|
7
|
+
id: "core.error",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { errorApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorApi.esm.js","sources":["../../../src/apis/definitions/ErrorApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 {
|
|
1
|
+
{"version":3,"file":"ErrorApi.esm.js","sources":["../../../src/apis/definitions/ErrorApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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 '../system';\nimport { Observable } from '@backstage/types';\n\n/**\n * Mirrors the JavaScript Error class, for the purpose of\n * providing documentation and optional fields.\n *\n * @public\n */\nexport type ErrorApiError = {\n name: string;\n message: string;\n stack?: string;\n};\n\n/**\n * Provides additional information about an error that was posted to the application.\n *\n * @public\n */\nexport type ErrorApiErrorContext = {\n /**\n * If set to true, this error should not be displayed to the user.\n *\n * Hidden errors are typically not displayed in the UI, but the ErrorApi\n * implementation may still report them to error tracking services\n * or other utilities that care about all errors.\n *\n * @defaultValue false\n */\n hidden?: boolean;\n};\n\n/**\n * The error API is used to report errors to the app, and display them to the user.\n *\n * @remarks\n *\n * Plugins can use this API as a method of displaying errors to the user, but also\n * to report errors for collection by error reporting services.\n *\n * If an error can be displayed inline, e.g. as feedback in a form, that should be\n * preferred over relying on this API to display the error. The main use of this API\n * for displaying errors should be for asynchronous errors, such as a failing background process.\n *\n * Even if an error is displayed inline, it should still be reported through this API\n * if it would be useful to collect or log it for debugging purposes, but with\n * the hidden flag set. For example, an error arising from form field validation\n * should probably not be reported, while a failed REST call would be useful to report.\n *\n * @public\n */\nexport type ErrorApi = {\n /**\n * Post an error for handling by the application.\n */\n post(error: ErrorApiError, context?: ErrorApiErrorContext): void;\n\n /**\n * Observe errors posted by other parts of the application.\n */\n error$(): Observable<{\n error: ErrorApiError;\n context?: ErrorApiErrorContext;\n }>;\n};\n\n/**\n * The {@link ApiRef} of {@link ErrorApi}.\n *\n * @public\n */\nexport const errorApiRef = createApiRef<ErrorApi>().with({\n id: 'core.error',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AAwFO,MAAM,WAAA,GAAc,YAAA,EAAuB,CAAE,IAAA,CAAK;AAAA,EACvD,EAAA,EAAI,YAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -13,8 +13,9 @@ const FeatureFlagState = {
|
|
|
13
13
|
*/
|
|
14
14
|
Active: 1
|
|
15
15
|
};
|
|
16
|
-
const featureFlagsApiRef = createApiRef({
|
|
17
|
-
id: "core.featureflags"
|
|
16
|
+
const featureFlagsApiRef = createApiRef().with({
|
|
17
|
+
id: "core.featureflags",
|
|
18
|
+
pluginId: "app"
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
export { FeatureFlagState, featureFlagsApiRef };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureFlagsApi.esm.js","sources":["../../../src/apis/definitions/FeatureFlagsApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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/* We want to maintain the same information as an enum, so we disable the redeclaration warning */\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport {
|
|
1
|
+
{"version":3,"file":"FeatureFlagsApi.esm.js","sources":["../../../src/apis/definitions/FeatureFlagsApi.ts"],"sourcesContent":["/*\n * Copyright 2020 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/* We want to maintain the same information as an enum, so we disable the redeclaration warning */\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport { createApiRef } from '../system';\n\n/**\n * Feature flag descriptor.\n *\n * @public\n */\nexport type FeatureFlag = {\n name: string;\n pluginId: string;\n description?: string;\n};\n\n/**\n * Enum representing the state of a feature flag (inactive/active).\n *\n * @public\n */\nexport const FeatureFlagState = {\n /**\n * Feature flag inactive (disabled).\n */\n None: 0,\n /**\n * Feature flag active (enabled).\n */\n Active: 1,\n} as const;\n\n/**\n * @public\n */\nexport type FeatureFlagState =\n (typeof FeatureFlagState)[keyof typeof FeatureFlagState];\n\n/**\n * @public\n */\nexport namespace FeatureFlagState {\n export type None = typeof FeatureFlagState.None;\n export type Active = typeof FeatureFlagState.Active;\n}\n\n/**\n * Options to use when saving feature flags.\n *\n * @public\n */\nexport type FeatureFlagsSaveOptions = {\n /**\n * The new feature flag states to save.\n */\n states: Record<string, FeatureFlagState>;\n\n /**\n * Whether the saves states should be merged into the existing ones, or replace them.\n *\n * Defaults to false.\n */\n merge?: boolean;\n};\n\n/**\n * The feature flags API is used to toggle functionality to users across plugins and Backstage.\n *\n * @remarks\n *\n * Plugins can use this API to register feature flags that they have available\n * for users to enable/disable, and this API will centralize the current user's\n * state of which feature flags they would like to enable.\n *\n * This is ideal for Backstage plugins, as well as your own App, to trial incomplete\n * or unstable upcoming features. Although there will be a common interface for users\n * to enable and disable feature flags, this API acts as another way to enable/disable.\n *\n * @public\n */\nexport interface FeatureFlagsApi {\n /**\n * Registers a new feature flag. Once a feature flag has been registered it\n * can be toggled by users, and read back to enable or disable features.\n */\n registerFlag(flag: FeatureFlag): void;\n\n /**\n * Get a list of all registered flags.\n */\n getRegisteredFlags(): FeatureFlag[];\n\n /**\n * Whether the feature flag with the given name is currently activated for the user.\n */\n isActive(name: string): boolean;\n\n /**\n * Save the user's choice of feature flag states.\n */\n save(options: FeatureFlagsSaveOptions): void;\n}\n\n/**\n * The {@link ApiRef} of {@link FeatureFlagsApi}.\n *\n * @public\n */\nexport const featureFlagsApiRef = createApiRef<FeatureFlagsApi>().with({\n id: 'core.featureflags',\n pluginId: 'app',\n});\n"],"names":[],"mappings":";;;;;AAoCO,MAAM,gBAAA,GAAmB;AAAA;AAAA;AAAA;AAAA,EAI9B,IAAA,EAAM,CAAA;AAAA;AAAA;AAAA;AAAA,EAIN,MAAA,EAAQ;AACV;AA8EO,MAAM,kBAAA,GAAqB,YAAA,EAA8B,CAAE,IAAA,CAAK;AAAA,EACrE,EAAA,EAAI,mBAAA;AAAA,EACJ,QAAA,EAAU;AACZ,CAAC;;;;"}
|
|
@@ -3,8 +3,9 @@ import '@backstage/version-bridge';
|
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import { createApiRef } from '../system/ApiRef.esm.js';
|
|
5
5
|
|
|
6
|
-
const fetchApiRef = createApiRef({
|
|
7
|
-
id: "core.fetch"
|
|
6
|
+
const fetchApiRef = createApiRef().with({
|
|
7
|
+
id: "core.fetch",
|
|
8
|
+
pluginId: "app"
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export { fetchApiRef };
|