@backstage/plugin-api-docs 0.6.12 → 0.6.16
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 +44 -0
- package/README.md +8 -0
- package/dist/esm/AsyncApiDefinition-21854d8d.esm.js +116 -0
- package/dist/esm/AsyncApiDefinition-21854d8d.esm.js.map +1 -0
- package/dist/esm/GraphQlDefinition-547f34fe.esm.js +41 -0
- package/dist/esm/GraphQlDefinition-547f34fe.esm.js.map +1 -0
- package/dist/esm/OpenApiDefinition-64011770.esm.js +131 -0
- package/dist/esm/OpenApiDefinition-64011770.esm.js.map +1 -0
- package/dist/esm/index-29e3fb16.esm.js +9 -0
- package/dist/esm/index-29e3fb16.esm.js.map +1 -0
- package/dist/esm/index-31dd65a0.esm.js +9 -0
- package/dist/esm/index-31dd65a0.esm.js.map +1 -0
- package/dist/esm/index-5bfec09f.esm.js +9 -0
- package/dist/esm/index-5bfec09f.esm.js.map +1 -0
- package/dist/esm/{index-0916153c.esm.js → index-8c4016a8.esm.js} +2 -9
- package/dist/esm/{index-0916153c.esm.js.map → index-8c4016a8.esm.js.map} +1 -1
- package/dist/esm/{index-33c067eb.esm.js → index-c1d775ea.esm.js} +36 -216
- package/dist/esm/index-c1d775ea.esm.js.map +1 -0
- package/dist/index.d.ts +19 -19
- package/dist/index.esm.js +1 -8
- package/dist/index.esm.js.map +1 -1
- package/package.json +13 -13
- package/dist/esm/index-33c067eb.esm.js.map +0 -1
- package/dist/esm/index-33fd6142.esm.js +0 -16
- package/dist/esm/index-33fd6142.esm.js.map +0 -1
- package/dist/esm/index-8d2b93f8.esm.js +0 -16
- package/dist/esm/index-8d2b93f8.esm.js.map +0 -1
- package/dist/esm/index-8f134ba4.esm.js +0 -16
- package/dist/esm/index-8f134ba4.esm.js.map +0 -1
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { useEntity, EntityTable, useRelatedEntities } from '@backstage/plugin-catalog-react';
|
|
2
2
|
import { Alert } from '@material-ui/lab';
|
|
3
|
-
import React, { Suspense
|
|
3
|
+
import React, { Suspense } from 'react';
|
|
4
4
|
import { createApiRef, useApi, createRouteRef, createExternalRouteRef, createPlugin, createApiFactory, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
|
|
5
5
|
import { CodeSnippet, TabbedCard, CardTab, Progress, InfoCard, WarningPanel, Link } from '@backstage/core-components';
|
|
6
|
-
import AsyncApi from '@asyncapi/react-component';
|
|
7
|
-
import '@asyncapi/react-component/lib/styles/fiori.css';
|
|
8
|
-
import { makeStyles, fade } from '@material-ui/core/styles';
|
|
9
|
-
import 'graphiql/graphiql.css';
|
|
10
|
-
import { buildSchema } from 'graphql';
|
|
11
|
-
import SwaggerUI from 'swagger-ui-react';
|
|
12
|
-
import 'swagger-ui-react/swagger-ui.css';
|
|
13
6
|
import { RELATION_CONSUMES_API, RELATION_HAS_PART, RELATION_PROVIDES_API, RELATION_API_CONSUMED_BY, RELATION_API_PROVIDED_BY } from '@backstage/catalog-model';
|
|
14
7
|
import { Typography } from '@material-ui/core';
|
|
15
8
|
|
|
@@ -18,10 +11,10 @@ const apiDocsConfigRef = createApiRef({
|
|
|
18
11
|
description: "Used to configure api-docs widgets"
|
|
19
12
|
});
|
|
20
13
|
|
|
21
|
-
const PlainApiDefinitionWidget = (
|
|
14
|
+
const PlainApiDefinitionWidget = (props) => {
|
|
22
15
|
return /* @__PURE__ */ React.createElement(CodeSnippet, {
|
|
23
|
-
text: definition,
|
|
24
|
-
language,
|
|
16
|
+
text: props.definition,
|
|
17
|
+
language: props.language,
|
|
25
18
|
showCopyCodeButton: true
|
|
26
19
|
});
|
|
27
20
|
};
|
|
@@ -64,206 +57,36 @@ const ApiDefinitionCard = (_) => {
|
|
|
64
57
|
});
|
|
65
58
|
};
|
|
66
59
|
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
"& .text-teal": {
|
|
77
|
-
color: theme.palette.primary.main
|
|
78
|
-
},
|
|
79
|
-
"& button": {
|
|
80
|
-
...theme.typography.button,
|
|
81
|
-
background: "none",
|
|
82
|
-
boxSizing: "border-box",
|
|
83
|
-
minWidth: 64,
|
|
84
|
-
borderRadius: theme.shape.borderRadius,
|
|
85
|
-
transition: theme.transitions.create(["background-color", "box-shadow", "border"], {
|
|
86
|
-
duration: theme.transitions.duration.short
|
|
87
|
-
}),
|
|
88
|
-
padding: "5px 15px",
|
|
89
|
-
color: theme.palette.primary.main,
|
|
90
|
-
border: `1px solid ${fade(theme.palette.primary.main, 0.5)}`,
|
|
91
|
-
"&:hover": {
|
|
92
|
-
textDecoration: "none",
|
|
93
|
-
"&.Mui-disabled": {
|
|
94
|
-
backgroundColor: "transparent"
|
|
95
|
-
},
|
|
96
|
-
border: `1px solid ${theme.palette.primary.main}`,
|
|
97
|
-
backgroundColor: fade(theme.palette.primary.main, theme.palette.action.hoverOpacity),
|
|
98
|
-
"@media (hover: none)": {
|
|
99
|
-
backgroundColor: "transparent"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"&.Mui-disabled": {
|
|
103
|
-
color: theme.palette.action.disabled
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"& .asyncapi__collapse-button:hover": {
|
|
107
|
-
color: theme.palette.primary.main
|
|
108
|
-
},
|
|
109
|
-
"& button.asyncapi__toggle-button": {
|
|
110
|
-
"min-width": "inherit"
|
|
111
|
-
},
|
|
112
|
-
"& .asyncapi__info-list li": {
|
|
113
|
-
"border-color": theme.palette.primary.main,
|
|
114
|
-
"&:hover": {
|
|
115
|
-
color: theme.palette.text.primary,
|
|
116
|
-
"border-color": theme.palette.primary.main,
|
|
117
|
-
"background-color": theme.palette.primary.main
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
"& .asyncapi__info-list li a": {
|
|
121
|
-
color: theme.palette.primary.main,
|
|
122
|
-
"&:hover": {
|
|
123
|
-
color: theme.palette.getContrastText(theme.palette.primary.main)
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"& .asyncapi__enum": {
|
|
127
|
-
color: theme.palette.secondary.main
|
|
128
|
-
},
|
|
129
|
-
"& .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": {
|
|
130
|
-
"background-color": "inherit"
|
|
131
|
-
},
|
|
132
|
-
"& .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": {
|
|
133
|
-
"background-color": "inherit",
|
|
134
|
-
color: theme.palette.text.primary
|
|
135
|
-
},
|
|
136
|
-
"& .asyncapi__additional-properties-notice": {
|
|
137
|
-
color: theme.palette.text.hint
|
|
138
|
-
},
|
|
139
|
-
"& .asyncapi__code, .asyncapi__code-pre": {
|
|
140
|
-
background: theme.palette.background.default
|
|
141
|
-
},
|
|
142
|
-
"& .asyncapi__schema-example-header-title": {
|
|
143
|
-
color: theme.palette.text.secondary
|
|
144
|
-
},
|
|
145
|
-
"& .asyncapi__message-headers-header, .asyncapi__message-payload-header, .asyncapi__server-variables-header, .asyncapi__server-security-header": {
|
|
146
|
-
"background-color": "inherit",
|
|
147
|
-
color: theme.palette.text.secondary
|
|
148
|
-
},
|
|
149
|
-
"& .asyncapi__table-header": {
|
|
150
|
-
background: theme.palette.background.default
|
|
151
|
-
},
|
|
152
|
-
"& .asyncapi__table-body": {
|
|
153
|
-
color: theme.palette.text.primary
|
|
154
|
-
},
|
|
155
|
-
"& .asyncapi__server-security-flow": {
|
|
156
|
-
background: theme.palette.background.default,
|
|
157
|
-
border: "none"
|
|
158
|
-
},
|
|
159
|
-
"& .asyncapi__server-security-flows-list a": {
|
|
160
|
-
color: theme.palette.primary.main
|
|
161
|
-
},
|
|
162
|
-
"& .asyncapi__table-row--nested": {
|
|
163
|
-
color: theme.palette.text.secondary
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}));
|
|
167
|
-
const AsyncApiDefinitionWidget = ({definition}) => {
|
|
168
|
-
const classes = useStyles$2();
|
|
169
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
170
|
-
className: classes.root
|
|
171
|
-
}, /* @__PURE__ */ React.createElement(AsyncApi, {
|
|
172
|
-
schema: definition
|
|
60
|
+
const LazyAsyncApiDefinition = React.lazy(() => import('./AsyncApiDefinition-21854d8d.esm.js').then((m) => ({
|
|
61
|
+
default: m.AsyncApiDefinition
|
|
62
|
+
})));
|
|
63
|
+
const AsyncApiDefinitionWidget = (props) => {
|
|
64
|
+
return /* @__PURE__ */ React.createElement(Suspense, {
|
|
65
|
+
fallback: /* @__PURE__ */ React.createElement(Progress, null)
|
|
66
|
+
}, /* @__PURE__ */ React.createElement(LazyAsyncApiDefinition, {
|
|
67
|
+
...props
|
|
173
68
|
}));
|
|
174
69
|
};
|
|
175
70
|
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
display: "flex",
|
|
181
|
-
flexFlow: "column nowrap"
|
|
182
|
-
},
|
|
183
|
-
graphiQlWrapper: {
|
|
184
|
-
flex: 1,
|
|
185
|
-
"@global": {
|
|
186
|
-
".graphiql-container": {
|
|
187
|
-
boxSizing: "initial",
|
|
188
|
-
height: "100%",
|
|
189
|
-
minHeight: "600px",
|
|
190
|
-
flex: "1 1 auto"
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}));
|
|
195
|
-
const GraphQlDefinitionWidget = ({definition}) => {
|
|
196
|
-
const classes = useStyles$1();
|
|
197
|
-
const schema = buildSchema(definition);
|
|
71
|
+
const LazyGraphQlDefinition = React.lazy(() => import('./GraphQlDefinition-547f34fe.esm.js').then((m) => ({
|
|
72
|
+
default: m.GraphQlDefinition
|
|
73
|
+
})));
|
|
74
|
+
const GraphQlDefinitionWidget = (props) => {
|
|
198
75
|
return /* @__PURE__ */ React.createElement(Suspense, {
|
|
199
76
|
fallback: /* @__PURE__ */ React.createElement(Progress, null)
|
|
200
|
-
}, /* @__PURE__ */ React.createElement(
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
className: classes.graphiQlWrapper
|
|
204
|
-
}, /* @__PURE__ */ React.createElement(GraphiQL, {
|
|
205
|
-
fetcher: () => Promise.resolve(null),
|
|
206
|
-
schema,
|
|
207
|
-
docExplorerOpen: true,
|
|
208
|
-
defaultSecondaryEditorOpen: false
|
|
209
|
-
}))));
|
|
77
|
+
}, /* @__PURE__ */ React.createElement(LazyGraphQlDefinition, {
|
|
78
|
+
...props
|
|
79
|
+
}));
|
|
210
80
|
};
|
|
211
81
|
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
"& .opblock-tag, .opblock-tag small, table thead tr td, table thead tr th": {
|
|
222
|
-
color: theme.palette.text.primary,
|
|
223
|
-
"border-color": theme.palette.divider
|
|
224
|
-
},
|
|
225
|
-
"& section.models, section.models.is-open h4": {
|
|
226
|
-
"border-color": theme.palette.divider
|
|
227
|
-
},
|
|
228
|
-
"& .opblock .opblock-summary-description, .parameter__type, table.headers td, .model-title, .model .property.primitive, section h3": {
|
|
229
|
-
color: theme.palette.text.secondary
|
|
230
|
-
},
|
|
231
|
-
"& .opblock .opblock-summary-operation-id, .opblock .opblock-summary-path, .opblock .opblock-summary-path__deprecated, .opblock .opblock-section-header h4, .parameter__name, .response-col_status, .response-col_links, .responses-inner h4, .swagger-ui .responses-inner h5, .opblock-section-header .btn, .tab li, .info li, .info p, .info table, section.models h4, .info .title, table.model tr.description, .property-row": {
|
|
232
|
-
color: theme.palette.text.primary
|
|
233
|
-
},
|
|
234
|
-
"& .opblock .opblock-section-header, .model-box, section.models .model-container": {
|
|
235
|
-
background: theme.palette.background.default
|
|
236
|
-
},
|
|
237
|
-
"& .prop-format, .parameter__in": {
|
|
238
|
-
color: theme.palette.text.disabled
|
|
239
|
-
},
|
|
240
|
-
"& ": {
|
|
241
|
-
color: theme.palette.text.primary,
|
|
242
|
-
"border-color": theme.palette.divider
|
|
243
|
-
},
|
|
244
|
-
"& .opblock-description-wrapper p, .opblock-external-docs-wrapper p, .opblock-title_normal p, .response-control-media-type__accept-message, .opblock .opblock-section-header>label, .scheme-container .schemes>label, .info .base-url, .model": {
|
|
245
|
-
color: theme.palette.text.hint
|
|
246
|
-
},
|
|
247
|
-
"& .parameter__name.required:after": {
|
|
248
|
-
color: theme.palette.warning.dark
|
|
249
|
-
},
|
|
250
|
-
"& .prop-type": {
|
|
251
|
-
color: theme.palette.primary.main
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}));
|
|
255
|
-
const OpenApiDefinitionWidget = ({definition}) => {
|
|
256
|
-
const classes = useStyles();
|
|
257
|
-
const [def, setDef] = useState("");
|
|
258
|
-
useEffect(() => {
|
|
259
|
-
const timer = setTimeout(() => setDef(definition), 0);
|
|
260
|
-
return () => clearTimeout(timer);
|
|
261
|
-
}, [definition, setDef]);
|
|
262
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
263
|
-
className: classes.root
|
|
264
|
-
}, /* @__PURE__ */ React.createElement(SwaggerUI, {
|
|
265
|
-
spec: def,
|
|
266
|
-
deepLinking: true
|
|
82
|
+
const LazyOpenApiDefinition = React.lazy(() => import('./OpenApiDefinition-64011770.esm.js').then((m) => ({
|
|
83
|
+
default: m.OpenApiDefinition
|
|
84
|
+
})));
|
|
85
|
+
const OpenApiDefinitionWidget = (props) => {
|
|
86
|
+
return /* @__PURE__ */ React.createElement(Suspense, {
|
|
87
|
+
fallback: /* @__PURE__ */ React.createElement(Progress, null)
|
|
88
|
+
}, /* @__PURE__ */ React.createElement(LazyOpenApiDefinition, {
|
|
89
|
+
...props
|
|
267
90
|
}));
|
|
268
91
|
};
|
|
269
92
|
|
|
@@ -534,11 +357,8 @@ const ProvidingComponentsCard = ({variant = "gridItem"}) => {
|
|
|
534
357
|
});
|
|
535
358
|
};
|
|
536
359
|
|
|
537
|
-
const NoIcon = () => null;
|
|
538
360
|
const rootRoute = createRouteRef({
|
|
539
|
-
|
|
540
|
-
path: "/api-docs",
|
|
541
|
-
title: "APIs"
|
|
361
|
+
id: "api-docs"
|
|
542
362
|
});
|
|
543
363
|
const createComponentRouteRef = createExternalRouteRef({
|
|
544
364
|
id: "create-component",
|
|
@@ -570,45 +390,45 @@ const apiDocsPlugin = createPlugin({
|
|
|
570
390
|
});
|
|
571
391
|
const ApiExplorerPage = apiDocsPlugin.provide(createRoutableExtension({
|
|
572
392
|
name: "ApiExplorerPage",
|
|
573
|
-
component: () => import('./index-
|
|
393
|
+
component: () => import('./index-8c4016a8.esm.js').then((m) => m.ApiExplorerPage),
|
|
574
394
|
mountPoint: rootRoute
|
|
575
395
|
}));
|
|
576
396
|
const EntityApiDefinitionCard = apiDocsPlugin.provide(createComponentExtension({
|
|
577
397
|
name: "EntityApiDefinitionCard",
|
|
578
398
|
component: {
|
|
579
|
-
lazy: () => import('./index-
|
|
399
|
+
lazy: () => import('./index-29e3fb16.esm.js').then((m) => m.ApiDefinitionCard)
|
|
580
400
|
}
|
|
581
401
|
}));
|
|
582
402
|
const EntityConsumedApisCard = apiDocsPlugin.provide(createComponentExtension({
|
|
583
403
|
name: "EntityConsumedApisCard",
|
|
584
404
|
component: {
|
|
585
|
-
lazy: () => import('./index-
|
|
405
|
+
lazy: () => import('./index-5bfec09f.esm.js').then((m) => m.ConsumedApisCard)
|
|
586
406
|
}
|
|
587
407
|
}));
|
|
588
408
|
const EntityConsumingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
|
|
589
409
|
name: "EntityConsumingComponentsCard",
|
|
590
410
|
component: {
|
|
591
|
-
lazy: () => import('./index-
|
|
411
|
+
lazy: () => import('./index-31dd65a0.esm.js').then((m) => m.ConsumingComponentsCard)
|
|
592
412
|
}
|
|
593
413
|
}));
|
|
594
414
|
const EntityProvidedApisCard = apiDocsPlugin.provide(createComponentExtension({
|
|
595
415
|
name: "EntityProvidedApisCard",
|
|
596
416
|
component: {
|
|
597
|
-
lazy: () => import('./index-
|
|
417
|
+
lazy: () => import('./index-5bfec09f.esm.js').then((m) => m.ProvidedApisCard)
|
|
598
418
|
}
|
|
599
419
|
}));
|
|
600
420
|
const EntityProvidingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
|
|
601
421
|
name: "EntityProvidingComponentsCard",
|
|
602
422
|
component: {
|
|
603
|
-
lazy: () => import('./index-
|
|
423
|
+
lazy: () => import('./index-31dd65a0.esm.js').then((m) => m.ProvidingComponentsCard)
|
|
604
424
|
}
|
|
605
425
|
}));
|
|
606
426
|
const EntityHasApisCard = apiDocsPlugin.provide(createComponentExtension({
|
|
607
427
|
name: "EntityHasApisCard",
|
|
608
428
|
component: {
|
|
609
|
-
lazy: () => import('./index-
|
|
429
|
+
lazy: () => import('./index-5bfec09f.esm.js').then((m) => m.HasApisCard)
|
|
610
430
|
}
|
|
611
431
|
}));
|
|
612
432
|
|
|
613
433
|
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 };
|
|
614
|
-
//# sourceMappingURL=index-
|
|
434
|
+
//# sourceMappingURL=index-c1d775ea.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-c1d775ea.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 description: 'Used to configure api-docs widgets',\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,EACJ,aAAa;AAAA;;MCEF,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,CAAE,UAAW;AACnB,QAAM,SAAS,OAAO;AACtB,QAAM,CAAE,0BAA2B;AAEnC,MAAI,CAAC,QAAQ;AACX,+CAAQ,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IACT,MAAM,MAAa,kCAA0B,KAAK,OAAK,EAAE;AAAA;AAAA;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ import * as _backstage_core_components from '@backstage/core-components';
|
|
|
8
8
|
import * as _backstage_plugin_catalog from '@backstage/plugin-catalog';
|
|
9
9
|
import * as _backstage_plugin_catalog_react from '@backstage/plugin-catalog-react';
|
|
10
10
|
|
|
11
|
-
declare type Props$
|
|
11
|
+
declare type Props$5 = {
|
|
12
12
|
/** @deprecated The entity is now grabbed from context instead */
|
|
13
13
|
apiEntity?: ApiEntity;
|
|
14
14
|
};
|
|
15
|
-
declare const ApiDefinitionCard: (_: Props$
|
|
15
|
+
declare const ApiDefinitionCard: (_: Props$5) => JSX.Element;
|
|
16
16
|
|
|
17
17
|
declare type ApiDefinitionWidget = {
|
|
18
18
|
type: string;
|
|
@@ -26,54 +26,54 @@ declare const ApiTypeTitle: ({ apiEntity }: {
|
|
|
26
26
|
apiEntity: ApiEntity;
|
|
27
27
|
}) => JSX.Element;
|
|
28
28
|
|
|
29
|
-
declare type Props$
|
|
29
|
+
declare type Props$4 = {
|
|
30
30
|
/** @deprecated The entity is now grabbed from context instead */
|
|
31
31
|
entity?: Entity;
|
|
32
32
|
variant?: 'gridItem';
|
|
33
33
|
};
|
|
34
|
-
declare const ConsumedApisCard: ({ variant }: Props$
|
|
34
|
+
declare const ConsumedApisCard: ({ variant }: Props$4) => JSX.Element;
|
|
35
35
|
|
|
36
|
-
declare type Props$
|
|
36
|
+
declare type Props$3 = {
|
|
37
37
|
variant?: 'gridItem';
|
|
38
38
|
};
|
|
39
|
-
declare const HasApisCard: ({ variant }: Props$
|
|
39
|
+
declare const HasApisCard: ({ variant }: Props$3) => JSX.Element;
|
|
40
40
|
|
|
41
|
-
declare type Props$
|
|
41
|
+
declare type Props$2 = {
|
|
42
42
|
/** @deprecated The entity is now grabbed from context instead */
|
|
43
43
|
entity?: Entity;
|
|
44
44
|
variant?: 'gridItem';
|
|
45
45
|
};
|
|
46
|
-
declare const ProvidedApisCard: ({ variant }: Props$
|
|
46
|
+
declare const ProvidedApisCard: ({ variant }: Props$2) => JSX.Element;
|
|
47
47
|
|
|
48
|
-
declare type
|
|
48
|
+
declare type AsyncApiDefinitionWidgetProps = {
|
|
49
49
|
definition: string;
|
|
50
50
|
};
|
|
51
|
-
declare const AsyncApiDefinitionWidget: (
|
|
51
|
+
declare const AsyncApiDefinitionWidget: (props: AsyncApiDefinitionWidgetProps) => JSX.Element;
|
|
52
52
|
|
|
53
|
-
declare type Props$
|
|
53
|
+
declare type Props$1 = {
|
|
54
54
|
/** @deprecated The entity is now grabbed from context instead */
|
|
55
55
|
entity?: Entity;
|
|
56
56
|
variant?: 'gridItem';
|
|
57
57
|
};
|
|
58
|
-
declare const ConsumingComponentsCard: ({ variant }: Props$
|
|
58
|
+
declare const ConsumingComponentsCard: ({ variant }: Props$1) => JSX.Element;
|
|
59
59
|
|
|
60
|
-
declare type Props
|
|
60
|
+
declare type Props = {
|
|
61
61
|
/** @deprecated The entity is now grabbed from context instead */
|
|
62
62
|
entity?: Entity;
|
|
63
63
|
variant?: 'gridItem';
|
|
64
64
|
};
|
|
65
|
-
declare const ProvidingComponentsCard: ({ variant }: Props
|
|
65
|
+
declare const ProvidingComponentsCard: ({ variant }: Props) => JSX.Element;
|
|
66
66
|
|
|
67
|
-
declare type
|
|
67
|
+
declare type OpenApiDefinitionWidgetProps = {
|
|
68
68
|
definition: string;
|
|
69
69
|
};
|
|
70
|
-
declare const OpenApiDefinitionWidget: (
|
|
70
|
+
declare const OpenApiDefinitionWidget: (props: OpenApiDefinitionWidgetProps) => JSX.Element;
|
|
71
71
|
|
|
72
|
-
declare type
|
|
72
|
+
declare type PlainApiDefinitionWidgetProps = {
|
|
73
73
|
definition: any;
|
|
74
74
|
language: string;
|
|
75
75
|
};
|
|
76
|
-
declare const PlainApiDefinitionWidget: (
|
|
76
|
+
declare const PlainApiDefinitionWidget: (props: PlainApiDefinitionWidgetProps) => JSX.Element;
|
|
77
77
|
|
|
78
78
|
declare const apiDocsConfigRef: _backstage_core_plugin_api.ApiRef<ApiDocsConfig>;
|
|
79
79
|
interface ApiDocsConfig {
|
|
@@ -116,4 +116,4 @@ declare const EntityHasApisCard: ({ variant }: {
|
|
|
116
116
|
variant?: "gridItem" | undefined;
|
|
117
117
|
}) => JSX.Element;
|
|
118
118
|
|
|
119
|
-
export { ApiDefinitionCard, ApiDefinitionWidget, ApiExplorerPage, ApiTypeTitle, AsyncApiDefinitionWidget, ConsumedApisCard, ConsumingComponentsCard, EntityApiDefinitionCard, EntityConsumedApisCard, EntityConsumingComponentsCard, EntityHasApisCard, EntityProvidedApisCard, EntityProvidingComponentsCard, HasApisCard, OpenApiDefinitionWidget, PlainApiDefinitionWidget, ProvidedApisCard, ProvidingComponentsCard, apiDocsConfigRef, apiDocsPlugin, defaultDefinitionWidgets, apiDocsPlugin as plugin };
|
|
119
|
+
export { ApiDefinitionCard, ApiDefinitionWidget, ApiExplorerPage, ApiTypeTitle, AsyncApiDefinitionWidget, AsyncApiDefinitionWidgetProps, ConsumedApisCard, ConsumingComponentsCard, EntityApiDefinitionCard, EntityConsumedApisCard, EntityConsumingComponentsCard, EntityHasApisCard, EntityProvidedApisCard, EntityProvidingComponentsCard, HasApisCard, OpenApiDefinitionWidget, OpenApiDefinitionWidgetProps, PlainApiDefinitionWidget, PlainApiDefinitionWidgetProps, ProvidedApisCard, ProvidingComponentsCard, apiDocsConfigRef, apiDocsPlugin, defaultDefinitionWidgets, apiDocsPlugin as plugin };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
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-
|
|
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-c1d775ea.esm.js';
|
|
2
2
|
import '@backstage/plugin-catalog-react';
|
|
3
3
|
import '@material-ui/lab';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@backstage/core-plugin-api';
|
|
6
6
|
import '@backstage/core-components';
|
|
7
|
-
import '@asyncapi/react-component';
|
|
8
|
-
import '@asyncapi/react-component/lib/styles/fiori.css';
|
|
9
|
-
import '@material-ui/core/styles';
|
|
10
|
-
import 'graphiql/graphiql.css';
|
|
11
|
-
import 'graphql';
|
|
12
|
-
import 'swagger-ui-react';
|
|
13
|
-
import 'swagger-ui-react/swagger-ui.css';
|
|
14
7
|
import '@backstage/catalog-model';
|
|
15
8
|
import '@material-ui/core';
|
|
16
9
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,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.
|
|
4
|
+
"version": "0.6.16",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@asyncapi/react-component": "^0.23.0",
|
|
34
|
-
"@backstage/catalog-model": "^0.9.
|
|
35
|
-
"@backstage/core-components": "^0.7.
|
|
36
|
-
"@backstage/core-plugin-api": "^0.
|
|
37
|
-
"@backstage/plugin-catalog": "^0.7.
|
|
38
|
-
"@backstage/plugin-catalog-react": "^0.6.
|
|
39
|
-
"@backstage/theme": "^0.2.
|
|
34
|
+
"@backstage/catalog-model": "^0.9.7",
|
|
35
|
+
"@backstage/core-components": "^0.7.6",
|
|
36
|
+
"@backstage/core-plugin-api": "^0.2.2",
|
|
37
|
+
"@backstage/plugin-catalog": "^0.7.3",
|
|
38
|
+
"@backstage/plugin-catalog-react": "^0.6.4",
|
|
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",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"swagger-ui-react": "^4.0.0-rc.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@backstage/cli": "^0.
|
|
57
|
-
"@backstage/core-app-api": "^0.1.
|
|
58
|
-
"@backstage/dev-utils": "^0.2.
|
|
59
|
-
"@backstage/test-utils": "^0.1.
|
|
56
|
+
"@backstage/cli": "^0.10.0",
|
|
57
|
+
"@backstage/core-app-api": "^0.1.24",
|
|
58
|
+
"@backstage/dev-utils": "^0.2.13",
|
|
59
|
+
"@backstage/test-utils": "^0.1.23",
|
|
60
60
|
"@testing-library/jest-dom": "^5.10.1",
|
|
61
61
|
"@testing-library/react": "^11.2.5",
|
|
62
62
|
"@testing-library/user-event": "^13.1.8",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"@types/node": "^14.14.32",
|
|
65
65
|
"@types/swagger-ui-react": "^3.23.3",
|
|
66
66
|
"cross-fetch": "^3.0.6",
|
|
67
|
-
"msw": "^0.
|
|
67
|
+
"msw": "^0.35.0"
|
|
68
68
|
},
|
|
69
69
|
"files": [
|
|
70
70
|
"dist"
|
|
71
71
|
],
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "a05e7081b805006e3f0b2960a08a7753357f532f"
|
|
73
73
|
}
|