zudoku 0.27.0 → 0.28.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/dist/app/main.js +1 -2
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
- package/dist/lib/components/PathRenderer.d.ts +11 -0
- package/dist/lib/components/PathRenderer.js +25 -0
- package/dist/lib/components/PathRenderer.js.map +1 -0
- package/dist/lib/components/ThemeSwitch.js +4 -4
- package/dist/lib/components/ThemeSwitch.js.map +1 -1
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.js +4 -2
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +17 -15
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/oas/graphql/circular.js +17 -6
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/graphql/index.d.ts +1 -0
- package/dist/lib/oas/graphql/index.js +41 -23
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +3 -1
- package/dist/lib/plugins/openapi/ColorizedParam.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 +6 -11
- 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 +97 -54
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +7 -15
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/{SchemaComponents.js → SchemaPropertyItem.js} +10 -8
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
- package/dist/lib/plugins/openapi/schema/utils.js +2 -0
- package/dist/lib/plugins/openapi/schema/utils.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/vite/plugin-api.js +9 -1
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/prerender.js +0 -1
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{AuthenticationPlugin-CO_YCd2x.js → AuthenticationPlugin-Du8cLBSr.js} +2 -2
- package/lib/{AuthenticationPlugin-CO_YCd2x.js.map → AuthenticationPlugin-Du8cLBSr.js.map} +1 -1
- package/lib/{Markdown-B8o9Qz4q.js → Markdown-Cyrx_JrO.js} +8 -9
- package/lib/{Markdown-B8o9Qz4q.js.map → Markdown-Cyrx_JrO.js.map} +1 -1
- package/lib/{MdxPage-BxRt3Ly7.js → MdxPage-BuG8Tuwc.js} +5 -5
- package/lib/{MdxPage-BxRt3Ly7.js.map → MdxPage-BuG8Tuwc.js.map} +1 -1
- package/lib/OpenApiRoute-UrC_t0e5.js +36 -0
- package/lib/OpenApiRoute-UrC_t0e5.js.map +1 -0
- package/lib/{OperationList-DH-zIgtq.js → OperationList-CDt1xdc4.js} +1312 -1303
- package/lib/OperationList-CDt1xdc4.js.map +1 -0
- package/lib/{Select-B7UXR0SB.js → Select-CnCZ4WhS.js} +3 -3
- package/lib/{Select-B7UXR0SB.js.map → Select-CnCZ4WhS.js.map} +1 -1
- package/lib/{SlotletProvider-CtIp8rP3.js → SlotletProvider-mQiPDQIH.js} +2 -2
- package/lib/{SlotletProvider-CtIp8rP3.js.map → SlotletProvider-mQiPDQIH.js.map} +1 -1
- package/lib/{SyntaxHighlight-C1w1QPdY.js → SyntaxHighlight-B0L4SC_N.js} +11 -5
- package/lib/SyntaxHighlight-B0L4SC_N.js.map +1 -0
- package/lib/{ZudokuContext-8jts0fF3.js → ZudokuContext-BTUJPpQl.js} +21 -21
- package/lib/{ZudokuContext-8jts0fF3.js.map → ZudokuContext-BTUJPpQl.js.map} +1 -1
- package/lib/{circular-Dgpd6AN-.js → circular-DxaIIlWD.js} +251 -239
- package/lib/{circular-Dgpd6AN-.js.map → circular-DxaIIlWD.js.map} +1 -1
- package/lib/{createServer-BV0tHzLK.js → createServer-CjNktZzL.js} +821 -808
- package/lib/{createServer-BV0tHzLK.js.map → createServer-CjNktZzL.js.map} +1 -1
- package/lib/{hook-BG02esyv.js → hook-FT3SJLe_.js} +2 -2
- package/lib/{hook-BG02esyv.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-DmqsUPcm.js → index-Eb1oiHbM.js} +881 -799
- package/lib/index-Eb1oiHbM.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/{useScrollToAnchor-Bl6mz9_x.js → useScrollToAnchor-BZsGmBng.js} +86 -90
- package/lib/useScrollToAnchor-BZsGmBng.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.components.js +364 -348
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- 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/package.json +1 -1
- package/src/app/main.tsx +1 -2
- package/src/lib/components/PathRenderer.tsx +59 -0
- package/src/lib/components/ThemeSwitch.tsx +15 -14
- package/src/lib/components/index.ts +7 -5
- package/src/lib/components/navigation/SidebarCategory.tsx +44 -41
- package/src/lib/oas/graphql/circular.ts +27 -6
- package/src/lib/oas/graphql/index.ts +63 -35
- package/src/lib/plugins/openapi/ColorizedParam.tsx +3 -3
- 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 +6 -1
- package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -1
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +18 -27
- 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 +125 -67
- package/src/lib/plugins/openapi/interfaces.ts +1 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +23 -33
- package/src/lib/plugins/openapi/schema/{SchemaComponents.tsx → SchemaPropertyItem.tsx} +10 -6
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +4 -1
- package/src/lib/plugins/openapi/schema/utils.ts +4 -0
- package/src/lib/util/joinUrl.test.ts +62 -0
- package/src/lib/util/joinUrl.ts +1 -1
- package/dist/lib/plugins/openapi/Route.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +0 -1
- package/lib/OperationList-DH-zIgtq.js.map +0 -1
- package/lib/Route-DJ0ZlVq1.js +0 -35
- package/lib/Route-DJ0ZlVq1.js.map +0 -1
- package/lib/StaggeredRender-DgsamH_G.js +0 -17
- package/lib/StaggeredRender-DgsamH_G.js.map +0 -1
- package/lib/SyntaxHighlight-C1w1QPdY.js.map +0 -1
- package/lib/index-Bn6Lc9tq.js +0 -9
- package/lib/index-Bn6Lc9tq.js.map +0 -1
- package/lib/index-DmqsUPcm.js.map +0 -1
- package/lib/joinUrl-BTy9bvoK.js.map +0 -1
- package/lib/useScrollToAnchor-Bl6mz9_x.js.map +0 -1
- /package/dist/lib/plugins/openapi/schema/{SchemaComponents.d.ts → SchemaPropertyItem.d.ts} +0 -0
|
@@ -17,7 +17,6 @@ import { useApiIdentities } from "../../components/context/ZudokuContext.js";
|
|
|
17
17
|
import { cn } from "../../util/cn.js";
|
|
18
18
|
import { Endpoint } from "./Endpoint.js";
|
|
19
19
|
import { OperationListItem } from "./OperationListItem.js";
|
|
20
|
-
import StaggeredRender from "./StaggeredRender.js";
|
|
21
20
|
import { useCreateQuery } from "./client/useCreateQuery.js";
|
|
22
21
|
import { useOasConfig } from "./context.js";
|
|
23
22
|
import { graphql } from "./graphql/index.js";
|
|
@@ -90,35 +89,51 @@ export const OperationsFragment = graphql(/* GraphQL */ `
|
|
|
90
89
|
export type OperationListItemResult = ResultOf<typeof OperationsFragment>;
|
|
91
90
|
|
|
92
91
|
const AllOperationsQuery = graphql(/* GraphQL */ `
|
|
93
|
-
query AllOperations(
|
|
92
|
+
query AllOperations(
|
|
93
|
+
$input: JSON!
|
|
94
|
+
$type: SchemaType!
|
|
95
|
+
$tag: String
|
|
96
|
+
$untagged: Boolean
|
|
97
|
+
) {
|
|
94
98
|
schema(input: $input, type: $type) {
|
|
95
99
|
description
|
|
96
100
|
summary
|
|
97
101
|
title
|
|
98
102
|
url
|
|
99
103
|
version
|
|
100
|
-
tags {
|
|
104
|
+
tags(name: $tag) {
|
|
101
105
|
name
|
|
102
106
|
description
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
}
|
|
108
|
+
operations(tag: $tag, untagged: $untagged) {
|
|
109
|
+
slug
|
|
110
|
+
...OperationsFragment
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
}
|
|
110
114
|
`);
|
|
111
115
|
|
|
112
|
-
export const OperationList = (
|
|
116
|
+
export const OperationList = ({
|
|
117
|
+
tag,
|
|
118
|
+
untagged,
|
|
119
|
+
}: {
|
|
120
|
+
tag?: string;
|
|
121
|
+
untagged?: boolean;
|
|
122
|
+
}) => {
|
|
113
123
|
const { input, type, versions, version } = useOasConfig();
|
|
114
|
-
const query = useCreateQuery(AllOperationsQuery, {
|
|
124
|
+
const query = useCreateQuery(AllOperationsQuery, {
|
|
125
|
+
input,
|
|
126
|
+
type,
|
|
127
|
+
tag,
|
|
128
|
+
untagged,
|
|
129
|
+
});
|
|
115
130
|
const { selectedServer } = useSelectedServerStore();
|
|
116
131
|
const result = useSuspenseQuery(query);
|
|
117
132
|
const title = result.data.schema.title;
|
|
118
133
|
const summary = result.data.schema.summary;
|
|
119
134
|
const description = result.data.schema.description;
|
|
120
135
|
const navigate = useNavigate();
|
|
121
|
-
|
|
136
|
+
const operations = result.data.schema.operations;
|
|
122
137
|
// Prefetch for Playground
|
|
123
138
|
useApiIdentities();
|
|
124
139
|
|
|
@@ -175,7 +190,14 @@ export const OperationList = () => {
|
|
|
175
190
|
<div className="my-4 flex items-center justify-end gap-4">
|
|
176
191
|
<Endpoint />
|
|
177
192
|
</div>
|
|
178
|
-
{
|
|
193
|
+
{operations.map((fragment) => (
|
|
194
|
+
<OperationListItem
|
|
195
|
+
serverUrl={selectedServer ?? result.data.schema.url ?? ""}
|
|
196
|
+
key={fragment.slug}
|
|
197
|
+
operationFragment={fragment}
|
|
198
|
+
/>
|
|
199
|
+
))}
|
|
200
|
+
{/* {result.data.schema.tags
|
|
179
201
|
.filter((tag) => tag.operations.length > 0)
|
|
180
202
|
.map((tag) => (
|
|
181
203
|
// px, -mx is so that `content-visibility` doesn't cut off overflown heading anchor links '#'
|
|
@@ -199,7 +221,7 @@ export const OperationList = () => {
|
|
|
199
221
|
</StaggeredRender>
|
|
200
222
|
</div>
|
|
201
223
|
</div>
|
|
202
|
-
))}
|
|
224
|
+
))} */}
|
|
203
225
|
</div>
|
|
204
226
|
);
|
|
205
227
|
};
|
|
@@ -37,7 +37,12 @@ export const OperationListItem = ({
|
|
|
37
37
|
className="grid grid-cols-1 lg:grid-cols-[minmax(0,4fr)_minmax(0,3fr)] gap-8 items-start border-b-2 mb-16 pb-16"
|
|
38
38
|
>
|
|
39
39
|
<div className="flex flex-col gap-4">
|
|
40
|
-
<Heading
|
|
40
|
+
<Heading
|
|
41
|
+
level={2}
|
|
42
|
+
id={operation.slug}
|
|
43
|
+
registerSidebarAnchor
|
|
44
|
+
className="break-all"
|
|
45
|
+
>
|
|
41
46
|
{operation.summary}
|
|
42
47
|
</Heading>
|
|
43
48
|
<div className="text-sm flex gap-2 font-mono">
|
|
@@ -8,6 +8,8 @@ export const RequestBodySidecarBox = ({
|
|
|
8
8
|
content: Content;
|
|
9
9
|
onExampleChange?: (example: unknown) => void;
|
|
10
10
|
}) => {
|
|
11
|
+
if (content.length === 0) return null;
|
|
12
|
+
|
|
11
13
|
return (
|
|
12
14
|
<SidecarBox.Root>
|
|
13
15
|
<SidecarBox.Head className="text-xs flex justify-between items-center">
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
2
2
|
import { HTTPSnippet } from "@zudoku/httpsnippet";
|
|
3
|
-
import {
|
|
3
|
+
import { useMemo, useState, useTransition } from "react";
|
|
4
4
|
import { useSearchParams } from "react-router";
|
|
5
5
|
import { useSelectedServerStore } from "../../authentication/state.js";
|
|
6
|
+
import { PathRenderer } from "../../components/PathRenderer.js";
|
|
6
7
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
7
8
|
import type { SchemaObject } from "../../oas/parser/index.js";
|
|
8
9
|
import { cn } from "../../util/cn.js";
|
|
@@ -114,31 +115,21 @@ export const Sidecar = ({
|
|
|
114
115
|
|
|
115
116
|
const requestBodyContent = operation.requestBody?.content;
|
|
116
117
|
|
|
117
|
-
const path =
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
{part}
|
|
133
|
-
</ColorizedParam>
|
|
134
|
-
) : (
|
|
135
|
-
part
|
|
136
|
-
)}
|
|
137
|
-
{i < arr.length - 1 ? "/" : null}
|
|
138
|
-
<wbr />
|
|
139
|
-
</Fragment>
|
|
140
|
-
);
|
|
141
|
-
});
|
|
118
|
+
const path = (
|
|
119
|
+
<PathRenderer
|
|
120
|
+
path={operation.path}
|
|
121
|
+
renderParam={({ name }) => (
|
|
122
|
+
<ColorizedParam
|
|
123
|
+
name={name}
|
|
124
|
+
backgroundOpacity="0"
|
|
125
|
+
// same as in `ParameterListItem`
|
|
126
|
+
slug={`${operation.slug}-${name}`}
|
|
127
|
+
>
|
|
128
|
+
{`{${name}}`}
|
|
129
|
+
</ColorizedParam>
|
|
130
|
+
)}
|
|
131
|
+
/>
|
|
132
|
+
);
|
|
142
133
|
|
|
143
134
|
const { selectedServer } = useSelectedServerStore();
|
|
144
135
|
|
|
@@ -196,7 +187,7 @@ export const Sidecar = ({
|
|
|
196
187
|
</span>
|
|
197
188
|
{isOnScreen && (
|
|
198
189
|
<PlaygroundDialogWrapper
|
|
199
|
-
server={result.data.schema.url}
|
|
190
|
+
server={result.data.schema.url ?? ""}
|
|
200
191
|
servers={result.data.schema.servers.map((server) => server.url)}
|
|
201
192
|
operation={operation}
|
|
202
193
|
examples={requestBodyContent ?? undefined}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
1
|
+
import { useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
3
|
-
import {
|
|
3
|
+
import { SchemaObject } from "../../oas/parser/index.js";
|
|
4
4
|
import { CollapsibleCode } from "./CollapsibleCode.js";
|
|
5
5
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
6
6
|
import * as SidecarBox from "./SidecarBox.js";
|
|
@@ -57,27 +57,27 @@ export const SidecarExamples = ({
|
|
|
57
57
|
const examples = effectiveContent?.examples ?? [];
|
|
58
58
|
const selectedExample = examples[selectedExampleIndex];
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
effectiveContent.schema as SchemaObject
|
|
69
|
-
|
|
70
|
-
}
|
|
60
|
+
const exampleValue = useMemo(() => {
|
|
61
|
+
if (selectedExample) {
|
|
62
|
+
// If it's a wrapped example with a value field, use that
|
|
63
|
+
return "value" in selectedExample
|
|
64
|
+
? selectedExample.value
|
|
65
|
+
: selectedExample;
|
|
66
|
+
} else if (effectiveContent?.schema) {
|
|
67
|
+
// No example provided, generate one from schema
|
|
68
|
+
return generateSchemaExample(effectiveContent.schema as SchemaObject);
|
|
69
|
+
}
|
|
70
|
+
}, [selectedExample, effectiveContent?.schema]);
|
|
71
71
|
|
|
72
72
|
useEffect(() => {
|
|
73
|
+
if (!exampleValue) return;
|
|
74
|
+
|
|
73
75
|
onExampleChange?.(exampleValue);
|
|
74
76
|
}, [exampleValue, onExampleChange]);
|
|
75
77
|
|
|
76
78
|
const formattedExample = formatForDisplay(exampleValue);
|
|
77
79
|
const language = getLanguage(effectiveContent?.mediaType);
|
|
78
80
|
|
|
79
|
-
const hasContent = examples.length > 0 || content.length > 0;
|
|
80
|
-
|
|
81
81
|
return (
|
|
82
82
|
<>
|
|
83
83
|
<SidecarBox.Body className="p-0">
|
|
@@ -109,13 +109,13 @@ export const SidecarExamples = ({
|
|
|
109
109
|
</div>
|
|
110
110
|
)}
|
|
111
111
|
</SidecarBox.Body>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
<SidecarBox.Footer className="text-xs p-0 divide-y divide-border">
|
|
113
|
+
{description && (
|
|
114
|
+
<div className="text-muted-foreground text-xs px-3 py-2">
|
|
115
|
+
{description}
|
|
116
|
+
</div>
|
|
117
|
+
)}
|
|
118
|
+
{(examples.length !== 0 || content.length !== 0) && (
|
|
119
119
|
<div className="flex items-center gap-2 justify-between min-w-0 px-3 py-2">
|
|
120
120
|
<div className="flex items-center gap-2 min-w-0">
|
|
121
121
|
{content.length > 1 ? (
|
|
@@ -156,8 +156,8 @@ export const SidecarExamples = ({
|
|
|
156
156
|
</div>
|
|
157
157
|
)}
|
|
158
158
|
</div>
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
)}
|
|
160
|
+
</SidecarBox.Footer>
|
|
161
161
|
</>
|
|
162
162
|
);
|
|
163
163
|
};
|
|
@@ -17,12 +17,14 @@ const documents = {
|
|
|
17
17
|
types.ServersQueryDocument,
|
|
18
18
|
"\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":
|
|
19
19
|
types.OperationsFragmentFragmentDoc,
|
|
20
|
-
"\n query AllOperations($input: JSON
|
|
20
|
+
"\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":
|
|
21
21
|
types.AllOperationsDocument,
|
|
22
22
|
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n":
|
|
23
23
|
types.GetServerQueryDocument,
|
|
24
|
-
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n
|
|
24
|
+
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n name\n }\n }\n }\n":
|
|
25
25
|
types.GetCategoriesDocument,
|
|
26
|
+
"\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":
|
|
27
|
+
types.GetOperationsDocument,
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -41,7 +43,7 @@ export function graphql(
|
|
|
41
43
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
42
44
|
*/
|
|
43
45
|
export function graphql(
|
|
44
|
-
source: "\n query AllOperations($input: JSON
|
|
46
|
+
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",
|
|
45
47
|
): typeof import("./graphql.js").AllOperationsDocument;
|
|
46
48
|
/**
|
|
47
49
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
@@ -53,8 +55,14 @@ export function graphql(
|
|
|
53
55
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
54
56
|
*/
|
|
55
57
|
export function graphql(
|
|
56
|
-
source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n
|
|
58
|
+
source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n name\n }\n }\n }\n",
|
|
57
59
|
): typeof import("./graphql.js").GetCategoriesDocument;
|
|
60
|
+
/**
|
|
61
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
62
|
+
*/
|
|
63
|
+
export function graphql(
|
|
64
|
+
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",
|
|
65
|
+
): typeof import("./graphql.js").GetOperationsDocument;
|
|
58
66
|
|
|
59
67
|
export function graphql(source: string) {
|
|
60
68
|
return (documents as any)[source] ?? {};
|
|
@@ -31,6 +31,8 @@ export type Scalars = {
|
|
|
31
31
|
JSON: { input: any; output: any };
|
|
32
32
|
/** The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
|
|
33
33
|
JSONObject: { input: any; output: any };
|
|
34
|
+
/** OpenAPI schema scalar type that handles circular references */
|
|
35
|
+
JSONSchema: { input: any; output: any };
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
export type EncodingItem = {
|
|
@@ -57,7 +59,7 @@ export type MediaTypeObject = {
|
|
|
57
59
|
encoding?: Maybe<Array<EncodingItem>>;
|
|
58
60
|
examples?: Maybe<Array<ExampleItem>>;
|
|
59
61
|
mediaType: Scalars["String"]["output"];
|
|
60
|
-
schema?: Maybe<Scalars["
|
|
62
|
+
schema?: Maybe<Scalars["JSONSchema"]["output"]>;
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
export type OperationItem = {
|
|
@@ -89,7 +91,7 @@ export type ParameterItem = {
|
|
|
89
91
|
in: ParameterIn;
|
|
90
92
|
name: Scalars["String"]["output"];
|
|
91
93
|
required?: Maybe<Scalars["Boolean"]["output"]>;
|
|
92
|
-
schema?: Maybe<Scalars["
|
|
94
|
+
schema?: Maybe<Scalars["JSONSchema"]["output"]>;
|
|
93
95
|
style?: Maybe<Scalars["String"]["output"]>;
|
|
94
96
|
};
|
|
95
97
|
|
|
@@ -132,11 +134,11 @@ export type Schema = {
|
|
|
132
134
|
operations: Array<OperationItem>;
|
|
133
135
|
paths: Array<PathItem>;
|
|
134
136
|
servers: Array<Server>;
|
|
137
|
+
summary?: Maybe<Scalars["String"]["output"]>;
|
|
135
138
|
tags: Array<SchemaTag>;
|
|
136
139
|
title: Scalars["String"]["output"];
|
|
137
|
-
url
|
|
140
|
+
url?: Maybe<Scalars["String"]["output"]>;
|
|
138
141
|
version: Scalars["String"]["output"];
|
|
139
|
-
summary?: Maybe<Scalars["String"]["output"]>;
|
|
140
142
|
};
|
|
141
143
|
|
|
142
144
|
export type SchemaOperationsArgs = {
|
|
@@ -144,6 +146,7 @@ export type SchemaOperationsArgs = {
|
|
|
144
146
|
operationId?: InputMaybe<Scalars["String"]["input"]>;
|
|
145
147
|
path?: InputMaybe<Scalars["String"]["input"]>;
|
|
146
148
|
tag?: InputMaybe<Scalars["String"]["input"]>;
|
|
149
|
+
untagged?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
147
150
|
};
|
|
148
151
|
|
|
149
152
|
export type SchemaTagsArgs = {
|
|
@@ -180,7 +183,7 @@ export type ServersQueryQuery = {
|
|
|
180
183
|
__typename?: "Query";
|
|
181
184
|
schema: {
|
|
182
185
|
__typename?: "Schema";
|
|
183
|
-
url
|
|
186
|
+
url?: string | null;
|
|
184
187
|
servers: Array<{ __typename?: "Server"; url: string }>;
|
|
185
188
|
};
|
|
186
189
|
};
|
|
@@ -255,6 +258,8 @@ export type OperationsFragmentFragment = {
|
|
|
255
258
|
export type AllOperationsQueryVariables = Exact<{
|
|
256
259
|
input: Scalars["JSON"]["input"];
|
|
257
260
|
type: SchemaType;
|
|
261
|
+
tag?: InputMaybe<Scalars["String"]["input"]>;
|
|
262
|
+
untagged?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
258
263
|
}>;
|
|
259
264
|
|
|
260
265
|
export type AllOperationsQuery = {
|
|
@@ -264,20 +269,20 @@ export type AllOperationsQuery = {
|
|
|
264
269
|
description?: string | null;
|
|
265
270
|
summary?: string | null;
|
|
266
271
|
title: string;
|
|
267
|
-
url
|
|
272
|
+
url?: string | null;
|
|
268
273
|
version: string;
|
|
269
274
|
tags: Array<{
|
|
270
275
|
__typename?: "SchemaTag";
|
|
271
276
|
name?: string | null;
|
|
272
277
|
description?: string | null;
|
|
273
|
-
operations: Array<
|
|
274
|
-
{ __typename?: "OperationItem"; slug: string } & {
|
|
275
|
-
" $fragmentRefs"?: {
|
|
276
|
-
OperationsFragmentFragment: OperationsFragmentFragment;
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
>;
|
|
280
278
|
}>;
|
|
279
|
+
operations: Array<
|
|
280
|
+
{ __typename?: "OperationItem"; slug: string } & {
|
|
281
|
+
" $fragmentRefs"?: {
|
|
282
|
+
OperationsFragmentFragment: OperationsFragmentFragment;
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
>;
|
|
281
286
|
};
|
|
282
287
|
};
|
|
283
288
|
|
|
@@ -290,7 +295,7 @@ export type GetServerQueryQuery = {
|
|
|
290
295
|
__typename?: "Query";
|
|
291
296
|
schema: {
|
|
292
297
|
__typename?: "Schema";
|
|
293
|
-
url
|
|
298
|
+
url?: string | null;
|
|
294
299
|
servers: Array<{ __typename?: "Server"; url: string }>;
|
|
295
300
|
};
|
|
296
301
|
};
|
|
@@ -304,19 +309,30 @@ export type GetCategoriesQuery = {
|
|
|
304
309
|
__typename?: "Query";
|
|
305
310
|
schema: {
|
|
306
311
|
__typename?: "Schema";
|
|
307
|
-
url
|
|
308
|
-
tags: Array<{
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
312
|
+
url?: string | null;
|
|
313
|
+
tags: Array<{ __typename?: "SchemaTag"; name?: string | null }>;
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export type GetOperationsQueryVariables = Exact<{
|
|
318
|
+
input: Scalars["JSON"]["input"];
|
|
319
|
+
type: SchemaType;
|
|
320
|
+
tag?: InputMaybe<Scalars["String"]["input"]>;
|
|
321
|
+
untagged?: InputMaybe<Scalars["Boolean"]["input"]>;
|
|
322
|
+
}>;
|
|
323
|
+
|
|
324
|
+
export type GetOperationsQuery = {
|
|
325
|
+
__typename?: "Query";
|
|
326
|
+
schema: {
|
|
327
|
+
__typename?: "Schema";
|
|
328
|
+
operations: Array<{
|
|
329
|
+
__typename?: "OperationItem";
|
|
330
|
+
slug: string;
|
|
331
|
+
deprecated?: boolean | null;
|
|
332
|
+
method: string;
|
|
333
|
+
summary?: string | null;
|
|
334
|
+
operationId?: string | null;
|
|
335
|
+
path: string;
|
|
320
336
|
}>;
|
|
321
337
|
};
|
|
322
338
|
};
|
|
@@ -418,20 +434,20 @@ export const ServersQueryDocument = new TypedDocumentString(`
|
|
|
418
434
|
ServersQueryQueryVariables
|
|
419
435
|
>;
|
|
420
436
|
export const AllOperationsDocument = new TypedDocumentString(`
|
|
421
|
-
query AllOperations($input: JSON!, $type: SchemaType
|
|
437
|
+
query AllOperations($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
|
|
422
438
|
schema(input: $input, type: $type) {
|
|
423
439
|
description
|
|
424
440
|
summary
|
|
425
441
|
title
|
|
426
442
|
url
|
|
427
443
|
version
|
|
428
|
-
tags {
|
|
444
|
+
tags(name: $tag) {
|
|
429
445
|
name
|
|
430
446
|
description
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
447
|
+
}
|
|
448
|
+
operations(tag: $tag, untagged: $untagged) {
|
|
449
|
+
slug
|
|
450
|
+
...OperationsFragment
|
|
435
451
|
}
|
|
436
452
|
}
|
|
437
453
|
}
|
|
@@ -517,17 +533,7 @@ export const GetCategoriesDocument = new TypedDocumentString(`
|
|
|
517
533
|
schema(input: $input, type: $type) {
|
|
518
534
|
url
|
|
519
535
|
tags {
|
|
520
|
-
__typename
|
|
521
536
|
name
|
|
522
|
-
operations {
|
|
523
|
-
__typename
|
|
524
|
-
slug
|
|
525
|
-
deprecated
|
|
526
|
-
method
|
|
527
|
-
summary
|
|
528
|
-
operationId
|
|
529
|
-
path
|
|
530
|
-
}
|
|
531
537
|
}
|
|
532
538
|
}
|
|
533
539
|
}
|
|
@@ -535,3 +541,20 @@ export const GetCategoriesDocument = new TypedDocumentString(`
|
|
|
535
541
|
GetCategoriesQuery,
|
|
536
542
|
GetCategoriesQueryVariables
|
|
537
543
|
>;
|
|
544
|
+
export const GetOperationsDocument = new TypedDocumentString(`
|
|
545
|
+
query GetOperations($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
|
|
546
|
+
schema(input: $input, type: $type) {
|
|
547
|
+
operations(tag: $tag, untagged: $untagged) {
|
|
548
|
+
slug
|
|
549
|
+
deprecated
|
|
550
|
+
method
|
|
551
|
+
summary
|
|
552
|
+
operationId
|
|
553
|
+
path
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
`) as unknown as TypedDocumentString<
|
|
558
|
+
GetOperationsQuery,
|
|
559
|
+
GetOperationsQueryVariables
|
|
560
|
+
>;
|