@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
package/dist/index.esm.js
CHANGED
|
@@ -1,115 +1,19 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import '@backstage/catalog-model';
|
|
20
|
-
import '@material-ui/icons/Extension';
|
|
21
|
-
import '@material-ui/lab/ToggleButton';
|
|
22
|
-
import '@material-ui/core/Box';
|
|
23
|
-
import '@material-ui/core/Button';
|
|
24
|
-
import '@material-ui/core/Dialog';
|
|
25
|
-
import '@material-ui/core/DialogActions';
|
|
26
|
-
import '@material-ui/core/DialogContent';
|
|
27
|
-
import '@material-ui/core/DialogTitle';
|
|
28
|
-
import '@material-ui/core/Tab';
|
|
29
|
-
import '@material-ui/core/Tabs';
|
|
30
|
-
|
|
31
|
-
const apiDocsPlugin = createPlugin({
|
|
32
|
-
id: "api-docs",
|
|
33
|
-
routes: {
|
|
34
|
-
root: rootRoute
|
|
35
|
-
},
|
|
36
|
-
apis: [
|
|
37
|
-
createApiFactory({
|
|
38
|
-
api: apiDocsConfigRef,
|
|
39
|
-
deps: {},
|
|
40
|
-
factory: () => {
|
|
41
|
-
const definitionWidgets = defaultDefinitionWidgets();
|
|
42
|
-
return {
|
|
43
|
-
getApiDefinitionWidget: (apiEntity) => {
|
|
44
|
-
return definitionWidgets.find((d) => d.type === apiEntity.spec.type);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
],
|
|
50
|
-
externalRoutes: {
|
|
51
|
-
registerApi: registerComponentRouteRef
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const ApiExplorerPage = apiDocsPlugin.provide(
|
|
55
|
-
createRoutableExtension({
|
|
56
|
-
name: "ApiExplorerPage",
|
|
57
|
-
component: () => import('./esm/index-DDxb-GVK.esm.js').then((m) => m.ApiExplorerIndexPage),
|
|
58
|
-
mountPoint: rootRoute
|
|
59
|
-
})
|
|
60
|
-
);
|
|
61
|
-
const EntityApiDefinitionCard = apiDocsPlugin.provide(
|
|
62
|
-
createComponentExtension({
|
|
63
|
-
name: "EntityApiDefinitionCard",
|
|
64
|
-
component: {
|
|
65
|
-
lazy: () => import('./esm/index-BnvGScty.esm.js').then((m) => m.ApiDefinitionCard)
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
);
|
|
69
|
-
const EntityConsumedApisCard = apiDocsPlugin.provide(
|
|
70
|
-
createComponentExtension({
|
|
71
|
-
name: "EntityConsumedApisCard",
|
|
72
|
-
component: {
|
|
73
|
-
lazy: () => import('./esm/index-BREvzWXp.esm.js').then((m) => m.ConsumedApisCard)
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
);
|
|
77
|
-
const EntityConsumingComponentsCard = apiDocsPlugin.provide(
|
|
78
|
-
createComponentExtension({
|
|
79
|
-
name: "EntityConsumingComponentsCard",
|
|
80
|
-
component: {
|
|
81
|
-
lazy: () => import('./esm/index-CEoQtSjl.esm.js').then(
|
|
82
|
-
(m) => m.ConsumingComponentsCard
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
);
|
|
87
|
-
const EntityProvidedApisCard = apiDocsPlugin.provide(
|
|
88
|
-
createComponentExtension({
|
|
89
|
-
name: "EntityProvidedApisCard",
|
|
90
|
-
component: {
|
|
91
|
-
lazy: () => import('./esm/index-BREvzWXp.esm.js').then((m) => m.ProvidedApisCard)
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
);
|
|
95
|
-
const EntityProvidingComponentsCard = apiDocsPlugin.provide(
|
|
96
|
-
createComponentExtension({
|
|
97
|
-
name: "EntityProvidingComponentsCard",
|
|
98
|
-
component: {
|
|
99
|
-
lazy: () => import('./esm/index-CEoQtSjl.esm.js').then(
|
|
100
|
-
(m) => m.ProvidingComponentsCard
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
})
|
|
104
|
-
);
|
|
105
|
-
const EntityHasApisCard = apiDocsPlugin.provide(
|
|
106
|
-
createComponentExtension({
|
|
107
|
-
name: "EntityHasApisCard",
|
|
108
|
-
component: {
|
|
109
|
-
lazy: () => import('./esm/index-BREvzWXp.esm.js').then((m) => m.HasApisCard)
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
export { ApiExplorerPage, EntityApiDefinitionCard, EntityConsumedApisCard, EntityConsumingComponentsCard, EntityHasApisCard, EntityProvidedApisCard, EntityProvidingComponentsCard, apiDocsConfigRef, apiDocsPlugin, defaultDefinitionWidgets, apiDocsPlugin as plugin };
|
|
1
|
+
export { ApiExplorerPage as ApiExplorerIndexPage } from './components/ApiExplorerPage/ApiExplorerPage.esm.js';
|
|
2
|
+
export { DefaultApiExplorerPage } from './components/ApiExplorerPage/DefaultApiExplorerPage.esm.js';
|
|
3
|
+
export { ApiDefinitionCard } from './components/ApiDefinitionCard/ApiDefinitionCard.esm.js';
|
|
4
|
+
export { defaultDefinitionWidgets } from './components/ApiDefinitionCard/ApiDefinitionWidget.esm.js';
|
|
5
|
+
export { ApiTypeTitle } from './components/ApiDefinitionCard/ApiTypeTitle.esm.js';
|
|
6
|
+
export { ApiDefinitionDialog } from './components/ApiDefinitionDialog/ApiDefinitionDialog.esm.js';
|
|
7
|
+
export { ConsumedApisCard } from './components/ApisCards/ConsumedApisCard.esm.js';
|
|
8
|
+
export { HasApisCard } from './components/ApisCards/HasApisCard.esm.js';
|
|
9
|
+
export { ProvidedApisCard } from './components/ApisCards/ProvidedApisCard.esm.js';
|
|
10
|
+
export { AsyncApiDefinitionWidget } from './components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js';
|
|
11
|
+
export { ConsumingComponentsCard } from './components/ComponentsCards/ConsumingComponentsCard.esm.js';
|
|
12
|
+
export { ProvidingComponentsCard } from './components/ComponentsCards/ProvidingComponentsCard.esm.js';
|
|
13
|
+
export { GraphQlDefinitionWidget } from './components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js';
|
|
14
|
+
export { OpenApiDefinitionWidget } from './components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js';
|
|
15
|
+
export { PlainApiDefinitionWidget } from './components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.esm.js';
|
|
16
|
+
export { TrpcApiDefinitionWidget } from './components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.esm.js';
|
|
17
|
+
export { apiDocsConfigRef } from './config.esm.js';
|
|
18
|
+
export { ApiExplorerPage, EntityApiDefinitionCard, EntityConsumedApisCard, EntityConsumingComponentsCard, EntityHasApisCard, EntityProvidedApisCard, EntityProvidingComponentsCard, apiDocsPlugin, apiDocsPlugin as plugin } from './plugin.esm.js';
|
|
115
19
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import '@backstage/plugin-catalog-react';
|
|
2
|
+
import '@material-ui/lab/Alert';
|
|
3
|
+
import 'react';
|
|
4
|
+
import { apiDocsConfigRef } from './config.esm.js';
|
|
5
|
+
import '@backstage/core-components';
|
|
6
|
+
import { createPlugin, createApiFactory, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
|
|
7
|
+
import { defaultDefinitionWidgets } from './components/ApiDefinitionCard/ApiDefinitionWidget.esm.js';
|
|
8
|
+
import '@material-ui/core/Typography';
|
|
9
|
+
import { rootRoute, registerComponentRouteRef } from './routes.esm.js';
|
|
10
|
+
|
|
11
|
+
const apiDocsPlugin = createPlugin({
|
|
12
|
+
id: "api-docs",
|
|
13
|
+
routes: {
|
|
14
|
+
root: rootRoute
|
|
15
|
+
},
|
|
16
|
+
apis: [
|
|
17
|
+
createApiFactory({
|
|
18
|
+
api: apiDocsConfigRef,
|
|
19
|
+
deps: {},
|
|
20
|
+
factory: () => {
|
|
21
|
+
const definitionWidgets = defaultDefinitionWidgets();
|
|
22
|
+
return {
|
|
23
|
+
getApiDefinitionWidget: (apiEntity) => {
|
|
24
|
+
return definitionWidgets.find((d) => d.type === apiEntity.spec.type);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
],
|
|
30
|
+
externalRoutes: {
|
|
31
|
+
registerApi: registerComponentRouteRef
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const ApiExplorerPage = apiDocsPlugin.provide(
|
|
35
|
+
createRoutableExtension({
|
|
36
|
+
name: "ApiExplorerPage",
|
|
37
|
+
component: () => import('./components/ApiExplorerPage/index.esm.js').then((m) => m.ApiExplorerIndexPage),
|
|
38
|
+
mountPoint: rootRoute
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
const EntityApiDefinitionCard = apiDocsPlugin.provide(
|
|
42
|
+
createComponentExtension({
|
|
43
|
+
name: "EntityApiDefinitionCard",
|
|
44
|
+
component: {
|
|
45
|
+
lazy: () => import('./components/ApiDefinitionCard/index.esm.js').then((m) => m.ApiDefinitionCard)
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
const EntityConsumedApisCard = apiDocsPlugin.provide(
|
|
50
|
+
createComponentExtension({
|
|
51
|
+
name: "EntityConsumedApisCard",
|
|
52
|
+
component: {
|
|
53
|
+
lazy: () => import('./components/ApisCards/index.esm.js').then((m) => m.ConsumedApisCard)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
const EntityConsumingComponentsCard = apiDocsPlugin.provide(
|
|
58
|
+
createComponentExtension({
|
|
59
|
+
name: "EntityConsumingComponentsCard",
|
|
60
|
+
component: {
|
|
61
|
+
lazy: () => import('./components/ComponentsCards/index.esm.js').then(
|
|
62
|
+
(m) => m.ConsumingComponentsCard
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
const EntityProvidedApisCard = apiDocsPlugin.provide(
|
|
68
|
+
createComponentExtension({
|
|
69
|
+
name: "EntityProvidedApisCard",
|
|
70
|
+
component: {
|
|
71
|
+
lazy: () => import('./components/ApisCards/index.esm.js').then((m) => m.ProvidedApisCard)
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
const EntityProvidingComponentsCard = apiDocsPlugin.provide(
|
|
76
|
+
createComponentExtension({
|
|
77
|
+
name: "EntityProvidingComponentsCard",
|
|
78
|
+
component: {
|
|
79
|
+
lazy: () => import('./components/ComponentsCards/index.esm.js').then(
|
|
80
|
+
(m) => m.ProvidingComponentsCard
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
const EntityHasApisCard = apiDocsPlugin.provide(
|
|
86
|
+
createComponentExtension({
|
|
87
|
+
name: "EntityHasApisCard",
|
|
88
|
+
component: {
|
|
89
|
+
lazy: () => import('./components/ApisCards/index.esm.js').then((m) => m.HasApisCard)
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
export { ApiExplorerPage, EntityApiDefinitionCard, EntityConsumedApisCard, EntityConsumingComponentsCard, EntityHasApisCard, EntityProvidedApisCard, EntityProvidingComponentsCard, apiDocsPlugin };
|
|
95
|
+
//# sourceMappingURL=plugin.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.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 { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { apiDocsConfigRef } from './config';\nimport { registerComponentRouteRef, rootRoute } from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const apiDocsPlugin = createPlugin({\n id: 'api-docs',\n routes: {\n root: rootRoute,\n },\n apis: [\n createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n ],\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n});\n\n/** @public */\nexport const ApiExplorerPage = apiDocsPlugin.provide(\n createRoutableExtension({\n name: 'ApiExplorerPage',\n component: () =>\n import('./components/ApiExplorerPage').then(m => m.ApiExplorerIndexPage),\n mountPoint: rootRoute,\n }),\n);\n\n/** @public */\nexport const EntityApiDefinitionCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityApiDefinitionCard',\n component: {\n lazy: () =>\n import('./components/ApiDefinitionCard').then(m => m.ApiDefinitionCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ConsumedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ConsumingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ProvidedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ProvidingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityHasApisCard',\n component: {\n lazy: () => import('./components/ApisCards').then(m => m.HasApisCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;;;;;AA4BO,MAAM,gBAAgB,YAAa,CAAA;AAAA,EACxC,EAAI,EAAA,UAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,GACR;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,gBAAA;AAAA,MACL,MAAM,EAAC;AAAA,MACP,SAAS,MAAM;AACb,QAAA,MAAM,oBAAoB,wBAAyB,EAAA,CAAA;AACnD,QAAO,OAAA;AAAA,UACL,sBAAA,EAAwB,CAAC,SAAyB,KAAA;AAChD,YAAA,OAAO,kBAAkB,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,SAAA,CAAU,KAAK,IAAI,CAAA,CAAA;AAAA,WACnE;AAAA,SACF,CAAA;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IACvB,IAAM,EAAA,wBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,qCAAwB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,KACjE;AAAA,GACD,CAAA;AACH,EAAA;AAGO,MAAM,gCAAgC,aAAc,CAAA,OAAA;AAAA,EACzD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,+BAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,2CAA8B,CAAE,CAAA,IAAA;AAAA,QACrC,OAAK,CAAE,CAAA,uBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH,EAAA;AAGO,MAAM,oBAAoB,aAAc,CAAA,OAAA;AAAA,EAC7C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,mBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,qCAAwB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,WAAW,CAAA;AAAA,KACtE;AAAA,GACD,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRouteRef, createExternalRouteRef } from '@backstage/core-plugin-api';
|
|
2
|
+
|
|
3
|
+
const rootRoute = createRouteRef({
|
|
4
|
+
id: "api-docs"
|
|
5
|
+
});
|
|
6
|
+
const registerComponentRouteRef = createExternalRouteRef({
|
|
7
|
+
id: "register-component",
|
|
8
|
+
optional: true
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { registerComponentRouteRef, rootRoute };
|
|
12
|
+
//# sourceMappingURL=routes.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.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 {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const rootRoute = createRouteRef({\n id: 'api-docs',\n});\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,YAAY,cAAe,CAAA;AAAA,EACtC,EAAI,EAAA,UAAA;AACN,CAAC,EAAA;AAEM,MAAM,4BAA4B,sBAAuB,CAAA;AAAA,EAC9D,EAAI,EAAA,oBAAA;AAAA,EACJ,QAAU,EAAA,IAAA;AACZ,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-api-docs",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5-next.1",
|
|
4
4
|
"description": "A Backstage plugin that helps represent API entities in the frontend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin"
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@asyncapi/react-component": "1.3.1",
|
|
52
|
-
"@backstage/catalog-model": "^1.
|
|
53
|
-
"@backstage/core-compat-api": "^0.2.
|
|
54
|
-
"@backstage/core-components": "^0.14.
|
|
52
|
+
"@backstage/catalog-model": "^1.5.0-next.0",
|
|
53
|
+
"@backstage/core-compat-api": "^0.2.5-next.1",
|
|
54
|
+
"@backstage/core-components": "^0.14.6-next.1",
|
|
55
55
|
"@backstage/core-plugin-api": "^1.9.2",
|
|
56
|
-
"@backstage/frontend-plugin-api": "^0.6.
|
|
57
|
-
"@backstage/plugin-catalog": "^1.19.
|
|
58
|
-
"@backstage/plugin-catalog-common": "^1.0.
|
|
59
|
-
"@backstage/plugin-catalog-react": "^1.11.
|
|
56
|
+
"@backstage/frontend-plugin-api": "^0.6.5-next.1",
|
|
57
|
+
"@backstage/plugin-catalog": "^1.19.1-next.1",
|
|
58
|
+
"@backstage/plugin-catalog-common": "^1.0.23-next.0",
|
|
59
|
+
"@backstage/plugin-catalog-react": "^1.11.4-next.1",
|
|
60
60
|
"@backstage/plugin-permission-react": "^0.4.22",
|
|
61
61
|
"@graphiql/react": "^0.20.0",
|
|
62
62
|
"@material-ui/core": "^4.12.2",
|
|
@@ -71,14 +71,15 @@
|
|
|
71
71
|
"swagger-ui-react": "^5.0.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@backstage/cli": "^0.26.
|
|
74
|
+
"@backstage/cli": "^0.26.5-next.0",
|
|
75
75
|
"@backstage/core-app-api": "^1.12.4",
|
|
76
|
-
"@backstage/dev-utils": "^1.0.
|
|
77
|
-
"@backstage/test-utils": "^1.5.
|
|
76
|
+
"@backstage/dev-utils": "^1.0.32-next.1",
|
|
77
|
+
"@backstage/test-utils": "^1.5.5-next.0",
|
|
78
78
|
"@testing-library/dom": "^10.0.0",
|
|
79
79
|
"@testing-library/jest-dom": "^6.0.0",
|
|
80
80
|
"@testing-library/react": "^15.0.0",
|
|
81
81
|
"@testing-library/user-event": "^14.0.0",
|
|
82
|
+
"@types/highlightjs": "^10.1.0",
|
|
82
83
|
"@types/swagger-ui-react": "^4.18.0"
|
|
83
84
|
},
|
|
84
85
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiDefinitionCard-B-gBxw4Y.esm.js","sources":["../../src/components/ApiDefinitionCard/ApiDefinitionCard.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 { useEntity } from '@backstage/plugin-catalog-react';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\n\nimport { CardTab, TabbedCard } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const ApiDefinitionCard = () => {\n const { entity } = useEntity<ApiEntity>();\n const config = useApi(apiDocsConfigRef);\n const { getApiDefinitionWidget } = config;\n\n if (!entity) {\n return <Alert severity=\"error\">Could not fetch the API</Alert>;\n }\n\n const definitionWidget = getApiDefinitionWidget(entity);\n const entityTitle = entity.metadata.title ?? entity.metadata.name;\n\n if (definitionWidget) {\n return (\n <TabbedCard title={entityTitle}>\n <CardTab label={definitionWidget.title} key=\"widget\">\n {definitionWidget.component(entity.spec.definition)}\n </CardTab>\n <CardTab label=\"Raw\" key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget.rawLanguage || entity.spec.type}\n />\n </CardTab>\n </TabbedCard>\n );\n }\n\n return (\n <TabbedCard\n title={entityTitle}\n children={[\n // Has to be an array, otherwise typescript doesn't like that this has only a single child\n <CardTab label={entity.spec.type} key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={entity.spec.type}\n />\n </CardTab>,\n ]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA2BO,MAAM,oBAAoB,MAAM;AA3BvC,EAAA,IAAA,EAAA,CAAA;AA4BE,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAqB,EAAA,CAAA;AACxC,EAAM,MAAA,MA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BAAA,KAAA,CAAA,aAAA;AAAA,UAAC,wBAAA;AAAA,UAAA;AAAA,YACC,UAAA,EAAY,OAAO,IAAK,CAAA,UAAA;AAAA,YACxB,QAAA,EAAU,OAAO,IAAK,CAAA,IAAA;AAAA,WAAA;AAAA,SAE1B,CAAA;AAAA,OACF;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { createRouteRef, createExternalRouteRef, createApiRef } from '@backstage/core-plugin-api';
|
|
2
|
-
import React, { Suspense } from 'react';
|
|
3
|
-
import { Progress, CodeSnippet } from '@backstage/core-components';
|
|
4
|
-
import { useTheme } from '@material-ui/core/styles';
|
|
5
|
-
|
|
6
|
-
const rootRoute = createRouteRef({
|
|
7
|
-
id: "api-docs"
|
|
8
|
-
});
|
|
9
|
-
const registerComponentRouteRef = createExternalRouteRef({
|
|
10
|
-
id: "register-component",
|
|
11
|
-
optional: true
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const apiDocsConfigRef = createApiRef({
|
|
15
|
-
id: "plugin.api-docs.config"
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const LazyAsyncApiDefinition = React.lazy(
|
|
19
|
-
() => import('./AsyncApiDefinition-BS46mwIR.esm.js').then((m) => ({
|
|
20
|
-
default: m.AsyncApiDefinition
|
|
21
|
-
}))
|
|
22
|
-
);
|
|
23
|
-
const AsyncApiDefinitionWidget = (props) => {
|
|
24
|
-
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Progress, null) }, /* @__PURE__ */ React.createElement(LazyAsyncApiDefinition, { ...props }));
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const LazyGraphQlDefinition = React.lazy(
|
|
28
|
-
() => import('./GraphQlDefinition-D3sN0srb.esm.js').then((m) => ({
|
|
29
|
-
default: m.GraphQlDefinition
|
|
30
|
-
}))
|
|
31
|
-
);
|
|
32
|
-
const GraphQlDefinitionWidget = (props) => {
|
|
33
|
-
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Progress, null) }, /* @__PURE__ */ React.createElement(LazyGraphQlDefinition, { ...props }));
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const LazyOpenApiDefinition = React.lazy(
|
|
37
|
-
() => import('./OpenApiDefinition-P9gI3GDo.esm.js').then((m) => ({
|
|
38
|
-
default: m.OpenApiDefinition
|
|
39
|
-
}))
|
|
40
|
-
);
|
|
41
|
-
const OpenApiDefinitionWidget = (props) => {
|
|
42
|
-
var _a;
|
|
43
|
-
const validSubmitMethods = (_a = props.supportedSubmitMethods) == null ? void 0 : _a.map(
|
|
44
|
-
(method) => method.toLocaleLowerCase()
|
|
45
|
-
);
|
|
46
|
-
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Progress, null) }, /* @__PURE__ */ React.createElement(
|
|
47
|
-
LazyOpenApiDefinition,
|
|
48
|
-
{
|
|
49
|
-
...props,
|
|
50
|
-
supportedSubmitMethods: validSubmitMethods
|
|
51
|
-
}
|
|
52
|
-
));
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const GrpcApiDefinitionWidget = (props) => {
|
|
56
|
-
const theme = useTheme();
|
|
57
|
-
return /* @__PURE__ */ React.createElement(
|
|
58
|
-
CodeSnippet,
|
|
59
|
-
{
|
|
60
|
-
customStyle: { backgroundColor: theme.palette.background.default },
|
|
61
|
-
text: props.definition,
|
|
62
|
-
language: "protobuf",
|
|
63
|
-
showCopyCodeButton: true
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const TrpcApiDefinitionWidget = (props) => {
|
|
69
|
-
const { definition } = props;
|
|
70
|
-
const theme = useTheme();
|
|
71
|
-
return /* @__PURE__ */ React.createElement(
|
|
72
|
-
CodeSnippet,
|
|
73
|
-
{
|
|
74
|
-
customStyle: { backgroundColor: theme.palette.background.default },
|
|
75
|
-
text: definition,
|
|
76
|
-
language: "typescript",
|
|
77
|
-
showCopyCodeButton: true
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
function defaultDefinitionWidgets() {
|
|
83
|
-
return [
|
|
84
|
-
{
|
|
85
|
-
type: "openapi",
|
|
86
|
-
title: "OpenAPI",
|
|
87
|
-
rawLanguage: "yaml",
|
|
88
|
-
component: (definition) => /* @__PURE__ */ React.createElement(OpenApiDefinitionWidget, { definition })
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
type: "asyncapi",
|
|
92
|
-
title: "AsyncAPI",
|
|
93
|
-
rawLanguage: "yaml",
|
|
94
|
-
component: (definition) => /* @__PURE__ */ React.createElement(AsyncApiDefinitionWidget, { definition })
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
type: "graphql",
|
|
98
|
-
title: "GraphQL",
|
|
99
|
-
rawLanguage: "graphql",
|
|
100
|
-
component: (definition) => /* @__PURE__ */ React.createElement(GraphQlDefinitionWidget, { definition })
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
type: "grpc",
|
|
104
|
-
title: "gRPC",
|
|
105
|
-
component: (definition) => /* @__PURE__ */ React.createElement(GrpcApiDefinitionWidget, { definition })
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
type: "trpc",
|
|
109
|
-
title: "tRPC",
|
|
110
|
-
component: (definition) => /* @__PURE__ */ React.createElement(TrpcApiDefinitionWidget, { definition })
|
|
111
|
-
}
|
|
112
|
-
];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export { AsyncApiDefinitionWidget as A, GraphQlDefinitionWidget as G, OpenApiDefinitionWidget as O, TrpcApiDefinitionWidget as T, apiDocsConfigRef as a, registerComponentRouteRef as b, defaultDefinitionWidgets as d, rootRoute as r };
|
|
116
|
-
//# sourceMappingURL=ApiDefinitionWidget-B2Z_EBYd.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiDefinitionWidget-B2Z_EBYd.esm.js","sources":["../../src/routes.ts","../../src/config.ts","../../src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx","../../src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx","../../src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx","../../src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.tsx","../../src/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.tsx","../../src/components/ApiDefinitionCard/ApiDefinitionWidget.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 createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const rootRoute = createRouteRef({\n id: 'api-docs',\n});\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n});\n","/*\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","/*\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","/*\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","/*\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","/*\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","/*\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","/*\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 */\nimport React from 'react';\nimport { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget';\nimport { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget';\nimport { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget';\nimport { GrpcApiDefinitionWidget } from '../GrpcApiDefinitionWidget';\nimport { TrpcApiDefinitionWidget } from '../TrpcDefinitionWidget';\n\n/** @public */\nexport type ApiDefinitionWidget = {\n type: string;\n title: string;\n component: (definition: string) => React.ReactElement;\n rawLanguage?: string;\n};\n\n/** @public */\nexport function defaultDefinitionWidgets(): ApiDefinitionWidget[] {\n return [\n {\n type: 'openapi',\n title: 'OpenAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <OpenApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'asyncapi',\n title: 'AsyncAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <AsyncApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'graphql',\n title: 'GraphQL',\n rawLanguage: 'graphql',\n component: definition => (\n <GraphQlDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'grpc',\n title: 'gRPC',\n component: definition => (\n <GrpcApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'trpc',\n title: 'tRPC',\n component: definition => (\n <TrpcApiDefinitionWidget definition={definition} />\n ),\n },\n ];\n}\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,YAAY,cAAe,CAAA;AAAA,EACtC,EAAI,EAAA,UAAA;AACN,CAAC,EAAA;AAEM,MAAM,4BAA4B,sBAAuB,CAAA;AAAA,EAC9D,EAAI,EAAA,oBAAA;AAAA,EACJ,QAAU,EAAA,IAAA;AACZ,CAAC;;ACPM,MAAM,mBAAmB,YAA4B,CAAA;AAAA,EAC1D,EAAI,EAAA,wBAAA;AACN,CAAC;;ACFD,MAAM,yBAAyB,KAAM,CAAA,IAAA;AAAA,EAAK,MACxC,OAAO,sCAAsB,CAAA,CAAE,KAAK,CAAM,CAAA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AAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,UAAA;AAAA,MACN,KAAO,EAAA,UAAA;AAAA,MACP,WAAa,EAAA,MAAA;AAAA,MACb,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,wBAAA,EAAA,EAAyB,UAAwB,EAAA,CAAA;AAAA,KAEtD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,SAAA;AAAA,MACP,WAAa,EAAA,SAAA;AAAA,MACb,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiExplorerPage-DN8sGDDe.esm.js","sources":["../../src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx","../../src/components/ApiExplorerPage/ApiExplorerPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { CatalogTable, CatalogTableRow } from '@backstage/plugin-catalog';\nimport {\n EntityKindPicker,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n CatalogFilterLayout,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { registerComponentRouteRef } from '../../routes';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\n\nconst defaultColumns: TableColumn<CatalogTableRow>[] = [\n CatalogTable.columns.createTitleColumn({ hidden: true }),\n CatalogTable.columns.createNameColumn({ defaultKind: 'API' }),\n CatalogTable.columns.createSystemColumn(),\n CatalogTable.columns.createOwnerColumn(),\n CatalogTable.columns.createSpecTypeColumn(),\n CatalogTable.columns.createSpecLifecycleColumn(),\n CatalogTable.columns.createMetadataDescriptionColumn(),\n CatalogTable.columns.createTagsColumn(),\n];\n\n/**\n * DefaultApiExplorerPageProps\n * @public\n */\nexport type DefaultApiExplorerPageProps = {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n};\n\n/**\n * DefaultApiExplorerPage\n * @public\n */\nexport const DefaultApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const { initiallySelectedFilter = 'all', columns, actions } = props;\n\n const configApi = useApi(configApiRef);\n const generatedSubtitle = `${\n configApi.getOptionalString('organization.name') ?? 'Backstage'\n } API Explorer`;\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n\n return (\n <PageWithHeader\n themeId=\"apis\"\n title=\"APIs\"\n subtitle={generatedSubtitle}\n pageTitleOverride=\"APIs\"\n >\n <Content>\n <ContentHeader title=\"\">\n {allowed && (\n <CreateButton\n title=\"Register Existing API\"\n to={registerComponentLink?.()}\n />\n )}\n <SupportButton>All your APIs</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter=\"api\" hidden />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable\n columns={columns || defaultColumns}\n actions={actions}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n};\n","/*\n * Copyright 2021 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 { useOutlet } from 'react-router-dom';\nimport {\n DefaultApiExplorerPage,\n DefaultApiExplorerPageProps,\n} from './DefaultApiExplorerPage';\n\n/**\n * ApiExplorerPage\n * @public\n */\nexport const ApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const outlet = useOutlet();\n\n return outlet || <DefaultApiExplorerPage {...props} />;\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2CA,MAAM,cAAiD,GAAA;AAAA,EACrD,aAAa,OAAQ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
|
|
3
|
-
import Typography from '@material-ui/core/Typography';
|
|
4
|
-
import { a as apiDocsConfigRef } from './ApiDefinitionWidget-B2Z_EBYd.esm.js';
|
|
5
|
-
import { useApi } from '@backstage/core-plugin-api';
|
|
6
|
-
|
|
7
|
-
const PlainApiDefinitionWidget = (props) => {
|
|
8
|
-
return /* @__PURE__ */ React.createElement(
|
|
9
|
-
CodeSnippet,
|
|
10
|
-
{
|
|
11
|
-
text: props.definition,
|
|
12
|
-
language: props.language,
|
|
13
|
-
showCopyCodeButton: true
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const ApiTypeTitle = (props) => {
|
|
19
|
-
const { apiEntity } = props;
|
|
20
|
-
const config = useApi(apiDocsConfigRef);
|
|
21
|
-
const definition = config.getApiDefinitionWidget(apiEntity);
|
|
22
|
-
const type = definition ? definition.title : apiEntity.spec.type;
|
|
23
|
-
return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, type);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { ApiTypeTitle as A, PlainApiDefinitionWidget as P };
|
|
27
|
-
//# sourceMappingURL=ApiTypeTitle-Q7DWBnfV.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiTypeTitle-Q7DWBnfV.esm.js","sources":["../../src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx","../../src/components/ApiDefinitionCard/ApiTypeTitle.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","/*\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 Typography from '@material-ui/core/Typography';\nimport React from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/**\n * @public\n */\nexport const ApiTypeTitle = (props: { apiEntity: ApiEntity }) => {\n const { apiEntity } = props;\n const config = useApi(apiDocsConfigRef);\n const definition = config.getApiDefinitionWidget(apiEntity);\n const type = definition ? definition.title : apiEntity.spec.type;\n\n return <Typography component=\"span\">{type}</Typography>;\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;;ACXa,MAAA,YAAA,GAAe,CAAC,KAAoC,KAAA;AAC/D,EAAM,MAAA,EAAE,WAAc,GAAA,KAAA,CAAA;AACtB,EAAM,MAAA,MAAA,GAAS,OAAO,gBAAgB,CAAA,CAAA;AACtC,EAAM,MAAA,UAAA,GAAa,MAAO,CAAA,sBAAA,CAAuB,SAAS,CAAA,CAAA;AAC1D,EAAA,MAAM,IAAO,GAAA,UAAA,GAAa,UAAW,CAAA,KAAA,GAAQ,UAAU,IAAK,CAAA,IAAA,CAAA;AAE5D,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAU,EAAA,MAAA,EAAA,EAAQ,IAAK,CAAA,CAAA;AAC5C;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncApiDefinition-BS46mwIR.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"],"names":[],"mappings":";;;;;AAsBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA,SAAA;AAAA,IACZ,aAAe,EAAA;AAAA,MACb,UAAY,EAAA,MAAA;AAAA,KACd;AAAA,IACA,aAAe,EAAA;AAAA,MACb,GAAG,MAAM,UAAW,CAAA,EAAA;AAAA,KACtB;AAAA,IACA,OAAS,EAAA;AAAA,MACP,GAAG,MAAM,UAAW,CAAA,EAAA;AAAA,KACtB;AAAA,IACA,WAAa,EAAA;AAAA,MACX,WAAa,EAAA,KAAA,CAAM,KAAM,CAAA,OAAA,CAAQ,QAAQ,GAAG,CAAA;AAAA,KAC9C;AAAA,IACA,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA,aAAA;AAAA,KACZ;AAAA,IACA,aAAe,EAAA;AAAA,MACb,OAAS,EAAA,MAAA;AAAA,KACX;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,EAAA;AAAA,KACxC;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,eAAA,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AAA;AAEA,MAAM,iBAAoB,GAAA;AAAA,EACxB,MAAQ,EAAA,MAAA;AAAA,EACR,KAAO,EAAA,CAAA;AAAA,EACP,OAAS,EAAA,IAAA;AAAA,EACT,MAAM,KAAK,GAAU,EAAA;AACnB,IAAA,MAAM,QAAW,GAAA,MAAM,KAAM,CAAA,GAAA,CAAI,UAAU,CAAA,CAAA;AAC3C,IAAA,OAAO,SAAS,IAAK,EAAA,CAAA;AAAA,GACvB;AACF,CAAA,CAAA;AAEA,MAAM,MAAS,GAAA;AAAA,EACb,aAAe,EAAA;AAAA,IACb,UAAY,EAAA;AAAA,MACV,QAAU,EAAA;AAAA,QACR,SAAA,EAAW,CAAC,kBAAA,EAAoB,iBAAiB,CAAA;AAAA,OACnD;AAAA,KACF;AAAA,GACF;AACF,CAAA,CAAA;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;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQlDefinition-D3sN0srb.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;AAAA,MACT,qBAAuB,EAAA;AA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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":[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