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.
Files changed (152) hide show
  1. package/dist/app/main.js +1 -2
  2. package/dist/app/main.js.map +1 -1
  3. package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
  4. package/dist/lib/components/PathRenderer.d.ts +11 -0
  5. package/dist/lib/components/PathRenderer.js +25 -0
  6. package/dist/lib/components/PathRenderer.js.map +1 -0
  7. package/dist/lib/components/ThemeSwitch.js +4 -4
  8. package/dist/lib/components/ThemeSwitch.js.map +1 -1
  9. package/dist/lib/components/index.d.ts +1 -0
  10. package/dist/lib/components/index.js +4 -2
  11. package/dist/lib/components/index.js.map +1 -1
  12. package/dist/lib/components/navigation/SidebarCategory.js +17 -15
  13. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  14. package/dist/lib/oas/graphql/circular.js +17 -6
  15. package/dist/lib/oas/graphql/circular.js.map +1 -1
  16. package/dist/lib/oas/graphql/index.d.ts +1 -0
  17. package/dist/lib/oas/graphql/index.js +41 -23
  18. package/dist/lib/oas/graphql/index.js.map +1 -1
  19. package/dist/lib/plugins/openapi/ColorizedParam.js +3 -1
  20. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  21. package/dist/lib/plugins/openapi/Endpoint.js +2 -2
  22. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  23. package/dist/lib/plugins/openapi/{Route.d.ts → OpenApiRoute.d.ts} +2 -1
  24. package/dist/lib/plugins/openapi/{Route.js → OpenApiRoute.js} +3 -4
  25. package/dist/lib/plugins/openapi/OpenApiRoute.js.map +1 -0
  26. package/dist/lib/plugins/openapi/OperationList.d.ts +4 -1
  27. package/dist/lib/plugins/openapi/OperationList.js +20 -14
  28. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  29. package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
  30. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  31. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  32. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  33. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +1 -1
  34. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -0
  35. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  36. package/dist/lib/plugins/openapi/Sidecar.js +6 -11
  37. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  38. package/dist/lib/plugins/openapi/SidecarExamples.js +17 -14
  39. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  40. package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -2
  41. package/dist/lib/plugins/openapi/graphql/gql.js +3 -2
  42. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  43. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +47 -26
  44. package/dist/lib/plugins/openapi/graphql/graphql.js +20 -16
  45. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  46. package/dist/lib/plugins/openapi/index.js +97 -54
  47. package/dist/lib/plugins/openapi/index.js.map +1 -1
  48. package/dist/lib/plugins/openapi/interfaces.d.ts +1 -0
  49. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
  50. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  51. package/dist/lib/plugins/openapi/playground/Playground.js +7 -15
  52. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  53. package/dist/lib/plugins/openapi/schema/{SchemaComponents.js → SchemaPropertyItem.js} +10 -8
  54. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -0
  55. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  56. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  57. package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
  58. package/dist/lib/plugins/openapi/schema/utils.js +2 -0
  59. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  60. package/dist/lib/util/joinUrl.js +1 -1
  61. package/dist/lib/util/joinUrl.js.map +1 -1
  62. package/dist/lib/util/joinUrl.test.d.ts +1 -0
  63. package/dist/lib/util/joinUrl.test.js +43 -0
  64. package/dist/lib/util/joinUrl.test.js.map +1 -0
  65. package/dist/vite/plugin-api.js +9 -1
  66. package/dist/vite/plugin-api.js.map +1 -1
  67. package/dist/vite/prerender.js +0 -1
  68. package/dist/vite/prerender.js.map +1 -1
  69. package/lib/{AuthenticationPlugin-CO_YCd2x.js → AuthenticationPlugin-Du8cLBSr.js} +2 -2
  70. package/lib/{AuthenticationPlugin-CO_YCd2x.js.map → AuthenticationPlugin-Du8cLBSr.js.map} +1 -1
  71. package/lib/{Markdown-B8o9Qz4q.js → Markdown-Cyrx_JrO.js} +8 -9
  72. package/lib/{Markdown-B8o9Qz4q.js.map → Markdown-Cyrx_JrO.js.map} +1 -1
  73. package/lib/{MdxPage-BxRt3Ly7.js → MdxPage-BuG8Tuwc.js} +5 -5
  74. package/lib/{MdxPage-BxRt3Ly7.js.map → MdxPage-BuG8Tuwc.js.map} +1 -1
  75. package/lib/OpenApiRoute-UrC_t0e5.js +36 -0
  76. package/lib/OpenApiRoute-UrC_t0e5.js.map +1 -0
  77. package/lib/{OperationList-DH-zIgtq.js → OperationList-CDt1xdc4.js} +1312 -1303
  78. package/lib/OperationList-CDt1xdc4.js.map +1 -0
  79. package/lib/{Select-B7UXR0SB.js → Select-CnCZ4WhS.js} +3 -3
  80. package/lib/{Select-B7UXR0SB.js.map → Select-CnCZ4WhS.js.map} +1 -1
  81. package/lib/{SlotletProvider-CtIp8rP3.js → SlotletProvider-mQiPDQIH.js} +2 -2
  82. package/lib/{SlotletProvider-CtIp8rP3.js.map → SlotletProvider-mQiPDQIH.js.map} +1 -1
  83. package/lib/{SyntaxHighlight-C1w1QPdY.js → SyntaxHighlight-B0L4SC_N.js} +11 -5
  84. package/lib/SyntaxHighlight-B0L4SC_N.js.map +1 -0
  85. package/lib/{ZudokuContext-8jts0fF3.js → ZudokuContext-BTUJPpQl.js} +21 -21
  86. package/lib/{ZudokuContext-8jts0fF3.js.map → ZudokuContext-BTUJPpQl.js.map} +1 -1
  87. package/lib/{circular-Dgpd6AN-.js → circular-DxaIIlWD.js} +251 -239
  88. package/lib/{circular-Dgpd6AN-.js.map → circular-DxaIIlWD.js.map} +1 -1
  89. package/lib/{createServer-BV0tHzLK.js → createServer-CjNktZzL.js} +821 -808
  90. package/lib/{createServer-BV0tHzLK.js.map → createServer-CjNktZzL.js.map} +1 -1
  91. package/lib/{hook-BG02esyv.js → hook-FT3SJLe_.js} +2 -2
  92. package/lib/{hook-BG02esyv.js.map → hook-FT3SJLe_.js.map} +1 -1
  93. package/lib/{index-LNp6rxyU.js → index-CjJS0l4l.js} +2 -2
  94. package/lib/{index-LNp6rxyU.js.map → index-CjJS0l4l.js.map} +1 -1
  95. package/lib/{index-DmqsUPcm.js → index-Eb1oiHbM.js} +881 -799
  96. package/lib/index-Eb1oiHbM.js.map +1 -0
  97. package/lib/{joinUrl-BTy9bvoK.js → joinUrl-nLx9pD-Z.js} +2 -2
  98. package/lib/joinUrl-nLx9pD-Z.js.map +1 -0
  99. package/lib/{useScrollToAnchor-Bl6mz9_x.js → useScrollToAnchor-BZsGmBng.js} +86 -90
  100. package/lib/useScrollToAnchor-BZsGmBng.js.map +1 -0
  101. package/lib/zudoku.auth-clerk.js +1 -1
  102. package/lib/zudoku.auth-openid.js +3 -3
  103. package/lib/zudoku.components.js +364 -348
  104. package/lib/zudoku.components.js.map +1 -1
  105. package/lib/zudoku.plugin-api-catalog.js +3 -3
  106. package/lib/zudoku.plugin-api-keys.js +4 -4
  107. package/lib/zudoku.plugin-custom-pages.js +1 -1
  108. package/lib/zudoku.plugin-markdown.js +1 -1
  109. package/lib/zudoku.plugin-openapi.js +6 -5
  110. package/lib/zudoku.plugin-openapi.js.map +1 -1
  111. package/package.json +1 -1
  112. package/src/app/main.tsx +1 -2
  113. package/src/lib/components/PathRenderer.tsx +59 -0
  114. package/src/lib/components/ThemeSwitch.tsx +15 -14
  115. package/src/lib/components/index.ts +7 -5
  116. package/src/lib/components/navigation/SidebarCategory.tsx +44 -41
  117. package/src/lib/oas/graphql/circular.ts +27 -6
  118. package/src/lib/oas/graphql/index.ts +63 -35
  119. package/src/lib/plugins/openapi/ColorizedParam.tsx +3 -3
  120. package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
  121. package/src/lib/plugins/openapi/{Route.tsx → OpenApiRoute.tsx} +3 -3
  122. package/src/lib/plugins/openapi/OperationList.tsx +34 -12
  123. package/src/lib/plugins/openapi/OperationListItem.tsx +6 -1
  124. package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -1
  125. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -0
  126. package/src/lib/plugins/openapi/Sidecar.tsx +18 -27
  127. package/src/lib/plugins/openapi/SidecarExamples.tsx +24 -24
  128. package/src/lib/plugins/openapi/graphql/gql.ts +12 -4
  129. package/src/lib/plugins/openapi/graphql/graphql.ts +66 -43
  130. package/src/lib/plugins/openapi/index.tsx +125 -67
  131. package/src/lib/plugins/openapi/interfaces.ts +1 -0
  132. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  133. package/src/lib/plugins/openapi/playground/Playground.tsx +23 -33
  134. package/src/lib/plugins/openapi/schema/{SchemaComponents.tsx → SchemaPropertyItem.tsx} +10 -6
  135. package/src/lib/plugins/openapi/schema/SchemaView.tsx +4 -1
  136. package/src/lib/plugins/openapi/schema/utils.ts +4 -0
  137. package/src/lib/util/joinUrl.test.ts +62 -0
  138. package/src/lib/util/joinUrl.ts +1 -1
  139. package/dist/lib/plugins/openapi/Route.js.map +0 -1
  140. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +0 -1
  141. package/lib/OperationList-DH-zIgtq.js.map +0 -1
  142. package/lib/Route-DJ0ZlVq1.js +0 -35
  143. package/lib/Route-DJ0ZlVq1.js.map +0 -1
  144. package/lib/StaggeredRender-DgsamH_G.js +0 -17
  145. package/lib/StaggeredRender-DgsamH_G.js.map +0 -1
  146. package/lib/SyntaxHighlight-C1w1QPdY.js.map +0 -1
  147. package/lib/index-Bn6Lc9tq.js +0 -9
  148. package/lib/index-Bn6Lc9tq.js.map +0 -1
  149. package/lib/index-DmqsUPcm.js.map +0 -1
  150. package/lib/joinUrl-BTy9bvoK.js.map +0 -1
  151. package/lib/useScrollToAnchor-Bl6mz9_x.js.map +0 -1
  152. /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($input: JSON!, $type: SchemaType!) {
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
- operations {
104
- slug
105
- ...OperationsFragment
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, { input, type });
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
- {result.data.schema.tags
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 level={2} id={operation.slug} registerSidebarAnchor>
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">
@@ -40,7 +40,7 @@ export const ParameterListItem = ({
40
40
  name={parameter.name}
41
41
  backgroundOpacity="15%"
42
42
  className="px-1"
43
- slug={id + "-" + parameter.name.toLocaleLowerCase()}
43
+ slug={`${id}-${parameter.name}`}
44
44
  />
45
45
  ) : (
46
46
  parameter.name
@@ -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 { Fragment, useMemo, useState, useTransition } from "react";
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 = operation.path.split("/").map((part, i, arr) => {
118
- const isParam =
119
- (part.startsWith("{") && part.endsWith("}")) || part.startsWith(":");
120
- const paramName = isParam ? part.replace(/[:{}]/g, "") : undefined;
121
-
122
- return (
123
- // eslint-disable-next-line react/no-array-index-key
124
- <Fragment key={part + i}>
125
- {paramName ? (
126
- <ColorizedParam
127
- name={paramName}
128
- backgroundOpacity="0"
129
- // same as in `ParameterListItem`
130
- slug={`${operation.slug}-${paramName.toLocaleLowerCase()}`}
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 { type SchemaObject } from "../../oas/graphql/index.js";
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
- let exampleValue = undefined;
61
- if (selectedExample) {
62
- // If it's a wrapped example with a value field, use that
63
- exampleValue =
64
- "value" in selectedExample ? selectedExample.value : selectedExample;
65
- } else if (effectiveContent?.schema) {
66
- // No example provided, generate one from schema
67
- exampleValue = generateSchemaExample(
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
- {hasContent && (
113
- <SidecarBox.Footer className="text-xs p-0">
114
- {description && (
115
- <div className="text-muted-foreground text-xs border-b px-3 py-2">
116
- {description}
117
- </div>
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
- </SidecarBox.Footer>
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!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n summary\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n":
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 __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\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!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n summary\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n",
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 __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\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["JSON"]["output"]>;
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["JSON"]["output"]>;
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: Scalars["String"]["output"];
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: string;
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: string;
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: string;
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: string;
308
- tags: Array<{
309
- __typename: "SchemaTag";
310
- name?: string | null;
311
- operations: Array<{
312
- __typename: "OperationItem";
313
- slug: string;
314
- deprecated?: boolean | null;
315
- method: string;
316
- summary?: string | null;
317
- operationId?: string | null;
318
- path: string;
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
- operations {
432
- slug
433
- ...OperationsFragment
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
+ >;