@backstage/plugin-api-docs 0.6.15 → 0.6.19

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 (28) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +8 -0
  3. package/dist/esm/AsyncApiDefinition-c39ae15d.esm.js +133 -0
  4. package/dist/esm/AsyncApiDefinition-c39ae15d.esm.js.map +1 -0
  5. package/dist/esm/{GraphQlDefinition-547f34fe.esm.js → GraphQlDefinition-fa85d425.esm.js} +2 -2
  6. package/dist/esm/{GraphQlDefinition-547f34fe.esm.js.map → GraphQlDefinition-fa85d425.esm.js.map} +1 -1
  7. package/dist/esm/OpenApiDefinition-48ae3040.esm.js +131 -0
  8. package/dist/esm/OpenApiDefinition-48ae3040.esm.js.map +1 -0
  9. package/dist/esm/{index-7242d6e8.esm.js → index-0bbaf1ad.esm.js} +2 -2
  10. package/dist/esm/index-0bbaf1ad.esm.js.map +1 -0
  11. package/dist/esm/{index-1ce8aa22.esm.js → index-59179174.esm.js} +2 -2
  12. package/dist/esm/index-59179174.esm.js.map +1 -0
  13. package/dist/esm/{index-1ecbbed9.esm.js → index-61a0b1ae.esm.js} +3 -3
  14. package/dist/esm/{index-1ecbbed9.esm.js.map → index-61a0b1ae.esm.js.map} +1 -1
  15. package/dist/esm/{index-ac0c1f1e.esm.js → index-be2646c3.esm.js} +37 -38
  16. package/dist/esm/index-be2646c3.esm.js.map +1 -0
  17. package/dist/esm/{index-176f44ac.esm.js → index-dce83687.esm.js} +2 -2
  18. package/dist/esm/index-dce83687.esm.js.map +1 -0
  19. package/dist/index.esm.js +1 -1
  20. package/package.json +18 -17
  21. package/dist/esm/AsyncApiDefinition-21854d8d.esm.js +0 -116
  22. package/dist/esm/AsyncApiDefinition-21854d8d.esm.js.map +0 -1
  23. package/dist/esm/OpenApiDefinition-2b13c691.esm.js +0 -111
  24. package/dist/esm/OpenApiDefinition-2b13c691.esm.js.map +0 -1
  25. package/dist/esm/index-176f44ac.esm.js.map +0 -1
  26. package/dist/esm/index-1ce8aa22.esm.js.map +0 -1
  27. package/dist/esm/index-7242d6e8.esm.js.map +0 -1
  28. package/dist/esm/index-ac0c1f1e.esm.js.map +0 -1
@@ -7,8 +7,7 @@ import { RELATION_CONSUMES_API, RELATION_HAS_PART, RELATION_PROVIDES_API, RELATI
7
7
  import { Typography } from '@material-ui/core';
8
8
 
9
9
  const apiDocsConfigRef = createApiRef({
10
- id: "plugin.api-docs.config",
11
- description: "Used to configure api-docs widgets"
10
+ id: "plugin.api-docs.config"
12
11
  });
13
12
 
14
13
  const PlainApiDefinitionWidget = (props) => {
@@ -20,9 +19,9 @@ const PlainApiDefinitionWidget = (props) => {
20
19
  };
21
20
 
22
21
  const ApiDefinitionCard = (_) => {
23
- const {entity} = useEntity();
22
+ const { entity } = useEntity();
24
23
  const config = useApi(apiDocsConfigRef);
25
- const {getApiDefinitionWidget} = config;
24
+ const { getApiDefinitionWidget } = config;
26
25
  if (!entity) {
27
26
  return /* @__PURE__ */ React.createElement(Alert, {
28
27
  severity: "error"
@@ -57,7 +56,7 @@ const ApiDefinitionCard = (_) => {
57
56
  });
58
57
  };
59
58
 
60
- const LazyAsyncApiDefinition = React.lazy(() => import('./AsyncApiDefinition-21854d8d.esm.js').then((m) => ({
59
+ const LazyAsyncApiDefinition = React.lazy(() => import('./AsyncApiDefinition-c39ae15d.esm.js').then((m) => ({
61
60
  default: m.AsyncApiDefinition
62
61
  })));
63
62
  const AsyncApiDefinitionWidget = (props) => {
@@ -68,7 +67,7 @@ const AsyncApiDefinitionWidget = (props) => {
68
67
  }));
69
68
  };
70
69
 
71
- const LazyGraphQlDefinition = React.lazy(() => import('./GraphQlDefinition-547f34fe.esm.js').then((m) => ({
70
+ const LazyGraphQlDefinition = React.lazy(() => import('./GraphQlDefinition-fa85d425.esm.js').then((m) => ({
72
71
  default: m.GraphQlDefinition
73
72
  })));
74
73
  const GraphQlDefinitionWidget = (props) => {
@@ -79,7 +78,7 @@ const GraphQlDefinitionWidget = (props) => {
79
78
  }));
80
79
  };
81
80
 
82
- const LazyOpenApiDefinition = React.lazy(() => import('./OpenApiDefinition-2b13c691.esm.js').then((m) => ({
81
+ const LazyOpenApiDefinition = React.lazy(() => import('./OpenApiDefinition-48ae3040.esm.js').then((m) => ({
83
82
  default: m.OpenApiDefinition
84
83
  })));
85
84
  const OpenApiDefinitionWidget = (props) => {
@@ -119,7 +118,7 @@ function defaultDefinitionWidgets() {
119
118
  ];
120
119
  }
121
120
 
122
- const ApiTypeTitle = ({apiEntity}) => {
121
+ const ApiTypeTitle = ({ apiEntity }) => {
123
122
  const config = useApi(apiDocsConfigRef);
124
123
  const definition = config.getApiDefinitionWidget(apiEntity);
125
124
  const type = definition ? definition.title : apiEntity.spec.type;
@@ -136,7 +135,7 @@ function createSpecApiTypeColumn() {
136
135
  };
137
136
  }
138
137
  const apiEntityColumns = [
139
- EntityTable.columns.createEntityRefColumn({defaultKind: "API"}),
138
+ EntityTable.columns.createEntityRefColumn({ defaultKind: "API" }),
140
139
  EntityTable.columns.createSystemColumn(),
141
140
  EntityTable.columns.createOwnerColumn(),
142
141
  createSpecApiTypeColumn(),
@@ -144,9 +143,9 @@ const apiEntityColumns = [
144
143
  EntityTable.columns.createMetadataDescriptionColumn()
145
144
  ];
146
145
 
147
- const ConsumedApisCard = ({variant = "gridItem"}) => {
148
- const {entity} = useEntity();
149
- const {entities, loading, error} = useRelatedEntities(entity, {
146
+ const ConsumedApisCard = ({ variant = "gridItem" }) => {
147
+ const { entity } = useEntity();
148
+ const { entities, loading, error } = useRelatedEntities(entity, {
150
149
  type: RELATION_CONSUMES_API
151
150
  });
152
151
  if (loading) {
@@ -172,7 +171,7 @@ const ConsumedApisCard = ({variant = "gridItem"}) => {
172
171
  title: "Consumed APIs",
173
172
  variant,
174
173
  emptyContent: /* @__PURE__ */ React.createElement("div", {
175
- style: {textAlign: "center"}
174
+ style: { textAlign: "center" }
176
175
  }, /* @__PURE__ */ React.createElement(Typography, {
177
176
  variant: "body1"
178
177
  }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not consume any APIs."), /* @__PURE__ */ React.createElement(Typography, {
@@ -186,15 +185,15 @@ const ConsumedApisCard = ({variant = "gridItem"}) => {
186
185
  };
187
186
 
188
187
  const columns = [
189
- EntityTable.columns.createEntityRefColumn({defaultKind: "API"}),
188
+ EntityTable.columns.createEntityRefColumn({ defaultKind: "API" }),
190
189
  EntityTable.columns.createOwnerColumn(),
191
190
  createSpecApiTypeColumn(),
192
191
  EntityTable.columns.createSpecLifecycleColumn(),
193
192
  EntityTable.columns.createMetadataDescriptionColumn()
194
193
  ];
195
- const HasApisCard = ({variant = "gridItem"}) => {
196
- const {entity} = useEntity();
197
- const {entities, loading, error} = useRelatedEntities(entity, {
194
+ const HasApisCard = ({ variant = "gridItem" }) => {
195
+ const { entity } = useEntity();
196
+ const { entities, loading, error } = useRelatedEntities(entity, {
198
197
  type: RELATION_HAS_PART,
199
198
  kind: "API"
200
199
  });
@@ -221,7 +220,7 @@ const HasApisCard = ({variant = "gridItem"}) => {
221
220
  title: "APIs",
222
221
  variant,
223
222
  emptyContent: /* @__PURE__ */ React.createElement("div", {
224
- style: {textAlign: "center"}
223
+ style: { textAlign: "center" }
225
224
  }, /* @__PURE__ */ React.createElement(Typography, {
226
225
  variant: "body1"
227
226
  }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not contain any APIs."), /* @__PURE__ */ React.createElement(Typography, {
@@ -234,9 +233,9 @@ const HasApisCard = ({variant = "gridItem"}) => {
234
233
  });
235
234
  };
236
235
 
237
- const ProvidedApisCard = ({variant = "gridItem"}) => {
238
- const {entity} = useEntity();
239
- const {entities, loading, error} = useRelatedEntities(entity, {
236
+ const ProvidedApisCard = ({ variant = "gridItem" }) => {
237
+ const { entity } = useEntity();
238
+ const { entities, loading, error } = useRelatedEntities(entity, {
240
239
  type: RELATION_PROVIDES_API
241
240
  });
242
241
  if (loading) {
@@ -262,7 +261,7 @@ const ProvidedApisCard = ({variant = "gridItem"}) => {
262
261
  title: "Provided APIs",
263
262
  variant,
264
263
  emptyContent: /* @__PURE__ */ React.createElement("div", {
265
- style: {textAlign: "center"}
264
+ style: { textAlign: "center" }
266
265
  }, /* @__PURE__ */ React.createElement(Typography, {
267
266
  variant: "body1"
268
267
  }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not provide any APIs."), /* @__PURE__ */ React.createElement(Typography, {
@@ -275,9 +274,9 @@ const ProvidedApisCard = ({variant = "gridItem"}) => {
275
274
  });
276
275
  };
277
276
 
278
- const ConsumingComponentsCard = ({variant = "gridItem"}) => {
279
- const {entity} = useEntity();
280
- const {entities, loading, error} = useRelatedEntities(entity, {
277
+ const ConsumingComponentsCard = ({ variant = "gridItem" }) => {
278
+ const { entity } = useEntity();
279
+ const { entities, loading, error } = useRelatedEntities(entity, {
281
280
  type: RELATION_API_CONSUMED_BY
282
281
  });
283
282
  if (loading) {
@@ -303,7 +302,7 @@ const ConsumingComponentsCard = ({variant = "gridItem"}) => {
303
302
  title: "Consumers",
304
303
  variant,
305
304
  emptyContent: /* @__PURE__ */ React.createElement("div", {
306
- style: {textAlign: "center"}
305
+ style: { textAlign: "center" }
307
306
  }, /* @__PURE__ */ React.createElement(Typography, {
308
307
  variant: "body1"
309
308
  }, "No component consumes this API."), /* @__PURE__ */ React.createElement(Typography, {
@@ -316,9 +315,9 @@ const ConsumingComponentsCard = ({variant = "gridItem"}) => {
316
315
  });
317
316
  };
318
317
 
319
- const ProvidingComponentsCard = ({variant = "gridItem"}) => {
320
- const {entity} = useEntity();
321
- const {entities, loading, error} = useRelatedEntities(entity, {
318
+ const ProvidingComponentsCard = ({ variant = "gridItem" }) => {
319
+ const { entity } = useEntity();
320
+ const { entities, loading, error } = useRelatedEntities(entity, {
322
321
  type: RELATION_API_PROVIDED_BY
323
322
  });
324
323
  if (loading) {
@@ -344,7 +343,7 @@ const ProvidingComponentsCard = ({variant = "gridItem"}) => {
344
343
  title: "Providers",
345
344
  variant,
346
345
  emptyContent: /* @__PURE__ */ React.createElement("div", {
347
- style: {textAlign: "center"}
346
+ style: { textAlign: "center" }
348
347
  }, /* @__PURE__ */ React.createElement(Typography, {
349
348
  variant: "body1"
350
349
  }, "No component provides this API."), /* @__PURE__ */ React.createElement(Typography, {
@@ -390,45 +389,45 @@ const apiDocsPlugin = createPlugin({
390
389
  });
391
390
  const ApiExplorerPage = apiDocsPlugin.provide(createRoutableExtension({
392
391
  name: "ApiExplorerPage",
393
- component: () => import('./index-1ecbbed9.esm.js').then((m) => m.ApiExplorerPage),
392
+ component: () => import('./index-61a0b1ae.esm.js').then((m) => m.ApiExplorerPage),
394
393
  mountPoint: rootRoute
395
394
  }));
396
395
  const EntityApiDefinitionCard = apiDocsPlugin.provide(createComponentExtension({
397
396
  name: "EntityApiDefinitionCard",
398
397
  component: {
399
- lazy: () => import('./index-176f44ac.esm.js').then((m) => m.ApiDefinitionCard)
398
+ lazy: () => import('./index-dce83687.esm.js').then((m) => m.ApiDefinitionCard)
400
399
  }
401
400
  }));
402
401
  const EntityConsumedApisCard = apiDocsPlugin.provide(createComponentExtension({
403
402
  name: "EntityConsumedApisCard",
404
403
  component: {
405
- lazy: () => import('./index-7242d6e8.esm.js').then((m) => m.ConsumedApisCard)
404
+ lazy: () => import('./index-0bbaf1ad.esm.js').then((m) => m.ConsumedApisCard)
406
405
  }
407
406
  }));
408
407
  const EntityConsumingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
409
408
  name: "EntityConsumingComponentsCard",
410
409
  component: {
411
- lazy: () => import('./index-1ce8aa22.esm.js').then((m) => m.ConsumingComponentsCard)
410
+ lazy: () => import('./index-59179174.esm.js').then((m) => m.ConsumingComponentsCard)
412
411
  }
413
412
  }));
414
413
  const EntityProvidedApisCard = apiDocsPlugin.provide(createComponentExtension({
415
414
  name: "EntityProvidedApisCard",
416
415
  component: {
417
- lazy: () => import('./index-7242d6e8.esm.js').then((m) => m.ProvidedApisCard)
416
+ lazy: () => import('./index-0bbaf1ad.esm.js').then((m) => m.ProvidedApisCard)
418
417
  }
419
418
  }));
420
419
  const EntityProvidingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
421
420
  name: "EntityProvidingComponentsCard",
422
421
  component: {
423
- lazy: () => import('./index-1ce8aa22.esm.js').then((m) => m.ProvidingComponentsCard)
422
+ lazy: () => import('./index-59179174.esm.js').then((m) => m.ProvidingComponentsCard)
424
423
  }
425
424
  }));
426
425
  const EntityHasApisCard = apiDocsPlugin.provide(createComponentExtension({
427
426
  name: "EntityHasApisCard",
428
427
  component: {
429
- lazy: () => import('./index-7242d6e8.esm.js').then((m) => m.HasApisCard)
428
+ lazy: () => import('./index-0bbaf1ad.esm.js').then((m) => m.HasApisCard)
430
429
  }
431
430
  }));
432
431
 
433
432
  export { ApiDefinitionCard as A, ConsumedApisCard as C, EntityApiDefinitionCard as E, HasApisCard as H, OpenApiDefinitionWidget as O, ProvidedApisCard as P, ApiTypeTitle as a, ConsumingComponentsCard as b, createComponentRouteRef as c, defaultDefinitionWidgets as d, ProvidingComponentsCard as e, apiDocsConfigRef as f, apiDocsPlugin as g, ApiExplorerPage as h, EntityConsumedApisCard as i, EntityConsumingComponentsCard as j, EntityHasApisCard as k, EntityProvidedApisCard as l, EntityProvidingComponentsCard as m, AsyncApiDefinitionWidget as n, PlainApiDefinitionWidget as o };
434
- //# sourceMappingURL=index-ac0c1f1e.esm.js.map
433
+ //# sourceMappingURL=index-be2646c3.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-be2646c3.esm.js","sources":["../../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/routes.ts","../../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 { 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\n if (definitionWidget) {\n return (\n <TabbedCard title={entity.metadata.name}>\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={entity.metadata.name}\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 {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const rootRoute = createRouteRef({\n id: 'api-docs',\n});\n\nexport const createComponentRouteRef = createExternalRouteRef({\n id: 'create-component',\n optional: true,\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 { createComponentRouteRef, 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 createComponent: createComponentRouteRef,\n },\n});\n\nexport const ApiExplorerPage = apiDocsPlugin.provide(\n createRoutableExtension({\n name: 'ApiExplorerPage',\n component: () =>\n import('./components/ApiExplorerPage').then(m => m.ApiExplorerPage),\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":[],"mappings":";;;;;;;;MAoBa,mBAAmB,aAA4B;AAAA,EAC1D,IAAI;AAAA;;MCGO,2BAA2B,CACtC,UACG;AACH,6CACG,aAAD;AAAA,IACE,MAAM,MAAM;AAAA,IACZ,UAAU,MAAM;AAAA,IAChB,oBAAkB;AAAA;AAAA;;MCAX,oBAAoB,CAAC,MAAa;AAC7C,QAAM,EAAE,WAAW;AACnB,QAAM,SAAS,OAAO;AACtB,QAAM,EAAE,2BAA2B;AAEnC,MAAI,CAAC,QAAQ;AACX,+CAAQ,OAAD;AAAA,MAAO,UAAS;AAAA,OAAQ;AAAA;AAGjC,QAAM,mBAAmB,uBAAuB;AAEhD,MAAI,kBAAkB;AACpB,+CACG,YAAD;AAAA,MAAY,OAAO,OAAO,SAAS;AAAA,2CAChC,SAAD;AAAA,MAAS,OAAO,iBAAiB;AAAA,MAAO,KAAI;AAAA,OACzC,iBAAiB,UAAU,OAAO,KAAK,kDAEzC,SAAD;AAAA,MAAS,OAAM;AAAA,MAAM,KAAI;AAAA,2CACtB,0BAAD;AAAA,MACE,YAAY,OAAO,KAAK;AAAA,MACxB,UAAU,iBAAiB,eAAe,OAAO,KAAK;AAAA;AAAA;AAOhE,6CACG,YAAD;AAAA,IACE,OAAO,OAAO,SAAS;AAAA,IACvB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W,MACT,OAAO,2BAAgC,KAAK,OAAK,EAAE;AAAA,EACrD,YAAY;AAAA;MAIH,0BAA0B,cAAc,QACnD,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,2BAAkC,KAAK,OAAK,EAAE;AAAA;AAAA;MAKhD,yBAAyB,cAAc,QAClD,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,2BAA0B,KAAK,OAAK,EAAE;AAAA;AAAA;MAKxC,gCAAgC,cAAc,QACzD,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,2BAAgC,KACrC,OAAK,EAAE;AAAA;AAAA;MAMJ,yBAAyB,cAAc,QAClD,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,2BAA0B,KAAK,OAAK,EAAE;AAAA;AAAA;MAKxC,gCAAgC,cAAc,QACzD,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MACJ,OAAO,2BAAgC,KACrC,OAAK,EAAE;AAAA;AAAA;MAMJ,oBAAoB,cAAc,QAC7C,yBAAyB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,IACT,MAAM,MAAM,OAAO,2BAA0B,KAAK,OAAK,EAAE;AAAA;AAAA;;;;"}
@@ -1,4 +1,4 @@
1
- export { A as ApiDefinitionCard, a as ApiTypeTitle, d as defaultDefinitionWidgets } from './index-ac0c1f1e.esm.js';
1
+ export { A as ApiDefinitionCard, a as ApiTypeTitle, d as defaultDefinitionWidgets } from './index-be2646c3.esm.js';
2
2
  import '@backstage/plugin-catalog-react';
3
3
  import '@material-ui/lab';
4
4
  import 'react';
@@ -6,4 +6,4 @@ import '@backstage/core-plugin-api';
6
6
  import '@backstage/core-components';
7
7
  import '@backstage/catalog-model';
8
8
  import '@material-ui/core';
9
- //# sourceMappingURL=index-176f44ac.esm.js.map
9
+ //# sourceMappingURL=index-dce83687.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-dce83687.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ApiDefinitionCard, h as ApiExplorerPage, a as ApiTypeTitle, n as AsyncApiDefinitionWidget, C as ConsumedApisCard, b as ConsumingComponentsCard, E as EntityApiDefinitionCard, i as EntityConsumedApisCard, j as EntityConsumingComponentsCard, k as EntityHasApisCard, l as EntityProvidedApisCard, m as EntityProvidingComponentsCard, H as HasApisCard, O as OpenApiDefinitionWidget, o as PlainApiDefinitionWidget, P as ProvidedApisCard, e as ProvidingComponentsCard, f as apiDocsConfigRef, g as apiDocsPlugin, d as defaultDefinitionWidgets, g as plugin } from './esm/index-ac0c1f1e.esm.js';
1
+ export { A as ApiDefinitionCard, h as ApiExplorerPage, a as ApiTypeTitle, n as AsyncApiDefinitionWidget, C as ConsumedApisCard, b as ConsumingComponentsCard, E as EntityApiDefinitionCard, i as EntityConsumedApisCard, j as EntityConsumingComponentsCard, k as EntityHasApisCard, l as EntityProvidedApisCard, m as EntityProvidingComponentsCard, H as HasApisCard, O as OpenApiDefinitionWidget, o as PlainApiDefinitionWidget, P as ProvidedApisCard, e as ProvidingComponentsCard, f as apiDocsConfigRef, g as apiDocsPlugin, d as defaultDefinitionWidgets, g as plugin } from './esm/index-be2646c3.esm.js';
2
2
  import '@backstage/plugin-catalog-react';
3
3
  import '@material-ui/lab';
4
4
  import 'react';
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.6.15",
4
+ "version": "0.6.19",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -30,33 +30,34 @@
30
30
  "clean": "backstage-cli clean"
31
31
  },
32
32
  "dependencies": {
33
- "@asyncapi/react-component": "^0.23.0",
33
+ "@asyncapi/react-component": "^1.0.0-next.25",
34
34
  "@backstage/catalog-model": "^0.9.7",
35
- "@backstage/core-components": "^0.7.5",
36
- "@backstage/core-plugin-api": "^0.2.1",
37
- "@backstage/plugin-catalog": "^0.7.3",
38
- "@backstage/plugin-catalog-react": "^0.6.4",
39
- "@backstage/theme": "^0.2.13",
35
+ "@backstage/core-components": "^0.8.2",
36
+ "@backstage/core-plugin-api": "^0.4.0",
37
+ "@backstage/plugin-catalog": "^0.7.5",
38
+ "@backstage/plugin-catalog-react": "^0.6.8",
39
+ "@backstage/theme": "^0.2.14",
40
40
  "@material-ui/core": "^4.12.2",
41
41
  "@material-ui/icons": "^4.9.1",
42
42
  "@material-ui/lab": "4.0.0-alpha.57",
43
- "@types/react": "*",
44
- "graphiql": "^1.0.0-alpha.10",
45
- "graphql": "^15.3.0",
43
+ "graphiql": "^1.5.12",
44
+ "graphql": "^16.0.0",
46
45
  "isomorphic-form-data": "^2.0.0",
47
- "react": "^16.13.1",
48
- "react-dom": "^16.13.1",
49
46
  "react-router": "6.0.0-beta.0",
50
47
  "react-router-dom": "6.0.0-beta.0",
51
48
  "react-use": "^17.2.4",
52
49
  "swagger-client": "3.16.1",
53
50
  "swagger-ui-react": "^4.0.0-rc.3"
54
51
  },
52
+ "peerDependencies": {
53
+ "@types/react": "^16.13.1 || ^17.0.0",
54
+ "react": "^16.13.1 || ^17.0.0"
55
+ },
55
56
  "devDependencies": {
56
- "@backstage/cli": "^0.9.1",
57
- "@backstage/core-app-api": "^0.1.23",
58
- "@backstage/dev-utils": "^0.2.13",
59
- "@backstage/test-utils": "^0.1.23",
57
+ "@backstage/cli": "^0.10.3",
58
+ "@backstage/core-app-api": "^0.3.0",
59
+ "@backstage/dev-utils": "^0.2.15",
60
+ "@backstage/test-utils": "^0.2.0",
60
61
  "@testing-library/jest-dom": "^5.10.1",
61
62
  "@testing-library/react": "^11.2.5",
62
63
  "@testing-library/user-event": "^13.1.8",
@@ -69,5 +70,5 @@
69
70
  "files": [
70
71
  "dist"
71
72
  ],
72
- "gitHead": "85c127e436a24140bb3606f17f034f82aa9c7c0d"
73
+ "gitHead": "b315430f9dfcfa19ab0dd90f5b4ac6904938fba7"
73
74
  }
@@ -1,116 +0,0 @@
1
- import AsyncApi from '@asyncapi/react-component';
2
- import '@asyncapi/react-component/lib/styles/fiori.css';
3
- import { makeStyles, alpha } from '@material-ui/core/styles';
4
- import React from 'react';
5
-
6
- const useStyles = makeStyles((theme) => ({
7
- root: {
8
- "& .asyncapi": {
9
- "font-family": "inherit",
10
- background: "none"
11
- },
12
- "& h2": {
13
- ...theme.typography.h6
14
- },
15
- "& .text-teal": {
16
- color: theme.palette.primary.main
17
- },
18
- "& button": {
19
- ...theme.typography.button,
20
- background: "none",
21
- boxSizing: "border-box",
22
- minWidth: 64,
23
- borderRadius: theme.shape.borderRadius,
24
- transition: theme.transitions.create(["background-color", "box-shadow", "border"], {
25
- duration: theme.transitions.duration.short
26
- }),
27
- padding: "5px 15px",
28
- color: theme.palette.primary.main,
29
- border: `1px solid ${alpha(theme.palette.primary.main, 0.5)}`,
30
- "&:hover": {
31
- textDecoration: "none",
32
- "&.Mui-disabled": {
33
- backgroundColor: "transparent"
34
- },
35
- border: `1px solid ${theme.palette.primary.main}`,
36
- backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),
37
- "@media (hover: none)": {
38
- backgroundColor: "transparent"
39
- }
40
- },
41
- "&.Mui-disabled": {
42
- color: theme.palette.action.disabled
43
- }
44
- },
45
- "& .asyncapi__collapse-button:hover": {
46
- color: theme.palette.primary.main
47
- },
48
- "& button.asyncapi__toggle-button": {
49
- "min-width": "inherit"
50
- },
51
- "& .asyncapi__info-list li": {
52
- "border-color": theme.palette.primary.main,
53
- "&:hover": {
54
- color: theme.palette.text.primary,
55
- "border-color": theme.palette.primary.main,
56
- "background-color": theme.palette.primary.main
57
- }
58
- },
59
- "& .asyncapi__info-list li a": {
60
- color: theme.palette.primary.main,
61
- "&:hover": {
62
- color: theme.palette.getContrastText(theme.palette.primary.main)
63
- }
64
- },
65
- "& .asyncapi__enum": {
66
- color: theme.palette.secondary.main
67
- },
68
- "& .asyncapi__info, .asyncapi__channel, .asyncapi__channels > div, .asyncapi__schema, .asyncapi__channel-operations-list .asyncapi__messages-list-item .asyncapi__message, .asyncapi__message, .asyncapi__server, .asyncapi__servers > div, .asyncapi__messages > div, .asyncapi__schemas > div": {
69
- "background-color": "inherit"
70
- },
71
- "& .asyncapi__channel-parameters-header, .asyncapi__channel-operations-header, .asyncapi__channel-operation-oneOf-subscribe-header, .asyncapi__channel-operation-oneOf-publish-header, .asyncapi__channel-operation-message-header, .asyncapi__message-header, .asyncapi__message-header-title, .asyncapi__message-header-title > h3, .asyncapi__bindings, .asyncapi__bindings-header, .asyncapi__bindings-header > h4": {
72
- "background-color": "inherit",
73
- color: theme.palette.text.primary
74
- },
75
- "& .asyncapi__additional-properties-notice": {
76
- color: theme.palette.text.hint
77
- },
78
- "& .asyncapi__code, .asyncapi__code-pre": {
79
- background: theme.palette.background.default
80
- },
81
- "& .asyncapi__schema-example-header-title": {
82
- color: theme.palette.text.secondary
83
- },
84
- "& .asyncapi__message-headers-header, .asyncapi__message-payload-header, .asyncapi__server-variables-header, .asyncapi__server-security-header": {
85
- "background-color": "inherit",
86
- color: theme.palette.text.secondary
87
- },
88
- "& .asyncapi__table-header": {
89
- background: theme.palette.background.default
90
- },
91
- "& .asyncapi__table-body": {
92
- color: theme.palette.text.primary
93
- },
94
- "& .asyncapi__server-security-flow": {
95
- background: theme.palette.background.default,
96
- border: "none"
97
- },
98
- "& .asyncapi__server-security-flows-list a": {
99
- color: theme.palette.primary.main
100
- },
101
- "& .asyncapi__table-row--nested": {
102
- color: theme.palette.text.secondary
103
- }
104
- }
105
- }));
106
- const AsyncApiDefinition = ({definition}) => {
107
- const classes = useStyles();
108
- return /* @__PURE__ */ React.createElement("div", {
109
- className: classes.root
110
- }, /* @__PURE__ */ React.createElement(AsyncApi, {
111
- schema: definition
112
- }));
113
- };
114
-
115
- export { AsyncApiDefinition };
116
- //# sourceMappingURL=AsyncApiDefinition-21854d8d.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AsyncApiDefinition-21854d8d.esm.js","sources":["../../src/components/AsyncApiDefinitionWidget/AsyncApiDefinition.tsx"],"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 AsyncApi from '@asyncapi/react-component';\nimport '@asyncapi/react-component/lib/styles/fiori.css';\nimport { alpha, makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n '& .asyncapi': {\n 'font-family': 'inherit',\n background: 'none',\n },\n '& h2': {\n ...theme.typography.h6,\n },\n '& .text-teal': {\n color: theme.palette.primary.main,\n },\n '& button': {\n ...theme.typography.button,\n background: 'none',\n boxSizing: 'border-box',\n minWidth: 64,\n borderRadius: theme.shape.borderRadius,\n transition: theme.transitions.create(\n ['background-color', 'box-shadow', 'border'],\n {\n duration: theme.transitions.duration.short,\n },\n ),\n padding: '5px 15px',\n color: theme.palette.primary.main,\n border: `1px solid ${alpha(theme.palette.primary.main, 0.5)}`,\n '&:hover': {\n textDecoration: 'none',\n '&.Mui-disabled': {\n backgroundColor: 'transparent',\n },\n border: `1px solid ${theme.palette.primary.main}`,\n backgroundColor: alpha(\n theme.palette.primary.main,\n theme.palette.action.hoverOpacity,\n ),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent',\n },\n },\n '&.Mui-disabled': {\n color: theme.palette.action.disabled,\n },\n },\n '& .asyncapi__collapse-button:hover': {\n color: theme.palette.primary.main,\n },\n '& button.asyncapi__toggle-button': {\n 'min-width': 'inherit',\n },\n '& .asyncapi__info-list li': {\n 'border-color': theme.palette.primary.main,\n '&:hover': {\n color: theme.palette.text.primary,\n 'border-color': theme.palette.primary.main,\n 'background-color': theme.palette.primary.main,\n },\n },\n '& .asyncapi__info-list li a': {\n color: theme.palette.primary.main,\n '&:hover': {\n color: theme.palette.getContrastText(theme.palette.primary.main),\n },\n },\n '& .asyncapi__enum': {\n color: theme.palette.secondary.main,\n },\n '& .asyncapi__info, .asyncapi__channel, .asyncapi__channels > div, .asyncapi__schema, .asyncapi__channel-operations-list .asyncapi__messages-list-item .asyncapi__message, .asyncapi__message, .asyncapi__server, .asyncapi__servers > div, .asyncapi__messages > div, .asyncapi__schemas > div':\n {\n 'background-color': 'inherit',\n },\n '& .asyncapi__channel-parameters-header, .asyncapi__channel-operations-header, .asyncapi__channel-operation-oneOf-subscribe-header, .asyncapi__channel-operation-oneOf-publish-header, .asyncapi__channel-operation-message-header, .asyncapi__message-header, .asyncapi__message-header-title, .asyncapi__message-header-title > h3, .asyncapi__bindings, .asyncapi__bindings-header, .asyncapi__bindings-header > h4':\n {\n 'background-color': 'inherit',\n color: theme.palette.text.primary,\n },\n '& .asyncapi__additional-properties-notice': {\n color: theme.palette.text.hint,\n },\n '& .asyncapi__code, .asyncapi__code-pre': {\n background: theme.palette.background.default,\n },\n '& .asyncapi__schema-example-header-title': {\n color: theme.palette.text.secondary,\n },\n '& .asyncapi__message-headers-header, .asyncapi__message-payload-header, .asyncapi__server-variables-header, .asyncapi__server-security-header':\n {\n 'background-color': 'inherit',\n color: theme.palette.text.secondary,\n },\n '& .asyncapi__table-header': {\n background: theme.palette.background.default,\n },\n '& .asyncapi__table-body': {\n color: theme.palette.text.primary,\n },\n '& .asyncapi__server-security-flow': {\n background: theme.palette.background.default,\n border: 'none',\n },\n '& .asyncapi__server-security-flows-list a': {\n color: theme.palette.primary.main,\n },\n '& .asyncapi__table-row--nested': {\n color: theme.palette.text.secondary,\n },\n },\n}));\n\ntype Props = {\n definition: string;\n};\n\nexport const AsyncApiDefinition = ({ definition }: Props) => {\n const classes = useStyles();\n\n return (\n <div className={classes.root}>\n <AsyncApi schema={definition} />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,YAAY,WAAW;AAAU,EACrC,MAAM;AAAA,IACJ,eAAe;AAAA,MACb,eAAe;AAAA,MACf,YAAY;AAAA;AAAA,IAEd,QAAQ;AAAA,SACH,MAAM,WAAW;AAAA;AAAA,IAEtB,gBAAgB;AAAA,MACd,OAAO,MAAM,QAAQ,QAAQ;AAAA;AAAA,IAE/B,YAAY;AAAA,SACP,MAAM,WAAW;AAAA,MACpB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,UAAU;AAAA,MACV,cAAc,MAAM,MAAM;AAAA,MAC1B,YAAY,MAAM,YAAY,OAC5B,CAAC,oBAAoB,cAAc,WACnC;AAAA,QACE,UAAU,MAAM,YAAY,SAAS;AAAA;AAAA,MAGzC,SAAS;AAAA,MACT,OAAO,MAAM,QAAQ,QAAQ;AAAA,MAC7B,QAAQ,aAAa,MAAM,MAAM,QAAQ,QAAQ,MAAM;AAAA,MACvD,WAAW;AAAA,QACT,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,UAChB,iBAAiB;AAAA;AAAA,QAEnB,QAAQ,aAAa,MAAM,QAAQ,QAAQ;AAAA,QAC3C,iBAAiB,MACf,MAAM,QAAQ,QAAQ,MACtB,MAAM,QAAQ,OAAO;AAAA,QAGvB,wBAAwB;AAAA,UACtB,iBAAiB;AAAA;AAAA;AAAA,MAGrB,kBAAkB;AAAA,QAChB,OAAO,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA,IAGhC,sCAAsC;AAAA,MACpC,OAAO,MAAM,QAAQ,Q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