@backstage/plugin-api-docs 0.11.10 → 0.11.11-next.2
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 +42 -4
- package/alpha/package.json +1 -1
- package/dist/alpha.d.ts +51 -11
- package/dist/components/ApisCards/ConsumedApisCard.esm.js +8 -1
- package/dist/components/ApisCards/ConsumedApisCard.esm.js.map +1 -1
- package/dist/components/ApisCards/ProvidedApisCard.esm.js +8 -1
- package/dist/components/ApisCards/ProvidedApisCard.esm.js.map +1 -1
- package/package.json +26 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,51 @@
|
|
|
1
1
|
# @backstage/plugin-api-docs
|
|
2
2
|
|
|
3
|
-
## 0.11.
|
|
3
|
+
## 0.11.11-next.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies
|
|
8
|
-
- @backstage/plugin-catalog@1.
|
|
9
|
-
- @backstage/plugin-catalog-react@1.
|
|
10
|
-
- @backstage/
|
|
8
|
+
- @backstage/plugin-catalog@1.24.0-next.2
|
|
9
|
+
- @backstage/plugin-catalog-react@1.14.0-next.2
|
|
10
|
+
- @backstage/catalog-model@1.7.0
|
|
11
|
+
- @backstage/core-compat-api@0.3.1-next.2
|
|
12
|
+
- @backstage/core-components@0.15.1-next.2
|
|
13
|
+
- @backstage/core-plugin-api@1.10.0-next.1
|
|
14
|
+
- @backstage/frontend-plugin-api@0.9.0-next.2
|
|
15
|
+
- @backstage/plugin-catalog-common@1.1.0
|
|
16
|
+
- @backstage/plugin-permission-react@0.4.27-next.1
|
|
17
|
+
|
|
18
|
+
## 0.11.11-next.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- e969dc7: Move `@types/react` to a peer dependency.
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @backstage/core-components@0.15.1-next.1
|
|
25
|
+
- @backstage/frontend-plugin-api@0.9.0-next.1
|
|
26
|
+
- @backstage/core-compat-api@0.3.1-next.1
|
|
27
|
+
- @backstage/core-plugin-api@1.10.0-next.1
|
|
28
|
+
- @backstage/plugin-permission-react@0.4.27-next.1
|
|
29
|
+
- @backstage/plugin-catalog-react@1.14.0-next.1
|
|
30
|
+
- @backstage/plugin-catalog@1.24.0-next.1
|
|
31
|
+
- @backstage/catalog-model@1.7.0
|
|
32
|
+
- @backstage/plugin-catalog-common@1.1.0
|
|
33
|
+
|
|
34
|
+
## 0.11.10-next.0
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- 46b5a20: Empty states updated with external link icon for learn more links
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
- @backstage/frontend-plugin-api@0.9.0-next.0
|
|
41
|
+
- @backstage/plugin-catalog@1.24.0-next.0
|
|
42
|
+
- @backstage/core-compat-api@0.3.1-next.0
|
|
43
|
+
- @backstage/core-components@0.15.1-next.0
|
|
44
|
+
- @backstage/core-plugin-api@1.10.0-next.0
|
|
45
|
+
- @backstage/plugin-catalog-react@1.13.1-next.0
|
|
46
|
+
- @backstage/catalog-model@1.7.0
|
|
47
|
+
- @backstage/plugin-catalog-common@1.1.0
|
|
48
|
+
- @backstage/plugin-permission-react@0.4.27-next.0
|
|
11
49
|
|
|
12
50
|
## 0.11.9
|
|
13
51
|
|
package/alpha/package.json
CHANGED
package/dist/alpha.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ 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;
|
|
14
13
|
name: undefined;
|
|
15
14
|
config: {};
|
|
16
15
|
configInput: {};
|
|
@@ -20,15 +19,22 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
20
19
|
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
21
20
|
}, "core.nav-item.target", {}>;
|
|
22
21
|
inputs: {};
|
|
22
|
+
params: {
|
|
23
|
+
title: string;
|
|
24
|
+
icon: _backstage_core_plugin_api.IconComponent;
|
|
25
|
+
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
26
|
+
};
|
|
23
27
|
}>;
|
|
24
28
|
"api:api-docs/config": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
25
29
|
kind: "api";
|
|
26
|
-
namespace: undefined;
|
|
27
30
|
name: "config";
|
|
28
31
|
config: {};
|
|
29
32
|
configInput: {};
|
|
30
33
|
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
31
34
|
inputs: {};
|
|
35
|
+
params: {
|
|
36
|
+
factory: _backstage_frontend_plugin_api.AnyApiFactory;
|
|
37
|
+
};
|
|
32
38
|
}>;
|
|
33
39
|
"page:api-docs": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
34
40
|
config: {
|
|
@@ -51,12 +57,15 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
51
57
|
}>;
|
|
52
58
|
};
|
|
53
59
|
kind: "page";
|
|
54
|
-
namespace: undefined;
|
|
55
60
|
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
|
+
};
|
|
56
66
|
}>;
|
|
57
67
|
"entity-card:api-docs/has-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
58
68
|
kind: "entity-card";
|
|
59
|
-
namespace: undefined;
|
|
60
69
|
name: "has-apis";
|
|
61
70
|
config: {
|
|
62
71
|
filter: string | undefined;
|
|
@@ -70,10 +79,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
70
79
|
optional: true;
|
|
71
80
|
}>;
|
|
72
81
|
inputs: {};
|
|
82
|
+
params: {
|
|
83
|
+
loader: () => Promise<JSX.Element>;
|
|
84
|
+
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
85
|
+
};
|
|
73
86
|
}>;
|
|
74
87
|
"entity-card:api-docs/definition": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
75
88
|
kind: "entity-card";
|
|
76
|
-
namespace: undefined;
|
|
77
89
|
name: "definition";
|
|
78
90
|
config: {
|
|
79
91
|
filter: string | undefined;
|
|
@@ -87,10 +99,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
87
99
|
optional: true;
|
|
88
100
|
}>;
|
|
89
101
|
inputs: {};
|
|
102
|
+
params: {
|
|
103
|
+
loader: () => Promise<JSX.Element>;
|
|
104
|
+
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
105
|
+
};
|
|
90
106
|
}>;
|
|
91
107
|
"entity-card:api-docs/consumed-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
92
108
|
kind: "entity-card";
|
|
93
|
-
namespace: undefined;
|
|
94
109
|
name: "consumed-apis";
|
|
95
110
|
config: {
|
|
96
111
|
filter: string | undefined;
|
|
@@ -104,10 +119,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
104
119
|
optional: true;
|
|
105
120
|
}>;
|
|
106
121
|
inputs: {};
|
|
122
|
+
params: {
|
|
123
|
+
loader: () => Promise<JSX.Element>;
|
|
124
|
+
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
125
|
+
};
|
|
107
126
|
}>;
|
|
108
127
|
"entity-card:api-docs/provided-apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
109
128
|
kind: "entity-card";
|
|
110
|
-
namespace: undefined;
|
|
111
129
|
name: "provided-apis";
|
|
112
130
|
config: {
|
|
113
131
|
filter: string | undefined;
|
|
@@ -121,10 +139,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
121
139
|
optional: true;
|
|
122
140
|
}>;
|
|
123
141
|
inputs: {};
|
|
142
|
+
params: {
|
|
143
|
+
loader: () => Promise<JSX.Element>;
|
|
144
|
+
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
145
|
+
};
|
|
124
146
|
}>;
|
|
125
147
|
"entity-card:api-docs/consuming-components": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
126
148
|
kind: "entity-card";
|
|
127
|
-
namespace: undefined;
|
|
128
149
|
name: "consuming-components";
|
|
129
150
|
config: {
|
|
130
151
|
filter: string | undefined;
|
|
@@ -138,10 +159,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
138
159
|
optional: true;
|
|
139
160
|
}>;
|
|
140
161
|
inputs: {};
|
|
162
|
+
params: {
|
|
163
|
+
loader: () => Promise<JSX.Element>;
|
|
164
|
+
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
165
|
+
};
|
|
141
166
|
}>;
|
|
142
167
|
"entity-card:api-docs/providing-components": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
143
168
|
kind: "entity-card";
|
|
144
|
-
namespace: undefined;
|
|
145
169
|
name: "providing-components";
|
|
146
170
|
config: {
|
|
147
171
|
filter: string | undefined;
|
|
@@ -155,10 +179,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
155
179
|
optional: true;
|
|
156
180
|
}>;
|
|
157
181
|
inputs: {};
|
|
182
|
+
params: {
|
|
183
|
+
loader: () => Promise<JSX.Element>;
|
|
184
|
+
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
185
|
+
};
|
|
158
186
|
}>;
|
|
159
187
|
"entity-content:api-docs/definition": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
160
188
|
kind: "entity-content";
|
|
161
|
-
namespace: undefined;
|
|
162
189
|
name: "definition";
|
|
163
190
|
config: {
|
|
164
191
|
path: string | undefined;
|
|
@@ -178,10 +205,16 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
178
205
|
optional: true;
|
|
179
206
|
}>;
|
|
180
207
|
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
|
+
};
|
|
181
215
|
}>;
|
|
182
216
|
"entity-content:api-docs/apis": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
183
217
|
kind: "entity-content";
|
|
184
|
-
namespace: undefined;
|
|
185
218
|
name: "apis";
|
|
186
219
|
config: {
|
|
187
220
|
path: string | undefined;
|
|
@@ -201,6 +234,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
201
234
|
optional: true;
|
|
202
235
|
}>;
|
|
203
236
|
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
|
+
};
|
|
204
244
|
}>;
|
|
205
245
|
}>;
|
|
206
246
|
|
|
@@ -34,7 +34,14 @@ 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(
|
|
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
|
+
))),
|
|
38
45
|
columns,
|
|
39
46
|
tableOptions,
|
|
40
47
|
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\n to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\"\n externalLinkIcon\n >\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,OAAU,GAAA,UAAA;AAAA,IACV,KAAQ,GAAA,eAAA;AAAA,IACR,OAAU,GAAA,gBAAA;AAAA,IACV,eAAe,EAAC;AAAA,GACd,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAA,MAAM,EAAE,QAAU,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,mBAAmB,MAAQ,EAAA;AAAA,IAC9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AAAA,MACA,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -34,7 +34,14 @@ 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(
|
|
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
|
+
)),
|
|
38
45
|
columns,
|
|
39
46
|
tableOptions,
|
|
40
47
|
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 <Link\n to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\"\n externalLinkIcon\n >\n Learn how to change this\n </Link>\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,OAAU,GAAA,UAAA;AAAA,IACV,KAAQ,GAAA,eAAA;AAAA,IACR,OAAU,GAAA,gBAAA;AAAA,IACV,eAAe,EAAC;AAAA,GACd,GAAA,KAAA,CAAA;AACJ,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B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A,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.
|
|
3
|
+
"version": "0.11.11-next.2",
|
|
4
4
|
"description": "A Backstage plugin that helps represent API entities in the frontend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"default": "./dist/index.esm.js"
|
|
31
31
|
},
|
|
32
32
|
"./alpha": {
|
|
33
|
+
"backstage": "@backstage/FrontendPlugin",
|
|
33
34
|
"import": "./dist/alpha.esm.js",
|
|
34
35
|
"types": "./dist/alpha.d.ts",
|
|
35
36
|
"default": "./dist/alpha.esm.js"
|
|
@@ -53,20 +54,19 @@
|
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
56
|
"@asyncapi/react-component": "1.3.1",
|
|
56
|
-
"@backstage/catalog-model": "
|
|
57
|
-
"@backstage/core-compat-api": "
|
|
58
|
-
"@backstage/core-components": "
|
|
59
|
-
"@backstage/core-plugin-api": "
|
|
60
|
-
"@backstage/frontend-plugin-api": "
|
|
61
|
-
"@backstage/plugin-catalog": "
|
|
62
|
-
"@backstage/plugin-catalog-common": "
|
|
63
|
-
"@backstage/plugin-catalog-react": "
|
|
64
|
-
"@backstage/plugin-permission-react": "
|
|
57
|
+
"@backstage/catalog-model": "1.7.0",
|
|
58
|
+
"@backstage/core-compat-api": "0.3.1-next.2",
|
|
59
|
+
"@backstage/core-components": "0.15.1-next.2",
|
|
60
|
+
"@backstage/core-plugin-api": "1.10.0-next.1",
|
|
61
|
+
"@backstage/frontend-plugin-api": "0.9.0-next.2",
|
|
62
|
+
"@backstage/plugin-catalog": "1.24.0-next.2",
|
|
63
|
+
"@backstage/plugin-catalog-common": "1.1.0",
|
|
64
|
+
"@backstage/plugin-catalog-react": "1.14.0-next.2",
|
|
65
|
+
"@backstage/plugin-permission-react": "0.4.27-next.1",
|
|
65
66
|
"@graphiql/react": "^0.23.0",
|
|
66
67
|
"@material-ui/core": "^4.12.2",
|
|
67
68
|
"@material-ui/icons": "^4.9.1",
|
|
68
69
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
69
|
-
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
70
70
|
"graphiql": "3.1.1",
|
|
71
71
|
"graphql": "^16.0.0",
|
|
72
72
|
"graphql-config": "^5.0.2",
|
|
@@ -75,21 +75,31 @@
|
|
|
75
75
|
"swagger-ui-react": "^5.0.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@backstage/cli": "
|
|
79
|
-
"@backstage/core-app-api": "
|
|
80
|
-
"@backstage/dev-utils": "
|
|
81
|
-
"@backstage/test-utils": "
|
|
78
|
+
"@backstage/cli": "0.28.0-next.2",
|
|
79
|
+
"@backstage/core-app-api": "1.15.1-next.1",
|
|
80
|
+
"@backstage/dev-utils": "1.1.2-next.2",
|
|
81
|
+
"@backstage/test-utils": "1.6.1-next.2",
|
|
82
82
|
"@testing-library/dom": "^10.0.0",
|
|
83
83
|
"@testing-library/jest-dom": "^6.0.0",
|
|
84
84
|
"@testing-library/react": "^16.0.0",
|
|
85
85
|
"@testing-library/user-event": "^14.0.0",
|
|
86
86
|
"@types/highlightjs": "^10.1.0",
|
|
87
|
-
"@types/
|
|
87
|
+
"@types/react": "^18.0.0",
|
|
88
|
+
"@types/swagger-ui-react": "^4.18.0",
|
|
89
|
+
"react": "^18.0.2",
|
|
90
|
+
"react-dom": "^18.0.2",
|
|
91
|
+
"react-router-dom": "^6.3.0"
|
|
88
92
|
},
|
|
89
93
|
"peerDependencies": {
|
|
94
|
+
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
90
95
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
91
96
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
92
97
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
93
98
|
},
|
|
99
|
+
"peerDependenciesMeta": {
|
|
100
|
+
"@types/react": {
|
|
101
|
+
"optional": true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
94
104
|
"module": "./dist/index.esm.js"
|
|
95
105
|
}
|