zudoku 0.3.0-dev.129 → 0.3.0-dev.130

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.
@@ -1,5 +1,5 @@
1
1
  import "./jsx-runtime-B6kdoens.js";
2
- import { o as l } from "./index-Bx0AgZT5.js";
2
+ import { o as l } from "./index-D-9zqIOh.js";
3
3
  import "./urql-DrBfkb92.js";
4
4
  import "./ZudokuContext-BIZ8zHbZ.js";
5
5
  import "zudoku/openapi-worker";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.3.0-dev.129",
3
+ "version": "0.3.0-dev.130",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
package/src/app/main.css CHANGED
@@ -170,6 +170,28 @@
170
170
  }
171
171
  }
172
172
 
173
+ .scrollbar::-webkit-scrollbar {
174
+ padding: 2px;
175
+ width: 12px;
176
+ height: 12px;
177
+ background: transparent;
178
+ }
179
+
180
+ .scrollbar:hover::-webkit-scrollbar-thumb {
181
+ background: hsla(var(--border));
182
+ border-radius: 12px;
183
+ border: 2px solid transparent;
184
+ background-clip: content-box;
185
+ }
186
+
187
+ .scrollbar::-webkit-scrollbar-thumb {
188
+ background: transparent;
189
+ }
190
+
191
+ .scrollbar::-webkit-scrollbar-corner {
192
+ background: transparent;
193
+ }
194
+
173
195
  /* Theme */
174
196
  :root {
175
197
  --background: 0 0% 100%;
@@ -4,21 +4,23 @@ import { cn } from "../../util/cn.js";
4
4
  export const SidebarWrapper = forwardRef<
5
5
  HTMLDivElement,
6
6
  PropsWithChildren<{ pushMainContent?: boolean; className?: string }>
7
- >(function SideNavigation({ children, className, pushMainContent }, ref) {
8
- return (
9
- <nav
10
- // this data attribute is used in `Layout.tsx` to determine if side navigation
11
- // is present for the current page so the main content is pushed to the right
12
- // it's also important to set `peer` class here.
13
- // maybe this could be simplified by adjusting the layout
14
- data-navigation={String(pushMainContent)}
15
- className={cn(
16
- "peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0 p-[--padding-nav-item] -mx-[--padding-nav-item] pb-20 pt-[--padding-content-top] w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
17
- className,
18
- )}
19
- ref={ref}
20
- >
21
- {children}
22
- </nav>
23
- );
24
- });
7
+ >(({ children, className, pushMainContent }, ref) => (
8
+ <nav
9
+ // this data attribute is used in `Layout.tsx` to determine if side navigation
10
+ // is present for the current page so the main content is pushed to the right
11
+ // it's also important to set `peer` class here.
12
+ // maybe this could be simplified by adjusting the layout
13
+ data-navigation={String(pushMainContent)}
14
+ className={cn(
15
+ "scrollbar peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0",
16
+ "px-[--padding-nav-item] -mx-[--padding-nav-item] pb-20 mt-[--padding-content-top]",
17
+ "w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
18
+ className,
19
+ )}
20
+ ref={ref}
21
+ >
22
+ {children}
23
+ </nav>
24
+ ));
25
+
26
+ SidebarWrapper.displayName = "SidebarWrapper";
@@ -1,7 +1,6 @@
1
1
  import { useState } from "react";
2
2
  import { Heading } from "../../components/Heading.js";
3
3
  import { Markdown } from "../../components/Markdown.js";
4
- import { Card } from "../../ui/Card.js";
5
4
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../ui/Tabs.js";
6
5
  import { groupBy } from "../../util/groupBy.js";
7
6
  import { renderIf } from "../../util/renderIf.js";
@@ -96,16 +95,12 @@ export const OperationListItem = ({
96
95
  value={response.statusCode}
97
96
  key={response.statusCode}
98
97
  >
99
- {renderIf(
100
- response.content?.find((content) => content.schema),
101
- (content) => {
102
- return <SchemaView schema={content.schema} />;
103
- },
104
- ) ?? (
105
- <Card className="font-mono text-sm p-4 italic bg-border/20">
106
- No response body
107
- </Card>
108
- )}
98
+ <SchemaView
99
+ schema={
100
+ response.content?.find((content) => content.schema)
101
+ ?.schema
102
+ }
103
+ />
109
104
  </TabsContent>
110
105
  ))}
111
106
  </ul>
@@ -164,7 +164,7 @@ export const openApiPlugin = (
164
164
  .map<SidebarItem>((tag) => ({
165
165
  type: "category",
166
166
  label: tag.name ?? "",
167
- collapsible: false,
167
+ collapsible: true,
168
168
  collapsed: false,
169
169
  items: tag.operations.map((operation) => ({
170
170
  type: "link",
@@ -1,5 +1,7 @@
1
+ import { Markdown, ProseClasses } from "../../../components/Markdown.js";
1
2
  import type { SchemaObject } from "../../../oas/parser/index.js";
2
3
  import { Card, CardContent, CardHeader, CardTitle } from "../../../ui/Card.js";
4
+ import { cn } from "../../../util/cn.js";
3
5
  import { groupBy } from "../../../util/groupBy.js";
4
6
  import { SchemaLogicalGroup, SchemaPropertyItem } from "./SchemaComponents.js";
5
7
  import { hasLogicalGroupings } from "./utils.js";
@@ -9,15 +11,27 @@ export const SchemaView = ({
9
11
  level = 0,
10
12
  defaultOpen = false,
11
13
  }: {
12
- schema: SchemaObject;
14
+ schema?: SchemaObject | null;
13
15
  level?: number;
14
16
  defaultOpen?: boolean;
15
17
  }) => {
18
+ if (!schema || Object.keys(schema).length === 0) {
19
+ return (
20
+ <Card className="p-4">
21
+ <span className="text-sm text-muted-foreground italic">
22
+ No response specified
23
+ </span>
24
+ </Card>
25
+ );
26
+ }
27
+
16
28
  const renderSchema = (schema: SchemaObject, level: number) => {
17
29
  if (schema.oneOf || schema.allOf || schema.anyOf) {
18
30
  return <SchemaLogicalGroup schema={schema} level={level} />;
19
31
  }
20
32
 
33
+ // Sometimes items is not defined
34
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
21
35
  if (schema.type === "array" && schema.items) {
22
36
  const itemsSchema = schema.items as SchemaObject;
23
37
 
@@ -26,11 +40,19 @@ export const SchemaView = ({
26
40
  ["string", "number", "boolean", "integer"].includes(itemsSchema.type)
27
41
  ) {
28
42
  return (
29
- <Card className="my-2">
30
- <CardContent>
31
- <strong>{`array<${itemsSchema.type}>`}</strong>
32
- {schema.description && <p>{schema.description}</p>}
33
- </CardContent>
43
+ <Card className="p-4">
44
+ <span className="text-sm text-muted-foreground">
45
+ {itemsSchema.type}[]
46
+ </span>
47
+ {schema.description && (
48
+ <Markdown
49
+ className={cn(
50
+ ProseClasses,
51
+ "text-sm leading-normal line-clamp-4",
52
+ )}
53
+ content={schema.description}
54
+ />
55
+ )}
34
56
  </Card>
35
57
  );
36
58
  } else if (
@@ -38,7 +60,7 @@ export const SchemaView = ({
38
60
  hasLogicalGroupings(itemsSchema)
39
61
  ) {
40
62
  return (
41
- <Card className="flex flex-col gap-2 bg-border/30 p-4 ">
63
+ <Card className="flex flex-col gap-2 bg-border/30 p-4">
42
64
  <span className="text-sm text-muted-foreground">object[]</span>
43
65
  {renderSchema(itemsSchema, level + 1)}
44
66
  </Card>
@@ -48,6 +70,24 @@ export const SchemaView = ({
48
70
  }
49
71
  }
50
72
 
73
+ if (schema.type === "object" && !schema.properties) {
74
+ return (
75
+ <Card className="p-4 flex gap-2 items-center">
76
+ {"name" in schema && <>{schema.name}</>}
77
+ <span className="text-sm text-muted-foreground">object</span>
78
+ {schema.description && (
79
+ <Markdown
80
+ className={cn(
81
+ ProseClasses,
82
+ "text-sm leading-normal line-clamp-4",
83
+ )}
84
+ content={schema.description}
85
+ />
86
+ )}
87
+ </Card>
88
+ );
89
+ }
90
+
51
91
  if (schema.properties) {
52
92
  const groupedProperties = groupBy(
53
93
  Object.entries(schema.properties),
@@ -89,6 +129,26 @@ export const SchemaView = ({
89
129
  );
90
130
  }
91
131
 
132
+ if (
133
+ typeof schema.type === "string" &&
134
+ ["string", "number", "boolean", "integer", "null"].includes(schema.type)
135
+ ) {
136
+ return (
137
+ <Card className="p-4">
138
+ <span className="text-sm text-muted-foreground">{schema.type}</span>
139
+ {schema.description && (
140
+ <Markdown
141
+ className={cn(
142
+ ProseClasses,
143
+ "text-sm leading-normal line-clamp-4",
144
+ )}
145
+ content={schema.description}
146
+ />
147
+ )}
148
+ </Card>
149
+ );
150
+ }
151
+
92
152
  if (schema.additionalProperties) {
93
153
  return (
94
154
  <Card className="my-2">
@@ -1,414 +0,0 @@
1
- import { j as e } from "./jsx-runtime-B6kdoens.js";
2
- import { C as b } from "./CategoryHeading-z15xh7Jb.js";
3
- import { D as v } from "./DeveloperHint-BQSFXH01.js";
4
- import { C as A, a as x, b as N, c as I, d as R, T as k, e as H, f as $, g as F, S as B, h as P, u as M, E as z } from "./index-Bx0AgZT5.js";
5
- import { c as E, h as j, H as h, a as f, P as q, I as O, S as G } from "./Markdown-CEccPMI_.js";
6
- import { useState as w } from "react";
7
- import { R as D, T as Q, C as V, a as _ } from "./index-Dz4LyXZI.js";
8
- import { u as J } from "./urql-DrBfkb92.js";
9
- import { B as K } from "./Combination-DTfV-c98.js";
10
- /**
11
- * @license lucide-react v0.378.0 - ISC
12
- *
13
- * This source code is licensed under the ISC license.
14
- * See the LICENSE file in the root directory of this source tree.
15
- */
16
- const U = E("ListPlus", [
17
- ["path", { d: "M11 12H3", key: "51ecnj" }],
18
- ["path", { d: "M16 6H3", key: "1wxfjs" }],
19
- ["path", { d: "M16 18H3", key: "12xzn7" }],
20
- ["path", { d: "M18 9v6", key: "1twb98" }],
21
- ["path", { d: "M21 12h-6", key: "bt1uis" }]
22
- ]);
23
- function Z(t, s) {
24
- return s;
25
- }
26
- const L = (t, s) => t.reduce(
27
- (i, n) => {
28
- const r = s(n);
29
- return i[r] || (i[r] = []), i[r].push(n), i;
30
- },
31
- {}
32
- ), C = (t, s) => t ? s(t) : void 0, S = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
33
- type: "string"
34
- }, W = ({
35
- parameter: t,
36
- group: s,
37
- id: i
38
- }) => /* @__PURE__ */ e.jsxs("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1", children: [
39
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
40
- /* @__PURE__ */ e.jsx("code", { children: s === "path" ? /* @__PURE__ */ e.jsx(
41
- A,
42
- {
43
- name: t.name,
44
- backgroundOpacity: "15%",
45
- slug: i + "-" + t.name.toLocaleLowerCase()
46
- }
47
- ) : t.name }),
48
- t.required && /* @__PURE__ */ e.jsx("span", { className: "py-px px-1.5 font-medium bg-primary/75 text-muted rounded-lg", children: "required" }),
49
- S(t).type && /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: S(t).type })
50
- ] }),
51
- t.description && /* @__PURE__ */ e.jsx(
52
- j,
53
- {
54
- content: t.description,
55
- className: "text-sm prose-p:my-1"
56
- }
57
- )
58
- ] }), X = ({
59
- group: t,
60
- parameters: s,
61
- id: i
62
- }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
63
- /* @__PURE__ */ e.jsx(h, { level: 3, id: `${i}/${t}-parameters`, className: "capitalize", children: t === "header" ? "Headers" : `${t} Parameters` }),
64
- /* @__PURE__ */ e.jsx(x, { children: /* @__PURE__ */ e.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: s.sort((n, r) => n.required === r.required ? 0 : n.required ? -1 : 1).map((n) => /* @__PURE__ */ e.jsx(
65
- W,
66
- {
67
- parameter: n,
68
- id: i,
69
- group: t
70
- },
71
- `${n.name}-${n.in}`
72
- )) }) })
73
- ] }), Y = (t) => t.type === "object" || t.type === "array" && typeof t.items == "object" && (!t.items.type || t.items.type === "object"), y = (t) => !!(t.oneOf ?? t.allOf ?? t.anyOf), T = ({
74
- schema: t,
75
- level: s
76
- }) => {
77
- const i = (n, r, c) => n.map((o, d) => /* @__PURE__ */ e.jsxs("div", { className: "my-2", children: [
78
- /* @__PURE__ */ e.jsx("strong", { children: r }),
79
- /* @__PURE__ */ e.jsxs("div", { className: "mt-2", children: [
80
- /* @__PURE__ */ e.jsx(u, { schema: o, level: s + 1 }),
81
- d < n.length - 1 && /* @__PURE__ */ e.jsx("div", { className: "text-center my-2", children: c })
82
- ] })
83
- ] }, d));
84
- return t.oneOf ? i(t.oneOf, "One of", "OR") : t.allOf ? i(t.allOf, "All of", "AND") : t.anyOf ? i(t.anyOf, "Any of", "OR") : null;
85
- }, ee = ({
86
- name: t,
87
- value: s,
88
- group: i,
89
- level: n,
90
- defaultOpen: r = !1,
91
- showCollapseButton: c = !0
92
- }) => {
93
- var m;
94
- const [o, d] = w(r);
95
- return /* @__PURE__ */ e.jsx("li", { className: "p-4 bg-border/20 hover:bg-border/30", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 justify-between text-sm", children: [
96
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
97
- /* @__PURE__ */ e.jsx("code", { children: t }),
98
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: s.type === "array" && ((m = s.items) != null && m.type) ? /* @__PURE__ */ e.jsxs("span", { children: [
99
- s.items.type,
100
- "[]"
101
- ] }) : Array.isArray(s.type) ? /* @__PURE__ */ e.jsx("span", { children: s.type.join(" | ") }) : /* @__PURE__ */ e.jsx("span", { children: s.type }) }),
102
- i === "optional" && /* @__PURE__ */ e.jsx("span", { className: "py-px px-1.5 font-medium border rounded-lg", children: "optional" })
103
- ] }),
104
- s.description && /* @__PURE__ */ e.jsx(
105
- j,
106
- {
107
- className: f(q, "text-sm leading-normal line-clamp-4"),
108
- content: s.description
109
- }
110
- ),
111
- (y(s) || Y(s)) && /* @__PURE__ */ e.jsxs(
112
- D,
113
- {
114
- defaultOpen: r,
115
- open: o,
116
- onOpenChange: () => d(!o),
117
- children: [
118
- c && /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
119
- K,
120
- {
121
- variant: "outline",
122
- size: "sm",
123
- className: "mt-2 flex gap-1.5",
124
- children: [
125
- /* @__PURE__ */ e.jsx(U, { size: 18 }),
126
- o ? "Hide nested properties" : "Show nested properties"
127
- ]
128
- }
129
- ) }),
130
- /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsxs("div", { className: "mt-2", children: [
131
- y(s) && /* @__PURE__ */ e.jsx(T, { schema: s, level: n + 1 }),
132
- s.type === "object" && /* @__PURE__ */ e.jsx(u, { schema: s, level: n + 1 }),
133
- s.type === "array" && typeof s.items == "object" && /* @__PURE__ */ e.jsx(u, { schema: s.items, level: n + 1 })
134
- ] }) })
135
- ]
136
- }
137
- )
138
- ] }) });
139
- }, u = ({
140
- schema: t,
141
- level: s = 0,
142
- defaultOpen: i = !1
143
- }) => {
144
- const n = (r, c) => {
145
- if (r.oneOf || r.allOf || r.anyOf)
146
- return /* @__PURE__ */ e.jsx(T, { schema: r, level: c });
147
- if (r.type === "array" && r.items) {
148
- const o = r.items;
149
- return typeof o.type == "string" && ["string", "number", "boolean", "integer"].includes(o.type) ? /* @__PURE__ */ e.jsx(x, { className: "my-2", children: /* @__PURE__ */ e.jsxs(N, { children: [
150
- /* @__PURE__ */ e.jsx("strong", { children: `array<${o.type}>` }),
151
- r.description && /* @__PURE__ */ e.jsx("p", { children: r.description })
152
- ] }) }) : o.type === "object" || y(o) ? /* @__PURE__ */ e.jsxs(x, { className: "flex flex-col gap-2 bg-border/30 p-4 ", children: [
153
- /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "object[]" }),
154
- n(o, c + 1)
155
- ] }) : n(o, c + 1);
156
- }
157
- if (r.properties) {
158
- const o = L(
159
- Object.entries(r.properties),
160
- ([a, l]) => {
161
- var p;
162
- return l.deprecated ? "deprecated" : (p = r.required) != null && p.includes(a) ? "required" : "optional";
163
- }
164
- ), d = c === 0 && Object.keys(o).length === 1, m = ["required", "optional", "deprecated"];
165
- return /* @__PURE__ */ e.jsx(x, { className: "divide-y overflow-hidden", children: m.map(
166
- (a) => o[a] && /* @__PURE__ */ e.jsx("ul", { className: "divide-y", children: o[a].map(([l, p]) => /* @__PURE__ */ e.jsx(
167
- ee,
168
- {
169
- name: l,
170
- value: p,
171
- group: a,
172
- level: c,
173
- defaultOpen: d || i,
174
- showCollapseButton: !d
175
- },
176
- l
177
- )) }, a)
178
- ) });
179
- }
180
- return r.additionalProperties ? /* @__PURE__ */ e.jsxs(x, { className: "my-2", children: [
181
- /* @__PURE__ */ e.jsx(I, { children: /* @__PURE__ */ e.jsx(R, { children: "Additional Properties:" }) }),
182
- /* @__PURE__ */ e.jsx(N, { children: n(
183
- r.additionalProperties,
184
- c + 1
185
- ) })
186
- ] }) : null;
187
- };
188
- return n(t, s);
189
- }, g = f(
190
- q,
191
- "max-w-full prose-img:max-w-prose"
192
- ), se = ["path", "query", "header", "cookie"], te = ({
193
- operationFragment: t
194
- }) => {
195
- var o, d, m;
196
- const s = Z(re, t), i = L(
197
- s.parameters ?? [],
198
- (a) => a.in
199
- ), n = s.responses.at(0), [r, c] = w(n == null ? void 0 : n.statusCode);
200
- return /* @__PURE__ */ e.jsxs(
201
- "div",
202
- {
203
- className: "grid grid-cols-1 lg:grid-cols-[4fr_3fr] gap-8 items-start border-b-2 mb-16 pb-16",
204
- children: [
205
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
206
- /* @__PURE__ */ e.jsx(h, { level: 2, id: s.slug, registerSidebarAnchor: !0, children: s.summary }),
207
- s.description && /* @__PURE__ */ e.jsx(
208
- j,
209
- {
210
- className: g,
211
- content: s.description
212
- }
213
- ),
214
- s.parameters && s.parameters.length > 0 && /* @__PURE__ */ e.jsx(e.Fragment, { children: se.flatMap(
215
- (a) => {
216
- var l;
217
- return (l = i[a]) != null && l.length ? /* @__PURE__ */ e.jsx(
218
- X,
219
- {
220
- id: s.slug,
221
- parameters: i[a],
222
- group: a
223
- },
224
- a
225
- ) : [];
226
- }
227
- ) }),
228
- C((m = (d = (o = s.requestBody) == null ? void 0 : o.content) == null ? void 0 : d.at(0)) == null ? void 0 : m.schema, (a) => /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
229
- /* @__PURE__ */ e.jsx(h, { level: 3, className: "capitalize", children: "Request Body" }),
230
- /* @__PURE__ */ e.jsx(u, { schema: a })
231
- ] })),
232
- s.responses.length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
233
- /* @__PURE__ */ e.jsx(h, { level: 3, className: "capitalize mt-8 pt-8 border-t", children: "Responses" }),
234
- /* @__PURE__ */ e.jsxs(
235
- k,
236
- {
237
- onValueChange: (a) => c(a),
238
- value: r,
239
- children: [
240
- s.responses.length > 1 && /* @__PURE__ */ e.jsx(H, { children: s.responses.map((a) => /* @__PURE__ */ e.jsx(
241
- $,
242
- {
243
- value: a.statusCode,
244
- title: a.description,
245
- children: a.statusCode
246
- },
247
- a.statusCode
248
- )) }),
249
- /* @__PURE__ */ e.jsx("ul", { className: "list-none m-0 px-0 overflow-hidden", children: s.responses.map((a) => {
250
- var l;
251
- return /* @__PURE__ */ e.jsx(
252
- F,
253
- {
254
- value: a.statusCode,
255
- children: C(
256
- (l = a.content) == null ? void 0 : l.find((p) => p.schema),
257
- (p) => /* @__PURE__ */ e.jsx(u, { schema: p.schema })
258
- ) ?? /* @__PURE__ */ e.jsx(x, { className: "font-mono text-sm p-4 italic bg-border/20", children: "No response body" })
259
- },
260
- a.statusCode
261
- );
262
- }) })
263
- ]
264
- }
265
- )
266
- ] })
267
- ] }),
268
- /* @__PURE__ */ e.jsx(
269
- B,
270
- {
271
- selectedResponse: r,
272
- onSelectResponse: c,
273
- operation: s
274
- }
275
- )
276
- ]
277
- },
278
- s.operationId
279
- );
280
- }, re = P(
281
- /* GraphQL */
282
- `
283
- fragment OperationsFragment on OperationItem {
284
- slug
285
- summary
286
- method
287
- description
288
- operationId
289
- contentTypes
290
- path
291
- parameters {
292
- name
293
- in
294
- description
295
- required
296
- schema
297
- style
298
- examples {
299
- name
300
- description
301
- externalValue
302
- value
303
- summary
304
- }
305
- }
306
- requestBody {
307
- content {
308
- mediaType
309
- encoding {
310
- name
311
- }
312
- schema
313
- }
314
- description
315
- required
316
- }
317
- responses {
318
- statusCode
319
- links
320
- description
321
- content {
322
- mediaType
323
- encoding {
324
- name
325
- }
326
- schema
327
- }
328
- }
329
- }
330
- `
331
- ), ne = P(
332
- /* GraphQL */
333
- `
334
- query AllOperations($input: JSON!, $type: SchemaType!) {
335
- schema(input: $input, type: $type) {
336
- description
337
- title
338
- url
339
- version
340
- tags {
341
- name
342
- description
343
- operations {
344
- slug
345
- ...OperationsFragment
346
- }
347
- }
348
- }
349
- }
350
- `
351
- ), ie = { suspense: !0 }, je = () => {
352
- var r;
353
- const { type: t, input: s } = M(), [i] = J({
354
- query: ne,
355
- variables: { type: t, input: s },
356
- context: ie
357
- }), n = (r = i.error) == null ? void 0 : r.graphQLErrors.at(0);
358
- return n ? /* @__PURE__ */ e.jsx(
359
- z,
360
- {
361
- category: "Error",
362
- title: "Schema cannot be displayed",
363
- message: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
364
- /* @__PURE__ */ e.jsxs(v, { className: "mb-4", children: [
365
- "Check your configuration value ",
366
- /* @__PURE__ */ e.jsx(O, { children: "apis.type" }),
367
- " ",
368
- "and ",
369
- /* @__PURE__ */ e.jsx(O, { children: "apis.input" }),
370
- " in the Zudoku config."
371
- ] }),
372
- "An error occurred while trying to fetch the API reference:",
373
- /* @__PURE__ */ e.jsx(G, { code: n.toString(), language: "plain" })
374
- ] })
375
- }
376
- ) : i.data ? /* @__PURE__ */ e.jsxs("div", { className: "pt-[--padding-content-top]", children: [
377
- /* @__PURE__ */ e.jsxs(
378
- "div",
379
- {
380
- className: f(
381
- g,
382
- "mb-16 max-w-full prose-img:max-w-prose"
383
- ),
384
- children: [
385
- /* @__PURE__ */ e.jsx(b, { children: "Overview" }),
386
- /* @__PURE__ */ e.jsx(h, { level: 1, id: "description", registerSidebarAnchor: !0, children: i.data.schema.title }),
387
- /* @__PURE__ */ e.jsx(j, { content: i.data.schema.description ?? "" })
388
- ]
389
- }
390
- ),
391
- i.data.schema.tags.filter((c) => c.operations.length > 0).map((c) => /* @__PURE__ */ e.jsxs("div", { children: [
392
- c.name && /* @__PURE__ */ e.jsx(b, { children: c.name }),
393
- c.description && /* @__PURE__ */ e.jsx(
394
- j,
395
- {
396
- className: `${g} mt-2 mb-12`,
397
- content: c.description
398
- }
399
- ),
400
- /* @__PURE__ */ e.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ e.jsx(_, { children: c.operations.map((o) => /* @__PURE__ */ e.jsx(
401
- te,
402
- {
403
- operationFragment: o
404
- },
405
- o.slug
406
- )) }) })
407
- ] }, c.name))
408
- ] }) : null;
409
- };
410
- export {
411
- je as OperationList,
412
- re as OperationsFragment
413
- };
414
- //# sourceMappingURL=OperationList-BoB5bkdm.js.map