@backstage/core-plugin-api 1.12.4-next.0 → 1.12.4
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 +21 -0
- package/dist/apis/definitions/AnalyticsApi.esm.js +2 -1
- package/dist/apis/definitions/AnalyticsApi.esm.js.map +1 -1
- package/dist/apis/system/ApiRef.esm.js +9 -0
- package/dist/apis/system/ApiRef.esm.js.map +1 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @backstage/core-plugin-api
|
|
2
2
|
|
|
3
|
+
## 1.12.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d911b72: Updated `createApiRef` to preserve the direct config call without deprecation warnings while staying compatible with the new frontend API ref typing.
|
|
8
|
+
- 59752a2: Deprecated `AlertApi`, `AlertMessage`, and `alertApiRef` in favor of the new `ToastApi` from `@backstage/frontend-plugin-api`.
|
|
9
|
+
- 0452d02: Add optional `description` field to plugin-level feature flags.
|
|
10
|
+
- a49a40d: Updated dependency `zod` to `^3.25.76 || ^4.0.0` & migrated to `/v3` or `/v4` imports.
|
|
11
|
+
- fe848e0: Changed `useApiHolder` to return an empty `ApiHolder` instead of throwing when used outside of an API context.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/frontend-plugin-api@0.15.0
|
|
14
|
+
|
|
15
|
+
## 1.12.4-next.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 0452d02: Add optional `description` field to plugin-level feature flags.
|
|
20
|
+
- fe848e0: Changed `useApiHolder` to return an empty `ApiHolder` instead of throwing when used outside of an API context.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @backstage/frontend-plugin-api@0.15.0-next.1
|
|
23
|
+
|
|
3
24
|
## 1.12.4-next.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -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 { ApiRef, 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 * 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 `ApiRef` of {@link AnalyticsApi}.\n *\n * @public\n */\nexport const analyticsApiRef: ApiRef<AnalyticsApi> = createApiRef({\n id: 'core.analytics',\n});\n"],"names":[],"mappings":"
|
|
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 { ApiRef, 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 * 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 `ApiRef` of {@link AnalyticsApi}.\n *\n * @public\n */\nexport const analyticsApiRef: ApiRef<AnalyticsApi> = createApiRef({\n id: 'core.analytics',\n});\n"],"names":[],"mappings":";;;AAgIO,MAAM,kBAAwC,YAAA,CAAa;AAAA,EAChE,EAAA,EAAI;AACN,CAAC;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createApiRef as createApiRef$1 } from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
const createFrontendApiRefCompat = createApiRef$1;
|
|
4
|
+
function createApiRef(config) {
|
|
5
|
+
return createFrontendApiRefCompat(config);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { createApiRef };
|
|
9
|
+
//# sourceMappingURL=ApiRef.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiRef.esm.js","sources":["../../../src/apis/system/ApiRef.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 {\n createApiRef as createFrontendApiRef,\n type ApiRef,\n type ApiRefConfig,\n} from '@backstage/frontend-plugin-api';\n\nconst createFrontendApiRefCompat = createFrontendApiRef as <T>(\n config: ApiRefConfig,\n) => ApiRef<T>;\n\n/**\n * Creates a reference to an API.\n *\n * @public\n */\nexport function createApiRef<T>(config: ApiRefConfig): ApiRef<T> {\n return createFrontendApiRefCompat<T>(config);\n}\n\nexport type { ApiRefConfig };\n"],"names":["createFrontendApiRef"],"mappings":";;AAsBA,MAAM,0BAAA,GAA6BA,cAAA;AAS5B,SAAS,aAAgB,MAAA,EAAiC;AAC/D,EAAA,OAAO,2BAA8B,MAAM,CAAA;AAC7C;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode, ComponentType, PropsWithChildren, ReactElement } from 'react';
|
|
3
|
-
import { ApiRef, AnyApiFactory } from '@backstage/frontend-plugin-api';
|
|
4
|
-
export { AlertApi, AlertMessage, AnyApiFactory, AnyApiRef, ApiFactory, ApiHolder, ApiRef, ApiRefConfig, AppTheme, AppThemeApi, AuthProviderInfo, AuthRequestOptions, BackstageIdentityApi, BackstageIdentityResponse, BackstageUserIdentity, ConfigApi, DiscoveryApi, ErrorApi, ErrorApiError, ErrorApiErrorContext, FeatureFlag, FeatureFlagState, FeatureFlagsApi, FeatureFlagsSaveOptions, FetchApi, IconComponent, IdentityApi, OAuthApi, OAuthRequestApi, OAuthRequester, OAuthRequesterOptions, OAuthScope, OpenIdConnectApi, PendingOAuthRequest, ProfileInfo, ProfileInfoApi, SessionApi, SessionState, StorageApi, StorageValueSnapshot, TypesToApiRefs, alertApiRef, appThemeApiRef, atlassianAuthApiRef, bitbucketAuthApiRef, bitbucketServerAuthApiRef, configApiRef, createApiFactory,
|
|
3
|
+
import { ApiRefConfig, ApiRef, AnyApiFactory } from '@backstage/frontend-plugin-api';
|
|
4
|
+
export { AlertApi, AlertMessage, AnyApiFactory, AnyApiRef, ApiFactory, ApiHolder, ApiRef, ApiRefConfig, AppTheme, AppThemeApi, AuthProviderInfo, AuthRequestOptions, BackstageIdentityApi, BackstageIdentityResponse, BackstageUserIdentity, ConfigApi, DiscoveryApi, ErrorApi, ErrorApiError, ErrorApiErrorContext, FeatureFlag, FeatureFlagState, FeatureFlagsApi, FeatureFlagsSaveOptions, FetchApi, IconComponent, IdentityApi, OAuthApi, OAuthRequestApi, OAuthRequester, OAuthRequesterOptions, OAuthScope, OpenIdConnectApi, PendingOAuthRequest, ProfileInfo, ProfileInfoApi, SessionApi, SessionState, StorageApi, StorageValueSnapshot, TypesToApiRefs, alertApiRef, appThemeApiRef, atlassianAuthApiRef, bitbucketAuthApiRef, bitbucketServerAuthApiRef, configApiRef, createApiFactory, discoveryApiRef, errorApiRef, featureFlagsApiRef, fetchApiRef, githubAuthApiRef, gitlabAuthApiRef, googleAuthApiRef, identityApiRef, microsoftAuthApiRef, oauthRequestApiRef, oktaAuthApiRef, oneloginAuthApiRef, openshiftAuthApiRef, storageApiRef, useApi, useApiHolder, vmwareCloudAuthApiRef, withApis } from '@backstage/frontend-plugin-api';
|
|
5
5
|
import { BackstagePlugin as BackstagePlugin$1, IconComponent, IdentityApi } from '@backstage/core-plugin-api';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -48,6 +48,13 @@ declare const AnalyticsContext: (options: {
|
|
|
48
48
|
children: ReactNode;
|
|
49
49
|
}) => react_jsx_runtime.JSX.Element;
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Creates a reference to an API.
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
declare function createApiRef<T>(config: ApiRefConfig): ApiRef<T>;
|
|
57
|
+
|
|
51
58
|
/**
|
|
52
59
|
* Represents an event worth tracking in an analytics system that could inform
|
|
53
60
|
* how users of a Backstage instance are using its features.
|
|
@@ -562,6 +569,8 @@ type BackstagePlugin<Routes extends AnyRoutes = {}, ExternalRoutes extends AnyEx
|
|
|
562
569
|
type PluginFeatureFlagConfig = {
|
|
563
570
|
/** Feature flag name */
|
|
564
571
|
name: string;
|
|
572
|
+
/** Feature flag description */
|
|
573
|
+
description?: string;
|
|
565
574
|
};
|
|
566
575
|
/**
|
|
567
576
|
* Plugin descriptor type.
|
|
@@ -775,5 +784,5 @@ interface ElementCollection {
|
|
|
775
784
|
*/
|
|
776
785
|
declare function useElementFilter<T>(node: ReactNode, filterFn: (arg: ElementCollection) => T, dependencies?: any[]): T;
|
|
777
786
|
|
|
778
|
-
export { AnalyticsContext, analyticsApiRef, attachComponentData, createComponentExtension, createExternalRouteRef, createPlugin, createReactExtension, createRoutableExtension, createRouteRef, createSubRouteRef, getComponentData, useAnalytics, useApp, useElementFilter, useRouteRef, useRouteRefParams };
|
|
787
|
+
export { AnalyticsContext, analyticsApiRef, attachComponentData, createApiRef, createComponentExtension, createExternalRouteRef, createPlugin, createReactExtension, createRoutableExtension, createRouteRef, createSubRouteRef, getComponentData, useAnalytics, useApp, useElementFilter, useRouteRef, useRouteRefParams };
|
|
779
788
|
export type { AnalyticsApi, AnalyticsContextValue, AnalyticsEvent, AnalyticsEventAttributes, AnalyticsTracker, AnyExternalRoutes, AnyParams, AnyRouteRefParams, AnyRoutes, AppComponents, AppContext, BackstagePlugin, BootErrorPageProps, CommonAnalyticsContext, ComponentLoader, ElementCollection, ErrorBoundaryFallbackProps, Extension, ExternalRouteRef, FeatureFlagsHooks, MakeSubRouteRef, MergeParams, OptionalParams, ParamKeys, ParamNames, ParamPart, PathParams, PluginConfig, PluginFeatureFlagConfig, RouteFunc, RouteRef, SignInPageProps, SubRouteRef };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { AnalyticsContext } from './analytics/AnalyticsContext.esm.js';
|
|
2
2
|
export { useAnalytics } from './analytics/useAnalytics.esm.js';
|
|
3
|
-
export { FeatureFlagState, SessionState, alertApiRef, appThemeApiRef, atlassianAuthApiRef, bitbucketAuthApiRef, bitbucketServerAuthApiRef, configApiRef, createApiFactory,
|
|
3
|
+
export { FeatureFlagState, SessionState, alertApiRef, appThemeApiRef, atlassianAuthApiRef, bitbucketAuthApiRef, bitbucketServerAuthApiRef, configApiRef, createApiFactory, discoveryApiRef, errorApiRef, featureFlagsApiRef, fetchApiRef, githubAuthApiRef, gitlabAuthApiRef, googleAuthApiRef, identityApiRef, microsoftAuthApiRef, oauthRequestApiRef, oktaAuthApiRef, oneloginAuthApiRef, openshiftAuthApiRef, storageApiRef, useApi, useApiHolder, vmwareCloudAuthApiRef, withApis } from '@backstage/frontend-plugin-api';
|
|
4
|
+
export { createApiRef } from './apis/system/ApiRef.esm.js';
|
|
4
5
|
export { analyticsApiRef } from './apis/definitions/AnalyticsApi.esm.js';
|
|
5
6
|
export { useApp } from './app/useApp.esm.js';
|
|
6
7
|
export { attachComponentData, getComponentData } from './extensions/componentData.esm.js';
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/core-plugin-api",
|
|
3
|
-
"version": "1.12.4
|
|
3
|
+
"version": "1.12.4",
|
|
4
4
|
"description": "Core API used by Backstage plugins",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library"
|
|
@@ -57,18 +57,18 @@
|
|
|
57
57
|
"test": "backstage-cli package test"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@backstage/config": "1.3.6",
|
|
61
|
-
"@backstage/errors": "1.2.7",
|
|
62
|
-
"@backstage/frontend-plugin-api": "0.
|
|
63
|
-
"@backstage/types": "1.2.2",
|
|
64
|
-
"@backstage/version-bridge": "1.0.12",
|
|
60
|
+
"@backstage/config": "^1.3.6",
|
|
61
|
+
"@backstage/errors": "^1.2.7",
|
|
62
|
+
"@backstage/frontend-plugin-api": "^0.15.0",
|
|
63
|
+
"@backstage/types": "^1.2.2",
|
|
64
|
+
"@backstage/version-bridge": "^1.0.12",
|
|
65
65
|
"history": "^5.0.0",
|
|
66
|
-
"zod": "^3.25.76"
|
|
66
|
+
"zod": "^3.25.76 || ^4.0.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@backstage/cli": "0.
|
|
70
|
-
"@backstage/core-app-api": "1.19.6
|
|
71
|
-
"@backstage/test-utils": "1.7.16
|
|
69
|
+
"@backstage/cli": "^0.36.0",
|
|
70
|
+
"@backstage/core-app-api": "^1.19.6",
|
|
71
|
+
"@backstage/test-utils": "^1.7.16",
|
|
72
72
|
"@testing-library/dom": "^10.0.0",
|
|
73
73
|
"@testing-library/jest-dom": "^6.0.0",
|
|
74
74
|
"@testing-library/react": "^16.0.0",
|