@backstage/plugin-api-docs 0.11.8-next.2 → 0.11.8-next.3
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 +16 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.d.ts +1 -1
- package/dist/components/ApisCards/ConsumedApisCard.esm.js +10 -4
- package/dist/components/ApisCards/ConsumedApisCard.esm.js.map +1 -1
- package/dist/components/ApisCards/HasApisCard.esm.js +10 -4
- package/dist/components/ApisCards/HasApisCard.esm.js.map +1 -1
- package/dist/components/ApisCards/ProvidedApisCard.esm.js +10 -4
- package/dist/components/ApisCards/ProvidedApisCard.esm.js.map +1 -1
- package/dist/index.d.ts +13 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @backstage/plugin-api-docs
|
|
2
2
|
|
|
3
|
+
## 0.11.8-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6582799: Add `tableOptions` to all tables and additionally `title` to API tables.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.7.0-next.3
|
|
10
|
+
- @backstage/plugin-catalog@1.22.0-next.3
|
|
11
|
+
- @backstage/catalog-model@1.6.0-next.0
|
|
12
|
+
- @backstage/core-compat-api@0.2.8-next.3
|
|
13
|
+
- @backstage/plugin-catalog-react@1.12.3-next.3
|
|
14
|
+
- @backstage/core-components@0.14.10-next.0
|
|
15
|
+
- @backstage/core-plugin-api@1.9.3
|
|
16
|
+
- @backstage/plugin-catalog-common@1.0.26-next.2
|
|
17
|
+
- @backstage/plugin-permission-react@0.4.25-next.1
|
|
18
|
+
|
|
3
19
|
## 0.11.8-next.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.d.ts
CHANGED
|
@@ -6,16 +6,21 @@ import { apiEntityColumns } from './presets.esm.js';
|
|
|
6
6
|
import { InfoCard, Progress, WarningPanel, CodeSnippet, Link } from '@backstage/core-components';
|
|
7
7
|
|
|
8
8
|
const ConsumedApisCard = (props) => {
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
variant = "gridItem",
|
|
11
|
+
title = "Consumed APIs",
|
|
12
|
+
columns = apiEntityColumns,
|
|
13
|
+
tableOptions = {}
|
|
14
|
+
} = props;
|
|
10
15
|
const { entity } = useEntity();
|
|
11
16
|
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
12
17
|
type: RELATION_CONSUMES_API
|
|
13
18
|
});
|
|
14
19
|
if (loading) {
|
|
15
|
-
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title
|
|
20
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title }, /* @__PURE__ */ React.createElement(Progress, null));
|
|
16
21
|
}
|
|
17
22
|
if (error || !entities) {
|
|
18
|
-
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title
|
|
23
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title }, /* @__PURE__ */ React.createElement(
|
|
19
24
|
WarningPanel,
|
|
20
25
|
{
|
|
21
26
|
severity: "error",
|
|
@@ -27,10 +32,11 @@ const ConsumedApisCard = (props) => {
|
|
|
27
32
|
return /* @__PURE__ */ React.createElement(
|
|
28
33
|
EntityTable,
|
|
29
34
|
{
|
|
30
|
-
title
|
|
35
|
+
title,
|
|
31
36
|
variant,
|
|
32
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."))),
|
|
33
38
|
columns,
|
|
39
|
+
tableOptions,
|
|
34
40
|
entities
|
|
35
41
|
}
|
|
36
42
|
);
|
|
@@ -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 WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ConsumedApisCard = (props: {\n variant?: InfoCardVariants;\n columns?: TableColumn<ApiEntity>[];\n}) => {\n const {
|
|
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,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,E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AA,EAAA,EAAG,iGAAkG,EAAA,EAAA,2BAE3G,CACF,CACF,CAAA;AAAA,MAEF,OAAA;AAAA,MACA,YAAA;AAAA,MACA,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -13,17 +13,22 @@ const presetColumns = [
|
|
|
13
13
|
EntityTable.columns.createMetadataDescriptionColumn()
|
|
14
14
|
];
|
|
15
15
|
const HasApisCard = (props) => {
|
|
16
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
variant = "gridItem",
|
|
18
|
+
title = "APIs",
|
|
19
|
+
columns = presetColumns,
|
|
20
|
+
tableOptions = {}
|
|
21
|
+
} = props;
|
|
17
22
|
const { entity } = useEntity();
|
|
18
23
|
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
19
24
|
type: RELATION_HAS_PART,
|
|
20
25
|
kind: "API"
|
|
21
26
|
});
|
|
22
27
|
if (loading) {
|
|
23
|
-
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title
|
|
28
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title }, /* @__PURE__ */ React.createElement(Progress, null));
|
|
24
29
|
}
|
|
25
30
|
if (error || !entities) {
|
|
26
|
-
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title
|
|
31
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title }, /* @__PURE__ */ React.createElement(
|
|
27
32
|
WarningPanel,
|
|
28
33
|
{
|
|
29
34
|
severity: "error",
|
|
@@ -35,10 +40,11 @@ const HasApisCard = (props) => {
|
|
|
35
40
|
return /* @__PURE__ */ React.createElement(
|
|
36
41
|
EntityTable,
|
|
37
42
|
{
|
|
38
|
-
title
|
|
43
|
+
title,
|
|
39
44
|
variant,
|
|
40
45
|
emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not contain any APIs."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api" }, "Learn how to change this."))),
|
|
41
46
|
columns,
|
|
47
|
+
tableOptions,
|
|
42
48
|
entities
|
|
43
49
|
}
|
|
44
50
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HasApisCard.esm.js","sources":["../../../src/components/ApisCards/HasApisCard.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_HAS_PART } 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 { createSpecApiTypeColumn } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n WarningPanel,\n} from '@backstage/core-components';\n\nconst presetColumns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\n\n/**\n * @public\n */\nexport const HasApisCard = (props: {\n variant?: InfoCardVariants;\n columns?: TableColumn<ApiEntity>[];\n}) => {\n const {
|
|
1
|
+
{"version":3,"file":"HasApisCard.esm.js","sources":["../../../src/components/ApisCards/HasApisCard.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_HAS_PART } 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 { createSpecApiTypeColumn } 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\nconst presetColumns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\n\n/**\n * @public\n */\nexport const HasApisCard = (props: {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ApiEntity>[];\n tableOptions?: TableOptions;\n}) => {\n const {\n variant = 'gridItem',\n title = 'APIs',\n columns = presetColumns,\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_HAS_PART,\n kind: 'API',\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={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 contain any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ApiEntity[]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAoCA,MAAM,aAA0C,GAAA;AAAA,EAC9C,YAAY,OAAQ,CAAA,qBAAA,CAAsB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,EAChE,WAAA,CAAY,QAAQ,iBAAkB,EAAA;AAAA,EACtC,uBAAwB,EAAA;AAAA,EACxB,WAAA,CAAY,QAAQ,yBAA0B,EAAA;AAAA,EAC9C,WAAA,CAAY,QAAQ,+BAAgC,EAAA;AACtD,CAAA,CAAA;AAKa,MAAA,WAAA,GAAc,CAAC,KAKtB,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,OAAU,GAAA,UAAA;AAAA,IACV,KAAQ,GAAA,MAAA;AAAA,IACR,OAAU,GAAA,aAAA;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,IAC9D,IAAM,EAAA,iBAAA;AAAA,IACN,IAAM,EAAA,KAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CACG,QAAS,EAAA,EAAA,OAAA,EAAkB,KAC1B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAS,CACZ,CAAA,CAAA;AAAA,GAEJ;AAEA,EAAI,IAAA,KAAA,IAAS,CAAC,QAAU,EAAA;AACtB,IACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,OAAA,EAAkB,KAC1B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,QAAS,EAAA,OAAA;AAAA,QACT,KAAM,EAAA,qBAAA;AAAA,QACN,OAAA,sCAAU,WAAY,EAAA,EAAA,IAAA,EAAM,GAAG,KAAK,CAAA,CAAA,EAAI,UAAS,MAAO,EAAA,CAAA;AAAA,OAAA;AAAA,KAE5D,CAAA,CAAA;AAAA,GAEJ;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,OAAA;AAAA,MACA,YACE,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,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,gFAAiF,EAAA,EAAA,2BAE1F,CACF,CACF,CAAA;AAAA,MAEF,OAAA;AAAA,MACA,YAAA;AAAA,MACA,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -6,16 +6,21 @@ import { apiEntityColumns } from './presets.esm.js';
|
|
|
6
6
|
import { InfoCard, Progress, WarningPanel, CodeSnippet, Link } from '@backstage/core-components';
|
|
7
7
|
|
|
8
8
|
const ProvidedApisCard = (props) => {
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
variant = "gridItem",
|
|
11
|
+
title = "Provided APIs",
|
|
12
|
+
columns = apiEntityColumns,
|
|
13
|
+
tableOptions = {}
|
|
14
|
+
} = props;
|
|
10
15
|
const { entity } = useEntity();
|
|
11
16
|
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
12
17
|
type: RELATION_PROVIDES_API
|
|
13
18
|
});
|
|
14
19
|
if (loading) {
|
|
15
|
-
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title
|
|
20
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title }, /* @__PURE__ */ React.createElement(Progress, null));
|
|
16
21
|
}
|
|
17
22
|
if (error || !entities) {
|
|
18
|
-
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title
|
|
23
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title }, /* @__PURE__ */ React.createElement(
|
|
19
24
|
WarningPanel,
|
|
20
25
|
{
|
|
21
26
|
severity: "error",
|
|
@@ -27,10 +32,11 @@ const ProvidedApisCard = (props) => {
|
|
|
27
32
|
return /* @__PURE__ */ React.createElement(
|
|
28
33
|
EntityTable,
|
|
29
34
|
{
|
|
30
|
-
title
|
|
35
|
+
title,
|
|
31
36
|
variant,
|
|
32
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."))),
|
|
33
38
|
columns,
|
|
39
|
+
tableOptions,
|
|
34
40
|
entities
|
|
35
41
|
}
|
|
36
42
|
);
|
|
@@ -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 WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ProvidedApisCard = (props: {\n variant?: InfoCardVariants;\n columns?: TableColumn<ApiEntity>[];\n}) => {\n const {
|
|
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>\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,IAC9D,IAAM,EAAA,qBAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAA,IAAI,OAAS,EAAA;AACX,IAAA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
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import * as _backstage_core_components from '@backstage/core-components';
|
|
5
|
-
import { TableColumn, TableProps, InfoCardVariants } from '@backstage/core-components';
|
|
5
|
+
import { TableColumn, TableProps, InfoCardVariants, TableOptions } from '@backstage/core-components';
|
|
6
6
|
import { CatalogTableRow } from '@backstage/plugin-catalog';
|
|
7
7
|
import { UserListFilterKind, EntityOwnerPickerProps } from '@backstage/plugin-catalog-react';
|
|
8
8
|
import { ApiEntity } from '@backstage/catalog-model';
|
|
@@ -66,7 +66,9 @@ declare function ApiDefinitionDialog(props: {
|
|
|
66
66
|
*/
|
|
67
67
|
declare const ConsumedApisCard: (props: {
|
|
68
68
|
variant?: InfoCardVariants;
|
|
69
|
+
title?: string;
|
|
69
70
|
columns?: TableColumn<ApiEntity>[];
|
|
71
|
+
tableOptions?: TableOptions;
|
|
70
72
|
}) => React__default.JSX.Element;
|
|
71
73
|
|
|
72
74
|
/**
|
|
@@ -74,7 +76,9 @@ declare const ConsumedApisCard: (props: {
|
|
|
74
76
|
*/
|
|
75
77
|
declare const HasApisCard: (props: {
|
|
76
78
|
variant?: InfoCardVariants;
|
|
79
|
+
title?: string;
|
|
77
80
|
columns?: TableColumn<ApiEntity>[];
|
|
81
|
+
tableOptions?: TableOptions;
|
|
78
82
|
}) => React__default.JSX.Element;
|
|
79
83
|
|
|
80
84
|
/**
|
|
@@ -82,7 +86,9 @@ declare const HasApisCard: (props: {
|
|
|
82
86
|
*/
|
|
83
87
|
declare const ProvidedApisCard: (props: {
|
|
84
88
|
variant?: InfoCardVariants;
|
|
89
|
+
title?: string;
|
|
85
90
|
columns?: TableColumn<ApiEntity>[];
|
|
91
|
+
tableOptions?: TableOptions;
|
|
86
92
|
}) => React__default.JSX.Element;
|
|
87
93
|
|
|
88
94
|
/** @public */
|
|
@@ -155,7 +161,9 @@ declare const EntityApiDefinitionCard: () => React.JSX.Element;
|
|
|
155
161
|
/** @public */
|
|
156
162
|
declare const EntityConsumedApisCard: (props: {
|
|
157
163
|
variant?: _backstage_core_components.InfoCardVariants | undefined;
|
|
164
|
+
title?: string | undefined;
|
|
158
165
|
columns?: _backstage_core_components.TableColumn<ApiEntity>[] | undefined;
|
|
166
|
+
tableOptions?: _backstage_core_components.TableOptions<{}> | undefined;
|
|
159
167
|
}) => React.JSX.Element;
|
|
160
168
|
/** @public */
|
|
161
169
|
declare const EntityConsumingComponentsCard: (props: {
|
|
@@ -164,7 +172,9 @@ declare const EntityConsumingComponentsCard: (props: {
|
|
|
164
172
|
/** @public */
|
|
165
173
|
declare const EntityProvidedApisCard: (props: {
|
|
166
174
|
variant?: _backstage_core_components.InfoCardVariants | undefined;
|
|
175
|
+
title?: string | undefined;
|
|
167
176
|
columns?: _backstage_core_components.TableColumn<ApiEntity>[] | undefined;
|
|
177
|
+
tableOptions?: _backstage_core_components.TableOptions<{}> | undefined;
|
|
168
178
|
}) => React.JSX.Element;
|
|
169
179
|
/** @public */
|
|
170
180
|
declare const EntityProvidingComponentsCard: (props: {
|
|
@@ -173,7 +183,9 @@ declare const EntityProvidingComponentsCard: (props: {
|
|
|
173
183
|
/** @public */
|
|
174
184
|
declare const EntityHasApisCard: (props: {
|
|
175
185
|
variant?: _backstage_core_components.InfoCardVariants | undefined;
|
|
186
|
+
title?: string | undefined;
|
|
176
187
|
columns?: _backstage_core_components.TableColumn<ApiEntity>[] | undefined;
|
|
188
|
+
tableOptions?: _backstage_core_components.TableOptions<{}> | undefined;
|
|
177
189
|
}) => React.JSX.Element;
|
|
178
190
|
|
|
179
191
|
export { ApiDefinitionCard, ApiDefinitionDialog, type ApiDefinitionWidget, type ApiDocsConfig, ApiExplorerPage$1 as ApiExplorerIndexPage, ApiExplorerPage, ApiTypeTitle, AsyncApiDefinitionWidget, type AsyncApiDefinitionWidgetProps, ConsumedApisCard, ConsumingComponentsCard, DefaultApiExplorerPage, type DefaultApiExplorerPageProps, EntityApiDefinitionCard, EntityConsumedApisCard, EntityConsumingComponentsCard, EntityHasApisCard, EntityProvidedApisCard, EntityProvidingComponentsCard, GraphQlDefinitionWidget, type GraphQlDefinitionWidgetProps, HasApisCard, OpenApiDefinitionWidget, type OpenApiDefinitionWidgetProps, PlainApiDefinitionWidget, type PlainApiDefinitionWidgetProps, ProvidedApisCard, ProvidingComponentsCard, TrpcApiDefinitionWidget, type TrpcApiDefinitionWidgetProps, apiDocsConfigRef, apiDocsPlugin, defaultDefinitionWidgets, apiDocsPlugin as plugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-api-docs",
|
|
3
|
-
"version": "0.11.8-next.
|
|
3
|
+
"version": "0.11.8-next.3",
|
|
4
4
|
"description": "A Backstage plugin that helps represent API entities in the frontend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@asyncapi/react-component": "1.3.1",
|
|
56
|
-
"@backstage/catalog-model": "^1.
|
|
57
|
-
"@backstage/core-compat-api": "^0.2.8-next.
|
|
56
|
+
"@backstage/catalog-model": "^1.6.0-next.0",
|
|
57
|
+
"@backstage/core-compat-api": "^0.2.8-next.3",
|
|
58
58
|
"@backstage/core-components": "^0.14.10-next.0",
|
|
59
59
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
60
|
-
"@backstage/frontend-plugin-api": "^0.7.0-next.
|
|
61
|
-
"@backstage/plugin-catalog": "^1.22.0-next.
|
|
62
|
-
"@backstage/plugin-catalog-common": "^1.0.26-next.
|
|
63
|
-
"@backstage/plugin-catalog-react": "^1.12.3-next.
|
|
60
|
+
"@backstage/frontend-plugin-api": "^0.7.0-next.3",
|
|
61
|
+
"@backstage/plugin-catalog": "^1.22.0-next.3",
|
|
62
|
+
"@backstage/plugin-catalog-common": "^1.0.26-next.2",
|
|
63
|
+
"@backstage/plugin-catalog-react": "^1.12.3-next.3",
|
|
64
64
|
"@backstage/plugin-permission-react": "^0.4.25-next.1",
|
|
65
65
|
"@graphiql/react": "^0.23.0",
|
|
66
66
|
"@material-ui/core": "^4.12.2",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"swagger-ui-react": "^5.0.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@backstage/cli": "^0.27.0-next.
|
|
78
|
+
"@backstage/cli": "^0.27.0-next.4",
|
|
79
79
|
"@backstage/core-app-api": "^1.14.2-next.0",
|
|
80
|
-
"@backstage/dev-utils": "^1.0.37-next.
|
|
80
|
+
"@backstage/dev-utils": "^1.0.37-next.3",
|
|
81
81
|
"@backstage/test-utils": "^1.5.10-next.2",
|
|
82
82
|
"@testing-library/dom": "^10.0.0",
|
|
83
83
|
"@testing-library/jest-dom": "^6.0.0",
|