zudoku 0.3.1-dev.2 → 0.3.1-dev.21

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