@backstage/plugin-api-docs 0.6.13 → 0.6.17
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 +38 -0
- package/README.md +8 -0
- package/dist/esm/AsyncApiDefinition-c39ae15d.esm.js +133 -0
- package/dist/esm/AsyncApiDefinition-c39ae15d.esm.js.map +1 -0
- package/dist/esm/{GraphQlDefinition-547f34fe.esm.js → GraphQlDefinition-fa85d425.esm.js} +2 -2
- package/dist/esm/{GraphQlDefinition-547f34fe.esm.js.map → GraphQlDefinition-fa85d425.esm.js.map} +1 -1
- package/dist/esm/OpenApiDefinition-48ae3040.esm.js +131 -0
- package/dist/esm/OpenApiDefinition-48ae3040.esm.js.map +1 -0
- package/dist/esm/{index-7b56f9d6.esm.js → index-00ee1634.esm.js} +2 -2
- package/dist/esm/index-00ee1634.esm.js.map +1 -0
- package/dist/esm/{index-dbcc0856.esm.js → index-2caea1c7.esm.js} +37 -40
- package/dist/esm/{index-dbcc0856.esm.js.map → index-2caea1c7.esm.js.map} +1 -1
- package/dist/esm/{index-47e93b67.esm.js → index-75e11fdf.esm.js} +2 -2
- package/dist/esm/index-75e11fdf.esm.js.map +1 -0
- package/dist/esm/{index-a11a0d9f.esm.js → index-81066cec.esm.js} +3 -3
- package/dist/esm/{index-a11a0d9f.esm.js.map → index-81066cec.esm.js.map} +1 -1
- package/dist/esm/{index-69af27cc.esm.js → index-f559083e.esm.js} +2 -2
- package/dist/esm/index-f559083e.esm.js.map +1 -0
- package/dist/index.esm.js +1 -1
- package/package.json +15 -15
- package/dist/esm/AsyncApiDefinition-21854d8d.esm.js +0 -116
- package/dist/esm/AsyncApiDefinition-21854d8d.esm.js.map +0 -1
- package/dist/esm/OpenApiDefinition-c327180d.esm.js +0 -109
- package/dist/esm/OpenApiDefinition-c327180d.esm.js.map +0 -1
- package/dist/esm/index-47e93b67.esm.js.map +0 -1
- package/dist/esm/index-69af27cc.esm.js.map +0 -1
- package/dist/esm/index-7b56f9d6.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @backstage/plugin-api-docs
|
|
2
2
|
|
|
3
|
+
## 0.6.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dde1681f33: chore(dependencies): bump `graphiql` package to latest
|
|
8
|
+
- ef64a444ca: Update AsyncAPI component to 1.0.0-x releases
|
|
9
|
+
|
|
10
|
+
## 0.6.16
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 752a53d94e: Improve theme integration for OpenApi definition
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @backstage/core-components@0.7.6
|
|
17
|
+
- @backstage/theme@0.2.14
|
|
18
|
+
- @backstage/core-plugin-api@0.2.2
|
|
19
|
+
|
|
20
|
+
## 0.6.15
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- c982fc12cb: Adjusted some styles in the OpenAPI definition, for elements which were barely readable in dark mode.
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @backstage/core-plugin-api@0.2.1
|
|
27
|
+
- @backstage/core-components@0.7.5
|
|
28
|
+
|
|
29
|
+
## 0.6.14
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- a125278b81: Refactor out the deprecated path and icon from RouteRefs
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
- @backstage/plugin-catalog@0.7.3
|
|
36
|
+
- @backstage/catalog-model@0.9.7
|
|
37
|
+
- @backstage/plugin-catalog-react@0.6.4
|
|
38
|
+
- @backstage/core-components@0.7.4
|
|
39
|
+
- @backstage/core-plugin-api@0.2.0
|
|
40
|
+
|
|
3
41
|
## 0.6.13
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -160,6 +160,14 @@ by this plugin.
|
|
|
160
160
|
Grab a copy of [oauth2-redirect.html](https://github.com/swagger-api/swagger-ui/blob/master/dist/oauth2-redirect.html)
|
|
161
161
|
and put it in the `app/public/` directory in order to enable Swagger UI to complete this redirection.
|
|
162
162
|
|
|
163
|
+
This also may require you to adjust `Content Security Policy` header settings of your Backstage application, so that the script in `oauth2-redirect.html` can be executed. Since the script is static we can add the hash of it directly to our CSP policy, which we do by adding the following to the `csp` section of the app configuration:
|
|
164
|
+
|
|
165
|
+
```yaml
|
|
166
|
+
script-src:
|
|
167
|
+
- "'self'"
|
|
168
|
+
- "'sha256-GeDavzSZ8O71Jggf/pQkKbt52dfZkrdNMQ3e+Ox+AkI='" # oauth2-redirect.html
|
|
169
|
+
```
|
|
170
|
+
|
|
163
171
|
#### Configuring your OAuth2 Client
|
|
164
172
|
|
|
165
173
|
You'll need to make sure your OAuth2 client has been registered in your OAuth2 Authentication Server (AS)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import AsyncApi from '@asyncapi/react-component';
|
|
2
|
+
import '@asyncapi/react-component/styles/default.css';
|
|
3
|
+
import { makeStyles, alpha, darken } from '@material-ui/core/styles';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useTheme } from '@material-ui/core';
|
|
6
|
+
|
|
7
|
+
const useStyles = makeStyles((theme) => ({
|
|
8
|
+
root: {
|
|
9
|
+
fontFamily: "inherit",
|
|
10
|
+
"& .bg-white": {
|
|
11
|
+
background: "none"
|
|
12
|
+
},
|
|
13
|
+
"& .text-4xl": {
|
|
14
|
+
...theme.typography.h3
|
|
15
|
+
},
|
|
16
|
+
" & h2": {
|
|
17
|
+
...theme.typography.h4
|
|
18
|
+
},
|
|
19
|
+
"& .border": {
|
|
20
|
+
borderColor: alpha(theme.palette.border, 0.1)
|
|
21
|
+
},
|
|
22
|
+
"& .min-w-min": {
|
|
23
|
+
minWidth: "fit-content"
|
|
24
|
+
},
|
|
25
|
+
"& .examples": {
|
|
26
|
+
padding: "1rem"
|
|
27
|
+
},
|
|
28
|
+
"& .bg-teal-500": {
|
|
29
|
+
backgroundColor: theme.palette.status.ok
|
|
30
|
+
},
|
|
31
|
+
"& .bg-blue-500": {
|
|
32
|
+
backgroundColor: theme.palette.info.main
|
|
33
|
+
},
|
|
34
|
+
"& .bg-blue-400": {
|
|
35
|
+
backgroundColor: theme.palette.info.light
|
|
36
|
+
},
|
|
37
|
+
"& .bg-indigo-400": {
|
|
38
|
+
backgroundColor: theme.palette.warning.main
|
|
39
|
+
},
|
|
40
|
+
"& .text-teal-50": {
|
|
41
|
+
color: theme.palette.status.ok
|
|
42
|
+
},
|
|
43
|
+
"& .text-red-600": {
|
|
44
|
+
color: theme.palette.error.main
|
|
45
|
+
},
|
|
46
|
+
"& .text-orange-600": {
|
|
47
|
+
color: theme.palette.warning.main
|
|
48
|
+
},
|
|
49
|
+
"& .text-teal-500": {
|
|
50
|
+
color: theme.palette.status.ok
|
|
51
|
+
},
|
|
52
|
+
"& .text-blue-500": {
|
|
53
|
+
color: theme.palette.info.main
|
|
54
|
+
},
|
|
55
|
+
"& .-rotate-90": {
|
|
56
|
+
"--tw-rotate": "0deg"
|
|
57
|
+
},
|
|
58
|
+
"& button": {
|
|
59
|
+
...theme.typography.button,
|
|
60
|
+
borderRadius: theme.shape.borderRadius,
|
|
61
|
+
color: theme.palette.primary.main
|
|
62
|
+
},
|
|
63
|
+
"& a": {
|
|
64
|
+
color: theme.palette.link
|
|
65
|
+
},
|
|
66
|
+
"& a.no-underline": {
|
|
67
|
+
...theme.typography.button,
|
|
68
|
+
background: "none",
|
|
69
|
+
boxSizing: "border-box",
|
|
70
|
+
minWidth: 64,
|
|
71
|
+
borderRadius: theme.shape.borderRadius,
|
|
72
|
+
transition: theme.transitions.create(["background-color", "box-shadow", "border"], {
|
|
73
|
+
duration: theme.transitions.duration.short
|
|
74
|
+
}),
|
|
75
|
+
padding: "5px 15px",
|
|
76
|
+
color: theme.palette.primary.main,
|
|
77
|
+
border: `1px solid ${alpha(theme.palette.primary.main, 0.5)}`,
|
|
78
|
+
"&:hover": {
|
|
79
|
+
textDecoration: "none",
|
|
80
|
+
border: `1px solid ${theme.palette.primary.main}`,
|
|
81
|
+
backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity)
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"& li.no-underline": {
|
|
85
|
+
"& a": {
|
|
86
|
+
textDecoration: "none",
|
|
87
|
+
color: theme.palette.getContrastText(theme.palette.primary.main)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
dark: {
|
|
92
|
+
"& svg": {
|
|
93
|
+
fill: theme.palette.text.primary
|
|
94
|
+
},
|
|
95
|
+
"& .prose": {
|
|
96
|
+
color: theme.palette.text.secondary,
|
|
97
|
+
"& h3": {
|
|
98
|
+
color: theme.palette.text.primary
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"& .bg-gray-100, .bg-gray-200": {
|
|
102
|
+
backgroundColor: theme.palette.background.default
|
|
103
|
+
},
|
|
104
|
+
"& .text-gray-600": {
|
|
105
|
+
color: theme.palette.grey["50"]
|
|
106
|
+
},
|
|
107
|
+
"& .text-gray-700": {
|
|
108
|
+
color: theme.palette.grey["100"]
|
|
109
|
+
},
|
|
110
|
+
"& .panel--right": {
|
|
111
|
+
background: darken(theme.palette.navigation.background, 0.1)
|
|
112
|
+
},
|
|
113
|
+
"& .examples": {
|
|
114
|
+
backgroundColor: darken(theme.palette.navigation.background, 0.1),
|
|
115
|
+
"& pre": {
|
|
116
|
+
backgroundColor: darken(theme.palette.background.default, 0.2)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}));
|
|
121
|
+
const AsyncApiDefinition = ({ definition }) => {
|
|
122
|
+
const classes = useStyles();
|
|
123
|
+
const theme = useTheme();
|
|
124
|
+
const classNames = `${classes.root} ${theme.palette.type === "dark" ? classes.dark : ""}`;
|
|
125
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
126
|
+
className: classNames
|
|
127
|
+
}, /* @__PURE__ */ React.createElement(AsyncApi, {
|
|
128
|
+
schema: definition
|
|
129
|
+
}));
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export { AsyncApiDefinition };
|
|
133
|
+
//# sourceMappingURL=AsyncApiDefinition-c39ae15d.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncApiDefinition-c39ae15d.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/styles/default.css';\nimport { makeStyles, alpha, darken } from '@material-ui/core/styles';\nimport { BackstageTheme } from '@backstage/theme';\nimport React from 'react';\nimport { useTheme } from '@material-ui/core';\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n root: {\n fontFamily: 'inherit',\n '& .bg-white': {\n background: 'none',\n },\n '& .text-4xl': {\n ...theme.typography.h3,\n },\n ' & h2': {\n ...theme.typography.h4,\n },\n '& .border': {\n borderColor: alpha(theme.palette.border, 0.1),\n },\n '& .min-w-min': {\n minWidth: 'fit-content',\n },\n '& .examples': {\n padding: '1rem',\n },\n '& .bg-teal-500': {\n backgroundColor: theme.palette.status.ok,\n },\n '& .bg-blue-500': {\n backgroundColor: theme.palette.info.main,\n },\n '& .bg-blue-400': {\n backgroundColor: theme.palette.info.light,\n },\n '& .bg-indigo-400': {\n backgroundColor: theme.palette.warning.main,\n },\n '& .text-teal-50': {\n color: theme.palette.status.ok,\n },\n '& .text-red-600': {\n color: theme.palette.error.main,\n },\n '& .text-orange-600': {\n color: theme.palette.warning.main,\n },\n '& .text-teal-500': {\n color: theme.palette.status.ok,\n },\n '& .text-blue-500': {\n color: theme.palette.info.main,\n },\n '& .-rotate-90': {\n '--tw-rotate': '0deg',\n },\n '& button': {\n ...theme.typography.button,\n borderRadius: theme.shape.borderRadius,\n color: theme.palette.primary.main,\n },\n '& a': {\n color: theme.palette.link,\n },\n '& a.no-underline': {\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 border: `1px solid ${theme.palette.primary.main}`,\n backgroundColor: alpha(\n theme.palette.primary.main,\n theme.palette.action.hoverOpacity,\n ),\n },\n },\n '& li.no-underline': {\n '& a': {\n textDecoration: 'none',\n color: theme.palette.getContrastText(theme.palette.primary.main),\n },\n },\n },\n dark: {\n '& svg': {\n fill: theme.palette.text.primary,\n },\n '& .prose': {\n color: theme.palette.text.secondary,\n '& h3': {\n color: theme.palette.text.primary,\n },\n },\n '& .bg-gray-100, .bg-gray-200': {\n backgroundColor: theme.palette.background.default,\n },\n '& .text-gray-600': {\n color: theme.palette.grey['50'],\n },\n '& .text-gray-700': {\n color: theme.palette.grey['100'],\n },\n '& .panel--right': {\n background: darken(theme.palette.navigation.background, 0.1),\n },\n '& .examples': {\n backgroundColor: darken(theme.palette.navigation.background, 0.1),\n '& pre': {\n backgroundColor: darken(theme.palette.background.default, 0.2),\n },\n },\n },\n}));\n\ntype Props = {\n definition: string;\n};\n\nexport const AsyncApiDefinition = ({ definition }: Props): JSX.Element => {\n const classes = useStyles();\n const theme = useTheme();\n const classNames = `${classes.root} ${\n theme.palette.type === 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AW,YAAY;AAAA,MAC7D,SAAS;AAAA,QACP,iBAAiB,OAAO,MAAM,QAAQ,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;MAUrD,qBAAqB,CAAC,EAAE,iBAAqC;AACxE,QAAM,UAAU;AAChB,QAAM,QAAQ;AACd,QAAM,aAAa,GAAG,QAAQ,QAC5B,MAAM,QAAQ,SAAS,SAAS,QAAQ,OAAO;AAGjD,6CACG,OAAD;AAAA,IAAK,WAAW;AAAA,yCACb,UAAD;AAAA,IAAU,QAAQ;AAAA;AAAA;;;;"}
|
|
@@ -22,7 +22,7 @@ const useStyles = makeStyles(() => ({
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}));
|
|
25
|
-
const GraphQlDefinition = ({definition}) => {
|
|
25
|
+
const GraphQlDefinition = ({ definition }) => {
|
|
26
26
|
const classes = useStyles();
|
|
27
27
|
const schema = buildSchema(definition);
|
|
28
28
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -38,4 +38,4 @@ const GraphQlDefinition = ({definition}) => {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export { GraphQlDefinition };
|
|
41
|
-
//# sourceMappingURL=GraphQlDefinition-
|
|
41
|
+
//# sourceMappingURL=GraphQlDefinition-fa85d425.esm.js.map
|
package/dist/esm/{GraphQlDefinition-547f34fe.esm.js.map → GraphQlDefinition-fa85d425.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQlDefinition-
|
|
1
|
+
{"version":3,"file":"GraphQlDefinition-fa85d425.esm.js","sources":["../../src/components/GraphQlDefinitionWidget/GraphQlDefinition.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 { BackstageTheme } from '@backstage/theme';\nimport { makeStyles } from '@material-ui/core/styles';\nimport GraphiQL from 'graphiql';\nimport 'graphiql/graphiql.css';\nimport { buildSchema } from 'graphql';\nimport React from 'react';\n\nconst useStyles = makeStyles<BackstageTheme>(() => ({\n root: {\n height: '100%',\n display: 'flex',\n flexFlow: 'column nowrap',\n },\n graphiQlWrapper: {\n flex: 1,\n '@global': {\n '.graphiql-container': {\n boxSizing: 'initial',\n height: '100%',\n minHeight: '600px',\n flex: '1 1 auto',\n },\n },\n },\n}));\n\ntype Props = {\n definition: string;\n};\n\nexport const GraphQlDefinition = ({ definition }: Props) => {\n const classes = useStyles();\n const schema = buildSchema(definition);\n\n return (\n <div className={classes.root}>\n <div className={classes.graphiQlWrapper}>\n <GraphiQL\n fetcher={() => Promise.resolve(null) as any}\n schema={schema}\n docExplorerOpen\n defaultSecondaryEditorOpen={false}\n />\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAuBA,MAAM,YAAY,WAA2B;AAAO,EAClD,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA;AAAA,EAEZ,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,WAAW;AAAA,MACT,uBAAuB;AAAA,QACrB,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,MAAM;AAAA;AAAA;AAAA;AAAA;MAUD,oBAAoB,CAAC,EAAE,iBAAwB;AAC1D,QAAM,UAAU;AAChB,QAAM,SAAS,YAAY;AAE3B,6CACG,OAAD;AAAA,IAAK,WAAW,QAAQ;AAAA,yCACrB,OAAD;AAAA,IAAK,WAAW,QAAQ;AAAA,yCACrB,UAAD;AAAA,IACE,SAAS,MAAM,QAAQ,QAAQ;AAAA,IAC/B;AAAA,IACA,iBAAe;AAAA,IACf,4BAA4B;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import SwaggerUI from 'swagger-ui-react';
|
|
4
|
+
import 'swagger-ui-react/swagger-ui.css';
|
|
5
|
+
|
|
6
|
+
const useStyles = makeStyles((theme) => ({
|
|
7
|
+
root: {
|
|
8
|
+
"& .swagger-ui": {
|
|
9
|
+
fontFamily: theme.typography.fontFamily,
|
|
10
|
+
color: theme.palette.text.primary,
|
|
11
|
+
[`& .scheme-container`]: {
|
|
12
|
+
backgroundColor: theme.palette.background.default
|
|
13
|
+
},
|
|
14
|
+
[`& .opblock-tag,
|
|
15
|
+
.opblock-tag small,
|
|
16
|
+
table thead tr td,
|
|
17
|
+
table thead tr th`]: {
|
|
18
|
+
fontFamily: theme.typography.fontFamily,
|
|
19
|
+
color: theme.palette.text.primary,
|
|
20
|
+
borderColor: theme.palette.divider
|
|
21
|
+
},
|
|
22
|
+
[`& section.models,
|
|
23
|
+
section.models.is-open h4`]: {
|
|
24
|
+
borderColor: theme.palette.divider
|
|
25
|
+
},
|
|
26
|
+
[`& .model-title,
|
|
27
|
+
.model .renderedMarkdown,
|
|
28
|
+
.model .description`]: {
|
|
29
|
+
fontFamily: theme.typography.fontFamily,
|
|
30
|
+
fontWeight: theme.typography.fontWeightRegular
|
|
31
|
+
},
|
|
32
|
+
[`& h1, h2, h3, h4, h5, h6,
|
|
33
|
+
.errors h4, .error h4, .opblock h4, section.models h4,
|
|
34
|
+
.response-control-media-type__accept-message,
|
|
35
|
+
.opblock-summary-description,
|
|
36
|
+
.opblock-summary-operation-id,
|
|
37
|
+
.opblock-summary-path,
|
|
38
|
+
.opblock-summary-path__deprecated,
|
|
39
|
+
.opblock-external-docs-wrapper,
|
|
40
|
+
.opblock-section-header .btn,
|
|
41
|
+
.opblock-section-header>label,
|
|
42
|
+
.scheme-container .schemes>label,a.nostyle,
|
|
43
|
+
.parameter__name,
|
|
44
|
+
.response-col_status,
|
|
45
|
+
.response-col_links,
|
|
46
|
+
.error .btn,
|
|
47
|
+
.info .title,
|
|
48
|
+
.info .base-url`]: {
|
|
49
|
+
fontFamily: theme.typography.fontFamily,
|
|
50
|
+
color: theme.palette.text.primary
|
|
51
|
+
},
|
|
52
|
+
[`& .opblock .opblock-section-header,
|
|
53
|
+
.model-box,
|
|
54
|
+
section.models .model-container`]: {
|
|
55
|
+
background: theme.palette.background.default
|
|
56
|
+
},
|
|
57
|
+
[`& .prop-format,
|
|
58
|
+
.parameter__in`]: {
|
|
59
|
+
color: theme.palette.text.disabled
|
|
60
|
+
},
|
|
61
|
+
[`& table.model,
|
|
62
|
+
.parameter__type,
|
|
63
|
+
.model.model-title,
|
|
64
|
+
.model-title,
|
|
65
|
+
.model span,
|
|
66
|
+
.model .brace-open,
|
|
67
|
+
.model .brace-close,
|
|
68
|
+
.model .property.primitive,
|
|
69
|
+
.model .renderedMarkdown,
|
|
70
|
+
.model .description,
|
|
71
|
+
.errors small`]: {
|
|
72
|
+
color: theme.palette.text.secondary
|
|
73
|
+
},
|
|
74
|
+
[`& .parameter__name.required:after`]: {
|
|
75
|
+
color: theme.palette.warning.dark
|
|
76
|
+
},
|
|
77
|
+
[`& table.model,
|
|
78
|
+
table.model .model,
|
|
79
|
+
.opblock-external-docs-wrapper`]: {
|
|
80
|
+
fontSize: theme.typography.fontSize
|
|
81
|
+
},
|
|
82
|
+
[`& table.headers td`]: {
|
|
83
|
+
color: theme.palette.text.primary,
|
|
84
|
+
fontWeight: theme.typography.fontWeightRegular
|
|
85
|
+
},
|
|
86
|
+
[`& .model-hint`]: {
|
|
87
|
+
color: theme.palette.text.hint,
|
|
88
|
+
backgroundColor: theme.palette.background.paper
|
|
89
|
+
},
|
|
90
|
+
[`& .opblock-summary-method,
|
|
91
|
+
.info a`]: {
|
|
92
|
+
fontFamily: theme.typography.fontFamily
|
|
93
|
+
},
|
|
94
|
+
[`& .info, .opblock, .tab`]: {
|
|
95
|
+
[`& li, p`]: {
|
|
96
|
+
fontFamily: theme.typography.fontFamily,
|
|
97
|
+
color: theme.palette.text.primary
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
[`& a`]: {
|
|
101
|
+
color: theme.palette.primary.main
|
|
102
|
+
},
|
|
103
|
+
[`& .renderedMarkdown code`]: {
|
|
104
|
+
color: theme.palette.secondary.light
|
|
105
|
+
},
|
|
106
|
+
[`& .property-row td:first-child`]: {
|
|
107
|
+
color: theme.palette.text.primary
|
|
108
|
+
},
|
|
109
|
+
[`& span.prop-type`]: {
|
|
110
|
+
color: theme.palette.success.light
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}));
|
|
115
|
+
const OpenApiDefinition = ({ definition }) => {
|
|
116
|
+
const classes = useStyles();
|
|
117
|
+
const [def, setDef] = useState("");
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
const timer = setTimeout(() => setDef(definition), 0);
|
|
120
|
+
return () => clearTimeout(timer);
|
|
121
|
+
}, [definition, setDef]);
|
|
122
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
123
|
+
className: classes.root
|
|
124
|
+
}, /* @__PURE__ */ React.createElement(SwaggerUI, {
|
|
125
|
+
spec: def,
|
|
126
|
+
deepLinking: true
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export { OpenApiDefinition };
|
|
131
|
+
//# sourceMappingURL=OpenApiDefinition-48ae3040.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenApiDefinition-48ae3040.esm.js","sources":["../../src/components/OpenApiDefinitionWidget/OpenApiDefinition.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 { makeStyles } from '@material-ui/core/styles';\nimport React, { useEffect, useState } from 'react';\nimport SwaggerUI from 'swagger-ui-react';\nimport 'swagger-ui-react/swagger-ui.css';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n '& .swagger-ui': {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n\n [`& .scheme-container`]: {\n backgroundColor: theme.palette.background.default,\n },\n [`& .opblock-tag,\n .opblock-tag small,\n table thead tr td,\n table thead tr th`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n borderColor: theme.palette.divider,\n },\n [`& section.models,\n section.models.is-open h4`]: {\n borderColor: theme.palette.divider,\n },\n [`& .model-title,\n .model .renderedMarkdown,\n .model .description`]: {\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightRegular,\n },\n [`& h1, h2, h3, h4, h5, h6,\n .errors h4, .error h4, .opblock h4, section.models h4,\n .response-control-media-type__accept-message,\n .opblock-summary-description,\n .opblock-summary-operation-id,\n .opblock-summary-path,\n .opblock-summary-path__deprecated,\n .opblock-external-docs-wrapper,\n .opblock-section-header .btn,\n .opblock-section-header>label,\n .scheme-container .schemes>label,a.nostyle,\n .parameter__name,\n .response-col_status,\n .response-col_links,\n .error .btn,\n .info .title,\n .info .base-url`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n },\n [`& .opblock .opblock-section-header, \n .model-box,\n section.models .model-container`]: {\n background: theme.palette.background.default,\n },\n [`& .prop-format,\n .parameter__in`]: {\n color: theme.palette.text.disabled,\n },\n [`& table.model, \n .parameter__type,\n .model.model-title,\n .model-title,\n .model span,\n .model .brace-open,\n .model .brace-close,\n .model .property.primitive,\n .model .renderedMarkdown,\n .model .description,\n .errors small`]: {\n color: theme.palette.text.secondary,\n },\n [`& .parameter__name.required:after`]: {\n color: theme.palette.warning.dark,\n },\n [`& table.model, \n table.model .model,\n .opblock-external-docs-wrapper`]: {\n fontSize: theme.typography.fontSize,\n },\n [`& table.headers td`]: {\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightRegular,\n },\n [`& .model-hint`]: {\n color: theme.palette.text.hint,\n backgroundColor: theme.palette.background.paper,\n },\n [`& .opblock-summary-method, \n .info a`]: {\n fontFamily: theme.typography.fontFamily,\n },\n [`& .info, .opblock, .tab`]: {\n [`& li, p`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n },\n },\n [`& a`]: {\n color: theme.palette.primary.main,\n },\n [`& .renderedMarkdown code`]: {\n color: theme.palette.secondary.light,\n },\n [`& .property-row td:first-child`]: {\n color: theme.palette.text.primary,\n },\n [`& span.prop-type`]: {\n color: theme.palette.success.light,\n },\n },\n },\n}));\n\nexport type OpenApiDefinitionProps = {\n definition: string;\n};\n\nexport const OpenApiDefinition = ({ definition }: OpenApiDefinitionProps) => {\n const classes = useStyles();\n\n // Due to a bug in the swagger-ui-react component, the component needs\n // to be created without content first.\n const [def, setDef] = useState('');\n\n useEffect(() => {\n const timer = setTimeout(() => setDef(definition), 0);\n return () => clearTimeout(timer);\n }, [definition, setDef]);\n\n return (\n <div className={classes.root}>\n <SwaggerUI spec={def} deepLinking />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,YAAY,WAAW;AAAU,EACrC,MAAM;AAAA,IACJ,iBAAiB;AAAA,MACf,YAAY,MAAM,WAAW;AAAA,MAC7B,OAAO,MAAM,QAAQ,KAAK;AAAA,OAEzB,wBAAwB;AAAA,QACvB,iBAAiB,MAAM,QAAQ,WAAW;AAAA;AAAA,OAE3C;AAAA;AAAA;AAAA,+BAGwB;AAAA,QACvB,YAAY,MAAM,WAAW;AAAA,QAC7B,OAAO,MAAM,QAAQ,KAAK;AAAA,QAC1B,aAAa,MAAM,QAAQ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B,6BAA6B;AAAA,QAC5B,OAAO,MAAM,QAAQ,UAAU;AAAA;AAAA,OAEhC,mCAAmC;AAAA,QAClC,OAAO,MAAM,QAAQ,KAAK;AAAA;AAAA,OAE3B,qBAAqB;AAAA,QACpB,OAAO,MAAM,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA;MAUxB,oBAAoB,CAAC,EAAE,iBAAyC;AAC3E,QAAM,UAAU;AAIhB,QAAM,CAAC,KAAK,UAAU,SAAS;AAE/B,YAAU,MAAM;AACd,UAAM,QAAQ,WAAW,MAAM,OAAO,aAAa;AACnD,WAAO,MAAM,aAAa;AAAA,KACzB,CAAC,YAAY;AAEhB,6CACG,OAAD;AAAA,IAAK,WAAW,QAAQ;AAAA,yCACrB,WAAD;AAAA,IAAW,MAAM;AAAA,IAAK,aAAW;AAAA;AAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as ConsumingComponentsCard, e as ProvidingComponentsCard } from './index-
|
|
1
|
+
export { b as ConsumingComponentsCard, e as ProvidingComponentsCard } from './index-2caea1c7.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-
|
|
9
|
+
//# sourceMappingURL=index-00ee1634.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-00ee1634.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -20,9 +20,9 @@ const PlainApiDefinitionWidget = (props) => {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const ApiDefinitionCard = (_) => {
|
|
23
|
-
const {entity} = useEntity();
|
|
23
|
+
const { entity } = useEntity();
|
|
24
24
|
const config = useApi(apiDocsConfigRef);
|
|
25
|
-
const {getApiDefinitionWidget} = config;
|
|
25
|
+
const { getApiDefinitionWidget } = config;
|
|
26
26
|
if (!entity) {
|
|
27
27
|
return /* @__PURE__ */ React.createElement(Alert, {
|
|
28
28
|
severity: "error"
|
|
@@ -57,7 +57,7 @@ const ApiDefinitionCard = (_) => {
|
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
const LazyAsyncApiDefinition = React.lazy(() => import('./AsyncApiDefinition-
|
|
60
|
+
const LazyAsyncApiDefinition = React.lazy(() => import('./AsyncApiDefinition-c39ae15d.esm.js').then((m) => ({
|
|
61
61
|
default: m.AsyncApiDefinition
|
|
62
62
|
})));
|
|
63
63
|
const AsyncApiDefinitionWidget = (props) => {
|
|
@@ -68,7 +68,7 @@ const AsyncApiDefinitionWidget = (props) => {
|
|
|
68
68
|
}));
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const LazyGraphQlDefinition = React.lazy(() => import('./GraphQlDefinition-
|
|
71
|
+
const LazyGraphQlDefinition = React.lazy(() => import('./GraphQlDefinition-fa85d425.esm.js').then((m) => ({
|
|
72
72
|
default: m.GraphQlDefinition
|
|
73
73
|
})));
|
|
74
74
|
const GraphQlDefinitionWidget = (props) => {
|
|
@@ -79,7 +79,7 @@ const GraphQlDefinitionWidget = (props) => {
|
|
|
79
79
|
}));
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
const LazyOpenApiDefinition = React.lazy(() => import('./OpenApiDefinition-
|
|
82
|
+
const LazyOpenApiDefinition = React.lazy(() => import('./OpenApiDefinition-48ae3040.esm.js').then((m) => ({
|
|
83
83
|
default: m.OpenApiDefinition
|
|
84
84
|
})));
|
|
85
85
|
const OpenApiDefinitionWidget = (props) => {
|
|
@@ -119,7 +119,7 @@ function defaultDefinitionWidgets() {
|
|
|
119
119
|
];
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
const ApiTypeTitle = ({apiEntity}) => {
|
|
122
|
+
const ApiTypeTitle = ({ apiEntity }) => {
|
|
123
123
|
const config = useApi(apiDocsConfigRef);
|
|
124
124
|
const definition = config.getApiDefinitionWidget(apiEntity);
|
|
125
125
|
const type = definition ? definition.title : apiEntity.spec.type;
|
|
@@ -136,7 +136,7 @@ function createSpecApiTypeColumn() {
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
const apiEntityColumns = [
|
|
139
|
-
EntityTable.columns.createEntityRefColumn({defaultKind: "API"}),
|
|
139
|
+
EntityTable.columns.createEntityRefColumn({ defaultKind: "API" }),
|
|
140
140
|
EntityTable.columns.createSystemColumn(),
|
|
141
141
|
EntityTable.columns.createOwnerColumn(),
|
|
142
142
|
createSpecApiTypeColumn(),
|
|
@@ -144,9 +144,9 @@ const apiEntityColumns = [
|
|
|
144
144
|
EntityTable.columns.createMetadataDescriptionColumn()
|
|
145
145
|
];
|
|
146
146
|
|
|
147
|
-
const ConsumedApisCard = ({variant = "gridItem"}) => {
|
|
148
|
-
const {entity} = useEntity();
|
|
149
|
-
const {entities, loading, error} = useRelatedEntities(entity, {
|
|
147
|
+
const ConsumedApisCard = ({ variant = "gridItem" }) => {
|
|
148
|
+
const { entity } = useEntity();
|
|
149
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
150
150
|
type: RELATION_CONSUMES_API
|
|
151
151
|
});
|
|
152
152
|
if (loading) {
|
|
@@ -172,7 +172,7 @@ const ConsumedApisCard = ({variant = "gridItem"}) => {
|
|
|
172
172
|
title: "Consumed APIs",
|
|
173
173
|
variant,
|
|
174
174
|
emptyContent: /* @__PURE__ */ React.createElement("div", {
|
|
175
|
-
style: {textAlign: "center"}
|
|
175
|
+
style: { textAlign: "center" }
|
|
176
176
|
}, /* @__PURE__ */ React.createElement(Typography, {
|
|
177
177
|
variant: "body1"
|
|
178
178
|
}, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not consume any APIs."), /* @__PURE__ */ React.createElement(Typography, {
|
|
@@ -186,15 +186,15 @@ const ConsumedApisCard = ({variant = "gridItem"}) => {
|
|
|
186
186
|
};
|
|
187
187
|
|
|
188
188
|
const columns = [
|
|
189
|
-
EntityTable.columns.createEntityRefColumn({defaultKind: "API"}),
|
|
189
|
+
EntityTable.columns.createEntityRefColumn({ defaultKind: "API" }),
|
|
190
190
|
EntityTable.columns.createOwnerColumn(),
|
|
191
191
|
createSpecApiTypeColumn(),
|
|
192
192
|
EntityTable.columns.createSpecLifecycleColumn(),
|
|
193
193
|
EntityTable.columns.createMetadataDescriptionColumn()
|
|
194
194
|
];
|
|
195
|
-
const HasApisCard = ({variant = "gridItem"}) => {
|
|
196
|
-
const {entity} = useEntity();
|
|
197
|
-
const {entities, loading, error} = useRelatedEntities(entity, {
|
|
195
|
+
const HasApisCard = ({ variant = "gridItem" }) => {
|
|
196
|
+
const { entity } = useEntity();
|
|
197
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
198
198
|
type: RELATION_HAS_PART,
|
|
199
199
|
kind: "API"
|
|
200
200
|
});
|
|
@@ -221,7 +221,7 @@ const HasApisCard = ({variant = "gridItem"}) => {
|
|
|
221
221
|
title: "APIs",
|
|
222
222
|
variant,
|
|
223
223
|
emptyContent: /* @__PURE__ */ React.createElement("div", {
|
|
224
|
-
style: {textAlign: "center"}
|
|
224
|
+
style: { textAlign: "center" }
|
|
225
225
|
}, /* @__PURE__ */ React.createElement(Typography, {
|
|
226
226
|
variant: "body1"
|
|
227
227
|
}, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not contain any APIs."), /* @__PURE__ */ React.createElement(Typography, {
|
|
@@ -234,9 +234,9 @@ const HasApisCard = ({variant = "gridItem"}) => {
|
|
|
234
234
|
});
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
const ProvidedApisCard = ({variant = "gridItem"}) => {
|
|
238
|
-
const {entity} = useEntity();
|
|
239
|
-
const {entities, loading, error} = useRelatedEntities(entity, {
|
|
237
|
+
const ProvidedApisCard = ({ variant = "gridItem" }) => {
|
|
238
|
+
const { entity } = useEntity();
|
|
239
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
240
240
|
type: RELATION_PROVIDES_API
|
|
241
241
|
});
|
|
242
242
|
if (loading) {
|
|
@@ -262,7 +262,7 @@ const ProvidedApisCard = ({variant = "gridItem"}) => {
|
|
|
262
262
|
title: "Provided APIs",
|
|
263
263
|
variant,
|
|
264
264
|
emptyContent: /* @__PURE__ */ React.createElement("div", {
|
|
265
|
-
style: {textAlign: "center"}
|
|
265
|
+
style: { textAlign: "center" }
|
|
266
266
|
}, /* @__PURE__ */ React.createElement(Typography, {
|
|
267
267
|
variant: "body1"
|
|
268
268
|
}, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not provide any APIs."), /* @__PURE__ */ React.createElement(Typography, {
|
|
@@ -275,9 +275,9 @@ const ProvidedApisCard = ({variant = "gridItem"}) => {
|
|
|
275
275
|
});
|
|
276
276
|
};
|
|
277
277
|
|
|
278
|
-
const ConsumingComponentsCard = ({variant = "gridItem"}) => {
|
|
279
|
-
const {entity} = useEntity();
|
|
280
|
-
const {entities, loading, error} = useRelatedEntities(entity, {
|
|
278
|
+
const ConsumingComponentsCard = ({ variant = "gridItem" }) => {
|
|
279
|
+
const { entity } = useEntity();
|
|
280
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
281
281
|
type: RELATION_API_CONSUMED_BY
|
|
282
282
|
});
|
|
283
283
|
if (loading) {
|
|
@@ -303,7 +303,7 @@ const ConsumingComponentsCard = ({variant = "gridItem"}) => {
|
|
|
303
303
|
title: "Consumers",
|
|
304
304
|
variant,
|
|
305
305
|
emptyContent: /* @__PURE__ */ React.createElement("div", {
|
|
306
|
-
style: {textAlign: "center"}
|
|
306
|
+
style: { textAlign: "center" }
|
|
307
307
|
}, /* @__PURE__ */ React.createElement(Typography, {
|
|
308
308
|
variant: "body1"
|
|
309
309
|
}, "No component consumes this API."), /* @__PURE__ */ React.createElement(Typography, {
|
|
@@ -316,9 +316,9 @@ const ConsumingComponentsCard = ({variant = "gridItem"}) => {
|
|
|
316
316
|
});
|
|
317
317
|
};
|
|
318
318
|
|
|
319
|
-
const ProvidingComponentsCard = ({variant = "gridItem"}) => {
|
|
320
|
-
const {entity} = useEntity();
|
|
321
|
-
const {entities, loading, error} = useRelatedEntities(entity, {
|
|
319
|
+
const ProvidingComponentsCard = ({ variant = "gridItem" }) => {
|
|
320
|
+
const { entity } = useEntity();
|
|
321
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
322
322
|
type: RELATION_API_PROVIDED_BY
|
|
323
323
|
});
|
|
324
324
|
if (loading) {
|
|
@@ -344,7 +344,7 @@ const ProvidingComponentsCard = ({variant = "gridItem"}) => {
|
|
|
344
344
|
title: "Providers",
|
|
345
345
|
variant,
|
|
346
346
|
emptyContent: /* @__PURE__ */ React.createElement("div", {
|
|
347
|
-
style: {textAlign: "center"}
|
|
347
|
+
style: { textAlign: "center" }
|
|
348
348
|
}, /* @__PURE__ */ React.createElement(Typography, {
|
|
349
349
|
variant: "body1"
|
|
350
350
|
}, "No component provides this API."), /* @__PURE__ */ React.createElement(Typography, {
|
|
@@ -357,11 +357,8 @@ const ProvidingComponentsCard = ({variant = "gridItem"}) => {
|
|
|
357
357
|
});
|
|
358
358
|
};
|
|
359
359
|
|
|
360
|
-
const NoIcon = () => null;
|
|
361
360
|
const rootRoute = createRouteRef({
|
|
362
|
-
|
|
363
|
-
path: "/api-docs",
|
|
364
|
-
title: "APIs"
|
|
361
|
+
id: "api-docs"
|
|
365
362
|
});
|
|
366
363
|
const createComponentRouteRef = createExternalRouteRef({
|
|
367
364
|
id: "create-component",
|
|
@@ -393,45 +390,45 @@ const apiDocsPlugin = createPlugin({
|
|
|
393
390
|
});
|
|
394
391
|
const ApiExplorerPage = apiDocsPlugin.provide(createRoutableExtension({
|
|
395
392
|
name: "ApiExplorerPage",
|
|
396
|
-
component: () => import('./index-
|
|
393
|
+
component: () => import('./index-81066cec.esm.js').then((m) => m.ApiExplorerPage),
|
|
397
394
|
mountPoint: rootRoute
|
|
398
395
|
}));
|
|
399
396
|
const EntityApiDefinitionCard = apiDocsPlugin.provide(createComponentExtension({
|
|
400
397
|
name: "EntityApiDefinitionCard",
|
|
401
398
|
component: {
|
|
402
|
-
lazy: () => import('./index-
|
|
399
|
+
lazy: () => import('./index-f559083e.esm.js').then((m) => m.ApiDefinitionCard)
|
|
403
400
|
}
|
|
404
401
|
}));
|
|
405
402
|
const EntityConsumedApisCard = apiDocsPlugin.provide(createComponentExtension({
|
|
406
403
|
name: "EntityConsumedApisCard",
|
|
407
404
|
component: {
|
|
408
|
-
lazy: () => import('./index-
|
|
405
|
+
lazy: () => import('./index-75e11fdf.esm.js').then((m) => m.ConsumedApisCard)
|
|
409
406
|
}
|
|
410
407
|
}));
|
|
411
408
|
const EntityConsumingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
|
|
412
409
|
name: "EntityConsumingComponentsCard",
|
|
413
410
|
component: {
|
|
414
|
-
lazy: () => import('./index-
|
|
411
|
+
lazy: () => import('./index-00ee1634.esm.js').then((m) => m.ConsumingComponentsCard)
|
|
415
412
|
}
|
|
416
413
|
}));
|
|
417
414
|
const EntityProvidedApisCard = apiDocsPlugin.provide(createComponentExtension({
|
|
418
415
|
name: "EntityProvidedApisCard",
|
|
419
416
|
component: {
|
|
420
|
-
lazy: () => import('./index-
|
|
417
|
+
lazy: () => import('./index-75e11fdf.esm.js').then((m) => m.ProvidedApisCard)
|
|
421
418
|
}
|
|
422
419
|
}));
|
|
423
420
|
const EntityProvidingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
|
|
424
421
|
name: "EntityProvidingComponentsCard",
|
|
425
422
|
component: {
|
|
426
|
-
lazy: () => import('./index-
|
|
423
|
+
lazy: () => import('./index-00ee1634.esm.js').then((m) => m.ProvidingComponentsCard)
|
|
427
424
|
}
|
|
428
425
|
}));
|
|
429
426
|
const EntityHasApisCard = apiDocsPlugin.provide(createComponentExtension({
|
|
430
427
|
name: "EntityHasApisCard",
|
|
431
428
|
component: {
|
|
432
|
-
lazy: () => import('./index-
|
|
429
|
+
lazy: () => import('./index-75e11fdf.esm.js').then((m) => m.HasApisCard)
|
|
433
430
|
}
|
|
434
431
|
}));
|
|
435
432
|
|
|
436
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 };
|
|
437
|
-
//# sourceMappingURL=index-
|
|
434
|
+
//# sourceMappingURL=index-2caea1c7.esm.js.map
|