@backstage/plugin-api-docs 0.11.10-next.0 → 0.11.10
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 +4 -11
- package/alpha/package.json +1 -1
- package/dist/alpha.d.ts +11 -51
- package/dist/components/ApisCards/ConsumedApisCard.esm.js +1 -8
- package/dist/components/ApisCards/ConsumedApisCard.esm.js.map +1 -1
- package/dist/components/ApisCards/ProvidedApisCard.esm.js +1 -8
- package/dist/components/ApisCards/ProvidedApisCard.esm.js.map +1 -1
- package/package.json +12 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
# @backstage/plugin-api-docs
|
|
2
2
|
|
|
3
|
-
## 0.11.10
|
|
3
|
+
## 0.11.10
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- 46b5a20: Empty states updated with external link icon for learn more links
|
|
8
7
|
- Updated dependencies
|
|
9
|
-
- @backstage/
|
|
10
|
-
- @backstage/plugin-catalog@1.
|
|
11
|
-
- @backstage/core-compat-api@0.3.
|
|
12
|
-
- @backstage/core-components@0.15.1-next.0
|
|
13
|
-
- @backstage/core-plugin-api@1.10.0-next.0
|
|
14
|
-
- @backstage/plugin-catalog-react@1.13.1-next.0
|
|
15
|
-
- @backstage/catalog-model@1.7.0
|
|
16
|
-
- @backstage/plugin-catalog-common@1.1.0
|
|
17
|
-
- @backstage/plugin-permission-react@0.4.27-next.0
|
|
8
|
+
- @backstage/plugin-catalog@1.23.1
|
|
9
|
+
- @backstage/plugin-catalog-react@1.13.1
|
|
10
|
+
- @backstage/core-compat-api@0.3.0
|
|
18
11
|
|
|
19
12
|
## 0.11.9
|
|
20
13
|
|
package/alpha/package.json
CHANGED
package/dist/alpha.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
10
10
|
}, {
|
|
11
11
|
"nav-item:api-docs": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
12
12
|
kind: "nav-item";
|
|
13
|
+
namespace: undefined;
|
|
13
14
|
name: undefined;
|
|
14
15
|
config: {};
|
|
15
16
|
configInput: {};
|
|
@@ -19,22 +20,15 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
19
20
|
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
20
21
|
}, "core.nav-item.target", {}>;
|
|
21
22
|
inputs: {};
|
|
22
|
-
params: {
|
|
23
|
-
title: string;
|
|
24
|
-
icon: _backstage_core_plugin_api.IconComponent;
|
|
25
|
-
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
26
|
-
};
|
|
27
23
|
}>;
|
|
28
24
|
"api:api-docs/config": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
29
25
|
kind: "api";
|
|
26
|
+
namespace: undefined;
|
|
30
27
|
name: "config";
|
|
31
28
|
config: {};
|
|
32
29
|
configInput: {};
|
|
33
30
|
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
34
31
|
inputs: {};
|
|
35
|
-
params: {
|
|
36
|
-
factory: _backstage_frontend_plugin_api.AnyApiFactory;
|
|
37
|
-
};
|
|
38
32
|
}>;
|
|
39
33
|
"page:api-docs": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
40
34
|
config: {
|
|
@@ -57,15 +51,12 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
57
51
|
}>;
|
|
58
52
|
};
|
|
59
53
|
kind: "page";
|
|
54
|
+
namespace: undefined;
|
|
60
55
|
name: undefined;
|
|
61
|
-
params: {
|
|
62
|
-
defaultPath: string;
|
|
63
|
-
loader: () => Promise<JSX.Element>;
|
|
64
|
-
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
65
|
-
};
|
|
66
56
|
}>;
|
|
67
57
|
"entity-card:api-docs/has-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
68
58
|
kind: "entity-card";
|
|
59
|
+
namespace: undefined;
|
|
69
60
|
name: "has-apis";
|
|
70
61
|
config: {
|
|
71
62
|
filter: string | undefined;
|
|
@@ -79,13 +70,10 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
79
70
|
optional: true;
|
|
80
71
|
}>;
|
|
81
72
|
inputs: {};
|
|
82
|
-
params: {
|
|
83
|
-
loader: () => Promise<JSX.Element>;
|
|
84
|
-
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
85
|
-
};
|
|
86
73
|
}>;
|
|
87
74
|
"entity-card:api-docs/definition": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
88
75
|
kind: "entity-card";
|
|
76
|
+
namespace: undefined;
|
|
89
77
|
name: "definition";
|
|
90
78
|
config: {
|
|
91
79
|
filter: string | undefined;
|
|
@@ -99,13 +87,10 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
99
87
|
optional: true;
|
|
100
88
|
}>;
|
|
101
89
|
inputs: {};
|
|
102
|
-
params: {
|
|
103
|
-
loader: () => Promise<JSX.Element>;
|
|
104
|
-
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
105
|
-
};
|
|
106
90
|
}>;
|
|
107
91
|
"entity-card:api-docs/consumed-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
108
92
|
kind: "entity-card";
|
|
93
|
+
namespace: undefined;
|
|
109
94
|
name: "consumed-apis";
|
|
110
95
|
config: {
|
|
111
96
|
filter: string | undefined;
|
|
@@ -119,13 +104,10 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
119
104
|
optional: true;
|
|
120
105
|
}>;
|
|
121
106
|
inputs: {};
|
|
122
|
-
params: {
|
|
123
|
-
loader: () => Promise<JSX.Element>;
|
|
124
|
-
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
125
|
-
};
|
|
126
107
|
}>;
|
|
127
108
|
"entity-card:api-docs/provided-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
128
109
|
kind: "entity-card";
|
|
110
|
+
namespace: undefined;
|
|
129
111
|
name: "provided-apis";
|
|
130
112
|
config: {
|
|
131
113
|
filter: string | undefined;
|
|
@@ -139,13 +121,10 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
139
121
|
optional: true;
|
|
140
122
|
}>;
|
|
141
123
|
inputs: {};
|
|
142
|
-
params: {
|
|
143
|
-
loader: () => Promise<JSX.Element>;
|
|
144
|
-
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
145
|
-
};
|
|
146
124
|
}>;
|
|
147
125
|
"entity-card:api-docs/consuming-components": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
148
126
|
kind: "entity-card";
|
|
127
|
+
namespace: undefined;
|
|
149
128
|
name: "consuming-components";
|
|
150
129
|
config: {
|
|
151
130
|
filter: string | undefined;
|
|
@@ -159,13 +138,10 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
159
138
|
optional: true;
|
|
160
139
|
}>;
|
|
161
140
|
inputs: {};
|
|
162
|
-
params: {
|
|
163
|
-
loader: () => Promise<JSX.Element>;
|
|
164
|
-
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
165
|
-
};
|
|
166
141
|
}>;
|
|
167
142
|
"entity-card:api-docs/providing-components": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
168
143
|
kind: "entity-card";
|
|
144
|
+
namespace: undefined;
|
|
169
145
|
name: "providing-components";
|
|
170
146
|
config: {
|
|
171
147
|
filter: string | undefined;
|
|
@@ -179,13 +155,10 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
179
155
|
optional: true;
|
|
180
156
|
}>;
|
|
181
157
|
inputs: {};
|
|
182
|
-
params: {
|
|
183
|
-
loader: () => Promise<JSX.Element>;
|
|
184
|
-
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
185
|
-
};
|
|
186
158
|
}>;
|
|
187
159
|
"entity-content:api-docs/definition": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
188
160
|
kind: "entity-content";
|
|
161
|
+
namespace: undefined;
|
|
189
162
|
name: "definition";
|
|
190
163
|
config: {
|
|
191
164
|
path: string | undefined;
|
|
@@ -205,16 +178,10 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
205
178
|
optional: true;
|
|
206
179
|
}>;
|
|
207
180
|
inputs: {};
|
|
208
|
-
params: {
|
|
209
|
-
loader: () => Promise<JSX.Element>;
|
|
210
|
-
defaultPath: string;
|
|
211
|
-
defaultTitle: string;
|
|
212
|
-
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
213
|
-
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
214
|
-
};
|
|
215
181
|
}>;
|
|
216
182
|
"entity-content:api-docs/apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
217
183
|
kind: "entity-content";
|
|
184
|
+
namespace: undefined;
|
|
218
185
|
name: "apis";
|
|
219
186
|
config: {
|
|
220
187
|
path: string | undefined;
|
|
@@ -234,13 +201,6 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
234
201
|
optional: true;
|
|
235
202
|
}>;
|
|
236
203
|
inputs: {};
|
|
237
|
-
params: {
|
|
238
|
-
loader: () => Promise<JSX.Element>;
|
|
239
|
-
defaultPath: string;
|
|
240
|
-
defaultTitle: string;
|
|
241
|
-
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
242
|
-
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
243
|
-
};
|
|
244
204
|
}>;
|
|
245
205
|
}>;
|
|
246
206
|
|
|
@@ -34,14 +34,7 @@ const ConsumedApisCard = (props) => {
|
|
|
34
34
|
{
|
|
35
35
|
title,
|
|
36
36
|
variant,
|
|
37
|
-
emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not consume any APIs."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(
|
|
38
|
-
Link,
|
|
39
|
-
{
|
|
40
|
-
to: "https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional",
|
|
41
|
-
externalLinkIcon: true
|
|
42
|
-
},
|
|
43
|
-
"Learn how to change this"
|
|
44
|
-
))),
|
|
37
|
+
emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not consume any APIs."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional" }, "Learn how to change this."))),
|
|
45
38
|
columns,
|
|
46
39
|
tableOptions,
|
|
47
40
|
entities
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsumedApisCard.esm.js","sources":["../../../src/components/ApisCards/ConsumedApisCard.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 { ApiEntity, RELATION_CONSUMES_API } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\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 InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ConsumedApisCard = (props: {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ApiEntity>[];\n tableOptions?: TableOptions;\n}) => {\n const {\n variant = 'gridItem',\n title = 'Consumed APIs',\n columns = apiEntityColumns,\n tableOptions = {},\n } = 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={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\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={title}\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
|
|
1
|
+
{"version":3,"file":"ConsumedApisCard.esm.js","sources":["../../../src/components/ApisCards/ConsumedApisCard.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 { ApiEntity, RELATION_CONSUMES_API } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\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 InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ConsumedApisCard = (props: {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ApiEntity>[];\n tableOptions?: TableOptions;\n}) => {\n const {\n variant = 'gridItem',\n title = 'Consumed APIs',\n columns = apiEntityColumns,\n tableOptions = {},\n } = 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={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\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={title}\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={columns}\n tableOptions={tableOptions}\n entities={entities as ApiEntity[]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuCa,MAAA,gBAAA,GAAmB,CAAC,KAK3B,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ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AAkB,CAAA,OAAO,CAAE,EAAA,6BAE/C,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,EAAA,EAAG,iGAAkG,EAAA,EAAA,2BAE3G,CACF,CACF,CAAA;AAAA,MAEF,OAAA;AAAA,MACA,YAAA;AAAA,MACA,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -34,14 +34,7 @@ const ProvidedApisCard = (props) => {
|
|
|
34
34
|
{
|
|
35
35
|
title,
|
|
36
36
|
variant,
|
|
37
|
-
emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not provide any APIs."), /* @__PURE__ */ React.createElement(
|
|
38
|
-
Link,
|
|
39
|
-
{
|
|
40
|
-
to: "https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional",
|
|
41
|
-
externalLinkIcon: true
|
|
42
|
-
},
|
|
43
|
-
"Learn how to change this"
|
|
44
|
-
)),
|
|
37
|
+
emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not provide any APIs."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional" }, "Learn how to change this."))),
|
|
45
38
|
columns,
|
|
46
39
|
tableOptions,
|
|
47
40
|
entities
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProvidedApisCard.esm.js","sources":["../../../src/components/ApisCards/ProvidedApisCard.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 { ApiEntity, RELATION_PROVIDES_API } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\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 InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ProvidedApisCard = (props: {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ApiEntity>[];\n tableOptions?: TableOptions;\n}) => {\n const {\n variant = 'gridItem',\n title = 'Provided APIs',\n columns = apiEntityColumns,\n tableOptions = {},\n } = 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={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\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={title}\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 <
|
|
1
|
+
{"version":3,"file":"ProvidedApisCard.esm.js","sources":["../../../src/components/ApisCards/ProvidedApisCard.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 { ApiEntity, RELATION_PROVIDES_API } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\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 InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ProvidedApisCard = (props: {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ApiEntity>[];\n tableOptions?: TableOptions;\n}) => {\n const {\n variant = 'gridItem',\n title = 'Provided APIs',\n columns = apiEntityColumns,\n tableOptions = {},\n } = 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={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\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={title}\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>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EAAA,EAAA,KAAA,EAAO,EAAE,SAAA,EAAW,QAAS,EAAA,EAAA,kBAC/B,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAA,EAAQ,SACpB,MAAO,CAAA,IAAA,CAAK,iBAAkB,CAAA,OAAO,CAAE,EAAA,6BAE/C,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,EAAA,EAAG,iGAAkG,EAAA,EAAA,2BAE3G,CACF,CACF,CAAA;AAAA,MAEF,OAAA;AAAA,MACA,YAAA;AAAA,MACA,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-api-docs",
|
|
3
|
-
"version": "0.11.10
|
|
3
|
+
"version": "0.11.10",
|
|
4
4
|
"description": "A Backstage plugin that helps represent API entities in the frontend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"default": "./dist/index.esm.js"
|
|
31
31
|
},
|
|
32
32
|
"./alpha": {
|
|
33
|
-
"backstage": "@backstage/FrontendPlugin",
|
|
34
33
|
"import": "./dist/alpha.esm.js",
|
|
35
34
|
"types": "./dist/alpha.d.ts",
|
|
36
35
|
"default": "./dist/alpha.esm.js"
|
|
@@ -55,14 +54,14 @@
|
|
|
55
54
|
"dependencies": {
|
|
56
55
|
"@asyncapi/react-component": "1.3.1",
|
|
57
56
|
"@backstage/catalog-model": "^1.7.0",
|
|
58
|
-
"@backstage/core-compat-api": "^0.3.
|
|
59
|
-
"@backstage/core-components": "^0.15.
|
|
60
|
-
"@backstage/core-plugin-api": "^1.
|
|
61
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
62
|
-
"@backstage/plugin-catalog": "^1.
|
|
57
|
+
"@backstage/core-compat-api": "^0.3.0",
|
|
58
|
+
"@backstage/core-components": "^0.15.0",
|
|
59
|
+
"@backstage/core-plugin-api": "^1.9.4",
|
|
60
|
+
"@backstage/frontend-plugin-api": "^0.8.0",
|
|
61
|
+
"@backstage/plugin-catalog": "^1.23.1",
|
|
63
62
|
"@backstage/plugin-catalog-common": "^1.1.0",
|
|
64
|
-
"@backstage/plugin-catalog-react": "^1.13.1
|
|
65
|
-
"@backstage/plugin-permission-react": "^0.4.
|
|
63
|
+
"@backstage/plugin-catalog-react": "^1.13.1",
|
|
64
|
+
"@backstage/plugin-permission-react": "^0.4.26",
|
|
66
65
|
"@graphiql/react": "^0.23.0",
|
|
67
66
|
"@material-ui/core": "^4.12.2",
|
|
68
67
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -76,10 +75,10 @@
|
|
|
76
75
|
"swagger-ui-react": "^5.0.0"
|
|
77
76
|
},
|
|
78
77
|
"devDependencies": {
|
|
79
|
-
"@backstage/cli": "^0.
|
|
80
|
-
"@backstage/core-app-api": "^1.15.
|
|
81
|
-
"@backstage/dev-utils": "^1.1.1
|
|
82
|
-
"@backstage/test-utils": "^1.6.
|
|
78
|
+
"@backstage/cli": "^0.27.1",
|
|
79
|
+
"@backstage/core-app-api": "^1.15.0",
|
|
80
|
+
"@backstage/dev-utils": "^1.1.1",
|
|
81
|
+
"@backstage/test-utils": "^1.6.0",
|
|
83
82
|
"@testing-library/dom": "^10.0.0",
|
|
84
83
|
"@testing-library/jest-dom": "^6.0.0",
|
|
85
84
|
"@testing-library/react": "^16.0.0",
|