zudoku 0.16.2 → 0.16.3
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/entry.server.js +4 -5
- package/dist/app/entry.server.js.map +1 -1
- package/dist/lib/components/Header.js +2 -2
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +4 -2
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +1 -4
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +9 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +2 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
- package/dist/lib/ui/ActionButton.d.ts +2 -0
- package/dist/lib/ui/ActionButton.js +10 -0
- package/dist/lib/ui/ActionButton.js.map +1 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
- package/lib/{OperationList-35iw_Gil.js → OperationList-BjppA5yM.js} +116 -113
- package/lib/OperationList-BjppA5yM.js.map +1 -0
- package/lib/{Route-BsEZmkNl.js → Route-D_djzMv3.js} +2 -2
- package/lib/{Route-BsEZmkNl.js.map → Route-D_djzMv3.js.map} +1 -1
- package/lib/{Spinner-C6zroowC.js → SidebarBadge-Bbt92M5K.js} +16 -18
- package/lib/SidebarBadge-Bbt92M5K.js.map +1 -0
- package/lib/Spinner-ChOGyPls.js +51 -0
- package/lib/Spinner-ChOGyPls.js.map +1 -0
- package/lib/{index-BdD8UbS-.js → index-_gtpPhlu.js} +342 -380
- package/lib/index-_gtpPhlu.js.map +1 -0
- package/lib/ui/ActionButton.js +24 -0
- package/lib/ui/ActionButton.js.map +1 -0
- package/lib/urql-core-35Qt_U4i.js +1511 -0
- package/lib/{urql-core-KJnLL26g.js.map → urql-core-35Qt_U4i.js.map} +1 -1
- package/lib/zudoku.components.js +159 -158
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +737 -729
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/package.json +2 -2
- package/src/app/entry.server.tsx +9 -5
- package/src/lib/components/Header.tsx +5 -5
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -8
- package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +17 -3
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +5 -1
- package/src/lib/ui/ActionButton.tsx +28 -0
- package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
- package/lib/OperationList-35iw_Gil.js.map +0 -1
- package/lib/Spinner-C6zroowC.js.map +0 -1
- package/lib/index-BdD8UbS-.js.map +0 -1
- package/lib/urql-core-KJnLL26g.js +0 -1455
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { g as v, u as
|
|
2
|
+
import { g as v, u as I, a as w, S as k, C as $, b as L, E as R } from "./index-_gtpPhlu.js";
|
|
3
3
|
import { C as O } from "./CategoryHeading-Bb9dqxD3.js";
|
|
4
|
-
import { D as
|
|
5
|
-
import { I as b, M as x, H as h, P as u, S as
|
|
4
|
+
import { D as z } from "./DeveloperHint-DHdLXGHA.js";
|
|
5
|
+
import { I as b, M as x, H as h, P as u, S as E } from "./Markdown-BDcCAWwm.js";
|
|
6
6
|
import { c as j } from "./cn-BmFQLtkS.js";
|
|
7
|
-
import { CheckIcon as
|
|
8
|
-
import { useTransition as
|
|
9
|
-
import { a as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { Tabs as
|
|
12
|
-
import { S as
|
|
13
|
-
import { Card as p, CardHeader as
|
|
7
|
+
import { CheckIcon as F, CopyIcon as D, ChevronDownIcon as H, CircleFadingPlusIcon as B, CircleDotIcon as M, CircleIcon as G, SquareMinusIcon as Q, SquarePlusIcon as V, ListPlusIcon as _ } from "lucide-react";
|
|
8
|
+
import { useTransition as J, useState as y, useCallback as K } from "react";
|
|
9
|
+
import { a as U } from "./state-CsuHT8ZO.js";
|
|
10
|
+
import { Button as q } from "./ui/Button.js";
|
|
11
|
+
import { Tabs as W, TabsList as Z, TabsTrigger as X, TabsContent as Y } from "./ui/Tabs.js";
|
|
12
|
+
import { S as ee } from "./StaggeredRender-DDHSzQKE.js";
|
|
13
|
+
import { Card as p, CardHeader as se, CardTitle as te, CardContent as re } from "./ui/Card.js";
|
|
14
14
|
import * as m from "@radix-ui/react-collapsible";
|
|
15
|
-
function
|
|
15
|
+
function ne(t, s) {
|
|
16
16
|
return s;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const ie = v(
|
|
19
19
|
/* GraphQL */
|
|
20
20
|
`
|
|
21
21
|
query ServersQuery($input: JSON!, $type: SchemaType!) {
|
|
@@ -28,26 +28,26 @@ const ae = v(
|
|
|
28
28
|
}
|
|
29
29
|
`
|
|
30
30
|
), S = ({ url: t }) => {
|
|
31
|
-
const [s,
|
|
31
|
+
const [s, i] = y(!1);
|
|
32
32
|
return /* @__PURE__ */ e.jsx(
|
|
33
|
-
|
|
33
|
+
q,
|
|
34
34
|
{
|
|
35
35
|
onClick: () => {
|
|
36
36
|
navigator.clipboard.writeText(t).then(() => {
|
|
37
|
-
|
|
37
|
+
i(!0), setTimeout(() => i(!1), 2e3);
|
|
38
38
|
});
|
|
39
39
|
},
|
|
40
40
|
variant: "ghost",
|
|
41
41
|
size: "icon",
|
|
42
|
-
children: s ? /* @__PURE__ */ e.jsx(
|
|
42
|
+
children: s ? /* @__PURE__ */ e.jsx(F, { className: "text-green-600", size: 14 }) : /* @__PURE__ */ e.jsx(D, { size: 14, strokeWidth: 1.3 })
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
|
-
},
|
|
46
|
-
const [t] =
|
|
47
|
-
query:
|
|
48
|
-
variables:
|
|
49
|
-
context:
|
|
50
|
-
}), [, s] =
|
|
45
|
+
}, ae = { suspense: !0 }, oe = () => {
|
|
46
|
+
const [t] = I({
|
|
47
|
+
query: ie,
|
|
48
|
+
variables: w(),
|
|
49
|
+
context: ae
|
|
50
|
+
}), [, s] = J(), { selectedServer: i, setSelectedServer: n } = U();
|
|
51
51
|
if (!t.data) return null;
|
|
52
52
|
const { servers: r } = t.data.schema;
|
|
53
53
|
return r.length === 1 ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -60,13 +60,13 @@ const ae = v(
|
|
|
60
60
|
":"
|
|
61
61
|
] }),
|
|
62
62
|
/* @__PURE__ */ e.jsx(
|
|
63
|
-
|
|
63
|
+
k,
|
|
64
64
|
{
|
|
65
65
|
className: "font-mono text-xs bg-border/50 dark:bg-border/70 py-1.5 max-w-[450px] truncate",
|
|
66
66
|
onChange: (a) => s(() => {
|
|
67
|
-
|
|
67
|
+
n(a.target.value);
|
|
68
68
|
}),
|
|
69
|
-
value:
|
|
69
|
+
value: i ?? t.data.schema.url,
|
|
70
70
|
showChevrons: r.length > 1,
|
|
71
71
|
options: r.map((a) => ({
|
|
72
72
|
value: a.url,
|
|
@@ -74,59 +74,62 @@ const ae = v(
|
|
|
74
74
|
}))
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
/* @__PURE__ */ e.jsx(S, { url:
|
|
77
|
+
/* @__PURE__ */ e.jsx(S, { url: i ?? t.data.schema.url })
|
|
78
78
|
] });
|
|
79
|
-
},
|
|
80
|
-
(
|
|
81
|
-
const r = s(
|
|
82
|
-
return
|
|
79
|
+
}, P = (t, s) => t.reduce(
|
|
80
|
+
(i, n) => {
|
|
81
|
+
const r = s(n);
|
|
82
|
+
return i[r] || (i[r] = []), i[r].push(n), i;
|
|
83
83
|
},
|
|
84
84
|
{}
|
|
85
|
-
),
|
|
85
|
+
), le = (t, s) => t ? s(t) : void 0, ce = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
|
|
86
86
|
type: "string"
|
|
87
87
|
}, de = ({
|
|
88
88
|
parameter: t,
|
|
89
89
|
group: s,
|
|
90
|
-
id:
|
|
91
|
-
}) =>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
id: i
|
|
91
|
+
}) => {
|
|
92
|
+
const n = ce(t);
|
|
93
|
+
return /* @__PURE__ */ e.jsxs("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1", children: [
|
|
94
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
95
|
+
/* @__PURE__ */ e.jsx("code", { children: s === "path" ? /* @__PURE__ */ e.jsx(
|
|
96
|
+
$,
|
|
97
|
+
{
|
|
98
|
+
name: t.name,
|
|
99
|
+
backgroundOpacity: "15%",
|
|
100
|
+
slug: i + "-" + t.name.toLocaleLowerCase()
|
|
101
|
+
}
|
|
102
|
+
) : t.name }),
|
|
103
|
+
t.required && /* @__PURE__ */ e.jsx("span", { className: "py-px px-1.5 font-medium bg-primary/75 text-muted rounded-lg", children: "required" }),
|
|
104
|
+
n.type && /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: n.type === "array" ? `${n.items.type}[]` : n.type })
|
|
105
|
+
] }),
|
|
106
|
+
t.description && /* @__PURE__ */ e.jsx(
|
|
107
|
+
x,
|
|
95
108
|
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
slug: n + "-" + t.name.toLocaleLowerCase()
|
|
109
|
+
content: t.description,
|
|
110
|
+
className: "text-sm prose-p:my-1 prose-code:whitespace-pre-line"
|
|
99
111
|
}
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
] }),
|
|
104
|
-
t.description && /* @__PURE__ */ e.jsx(
|
|
105
|
-
x,
|
|
106
|
-
{
|
|
107
|
-
content: t.description,
|
|
108
|
-
className: "text-sm prose-p:my-1 prose-code:whitespace-pre-line"
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
] }), pe = ({
|
|
112
|
+
)
|
|
113
|
+
] });
|
|
114
|
+
}, pe = ({
|
|
112
115
|
group: t,
|
|
113
116
|
parameters: s,
|
|
114
|
-
id:
|
|
117
|
+
id: i
|
|
115
118
|
}) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
116
|
-
/* @__PURE__ */ e.jsx(h, { level: 3, id: `${
|
|
117
|
-
/* @__PURE__ */ e.jsx(p, { children: /* @__PURE__ */ e.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: s.sort((
|
|
119
|
+
/* @__PURE__ */ e.jsx(h, { level: 3, id: `${i}/${t}-parameters`, className: "capitalize", children: t === "header" ? "Headers" : `${t} Parameters` }),
|
|
120
|
+
/* @__PURE__ */ e.jsx(p, { 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(
|
|
118
121
|
de,
|
|
119
122
|
{
|
|
120
|
-
parameter:
|
|
121
|
-
id:
|
|
123
|
+
parameter: n,
|
|
124
|
+
id: i,
|
|
122
125
|
group: t
|
|
123
126
|
},
|
|
124
|
-
`${
|
|
127
|
+
`${n.name}-${n.in}`
|
|
125
128
|
)) }) })
|
|
126
129
|
] }), me = (t) => Object.entries(t), xe = {
|
|
127
|
-
AND: /* @__PURE__ */ e.jsx(
|
|
128
|
-
OR: /* @__PURE__ */ e.jsx(
|
|
129
|
-
ONE: /* @__PURE__ */ e.jsx(
|
|
130
|
+
AND: /* @__PURE__ */ e.jsx(B, { size: 16, className: "fill-card" }),
|
|
131
|
+
OR: /* @__PURE__ */ e.jsx(M, { size: 16, className: "fill-card" }),
|
|
132
|
+
ONE: /* @__PURE__ */ e.jsx(G, { size: 14, className: "fill-card" })
|
|
130
133
|
}, ue = {
|
|
131
134
|
AND: "text-green-500 dark:text-green-300/60",
|
|
132
135
|
OR: "text-blue-400 dark:text-blue-500",
|
|
@@ -134,7 +137,7 @@ const ae = v(
|
|
|
134
137
|
}, je = ({
|
|
135
138
|
type: t,
|
|
136
139
|
isOpen: s,
|
|
137
|
-
className:
|
|
140
|
+
className: i
|
|
138
141
|
}) => /* @__PURE__ */ e.jsx(
|
|
139
142
|
"div",
|
|
140
143
|
{
|
|
@@ -142,7 +145,7 @@ const ae = v(
|
|
|
142
145
|
ue[t],
|
|
143
146
|
"relative text-sm flex py-2",
|
|
144
147
|
"before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
|
|
145
|
-
|
|
148
|
+
i
|
|
146
149
|
),
|
|
147
150
|
children: /* @__PURE__ */ e.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
|
|
148
151
|
xe[t],
|
|
@@ -153,18 +156,18 @@ const ae = v(
|
|
|
153
156
|
"translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
|
|
154
157
|
!s && "-rotate-90"
|
|
155
158
|
),
|
|
156
|
-
children: /* @__PURE__ */ e.jsx(
|
|
159
|
+
children: /* @__PURE__ */ e.jsx(H, { size: 16 })
|
|
157
160
|
}
|
|
158
161
|
)
|
|
159
162
|
] })
|
|
160
163
|
}
|
|
161
164
|
), ge = (t) => {
|
|
162
|
-
const [s,
|
|
165
|
+
const [s, i] = y(!0);
|
|
163
166
|
return /* @__PURE__ */ e.jsxs(
|
|
164
167
|
m.Root,
|
|
165
168
|
{
|
|
166
169
|
open: s,
|
|
167
|
-
onOpenChange: () =>
|
|
170
|
+
onOpenChange: () => i((n) => !n),
|
|
168
171
|
className: "group",
|
|
169
172
|
children: [
|
|
170
173
|
/* @__PURE__ */ e.jsx(m.Trigger, { children: /* @__PURE__ */ e.jsx(je, { type: t.type, isOpen: s }) }),
|
|
@@ -180,12 +183,12 @@ const ae = v(
|
|
|
180
183
|
}, fe = ({
|
|
181
184
|
schemas: t,
|
|
182
185
|
type: s,
|
|
183
|
-
isOpen:
|
|
184
|
-
level:
|
|
186
|
+
isOpen: i,
|
|
187
|
+
level: n,
|
|
185
188
|
toggleOpen: r
|
|
186
|
-
}) => /* @__PURE__ */ e.jsx(m.Root, { open:
|
|
189
|
+
}) => /* @__PURE__ */ e.jsx(m.Root, { open: i, onOpenChange: r, asChild: !0, children: /* @__PURE__ */ e.jsxs(p, { className: "px-6", children: [
|
|
187
190
|
/* @__PURE__ */ e.jsxs(m.Trigger, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5", children: [
|
|
188
|
-
|
|
191
|
+
i ? /* @__PURE__ */ e.jsx(Q, { size: 14 }) : /* @__PURE__ */ e.jsx(V, { size: 14 }),
|
|
189
192
|
/* @__PURE__ */ e.jsx("span", { children: he[s] })
|
|
190
193
|
] }),
|
|
191
194
|
/* @__PURE__ */ e.jsx(m.Content, { className: "pb-4", children: t.map((a, l) => (
|
|
@@ -195,7 +198,7 @@ const ae = v(
|
|
|
195
198
|
{
|
|
196
199
|
type: s,
|
|
197
200
|
schema: a,
|
|
198
|
-
level:
|
|
201
|
+
level: n
|
|
199
202
|
},
|
|
200
203
|
l
|
|
201
204
|
)
|
|
@@ -204,11 +207,11 @@ const ae = v(
|
|
|
204
207
|
allOf: "AND",
|
|
205
208
|
anyOf: "OR",
|
|
206
209
|
oneOf: "ONE"
|
|
207
|
-
},
|
|
210
|
+
}, T = ({
|
|
208
211
|
schema: t,
|
|
209
212
|
level: s
|
|
210
213
|
}) => {
|
|
211
|
-
const [
|
|
214
|
+
const [i, n] = y(!0), r = K(() => n((a) => !a), []);
|
|
212
215
|
for (const [a, l] of me(be))
|
|
213
216
|
if (t[a])
|
|
214
217
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -216,7 +219,7 @@ const ae = v(
|
|
|
216
219
|
{
|
|
217
220
|
schemas: t[a],
|
|
218
221
|
type: l,
|
|
219
|
-
isOpen:
|
|
222
|
+
isOpen: i,
|
|
220
223
|
toggleOpen: r,
|
|
221
224
|
level: s
|
|
222
225
|
}
|
|
@@ -224,8 +227,8 @@ const ae = v(
|
|
|
224
227
|
}, Ne = ({
|
|
225
228
|
name: t,
|
|
226
229
|
schema: s,
|
|
227
|
-
group:
|
|
228
|
-
level:
|
|
230
|
+
group: i,
|
|
231
|
+
level: n,
|
|
229
232
|
defaultOpen: r = !1,
|
|
230
233
|
showCollapseButton: a = !0
|
|
231
234
|
}) => {
|
|
@@ -237,7 +240,7 @@ const ae = v(
|
|
|
237
240
|
s.items.type,
|
|
238
241
|
"[]"
|
|
239
242
|
] }) : Array.isArray(s.type) ? /* @__PURE__ */ e.jsx("span", { children: s.type.join(" | ") }) : /* @__PURE__ */ e.jsx("span", { children: s.type }) }),
|
|
240
|
-
|
|
243
|
+
i === "optional" && /* @__PURE__ */ e.jsx("span", { className: "py-px px-1.5 font-medium border rounded-lg", children: "optional" })
|
|
241
244
|
] }),
|
|
242
245
|
s.description && /* @__PURE__ */ e.jsx(
|
|
243
246
|
x,
|
|
@@ -254,18 +257,18 @@ const ae = v(
|
|
|
254
257
|
onOpenChange: () => g(!l),
|
|
255
258
|
children: [
|
|
256
259
|
a && /* @__PURE__ */ e.jsx(m.Trigger, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
257
|
-
|
|
260
|
+
q,
|
|
258
261
|
{
|
|
259
262
|
variant: "outline",
|
|
260
263
|
size: "sm",
|
|
261
264
|
className: "mt-2 flex gap-1.5",
|
|
262
265
|
children: [
|
|
263
|
-
/* @__PURE__ */ e.jsx(
|
|
266
|
+
/* @__PURE__ */ e.jsx(_, { size: 18 }),
|
|
264
267
|
l ? "Hide nested properties" : "Show nested properties"
|
|
265
268
|
]
|
|
266
269
|
}
|
|
267
270
|
) }),
|
|
268
|
-
/* @__PURE__ */ e.jsx(m.Content, { children: /* @__PURE__ */ e.jsx("div", { className: "mt-2", children: N(s) ? /* @__PURE__ */ e.jsx(
|
|
271
|
+
/* @__PURE__ */ e.jsx(m.Content, { children: /* @__PURE__ */ e.jsx("div", { className: "mt-2", children: N(s) ? /* @__PURE__ */ e.jsx(T, { schema: s, level: n + 1 }) : s.type === "object" ? /* @__PURE__ */ e.jsx(f, { schema: s, level: n + 1 }) : s.type === "array" && typeof s.items == "object" && /* @__PURE__ */ e.jsx(f, { schema: s.items, level: n + 1 }) }) })
|
|
269
272
|
]
|
|
270
273
|
}
|
|
271
274
|
)
|
|
@@ -273,13 +276,13 @@ const ae = v(
|
|
|
273
276
|
}, f = ({
|
|
274
277
|
schema: t,
|
|
275
278
|
level: s = 0,
|
|
276
|
-
defaultOpen:
|
|
279
|
+
defaultOpen: i = !1
|
|
277
280
|
}) => {
|
|
278
281
|
if (!t || Object.keys(t).length === 0)
|
|
279
282
|
return /* @__PURE__ */ e.jsx(p, { className: "p-4", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No response specified" }) });
|
|
280
|
-
const
|
|
283
|
+
const n = (r, a) => {
|
|
281
284
|
if (N(r))
|
|
282
|
-
return /* @__PURE__ */ e.jsx(
|
|
285
|
+
return /* @__PURE__ */ e.jsx(T, { schema: r, level: a });
|
|
283
286
|
if (r.type === "array" && r.items) {
|
|
284
287
|
const l = r.items;
|
|
285
288
|
return typeof l.type == "string" && ["string", "number", "boolean", "integer"].includes(l.type) ? /* @__PURE__ */ e.jsxs(p, { className: "p-4", children: [
|
|
@@ -299,8 +302,8 @@ const ae = v(
|
|
|
299
302
|
)
|
|
300
303
|
] }) : l.type === "object" ? /* @__PURE__ */ e.jsxs(p, { className: "flex flex-col gap-2 bg-border/30 p-4", children: [
|
|
301
304
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground", children: "object[]" }),
|
|
302
|
-
|
|
303
|
-
] }) :
|
|
305
|
+
n(l, a + 1)
|
|
306
|
+
] }) : n(l, a + 1);
|
|
304
307
|
}
|
|
305
308
|
if (r.type === "object" && (!r.properties || Object.keys(r.properties).length === 0))
|
|
306
309
|
return /* @__PURE__ */ e.jsxs(p, { className: "p-4 flex gap-2 items-center", children: [
|
|
@@ -318,7 +321,7 @@ const ae = v(
|
|
|
318
321
|
)
|
|
319
322
|
] });
|
|
320
323
|
if (r.properties) {
|
|
321
|
-
const l =
|
|
324
|
+
const l = P(
|
|
322
325
|
Object.entries(r.properties),
|
|
323
326
|
([d, o]) => {
|
|
324
327
|
var c;
|
|
@@ -333,7 +336,7 @@ const ae = v(
|
|
|
333
336
|
schema: c,
|
|
334
337
|
group: d,
|
|
335
338
|
level: a,
|
|
336
|
-
defaultOpen:
|
|
339
|
+
defaultOpen: i
|
|
337
340
|
},
|
|
338
341
|
o
|
|
339
342
|
)) }, d)
|
|
@@ -352,22 +355,22 @@ const ae = v(
|
|
|
352
355
|
}
|
|
353
356
|
)
|
|
354
357
|
] }) : r.additionalProperties ? /* @__PURE__ */ e.jsxs(p, { className: "my-2", children: [
|
|
355
|
-
/* @__PURE__ */ e.jsx(
|
|
356
|
-
/* @__PURE__ */ e.jsx(
|
|
358
|
+
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(te, { children: "Additional Properties:" }) }),
|
|
359
|
+
/* @__PURE__ */ e.jsx(re, { children: n(
|
|
357
360
|
r.additionalProperties,
|
|
358
361
|
a + 1
|
|
359
362
|
) })
|
|
360
363
|
] }) : null;
|
|
361
364
|
};
|
|
362
|
-
return
|
|
365
|
+
return n(t, s);
|
|
363
366
|
}, ve = ["path", "query", "header", "cookie"], Ce = ({
|
|
364
367
|
operationFragment: t
|
|
365
368
|
}) => {
|
|
366
369
|
var l, g, d;
|
|
367
|
-
const s =
|
|
370
|
+
const s = ne(Oe, t), i = P(
|
|
368
371
|
s.parameters ?? [],
|
|
369
372
|
(o) => o.in
|
|
370
|
-
),
|
|
373
|
+
), n = s.responses.at(0), [r, a] = y(n == null ? void 0 : n.statusCode);
|
|
371
374
|
return /* @__PURE__ */ e.jsxs(
|
|
372
375
|
"div",
|
|
373
376
|
{
|
|
@@ -385,18 +388,18 @@ const ae = v(
|
|
|
385
388
|
s.parameters && s.parameters.length > 0 && /* @__PURE__ */ e.jsx(e.Fragment, { children: ve.flatMap(
|
|
386
389
|
(o) => {
|
|
387
390
|
var c;
|
|
388
|
-
return (c =
|
|
391
|
+
return (c = i[o]) != null && c.length ? /* @__PURE__ */ e.jsx(
|
|
389
392
|
pe,
|
|
390
393
|
{
|
|
391
394
|
id: s.slug,
|
|
392
|
-
parameters:
|
|
395
|
+
parameters: i[o],
|
|
393
396
|
group: o
|
|
394
397
|
},
|
|
395
398
|
o
|
|
396
399
|
) : [];
|
|
397
400
|
}
|
|
398
401
|
) }),
|
|
399
|
-
|
|
402
|
+
le((d = (g = (l = s.requestBody) == null ? void 0 : l.content) == null ? void 0 : g.at(0)) == null ? void 0 : d.schema, (o) => /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
|
|
400
403
|
/* @__PURE__ */ e.jsx(
|
|
401
404
|
h,
|
|
402
405
|
{
|
|
@@ -421,13 +424,13 @@ const ae = v(
|
|
|
421
424
|
}
|
|
422
425
|
),
|
|
423
426
|
/* @__PURE__ */ e.jsxs(
|
|
424
|
-
|
|
427
|
+
W,
|
|
425
428
|
{
|
|
426
429
|
onValueChange: (o) => a(o),
|
|
427
430
|
value: r,
|
|
428
431
|
children: [
|
|
429
|
-
s.responses.length > 1 && /* @__PURE__ */ e.jsx(
|
|
430
|
-
|
|
432
|
+
s.responses.length > 1 && /* @__PURE__ */ e.jsx(Z, { children: s.responses.map((o) => /* @__PURE__ */ e.jsx(
|
|
433
|
+
X,
|
|
431
434
|
{
|
|
432
435
|
value: o.statusCode,
|
|
433
436
|
title: o.description ?? void 0,
|
|
@@ -438,13 +441,13 @@ const ae = v(
|
|
|
438
441
|
/* @__PURE__ */ e.jsx("ul", { className: "list-none m-0 px-0", children: s.responses.map((o) => {
|
|
439
442
|
var c, C;
|
|
440
443
|
return /* @__PURE__ */ e.jsx(
|
|
441
|
-
|
|
444
|
+
Y,
|
|
442
445
|
{
|
|
443
446
|
value: o.statusCode,
|
|
444
447
|
children: /* @__PURE__ */ e.jsx(
|
|
445
448
|
f,
|
|
446
449
|
{
|
|
447
|
-
schema: (C = (c = o.content) == null ? void 0 : c.find((
|
|
450
|
+
schema: (C = (c = o.content) == null ? void 0 : c.find((A) => A.schema)) == null ? void 0 : C.schema
|
|
448
451
|
}
|
|
449
452
|
)
|
|
450
453
|
},
|
|
@@ -457,7 +460,7 @@ const ae = v(
|
|
|
457
460
|
] })
|
|
458
461
|
] }),
|
|
459
462
|
/* @__PURE__ */ e.jsx(
|
|
460
|
-
|
|
463
|
+
L,
|
|
461
464
|
{
|
|
462
465
|
selectedResponse: r,
|
|
463
466
|
onSelectResponse: a,
|
|
@@ -555,18 +558,18 @@ const ae = v(
|
|
|
555
558
|
`
|
|
556
559
|
), Ie = { suspense: !0 }, He = () => {
|
|
557
560
|
var r;
|
|
558
|
-
const { type: t, input: s } =
|
|
561
|
+
const { type: t, input: s } = w(), [i] = I({
|
|
559
562
|
query: Se,
|
|
560
563
|
variables: { type: t, input: s },
|
|
561
564
|
context: Ie
|
|
562
|
-
}),
|
|
563
|
-
return
|
|
564
|
-
|
|
565
|
+
}), n = (r = i.error) == null ? void 0 : r.graphQLErrors.at(0);
|
|
566
|
+
return n ? /* @__PURE__ */ e.jsx(
|
|
567
|
+
R,
|
|
565
568
|
{
|
|
566
569
|
category: "Error",
|
|
567
570
|
title: "Schema cannot be displayed",
|
|
568
571
|
message: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
569
|
-
/* @__PURE__ */ e.jsxs(
|
|
572
|
+
/* @__PURE__ */ e.jsxs(z, { className: "mb-4", children: [
|
|
570
573
|
"Check your configuration value ",
|
|
571
574
|
/* @__PURE__ */ e.jsx(b, { children: "apis.type" }),
|
|
572
575
|
" ",
|
|
@@ -575,24 +578,24 @@ const ae = v(
|
|
|
575
578
|
" in the Zudoku config."
|
|
576
579
|
] }),
|
|
577
580
|
"An error occurred while trying to fetch the API reference:",
|
|
578
|
-
/* @__PURE__ */ e.jsx(
|
|
581
|
+
/* @__PURE__ */ e.jsx(E, { code: n.toString(), language: "plain" })
|
|
579
582
|
] })
|
|
580
583
|
}
|
|
581
|
-
) :
|
|
584
|
+
) : i.data ? /* @__PURE__ */ e.jsxs("div", { className: "pt-[--padding-content-top]", children: [
|
|
582
585
|
/* @__PURE__ */ e.jsxs(
|
|
583
586
|
"div",
|
|
584
587
|
{
|
|
585
588
|
className: j(u, "mb-16 max-w-full prose-img:max-w-prose"),
|
|
586
589
|
children: [
|
|
587
590
|
/* @__PURE__ */ e.jsx(O, { children: "Overview" }),
|
|
588
|
-
/* @__PURE__ */ e.jsx(h, { level: 1, id: "description", registerSidebarAnchor: !0, children:
|
|
589
|
-
/* @__PURE__ */ e.jsx(x, { content:
|
|
591
|
+
/* @__PURE__ */ e.jsx(h, { level: 1, id: "description", registerSidebarAnchor: !0, children: i.data.schema.title }),
|
|
592
|
+
/* @__PURE__ */ e.jsx(x, { content: i.data.schema.description ?? "" })
|
|
590
593
|
]
|
|
591
594
|
}
|
|
592
595
|
),
|
|
593
596
|
/* @__PURE__ */ e.jsx("hr", {}),
|
|
594
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ e.jsx(
|
|
595
|
-
|
|
597
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ e.jsx(oe, {}) }),
|
|
598
|
+
i.data.schema.tags.filter((a) => a.operations.length > 0).map((a) => /* @__PURE__ */ e.jsxs("div", { children: [
|
|
596
599
|
a.name && /* @__PURE__ */ e.jsx(O, { children: a.name }),
|
|
597
600
|
a.description && /* @__PURE__ */ e.jsx(
|
|
598
601
|
x,
|
|
@@ -601,7 +604,7 @@ const ae = v(
|
|
|
601
604
|
content: a.description
|
|
602
605
|
}
|
|
603
606
|
),
|
|
604
|
-
/* @__PURE__ */ e.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ e.jsx(
|
|
607
|
+
/* @__PURE__ */ e.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ e.jsx(ee, { children: a.operations.map((l) => /* @__PURE__ */ e.jsx(
|
|
605
608
|
Ce,
|
|
606
609
|
{
|
|
607
610
|
operationFragment: l
|
|
@@ -615,4 +618,4 @@ export {
|
|
|
615
618
|
He as OperationList,
|
|
616
619
|
Oe as OperationsFragment
|
|
617
620
|
};
|
|
618
|
-
//# sourceMappingURL=OperationList-
|
|
621
|
+
//# sourceMappingURL=OperationList-BjppA5yM.js.map
|