@backstage/plugin-api-docs 0.11.4 → 0.11.5-next.1
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 +27 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.esm.js +12 -11
- package/dist/alpha.esm.js.map +1 -1
- package/dist/{esm/ApiDefinitionCard-B-gBxw4Y.esm.js → components/ApiDefinitionCard/ApiDefinitionCard.esm.js} +4 -4
- package/dist/components/ApiDefinitionCard/ApiDefinitionCard.esm.js.map +1 -0
- package/dist/components/ApiDefinitionCard/ApiDefinitionWidget.esm.js +42 -0
- package/dist/components/ApiDefinitionCard/ApiDefinitionWidget.esm.js.map +1 -0
- package/dist/components/ApiDefinitionCard/ApiTypeTitle.esm.js +15 -0
- package/dist/components/ApiDefinitionCard/ApiTypeTitle.esm.js.map +1 -0
- package/dist/components/ApiDefinitionCard/index.esm.js +4 -0
- package/dist/components/ApiDefinitionCard/index.esm.js.map +1 -0
- package/dist/components/ApiDefinitionDialog/ApiDefinitionDialog.esm.js +117 -0
- package/dist/components/ApiDefinitionDialog/ApiDefinitionDialog.esm.js.map +1 -0
- package/dist/components/ApiExplorerPage/ApiExplorerPage.esm.js +11 -0
- package/dist/components/ApiExplorerPage/ApiExplorerPage.esm.js.map +1 -0
- package/dist/{esm/ApiExplorerPage-DN8sGDDe.esm.js → components/ApiExplorerPage/DefaultApiExplorerPage.esm.js} +4 -10
- package/dist/components/ApiExplorerPage/DefaultApiExplorerPage.esm.js.map +1 -0
- package/dist/components/ApiExplorerPage/index.esm.js +3 -0
- package/dist/components/ApiExplorerPage/index.esm.js.map +1 -0
- package/dist/components/ApisCards/ConsumedApisCard.esm.js +40 -0
- package/dist/components/ApisCards/ConsumedApisCard.esm.js.map +1 -0
- package/dist/components/ApisCards/HasApisCard.esm.js +48 -0
- package/dist/components/ApisCards/HasApisCard.esm.js.map +1 -0
- package/dist/components/ApisCards/ProvidedApisCard.esm.js +40 -0
- package/dist/components/ApisCards/ProvidedApisCard.esm.js.map +1 -0
- package/dist/components/ApisCards/index.esm.js +4 -0
- package/dist/components/ApisCards/index.esm.js.map +1 -0
- package/dist/components/ApisCards/presets.esm.js +58 -0
- package/dist/components/ApisCards/presets.esm.js.map +1 -0
- package/dist/{esm/AsyncApiDefinition-BS46mwIR.esm.js → components/AsyncApiDefinitionWidget/AsyncApiDefinition.esm.js} +1 -1
- package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinition.esm.js.map +1 -0
- package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js +14 -0
- package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js.map +1 -0
- package/dist/{esm/ProvidingComponentsCard-DleuYPKR.esm.js → components/ComponentsCards/ConsumingComponentsCard.esm.js} +3 -34
- package/dist/components/ComponentsCards/ConsumingComponentsCard.esm.js.map +1 -0
- package/dist/components/ComponentsCards/ProvidingComponentsCard.esm.js +39 -0
- package/dist/components/ComponentsCards/ProvidingComponentsCard.esm.js.map +1 -0
- package/dist/components/ComponentsCards/index.esm.js +3 -0
- package/dist/components/ComponentsCards/index.esm.js.map +1 -0
- package/dist/{esm/GraphQlDefinition-D3sN0srb.esm.js → components/GraphQlDefinitionWidget/GraphQlDefinition.esm.js} +1 -1
- package/dist/components/GraphQlDefinitionWidget/GraphQlDefinition.esm.js.map +1 -0
- package/dist/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js +14 -0
- package/dist/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js.map +1 -0
- package/dist/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.esm.js +19 -0
- package/dist/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.esm.js.map +1 -0
- package/dist/{esm/OpenApiDefinition-P9gI3GDo.esm.js → components/OpenApiDefinitionWidget/OpenApiDefinition.esm.js} +1 -1
- package/dist/components/OpenApiDefinitionWidget/OpenApiDefinition.esm.js.map +1 -0
- package/dist/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js +24 -0
- package/dist/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js.map +1 -0
- package/dist/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.esm.js +16 -0
- package/dist/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.esm.js.map +1 -0
- package/dist/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.esm.js +20 -0
- package/dist/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.esm.js.map +1 -0
- package/dist/config.esm.js +8 -0
- package/dist/config.esm.js.map +1 -0
- package/dist/index.esm.js +18 -114
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +95 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/routes.esm.js +12 -0
- package/dist/routes.esm.js.map +1 -0
- package/package.json +12 -11
- package/dist/esm/ApiDefinitionCard-B-gBxw4Y.esm.js.map +0 -1
- package/dist/esm/ApiDefinitionWidget-B2Z_EBYd.esm.js +0 -116
- package/dist/esm/ApiDefinitionWidget-B2Z_EBYd.esm.js.map +0 -1
- package/dist/esm/ApiExplorerPage-DN8sGDDe.esm.js.map +0 -1
- package/dist/esm/ApiTypeTitle-Q7DWBnfV.esm.js +0 -27
- package/dist/esm/ApiTypeTitle-Q7DWBnfV.esm.js.map +0 -1
- package/dist/esm/AsyncApiDefinition-BS46mwIR.esm.js.map +0 -1
- package/dist/esm/GraphQlDefinition-D3sN0srb.esm.js.map +0 -1
- package/dist/esm/OpenApiDefinition-P9gI3GDo.esm.js.map +0 -1
- package/dist/esm/ProvidedApisCard-DYM2U8N2.esm.js +0 -265
- package/dist/esm/ProvidedApisCard-DYM2U8N2.esm.js.map +0 -1
- package/dist/esm/ProvidingComponentsCard-DleuYPKR.esm.js.map +0 -1
- package/dist/esm/index-BREvzWXp.esm.js +0 -22
- package/dist/esm/index-BREvzWXp.esm.js.map +0 -1
- package/dist/esm/index-BnvGScty.esm.js +0 -11
- package/dist/esm/index-BnvGScty.esm.js.map +0 -1
- package/dist/esm/index-CEoQtSjl.esm.js +0 -7
- package/dist/esm/index-CEoQtSjl.esm.js.map +0 -1
- package/dist/esm/index-DDxb-GVK.esm.js +0 -12
- package/dist/esm/index-DDxb-GVK.esm.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RELATION_HAS_PART } from '@backstage/catalog-model';
|
|
2
|
+
import Typography from '@material-ui/core/Typography';
|
|
3
|
+
import { EntityTable, useEntity, useRelatedEntities } from '@backstage/plugin-catalog-react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { createSpecApiTypeColumn } from './presets.esm.js';
|
|
6
|
+
import { InfoCard, Progress, WarningPanel, CodeSnippet, Link } from '@backstage/core-components';
|
|
7
|
+
|
|
8
|
+
const presetColumns = [
|
|
9
|
+
EntityTable.columns.createEntityRefColumn({ defaultKind: "API" }),
|
|
10
|
+
EntityTable.columns.createOwnerColumn(),
|
|
11
|
+
createSpecApiTypeColumn(),
|
|
12
|
+
EntityTable.columns.createSpecLifecycleColumn(),
|
|
13
|
+
EntityTable.columns.createMetadataDescriptionColumn()
|
|
14
|
+
];
|
|
15
|
+
const HasApisCard = (props) => {
|
|
16
|
+
const { variant = "gridItem", columns = presetColumns } = props;
|
|
17
|
+
const { entity } = useEntity();
|
|
18
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
19
|
+
type: RELATION_HAS_PART,
|
|
20
|
+
kind: "API"
|
|
21
|
+
});
|
|
22
|
+
if (loading) {
|
|
23
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "APIs" }, /* @__PURE__ */ React.createElement(Progress, null));
|
|
24
|
+
}
|
|
25
|
+
if (error || !entities) {
|
|
26
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "APIs" }, /* @__PURE__ */ React.createElement(
|
|
27
|
+
WarningPanel,
|
|
28
|
+
{
|
|
29
|
+
severity: "error",
|
|
30
|
+
title: "Could not load APIs",
|
|
31
|
+
message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
|
|
32
|
+
}
|
|
33
|
+
));
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ React.createElement(
|
|
36
|
+
EntityTable,
|
|
37
|
+
{
|
|
38
|
+
title: "APIs",
|
|
39
|
+
variant,
|
|
40
|
+
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
|
+
columns,
|
|
42
|
+
entities
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { HasApisCard };
|
|
48
|
+
//# sourceMappingURL=HasApisCard.esm.js.map
|
|
@@ -0,0 +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 { variant = 'gridItem', columns = presetColumns } = 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=\"APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"APIs\">\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=\"APIs\"\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 entities={entities as ApiEntity[]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAmCA,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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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,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RELATION_PROVIDES_API } from '@backstage/catalog-model';
|
|
2
|
+
import Typography from '@material-ui/core/Typography';
|
|
3
|
+
import { useEntity, useRelatedEntities, EntityTable } from '@backstage/plugin-catalog-react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { apiEntityColumns } from './presets.esm.js';
|
|
6
|
+
import { InfoCard, Progress, WarningPanel, CodeSnippet, Link } from '@backstage/core-components';
|
|
7
|
+
|
|
8
|
+
const ProvidedApisCard = (props) => {
|
|
9
|
+
const { variant = "gridItem", columns = apiEntityColumns } = props;
|
|
10
|
+
const { entity } = useEntity();
|
|
11
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
12
|
+
type: RELATION_PROVIDES_API
|
|
13
|
+
});
|
|
14
|
+
if (loading) {
|
|
15
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Provided APIs" }, /* @__PURE__ */ React.createElement(Progress, null));
|
|
16
|
+
}
|
|
17
|
+
if (error || !entities) {
|
|
18
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Provided APIs" }, /* @__PURE__ */ React.createElement(
|
|
19
|
+
WarningPanel,
|
|
20
|
+
{
|
|
21
|
+
severity: "error",
|
|
22
|
+
title: "Could not load APIs",
|
|
23
|
+
message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
|
|
24
|
+
}
|
|
25
|
+
));
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ React.createElement(
|
|
28
|
+
EntityTable,
|
|
29
|
+
{
|
|
30
|
+
title: "Provided APIs",
|
|
31
|
+
variant,
|
|
32
|
+
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
|
+
columns,
|
|
34
|
+
entities
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { ProvidedApisCard };
|
|
40
|
+
//# sourceMappingURL=ProvidedApisCard.esm.js.map
|
|
@@ -0,0 +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 { variant = 'gridItem', columns = apiEntityColumns } = 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=\"Provided APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Provided APIs\">\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=\"Provided APIs\"\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 entities={entities as ApiEntity[]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAsCa,MAAA,gBAAA,GAAmB,CAAC,KAG3B,KAAA;AACJ,EAAA,MAAM,EAAE,OAAA,GAAU,UAAY,EAAA,OAAA,GAAU,kBAAqB,GAAA,KAAA,CAAA;AAC7D,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,2CACG,QAAS,EAAA,EAAA,OAAA,EAAkB,OAAM,eAChC,EAAA,kBA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 +1,58 @@
|
|
|
1
|
+
import { EntityTable } from '@backstage/plugin-catalog-react';
|
|
2
|
+
import ExtensionIcon from '@material-ui/icons/Extension';
|
|
3
|
+
import ToggleButton from '@material-ui/lab/ToggleButton';
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import '@material-ui/lab/Alert';
|
|
6
|
+
import '../../config.esm.js';
|
|
7
|
+
import '@backstage/core-components';
|
|
8
|
+
import '@backstage/core-plugin-api';
|
|
9
|
+
import '../AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js';
|
|
10
|
+
import '../GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js';
|
|
11
|
+
import '../OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js';
|
|
12
|
+
import '@material-ui/core/styles';
|
|
13
|
+
import { ApiTypeTitle } from '../ApiDefinitionCard/ApiTypeTitle.esm.js';
|
|
14
|
+
import { ApiDefinitionDialog } from '../ApiDefinitionDialog/ApiDefinitionDialog.esm.js';
|
|
15
|
+
|
|
16
|
+
function createSpecApiTypeColumn() {
|
|
17
|
+
return {
|
|
18
|
+
title: "Type",
|
|
19
|
+
field: "spec.type",
|
|
20
|
+
render: (entity) => /* @__PURE__ */ React.createElement(ApiTypeTitle, { apiEntity: entity })
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const ApiDefinitionButton = ({ apiEntity }) => {
|
|
24
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
25
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
26
|
+
ToggleButton,
|
|
27
|
+
{
|
|
28
|
+
"aria-label": "Toggle API Definition Dialog",
|
|
29
|
+
onClick: () => setDialogOpen(!dialogOpen)
|
|
30
|
+
},
|
|
31
|
+
/* @__PURE__ */ React.createElement(ExtensionIcon, null)
|
|
32
|
+
), /* @__PURE__ */ React.createElement(
|
|
33
|
+
ApiDefinitionDialog,
|
|
34
|
+
{
|
|
35
|
+
entity: apiEntity,
|
|
36
|
+
open: dialogOpen,
|
|
37
|
+
onClose: () => setDialogOpen(false)
|
|
38
|
+
}
|
|
39
|
+
));
|
|
40
|
+
};
|
|
41
|
+
function createApiDefinitionColumn() {
|
|
42
|
+
return {
|
|
43
|
+
title: "API Definition",
|
|
44
|
+
render: (entity) => /* @__PURE__ */ React.createElement(ApiDefinitionButton, { apiEntity: entity })
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const apiEntityColumns = [
|
|
48
|
+
EntityTable.columns.createEntityRefColumn({ defaultKind: "API" }),
|
|
49
|
+
EntityTable.columns.createSystemColumn(),
|
|
50
|
+
EntityTable.columns.createOwnerColumn(),
|
|
51
|
+
createSpecApiTypeColumn(),
|
|
52
|
+
EntityTable.columns.createSpecLifecycleColumn(),
|
|
53
|
+
EntityTable.columns.createMetadataDescriptionColumn(),
|
|
54
|
+
createApiDefinitionColumn()
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
export { apiEntityColumns, createSpecApiTypeColumn };
|
|
58
|
+
//# sourceMappingURL=presets.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.esm.js","sources":["../../../src/components/ApisCards/presets.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 } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport ExtensionIcon from '@material-ui/icons/Extension';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\nimport React, { useState } from 'react';\nimport { ApiTypeTitle } from '../ApiDefinitionCard';\nimport { ApiDefinitionDialog } from '../ApiDefinitionDialog';\n\nexport function createSpecApiTypeColumn(): TableColumn<ApiEntity> {\n return {\n title: 'Type',\n field: 'spec.type',\n render: entity => <ApiTypeTitle apiEntity={entity} />,\n };\n}\n\nconst ApiDefinitionButton = ({ apiEntity }: { apiEntity: ApiEntity }) => {\n const [dialogOpen, setDialogOpen] = useState(false);\n return (\n <>\n <ToggleButton\n aria-label=\"Toggle API Definition Dialog\"\n onClick={() => setDialogOpen(!dialogOpen)}\n >\n <ExtensionIcon />\n </ToggleButton>\n <ApiDefinitionDialog\n entity={apiEntity}\n open={dialogOpen}\n onClose={() => setDialogOpen(false)}\n />\n </>\n );\n};\n\nfunction createApiDefinitionColumn(): TableColumn<ApiEntity> {\n return {\n title: 'API Definition',\n render: entity => <ApiDefinitionButton apiEntity={entity} />,\n };\n}\n\nexport const apiEntityColumns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createSystemColumn(),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n createApiDefinitionColumn(),\n];\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAyBO,SAAS,uBAAkD,GAAA;AAChE,EAAO,OAAA;AAAA,IACL,KAAO,EAAA,MAAA;AAAA,IACP,KAAO,EAAA,WAAA;AAAA,IACP,MAAQ,EAAA,CAAA,MAAA,qBAAW,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,WAAW,MAAQ,EAAA,CAAA;AAAA,GACrD,CAAA;AACF,CAAA;AAEA,MAAM,mBAAsB,GAAA,CAAC,EAAE,SAAA,EAA0C,KAAA;AACvE,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAClD,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,YAAW,EAAA,8BAAA;AAAA,MACX,OAAS,EAAA,MAAM,aAAc,CAAA,CAAC,UAAU,CAAA;AAAA,KAAA;AAAA,wCAEvC,aAAc,EAAA,IAAA,CAAA;AAAA,GAEjB,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,MAAQ,EAAA,SAAA;AAAA,MACR,IAAM,EAAA,UAAA;AAAA,MACN,OAAA,EAAS,MAAM,aAAA,CAAc,KAAK,CAAA;AAAA,KAAA;AAAA,GAEtC,CAAA,CAAA;AAEJ,CAAA,CAAA;AAEA,SAAS,yBAAoD,GAAA;AAC3D,EAAO,OAAA;AAAA,IACL,KAAO,EAAA,gBAAA;AAAA,IACP,MAAQ,EAAA,CAAA,MAAA,qBAAW,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,EAAoB,WAAW,MAAQ,EAAA,CAAA;AAAA,GAC5D,CAAA;AACF,CAAA;AAEO,MAAM,gBAA6C,GAAA;AAAA,EACxD,YAAY,OAAQ,CAAA,qBAAA,CAAsB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,EAChE,WAAA,CAAY,QAAQ,kBAAmB,EAAA;AAAA,EACvC,WAAA,CAAY,QAAQ,iBAAkB,EAAA;AAAA,EACtC,uBAAwB,EAAA;AAAA,EACxB,WAAA,CAAY,QAAQ,yBAA0B,EAAA;AAAA,EAC9C,WAAA,CAAY,QAAQ,+BAAgC,EAAA;AAAA,EACpD,yBAA0B,EAAA;AAC5B;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncApiDefinition.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 React from 'react';\nimport { useTheme } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\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 // override whatever may be in the theme's typography to ensure consistency with asyncapi\n textTransform: 'inherit',\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 httpsFetchResolver = {\n schema: 'https',\n order: 1,\n canRead: true,\n async read(uri: any) {\n const response = await fetch(uri.toString());\n return response.text();\n },\n};\n\nconst httpFetchResolver = {\n schema: 'http',\n order: 1,\n canRead: true,\n async read(uri: any) {\n const response = await fetch(uri.toString());\n return response.text();\n },\n};\n\nconst config = {\n parserOptions: {\n __unstable: {\n resolver: {\n resolvers: [httpsFetchResolver, httpFetchResolver],\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} config={config} />\n </div>\n );\n};\n"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AAA;AAMO,MAAM,kBAAqB,GAAA,CAAC,EAAE,UAAA,EAAqC,KAAA;AACxE,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,EAAM,MAAA,UAAA,GAAa,CAAG,EAAA,OAAA,CAAQ,IAAI,CAAA,CAAA,EAChC,KAAM,CAAA,OAAA,CAAQ,IAAS,KAAA,MAAA,GAAS,OAAQ,CAAA,IAAA,GAAO,EACjD,CAAA,CAAA,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,SAAI,SAAW,EAAA,UAAA,EAAA,sCACb,QAAS,EAAA,EAAA,MAAA,EAAQ,UAAY,EAAA,MAAA,EAAgB,CAChD,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Progress } from '@backstage/core-components';
|
|
2
|
+
import React, { Suspense } from 'react';
|
|
3
|
+
|
|
4
|
+
const LazyAsyncApiDefinition = React.lazy(
|
|
5
|
+
() => import('./AsyncApiDefinition.esm.js').then((m) => ({
|
|
6
|
+
default: m.AsyncApiDefinition
|
|
7
|
+
}))
|
|
8
|
+
);
|
|
9
|
+
const AsyncApiDefinitionWidget = (props) => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Progress, null) }, /* @__PURE__ */ React.createElement(LazyAsyncApiDefinition, { ...props }));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { AsyncApiDefinitionWidget };
|
|
14
|
+
//# sourceMappingURL=AsyncApiDefinitionWidget.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncApiDefinitionWidget.esm.js","sources":["../../../src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The asyncapi component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyAsyncApiDefinition = React.lazy(() =>\n import('./AsyncApiDefinition').then(m => ({\n default: m.AsyncApiDefinition,\n })),\n);\n\n/** @public */\nexport type AsyncApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const AsyncApiDefinitionWidget = (\n props: AsyncApiDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyAsyncApiDefinition {...props} />\n </Suspense>\n );\n};\n"],"names":[],"mappings":";;;AAqBA,MAAM,yBAAyB,KAAM,CAAA,IAAA;AAAA,EAAK,MACxC,OAAO,6BAAsB,CAAA,CAAE,KAAK,CAAM,CAAA,MAAA;AAAA,IACxC,SAAS,CAAE,CAAA,kBAAA;AAAA,GACX,CAAA,CAAA;AACJ,CAAA,CAAA;AAQa,MAAA,wBAAA,GAA2B,CACtC,KACG,KAAA;AACH,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,QAAA,kBAAW,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,qBAC3B,KAAA,CAAA,aAAA,CAAA,sBAAA,EAAA,EAAwB,GAAG,KAAA,EAAO,CACrC,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RELATION_API_CONSUMED_BY
|
|
1
|
+
import { RELATION_API_CONSUMED_BY } from '@backstage/catalog-model';
|
|
2
2
|
import Typography from '@material-ui/core/Typography';
|
|
3
3
|
import { useEntity, useRelatedEntities, EntityTable } from '@backstage/plugin-catalog-react';
|
|
4
4
|
import React from 'react';
|
|
@@ -35,36 +35,5 @@ const ConsumingComponentsCard = (props) => {
|
|
|
35
35
|
);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const { entity } = useEntity();
|
|
41
|
-
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
42
|
-
type: RELATION_API_PROVIDED_BY
|
|
43
|
-
});
|
|
44
|
-
if (loading) {
|
|
45
|
-
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Providers" }, /* @__PURE__ */ React.createElement(Progress, null));
|
|
46
|
-
}
|
|
47
|
-
if (error || !entities) {
|
|
48
|
-
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Providers" }, /* @__PURE__ */ React.createElement(
|
|
49
|
-
WarningPanel,
|
|
50
|
-
{
|
|
51
|
-
severity: "error",
|
|
52
|
-
title: "Could not load components",
|
|
53
|
-
message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
|
|
54
|
-
}
|
|
55
|
-
));
|
|
56
|
-
}
|
|
57
|
-
return /* @__PURE__ */ React.createElement(
|
|
58
|
-
EntityTable,
|
|
59
|
-
{
|
|
60
|
-
title: "Providers",
|
|
61
|
-
variant,
|
|
62
|
-
emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "No component provides this API."), /* @__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."))),
|
|
63
|
-
columns: EntityTable.componentEntityColumns,
|
|
64
|
-
entities
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export { ConsumingComponentsCard as C, ProvidingComponentsCard as P };
|
|
70
|
-
//# sourceMappingURL=ProvidingComponentsCard-DleuYPKR.esm.js.map
|
|
38
|
+
export { ConsumingComponentsCard };
|
|
39
|
+
//# sourceMappingURL=ConsumingComponentsCard.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsumingComponentsCard.esm.js","sources":["../../../src/components/ComponentsCards/ConsumingComponentsCard.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 {\n ComponentEntity,\n RELATION_API_CONSUMED_BY,\n} 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 {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ConsumingComponentsCard = (props: {\n variant?: InfoCardVariants;\n}) => {\n const { variant = 'gridItem' } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_CONSUMED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Consumers\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Consumers\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load components\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Consumers\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n No component consumes this API.\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={EntityTable.componentEntityColumns}\n entities={entities as ComponentEntity[]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAuCa,MAAA,uBAAA,GAA0B,CAAC,KAElC,KAAA;AACJ,EAAM,MAAA,EAAE,OAAU,GAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AACjC,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,wBAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CACG,QAAS,EAAA,EAAA,OAAA,EAAkB,OAAM,WAChC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAS,CACZ,CAAA,CAAA;AAAA,GAEJ;AAEA,EAAI,IAAA,KAAA,IAAS,CAAC,QAAU,EAAA;AACtB,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,OAAkB,EAAA,KAAA,EAAM,WAChC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,QAAS,EAAA,OAAA;AAAA,QACT,KAAM,EAAA,2BAAA;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,KAAM,EAAA,WAAA;AAAA,MACN,OAAA;AAAA,MACA,YAAA,kBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,KAAO,EAAA,EAAE,WAAW,QAAS,EAAA,EAAA,kBAC/B,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAA,EAAQ,iCAE5B,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,EAAG,EAAA,iGAAA,EAAA,EAAkG,2BAE3G,CACF,CACF,CAAA;AAAA,MAEF,SAAS,WAAY,CAAA,sBAAA;AAAA,MACrB,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RELATION_API_PROVIDED_BY } from '@backstage/catalog-model';
|
|
2
|
+
import Typography from '@material-ui/core/Typography';
|
|
3
|
+
import { useEntity, useRelatedEntities, EntityTable } from '@backstage/plugin-catalog-react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { InfoCard, Progress, WarningPanel, CodeSnippet, Link } from '@backstage/core-components';
|
|
6
|
+
|
|
7
|
+
const ProvidingComponentsCard = (props) => {
|
|
8
|
+
const { variant = "gridItem" } = props;
|
|
9
|
+
const { entity } = useEntity();
|
|
10
|
+
const { entities, loading, error } = useRelatedEntities(entity, {
|
|
11
|
+
type: RELATION_API_PROVIDED_BY
|
|
12
|
+
});
|
|
13
|
+
if (loading) {
|
|
14
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Providers" }, /* @__PURE__ */ React.createElement(Progress, null));
|
|
15
|
+
}
|
|
16
|
+
if (error || !entities) {
|
|
17
|
+
return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Providers" }, /* @__PURE__ */ React.createElement(
|
|
18
|
+
WarningPanel,
|
|
19
|
+
{
|
|
20
|
+
severity: "error",
|
|
21
|
+
title: "Could not load components",
|
|
22
|
+
message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
|
|
23
|
+
}
|
|
24
|
+
));
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ React.createElement(
|
|
27
|
+
EntityTable,
|
|
28
|
+
{
|
|
29
|
+
title: "Providers",
|
|
30
|
+
variant,
|
|
31
|
+
emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "No component provides this API."), /* @__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."))),
|
|
32
|
+
columns: EntityTable.componentEntityColumns,
|
|
33
|
+
entities
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { ProvidingComponentsCard };
|
|
39
|
+
//# sourceMappingURL=ProvidingComponentsCard.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProvidingComponentsCard.esm.js","sources":["../../../src/components/ComponentsCards/ProvidingComponentsCard.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 {\n ComponentEntity,\n RELATION_API_PROVIDED_BY,\n} 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 {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\n/** @public */\nexport const ProvidingComponentsCard = (props: {\n variant?: InfoCardVariants;\n}) => {\n const { variant = 'gridItem' } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_PROVIDED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Providers\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Providers\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load components\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Providers\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n No component provides this API.\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={EntityTable.componentEntityColumns}\n entities={entities as ComponentEntity[]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAqCa,MAAA,uBAAA,GAA0B,CAAC,KAElC,KAAA;AACJ,EAAM,MAAA,EAAE,OAAU,GAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AACjC,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,wBAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CACG,QAAS,EAAA,EAAA,OAAA,EAAkB,OAAM,WAChC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAS,CACZ,CAAA,CAAA;AAAA,GAEJ;AAEA,EAAI,IAAA,KAAA,IAAS,CAAC,QAAU,EAAA;AACtB,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,OAAkB,EAAA,KAAA,EAAM,WAChC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,QAAS,EAAA,OAAA;AAAA,QACT,KAAM,EAAA,2BAAA;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,KAAM,EAAA,WAAA;AAAA,MACN,OAAA;AAAA,MACA,YAAA,kBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,KAAO,EAAA,EAAE,WAAW,QAAS,EAAA,EAAA,kBAC/B,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAA,EAAQ,iCAE5B,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,EAAG,EAAA,iGAAA,EAAA,EAAkG,2BAE3G,CACF,CACF,CAAA;AAAA,MAEF,SAAS,WAAY,CAAA,sBAAA;AAAA,MACrB,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlDefinition.esm.js","sources":["../../../src/components/GraphQlDefinitionWidget/GraphQlDefinition.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport {\n DocExplorer,\n EditorContextProvider,\n ExplorerContextProvider,\n SchemaContextProvider,\n} from '@graphiql/react';\nimport 'graphiql/graphiql.css';\nimport { buildSchema } from 'graphql';\nimport React from 'react';\n\nconst useStyles = makeStyles({\n root: {\n height: '100%',\n display: 'flex',\n flexFlow: 'column nowrap',\n },\n graphiQlWrapper: {\n flex: 1,\n '@global': {\n '.graphiql-container': {\n boxSizing: 'initial',\n height: '100%',\n minHeight: '600px',\n flex: '1 1 auto',\n },\n '.graphiql-sidebar': {\n width: '100%',\n },\n },\n },\n});\n\ntype Props = {\n definition: string;\n};\n\nexport const GraphQlDefinition = ({ definition }: Props) => {\n const classes = useStyles();\n const schema = buildSchema(definition);\n\n return (\n <div className={classes.root}>\n <div className={classes.graphiQlWrapper}>\n <EditorContextProvider>\n <SchemaContextProvider\n schema={schema}\n fetcher={() => Promise.resolve(null) as any}\n >\n <div className=\"graphiql-container\">\n <div className=\"graphiql-sidebar\">\n <div className=\"graphiql-sidebar-section\">\n <ExplorerContextProvider>\n <DocExplorer />\n </ExplorerContextProvider>\n </div>\n </div>\n </div>\n </SchemaContextProvider>\n </EditorContextProvider>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AA2BA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,MAAA;AAAA,IACR,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,eAAA;AAAA,GACZ;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,IAAM,EAAA,CAAA;AAAA,IACN,SAAW,EAAA;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
const LazyGraphQlDefinition = React.lazy(
|
|
5
|
+
() => import('./GraphQlDefinition.esm.js').then((m) => ({
|
|
6
|
+
default: m.GraphQlDefinition
|
|
7
|
+
}))
|
|
8
|
+
);
|
|
9
|
+
const GraphQlDefinitionWidget = (props) => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Progress, null) }, /* @__PURE__ */ React.createElement(LazyGraphQlDefinition, { ...props }));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { GraphQlDefinitionWidget };
|
|
14
|
+
//# sourceMappingURL=GraphQlDefinitionWidget.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlDefinitionWidget.esm.js","sources":["../../../src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The graphql component, graphql and related CSS has a significant size, only\n// load it if the element is actually used.\nconst LazyGraphQlDefinition = React.lazy(() =>\n import('./GraphQlDefinition').then(m => ({\n default: m.GraphQlDefinition,\n })),\n);\n\n/** @public */\nexport type GraphQlDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const GraphQlDefinitionWidget = (\n props: GraphQlDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyGraphQlDefinition {...props} />\n </Suspense>\n );\n};\n"],"names":[],"mappings":";;;AAqBA,MAAM,wBAAwB,KAAM,CAAA,IAAA;AAAA,EAAK,MACvC,OAAO,4BAAqB,CAAA,CAAE,KAAK,CAAM,CAAA,MAAA;AAAA,IACvC,SAAS,CAAE,CAAA,iBAAA;AAAA,GACX,CAAA,CAAA;AACJ,CAAA,CAAA;AAQa,MAAA,uBAAA,GAA0B,CACrC,KACG,KAAA;AACH,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,QAAA,kBAAW,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,qBAC3B,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,EAAuB,GAAG,KAAA,EAAO,CACpC,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CodeSnippet } from '@backstage/core-components';
|
|
3
|
+
import { useTheme } from '@material-ui/core/styles';
|
|
4
|
+
|
|
5
|
+
const GrpcApiDefinitionWidget = (props) => {
|
|
6
|
+
const theme = useTheme();
|
|
7
|
+
return /* @__PURE__ */ React.createElement(
|
|
8
|
+
CodeSnippet,
|
|
9
|
+
{
|
|
10
|
+
customStyle: { backgroundColor: theme.palette.background.default },
|
|
11
|
+
text: props.definition,
|
|
12
|
+
language: "protobuf",
|
|
13
|
+
showCopyCodeButton: true
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { GrpcApiDefinitionWidget };
|
|
19
|
+
//# sourceMappingURL=GrpcApiDefinitionWidget.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrpcApiDefinitionWidget.esm.js","sources":["../../../src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.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 React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { useTheme } from '@material-ui/core/styles';\n\n/** @public */\nexport type GrpcApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const GrpcApiDefinitionWidget = (\n props: GrpcApiDefinitionWidgetProps,\n) => {\n const theme = useTheme();\n return (\n <CodeSnippet\n customStyle={{ backgroundColor: theme.palette.background.default }}\n text={props.definition}\n language=\"protobuf\"\n showCopyCodeButton\n />\n );\n};\n"],"names":[],"mappings":";;;;AA0Ba,MAAA,uBAAA,GAA0B,CACrC,KACG,KAAA;AACH,EAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,aAAa,EAAE,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,WAAW,OAAQ,EAAA;AAAA,MACjE,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,QAAS,EAAA,UAAA;AAAA,MACT,kBAAkB,EAAA,IAAA;AAAA,KAAA;AAAA,GACpB,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenApiDefinition.esm.js","sources":["../../../src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport React, { useEffect, useState } from 'react';\nimport SwaggerUI, { SwaggerUIProps } from 'swagger-ui-react';\nimport 'swagger-ui-react/swagger-ui.css';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n '& .swagger-ui': {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n\n ['& .btn-clear']: {\n color: theme.palette.text.primary,\n },\n [`& .scheme-container`]: {\n backgroundColor: theme.palette.background.default,\n },\n [`& .opblock-tag,\n .opblock-tag small,\n table thead tr td,\n table thead tr th`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n borderColor: theme.palette.divider,\n },\n [`& section.models,\n section.models.is-open h4`]: {\n borderColor: theme.palette.divider,\n },\n [`& .model-title,\n .model .renderedMarkdown,\n .model .description`]: {\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightRegular,\n },\n [`& h1, h2, h3, h4, h5, h6,\n .errors h4, .error h4, .opblock h4, section.models h4,\n .response-control-media-type__accept-message,\n .opblock-summary-description,\n .opblock-summary-operation-id,\n .opblock-summary-path,\n .opblock-summary-path__deprecated,\n .opblock-description-wrapper,\n .opblock-external-docs-wrapper,\n .opblock-section-header .btn,\n .opblock-section-header>label,\n .scheme-container .schemes>label,a.nostyle,\n .parameter__name,\n .response-col_status,\n .response-col_links,\n .error .btn,\n .info .title,\n .info .base-url`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n },\n [`& .opblock .opblock-section-header,\n .model-box,\n section.models .model-container`]: {\n background: theme.palette.background.default,\n },\n [`& .prop-format,\n .parameter__in`]: {\n color: theme.palette.text.disabled,\n },\n [`& table.model,\n .parameter__type,\n .model.model-title,\n .model-title,\n .model span,\n .model .brace-open,\n .model .brace-close,\n .model .property.primitive,\n .model .renderedMarkdown,\n .model .description,\n .errors small`]: {\n color: theme.palette.text.secondary,\n },\n [`& .parameter__name.required:after`]: {\n color: theme.palette.warning.dark,\n },\n [`& table.model,\n table.model .model,\n .opblock-external-docs-wrapper`]: {\n fontSize: theme.typography.fontSize,\n },\n [`& table.headers td`]: {\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightRegular,\n },\n [`& .model-hint`]: {\n color: theme.palette.text.secondary,\n backgroundColor: theme.palette.background.paper,\n },\n [`& .opblock-summary-method,\n .info a`]: {\n fontFamily: theme.typography.fontFamily,\n },\n [`& .info, .opblock, .tab`]: {\n [`& li, p`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n },\n },\n [`& a`]: {\n color: theme.palette.primary.main,\n },\n [`& .renderedMarkdown code`]: {\n color: theme.palette.secondary.light,\n },\n [`& .property-row td:first-child`]: {\n color: theme.palette.text.primary,\n },\n [`& span.prop-type`]: {\n color: theme.palette.success.light,\n },\n },\n },\n}));\n\nexport type OpenApiDefinitionProps = {\n definition: string;\n} & Omit<SwaggerUIProps, 'spec'>;\n\nexport const OpenApiDefinition = ({\n definition,\n ...swaggerUiProps\n}: OpenApiDefinitionProps) => {\n const classes = useStyles();\n\n // Due to a bug in the swagger-ui-react component, the component needs\n // to be created without content first.\n const [def, setDef] = useState('');\n\n useEffect(() => {\n const timer = setTimeout(() => setDef(definition), 0);\n return () => clearTimeout(timer);\n }, [definition, setDef]);\n\n return (\n <div className={classes.root}>\n <SwaggerUI\n spec={def}\n url=\"\"\n deepLinking\n oauth2RedirectUrl={`${window.location.protocol}//${window.location.host}/oauth2-redirect.html`}\n {...swaggerUiProps}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,eAAiB,EAAA;AAAA,MACf,UAAA,EAAY,MAAM,UAAW,CAAA,UAAA;AAAA,MAC7B,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA;AAAA,MAE1B,CAAC,cAAc,GAAG;AAAA,QAChB,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24 @@
|
|
|
1
|
+
import { Progress } from '@backstage/core-components';
|
|
2
|
+
import React, { Suspense } from 'react';
|
|
3
|
+
|
|
4
|
+
const LazyOpenApiDefinition = React.lazy(
|
|
5
|
+
() => import('./OpenApiDefinition.esm.js').then((m) => ({
|
|
6
|
+
default: m.OpenApiDefinition
|
|
7
|
+
}))
|
|
8
|
+
);
|
|
9
|
+
const OpenApiDefinitionWidget = (props) => {
|
|
10
|
+
var _a;
|
|
11
|
+
const validSubmitMethods = (_a = props.supportedSubmitMethods) == null ? void 0 : _a.map(
|
|
12
|
+
(method) => method.toLocaleLowerCase()
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Progress, null) }, /* @__PURE__ */ React.createElement(
|
|
15
|
+
LazyOpenApiDefinition,
|
|
16
|
+
{
|
|
17
|
+
...props,
|
|
18
|
+
supportedSubmitMethods: validSubmitMethods
|
|
19
|
+
}
|
|
20
|
+
));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { OpenApiDefinitionWidget };
|
|
24
|
+
//# sourceMappingURL=OpenApiDefinitionWidget.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenApiDefinitionWidget.esm.js","sources":["../../../src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The swagger-ui component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyOpenApiDefinition = React.lazy(() =>\n import('./OpenApiDefinition').then(m => ({\n default: m.OpenApiDefinition,\n })),\n);\n\n/** @public */\nexport type OpenApiDefinitionWidgetProps = {\n definition: string;\n requestInterceptor?: (req: any) => any | Promise<any>;\n supportedSubmitMethods?: string[];\n};\n\n/** @public */\nexport const OpenApiDefinitionWidget = (\n props: OpenApiDefinitionWidgetProps,\n) => {\n const validSubmitMethods = props.supportedSubmitMethods?.map(method =>\n method.toLocaleLowerCase(),\n );\n return (\n <Suspense fallback={<Progress />}>\n <LazyOpenApiDefinition\n {...props}\n supportedSubmitMethods={validSubmitMethods}\n />\n </Suspense>\n );\n};\n"],"names":[],"mappings":";;;AAqBA,MAAM,wBAAwB,KAAM,CAAA,IAAA;AAAA,EAAK,MACvC,OAAO,4BAAqB,CAAA,CAAE,KAAK,CAAM,CAAA,MAAA;AAAA,IACvC,SAAS,CAAE,CAAA,iBAAA;AAAA,GACX,CAAA,CAAA;AACJ,CAAA,CAAA;AAUa,MAAA,uBAAA,GAA0B,CACrC,KACG,KAAA;AArCL,EAAA,IAAA,EAAA,CAAA;AAsCE,EAAM,MAAA,kBAAA,GAAA,CAAqB,EAAM,GAAA,KAAA,CAAA,sBAAA,KAAN,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA;AAAA,IAAI,CAAA,MAAA,KAC3D,OAAO,iBAAkB,EAAA;AAAA,GAAA,CAAA;AAE3B,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,QAAU,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAS,CAC5B,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,sBAAwB,EAAA,kBAAA;AAAA,KAAA;AAAA,GAE5B,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CodeSnippet } from '@backstage/core-components';
|
|
3
|
+
|
|
4
|
+
const PlainApiDefinitionWidget = (props) => {
|
|
5
|
+
return /* @__PURE__ */ React.createElement(
|
|
6
|
+
CodeSnippet,
|
|
7
|
+
{
|
|
8
|
+
text: props.definition,
|
|
9
|
+
language: props.language,
|
|
10
|
+
showCopyCodeButton: true
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { PlainApiDefinitionWidget };
|
|
16
|
+
//# sourceMappingURL=PlainApiDefinitionWidget.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainApiDefinitionWidget.esm.js","sources":["../../../src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.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 React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\n/** @public */\nexport type PlainApiDefinitionWidgetProps = {\n definition: any;\n language: string;\n};\n\n/** @public */\nexport const PlainApiDefinitionWidget = (\n props: PlainApiDefinitionWidgetProps,\n) => {\n return (\n <CodeSnippet\n text={props.definition}\n language={props.language}\n showCopyCodeButton\n />\n );\n};\n"],"names":[],"mappings":";;;AA0Ba,MAAA,wBAAA,GAA2B,CACtC,KACG,KAAA;AACH,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,UAAU,KAAM,CAAA,QAAA;AAAA,MAChB,kBAAkB,EAAA,IAAA;AAAA,KAAA;AAAA,GACpB,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CodeSnippet } from '@backstage/core-components';
|
|
3
|
+
import { useTheme } from '@material-ui/core/styles';
|
|
4
|
+
|
|
5
|
+
const TrpcApiDefinitionWidget = (props) => {
|
|
6
|
+
const { definition } = props;
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
return /* @__PURE__ */ React.createElement(
|
|
9
|
+
CodeSnippet,
|
|
10
|
+
{
|
|
11
|
+
customStyle: { backgroundColor: theme.palette.background.default },
|
|
12
|
+
text: definition,
|
|
13
|
+
language: "typescript",
|
|
14
|
+
showCopyCodeButton: true
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { TrpcApiDefinitionWidget };
|
|
20
|
+
//# sourceMappingURL=TrpcApiDefinitionWidget.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrpcApiDefinitionWidget.esm.js","sources":["../../../src/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { useTheme } from '@material-ui/core/styles';\n\n/** @public */\nexport type TrpcApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const TrpcApiDefinitionWidget = (\n props: TrpcApiDefinitionWidgetProps,\n) => {\n const { definition } = props;\n const theme = useTheme();\n return (\n <CodeSnippet\n customStyle={{ backgroundColor: theme.palette.background.default }}\n text={definition}\n language=\"typescript\"\n showCopyCodeButton\n />\n );\n};\n"],"names":[],"mappings":";;;;AAyBa,MAAA,uBAAA,GAA0B,CACrC,KACG,KAAA;AACH,EAAM,MAAA,EAAE,YAAe,GAAA,KAAA,CAAA;AACvB,EAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,aAAa,EAAE,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,WAAW,OAAQ,EAAA;AAAA,MACjE,IAAM,EAAA,UAAA;AAAA,MACN,QAAS,EAAA,YAAA;AAAA,MACT,kBAAkB,EAAA,IAAA;AAAA,KAAA;AAAA,GACpB,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.esm.js","sources":["../src/config.ts"],"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 } from '@backstage/catalog-model';\nimport { ApiDefinitionWidget } from './components/ApiDefinitionCard/ApiDefinitionWidget';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const apiDocsConfigRef = createApiRef<ApiDocsConfig>({\n id: 'plugin.api-docs.config',\n});\n\n/** @public */\nexport interface ApiDocsConfig {\n getApiDefinitionWidget: (\n apiEntity: ApiEntity,\n ) => ApiDefinitionWidget | undefined;\n}\n"],"names":[],"mappings":";;AAqBO,MAAM,mBAAmB,YAA4B,CAAA;AAAA,EAC1D,EAAI,EAAA,wBAAA;AACN,CAAC;;;;"}
|