@backstage/frontend-plugin-api 0.13.0 → 0.13.2-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/analytics/useAnalytics.esm.js +14 -1
  3. package/dist/analytics/useAnalytics.esm.js.map +1 -1
  4. package/dist/apis/definitions/AlertApi.esm.js +11 -0
  5. package/dist/apis/definitions/AlertApi.esm.js.map +1 -0
  6. package/dist/apis/definitions/AnalyticsApi.esm.js +4 -1
  7. package/dist/apis/definitions/AnalyticsApi.esm.js.map +1 -1
  8. package/dist/apis/definitions/AppLanguageApi.esm.js +11 -0
  9. package/dist/apis/definitions/AppLanguageApi.esm.js.map +1 -0
  10. package/dist/apis/definitions/AppThemeApi.esm.js +11 -0
  11. package/dist/apis/definitions/AppThemeApi.esm.js.map +1 -0
  12. package/dist/apis/definitions/AppTreeApi.esm.js +4 -1
  13. package/dist/apis/definitions/AppTreeApi.esm.js.map +1 -1
  14. package/dist/apis/definitions/ConfigApi.esm.js +11 -0
  15. package/dist/apis/definitions/ConfigApi.esm.js.map +1 -0
  16. package/dist/apis/definitions/DialogApi.esm.js +4 -1
  17. package/dist/apis/definitions/DialogApi.esm.js.map +1 -1
  18. package/dist/apis/definitions/DiscoveryApi.esm.js +11 -0
  19. package/dist/apis/definitions/DiscoveryApi.esm.js.map +1 -0
  20. package/dist/apis/definitions/ErrorApi.esm.js +11 -0
  21. package/dist/apis/definitions/ErrorApi.esm.js.map +1 -0
  22. package/dist/apis/definitions/FeatureFlagsApi.esm.js +21 -0
  23. package/dist/apis/definitions/FeatureFlagsApi.esm.js.map +1 -0
  24. package/dist/apis/definitions/FetchApi.esm.js +11 -0
  25. package/dist/apis/definitions/FetchApi.esm.js.map +1 -0
  26. package/dist/apis/definitions/IconsApi.esm.js +4 -1
  27. package/dist/apis/definitions/IconsApi.esm.js.map +1 -1
  28. package/dist/apis/definitions/IdentityApi.esm.js +11 -0
  29. package/dist/apis/definitions/IdentityApi.esm.js.map +1 -0
  30. package/dist/apis/definitions/OAuthRequestApi.esm.js +11 -0
  31. package/dist/apis/definitions/OAuthRequestApi.esm.js.map +1 -0
  32. package/dist/apis/definitions/RouteResolutionApi.esm.js +4 -1
  33. package/dist/apis/definitions/RouteResolutionApi.esm.js.map +1 -1
  34. package/dist/apis/definitions/StorageApi.esm.js +11 -0
  35. package/dist/apis/definitions/StorageApi.esm.js.map +1 -0
  36. package/dist/apis/definitions/SwappableComponentsApi.esm.js +4 -1
  37. package/dist/apis/definitions/SwappableComponentsApi.esm.js.map +1 -1
  38. package/dist/apis/definitions/TranslationApi.esm.js +11 -0
  39. package/dist/apis/definitions/TranslationApi.esm.js.map +1 -0
  40. package/dist/apis/definitions/auth.esm.js +51 -0
  41. package/dist/apis/definitions/auth.esm.js.map +1 -0
  42. package/dist/apis/system/ApiRef.esm.js +27 -0
  43. package/dist/apis/system/ApiRef.esm.js.map +1 -0
  44. package/dist/apis/system/helpers.esm.js +13 -0
  45. package/dist/apis/system/helpers.esm.js.map +1 -0
  46. package/dist/apis/system/useApi.esm.js +50 -0
  47. package/dist/apis/system/useApi.esm.js.map +1 -0
  48. package/dist/blueprints/NavItemBlueprint.esm.js.map +1 -1
  49. package/dist/blueprints/PageBlueprint.esm.js +15 -1
  50. package/dist/blueprints/PageBlueprint.esm.js.map +1 -1
  51. package/dist/blueprints/SignInPageBlueprint.esm.js +15 -1
  52. package/dist/blueprints/SignInPageBlueprint.esm.js.map +1 -1
  53. package/dist/blueprints/ThemeBlueprint.esm.js.map +1 -1
  54. package/dist/components/ExtensionBoundary.esm.js +2 -1
  55. package/dist/components/ExtensionBoundary.esm.js.map +1 -1
  56. package/dist/components/createSwappableComponent.esm.js +14 -1
  57. package/dist/components/createSwappableComponent.esm.js.map +1 -1
  58. package/dist/frontend-internal/src/wiring/InternalExtensionInput.esm.js.map +1 -1
  59. package/dist/index.d.ts +1595 -148
  60. package/dist/index.esm.js +20 -2
  61. package/dist/index.esm.js.map +1 -1
  62. package/dist/routing/useRouteRef.esm.js +14 -1
  63. package/dist/routing/useRouteRef.esm.js.map +1 -1
  64. package/dist/translation/TranslationMessages.esm.js +11 -0
  65. package/dist/translation/TranslationMessages.esm.js.map +1 -0
  66. package/dist/translation/TranslationRef.esm.js +62 -0
  67. package/dist/translation/TranslationRef.esm.js.map +1 -0
  68. package/dist/translation/TranslationResource.esm.js +21 -0
  69. package/dist/translation/TranslationResource.esm.js.map +1 -0
  70. package/dist/translation/useTranslationRef.esm.js +89 -0
  71. package/dist/translation/useTranslationRef.esm.js.map +1 -0
  72. package/dist/wiring/createExtension.esm.js +2 -2
  73. package/dist/wiring/createExtension.esm.js.map +1 -1
  74. package/package.json +28 -21
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @backstage/frontend-plugin-api
2
2
 
3
+ ## 0.13.2-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 0bc1ce9: Fixed a versioning conflict that could result in a `.withContext` is not a function error.
8
+ - 97cd16f: Reversed the relationship between the old `@backstage/core-plugin-api` and the new `@backstage/frontend-plugin-api`. Previously, the a lot of API definitions and utilities where defined in the old and re-exported from the old, but this change flips that around so that they now reside in the new package and are re-exported from the old. The external API of both packages remain the same, but this is a step towards being able to add further compatibility with the new frontend system built into the old.
9
+ - Updated dependencies
10
+ - @backstage/core-components@0.18.4-next.0
11
+ - @backstage/config@1.3.6
12
+ - @backstage/errors@1.2.7
13
+ - @backstage/types@1.2.2
14
+ - @backstage/version-bridge@1.0.11
15
+
3
16
  ## 0.13.0
4
17
 
5
18
  ### Minor Changes
@@ -1,11 +1,24 @@
1
- import { useApi } from '@backstage/core-plugin-api';
1
+ import { useApi } from '../apis/system/useApi.esm.js';
2
2
  import { useAnalyticsContext } from './AnalyticsContext.esm.js';
3
3
  import '../apis/definitions/AppTreeApi.esm.js';
4
+ import '../apis/definitions/auth.esm.js';
5
+ import '../apis/definitions/AlertApi.esm.js';
6
+ import '../apis/definitions/AppLanguageApi.esm.js';
7
+ import '../apis/definitions/AppThemeApi.esm.js';
4
8
  import '../apis/definitions/SwappableComponentsApi.esm.js';
9
+ import '../apis/definitions/ConfigApi.esm.js';
10
+ import '../apis/definitions/DiscoveryApi.esm.js';
11
+ import '../apis/definitions/ErrorApi.esm.js';
12
+ import '../apis/definitions/FeatureFlagsApi.esm.js';
13
+ import '../apis/definitions/FetchApi.esm.js';
5
14
  import '../apis/definitions/IconsApi.esm.js';
15
+ import '../apis/definitions/IdentityApi.esm.js';
6
16
  import '../apis/definitions/DialogApi.esm.js';
17
+ import '../apis/definitions/OAuthRequestApi.esm.js';
7
18
  import '../apis/definitions/RouteResolutionApi.esm.js';
19
+ import '../apis/definitions/StorageApi.esm.js';
8
20
  import { analyticsApiRef } from '../apis/definitions/AnalyticsApi.esm.js';
21
+ import '../apis/definitions/TranslationApi.esm.js';
9
22
  import { useRef } from 'react';
10
23
  import { Tracker } from './Tracker.esm.js';
11
24
 
@@ -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 '@backstage/core-plugin-api';\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;;;;"}
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;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const alertApiRef = createApiRef({
7
+ id: "core.alert"
8
+ });
9
+
10
+ export { alertApiRef };
11
+ //# sourceMappingURL=AlertApi.esm.js.map
@@ -0,0 +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, ApiRef } from '../system';\nimport { Observable } from '@backstage/types';\n\n/**\n * Message handled by the {@link AlertApi}.\n *\n * @public\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 */\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 */\nexport const alertApiRef: ApiRef<AlertApi> = createApiRef({\n id: 'core.alert',\n});\n"],"names":[],"mappings":";;;;;AAqDO,MAAM,cAAgC,YAAA,CAAa;AAAA,EACxD,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1,4 +1,7 @@
1
- import { createApiRef } from '@backstage/core-plugin-api';
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
2
5
 
3
6
  const analyticsApiRef = createApiRef({
4
7
  id: "core.analytics"
@@ -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 '@backstage/core-plugin-api';\nimport { AnalyticsContextValue } from '../../analytics/types';\nimport type { AnalyticsImplementationBlueprint } from '../../blueprints/';\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: ApiRef<AnalyticsApi> = createApiRef({\n id: 'core.analytics',\n});\n"],"names":[],"mappings":";;AA0JO,MAAM,kBAAwC,YAAA,CAAa;AAAA,EAChE,EAAA,EAAI;AACN,CAAC;;;;"}
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 * 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: ApiRef<AnalyticsApi> = createApiRef({\n id: 'core.analytics',\n});\n"],"names":[],"mappings":";;;;;AAyJO,MAAM,kBAAwC,YAAA,CAAa;AAAA,EAChE,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const appLanguageApiRef = createApiRef({
7
+ id: "core.applanguage"
8
+ });
9
+
10
+ export { appLanguageApiRef };
11
+ //# sourceMappingURL=AppLanguageApi.esm.js.map
@@ -0,0 +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 { ApiRef, 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: ApiRef<AppLanguageApi> = createApiRef({\n id: 'core.applanguage',\n});\n"],"names":[],"mappings":";;;;;AAiCO,MAAM,oBAA4C,YAAA,CAAa;AAAA,EACpE,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const appThemeApiRef = createApiRef({
7
+ id: "core.apptheme"
8
+ });
9
+
10
+ export { appThemeApiRef };
11
+ //# sourceMappingURL=AppThemeApi.esm.js.map
@@ -0,0 +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 { ApiRef, 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: ApiRef<AppThemeApi> = createApiRef({\n id: 'core.apptheme',\n});\n"],"names":[],"mappings":";;;;;AAoFO,MAAM,iBAAsC,YAAA,CAAa;AAAA,EAC9D,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1,4 +1,7 @@
1
- import { createApiRef } from '@backstage/core-plugin-api';
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
2
5
 
3
6
  const appTreeApiRef = createApiRef({ id: "core.app-tree" });
4
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"AppTreeApi.esm.js","sources":["../../../src/apis/definitions/AppTreeApi.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApiRef } from '@backstage/core-plugin-api';\nimport { 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>({ id: 'core.app-tree' });\n"],"names":[],"mappings":";;AAuHO,MAAM,aAAA,GAAgB,YAAA,CAAyB,EAAE,EAAA,EAAI,iBAAiB;;;;"}
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>({ id: 'core.app-tree' });\n"],"names":[],"mappings":";;;;;AAuHO,MAAM,aAAA,GAAgB,YAAA,CAAyB,EAAE,EAAA,EAAI,iBAAiB;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const configApiRef = createApiRef({
7
+ id: "core.config"
8
+ });
9
+
10
+ export { configApiRef };
11
+ //# sourceMappingURL=ConfigApi.esm.js.map
@@ -0,0 +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 { ApiRef, createApiRef } from '../system';\nimport { 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: ApiRef<ConfigApi> = createApiRef({\n id: 'core.config',\n});\n"],"names":[],"mappings":";;;;;AA+BO,MAAM,eAAkC,YAAA,CAAa;AAAA,EAC1D,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1,4 +1,7 @@
1
- import { createApiRef } from '@backstage/core-plugin-api';
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
2
5
 
3
6
  const dialogApiRef = createApiRef({
4
7
  id: "core.dialog"
@@ -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 '@backstage/core-plugin-api';\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 | React.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>({\n id: 'core.dialog',\n});\n"],"names":[],"mappings":";;AA+KO,MAAM,eAAe,YAAA,CAAwB;AAAA,EAClD,EAAA,EAAI;AACN,CAAC;;;;"}
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 | React.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>({\n id: 'core.dialog',\n});\n"],"names":[],"mappings":";;;;;AA+KO,MAAM,eAAe,YAAA,CAAwB;AAAA,EAClD,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const discoveryApiRef = createApiRef({
7
+ id: "core.discovery"
8
+ });
9
+
10
+ export { discoveryApiRef };
11
+ //# sourceMappingURL=DiscoveryApi.esm.js.map
@@ -0,0 +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 { ApiRef, 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: ApiRef<DiscoveryApi> = createApiRef({\n id: 'core.discovery',\n});\n"],"names":[],"mappings":";;;;;AAoDO,MAAM,kBAAwC,YAAA,CAAa;AAAA,EAChE,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const errorApiRef = createApiRef({
7
+ id: "core.error"
8
+ });
9
+
10
+ export { errorApiRef };
11
+ //# sourceMappingURL=ErrorApi.esm.js.map
@@ -0,0 +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 { ApiRef, 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: ApiRef<ErrorApi> = createApiRef({\n id: 'core.error',\n});\n"],"names":[],"mappings":";;;;;AAwFO,MAAM,cAAgC,YAAA,CAAa;AAAA,EACxD,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,21 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const FeatureFlagState = {
7
+ /**
8
+ * Feature flag inactive (disabled).
9
+ */
10
+ None: 0,
11
+ /**
12
+ * Feature flag active (enabled).
13
+ */
14
+ Active: 1
15
+ };
16
+ const featureFlagsApiRef = createApiRef({
17
+ id: "core.featureflags"
18
+ });
19
+
20
+ export { FeatureFlagState, featureFlagsApiRef };
21
+ //# sourceMappingURL=FeatureFlagsApi.esm.js.map
@@ -0,0 +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 { ApiRef, 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: ApiRef<FeatureFlagsApi> = createApiRef({\n id: 'core.featureflags',\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,qBAA8C,YAAA,CAAa;AAAA,EACtE,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const fetchApiRef = createApiRef({
7
+ id: "core.fetch"
8
+ });
9
+
10
+ export { fetchApiRef };
11
+ //# sourceMappingURL=FetchApi.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchApi.esm.js","sources":["../../../src/apis/definitions/FetchApi.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';\n\n/**\n * A wrapper for the fetch API, that has additional behaviors such as the\n * ability to automatically inject auth information where necessary.\n *\n * @public\n */\nexport type FetchApi = {\n /**\n * The `fetch` implementation.\n */\n fetch: typeof fetch;\n};\n\n/**\n * The {@link ApiRef} of {@link FetchApi}.\n *\n * @remarks\n *\n * This is a wrapper for the fetch API, that has additional behaviors such as\n * the ability to automatically inject auth information where necessary.\n *\n * Note that the default behavior of this API (unless overridden by your org),\n * is to require that the user is already signed in so that it has auth\n * information to inject. Therefore, using the default implementation of this\n * utility API e.g. on the `SignInPage` or similar, would cause issues. In\n * special circumstances like those, you can use the regular system `fetch`\n * instead.\n *\n * @public\n */\nexport const fetchApiRef: ApiRef<FetchApi> = createApiRef({\n id: 'core.fetch',\n});\n"],"names":[],"mappings":";;;;;AAgDO,MAAM,cAAgC,YAAA,CAAa;AAAA,EACxD,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1,4 +1,7 @@
1
- import { createApiRef } from '@backstage/core-plugin-api';
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
2
5
 
3
6
  const iconsApiRef = createApiRef({
4
7
  id: "core.icons"
@@ -1 +1 @@
1
- {"version":3,"file":"IconsApi.esm.js","sources":["../../../src/apis/definitions/IconsApi.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApiRef } from '@backstage/core-plugin-api';\nimport { IconComponent } from '../../icons';\n\n/**\n * API for accessing app icons.\n *\n * @public\n */\nexport interface IconsApi {\n getIcon(key: string): IconComponent | undefined;\n\n listIconKeys(): string[];\n}\n\n/**\n * The `ApiRef` of {@link IconsApi}.\n *\n * @public\n */\nexport const iconsApiRef = createApiRef<IconsApi>({\n id: 'core.icons',\n});\n"],"names":[],"mappings":";;AAmCO,MAAM,cAAc,YAAA,CAAuB;AAAA,EAChD,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"IconsApi.esm.js","sources":["../../../src/apis/definitions/IconsApi.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 { IconComponent } from '../../icons';\n\n/**\n * API for accessing app icons.\n *\n * @public\n */\nexport interface IconsApi {\n getIcon(key: string): IconComponent | undefined;\n\n listIconKeys(): string[];\n}\n\n/**\n * The `ApiRef` of {@link IconsApi}.\n *\n * @public\n */\nexport const iconsApiRef = createApiRef<IconsApi>({\n id: 'core.icons',\n});\n"],"names":[],"mappings":";;;;;AAmCO,MAAM,cAAc,YAAA,CAAuB;AAAA,EAChD,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const identityApiRef = createApiRef({
7
+ id: "core.identity"
8
+ });
9
+
10
+ export { identityApiRef };
11
+ //# sourceMappingURL=IdentityApi.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityApi.esm.js","sources":["../../../src/apis/definitions/IdentityApi.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 { ApiRef, createApiRef } from '../system';\nimport { BackstageUserIdentity, ProfileInfo } from './auth';\n\n/**\n * The Identity API used to identify and get information about the signed in user.\n *\n * @public\n */\nexport type IdentityApi = {\n /**\n * The profile of the signed in user.\n */\n getProfileInfo(): Promise<ProfileInfo>;\n\n /**\n * User identity information within Backstage.\n */\n getBackstageIdentity(): Promise<BackstageUserIdentity>;\n\n /**\n * Provides credentials in the form of a token which proves the identity of the signed in user.\n *\n * The token will be undefined if the signed in user does not have a verified\n * identity, such as a demo user or mocked user for e2e tests.\n */\n getCredentials(): Promise<{ token?: string }>;\n\n /**\n * Sign out the current user\n */\n signOut(): Promise<void>;\n};\n\n/**\n * The {@link ApiRef} of {@link IdentityApi}.\n *\n * @public\n */\nexport const identityApiRef: ApiRef<IdentityApi> = createApiRef({\n id: 'core.identity',\n});\n"],"names":[],"mappings":";;;;;AAqDO,MAAM,iBAAsC,YAAA,CAAa;AAAA,EAC9D,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const oauthRequestApiRef = createApiRef({
7
+ id: "core.oauthrequest"
8
+ });
9
+
10
+ export { oauthRequestApiRef };
11
+ //# sourceMappingURL=OAuthRequestApi.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OAuthRequestApi.esm.js","sources":["../../../src/apis/definitions/OAuthRequestApi.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 { Observable } from '@backstage/types';\nimport { ApiRef, createApiRef } from '../system';\nimport { AuthProviderInfo } from './auth';\n\n/**\n * Describes how to handle auth requests. Both how to show them to the user, and what to do when\n * the user accesses the auth request.\n *\n * @public\n */\nexport type OAuthRequesterOptions<TOAuthResponse> = {\n /**\n * Information about the auth provider, which will be forwarded to auth requests.\n */\n provider: AuthProviderInfo;\n\n /**\n * Implementation of the auth flow, which will be called synchronously when\n * trigger() is called on an auth requests.\n */\n onAuthRequest(scopes: Set<string>): Promise<TOAuthResponse>;\n};\n\n/**\n * Function used to trigger new auth requests for a set of scopes.\n *\n * @remarks\n *\n * The returned promise will resolve to the same value returned by the onAuthRequest in the\n * {@link OAuthRequesterOptions}. Or rejected, if the request is rejected.\n *\n * This function can be called multiple times before the promise resolves. All calls\n * will be merged into one request, and the scopes forwarded to the onAuthRequest will be the\n * union of all requested scopes.\n *\n * @public\n */\nexport type OAuthRequester<TAuthResponse> = (\n scopes: Set<string>,\n) => Promise<TAuthResponse>;\n\n/**\n * An pending auth request for a single auth provider. The request will remain in this pending\n * state until either reject() or trigger() is called.\n *\n * @remarks\n *\n * Any new requests for the same provider are merged into the existing pending request, meaning\n * there will only ever be a single pending request for a given provider.\n *\n * @public\n */\nexport type PendingOAuthRequest = {\n /**\n * Information about the auth provider, as given in the AuthRequesterOptions\n */\n provider: AuthProviderInfo;\n\n /**\n * Rejects the request, causing all pending AuthRequester calls to fail with \"RejectedError\".\n */\n reject(): void;\n\n /**\n * Trigger the auth request to continue the auth flow, by for example showing a popup.\n *\n * Synchronously calls onAuthRequest with all scope currently in the request.\n */\n trigger(): Promise<void>;\n};\n\n/**\n * Provides helpers for implemented OAuth login flows within Backstage.\n *\n * @public\n */\nexport type OAuthRequestApi = {\n /**\n * A utility for showing login popups or similar things, and merging together multiple requests for\n * different scopes into one request that includes all scopes.\n *\n * The passed in options provide information about the login provider, and how to handle auth requests.\n *\n * The returned AuthRequester function is used to request login with new scopes. These requests\n * are merged together and forwarded to the auth handler, as soon as a consumer of auth requests\n * triggers an auth flow.\n *\n * See AuthRequesterOptions, AuthRequester, and handleAuthRequests for more info.\n */\n createAuthRequester<OAuthResponse>(\n options: OAuthRequesterOptions<OAuthResponse>,\n ): OAuthRequester<OAuthResponse>;\n\n /**\n * Observers pending auth requests. The returned observable will emit all\n * current active auth request, at most one for each created auth requester.\n *\n * Each request has its own info about the login provider, forwarded from the auth requester options.\n *\n * Depending on user interaction, the request should either be rejected, or used to trigger the auth handler.\n * If the request is rejected, all pending AuthRequester calls will fail with a \"RejectedError\".\n * If a auth is triggered, and the auth handler resolves successfully, then all currently pending\n * AuthRequester calls will resolve to the value returned by the onAuthRequest call.\n */\n authRequest$(): Observable<PendingOAuthRequest[]>;\n};\n\n/**\n * The {@link ApiRef} of {@link OAuthRequestApi}.\n *\n * @public\n */\nexport const oauthRequestApiRef: ApiRef<OAuthRequestApi> = createApiRef({\n id: 'core.oauthrequest',\n});\n"],"names":[],"mappings":";;;;;AAgIO,MAAM,qBAA8C,YAAA,CAAa;AAAA,EACtE,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1,4 +1,7 @@
1
- import { createApiRef } from '@backstage/core-plugin-api';
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
2
5
 
3
6
  const routeResolutionApiRef = createApiRef({
4
7
  id: "core.route-resolution"
@@ -1 +1 @@
1
- {"version":3,"file":"RouteResolutionApi.esm.js","sources":["../../../src/apis/definitions/RouteResolutionApi.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AnyRouteRefParams,\n RouteRef,\n SubRouteRef,\n ExternalRouteRef,\n} from '../../routing';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * TS magic for handling route parameters.\n *\n * @remarks\n *\n * The extra TS magic here is to require a single params argument if the RouteRef\n * had at least one param defined, but require 0 arguments if there are no params defined.\n * Without this we'd have to pass in empty object to all parameter-less RouteRefs\n * just to make TypeScript happy, or we would have to make the argument optional in\n * which case you might forget to pass it in when it is actually required.\n *\n * @public\n */\nexport type RouteFunc<TParams extends AnyRouteRefParams> = (\n ...[params]: TParams extends undefined\n ? readonly []\n : readonly [params: TParams]\n) => string;\n\n/**\n * @public\n */\nexport interface RouteResolutionApi {\n resolve<TParams extends AnyRouteRefParams>(\n anyRouteRef:\n | RouteRef<TParams>\n | SubRouteRef<TParams>\n | ExternalRouteRef<TParams>,\n options?: {\n /**\n * An absolute path to use as a starting point when resolving the route.\n * If no path is provided the route will be resolved from the root of the app.\n */\n sourcePath?: string;\n },\n ): RouteFunc<TParams> | undefined;\n}\n\n/**\n * The `ApiRef` of {@link RouteResolutionApi}.\n *\n * @public\n */\nexport const routeResolutionApiRef = createApiRef<RouteResolutionApi>({\n id: 'core.route-resolution',\n});\n"],"names":[],"mappings":";;AAmEO,MAAM,wBAAwB,YAAA,CAAiC;AAAA,EACpE,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"RouteResolutionApi.esm.js","sources":["../../../src/apis/definitions/RouteResolutionApi.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AnyRouteRefParams,\n RouteRef,\n SubRouteRef,\n ExternalRouteRef,\n} from '../../routing';\nimport { createApiRef } from '../system';\n\n/**\n * TS magic for handling route parameters.\n *\n * @remarks\n *\n * The extra TS magic here is to require a single params argument if the RouteRef\n * had at least one param defined, but require 0 arguments if there are no params defined.\n * Without this we'd have to pass in empty object to all parameter-less RouteRefs\n * just to make TypeScript happy, or we would have to make the argument optional in\n * which case you might forget to pass it in when it is actually required.\n *\n * @public\n */\nexport type RouteFunc<TParams extends AnyRouteRefParams> = (\n ...[params]: TParams extends undefined\n ? readonly []\n : readonly [params: TParams]\n) => string;\n\n/**\n * @public\n */\nexport interface RouteResolutionApi {\n resolve<TParams extends AnyRouteRefParams>(\n anyRouteRef:\n | RouteRef<TParams>\n | SubRouteRef<TParams>\n | ExternalRouteRef<TParams>,\n options?: {\n /**\n * An absolute path to use as a starting point when resolving the route.\n * If no path is provided the route will be resolved from the root of the app.\n */\n sourcePath?: string;\n },\n ): RouteFunc<TParams> | undefined;\n}\n\n/**\n * The `ApiRef` of {@link RouteResolutionApi}.\n *\n * @public\n */\nexport const routeResolutionApiRef = createApiRef<RouteResolutionApi>({\n id: 'core.route-resolution',\n});\n"],"names":[],"mappings":";;;;;AAmEO,MAAM,wBAAwB,YAAA,CAAiC;AAAA,EACpE,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const storageApiRef = createApiRef({
7
+ id: "core.storage"
8
+ });
9
+
10
+ export { storageApiRef };
11
+ //# sourceMappingURL=StorageApi.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageApi.esm.js","sources":["../../../src/apis/definitions/StorageApi.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 { ApiRef, createApiRef } from '../system';\nimport { JsonValue, Observable } from '@backstage/types';\n\n/**\n * A snapshot in time of the current known value of a storage key.\n *\n * @public\n */\nexport type StorageValueSnapshot<TValue extends JsonValue> =\n | {\n key: string;\n presence: 'unknown' | 'absent';\n value?: undefined;\n }\n | {\n key: string;\n presence: 'present';\n value: TValue;\n };\n\n/**\n * Provides a key-value persistence API.\n *\n * @public\n */\nexport interface StorageApi {\n /**\n * Create a bucket to store data in.\n *\n * @param name - Namespace for the storage to be stored under,\n * will inherit previous namespaces too\n */\n forBucket(name: string): StorageApi;\n\n /**\n * Remove persistent data.\n *\n * @param key - Unique key associated with the data.\n */\n remove(key: string): Promise<void>;\n\n /**\n * Save persistent data, and emit messages to anyone that is using\n * {@link StorageApi.observe$} for this key.\n *\n * @param key - Unique key associated with the data.\n * @param data - The data to be stored under the key.\n */\n set<T extends JsonValue>(key: string, data: T): Promise<void>;\n\n /**\n * Observe the value over time for a particular key in the current bucket.\n *\n * @remarks\n *\n * The observable will only emit values when the value changes in the underlying\n * storage, although multiple values with the same shape may be emitted in a row.\n *\n * If a {@link StorageApi.snapshot} of a key is retrieved and the presence is\n * `'unknown'`, then you are guaranteed to receive a snapshot with a known\n * presence, as long as you observe the key within the same tick.\n *\n * Since the emitted values are shared across all subscribers, it is important\n * not to mutate the returned values. The values may be frozen as a precaution.\n *\n * @param key - Unique key associated with the data\n */\n observe$<T extends JsonValue>(\n key: string,\n ): Observable<StorageValueSnapshot<T>>;\n\n /**\n * Returns an immediate snapshot value for the given key, if possible.\n *\n * @remarks\n *\n * Combine with {@link StorageApi.observe$} to get notified of value changes.\n *\n * Note that this method is synchronous, and some underlying storages may be\n * unable to retrieve a value using this method - the result may or may not\n * consistently have a presence of 'unknown'. Use {@link StorageApi.observe$}\n * to be sure to receive an actual value eventually.\n */\n snapshot<T extends JsonValue>(key: string): StorageValueSnapshot<T>;\n}\n\n/**\n * The {@link ApiRef} of {@link StorageApi}.\n *\n * @public\n */\nexport const storageApiRef: ApiRef<StorageApi> = createApiRef({\n id: 'core.storage',\n});\n"],"names":[],"mappings":";;;;;AA2GO,MAAM,gBAAoC,YAAA,CAAa;AAAA,EAC5D,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1,4 +1,7 @@
1
- import { createApiRef } from '@backstage/core-plugin-api';
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
2
5
 
3
6
  const swappableComponentsApiRef = createApiRef({
4
7
  id: "core.swappable-components"
@@ -1 +1 @@
1
- {"version":3,"file":"SwappableComponentsApi.esm.js","sources":["../../../src/apis/definitions/SwappableComponentsApi.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 { SwappableComponentRef } from '../../components';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * API for looking up components based on component refs.\n *\n * @public\n */\nexport interface SwappableComponentsApi {\n getComponent<\n TInnerComponentProps extends {},\n TExternalComponentProps extends {} = TInnerComponentProps,\n >(\n ref: SwappableComponentRef<TInnerComponentProps, TExternalComponentProps>,\n ): (props: TInnerComponentProps) => JSX.Element | null;\n}\n\n/**\n * The `ApiRef` of {@link SwappableComponentsApi}.\n *\n * @public\n */\nexport const swappableComponentsApiRef = createApiRef<SwappableComponentsApi>({\n id: 'core.swappable-components',\n});\n"],"names":[],"mappings":";;AAsCO,MAAM,4BAA4B,YAAA,CAAqC;AAAA,EAC5E,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"SwappableComponentsApi.esm.js","sources":["../../../src/apis/definitions/SwappableComponentsApi.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 { SwappableComponentRef } from '../../components';\nimport { createApiRef } from '../system';\n\n/**\n * API for looking up components based on component refs.\n *\n * @public\n */\nexport interface SwappableComponentsApi {\n getComponent<\n TInnerComponentProps extends {},\n TExternalComponentProps extends {} = TInnerComponentProps,\n >(\n ref: SwappableComponentRef<TInnerComponentProps, TExternalComponentProps>,\n ): (props: TInnerComponentProps) => JSX.Element | null;\n}\n\n/**\n * The `ApiRef` of {@link SwappableComponentsApi}.\n *\n * @public\n */\nexport const swappableComponentsApiRef = createApiRef<SwappableComponentsApi>({\n id: 'core.swappable-components',\n});\n"],"names":[],"mappings":";;;;;AAsCO,MAAM,4BAA4B,YAAA,CAAqC;AAAA,EAC5E,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,11 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const translationApiRef = createApiRef({
7
+ id: "core.translation"
8
+ });
9
+
10
+ export { translationApiRef };
11
+ //# sourceMappingURL=TranslationApi.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TranslationApi.esm.js","sources":["../../../src/apis/definitions/TranslationApi.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 { ApiRef, createApiRef } from '../system';\nimport { Expand, ExpandRecursive, Observable } from '@backstage/types';\nimport { TranslationRef } from '../../translation';\nimport { JSX } from 'react';\n\n/**\n * Base translation options.\n *\n * @alpha\n */\ninterface BaseOptions {\n interpolation?: {\n /** Whether to HTML escape provided values, defaults to false */\n escapeValue?: boolean;\n };\n}\n\n/**\n * All pluralization suffixes supported by i18next\n *\n * @ignore\n */\ntype TranslationPlural = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';\n\n/**\n * A mapping of i18n formatting types to their corresponding types and options.\n * @ignore\n */\ntype I18nextFormatMap = {\n number: {\n type: number;\n options: Intl.NumberFormatOptions;\n };\n currency: {\n type: number;\n options: Intl.NumberFormatOptions;\n };\n datetime: {\n type: Date;\n options: Intl.DateTimeFormatOptions;\n };\n relativetime: {\n type: number;\n options: {\n range?: Intl.RelativeTimeFormatUnit;\n } & Intl.RelativeTimeFormatOptions;\n };\n list: {\n type: string[];\n options: Intl.ListFormatOptions;\n };\n};\n\n/**\n * Extracts all pluralized keys from the message map.\n *\n * @example\n * ```\n * { foo: 'foo', bar_one: 'bar', bar_other: 'bars' } -> 'bar'\n * ```\n *\n * @ignore\n */\ntype PluralKeys<TMessages extends { [key in string]: string }> = {\n [Key in keyof TMessages]: Key extends `${infer K}_${TranslationPlural}`\n ? K\n : never;\n}[keyof TMessages];\n\n/**\n * Collapses a message map into normalized keys with union values.\n *\n * @example\n * ```\n * { foo_one: 'foo', foo_other: 'foos' } -> { foo: 'foo' | 'foos' }\n * ```\n *\n * @ignore\n */\ntype CollapsedMessages<TMessages extends { [key in string]: string }> = {\n [key in keyof TMessages as key extends `${infer K}_${TranslationPlural}`\n ? K\n : key]: TMessages[key];\n};\n\n/**\n * Trim away whitespace\n *\n * @ignore\n */\ntype Trim<T> = T extends ` ${infer U}`\n ? Trim<U>\n : T extends `${infer U} `\n ? Trim<U>\n : T;\n\n/**\n * Extracts the key and format from a replacement string.\n *\n * @example\n * ```\n * 'foo, number' -> { foo: number }, 'foo' -> { foo: undefined }\n * ```\n */\ntype ExtractFormat<Replacement extends string> =\n Replacement extends `${infer Key},${infer FullFormat}`\n ? {\n [key in Trim<Key>]: Lowercase<\n Trim<\n FullFormat extends `${infer Format}(${string})${string}`\n ? Format\n : FullFormat\n >\n >;\n }\n : { [key in Trim<Replacement>]: undefined };\n\n/**\n * Expand the keys in a flat map to nested objects.\n *\n * @example\n * ```\n * { 'a.b': 'foo', 'a.c': 'bar' } -> { a: { b: 'foo', c: 'bar' }\n * ```\n *\n * @ignore\n */\ntype ExpandKeys<TMap extends {}> = {\n [Key in keyof TMap as Key extends `${infer Prefix}.${string}`\n ? Prefix\n : Key]: Key extends `${string}.${infer Rest}`\n ? ExpandKeys<{ [key in Rest]: TMap[Key] }>\n : TMap[Key];\n};\n\n/**\n * Extracts all option keys and their format from a message string.\n *\n * @example\n * ```\n * 'foo {{bar}} {{baz, number}}' -> { 'bar': undefined, 'baz': 'number' }\n * ```\n *\n * @ignore\n */\ntype ReplaceFormatsFromMessage<TMessage> =\n TMessage extends `${string}{{${infer Replacement}}}${infer Tail}` // no formatting, e.g. {{foo}}\n ? ExpandKeys<ExtractFormat<Replacement>> & ReplaceFormatsFromMessage<Tail>\n : {};\n\n/**\n * Generates the replace options structure\n *\n * @ignore\n */\ntype ReplaceOptionsFromFormats<TFormats extends {}, TValueType> = {\n [Key in keyof TFormats]: TFormats[Key] extends keyof I18nextFormatMap\n ? I18nextFormatMap[TFormats[Key]]['type']\n : TFormats[Key] extends {}\n ? Expand<ReplaceOptionsFromFormats<TFormats[Key], TValueType>>\n : TValueType;\n};\n\n/**\n * Generates the formatParams options structure\n *\n * @ignore\n */\ntype ReplaceFormatParamsFromFormats<TFormats extends {}> = {\n [Key in keyof TFormats]?: TFormats[Key] extends keyof I18nextFormatMap\n ? I18nextFormatMap[TFormats[Key]]['options']\n : TFormats[Key] extends {}\n ? Expand<ReplaceFormatParamsFromFormats<TFormats[Key]>>\n : undefined;\n};\n\n/**\n * Extracts all nesting keys from a message string.\n *\n * @example\n * ```\n * 'foo $t(bar) $t(baz)' -> 'bar' | 'baz'\n * ```\n *\n * @ignore\n */\ntype NestingKeysFromMessage<TMessage extends string> =\n TMessage extends `${string}$t(${infer Key})${infer Tail}` // nesting options are not supported\n ? Trim<Key> | NestingKeysFromMessage<Tail>\n : never;\n\n/**\n * Find all referenced keys, given a starting key and the full set of messages.\n *\n * This will only discover keys up to 3 levels deep.\n *\n * @example\n * ```\n * <'x', { x: '$t(y) $t(z)', y: 'y', z: '$t(w)', w: 'w', foo: 'foo' }> -> 'x' | 'y' | 'z' | 'w'\n * ```\n *\n * @ignore\n */\ntype NestedMessageKeys<\n TKey extends keyof TMessages,\n TMessages extends { [key in string]: string },\n> =\n | TKey\n | NestedMessageKeys2<NestingKeysFromMessage<TMessages[TKey]>, TMessages>;\n// Can't recursively reference ourself, so instead we got this beauty\ntype NestedMessageKeys2<\n TKey extends keyof TMessages,\n TMessages extends { [key in string]: string },\n> =\n | TKey\n | NestedMessageKeys3<NestingKeysFromMessage<TMessages[TKey]>, TMessages>;\n// Only support 3 levels of nesting\ntype NestedMessageKeys3<\n TKey extends keyof TMessages,\n TMessages extends { [key in string]: string },\n> = TKey | NestingKeysFromMessage<TMessages[TKey]>;\n\n/**\n * Converts a union type to an intersection type.\n *\n * @example\n * ```\n * { foo: 'foo' } | { bar: 'bar' } -> { foo: 'foo' } & { bar: 'bar' }\n * ```\n *\n * @ignore\n */\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (\n k: infer I,\n) => void\n ? I\n : never;\n\n/**\n * Collects different types of options into a single object\n *\n * @ignore\n */\ntype CollectOptions<\n TCount extends { count?: number },\n TFormats extends {},\n TValueType,\n> = TCount &\n // count is special, omit it from the replacements\n (keyof Omit<TFormats, 'count'> extends never\n ? {}\n : (\n | Expand<Omit<ReplaceOptionsFromFormats<TFormats, TValueType>, 'count'>>\n | {\n replace: Expand<\n Omit<ReplaceOptionsFromFormats<TFormats, TValueType>, 'count'>\n >;\n }\n ) & {\n formatParams?: Expand<ReplaceFormatParamsFromFormats<TFormats>>;\n });\n\n/**\n * Helper type to only require options argument if needed\n *\n * @ignore\n */\ntype OptionArgs<TOptions extends {}> = keyof TOptions extends never\n ? [options?: Expand<BaseOptions>]\n : [options: Expand<BaseOptions & TOptions>];\n\n/**\n * @ignore\n */\ntype TranslationFunctionOptions<\n TKeys extends keyof TMessages, // All normalized message keys to be considered, i.e. included nested ones\n TPluralKeys extends keyof TMessages, // All keys in the message map that are pluralized\n TMessages extends { [key in string]: string }, // Collapsed message map with normalized keys and union values\n TValueType,\n> = OptionArgs<\n Expand<\n CollectOptions<\n TKeys & TPluralKeys extends never ? {} : { count: number },\n ExpandRecursive<\n UnionToIntersection<ReplaceFormatsFromMessage<TMessages[TKeys]>>\n >,\n TValueType\n >\n >\n>;\n\n/** @public */\nexport type TranslationFunction<TMessages extends { [key in string]: string }> =\n CollapsedMessages<TMessages> extends infer IMessages extends {\n [key in string]: string;\n }\n ? {\n /**\n * A translation function that returns a string.\n */\n <TKey extends keyof IMessages>(\n key: TKey,\n ...[args]: TranslationFunctionOptions<\n NestedMessageKeys<TKey, IMessages>,\n PluralKeys<TMessages>,\n IMessages,\n string\n >\n ): IMessages[TKey];\n /**\n * A translation function where at least one JSX.Element has been\n * provided as an interpolation value, and will therefore return a\n * JSX.Element.\n */\n <TKey extends keyof IMessages>(\n key: TKey,\n ...[args]: TranslationFunctionOptions<\n NestedMessageKeys<TKey, IMessages>,\n PluralKeys<TMessages>,\n IMessages,\n string | JSX.Element\n >\n ): JSX.Element;\n }\n : never;\n\n/** @public */\nexport type TranslationSnapshot<TMessages extends { [key in string]: string }> =\n { ready: false } | { ready: true; t: TranslationFunction<TMessages> };\n\n/** @public */\nexport type TranslationApi = {\n getTranslation<TMessages extends { [key in string]: string }>(\n translationRef: TranslationRef<string, TMessages>,\n ): TranslationSnapshot<TMessages>;\n\n translation$<TMessages extends { [key in string]: string }>(\n translationRef: TranslationRef<string, TMessages>,\n ): Observable<TranslationSnapshot<TMessages>>;\n};\n\n/**\n * @public\n */\nexport const translationApiRef: ApiRef<TranslationApi> = createApiRef({\n id: 'core.translation',\n});\n"],"names":[],"mappings":";;;;;AAwWO,MAAM,oBAA4C,YAAA,CAAa;AAAA,EACpE,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -0,0 +1,51 @@
1
+ import 'react/jsx-runtime';
2
+ import '@backstage/version-bridge';
3
+ import '@backstage/errors';
4
+ import { createApiRef } from '../system/ApiRef.esm.js';
5
+
6
+ const SessionState = {
7
+ /**
8
+ * User signed in.
9
+ */
10
+ SignedIn: "SignedIn",
11
+ /**
12
+ * User not signed in.
13
+ */
14
+ SignedOut: "SignedOut"
15
+ };
16
+ const googleAuthApiRef = createApiRef({
17
+ id: "core.auth.google"
18
+ });
19
+ const githubAuthApiRef = createApiRef({
20
+ id: "core.auth.github"
21
+ });
22
+ const oktaAuthApiRef = createApiRef({
23
+ id: "core.auth.okta"
24
+ });
25
+ const gitlabAuthApiRef = createApiRef({
26
+ id: "core.auth.gitlab"
27
+ });
28
+ const microsoftAuthApiRef = createApiRef({
29
+ id: "core.auth.microsoft"
30
+ });
31
+ const oneloginAuthApiRef = createApiRef({
32
+ id: "core.auth.onelogin"
33
+ });
34
+ const bitbucketAuthApiRef = createApiRef({
35
+ id: "core.auth.bitbucket"
36
+ });
37
+ const bitbucketServerAuthApiRef = createApiRef({
38
+ id: "core.auth.bitbucket-server"
39
+ });
40
+ const atlassianAuthApiRef = createApiRef({
41
+ id: "core.auth.atlassian"
42
+ });
43
+ const vmwareCloudAuthApiRef = createApiRef({
44
+ id: "core.auth.vmware-cloud"
45
+ });
46
+ const openshiftAuthApiRef = createApiRef({
47
+ id: "core.auth.openshift"
48
+ });
49
+
50
+ export { SessionState, atlassianAuthApiRef, bitbucketAuthApiRef, bitbucketServerAuthApiRef, githubAuthApiRef, gitlabAuthApiRef, googleAuthApiRef, microsoftAuthApiRef, oktaAuthApiRef, oneloginAuthApiRef, openshiftAuthApiRef, vmwareCloudAuthApiRef };
51
+ //# sourceMappingURL=auth.esm.js.map