zudoku 0.3.1-dev.1 → 0.3.1-dev.11

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 (55) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/lib/plugins/openapi/OperationList.js +3 -4
  3. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  4. package/dist/lib/plugins/openapi/OperationListItem.js +2 -3
  5. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  6. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  7. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  8. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +2 -2
  9. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  10. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +9 -0
  11. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +14 -0
  12. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -0
  13. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.d.ts +6 -0
  14. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js +17 -0
  15. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js.map +1 -0
  16. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +7 -0
  17. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +10 -0
  18. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -0
  19. package/dist/lib/plugins/openapi/schema/SchemaComponents.d.ts +3 -3
  20. package/dist/lib/plugins/openapi/schema/SchemaComponents.js +15 -15
  21. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
  22. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  23. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  24. package/dist/lib/plugins/openapi/schema/utils.d.ts +6 -0
  25. package/dist/lib/plugins/openapi/schema/utils.js +5 -0
  26. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  27. package/lib/{Input-DB9VROFR.js → Input-CzXNm7xb.js} +2 -1
  28. package/lib/{Input-DB9VROFR.js.map → Input-CzXNm7xb.js.map} +1 -1
  29. package/lib/OperationList-CYyaboNz.js +589 -0
  30. package/lib/OperationList-CYyaboNz.js.map +1 -0
  31. package/lib/{Route-DfAFiR7v.js → Route-C3Jb0axy.js} +2 -2
  32. package/lib/{Route-DfAFiR7v.js.map → Route-C3Jb0axy.js.map} +1 -1
  33. package/lib/{index-D-9zqIOh.js → index-B1he6g8N.js} +532 -514
  34. package/lib/index-B1he6g8N.js.map +1 -0
  35. package/lib/zudoku.plugin-api-keys.js +1 -1
  36. package/lib/zudoku.plugin-openapi.js +1 -1
  37. package/package.json +79 -99
  38. package/src/app/main.css +26 -1
  39. package/src/lib/plugins/openapi/OperationList.tsx +3 -7
  40. package/src/lib/plugins/openapi/OperationListItem.tsx +3 -4
  41. package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -1
  42. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +27 -5
  43. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +47 -0
  44. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.tsx +54 -0
  45. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +30 -0
  46. package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +41 -41
  47. package/src/lib/plugins/openapi/schema/SchemaView.tsx +4 -4
  48. package/src/lib/plugins/openapi/schema/utils.ts +8 -0
  49. package/dist/lib/plugins/openapi/util/prose.d.ts +0 -1
  50. package/dist/lib/plugins/openapi/util/prose.js +0 -4
  51. package/dist/lib/plugins/openapi/util/prose.js.map +0 -1
  52. package/lib/OperationList-Cxiw2Z-v.js +0 -457
  53. package/lib/OperationList-Cxiw2Z-v.js.map +0 -1
  54. package/lib/index-D-9zqIOh.js.map +0 -1
  55. package/src/lib/plugins/openapi/util/prose.ts +0 -7
@@ -0,0 +1,589 @@
1
+ import { j as e } from "./jsx-runtime-B6kdoens.js";
2
+ import { C as k } from "./CategoryHeading-z15xh7Jb.js";
3
+ import { D as A } from "./DeveloperHint-BQSFXH01.js";
4
+ import { C as I, a as d, b as T, c as R, d as z, T as F, e as H, f as $, g as E, S as D, h as P, u as B, E as G } from "./index-B1he6g8N.js";
5
+ import { c as y, h as p, H as g, a as h, P as j, I as w, S as Q } from "./Markdown-CEccPMI_.js";
6
+ import { useState as b, useCallback as V } from "react";
7
+ import { R as O, T as v, C, 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
+ import { j as U } from "./Input-CzXNm7xb.js";
11
+ /**
12
+ * @license lucide-react v0.378.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */
17
+ const Z = y("CircleDot", [
18
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
19
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
20
+ ]);
21
+ /**
22
+ * @license lucide-react v0.378.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */
27
+ const W = y("CircleFadingPlus", [
28
+ ["path", { d: "M12 2a10 10 0 0 1 7.38 16.75", key: "175t95" }],
29
+ ["path", { d: "M12 8v8", key: "napkw2" }],
30
+ ["path", { d: "M16 12H8", key: "1fr5h0" }],
31
+ ["path", { d: "M2.5 8.875a10 10 0 0 0-.5 3", key: "1vce0s" }],
32
+ ["path", { d: "M2.83 16a10 10 0 0 0 2.43 3.4", key: "o3fkw4" }],
33
+ ["path", { d: "M4.636 5.235a10 10 0 0 1 .891-.857", key: "1szpfk" }],
34
+ ["path", { d: "M8.644 21.42a10 10 0 0 0 7.631-.38", key: "9yhvd4" }]
35
+ ]);
36
+ /**
37
+ * @license lucide-react v0.378.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */
42
+ const X = y("Circle", [
43
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
44
+ ]);
45
+ /**
46
+ * @license lucide-react v0.378.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */
51
+ const Y = y("ListPlus", [
52
+ ["path", { d: "M11 12H3", key: "51ecnj" }],
53
+ ["path", { d: "M16 6H3", key: "1wxfjs" }],
54
+ ["path", { d: "M16 18H3", key: "12xzn7" }],
55
+ ["path", { d: "M18 9v6", key: "1twb98" }],
56
+ ["path", { d: "M21 12h-6", key: "bt1uis" }]
57
+ ]);
58
+ /**
59
+ * @license lucide-react v0.378.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */
64
+ const ee = y("SquareMinus", [
65
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
66
+ ["path", { d: "M8 12h8", key: "1wcyev" }]
67
+ ]);
68
+ /**
69
+ * @license lucide-react v0.378.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */
74
+ const se = y("SquarePlus", [
75
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
76
+ ["path", { d: "M8 12h8", key: "1wcyev" }],
77
+ ["path", { d: "M12 8v8", key: "napkw2" }]
78
+ ]);
79
+ function te(t, s) {
80
+ return s;
81
+ }
82
+ const M = (t, s) => t.reduce(
83
+ (n, a) => {
84
+ const r = s(a);
85
+ return n[r] || (n[r] = []), n[r].push(a), n;
86
+ },
87
+ {}
88
+ ), re = (t, s) => t ? s(t) : void 0, S = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
89
+ type: "string"
90
+ }, ne = ({
91
+ parameter: t,
92
+ group: s,
93
+ id: n
94
+ }) => /* @__PURE__ */ e.jsxs("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1", children: [
95
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
96
+ /* @__PURE__ */ e.jsx("code", { children: s === "path" ? /* @__PURE__ */ e.jsx(
97
+ I,
98
+ {
99
+ name: t.name,
100
+ backgroundOpacity: "15%",
101
+ slug: n + "-" + t.name.toLocaleLowerCase()
102
+ }
103
+ ) : t.name }),
104
+ t.required && /* @__PURE__ */ e.jsx("span", { className: "py-px px-1.5 font-medium bg-primary/75 text-muted rounded-lg", children: "required" }),
105
+ S(t).type && /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: S(t).type })
106
+ ] }),
107
+ t.description && /* @__PURE__ */ e.jsx(
108
+ p,
109
+ {
110
+ content: t.description,
111
+ className: "text-sm prose-p:my-1 prose-code:whitespace-pre-line"
112
+ }
113
+ )
114
+ ] }), ae = ({
115
+ group: t,
116
+ parameters: s,
117
+ id: n
118
+ }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
119
+ /* @__PURE__ */ e.jsx(g, { level: 3, id: `${n}/${t}-parameters`, className: "capitalize", children: t === "header" ? "Headers" : `${t} Parameters` }),
120
+ /* @__PURE__ */ e.jsx(d, { children: /* @__PURE__ */ e.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: s.sort((a, r) => a.required === r.required ? 0 : a.required ? -1 : 1).map((a) => /* @__PURE__ */ e.jsx(
121
+ ne,
122
+ {
123
+ parameter: a,
124
+ id: n,
125
+ group: t
126
+ },
127
+ `${a.name}-${a.in}`
128
+ )) }) })
129
+ ] }), ie = (t) => Object.entries(t), oe = {
130
+ AND: /* @__PURE__ */ e.jsx(W, { size: 16, className: "fill-card" }),
131
+ OR: /* @__PURE__ */ e.jsx(Z, { size: 16, className: "fill-card" }),
132
+ ONE: /* @__PURE__ */ e.jsx(X, { size: 14, className: "fill-card" })
133
+ }, le = {
134
+ AND: "text-green-500 dark:text-green-300/60",
135
+ OR: "text-blue-400 dark:text-blue-500",
136
+ ONE: "text-purple-500 dark:text-purple-300/60"
137
+ }, ce = ({
138
+ type: t,
139
+ isOpen: s,
140
+ className: n
141
+ }) => /* @__PURE__ */ e.jsx(
142
+ "div",
143
+ {
144
+ className: h(
145
+ le[t],
146
+ "relative text-sm flex py-2",
147
+ "before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
148
+ n
149
+ ),
150
+ children: /* @__PURE__ */ e.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
151
+ oe[t],
152
+ /* @__PURE__ */ e.jsx(
153
+ "div",
154
+ {
155
+ className: h(
156
+ "translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
157
+ !s && "-rotate-90"
158
+ ),
159
+ children: /* @__PURE__ */ e.jsx(U, { size: 16 })
160
+ }
161
+ )
162
+ ] })
163
+ }
164
+ ), de = (t) => {
165
+ const [s, n] = b(!0);
166
+ return /* @__PURE__ */ e.jsxs(
167
+ O,
168
+ {
169
+ open: s,
170
+ onOpenChange: () => n((a) => !a),
171
+ className: "group",
172
+ children: [
173
+ /* @__PURE__ */ e.jsx(v, { children: /* @__PURE__ */ e.jsx(ce, { type: t.type, isOpen: s }) }),
174
+ !s && /* @__PURE__ */ e.jsx("div", { className: "wavy-line bg-border translate-y-1" }),
175
+ /* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(f, { schema: t.schema, level: t.level + 1 }) })
176
+ ]
177
+ }
178
+ );
179
+ }, pe = {
180
+ AND: "All of",
181
+ OR: "Any of",
182
+ ONE: "One of"
183
+ }, me = ({
184
+ schemas: t,
185
+ type: s,
186
+ isOpen: n,
187
+ level: a,
188
+ toggleOpen: r
189
+ }) => /* @__PURE__ */ e.jsx(O, { open: n, onOpenChange: r, asChild: !0, children: /* @__PURE__ */ e.jsxs(d, { className: "px-6", children: [
190
+ /* @__PURE__ */ e.jsxs(v, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5", children: [
191
+ n ? /* @__PURE__ */ e.jsx(ee, { size: 14 }) : /* @__PURE__ */ e.jsx(se, { size: 14 }),
192
+ /* @__PURE__ */ e.jsx("span", { children: pe[s] })
193
+ ] }),
194
+ /* @__PURE__ */ e.jsx(C, { className: "pb-4", children: t.map((i, l) => (
195
+ // eslint-disable-next-line react/no-array-index-key
196
+ /* @__PURE__ */ e.jsx(
197
+ de,
198
+ {
199
+ type: s,
200
+ schema: i,
201
+ level: a
202
+ },
203
+ l
204
+ )
205
+ )) })
206
+ ] }) }), xe = (t) => t.type === "object" || t.type === "array" && typeof t.items == "object" && (!t.items.type || t.items.type === "object"), N = (t) => !!(t.oneOf ?? t.allOf ?? t.anyOf), ue = {
207
+ allOf: "AND",
208
+ anyOf: "OR",
209
+ oneOf: "ONE"
210
+ }, q = ({
211
+ schema: t,
212
+ level: s
213
+ }) => {
214
+ const [n, a] = b(!0), r = V(() => a((i) => !i), []);
215
+ for (const [i, l] of ie(ue))
216
+ if (t[i])
217
+ return /* @__PURE__ */ e.jsx(
218
+ me,
219
+ {
220
+ schemas: t[i],
221
+ type: l,
222
+ isOpen: n,
223
+ toggleOpen: r,
224
+ level: s
225
+ }
226
+ );
227
+ }, he = ({
228
+ name: t,
229
+ schema: s,
230
+ group: n,
231
+ level: a,
232
+ defaultOpen: r = !1,
233
+ showCollapseButton: i = !0
234
+ }) => {
235
+ var x;
236
+ const [l, m] = b(r);
237
+ 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: [
238
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
239
+ /* @__PURE__ */ e.jsx("code", { children: t }),
240
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: s.type === "array" && ((x = s.items) != null && x.type) ? /* @__PURE__ */ e.jsxs("span", { children: [
241
+ s.items.type,
242
+ "[]"
243
+ ] }) : Array.isArray(s.type) ? /* @__PURE__ */ e.jsx("span", { children: s.type.join(" | ") }) : /* @__PURE__ */ e.jsx("span", { children: s.type }) }),
244
+ n === "optional" && /* @__PURE__ */ e.jsx("span", { className: "py-px px-1.5 font-medium border rounded-lg", children: "optional" })
245
+ ] }),
246
+ s.description && /* @__PURE__ */ e.jsx(
247
+ p,
248
+ {
249
+ className: h(j, "text-sm leading-normal line-clamp-4"),
250
+ content: s.description
251
+ }
252
+ ),
253
+ (N(s) || xe(s)) && /* @__PURE__ */ e.jsxs(
254
+ O,
255
+ {
256
+ defaultOpen: r,
257
+ open: l,
258
+ onOpenChange: () => m(!l),
259
+ children: [
260
+ i && /* @__PURE__ */ e.jsx(v, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
261
+ K,
262
+ {
263
+ variant: "outline",
264
+ size: "sm",
265
+ className: "mt-2 flex gap-1.5",
266
+ children: [
267
+ /* @__PURE__ */ e.jsx(Y, { size: 18 }),
268
+ l ? "Hide nested properties" : "Show nested properties"
269
+ ]
270
+ }
271
+ ) }),
272
+ /* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx("div", { className: "mt-2", children: N(s) ? /* @__PURE__ */ e.jsx(q, { schema: s, level: a + 1 }) : s.type === "object" ? /* @__PURE__ */ e.jsx(f, { schema: s, level: a + 1 }) : s.type === "array" && typeof s.items == "object" && /* @__PURE__ */ e.jsx(f, { schema: s.items, level: a + 1 }) }) })
273
+ ]
274
+ }
275
+ )
276
+ ] }) });
277
+ }, f = ({
278
+ schema: t,
279
+ level: s = 0,
280
+ defaultOpen: n = !1
281
+ }) => {
282
+ if (!t || Object.keys(t).length === 0)
283
+ return /* @__PURE__ */ e.jsx(d, { className: "p-4", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No response specified" }) });
284
+ const a = (r, i) => {
285
+ if (r.oneOf || r.allOf || r.anyOf)
286
+ return /* @__PURE__ */ e.jsx(q, { schema: r, level: i });
287
+ if (r.type === "array" && r.items) {
288
+ const l = r.items;
289
+ return typeof l.type == "string" && ["string", "number", "boolean", "integer"].includes(l.type) ? /* @__PURE__ */ e.jsxs(d, { className: "p-4", children: [
290
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm text-muted-foreground", children: [
291
+ l.type,
292
+ "[]"
293
+ ] }),
294
+ r.description && /* @__PURE__ */ e.jsx(
295
+ p,
296
+ {
297
+ className: h(
298
+ j,
299
+ "text-sm leading-normal line-clamp-4"
300
+ ),
301
+ content: r.description
302
+ }
303
+ )
304
+ ] }) : l.type === "object" || N(l) ? /* @__PURE__ */ e.jsxs(d, { className: "flex flex-col gap-2 bg-border/30 p-4", children: [
305
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "object[]" }),
306
+ a(l, i + 1)
307
+ ] }) : a(l, i + 1);
308
+ }
309
+ if (r.type === "object" && !r.properties)
310
+ return /* @__PURE__ */ e.jsxs(d, { className: "p-4 flex gap-2 items-center", children: [
311
+ "name" in r && /* @__PURE__ */ e.jsx(e.Fragment, { children: r.name }),
312
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "object" }),
313
+ r.description && /* @__PURE__ */ e.jsx(
314
+ p,
315
+ {
316
+ className: h(
317
+ j,
318
+ "text-sm leading-normal line-clamp-4"
319
+ ),
320
+ content: r.description
321
+ }
322
+ )
323
+ ] });
324
+ if (r.properties) {
325
+ const l = M(
326
+ Object.entries(r.properties),
327
+ ([o, c]) => {
328
+ var u;
329
+ return c.deprecated ? "deprecated" : (u = r.required) != null && u.includes(o) ? "required" : "optional";
330
+ }
331
+ ), m = i === 0 && Object.keys(l).length === 1, x = ["required", "optional", "deprecated"];
332
+ return /* @__PURE__ */ e.jsx(d, { className: "divide-y overflow-hidden", children: x.map(
333
+ (o) => l[o] && /* @__PURE__ */ e.jsx("ul", { className: "divide-y", children: l[o].map(([c, u]) => /* @__PURE__ */ e.jsx(
334
+ he,
335
+ {
336
+ name: c,
337
+ schema: u,
338
+ group: o,
339
+ level: i,
340
+ defaultOpen: m || n,
341
+ showCollapseButton: !m
342
+ },
343
+ c
344
+ )) }, o)
345
+ ) });
346
+ }
347
+ return typeof r.type == "string" && ["string", "number", "boolean", "integer", "null"].includes(r.type) ? /* @__PURE__ */ e.jsxs(d, { className: "p-4", children: [
348
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: r.type }),
349
+ r.description && /* @__PURE__ */ e.jsx(
350
+ p,
351
+ {
352
+ className: h(
353
+ j,
354
+ "text-sm leading-normal line-clamp-4"
355
+ ),
356
+ content: r.description
357
+ }
358
+ )
359
+ ] }) : r.additionalProperties ? /* @__PURE__ */ e.jsxs(d, { className: "my-2", children: [
360
+ /* @__PURE__ */ e.jsx(T, { children: /* @__PURE__ */ e.jsx(R, { children: "Additional Properties:" }) }),
361
+ /* @__PURE__ */ e.jsx(z, { children: a(
362
+ r.additionalProperties,
363
+ i + 1
364
+ ) })
365
+ ] }) : null;
366
+ };
367
+ return a(t, s);
368
+ }, je = ["path", "query", "header", "cookie"], ye = ({
369
+ operationFragment: t
370
+ }) => {
371
+ var l, m, x;
372
+ const s = te(ge, t), n = M(
373
+ s.parameters ?? [],
374
+ (o) => o.in
375
+ ), a = s.responses.at(0), [r, i] = b(a == null ? void 0 : a.statusCode);
376
+ return /* @__PURE__ */ e.jsxs(
377
+ "div",
378
+ {
379
+ className: "grid grid-cols-1 lg:grid-cols-[4fr_3fr] gap-8 items-start border-b-2 mb-16 pb-16",
380
+ children: [
381
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
382
+ /* @__PURE__ */ e.jsx(g, { level: 2, id: s.slug, registerSidebarAnchor: !0, children: s.summary }),
383
+ s.description && /* @__PURE__ */ e.jsx(
384
+ p,
385
+ {
386
+ className: `${j} max-w-full prose-img:max-w-prose`,
387
+ content: s.description
388
+ }
389
+ ),
390
+ s.parameters && s.parameters.length > 0 && /* @__PURE__ */ e.jsx(e.Fragment, { children: je.flatMap(
391
+ (o) => {
392
+ var c;
393
+ return (c = n[o]) != null && c.length ? /* @__PURE__ */ e.jsx(
394
+ ae,
395
+ {
396
+ id: s.slug,
397
+ parameters: n[o],
398
+ group: o
399
+ },
400
+ o
401
+ ) : [];
402
+ }
403
+ ) }),
404
+ re((x = (m = (l = s.requestBody) == null ? void 0 : l.content) == null ? void 0 : m.at(0)) == null ? void 0 : x.schema, (o) => /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
405
+ /* @__PURE__ */ e.jsx(g, { level: 3, className: "capitalize", children: "Request Body" }),
406
+ /* @__PURE__ */ e.jsx(f, { schema: o })
407
+ ] })),
408
+ s.responses.length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
409
+ /* @__PURE__ */ e.jsx(g, { level: 3, className: "capitalize mt-8 pt-8 border-t", children: "Responses" }),
410
+ /* @__PURE__ */ e.jsxs(
411
+ F,
412
+ {
413
+ onValueChange: (o) => i(o),
414
+ value: r,
415
+ children: [
416
+ s.responses.length > 1 && /* @__PURE__ */ e.jsx(H, { children: s.responses.map((o) => /* @__PURE__ */ e.jsx(
417
+ $,
418
+ {
419
+ value: o.statusCode,
420
+ title: o.description,
421
+ children: o.statusCode
422
+ },
423
+ o.statusCode
424
+ )) }),
425
+ /* @__PURE__ */ e.jsx("ul", { className: "list-none m-0 px-0", children: s.responses.map((o) => {
426
+ var c, u;
427
+ return /* @__PURE__ */ e.jsx(
428
+ E,
429
+ {
430
+ value: o.statusCode,
431
+ children: /* @__PURE__ */ e.jsx(
432
+ f,
433
+ {
434
+ schema: (u = (c = o.content) == null ? void 0 : c.find((L) => L.schema)) == null ? void 0 : u.schema
435
+ }
436
+ )
437
+ },
438
+ o.statusCode
439
+ );
440
+ }) })
441
+ ]
442
+ }
443
+ )
444
+ ] })
445
+ ] }),
446
+ /* @__PURE__ */ e.jsx(
447
+ D,
448
+ {
449
+ selectedResponse: r,
450
+ onSelectResponse: i,
451
+ operation: s
452
+ }
453
+ )
454
+ ]
455
+ },
456
+ s.operationId
457
+ );
458
+ }, ge = P(
459
+ /* GraphQL */
460
+ `
461
+ fragment OperationsFragment on OperationItem {
462
+ slug
463
+ summary
464
+ method
465
+ description
466
+ operationId
467
+ contentTypes
468
+ path
469
+ parameters {
470
+ name
471
+ in
472
+ description
473
+ required
474
+ schema
475
+ style
476
+ examples {
477
+ name
478
+ description
479
+ externalValue
480
+ value
481
+ summary
482
+ }
483
+ }
484
+ requestBody {
485
+ content {
486
+ mediaType
487
+ encoding {
488
+ name
489
+ }
490
+ schema
491
+ }
492
+ description
493
+ required
494
+ }
495
+ responses {
496
+ statusCode
497
+ links
498
+ description
499
+ content {
500
+ mediaType
501
+ encoding {
502
+ name
503
+ }
504
+ schema
505
+ }
506
+ }
507
+ }
508
+ `
509
+ ), fe = P(
510
+ /* GraphQL */
511
+ `
512
+ query AllOperations($input: JSON!, $type: SchemaType!) {
513
+ schema(input: $input, type: $type) {
514
+ description
515
+ title
516
+ url
517
+ version
518
+ tags {
519
+ name
520
+ description
521
+ operations {
522
+ slug
523
+ ...OperationsFragment
524
+ }
525
+ }
526
+ }
527
+ }
528
+ `
529
+ ), be = { suspense: !0 }, Le = () => {
530
+ var r;
531
+ const { type: t, input: s } = B(), [n] = J({
532
+ query: fe,
533
+ variables: { type: t, input: s },
534
+ context: be
535
+ }), a = (r = n.error) == null ? void 0 : r.graphQLErrors.at(0);
536
+ return a ? /* @__PURE__ */ e.jsx(
537
+ G,
538
+ {
539
+ category: "Error",
540
+ title: "Schema cannot be displayed",
541
+ message: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
542
+ /* @__PURE__ */ e.jsxs(A, { className: "mb-4", children: [
543
+ "Check your configuration value ",
544
+ /* @__PURE__ */ e.jsx(w, { children: "apis.type" }),
545
+ " ",
546
+ "and ",
547
+ /* @__PURE__ */ e.jsx(w, { children: "apis.input" }),
548
+ " in the Zudoku config."
549
+ ] }),
550
+ "An error occurred while trying to fetch the API reference:",
551
+ /* @__PURE__ */ e.jsx(Q, { code: a.toString(), language: "plain" })
552
+ ] })
553
+ }
554
+ ) : n.data ? /* @__PURE__ */ e.jsxs("div", { className: "pt-[--padding-content-top]", children: [
555
+ /* @__PURE__ */ e.jsxs(
556
+ "div",
557
+ {
558
+ className: h(j, "mb-16 max-w-full prose-img:max-w-prose"),
559
+ children: [
560
+ /* @__PURE__ */ e.jsx(k, { children: "Overview" }),
561
+ /* @__PURE__ */ e.jsx(g, { level: 1, id: "description", registerSidebarAnchor: !0, children: n.data.schema.title }),
562
+ /* @__PURE__ */ e.jsx(p, { content: n.data.schema.description ?? "" })
563
+ ]
564
+ }
565
+ ),
566
+ n.data.schema.tags.filter((i) => i.operations.length > 0).map((i) => /* @__PURE__ */ e.jsxs("div", { children: [
567
+ i.name && /* @__PURE__ */ e.jsx(k, { children: i.name }),
568
+ i.description && /* @__PURE__ */ e.jsx(
569
+ p,
570
+ {
571
+ className: `${j} max-w-full prose-img:max-w-prose w-full mt-2 mb-12`,
572
+ content: i.description
573
+ }
574
+ ),
575
+ /* @__PURE__ */ e.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ e.jsx(_, { children: i.operations.map((l) => /* @__PURE__ */ e.jsx(
576
+ ye,
577
+ {
578
+ operationFragment: l
579
+ },
580
+ l.slug
581
+ )) }) })
582
+ ] }, i.name))
583
+ ] }) : null;
584
+ };
585
+ export {
586
+ Le as OperationList,
587
+ ge as OperationsFragment
588
+ };
589
+ //# sourceMappingURL=OperationList-CYyaboNz.js.map