@backstage/plugin-api-docs 0.0.0-nightly-20220420024818 → 0.0.0-nightly-20220423023357

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # @backstage/plugin-api-docs
2
2
 
3
- ## 0.0.0-nightly-20220420024818
3
+ ## 0.0.0-nightly-20220423023357
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 09fa05e5d7: Bumped @asyncapi/react-component > openapi-sampler > json-pointer to resolve security vulnerability CVE-2021-23820
8
+ - 433a609a15: Updated the rendering of AsyncApi definitions to be able to resolve absolute HTTP \$ref references.
8
9
 
9
10
  ## 0.8.4
10
11
 
@@ -118,6 +118,19 @@ const useStyles = makeStyles((theme) => ({
118
118
  }
119
119
  }
120
120
  }));
121
+ const fetchResolver = {
122
+ order: 199,
123
+ canRead: /^https?:\/\//,
124
+ async read(file) {
125
+ const response = await fetch(file.url);
126
+ return response.text();
127
+ }
128
+ };
129
+ const config = {
130
+ parserOptions: {
131
+ resolve: { fetch: fetchResolver }
132
+ }
133
+ };
121
134
  const AsyncApiDefinition = ({ definition }) => {
122
135
  const classes = useStyles();
123
136
  const theme = useTheme();
@@ -125,9 +138,10 @@ const AsyncApiDefinition = ({ definition }) => {
125
138
  return /* @__PURE__ */ React.createElement("div", {
126
139
  className: classNames
127
140
  }, /* @__PURE__ */ React.createElement(AsyncApi, {
128
- schema: definition
141
+ schema: definition,
142
+ config
129
143
  }));
130
144
  };
131
145
 
132
146
  export { AsyncApiDefinition };
133
- //# sourceMappingURL=AsyncApiDefinition-5fccfdab.esm.js.map
147
+ //# sourceMappingURL=AsyncApiDefinition-2cfdacde.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncApiDefinition-2cfdacde.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\nconst fetchResolver = {\n order: 199, // Use 199 as the built-in http resolver is 200\n canRead: /^https?:\\/\\//,\n async read(file: any) {\n const response = await fetch(file.url);\n return response.text();\n },\n};\n\nconst config = {\n parserOptions: {\n resolve: { fetch: fetchResolver },\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 === 'dark' ? classes.dark : ''\n }`;\n\n return (\n <div className={classNames}>\n <AsyncApi schema={definition} config={config} />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAKA,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACzC,EAAE,IAAI,EAAE;AAC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AAC,aAAa,CAAC,QAAQ,EAAE;AACnD,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,MAAM;AACV,GAAG,CAAC,CAAC,CAAC;AACN;;;;"}
@@ -9,4 +9,4 @@ import '@material-ui/lab';
9
9
  import '@material-ui/core/styles';
10
10
  import '@backstage/catalog-model';
11
11
  import '@material-ui/core';
12
- //# sourceMappingURL=index-ba75d62f.esm.js.map
12
+ //# sourceMappingURL=index-993610e9.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-993610e9.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -9,4 +9,4 @@ import '@material-ui/lab';
9
9
  import '@material-ui/core/styles';
10
10
  import '@backstage/catalog-model';
11
11
  import '@material-ui/core';
12
- //# sourceMappingURL=index-3fc3ad48.esm.js.map
12
+ //# sourceMappingURL=index-bd1ed3f5.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-bd1ed3f5.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -9,4 +9,4 @@ import '@material-ui/lab';
9
9
  import '@material-ui/core/styles';
10
10
  import '@backstage/catalog-model';
11
11
  import '@material-ui/core';
12
- //# sourceMappingURL=index-7c423741.esm.js.map
12
+ //# sourceMappingURL=index-e2729792.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-e2729792.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -9,4 +9,4 @@ import '@material-ui/lab';
9
9
  import '@material-ui/core/styles';
10
10
  import '@backstage/catalog-model';
11
11
  import '@material-ui/core';
12
- //# sourceMappingURL=index-826e8d9c.esm.js.map
12
+ //# sourceMappingURL=index-e47c01a9.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-e47c01a9.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
package/dist/index.esm.js CHANGED
@@ -115,7 +115,7 @@ const ApiDefinitionCard = () => {
115
115
  });
116
116
  };
117
117
 
118
- const LazyAsyncApiDefinition = React.lazy(() => import('./esm/AsyncApiDefinition-5fccfdab.esm.js').then((m) => ({
118
+ const LazyAsyncApiDefinition = React.lazy(() => import('./esm/AsyncApiDefinition-2cfdacde.esm.js').then((m) => ({
119
119
  default: m.AsyncApiDefinition
120
120
  })));
121
121
  const AsyncApiDefinitionWidget = (props) => {
@@ -457,43 +457,43 @@ const apiDocsPlugin = createPlugin({
457
457
  });
458
458
  const ApiExplorerPage = apiDocsPlugin.provide(createRoutableExtension({
459
459
  name: "ApiExplorerPage",
460
- component: () => import('./esm/index-7c423741.esm.js').then((m) => m.ApiExplorerIndexPage),
460
+ component: () => import('./esm/index-e2729792.esm.js').then((m) => m.ApiExplorerIndexPage),
461
461
  mountPoint: rootRoute
462
462
  }));
463
463
  const EntityApiDefinitionCard = apiDocsPlugin.provide(createComponentExtension({
464
464
  name: "EntityApiDefinitionCard",
465
465
  component: {
466
- lazy: () => import('./esm/index-826e8d9c.esm.js').then((m) => m.ApiDefinitionCard)
466
+ lazy: () => import('./esm/index-e47c01a9.esm.js').then((m) => m.ApiDefinitionCard)
467
467
  }
468
468
  }));
469
469
  const EntityConsumedApisCard = apiDocsPlugin.provide(createComponentExtension({
470
470
  name: "EntityConsumedApisCard",
471
471
  component: {
472
- lazy: () => import('./esm/index-3fc3ad48.esm.js').then((m) => m.ConsumedApisCard)
472
+ lazy: () => import('./esm/index-bd1ed3f5.esm.js').then((m) => m.ConsumedApisCard)
473
473
  }
474
474
  }));
475
475
  const EntityConsumingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
476
476
  name: "EntityConsumingComponentsCard",
477
477
  component: {
478
- lazy: () => import('./esm/index-ba75d62f.esm.js').then((m) => m.ConsumingComponentsCard)
478
+ lazy: () => import('./esm/index-993610e9.esm.js').then((m) => m.ConsumingComponentsCard)
479
479
  }
480
480
  }));
481
481
  const EntityProvidedApisCard = apiDocsPlugin.provide(createComponentExtension({
482
482
  name: "EntityProvidedApisCard",
483
483
  component: {
484
- lazy: () => import('./esm/index-3fc3ad48.esm.js').then((m) => m.ProvidedApisCard)
484
+ lazy: () => import('./esm/index-bd1ed3f5.esm.js').then((m) => m.ProvidedApisCard)
485
485
  }
486
486
  }));
487
487
  const EntityProvidingComponentsCard = apiDocsPlugin.provide(createComponentExtension({
488
488
  name: "EntityProvidingComponentsCard",
489
489
  component: {
490
- lazy: () => import('./esm/index-ba75d62f.esm.js').then((m) => m.ProvidingComponentsCard)
490
+ lazy: () => import('./esm/index-993610e9.esm.js').then((m) => m.ProvidingComponentsCard)
491
491
  }
492
492
  }));
493
493
  const EntityHasApisCard = apiDocsPlugin.provide(createComponentExtension({
494
494
  name: "EntityHasApisCard",
495
495
  component: {
496
- lazy: () => import('./esm/index-3fc3ad48.esm.js').then((m) => m.HasApisCard)
496
+ lazy: () => import('./esm/index-bd1ed3f5.esm.js').then((m) => m.HasApisCard)
497
497
  }
498
498
  }));
499
499
 
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.0.0-nightly-20220420024818",
4
+ "version": "0.0.0-nightly-20220423023357",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -56,10 +56,10 @@
56
56
  "react": "^16.13.1 || ^17.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@backstage/cli": "^0.17.0",
59
+ "@backstage/cli": "^0.0.0-nightly-20220423023357",
60
60
  "@backstage/core-app-api": "^1.0.1",
61
61
  "@backstage/dev-utils": "^1.0.1",
62
- "@backstage/test-utils": "^0.0.0-nightly-20220420024818",
62
+ "@backstage/test-utils": "^0.0.0-nightly-20220423023357",
63
63
  "@testing-library/jest-dom": "^5.10.1",
64
64
  "@testing-library/react": "^12.1.3",
65
65
  "@testing-library/user-event": "^14.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"AsyncApiDefinition-5fccfdab.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 === 'dark' ? classes.dark : ''\n }`;\n\n return (\n <div className={classNames}>\n <AsyncApi schema={definition} />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAKA,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACzC,EAAE,IAAI,EAAE;AACR,IAAI,UAAU,EAAE,SAAS;AACzB,IA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AAU,EAAE,GAAG,CAAC;AAClE,KAAK;AACL,IAAI,aAAa,EAAE;AACnB,MAAM,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,CAAC;AACvE,MAAM,OAAO,EAAE;AACf,QAAQ,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC;AACtE,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC,CAAC,CAAC,CAAC;AACQ,MAAC,kBAAkB,GAAG,CAAC,EAAE,UAAU,EAAE,KAAK;AACtD,EAAE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;AAC9B,EAAE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;AAC3B,EAAE,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5F,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AACpD,IAAI,SAAS,EAAE,UAAU;AACzB,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;AACnD,IAAI,MAAM,EAAE,UAAU;AACtB,GAAG,CAAC,CAAC,CAAC;AACN;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-3fc3ad48.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-7c423741.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-826e8d9c.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-ba75d62f.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}