@backstage/plugin-api-docs 0.7.3 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @backstage/plugin-api-docs
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2262fe19c9: **BREAKING**: Removed support for passing in an explicit `entity` prop to entity page extensions, which has been deprecated for a long time. This is only a breaking change at the TypeScript level, as this property was already ignored.
8
+
9
+ ### Patch Changes
10
+
11
+ - 306c366fc9: chore(deps): bump `@asyncapi/react-component`
12
+ - 919cf2f836: Minor updates to match the new `targetRef` field of relations, and to stop consuming the `target` field
13
+ - Updated dependencies
14
+ - @backstage/plugin-catalog@0.9.0
15
+ - @backstage/core-components@0.8.10
16
+ - @backstage/plugin-catalog-react@0.7.0
17
+ - @backstage/catalog-model@0.11.0
18
+ - @backstage/core-plugin-api@0.7.0
19
+
3
20
  ## 0.7.3
4
21
 
5
22
  ### Patch Changes
@@ -8,4 +8,4 @@ import '@backstage/plugin-catalog-react';
8
8
  import '@material-ui/lab';
9
9
  import '@backstage/catalog-model';
10
10
  import '@material-ui/core';
11
- //# sourceMappingURL=index-446e3e5c.esm.js.map
11
+ //# sourceMappingURL=index-67f385f3.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-67f385f3.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -8,4 +8,4 @@ import '@backstage/plugin-catalog-react';
8
8
  import '@material-ui/lab';
9
9
  import '@backstage/catalog-model';
10
10
  import '@material-ui/core';
11
- //# sourceMappingURL=index-1dc3ed84.esm.js.map
11
+ //# sourceMappingURL=index-88534b9b.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-88534b9b.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -8,4 +8,4 @@ import '@backstage/plugin-catalog-react';
8
8
  import '@material-ui/lab';
9
9
  import '@backstage/catalog-model';
10
10
  import '@material-ui/core';
11
- //# sourceMappingURL=index-8a745bfb.esm.js.map
11
+ //# sourceMappingURL=index-8d507e13.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-8d507e13.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -8,4 +8,4 @@ import '@backstage/plugin-catalog-react';
8
8
  import '@material-ui/lab';
9
9
  import '@backstage/catalog-model';
10
10
  import '@material-ui/core';
11
- //# sourceMappingURL=index-d40626b4.esm.js.map
11
+ //# sourceMappingURL=index-f00e35dd.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-f00e35dd.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -2,9 +2,8 @@
2
2
  import { TableColumn, TableProps } from '@backstage/core-components';
3
3
  import { CatalogTableRow } from '@backstage/plugin-catalog';
4
4
  import { UserListFilterKind } from '@backstage/plugin-catalog-react';
5
- import * as _backstage_catalog_model from '@backstage/catalog-model';
6
- import { ApiEntity, Entity } from '@backstage/catalog-model';
7
5
  import React from 'react';
6
+ import { ApiEntity } from '@backstage/catalog-model';
8
7
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
9
8
 
10
9
  /**
@@ -28,11 +27,7 @@ declare const DefaultApiExplorerPage: ({ initiallySelectedFilter, columns, actio
28
27
  */
29
28
  declare const ApiExplorerPage$1: (props: DefaultApiExplorerPageProps) => JSX.Element;
30
29
 
31
- declare type Props$5 = {
32
- /** @deprecated The entity is now grabbed from context instead */
33
- apiEntity?: ApiEntity;
34
- };
35
- declare const ApiDefinitionCard: (_: Props$5) => JSX.Element;
30
+ declare const ApiDefinitionCard: () => JSX.Element;
36
31
 
37
32
  declare type ApiDefinitionWidget = {
38
33
  type: string;
@@ -47,8 +42,6 @@ declare const ApiTypeTitle: ({ apiEntity }: {
47
42
  }) => JSX.Element;
48
43
 
49
44
  declare type Props$4 = {
50
- /** @deprecated The entity is now grabbed from context instead */
51
- entity?: Entity;
52
45
  variant?: 'gridItem';
53
46
  };
54
47
  declare const ConsumedApisCard: ({ variant }: Props$4) => JSX.Element;
@@ -59,8 +52,6 @@ declare type Props$3 = {
59
52
  declare const HasApisCard: ({ variant }: Props$3) => JSX.Element;
60
53
 
61
54
  declare type Props$2 = {
62
- /** @deprecated The entity is now grabbed from context instead */
63
- entity?: Entity;
64
55
  variant?: 'gridItem';
65
56
  };
66
57
  declare const ProvidedApisCard: ({ variant }: Props$2) => JSX.Element;
@@ -71,15 +62,11 @@ declare type AsyncApiDefinitionWidgetProps = {
71
62
  declare const AsyncApiDefinitionWidget: (props: AsyncApiDefinitionWidgetProps) => JSX.Element;
72
63
 
73
64
  declare type Props$1 = {
74
- /** @deprecated The entity is now grabbed from context instead */
75
- entity?: Entity;
76
65
  variant?: 'gridItem';
77
66
  };
78
67
  declare const ConsumingComponentsCard: ({ variant }: Props$1) => JSX.Element;
79
68
 
80
69
  declare type Props = {
81
- /** @deprecated The entity is now grabbed from context instead */
82
- entity?: Entity;
83
70
  variant?: 'gridItem';
84
71
  };
85
72
  declare const ProvidingComponentsCard: ({ variant }: Props) => JSX.Element;
@@ -111,23 +98,17 @@ declare const apiDocsPlugin: _backstage_core_plugin_api.BackstagePlugin<{
111
98
  registerApi: _backstage_core_plugin_api.ExternalRouteRef<undefined, true>;
112
99
  }>;
113
100
  declare const ApiExplorerPage: (props: DefaultApiExplorerPageProps) => JSX.Element;
114
- declare const EntityApiDefinitionCard: (_: {
115
- apiEntity?: ApiEntity | undefined;
116
- }) => JSX.Element;
101
+ declare const EntityApiDefinitionCard: () => JSX.Element;
117
102
  declare const EntityConsumedApisCard: ({ variant }: {
118
- entity?: _backstage_catalog_model.Entity | undefined;
119
103
  variant?: "gridItem" | undefined;
120
104
  }) => JSX.Element;
121
105
  declare const EntityConsumingComponentsCard: ({ variant }: {
122
- entity?: _backstage_catalog_model.Entity | undefined;
123
106
  variant?: "gridItem" | undefined;
124
107
  }) => JSX.Element;
125
108
  declare const EntityProvidedApisCard: ({ variant }: {
126
- entity?: _backstage_catalog_model.Entity | undefined;
127
109
  variant?: "gridItem" | undefined;
128
110
  }) => JSX.Element;
129
111
  declare const EntityProvidingComponentsCard: ({ variant }: {
130
- entity?: _backstage_catalog_model.Entity | undefined;
131
112
  variant?: "gridItem" | undefined;
132
113
  }) => JSX.Element;
133
114
  declare const EntityHasApisCard: ({ variant }: {
package/dist/index.esm.js CHANGED
@@ -74,7 +74,7 @@ const PlainApiDefinitionWidget = (props) => {
74
74
  });
75
75
  };
76
76
 
77
- const ApiDefinitionCard = (_) => {
77
+ const ApiDefinitionCard = () => {
78
78
  var _a;
79
79
  const { entity } = useEntity();
80
80
  const config = useApi(apiDocsConfigRef);
@@ -439,43 +439,43 @@ const apiDocsPlugin = createPlugin({
439
439
  });
440
440
  const ApiExplorerPage = apiDocsPlugin.provide(createRoutableExtension({
441
441
  name: "ApiExplorerPage",
442
- component: () => import('./esm/index-1dc3ed84.esm.js').then((m) => m.ApiExplorerIndexPage),
442
+ component: () => import('./esm/index-88534b9b.esm.js').then((m) => m.ApiExplorerIndexPage),
443
443
  mountPoint: rootRoute
444
444
  }));
445
445
  const EntityApiDefinitionCard = apiDocsPlugin.provide(createComponentExtension({
446
446
  name: "EntityApiDefinitionCard",
447
447
  component: {
448
- lazy: () => import('./esm/index-8a745bfb.esm.js').then((m) => m.ApiDefinitionCard)
448
+ lazy: () => import('./esm/index-8d507e13.esm.js').then((m) => m.ApiDefinitionCard)
449
449
  }
450
450
  }));
451
451
  const EntityConsumedApisCard = apiDocsPlugin.provide(createComponentExtension({
452
452
  name: "EntityConsumedApisCard",
453
453
  component: {
454
- lazy: () => import('./esm/index-446e3e5c.esm.js').then((m) => m.ConsumedApisCard)
454
+ lazy: () => import('./esm/index-67f385f3.esm.js').then((m) => m.ConsumedApisCard)
455
455
  }
456
456
  }));
457
457
  const EntityConsumingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
458
458
  name: "EntityConsumingComponentsCard",
459
459
  component: {
460
- lazy: () => import('./esm/index-d40626b4.esm.js').then((m) => m.ConsumingComponentsCard)
460
+ lazy: () => import('./esm/index-f00e35dd.esm.js').then((m) => m.ConsumingComponentsCard)
461
461
  }
462
462
  }));
463
463
  const EntityProvidedApisCard = apiDocsPlugin.provide(createComponentExtension({
464
464
  name: "EntityProvidedApisCard",
465
465
  component: {
466
- lazy: () => import('./esm/index-446e3e5c.esm.js').then((m) => m.ProvidedApisCard)
466
+ lazy: () => import('./esm/index-67f385f3.esm.js').then((m) => m.ProvidedApisCard)
467
467
  }
468
468
  }));
469
469
  const EntityProvidingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
470
470
  name: "EntityProvidingComponentsCard",
471
471
  component: {
472
- lazy: () => import('./esm/index-d40626b4.esm.js').then((m) => m.ProvidingComponentsCard)
472
+ lazy: () => import('./esm/index-f00e35dd.esm.js').then((m) => m.ProvidingComponentsCard)
473
473
  }
474
474
  }));
475
475
  const EntityHasApisCard = apiDocsPlugin.provide(createComponentExtension({
476
476
  name: "EntityHasApisCard",
477
477
  component: {
478
- lazy: () => import('./esm/index-446e3e5c.esm.js').then((m) => m.HasApisCard)
478
+ lazy: () => import('./esm/index-67f385f3.esm.js').then((m) => m.HasApisCard)
479
479
  }
480
480
  }));
481
481
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/routes.ts","../src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx","../src/components/ApiExplorerPage/ApiExplorerPage.tsx","../src/config.ts","../src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx","../src/components/ApiDefinitionCard/ApiDefinitionCard.tsx","../src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx","../src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx","../src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx","../src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx","../src/components/ApiDefinitionCard/ApiTypeTitle.tsx","../src/components/ApisCards/presets.tsx","../src/components/ApisCards/ConsumedApisCard.tsx","../src/components/ApisCards/HasApisCard.tsx","../src/components/ApisCards/ProvidedApisCard.tsx","../src/components/ComponentsCards/ConsumingComponentsCard.tsx","../src/components/ComponentsCards/ProvidingComponentsCard.tsx","../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const rootRoute = createRouteRef({\n id: 'api-docs',\n});\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n});\n","/*\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 {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CatalogTable,\n CatalogTableRow,\n FilteredEntityLayout,\n EntityListContainer,\n FilterContainer,\n} from '@backstage/plugin-catalog';\nimport {\n EntityKindPicker,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { registerComponentRouteRef } from '../../routes';\n\nconst defaultColumns: TableColumn<CatalogTableRow>[] = [\n CatalogTable.columns.createNameColumn({ defaultKind: 'API' }),\n CatalogTable.columns.createSystemColumn(),\n CatalogTable.columns.createOwnerColumn(),\n CatalogTable.columns.createSpecTypeColumn(),\n CatalogTable.columns.createSpecLifecycleColumn(),\n CatalogTable.columns.createMetadataDescriptionColumn(),\n CatalogTable.columns.createTagsColumn(),\n];\n\n/**\n * DefaultApiExplorerPageProps\n * @public\n */\nexport type DefaultApiExplorerPageProps = {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n};\n\n/**\n * DefaultApiExplorerPage\n * @public\n */\nexport const DefaultApiExplorerPage = ({\n initiallySelectedFilter = 'all',\n columns,\n actions,\n}: DefaultApiExplorerPageProps) => {\n const configApi = useApi(configApiRef);\n const generatedSubtitle = `${\n configApi.getOptionalString('organization.name') ?? 'Backstage'\n } API Explorer`;\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n\n return (\n <PageWithHeader\n themeId=\"apis\"\n title=\"APIs\"\n subtitle={generatedSubtitle}\n pageTitleOverride=\"APIs\"\n >\n <Content>\n <ContentHeader title=\"\">\n <CreateButton\n title=\"Register Existing API\"\n to={registerComponentLink?.()}\n />\n <SupportButton>All your APIs</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <FilteredEntityLayout>\n <FilterContainer>\n <EntityKindPicker initialFilter=\"api\" hidden />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n </FilterContainer>\n <EntityListContainer>\n <CatalogTable\n columns={columns || defaultColumns}\n actions={actions}\n />\n </EntityListContainer>\n </FilteredEntityLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n};\n","/*\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 React from 'react';\nimport { useOutlet } from 'react-router';\nimport {\n DefaultApiExplorerPage,\n DefaultApiExplorerPageProps,\n} from './DefaultApiExplorerPage';\n\n/**\n * ApiExplorerPage\n * @public\n */\nexport const ApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const outlet = useOutlet();\n\n return outlet || <DefaultApiExplorerPage {...props} />;\n};\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { ApiDefinitionWidget } from './components/ApiDefinitionCard/ApiDefinitionWidget';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\nexport const apiDocsConfigRef = createApiRef<ApiDocsConfig>({\n id: 'plugin.api-docs.config',\n});\n\nexport interface ApiDocsConfig {\n getApiDefinitionWidget: (\n apiEntity: ApiEntity,\n ) => ApiDefinitionWidget | undefined;\n}\n","/*\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 React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nexport type PlainApiDefinitionWidgetProps = {\n definition: any;\n language: string;\n};\n\nexport const PlainApiDefinitionWidget = (\n props: PlainApiDefinitionWidgetProps,\n) => {\n return (\n <CodeSnippet\n text={props.definition}\n language={props.language}\n showCopyCodeButton\n />\n );\n};\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { Alert } from '@material-ui/lab';\nimport React from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\n\nimport { CardTab, TabbedCard } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\ntype Props = {\n /** @deprecated The entity is now grabbed from context instead */\n apiEntity?: ApiEntity;\n};\n\nexport const ApiDefinitionCard = (_: Props) => {\n const { entity } = useEntity<ApiEntity>();\n const config = useApi(apiDocsConfigRef);\n const { getApiDefinitionWidget } = config;\n\n if (!entity) {\n return <Alert severity=\"error\">Could not fetch the API</Alert>;\n }\n\n const definitionWidget = getApiDefinitionWidget(entity);\n const entityTitle = entity.metadata.title ?? entity.metadata.name;\n\n if (definitionWidget) {\n return (\n <TabbedCard title={entityTitle}>\n <CardTab label={definitionWidget.title} key=\"widget\">\n {definitionWidget.component(entity.spec.definition)}\n </CardTab>\n <CardTab label=\"Raw\" key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget.rawLanguage || entity.spec.type}\n />\n </CardTab>\n </TabbedCard>\n );\n }\n\n return (\n <TabbedCard\n title={entityTitle}\n children={[\n // Has to be an array, otherwise typescript doesn't like that this has only a single child\n <CardTab label={entity.spec.type} key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={entity.spec.type}\n />\n </CardTab>,\n ]}\n />\n );\n};\n","/*\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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The asyncapi component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyAsyncApiDefinition = React.lazy(() =>\n import('./AsyncApiDefinition').then(m => ({\n default: m.AsyncApiDefinition,\n })),\n);\n\nexport type AsyncApiDefinitionWidgetProps = {\n definition: string;\n};\n\nexport const AsyncApiDefinitionWidget = (\n props: AsyncApiDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyAsyncApiDefinition {...props} />\n </Suspense>\n );\n};\n","/*\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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The graphql component, graphql and related CSS has a significant size, only\n// load it if the element is actually used.\nconst LazyGraphQlDefinition = React.lazy(() =>\n import('./GraphQlDefinition').then(m => ({\n default: m.GraphQlDefinition,\n })),\n);\n\nexport type GraphQlDefinitionWidgetProps = {\n definition: string;\n};\n\nexport const GraphQlDefinitionWidget = (\n props: GraphQlDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyGraphQlDefinition {...props} />\n </Suspense>\n );\n};\n","/*\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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The swagger-ui component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyOpenApiDefinition = React.lazy(() =>\n import('./OpenApiDefinition').then(m => ({\n default: m.OpenApiDefinition,\n })),\n);\n\nexport type OpenApiDefinitionWidgetProps = {\n definition: string;\n};\n\nexport const OpenApiDefinitionWidget = (\n props: OpenApiDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyOpenApiDefinition {...props} />\n </Suspense>\n );\n};\n","/*\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 React from 'react';\nimport { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget';\nimport { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget';\nimport { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget';\n\nexport type ApiDefinitionWidget = {\n type: string;\n title: string;\n component: (definition: string) => React.ReactElement;\n rawLanguage?: string;\n};\n\nexport function defaultDefinitionWidgets(): ApiDefinitionWidget[] {\n return [\n {\n type: 'openapi',\n title: 'OpenAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <OpenApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'asyncapi',\n title: 'AsyncAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <AsyncApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'graphql',\n title: 'GraphQL',\n rawLanguage: 'graphql',\n component: definition => (\n <GraphQlDefinitionWidget definition={definition} />\n ),\n },\n ];\n}\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport React from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { useApi } from '@backstage/core-plugin-api';\n\nexport const ApiTypeTitle = ({ apiEntity }: { apiEntity: ApiEntity }) => {\n const config = useApi(apiDocsConfigRef);\n const definition = config.getApiDefinitionWidget(apiEntity);\n const type = definition ? definition.title : apiEntity.spec.type;\n\n return <span>{type}</span>;\n};\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { ApiTypeTitle } from '../ApiDefinitionCard';\nimport { TableColumn } from '@backstage/core-components';\n\nexport function createSpecApiTypeColumn(): TableColumn<ApiEntity> {\n return {\n title: 'Type',\n field: 'spec.type',\n render: entity => <ApiTypeTitle apiEntity={entity} />,\n };\n}\n\n// TODO: This could be moved to plugin-catalog-react if we wouldn't have a\n// special createSpecApiTypeColumn. But this is required to use ApiTypeTitle to\n// resolve the display name of an entity. Is the display name really worth it?\n\nexport const apiEntityColumns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createSystemColumn(),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ApiEntity,\n Entity,\n RELATION_CONSUMES_API,\n} from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { apiEntityColumns } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: Entity;\n variant?: 'gridItem';\n};\n\nexport const ConsumedApisCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_CONSUMES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Consumed APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Consumed APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Consumed APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not consume any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={apiEntityColumns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n","/*\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 { ApiEntity, RELATION_HAS_PART } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { createSpecApiTypeColumn } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n TableColumn,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n variant?: 'gridItem';\n};\n\nconst columns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\n\nexport const HasApisCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_HAS_PART,\n kind: 'API',\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not contain any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ApiEntity,\n Entity,\n RELATION_PROVIDES_API,\n} from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { apiEntityColumns } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: Entity;\n variant?: 'gridItem';\n};\n\nexport const ProvidedApisCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_PROVIDES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Provided APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Provided APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Provided APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not provide any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={apiEntityColumns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentEntity,\n Entity,\n RELATION_API_CONSUMED_BY,\n} from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: Entity;\n variant?: 'gridItem';\n};\n\nexport const ConsumingComponentsCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_CONSUMED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Consumers\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Consumers\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load components\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Consumers\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n No component consumes this API.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={EntityTable.componentEntityColumns}\n entities={entities as ComponentEntity[]}\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentEntity,\n Entity,\n RELATION_API_PROVIDED_BY,\n} from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n /** @deprecated The entity is now grabbed from context instead */\n entity?: Entity;\n variant?: 'gridItem';\n};\n\nexport const ProvidingComponentsCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_PROVIDED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Providers\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Providers\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load components\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Providers\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n No component provides this API.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={EntityTable.componentEntityColumns}\n entities={entities as ComponentEntity[]}\n />\n );\n};\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { apiDocsConfigRef } from './config';\nimport { registerComponentRouteRef, rootRoute } from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nexport const apiDocsPlugin = createPlugin({\n id: 'api-docs',\n routes: {\n root: rootRoute,\n },\n apis: [\n createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n ],\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n});\n\nexport const ApiExplorerPage = apiDocsPlugin.provide(\n createRoutableExtension({\n name: 'ApiExplorerPage',\n component: () =>\n import('./components/ApiExplorerPage').then(m => m.ApiExplorerIndexPage),\n mountPoint: rootRoute,\n }),\n);\n\nexport const EntityApiDefinitionCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityApiDefinitionCard',\n component: {\n lazy: () =>\n import('./components/ApiDefinitionCard').then(m => m.ApiDefinitionCard),\n },\n }),\n);\n\nexport const EntityConsumedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ConsumedApisCard),\n },\n }),\n);\n\nexport const EntityConsumingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ConsumingComponentsCard,\n ),\n },\n }),\n);\n\nexport const EntityProvidedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ProvidedApisCard),\n },\n }),\n);\n\nexport const EntityProvidingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ProvidingComponentsCard,\n ),\n },\n }),\n);\n\nexport const EntityHasApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityHasApisCard',\n component: {\n lazy: () => import('./components/ApisCards').then(m => m.HasApisCard),\n },\n }),\n);\n"],"names":["ApiExplorerPage"],"mappings":";;;;;;;;;;MAqBa,YAAY,eAAe;AAAA,EACtC,IAAI;AAAA;MAGO,4BAA4B,uBAAuB;AAAA,EAC9D,IAAI;AAAA,EACJ,UAAU;AAAA;;ACmBZ,MAAM,iBAAiD;AAAA,EACrD,aAAa,QAAQ,iBAAiB,EAAE,aAAa;AAAA,EACrD,aAAa,QAAQ;AAAA,EACrB,aAAa,QAAQ;AAAA,EACrB,aAAa,QAAQ;AAAA,EACrB,aAAa,QAAQ;AAAA,EACrB,aAAa,QAAQ;AAAA,EACrB,aAAa,QAAQ;AAAA;MAiBV,yBAAyB,CAAC;AAAA,EACrC,0BAA0B;AAAA,EAC1B;AAAA,EACA;AAAA,MACiC;AA1EnC;AA2EE,QAAM,YAAY,OAAO;AACzB,QAAM,oBAAoB,GACxB,gBAAU,kBAAkB,yBAA5B,YAAoD;AAEtD,QAAM,wBAAwB,YAAY;AAE1C,6CACG,gBAAD;AAAA,IACE,SAAQ;AAAA,IACR,OAAM;AAAA,IACN,UAAU;AAAA,IACV,mBAAkB;AAAA,yCAEjB,SAAD,0CACG,eAAD;AAAA,IAAe,OAAM;AAAA,yCAClB,cAAD;AAAA,IACE,OAAM;AAAA,IACN,IAAI;AAAA,0CAEL,eAAD,MAAe,uDAEhB,oBAAD,0CACG,sBAAD,0CACG,iBAAD,0CACG,kBAAD;AAAA,IAAkB,eAAc;AAAA,IAA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EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,+BAA0B,KAAK,OAAK,EAAE;AAAA;AAAA;MAKxC,gCAAgC,cAAc,QACzD,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,+BAAgC,KACrC,OAAK,EAAE;AAAA;AAAA;MAMJ,yBAAyB,cAAc,QAClD,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,+BAA0B,KAAK,OAAK,EAAE;AAAA;AAAA;MAKxC,gCAAgC,cAAc,QACzD,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,+BAAgC,KACrC,OAAK,EAAE;AAAA;AAAA;MAMJ,oBAAoB,cAAc,QAC7C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAA0B,KAAK,OAAK,EAAE;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/routes.ts","../src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx","../src/components/ApiExplorerPage/ApiExplorerPage.tsx","../src/config.ts","../src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx","../src/components/ApiDefinitionCard/ApiDefinitionCard.tsx","../src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx","../src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx","../src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx","../src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx","../src/components/ApiDefinitionCard/ApiTypeTitle.tsx","../src/components/ApisCards/presets.tsx","../src/components/ApisCards/ConsumedApisCard.tsx","../src/components/ApisCards/HasApisCard.tsx","../src/components/ApisCards/ProvidedApisCard.tsx","../src/components/ComponentsCards/ConsumingComponentsCard.tsx","../src/components/ComponentsCards/ProvidingComponentsCard.tsx","../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const rootRoute = createRouteRef({\n id: 'api-docs',\n});\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n});\n","/*\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 {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CatalogTable,\n CatalogTableRow,\n FilteredEntityLayout,\n EntityListContainer,\n FilterContainer,\n} from '@backstage/plugin-catalog';\nimport {\n EntityKindPicker,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { registerComponentRouteRef } from '../../routes';\n\nconst defaultColumns: TableColumn<CatalogTableRow>[] = [\n CatalogTable.columns.createNameColumn({ defaultKind: 'API' }),\n CatalogTable.columns.createSystemColumn(),\n CatalogTable.columns.createOwnerColumn(),\n CatalogTable.columns.createSpecTypeColumn(),\n CatalogTable.columns.createSpecLifecycleColumn(),\n CatalogTable.columns.createMetadataDescriptionColumn(),\n CatalogTable.columns.createTagsColumn(),\n];\n\n/**\n * DefaultApiExplorerPageProps\n * @public\n */\nexport type DefaultApiExplorerPageProps = {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n};\n\n/**\n * DefaultApiExplorerPage\n * @public\n */\nexport const DefaultApiExplorerPage = ({\n initiallySelectedFilter = 'all',\n columns,\n actions,\n}: DefaultApiExplorerPageProps) => {\n const configApi = useApi(configApiRef);\n const generatedSubtitle = `${\n configApi.getOptionalString('organization.name') ?? 'Backstage'\n } API Explorer`;\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n\n return (\n <PageWithHeader\n themeId=\"apis\"\n title=\"APIs\"\n subtitle={generatedSubtitle}\n pageTitleOverride=\"APIs\"\n >\n <Content>\n <ContentHeader title=\"\">\n <CreateButton\n title=\"Register Existing API\"\n to={registerComponentLink?.()}\n />\n <SupportButton>All your APIs</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <FilteredEntityLayout>\n <FilterContainer>\n <EntityKindPicker initialFilter=\"api\" hidden />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n </FilterContainer>\n <EntityListContainer>\n <CatalogTable\n columns={columns || defaultColumns}\n actions={actions}\n />\n </EntityListContainer>\n </FilteredEntityLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n};\n","/*\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 React from 'react';\nimport { useOutlet } from 'react-router';\nimport {\n DefaultApiExplorerPage,\n DefaultApiExplorerPageProps,\n} from './DefaultApiExplorerPage';\n\n/**\n * ApiExplorerPage\n * @public\n */\nexport const ApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const outlet = useOutlet();\n\n return outlet || <DefaultApiExplorerPage {...props} />;\n};\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { ApiDefinitionWidget } from './components/ApiDefinitionCard/ApiDefinitionWidget';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\nexport const apiDocsConfigRef = createApiRef<ApiDocsConfig>({\n id: 'plugin.api-docs.config',\n});\n\nexport interface ApiDocsConfig {\n getApiDefinitionWidget: (\n apiEntity: ApiEntity,\n ) => ApiDefinitionWidget | undefined;\n}\n","/*\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 React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nexport type PlainApiDefinitionWidgetProps = {\n definition: any;\n language: string;\n};\n\nexport const PlainApiDefinitionWidget = (\n props: PlainApiDefinitionWidgetProps,\n) => {\n return (\n <CodeSnippet\n text={props.definition}\n language={props.language}\n showCopyCodeButton\n />\n );\n};\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { Alert } from '@material-ui/lab';\nimport React from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\n\nimport { CardTab, TabbedCard } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nexport const ApiDefinitionCard = () => {\n const { entity } = useEntity<ApiEntity>();\n const config = useApi(apiDocsConfigRef);\n const { getApiDefinitionWidget } = config;\n\n if (!entity) {\n return <Alert severity=\"error\">Could not fetch the API</Alert>;\n }\n\n const definitionWidget = getApiDefinitionWidget(entity);\n const entityTitle = entity.metadata.title ?? entity.metadata.name;\n\n if (definitionWidget) {\n return (\n <TabbedCard title={entityTitle}>\n <CardTab label={definitionWidget.title} key=\"widget\">\n {definitionWidget.component(entity.spec.definition)}\n </CardTab>\n <CardTab label=\"Raw\" key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget.rawLanguage || entity.spec.type}\n />\n </CardTab>\n </TabbedCard>\n );\n }\n\n return (\n <TabbedCard\n title={entityTitle}\n children={[\n // Has to be an array, otherwise typescript doesn't like that this has only a single child\n <CardTab label={entity.spec.type} key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={entity.spec.type}\n />\n </CardTab>,\n ]}\n />\n );\n};\n","/*\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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The asyncapi component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyAsyncApiDefinition = React.lazy(() =>\n import('./AsyncApiDefinition').then(m => ({\n default: m.AsyncApiDefinition,\n })),\n);\n\nexport type AsyncApiDefinitionWidgetProps = {\n definition: string;\n};\n\nexport const AsyncApiDefinitionWidget = (\n props: AsyncApiDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyAsyncApiDefinition {...props} />\n </Suspense>\n );\n};\n","/*\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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The graphql component, graphql and related CSS has a significant size, only\n// load it if the element is actually used.\nconst LazyGraphQlDefinition = React.lazy(() =>\n import('./GraphQlDefinition').then(m => ({\n default: m.GraphQlDefinition,\n })),\n);\n\nexport type GraphQlDefinitionWidgetProps = {\n definition: string;\n};\n\nexport const GraphQlDefinitionWidget = (\n props: GraphQlDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyGraphQlDefinition {...props} />\n </Suspense>\n );\n};\n","/*\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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The swagger-ui component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyOpenApiDefinition = React.lazy(() =>\n import('./OpenApiDefinition').then(m => ({\n default: m.OpenApiDefinition,\n })),\n);\n\nexport type OpenApiDefinitionWidgetProps = {\n definition: string;\n};\n\nexport const OpenApiDefinitionWidget = (\n props: OpenApiDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyOpenApiDefinition {...props} />\n </Suspense>\n );\n};\n","/*\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 React from 'react';\nimport { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget';\nimport { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget';\nimport { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget';\n\nexport type ApiDefinitionWidget = {\n type: string;\n title: string;\n component: (definition: string) => React.ReactElement;\n rawLanguage?: string;\n};\n\nexport function defaultDefinitionWidgets(): ApiDefinitionWidget[] {\n return [\n {\n type: 'openapi',\n title: 'OpenAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <OpenApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'asyncapi',\n title: 'AsyncAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <AsyncApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'graphql',\n title: 'GraphQL',\n rawLanguage: 'graphql',\n component: definition => (\n <GraphQlDefinitionWidget definition={definition} />\n ),\n },\n ];\n}\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport React from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { useApi } from '@backstage/core-plugin-api';\n\nexport const ApiTypeTitle = ({ apiEntity }: { apiEntity: ApiEntity }) => {\n const config = useApi(apiDocsConfigRef);\n const definition = config.getApiDefinitionWidget(apiEntity);\n const type = definition ? definition.title : apiEntity.spec.type;\n\n return <span>{type}</span>;\n};\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { ApiTypeTitle } from '../ApiDefinitionCard';\nimport { TableColumn } from '@backstage/core-components';\n\nexport function createSpecApiTypeColumn(): TableColumn<ApiEntity> {\n return {\n title: 'Type',\n field: 'spec.type',\n render: entity => <ApiTypeTitle apiEntity={entity} />,\n };\n}\n\n// TODO: This could be moved to plugin-catalog-react if we wouldn't have a\n// special createSpecApiTypeColumn. But this is required to use ApiTypeTitle to\n// resolve the display name of an entity. Is the display name really worth it?\n\nexport const apiEntityColumns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createSystemColumn(),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\n","/*\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 { ApiEntity, RELATION_CONSUMES_API } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { apiEntityColumns } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n variant?: 'gridItem';\n};\n\nexport const ConsumedApisCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_CONSUMES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Consumed APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Consumed APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Consumed APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not consume any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={apiEntityColumns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n","/*\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 { ApiEntity, RELATION_HAS_PART } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { createSpecApiTypeColumn } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n TableColumn,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n variant?: 'gridItem';\n};\n\nconst columns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\n\nexport const HasApisCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_HAS_PART,\n kind: 'API',\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not contain any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n","/*\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 { ApiEntity, RELATION_PROVIDES_API } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { apiEntityColumns } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n variant?: 'gridItem';\n};\n\nexport const ProvidedApisCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_PROVIDES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Provided APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Provided APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Provided APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not provide any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={apiEntityColumns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentEntity,\n RELATION_API_CONSUMED_BY,\n} from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n variant?: 'gridItem';\n};\n\nexport const ConsumingComponentsCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_CONSUMED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Consumers\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Consumers\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load components\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Consumers\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n No component consumes this API.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={EntityTable.componentEntityColumns}\n entities={entities as ComponentEntity[]}\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentEntity,\n RELATION_API_PROVIDED_BY,\n} from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n CodeSnippet,\n InfoCard,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\ntype Props = {\n variant?: 'gridItem';\n};\n\nexport const ProvidingComponentsCard = ({ variant = 'gridItem' }: Props) => {\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_PROVIDED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Providers\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Providers\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load components\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Providers\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n No component provides this API.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={EntityTable.componentEntityColumns}\n entities={entities as ComponentEntity[]}\n />\n );\n};\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { apiDocsConfigRef } from './config';\nimport { registerComponentRouteRef, rootRoute } from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nexport const apiDocsPlugin = createPlugin({\n id: 'api-docs',\n routes: {\n root: rootRoute,\n },\n apis: [\n createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n ],\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n});\n\nexport const ApiExplorerPage = apiDocsPlugin.provide(\n createRoutableExtension({\n name: 'ApiExplorerPage',\n component: () =>\n import('./components/ApiExplorerPage').then(m => m.ApiExplorerIndexPage),\n mountPoint: rootRoute,\n }),\n);\n\nexport const EntityApiDefinitionCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityApiDefinitionCard',\n component: {\n lazy: () =>\n import('./components/ApiDefinitionCard').then(m => m.ApiDefinitionCard),\n },\n }),\n);\n\nexport const EntityConsumedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ConsumedApisCard),\n },\n }),\n);\n\nexport const EntityConsumingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ConsumingComponentsCard,\n ),\n },\n }),\n);\n\nexport const EntityProvidedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ProvidedApisCard),\n },\n }),\n);\n\nexport const EntityProvidingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ProvidingComponentsCard,\n ),\n },\n }),\n);\n\nexport const EntityHasApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityHasApisCard',\n component: {\n lazy: () => import('./components/ApisCards').then(m => m.HasApisCard),\n },\n }),\n);\n"],"names":["ApiExplorerPage"],"mappings":";;;;;;;;;;MAqBa,YAAY,eAAe;AAAA,EACtC,IAAI;AAAA;MAGO,4BAA4B,uBAAuB;AAAA,EAC9D,IAAI;AAAA,EACJ,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E;AAAA;AAAA;MAMJ,oBAAoB,cAAc,QAC7C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,+BAA0B,KAAK,OAAK,EAAE;AAAA;AAAA;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-api-docs",
3
3
  "description": "A Backstage plugin that helps represent API entities in the frontend",
4
- "version": "0.7.3",
4
+ "version": "0.8.0",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -33,12 +33,12 @@
33
33
  "clean": "backstage-cli package clean"
34
34
  },
35
35
  "dependencies": {
36
- "@asyncapi/react-component": "1.0.0-next.32",
37
- "@backstage/catalog-model": "^0.10.0",
38
- "@backstage/core-components": "^0.8.9",
39
- "@backstage/core-plugin-api": "^0.6.1",
40
- "@backstage/plugin-catalog": "^0.8.0",
41
- "@backstage/plugin-catalog-react": "^0.6.15",
36
+ "@asyncapi/react-component": "1.0.0-next.33",
37
+ "@backstage/catalog-model": "^0.11.0",
38
+ "@backstage/core-components": "^0.8.10",
39
+ "@backstage/core-plugin-api": "^0.7.0",
40
+ "@backstage/plugin-catalog": "^0.9.0",
41
+ "@backstage/plugin-catalog-react": "^0.7.0",
42
42
  "@backstage/theme": "^0.2.15",
43
43
  "@material-ui/core": "^4.12.2",
44
44
  "@material-ui/icons": "^4.9.1",
@@ -56,10 +56,10 @@
56
56
  "react": "^16.13.1 || ^17.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@backstage/cli": "^0.14.0",
60
- "@backstage/core-app-api": "^0.5.3",
61
- "@backstage/dev-utils": "^0.2.22",
62
- "@backstage/test-utils": "^0.2.5",
59
+ "@backstage/cli": "^0.14.1",
60
+ "@backstage/core-app-api": "^0.5.4",
61
+ "@backstage/dev-utils": "^0.2.23",
62
+ "@backstage/test-utils": "^0.2.6",
63
63
  "@testing-library/jest-dom": "^5.10.1",
64
64
  "@testing-library/react": "^11.2.5",
65
65
  "@testing-library/user-event": "^13.1.8",
@@ -72,5 +72,5 @@
72
72
  "files": [
73
73
  "dist"
74
74
  ],
75
- "gitHead": "4805c3d13ce9bfc369e53c271b1b95e722b3b4dc"
75
+ "gitHead": "a15da6ea1e3e8adc37be98be064071c8b5279b4a"
76
76
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-1dc3ed84.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-446e3e5c.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-8a745bfb.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-d40626b4.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}