zudoku 0.26.1 → 0.28.0
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/dist/app/main.d.ts +1 -1
- package/dist/app/main.js +19 -7
- package/dist/app/main.js.map +1 -1
- package/dist/config/loader.js +1 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
- package/dist/config/validators/common.d.ts +67 -0
- package/dist/config/validators/common.js +5 -0
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +29 -0
- package/dist/lib/components/AnchorLink.js +5 -2
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Markdown.d.ts +2 -2
- package/dist/lib/components/Markdown.js +3 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/StatusPage.d.ts +7 -0
- package/dist/lib/components/StatusPage.js +71 -0
- package/dist/lib/components/StatusPage.js.map +1 -0
- package/dist/lib/components/SyntaxHighlight.d.ts +2 -1
- package/dist/lib/components/SyntaxHighlight.js +2 -2
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.js +4 -4
- package/dist/lib/components/ThemeSwitch.js.map +1 -1
- package/dist/lib/components/cache.d.ts +6 -0
- package/dist/lib/components/cache.js +13 -0
- package/dist/lib/components/cache.js.map +1 -0
- package/dist/lib/components/context/ViewportAnchorContext.js +16 -4
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +2 -1
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +9 -2
- package/dist/lib/components/index.js +3 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +3 -3
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/core/RouteGuard.d.ts +1 -0
- package/dist/lib/core/RouteGuard.js +28 -0
- package/dist/lib/core/RouteGuard.js.map +1 -0
- package/dist/lib/core/ZudokuContext.d.ts +4 -2
- package/dist/lib/core/ZudokuContext.js +9 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/oas/graphql/circular.d.ts +3 -0
- package/dist/lib/oas/graphql/circular.js +27 -0
- package/dist/lib/oas/graphql/circular.js.map +1 -0
- package/dist/lib/oas/graphql/index.d.ts +1 -0
- package/dist/lib/oas/graphql/index.js +46 -29
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/dereference/index.d.ts +0 -1
- package/dist/lib/oas/parser/dereference/index.js +1 -1
- package/dist/lib/oas/parser/dereference/index.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +2 -2
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/{Route.d.ts → OpenApiRoute.d.ts} +2 -1
- package/dist/lib/plugins/openapi/{Route.js → OpenApiRoute.js} +3 -4
- package/dist/lib/plugins/openapi/OpenApiRoute.js.map +1 -0
- package/dist/lib/plugins/openapi/OperationList.d.ts +4 -1
- package/dist/lib/plugins/openapi/OperationList.js +20 -14
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +3 -3
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +17 -14
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -2
- package/dist/lib/plugins/openapi/graphql/gql.js +3 -2
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +47 -26
- package/dist/lib/plugins/openapi/graphql/graphql.js +20 -16
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +101 -65
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +8 -2
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +5 -5
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js +17 -16
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +5 -0
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js +4 -0
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.js +4 -12
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +13 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +19 -31
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +4 -3
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/SubmitButton.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/SubmitButton.js +22 -0
- package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +11 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +95 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +16 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.d.ts +10 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js +32 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js +56 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
- package/dist/lib/ui/Command.js +1 -1
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/Select.js +2 -2
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/util/MdxComponents.js +2 -2
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/joinUrl.js +1 -1
- package/dist/lib/util/joinUrl.js.map +1 -1
- package/dist/lib/util/joinUrl.test.d.ts +1 -0
- package/dist/lib/util/joinUrl.test.js +43 -0
- package/dist/lib/util/joinUrl.test.js.map +1 -0
- package/dist/lib/util/useScrollToAnchor.d.ts +1 -0
- package/dist/lib/util/useScrollToAnchor.js +26 -15
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/plugin-api.js +15 -3
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/prerender.js +1 -0
- package/dist/vite/prerender.js.map +1 -1
- package/dist/zuplo/enrich-with-zuplo.js +1 -1
- package/dist/zuplo/enrich-with-zuplo.js.map +1 -1
- package/dist/zuplo/with-zuplo.d.ts +2 -1
- package/dist/zuplo/with-zuplo.js +3 -1
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AuthenticationPlugin-C9SwOxkc.js → AuthenticationPlugin-Du8cLBSr.js} +3 -3
- package/lib/{AuthenticationPlugin-C9SwOxkc.js.map → AuthenticationPlugin-Du8cLBSr.js.map} +1 -1
- package/lib/{Markdown-DFN6p0J-.js → Markdown-Cyrx_JrO.js} +1195 -1185
- package/lib/{Markdown-DFN6p0J-.js.map → Markdown-Cyrx_JrO.js.map} +1 -1
- package/lib/{MdxPage-D9c4z09Q.js → MdxPage-DewragjB.js} +6 -6
- package/lib/{MdxPage-D9c4z09Q.js.map → MdxPage-DewragjB.js.map} +1 -1
- package/lib/OpenApiRoute-UrC_t0e5.js +36 -0
- package/lib/OpenApiRoute-UrC_t0e5.js.map +1 -0
- package/lib/{OperationList-DGJWDx1G.js → OperationList-D_ejrepA.js} +1970 -1957
- package/lib/OperationList-D_ejrepA.js.map +1 -0
- package/lib/{Select-D3O7wISy.js → Select-CnCZ4WhS.js} +61 -61
- package/lib/Select-CnCZ4WhS.js.map +1 -0
- package/lib/{SlotletProvider-_3zzX_g_.js → SlotletProvider-mQiPDQIH.js} +4 -4
- package/lib/{SlotletProvider-_3zzX_g_.js.map → SlotletProvider-mQiPDQIH.js.map} +1 -1
- package/lib/{SyntaxHighlight-CJCSPG1F.js → SyntaxHighlight-B0L4SC_N.js} +309 -298
- package/lib/SyntaxHighlight-B0L4SC_N.js.map +1 -0
- package/lib/{ZudokuContext-DeQZEp-x.js → ZudokuContext-BTUJPpQl.js} +257 -246
- package/lib/ZudokuContext-BTUJPpQl.js.map +1 -0
- package/lib/{chunk-SYFQ2XB5-BF5IDYrB.js → chunk-SYFQ2XB5-BPvC-soB.js} +5 -5
- package/lib/{chunk-SYFQ2XB5-BF5IDYrB.js.map → chunk-SYFQ2XB5-BPvC-soB.js.map} +1 -1
- package/lib/circular-Dgpd6AN-.js +15397 -0
- package/lib/circular-Dgpd6AN-.js.map +1 -0
- package/lib/{createServer-BcaswoFO.js → createServer-BydbkTsd.js} +3487 -5601
- package/lib/createServer-BydbkTsd.js.map +1 -0
- package/lib/{hook-BRQEDRbn.js → hook-FT3SJLe_.js} +2 -2
- package/lib/{hook-BRQEDRbn.js.map → hook-FT3SJLe_.js.map} +1 -1
- package/lib/{index-LNp6rxyU.js → index-CjJS0l4l.js} +2 -2
- package/lib/{index-LNp6rxyU.js.map → index-CjJS0l4l.js.map} +1 -1
- package/lib/index-DGugJOLc.js +1974 -0
- package/lib/index-DGugJOLc.js.map +1 -0
- package/lib/{joinUrl-BTy9bvoK.js → joinUrl-nLx9pD-Z.js} +2 -2
- package/lib/joinUrl-nLx9pD-Z.js.map +1 -0
- package/lib/ui/Command.js +27 -27
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Select.js +2 -2
- package/lib/ui/Select.js.map +1 -1
- package/lib/{useExposedProps-CetwhZpP.js → useExposedProps-BLKFBylA.js} +2 -2
- package/lib/{useExposedProps-CetwhZpP.js.map → useExposedProps-BLKFBylA.js.map} +1 -1
- package/lib/useScrollToAnchor-eRM9tVvD.js +289 -0
- package/lib/useScrollToAnchor-eRM9tVvD.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +4 -4
- package/lib/zudoku.components.js +740 -979
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +4 -4
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +6 -5
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +2 -2
- package/src/app/main.tsx +26 -7
- package/src/lib/components/AnchorLink.tsx +5 -2
- package/src/lib/components/Header.tsx +1 -1
- package/src/lib/components/Markdown.tsx +14 -15
- package/src/lib/components/StatusPage.tsx +91 -0
- package/src/lib/components/SyntaxHighlight.tsx +14 -0
- package/src/lib/components/ThemeSwitch.tsx +14 -15
- package/src/lib/components/cache.ts +15 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +20 -6
- package/src/lib/components/context/ZudokuContext.ts +3 -1
- package/src/lib/components/index.ts +7 -0
- package/src/lib/components/navigation/SidebarCategory.tsx +3 -2
- package/src/lib/core/RouteGuard.tsx +35 -0
- package/src/lib/core/ZudokuContext.ts +9 -8
- package/src/lib/oas/graphql/circular.ts +29 -0
- package/src/lib/oas/graphql/index.ts +72 -44
- package/src/lib/oas/parser/dereference/index.ts +1 -2
- package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
- package/src/lib/plugins/openapi/{Route.tsx → OpenApiRoute.tsx} +3 -3
- package/src/lib/plugins/openapi/OperationList.tsx +34 -12
- package/src/lib/plugins/openapi/OperationListItem.tsx +0 -2
- package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -0
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +4 -3
- package/src/lib/plugins/openapi/SidecarExamples.tsx +24 -24
- package/src/lib/plugins/openapi/graphql/gql.ts +12 -4
- package/src/lib/plugins/openapi/graphql/graphql.ts +66 -43
- package/src/lib/plugins/openapi/index.tsx +134 -82
- package/src/lib/plugins/openapi/interfaces.ts +11 -2
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -27
- package/src/lib/plugins/openapi/playground/Headers.tsx +65 -65
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +8 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +34 -74
- package/src/lib/plugins/openapi/playground/Playground.tsx +64 -116
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +46 -45
- package/src/lib/plugins/openapi/playground/SubmitButton.tsx +75 -0
- package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +73 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +210 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +101 -0
- package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.test.ts +64 -0
- package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.ts +36 -0
- package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +1 -1
- package/src/lib/ui/Command.tsx +1 -1
- package/src/lib/ui/Select.tsx +1 -1
- package/src/lib/util/MdxComponents.tsx +2 -1
- package/src/lib/util/joinUrl.test.ts +62 -0
- package/src/lib/util/joinUrl.ts +1 -1
- package/src/lib/util/useScrollToAnchor.ts +32 -15
- package/dist/lib/plugins/openapi/Route.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +0 -4
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +0 -42
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +0 -1
- package/lib/AnchorLink-bObQitZv.js +0 -34
- package/lib/AnchorLink-bObQitZv.js.map +0 -1
- package/lib/OperationList-DGJWDx1G.js.map +0 -1
- package/lib/Route-VdmEyOD0.js +0 -35
- package/lib/Route-VdmEyOD0.js.map +0 -1
- package/lib/Select-D3O7wISy.js.map +0 -1
- package/lib/StaggeredRender-DgsamH_G.js +0 -17
- package/lib/StaggeredRender-DgsamH_G.js.map +0 -1
- package/lib/SyntaxHighlight-CJCSPG1F.js.map +0 -1
- package/lib/ZudokuContext-DeQZEp-x.js.map +0 -1
- package/lib/createServer-BcaswoFO.js.map +0 -1
- package/lib/index-Bn6Lc9tq.js +0 -9
- package/lib/index-Bn6Lc9tq.js.map +0 -1
- package/lib/index-CXRrqOIl.js +0 -1750
- package/lib/index-CXRrqOIl.js.map +0 -1
- package/lib/index-TaRXY2w1.js +0 -43
- package/lib/index-TaRXY2w1.js.map +0 -1
- package/lib/joinUrl-BTy9bvoK.js.map +0 -1
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -76
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
4
4
|
import { CollapsibleCode } from "./CollapsibleCode.js";
|
|
5
5
|
import * as SidecarBox from "./SidecarBox.js";
|
|
@@ -35,23 +35,26 @@ export const SidecarExamples = ({ content, description, onExampleChange, }) => {
|
|
|
35
35
|
// Get example value, with fallback to schema-generated example
|
|
36
36
|
const examples = effectiveContent?.examples ?? [];
|
|
37
37
|
const selectedExample = examples[selectedExampleIndex];
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
const exampleValue = useMemo(() => {
|
|
39
|
+
if (selectedExample) {
|
|
40
|
+
// If it's a wrapped example with a value field, use that
|
|
41
|
+
return "value" in selectedExample
|
|
42
|
+
? selectedExample.value
|
|
43
|
+
: selectedExample;
|
|
44
|
+
}
|
|
45
|
+
else if (effectiveContent?.schema) {
|
|
46
|
+
// No example provided, generate one from schema
|
|
47
|
+
return generateSchemaExample(effectiveContent.schema);
|
|
48
|
+
}
|
|
49
|
+
}, [selectedExample, effectiveContent?.schema]);
|
|
48
50
|
useEffect(() => {
|
|
51
|
+
if (!exampleValue)
|
|
52
|
+
return;
|
|
49
53
|
onExampleChange?.(exampleValue);
|
|
50
54
|
}, [exampleValue, onExampleChange]);
|
|
51
55
|
const formattedExample = formatForDisplay(exampleValue);
|
|
52
56
|
const language = getLanguage(effectiveContent?.mediaType);
|
|
53
|
-
|
|
54
|
-
return (_jsxs(_Fragment, { children: [_jsxs(SidecarBox.Body, { className: "p-0", children: [selectedExample?.externalValue ? (_jsx("div", { className: "p-2", children: _jsx("a", { href: selectedExample.externalValue, target: "_blank", rel: "noopener noreferrer", className: "text-xs text-primary hover:underline", children: "View External Example \u2192" }) })) : (_jsx(CollapsibleCode, { children: _jsx(SyntaxHighlight, { language: language, noBackground: true, copyable: true, className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2", code: formattedExample }) })), selectedExample?.description && (_jsx("div", { className: "border-t text-xs px-3 py-1.5 text-muted-foreground", children: selectedExample.description }))] }), hasContent && (_jsxs(SidecarBox.Footer, { className: "text-xs p-0", children: [description && (_jsx("div", { className: "text-muted-foreground text-xs border-b px-3 py-2", children: description })), _jsxs("div", { className: "flex items-center gap-2 justify-between min-w-0 px-3 py-2", children: [_jsx("div", { className: "flex items-center gap-2 min-w-0", children: content.length > 1 ? (_jsx(SimpleSelect, { className: "max-w-[200px]", value: selectedContentTypeIndex.toString(), onChange: (e) => setSelectedContentTypeIndex(Number(e.target.value)), options: content.map((c, index) => ({
|
|
57
|
+
return (_jsxs(_Fragment, { children: [_jsxs(SidecarBox.Body, { className: "p-0", children: [selectedExample?.externalValue ? (_jsx("div", { className: "p-2", children: _jsx("a", { href: selectedExample.externalValue, target: "_blank", rel: "noopener noreferrer", className: "text-xs text-primary hover:underline", children: "View External Example \u2192" }) })) : (_jsx(CollapsibleCode, { children: _jsx(SyntaxHighlight, { language: language, noBackground: true, copyable: true, className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2", code: formattedExample }) })), selectedExample?.description && (_jsx("div", { className: "border-t text-xs px-3 py-1.5 text-muted-foreground", children: selectedExample.description }))] }), _jsxs(SidecarBox.Footer, { className: "text-xs p-0 divide-y divide-border", children: [description && (_jsx("div", { className: "text-muted-foreground text-xs px-3 py-2", children: description })), (examples.length !== 0 || content.length !== 0) && (_jsxs("div", { className: "flex items-center gap-2 justify-between min-w-0 px-3 py-2", children: [_jsx("div", { className: "flex items-center gap-2 min-w-0", children: content.length > 1 ? (_jsx(SimpleSelect, { className: "max-w-[200px]", value: selectedContentTypeIndex.toString(), onChange: (e) => setSelectedContentTypeIndex(Number(e.target.value)), options: content.map((c, index) => ({
|
|
55
58
|
value: index.toString(),
|
|
56
59
|
label: c.mediaType,
|
|
57
60
|
})) })) : (_jsx("span", { className: "font-mono text-[11px]", children: content[0]?.mediaType })) }), examples.length > 1 && (_jsx("div", { className: "flex items-center gap-1", children: _jsx(SimpleSelect, { className: "max-w-[180px]", value: selectedExampleIndex.toString(), onChange: (e) => setSelectedExampleIndex(Number(e.target.value)), options: examples.map((example, index) => ({
|
|
@@ -60,6 +63,6 @@ export const SidecarExamples = ({ content, description, onExampleChange, }) => {
|
|
|
60
63
|
example.name ||
|
|
61
64
|
example.description ||
|
|
62
65
|
`Example ${index + 1}`,
|
|
63
|
-
})) }) }))] })] })
|
|
66
|
+
})) }) }))] }))] })] }));
|
|
64
67
|
};
|
|
65
68
|
//# sourceMappingURL=SidecarExamples.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidecarExamples.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/SidecarExamples.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SidecarExamples.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/SidecarExamples.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,UAAU,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E,EAAE,CACd,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAEjD,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;wCACzC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;wCACvB,KAAK,EACH,OAAO,CAAC,OAAO;4CACf,OAAO,CAAC,IAAI;4CACZ,OAAO,CAAC,WAAW;4CACnB,WAAW,KAAK,GAAG,CAAC,EAAE;qCACzB,CAAC,CAAC,GACH,GACE,CACP,IACG,CACP,IACiB,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -9,7 +9,7 @@ export declare function graphql(source: "\n fragment OperationsFragment on Oper
|
|
|
9
9
|
/**
|
|
10
10
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
11
11
|
*/
|
|
12
|
-
export declare function graphql(source: "\n query AllOperations($input: JSON
|
|
12
|
+
export declare function graphql(source: "\n query AllOperations(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n description\n summary\n title\n url\n version\n tags(name: $tag) {\n name\n description\n }\n operations(tag: $tag, untagged: $untagged) {\n slug\n ...OperationsFragment\n }\n }\n }\n"): typeof import("./graphql.js").AllOperationsDocument;
|
|
13
13
|
/**
|
|
14
14
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
15
15
|
*/
|
|
@@ -17,4 +17,8 @@ export declare function graphql(source: "\n query getServerQuery($input: JSON!,
|
|
|
17
17
|
/**
|
|
18
18
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
19
19
|
*/
|
|
20
|
-
export declare function graphql(source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n
|
|
20
|
+
export declare function graphql(source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n name\n }\n }\n }\n"): typeof import("./graphql.js").GetCategoriesDocument;
|
|
21
|
+
/**
|
|
22
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
23
|
+
*/
|
|
24
|
+
export declare function graphql(source: "\n query GetOperations(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n operations(tag: $tag, untagged: $untagged) {\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n"): typeof import("./graphql.js").GetOperationsDocument;
|
|
@@ -14,9 +14,10 @@ import * as types from "./graphql.js";
|
|
|
14
14
|
const documents = {
|
|
15
15
|
"\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": types.ServersQueryDocument,
|
|
16
16
|
"\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n": types.OperationsFragmentFragmentDoc,
|
|
17
|
-
"\n query AllOperations($input: JSON
|
|
17
|
+
"\n query AllOperations(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n description\n summary\n title\n url\n version\n tags(name: $tag) {\n name\n description\n }\n operations(tag: $tag, untagged: $untagged) {\n slug\n ...OperationsFragment\n }\n }\n }\n": types.AllOperationsDocument,
|
|
18
18
|
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": types.GetServerQueryDocument,
|
|
19
|
-
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n
|
|
19
|
+
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n name\n }\n }\n }\n": types.GetCategoriesDocument,
|
|
20
|
+
"\n query GetOperations(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n operations(tag: $tag, untagged: $untagged) {\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n": types.GetOperationsDocument,
|
|
20
21
|
};
|
|
21
22
|
export function graphql(source) {
|
|
22
23
|
return documents[source] ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql.js","sourceRoot":"","sources":["../../../../../src/lib/plugins/openapi/graphql/gql.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,SAAS,GAAG;IAChB,uKAAuK,EACrK,KAAK,CAAC,oBAAoB;IAC5B,m+BAAm+B,EACj+B,KAAK,CAAC,6BAA6B;IACrC,
|
|
1
|
+
{"version":3,"file":"gql.js","sourceRoot":"","sources":["../../../../../src/lib/plugins/openapi/graphql/gql.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,SAAS,GAAG;IAChB,uKAAuK,EACrK,KAAK,CAAC,oBAAoB;IAC5B,m+BAAm+B,EACj+B,KAAK,CAAC,6BAA6B;IACrC,uaAAua,EACra,KAAK,CAAC,qBAAqB;IAC7B,yKAAyK,EACvK,KAAK,CAAC,sBAAsB;IAC9B,sKAAsK,EACpK,KAAK,CAAC,qBAAqB;IAC7B,iVAAiV,EAC/U,KAAK,CAAC,qBAAqB;CAC9B,CAAC;AAuCF,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,OAAQ,SAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -52,6 +52,11 @@ export type Scalars = {
|
|
|
52
52
|
input: any;
|
|
53
53
|
output: any;
|
|
54
54
|
};
|
|
55
|
+
/** OpenAPI schema scalar type that handles circular references */
|
|
56
|
+
JSONSchema: {
|
|
57
|
+
input: any;
|
|
58
|
+
output: any;
|
|
59
|
+
};
|
|
55
60
|
};
|
|
56
61
|
export type EncodingItem = {
|
|
57
62
|
__typename?: "EncodingItem";
|
|
@@ -75,7 +80,7 @@ export type MediaTypeObject = {
|
|
|
75
80
|
encoding?: Maybe<Array<EncodingItem>>;
|
|
76
81
|
examples?: Maybe<Array<ExampleItem>>;
|
|
77
82
|
mediaType: Scalars["String"]["output"];
|
|
78
|
-
schema?: Maybe<Scalars["
|
|
83
|
+
schema?: Maybe<Scalars["JSONSchema"]["output"]>;
|
|
79
84
|
};
|
|
80
85
|
export type OperationItem = {
|
|
81
86
|
__typename?: "OperationItem";
|
|
@@ -104,7 +109,7 @@ export type ParameterItem = {
|
|
|
104
109
|
in: ParameterIn;
|
|
105
110
|
name: Scalars["String"]["output"];
|
|
106
111
|
required?: Maybe<Scalars["Boolean"]["output"]>;
|
|
107
|
-
schema?: Maybe<Scalars["
|
|
112
|
+
schema?: Maybe<Scalars["JSONSchema"]["output"]>;
|
|
108
113
|
style?: Maybe<Scalars["String"]["output"]>;
|
|
109
114
|
};
|
|
110
115
|
export type PathItem = {
|
|
@@ -141,17 +146,18 @@ export type Schema = {
|
|
|
141
146
|
operations: Array<OperationItem>;
|
|
142
147
|
paths: Array<PathItem>;
|
|
143
148
|
servers: Array<Server>;
|
|
149
|
+
summary?: Maybe<Scalars["String"]["output"]>;
|
|
144
150
|
tags: Array<SchemaTag>;
|
|
145
151
|
title: Scalars["String"]["output"];
|
|
146
|
-
url
|
|
152
|
+
url?: Maybe<Scalars["String"]["output"]>;
|
|
147
153
|
version: Scalars["String"]["output"];
|
|
148
|
-
summary?: Maybe<Scalars["String"]["output"]>;
|
|
149
154
|
};
|
|
150
155
|
export type SchemaOperationsArgs = {
|
|
151
156
|
method?: InputMaybe<Scalars["String"]["input"]>;
|
|
152
157
|
operationId?: InputMaybe<Scalars["String"]["input"]>;
|
|
153
158
|
path?: InputMaybe<Scalars["String"]["input"]>;
|
|
154
159
|
tag?: InputMaybe<Scalars["String"]["input"]>;
|
|
160
|
+
untagged?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
155
161
|
};
|
|
156
162
|
export type SchemaTagsArgs = {
|
|
157
163
|
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
@@ -181,7 +187,7 @@ export type ServersQueryQuery = {
|
|
|
181
187
|
__typename?: "Query";
|
|
182
188
|
schema: {
|
|
183
189
|
__typename?: "Schema";
|
|
184
|
-
url
|
|
190
|
+
url?: string | null;
|
|
185
191
|
servers: Array<{
|
|
186
192
|
__typename?: "Server";
|
|
187
193
|
url: string;
|
|
@@ -265,6 +271,8 @@ export type OperationsFragmentFragment = {
|
|
|
265
271
|
export type AllOperationsQueryVariables = Exact<{
|
|
266
272
|
input: Scalars["JSON"]["input"];
|
|
267
273
|
type: SchemaType;
|
|
274
|
+
tag?: InputMaybe<Scalars["String"]["input"]>;
|
|
275
|
+
untagged?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
268
276
|
}>;
|
|
269
277
|
export type AllOperationsQuery = {
|
|
270
278
|
__typename?: "Query";
|
|
@@ -273,20 +281,20 @@ export type AllOperationsQuery = {
|
|
|
273
281
|
description?: string | null;
|
|
274
282
|
summary?: string | null;
|
|
275
283
|
title: string;
|
|
276
|
-
url
|
|
284
|
+
url?: string | null;
|
|
277
285
|
version: string;
|
|
278
286
|
tags: Array<{
|
|
279
287
|
__typename?: "SchemaTag";
|
|
280
288
|
name?: string | null;
|
|
281
289
|
description?: string | null;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
+
}>;
|
|
291
|
+
operations: Array<{
|
|
292
|
+
__typename?: "OperationItem";
|
|
293
|
+
slug: string;
|
|
294
|
+
} & {
|
|
295
|
+
" $fragmentRefs"?: {
|
|
296
|
+
OperationsFragmentFragment: OperationsFragmentFragment;
|
|
297
|
+
};
|
|
290
298
|
}>;
|
|
291
299
|
};
|
|
292
300
|
};
|
|
@@ -298,7 +306,7 @@ export type GetServerQueryQuery = {
|
|
|
298
306
|
__typename?: "Query";
|
|
299
307
|
schema: {
|
|
300
308
|
__typename?: "Schema";
|
|
301
|
-
url
|
|
309
|
+
url?: string | null;
|
|
302
310
|
servers: Array<{
|
|
303
311
|
__typename?: "Server";
|
|
304
312
|
url: string;
|
|
@@ -313,19 +321,31 @@ export type GetCategoriesQuery = {
|
|
|
313
321
|
__typename?: "Query";
|
|
314
322
|
schema: {
|
|
315
323
|
__typename?: "Schema";
|
|
316
|
-
url
|
|
324
|
+
url?: string | null;
|
|
317
325
|
tags: Array<{
|
|
318
|
-
__typename
|
|
326
|
+
__typename?: "SchemaTag";
|
|
319
327
|
name?: string | null;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
328
|
+
}>;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
export type GetOperationsQueryVariables = Exact<{
|
|
332
|
+
input: Scalars["JSON"]["input"];
|
|
333
|
+
type: SchemaType;
|
|
334
|
+
tag?: InputMaybe<Scalars["String"]["input"]>;
|
|
335
|
+
untagged?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
336
|
+
}>;
|
|
337
|
+
export type GetOperationsQuery = {
|
|
338
|
+
__typename?: "Query";
|
|
339
|
+
schema: {
|
|
340
|
+
__typename?: "Schema";
|
|
341
|
+
operations: Array<{
|
|
342
|
+
__typename?: "OperationItem";
|
|
343
|
+
slug: string;
|
|
344
|
+
deprecated?: boolean | null;
|
|
345
|
+
method: string;
|
|
346
|
+
summary?: string | null;
|
|
347
|
+
operationId?: string | null;
|
|
348
|
+
path: string;
|
|
329
349
|
}>;
|
|
330
350
|
};
|
|
331
351
|
};
|
|
@@ -341,3 +361,4 @@ export declare const ServersQueryDocument: TypedDocumentString<ServersQueryQuery
|
|
|
341
361
|
export declare const AllOperationsDocument: TypedDocumentString<AllOperationsQuery, AllOperationsQueryVariables>;
|
|
342
362
|
export declare const GetServerQueryDocument: TypedDocumentString<GetServerQueryQuery, GetServerQueryQueryVariables>;
|
|
343
363
|
export declare const GetCategoriesDocument: TypedDocumentString<GetCategoriesQuery, GetCategoriesQueryVariables>;
|
|
364
|
+
export declare const GetOperationsDocument: TypedDocumentString<GetOperationsQuery, GetOperationsQueryVariables>;
|
|
@@ -85,20 +85,20 @@ export const ServersQueryDocument = new TypedDocumentString(`
|
|
|
85
85
|
}
|
|
86
86
|
`);
|
|
87
87
|
export const AllOperationsDocument = new TypedDocumentString(`
|
|
88
|
-
query AllOperations($input: JSON!, $type: SchemaType
|
|
88
|
+
query AllOperations($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
|
|
89
89
|
schema(input: $input, type: $type) {
|
|
90
90
|
description
|
|
91
91
|
summary
|
|
92
92
|
title
|
|
93
93
|
url
|
|
94
94
|
version
|
|
95
|
-
tags {
|
|
95
|
+
tags(name: $tag) {
|
|
96
96
|
name
|
|
97
97
|
description
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
}
|
|
99
|
+
operations(tag: $tag, untagged: $untagged) {
|
|
100
|
+
slug
|
|
101
|
+
...OperationsFragment
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -178,17 +178,21 @@ export const GetCategoriesDocument = new TypedDocumentString(`
|
|
|
178
178
|
schema(input: $input, type: $type) {
|
|
179
179
|
url
|
|
180
180
|
tags {
|
|
181
|
-
__typename
|
|
182
181
|
name
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
`);
|
|
186
|
+
export const GetOperationsDocument = new TypedDocumentString(`
|
|
187
|
+
query GetOperations($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
|
|
188
|
+
schema(input: $input, type: $type) {
|
|
189
|
+
operations(tag: $tag, untagged: $untagged) {
|
|
190
|
+
slug
|
|
191
|
+
deprecated
|
|
192
|
+
method
|
|
193
|
+
summary
|
|
194
|
+
operationId
|
|
195
|
+
path
|
|
192
196
|
}
|
|
193
197
|
}
|
|
194
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../../../src/lib/plugins/openapi/graphql/graphql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../../../src/lib/plugins/openapi/graphql/graphql.ts"],"names":[],"mappings":"AAmVA,MAAM,OAAO,mBACX,SAAQ,MAAM;IAMJ;IACD;IAJT,SAAS,CAA4D;IAErE,YACU,KAAa,EACd,QAA0C;QAEjD,KAAK,CAAC,KAAK,CAAC,CAAC;QAHL,UAAK,GAAL,KAAK,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAkC;IAGnD,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AACD,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,mBAAmB,CAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8DG,EACH,EAAE,YAAY,EAAE,oBAAoB,EAAE,CACgC,CAAC;AACzE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,mBAAmB,CAAC;;;;;;;;;KASvD,CAGJ,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8E3D,CAGD,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,mBAAmB,CAAC;;;;;;;;;KASzD,CAGJ,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,mBAAmB,CAAC;;;;;;;;;KASxD,CAGJ,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,mBAAmB,CAAC;;;;;;;;;;;;;KAaxD,CAGJ,CAAC"}
|
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { graphql } from "./graphql/index.js";
|
|
4
|
-
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
import slugify from "@sindresorhus/slugify";
|
|
5
3
|
import { CirclePlayIcon, LogInIcon } from "lucide-react";
|
|
4
|
+
import { matchPath, redirect } from "react-router";
|
|
6
5
|
import { useAuth } from "../../authentication/hook.js";
|
|
7
6
|
import { Button } from "../../ui/Button.js";
|
|
8
|
-
import {
|
|
7
|
+
import { joinUrl } from "../../util/joinUrl.js";
|
|
9
8
|
import { GraphQLClient } from "./client/GraphQLClient.js";
|
|
9
|
+
import { graphql } from "./graphql/index.js";
|
|
10
10
|
import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
|
|
11
11
|
const GetCategoriesQuery = graphql(`
|
|
12
12
|
query GetCategories($input: JSON!, $type: SchemaType!) {
|
|
13
13
|
schema(input: $input, type: $type) {
|
|
14
14
|
url
|
|
15
15
|
tags {
|
|
16
|
-
__typename
|
|
17
16
|
name
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`);
|
|
21
|
+
const GetOperationsQuery = graphql(`
|
|
22
|
+
query GetOperations(
|
|
23
|
+
$input: JSON!
|
|
24
|
+
$type: SchemaType!
|
|
25
|
+
$tag: String
|
|
26
|
+
$untagged: Boolean
|
|
27
|
+
) {
|
|
28
|
+
schema(input: $input, type: $type) {
|
|
29
|
+
operations(tag: $tag, untagged: $untagged) {
|
|
30
|
+
slug
|
|
31
|
+
deprecated
|
|
32
|
+
method
|
|
33
|
+
summary
|
|
34
|
+
operationId
|
|
35
|
+
path
|
|
27
36
|
}
|
|
28
37
|
}
|
|
29
38
|
}
|
|
@@ -37,8 +46,9 @@ const MethodColorMap = {
|
|
|
37
46
|
options: "gray",
|
|
38
47
|
head: "gray",
|
|
39
48
|
};
|
|
49
|
+
const UNTAGGED_PATH = "~endpoints";
|
|
40
50
|
export const openApiPlugin = (config) => {
|
|
41
|
-
const basePath =
|
|
51
|
+
const basePath = joinUrl(config.navigationId ?? "/reference");
|
|
42
52
|
const versions = config.type === "file" ? Object.keys(config.input) : [];
|
|
43
53
|
const client = new GraphQLClient(config);
|
|
44
54
|
return {
|
|
@@ -53,19 +63,13 @@ export const openApiPlugin = (config) => {
|
|
|
53
63
|
getMdxComponents: () => ({
|
|
54
64
|
OpenPlaygroundButton: ({ requireAuth, server, method, url, ...props }) => {
|
|
55
65
|
const auth = useAuth();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
type: config.type,
|
|
60
|
-
input: config.input,
|
|
61
|
-
}),
|
|
62
|
-
enabled: !server,
|
|
63
|
-
queryKey: ["playground-server"],
|
|
64
|
-
});
|
|
66
|
+
if (!server) {
|
|
67
|
+
throw new Error("Server is required");
|
|
68
|
+
}
|
|
65
69
|
if (requireAuth && !auth.isAuthenticated) {
|
|
66
70
|
return (_jsxs(Button, { className: "gap-2 items-center", variant: "outline", onClick: auth.login, children: ["Login to open in Playground ", _jsx(LogInIcon, { size: 16 })] }));
|
|
67
71
|
}
|
|
68
|
-
return (_jsx(PlaygroundDialog, { url: url ?? "/", method: method ?? "get", server: server
|
|
72
|
+
return (_jsx(PlaygroundDialog, { url: url ?? "/", method: method ?? "get", server: server, ...props, children: _jsxs(Button, { className: "gap-2 items-center", variant: "outline", children: ["Open in Playground ", _jsx(CirclePlayIcon, { size: 16 })] }) }));
|
|
69
73
|
},
|
|
70
74
|
}),
|
|
71
75
|
getSidebar: async (path) => {
|
|
@@ -73,35 +77,45 @@ export const openApiPlugin = (config) => {
|
|
|
73
77
|
return [];
|
|
74
78
|
}
|
|
75
79
|
try {
|
|
76
|
-
const
|
|
77
|
-
|
|
80
|
+
const urlVersion = versions.find((v) => path.startsWith(joinUrl(basePath, v)));
|
|
81
|
+
const version = urlVersion ?? Object.keys(config.input).at(0);
|
|
78
82
|
const data = await client.fetch(GetCategoriesQuery, {
|
|
79
83
|
type: config.type,
|
|
80
84
|
input: config.type === "file" ? config.input[version] : config.input,
|
|
81
|
-
version,
|
|
82
85
|
});
|
|
86
|
+
const tag = config.tagPages?.find((tag) => path.split("/").at(-1) === slugify(tag));
|
|
87
|
+
const operationsData = await client.fetch(GetOperationsQuery, {
|
|
88
|
+
type: config.type,
|
|
89
|
+
input: config.type === "file" ? config.input[version] : config.input,
|
|
90
|
+
tag,
|
|
91
|
+
untagged: tag === undefined,
|
|
92
|
+
});
|
|
93
|
+
const items = operationsData.schema.operations.map((operation) => ({
|
|
94
|
+
type: "link",
|
|
95
|
+
label: operation.summary ?? operation.path,
|
|
96
|
+
href: `#${operation.slug}`,
|
|
97
|
+
badge: {
|
|
98
|
+
label: operation.method,
|
|
99
|
+
color: MethodColorMap[operation.method.toLowerCase()],
|
|
100
|
+
invert: true,
|
|
101
|
+
},
|
|
102
|
+
}));
|
|
83
103
|
const categories = data.schema.tags
|
|
84
|
-
.filter((tag) => tag.operations.length > 0)
|
|
85
|
-
.map((tag) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
badge: {
|
|
95
|
-
label: operation.method,
|
|
96
|
-
color: MethodColorMap[operation.method.toLowerCase()],
|
|
97
|
-
invert: true,
|
|
104
|
+
// .filter((tag) => tag.operations.length > 0)
|
|
105
|
+
.map((tag) => {
|
|
106
|
+
const categoryLink = joinUrl(basePath, urlVersion, tag.name ? slugify(tag.name) : UNTAGGED_PATH);
|
|
107
|
+
return {
|
|
108
|
+
type: "category",
|
|
109
|
+
label: tag.name || "Other endpoints",
|
|
110
|
+
link: {
|
|
111
|
+
type: "doc",
|
|
112
|
+
id: categoryLink,
|
|
113
|
+
label: tag.name,
|
|
98
114
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
label: "Overview",
|
|
104
|
-
href: "#description",
|
|
115
|
+
collapsible: false,
|
|
116
|
+
collapsed: true,
|
|
117
|
+
items: path === categoryLink ? items : [],
|
|
118
|
+
};
|
|
105
119
|
});
|
|
106
120
|
return categories;
|
|
107
121
|
}
|
|
@@ -111,24 +125,46 @@ export const openApiPlugin = (config) => {
|
|
|
111
125
|
},
|
|
112
126
|
getRoutes: () => {
|
|
113
127
|
const versionsInPath = [null, ...versions];
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const { OpenApiRoute } = await import("./Route.js");
|
|
118
|
-
return {
|
|
119
|
-
element: (_jsx(OpenApiRoute, { basePath: basePath, versions: versions, client: client, config: config })),
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
children: [
|
|
123
|
-
{
|
|
124
|
-
index: true,
|
|
125
|
-
async lazy() {
|
|
126
|
-
const { OperationList } = await import("./OperationList.js");
|
|
127
|
-
return { element: _jsx(OperationList, {}) };
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
],
|
|
128
|
+
const tagPages = (config.tagPages ?? []).map((tag) => ({
|
|
129
|
+
tag,
|
|
130
|
+
path: slugify(tag),
|
|
131
131
|
}));
|
|
132
|
+
return versionsInPath.map((version) => {
|
|
133
|
+
const versionPath = joinUrl(basePath, version ? `/${version}` : "");
|
|
134
|
+
return {
|
|
135
|
+
path: versionPath,
|
|
136
|
+
async lazy() {
|
|
137
|
+
const { OpenApiRoute } = await import("./OpenApiRoute.js");
|
|
138
|
+
return {
|
|
139
|
+
element: (_jsx(OpenApiRoute, { version: version ?? undefined, basePath: basePath, versions: versions, client: client, config: config })),
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
children: [
|
|
143
|
+
{
|
|
144
|
+
index: true,
|
|
145
|
+
loader: () => redirect(joinUrl(versionPath, tagPages.at(0)?.path ?? UNTAGGED_PATH)),
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
path: joinUrl(versionPath, UNTAGGED_PATH),
|
|
149
|
+
async lazy() {
|
|
150
|
+
const { OperationList } = await import("./OperationList.js");
|
|
151
|
+
return { element: _jsx(OperationList, { untagged: true }) };
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
...tagPages.map((tag) => {
|
|
155
|
+
return {
|
|
156
|
+
path: joinUrl(versionPath, tag.path),
|
|
157
|
+
async lazy() {
|
|
158
|
+
const { OperationList } = await import("./OperationList.js");
|
|
159
|
+
return {
|
|
160
|
+
element: _jsx(OperationList, { tag: tag.tag }),
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}),
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
});
|
|
132
168
|
},
|
|
133
169
|
};
|
|
134
170
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/index.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["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I;gCACR,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;gCAC7D,OAAO,EAAE,OAAO,EAAE,KAAC,aAAa,IAAC,QAAQ,EAAE,IAAI,GAAI,EAAE,CAAC;4BACxD,CAAC;yBACF;wBACD,GAAG,QAAQ,CAAC,GAAG,CAAc,CAAC,GAAG,EAAE,EAAE;4BACnC,OAAO;gCACL,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC;gCACpC,KAAK,CAAC,IAAI;oCACR,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;oCAC7D,OAAO;wCACL,OAAO,EAAE,KAAC,aAAa,IAAC,GAAG,EAAE,GAAG,CAAC,GAAG,GAAI;qCACzC,CAAC;gCACJ,CAAC;6BACF,CAAC;wBACJ,CAAC,CAAC;qBACH;iBACF,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -24,12 +24,18 @@ export type OasPluginConfig = {
|
|
|
24
24
|
server?: string;
|
|
25
25
|
navigationId?: string;
|
|
26
26
|
skipPreload?: boolean;
|
|
27
|
-
|
|
27
|
+
tagPages?: Array<string>;
|
|
28
|
+
} & OasPluginConfigOptions & OasSource;
|
|
29
|
+
export type OasPluginConfigOptions = {
|
|
30
|
+
options?: {
|
|
31
|
+
examplesDefaultLanguage?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
28
34
|
export type OasPluginContext = {
|
|
29
35
|
server?: string;
|
|
30
36
|
navigationId?: string;
|
|
31
37
|
skipPreload?: boolean;
|
|
32
38
|
version?: string;
|
|
33
39
|
versions: Record<string, string>;
|
|
34
|
-
} & ContextOasSource;
|
|
40
|
+
} & ContextOasSource & OasPluginConfigOptions;
|
|
35
41
|
export {};
|