zudoku 0.7.2-dev.14 → 0.8.0

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 (70) hide show
  1. package/lib/AuthenticationPlugin-Bx9FK124.js +55 -0
  2. package/lib/{AuthenticationPlugin-BMjOjKqE.js.map → AuthenticationPlugin-Bx9FK124.js.map} +1 -1
  3. package/lib/CategoryHeading-XnFqN2lJ.js +10 -0
  4. package/lib/{CategoryHeading-BE8e6QdS.js.map → CategoryHeading-XnFqN2lJ.js.map} +1 -1
  5. package/lib/DeveloperHint-FBb2uXJe.js +16 -0
  6. package/lib/{DeveloperHint-Bl9gIdNI.js.map → DeveloperHint-FBb2uXJe.js.map} +1 -1
  7. package/lib/ErrorPage-knunPbKI.js +18 -0
  8. package/lib/{ErrorPage-CPR1XVKW.js.map → ErrorPage-knunPbKI.js.map} +1 -1
  9. package/lib/Input-BEDZAKw0.js +2198 -0
  10. package/lib/{Input-BBlyeDuG.js.map → Input-BEDZAKw0.js.map} +1 -1
  11. package/lib/{Markdown-CCNihH_N.js → Markdown-B4aR03g6.js} +2650 -2641
  12. package/lib/{Markdown-CCNihH_N.js.map → Markdown-B4aR03g6.js.map} +1 -1
  13. package/lib/MdxPage-BZyQsH8Z.js +172 -0
  14. package/lib/{MdxPage-BavkYqzi.js.map → MdxPage-BZyQsH8Z.js.map} +1 -1
  15. package/lib/OperationList-2NeWEM0u.js +560 -0
  16. package/lib/{OperationList-C6Ps2keZ.js.map → OperationList-2NeWEM0u.js.map} +1 -1
  17. package/lib/Route-BZPewmrN.js +14 -0
  18. package/lib/{Route-xRJ9mJgH.js.map → Route-BZPewmrN.js.map} +1 -1
  19. package/lib/{SidebarBadge-2JcxswKF.js → SidebarBadge-COz0hgfa.js} +41 -41
  20. package/lib/{SidebarBadge-2JcxswKF.js.map → SidebarBadge-COz0hgfa.js.map} +1 -1
  21. package/lib/SlotletProvider-DJMaOUDs.js +238 -0
  22. package/lib/{SlotletProvider-CuB3Ts8r.js.map → SlotletProvider-DJMaOUDs.js.map} +1 -1
  23. package/lib/Spinner-3cQDBVGr.js +7 -0
  24. package/lib/Spinner-3cQDBVGr.js.map +1 -0
  25. package/lib/{ZudokuContext-JoyeA9dT.js → ZudokuContext-cr-pTRY1.js} +66 -65
  26. package/lib/{ZudokuContext-JoyeA9dT.js.map → ZudokuContext-cr-pTRY1.js.map} +1 -1
  27. package/lib/{index-G1-TGLO1.js → index-1EDgIO6b.js} +4 -4
  28. package/lib/{index-G1-TGLO1.js.map → index-1EDgIO6b.js.map} +1 -1
  29. package/lib/index-BG0g4WW0.js +1771 -0
  30. package/lib/index-BG0g4WW0.js.map +1 -0
  31. package/lib/{index-BF4cn28H.js → index-Dv2KZuEw.js} +1991 -1804
  32. package/lib/{index-BF4cn28H.js.map → index-Dv2KZuEw.js.map} +1 -1
  33. package/lib/{index-BLvMkqjO.js → index-Zezcv0xb.js} +5 -5
  34. package/lib/{index-BLvMkqjO.js.map → index-Zezcv0xb.js.map} +1 -1
  35. package/lib/jsx-runtime-B6kdoens.js +635 -0
  36. package/lib/jsx-runtime-B6kdoens.js.map +1 -0
  37. package/lib/{utils-B8R4grFM.js → utils-ByIc_KIM.js} +98 -97
  38. package/lib/{utils-B8R4grFM.js.map → utils-ByIc_KIM.js.map} +1 -1
  39. package/lib/zudoku.auth-auth0.js +21 -16
  40. package/lib/zudoku.auth-auth0.js.map +1 -1
  41. package/lib/zudoku.auth-clerk.js +37 -32
  42. package/lib/zudoku.auth-clerk.js.map +1 -1
  43. package/lib/zudoku.auth-openid.js +505 -485
  44. package/lib/zudoku.auth-openid.js.map +1 -1
  45. package/lib/zudoku.components.js +1659 -1531
  46. package/lib/zudoku.components.js.map +1 -1
  47. package/lib/zudoku.plugin-api-keys.js +214 -150
  48. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  49. package/lib/zudoku.plugin-custom-page.js +6 -5
  50. package/lib/zudoku.plugin-custom-page.js.map +1 -1
  51. package/lib/zudoku.plugin-markdown.js +13 -12
  52. package/lib/zudoku.plugin-markdown.js.map +1 -1
  53. package/lib/zudoku.plugin-openapi.js +8 -7
  54. package/lib/zudoku.plugin-openapi.js.map +1 -1
  55. package/lib/zudoku.plugin-search-inkeep.js +21 -20
  56. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  57. package/package.json +1 -1
  58. package/lib/AuthenticationPlugin-BMjOjKqE.js +0 -54
  59. package/lib/CategoryHeading-BE8e6QdS.js +0 -9
  60. package/lib/DeveloperHint-Bl9gIdNI.js +0 -12
  61. package/lib/ErrorPage-CPR1XVKW.js +0 -12
  62. package/lib/Input-BBlyeDuG.js +0 -2192
  63. package/lib/MdxPage-BavkYqzi.js +0 -140
  64. package/lib/OperationList-C6Ps2keZ.js +0 -460
  65. package/lib/Route-xRJ9mJgH.js +0 -13
  66. package/lib/SlotletProvider-CuB3Ts8r.js +0 -213
  67. package/lib/Spinner-BlxzaFFF.js +0 -6
  68. package/lib/Spinner-BlxzaFFF.js.map +0 -1
  69. package/lib/jsx-runtime-lNnQYwFN.js +0 -2403
  70. package/lib/jsx-runtime-lNnQYwFN.js.map +0 -1
@@ -1,140 +0,0 @@
1
- import { A as w, u as k, a as A, H as T, b as P } from "./utils-B8R4grFM.js";
2
- import { L as E } from "./jsx-runtime-lNnQYwFN.js";
3
- import { C } from "./CategoryHeading-BE8e6QdS.js";
4
- import { u as H, a as m, P as S, H as u } from "./Markdown-CCNihH_N.js";
5
- import { s as I } from "./slugify-DbLhpSPt.js";
6
- import { ListTreeIcon as L } from "lucide-react";
7
- import { useRef as f, useState as _, useEffect as $ } from "react";
8
- const y = "data-active", v = ({
9
- item: a,
10
- children: e,
11
- className: t,
12
- isActive: c
13
- }) => /* @__PURE__ */ React.createElement(
14
- "li",
15
- {
16
- className: m(
17
- "truncate",
18
- c ? "text-primary" : "text-foreground/65 dark:text-foreground/75",
19
- t
20
- ),
21
- title: a.value
22
- },
23
- /* @__PURE__ */ React.createElement(
24
- w,
25
- {
26
- to: `#${a.id}`,
27
- [y]: a.id,
28
- className: m(
29
- c ? "text-primary" : "text-foreground/65 dark:text-foreground/75 hover:text-foreground"
30
- )
31
- },
32
- a.value
33
- ),
34
- e
35
- ), M = ({ entries: a }) => {
36
- const { activeAnchor: e } = H(), t = f(null), c = f(!1), [d, l] = _({
37
- top: 0,
38
- opacity: 0
39
- });
40
- return $(() => {
41
- if (!t.current) return;
42
- const r = t.current.querySelector(
43
- `[${y}='${e}']`
44
- );
45
- if (!r) {
46
- l({ top: 0, opacity: 0 });
47
- return;
48
- }
49
- const n = t.current.getBoundingClientRect().top, p = r.getBoundingClientRect().top;
50
- l({
51
- opacity: 1,
52
- top: `${p - n}px`
53
- }), !c.current && requestIdleCallback(() => {
54
- c.current = !0;
55
- });
56
- }, [e]), /* @__PURE__ */ React.createElement("aside", { className: "sticky scrollbar top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 font-medium mb-2" }, /* @__PURE__ */ React.createElement(L, { size: 16 }), "On this page"), /* @__PURE__ */ React.createElement("div", { className: "relative ms-2 ps-4" }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 right-auto bg-border w-[2px]" }), /* @__PURE__ */ React.createElement(
57
- "div",
58
- {
59
- className: m(
60
- "absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary",
61
- c.current && "ease-out [transition:top_150ms,opacity_325ms]"
62
- ),
63
- style: d
64
- }
65
- ), /* @__PURE__ */ React.createElement(
66
- "ul",
67
- {
68
- ref: t,
69
- className: "relative font-medium list-none space-y-2"
70
- },
71
- a.map((r) => /* @__PURE__ */ React.createElement(
72
- v,
73
- {
74
- isActive: r.id === e,
75
- key: r.id,
76
- item: r,
77
- className: "pl-0"
78
- },
79
- r.children && /* @__PURE__ */ React.createElement("ul", { className: "list-none pl-4 pt-2 space-y-2" }, r.children.map((n) => /* @__PURE__ */ React.createElement(
80
- v,
81
- {
82
- item: n,
83
- isActive: n.id === e,
84
- key: n.id
85
- }
86
- )))
87
- ))
88
- )));
89
- }, j = {
90
- h2: ({ children: a, id: e }) => /* @__PURE__ */ React.createElement(u, { level: 2, id: e, registerSidebarAnchor: !0 }, a),
91
- h3: ({ children: a, id: e }) => /* @__PURE__ */ React.createElement(u, { level: 3, id: e, registerSidebarAnchor: !0 }, a)
92
- }, X = ({
93
- mdxComponent: a,
94
- frontmatter: e = {},
95
- defaultOptions: t,
96
- tableOfContents: c
97
- }) => {
98
- var x, R, h;
99
- const d = (x = k()) == null ? void 0 : x.categoryLabel, l = e.title, r = e.category ?? d, n = e.toc === !1 || (t == null ? void 0 : t.toc) === !1, p = ((R = c.find((s) => s.depth === 1)) == null ? void 0 : R.value) ?? l, b = e.disablePager ?? (t == null ? void 0 : t.disablePager) ?? !1, g = ((h = c.find((s) => s.depth === 1)) == null ? void 0 : h.children) ?? // if `title` is provided by frontmatter it does not appear in the table of contents
100
- c.filter((s) => s.depth === 2), N = !n && g.length > 0, { prev: o, next: i } = A();
101
- return /* @__PURE__ */ React.createElement("div", { className: "xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between" }, /* @__PURE__ */ React.createElement(T, null, /* @__PURE__ */ React.createElement("title", null, p)), /* @__PURE__ */ React.createElement(
102
- "div",
103
- {
104
- className: m(
105
- S,
106
- "max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]"
107
- )
108
- },
109
- /* @__PURE__ */ React.createElement("header", null, r && /* @__PURE__ */ React.createElement(C, null, r), l && /* @__PURE__ */ React.createElement(u, { level: 1, id: I(l, { lower: !0 }) }, l)),
110
- /* @__PURE__ */ React.createElement(
111
- a,
112
- {
113
- components: { ...P(), ...j }
114
- }
115
- ),
116
- !b && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("hr", null), /* @__PURE__ */ React.createElement("div", { className: "not-prose flex flex-wrap items-center justify-between gap-2 lg:gap-8" }, o ? /* @__PURE__ */ React.createElement(
117
- E,
118
- {
119
- to: o.id,
120
- className: "flex flex-col items-stretch gap-2 flex-1 min-w-max border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md",
121
- title: o.label
122
- },
123
- /* @__PURE__ */ React.createElement("div", { className: "text-sm text-muted-foreground" }, "← Previous page"),
124
- /* @__PURE__ */ React.createElement("div", { className: "text-lg text-primary truncate" }, o.label)
125
- ) : /* @__PURE__ */ React.createElement("div", { className: "flex-1" }), i ? /* @__PURE__ */ React.createElement(
126
- E,
127
- {
128
- to: i.id,
129
- className: "flex flex-col items-stretch gap-2 flex-1 min-w-max border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md",
130
- title: i.label
131
- },
132
- /* @__PURE__ */ React.createElement("div", { className: "text-sm text-muted-foreground" }, "Next page →"),
133
- /* @__PURE__ */ React.createElement("div", { className: "text-lg text-primary truncate" }, i.label)
134
- ) : /* @__PURE__ */ React.createElement("div", { className: "flex-1" })))
135
- ), /* @__PURE__ */ React.createElement("div", { className: "hidden xl:block" }, N && /* @__PURE__ */ React.createElement(M, { entries: g })));
136
- };
137
- export {
138
- X as MdxPage
139
- };
140
- //# sourceMappingURL=MdxPage-BavkYqzi.js.map
@@ -1,460 +0,0 @@
1
- import { C as v } from "./CategoryHeading-BE8e6QdS.js";
2
- import { D as w } from "./DeveloperHint-Bl9gIdNI.js";
3
- import { E as P } from "./ErrorPage-CPR1XVKW.js";
4
- import { I as f, M as p, H as E, a as d, P as u, S as A } from "./Markdown-CCNihH_N.js";
5
- import { CheckIcon as j, CopyIcon as T, ChevronDownIcon as L, CircleFadingPlusIcon as z, CircleDotIcon as $, CircleIcon as F, SquareMinusIcon as D, SquarePlusIcon as H, ListPlusIcon as B } from "lucide-react";
6
- import { useState as y, useCallback as M } from "react";
7
- import { C as G, a as m, b as Q, c as V, d as _, T as J, e as K, f as U, g as W, S as Z, h as S, u as X } from "./index-BF4cn28H.js";
8
- import { R as b, T as N, C, S as Y } from "./index-G1-TGLO1.js";
9
- import { u as ee } from "./urql-YhcsXYy8.js";
10
- import { B as te } from "./index-BLvMkqjO.js";
11
- function ae(t, e) {
12
- return e;
13
- }
14
- const ne = ({ url: t }) => {
15
- const [e, n] = y(!1);
16
- return /* @__PURE__ */ React.createElement("div", { className: "my-4 flex items-center justify-end gap-2 text-sm" }, /* @__PURE__ */ React.createElement("span", { className: "font-medium" }, "Endpoint:"), /* @__PURE__ */ React.createElement(f, { className: "p-1.5 flex gap-2.5 items-center text-xs" }, t, /* @__PURE__ */ React.createElement(
17
- "button",
18
- {
19
- onClick: () => {
20
- navigator.clipboard.writeText(t).then(() => {
21
- n(!0), setTimeout(() => n(!1), 2e3);
22
- });
23
- },
24
- type: "button"
25
- },
26
- e ? /* @__PURE__ */ React.createElement(j, { className: "text-green-600", size: 14 }) : /* @__PURE__ */ React.createElement(T, { size: 14, strokeWidth: 1.3 })
27
- )));
28
- }, k = (t, e) => t.reduce(
29
- (n, r) => {
30
- const a = e(r);
31
- return n[a] || (n[a] = []), n[a].push(r), n;
32
- },
33
- {}
34
- ), re = (t, e) => t ? e(t) : void 0, h = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
35
- type: "string"
36
- }, ce = ({
37
- parameter: t,
38
- group: e,
39
- id: n
40
- }) => /* @__PURE__ */ React.createElement("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement("code", null, e === "path" ? /* @__PURE__ */ React.createElement(
41
- G,
42
- {
43
- name: t.name,
44
- backgroundOpacity: "15%",
45
- slug: n + "-" + t.name.toLocaleLowerCase()
46
- }
47
- ) : t.name), t.required && /* @__PURE__ */ React.createElement("span", { className: "py-px px-1.5 font-medium bg-primary/75 text-muted rounded-lg" }, "required"), h(t).type && /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground" }, h(t).type)), t.description && /* @__PURE__ */ React.createElement(
48
- p,
49
- {
50
- content: t.description,
51
- className: "text-sm prose-p:my-1 prose-code:whitespace-pre-line"
52
- }
53
- )), se = ({
54
- group: t,
55
- parameters: e,
56
- id: n
57
- }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(E, { level: 3, id: `${n}/${t}-parameters`, className: "capitalize" }, t === "header" ? "Headers" : `${t} Parameters`), /* @__PURE__ */ React.createElement(m, null, /* @__PURE__ */ React.createElement("ul", { className: "list-none m-0 px-0 divide-y " }, e.sort((r, a) => r.required === a.required ? 0 : r.required ? -1 : 1).map((r) => /* @__PURE__ */ React.createElement(
58
- ce,
59
- {
60
- key: `${r.name}-${r.in}`,
61
- parameter: r,
62
- id: n,
63
- group: t
64
- }
65
- ))))), le = (t) => Object.entries(t), oe = {
66
- AND: /* @__PURE__ */ React.createElement(z, { size: 16, className: "fill-card" }),
67
- OR: /* @__PURE__ */ React.createElement($, { size: 16, className: "fill-card" }),
68
- ONE: /* @__PURE__ */ React.createElement(F, { size: 14, className: "fill-card" })
69
- }, ie = {
70
- AND: "text-green-500 dark:text-green-300/60",
71
- OR: "text-blue-400 dark:text-blue-500",
72
- ONE: "text-purple-500 dark:text-purple-300/60"
73
- }, me = ({
74
- type: t,
75
- isOpen: e,
76
- className: n
77
- }) => /* @__PURE__ */ React.createElement(
78
- "div",
79
- {
80
- className: d(
81
- ie[t],
82
- "relative text-sm flex py-2",
83
- "before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
84
- n
85
- )
86
- },
87
- /* @__PURE__ */ React.createElement("div", { className: "-translate-x-[7px] flex gap-1 items-center" }, oe[t], /* @__PURE__ */ React.createElement(
88
- "div",
89
- {
90
- className: d(
91
- "translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
92
- !e && "-rotate-90"
93
- )
94
- },
95
- /* @__PURE__ */ React.createElement(L, { size: 16 })
96
- ))
97
- ), pe = (t) => {
98
- const [e, n] = y(!0);
99
- return /* @__PURE__ */ React.createElement(
100
- b,
101
- {
102
- open: e,
103
- onOpenChange: () => n((r) => !r),
104
- className: "group"
105
- },
106
- /* @__PURE__ */ React.createElement(N, null, /* @__PURE__ */ React.createElement(me, { type: t.type, isOpen: e })),
107
- !e && /* @__PURE__ */ React.createElement("div", { className: "wavy-line bg-border translate-y-1" }),
108
- /* @__PURE__ */ React.createElement(C, null, /* @__PURE__ */ React.createElement(g, { schema: t.schema, level: t.level + 1 }))
109
- );
110
- }, de = {
111
- AND: "All of",
112
- OR: "Any of",
113
- ONE: "One of"
114
- }, ue = ({
115
- schemas: t,
116
- type: e,
117
- isOpen: n,
118
- level: r,
119
- toggleOpen: a
120
- }) => /* @__PURE__ */ React.createElement(b, { open: n, onOpenChange: a, asChild: !0 }, /* @__PURE__ */ React.createElement(m, { className: "px-6" }, /* @__PURE__ */ React.createElement(N, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5" }, n ? /* @__PURE__ */ React.createElement(D, { size: 14 }) : /* @__PURE__ */ React.createElement(H, { size: 14 }), /* @__PURE__ */ React.createElement("span", null, de[e])), /* @__PURE__ */ React.createElement(C, { className: "pb-4" }, t.map((c, l) => (
121
- // eslint-disable-next-line react/no-array-index-key
122
- /* @__PURE__ */ React.createElement(
123
- pe,
124
- {
125
- key: l,
126
- type: e,
127
- schema: c,
128
- level: r
129
- }
130
- )
131
- ))))), Re = (t) => t.type === "object" || t.type === "array" && typeof t.items == "object" && (!t.items.type || t.items.type === "object"), x = (t) => !!(t.oneOf ?? t.allOf ?? t.anyOf), Ee = {
132
- allOf: "AND",
133
- anyOf: "OR",
134
- oneOf: "ONE"
135
- }, I = ({
136
- schema: t,
137
- level: e
138
- }) => {
139
- const [n, r] = y(!0), a = M(() => r((c) => !c), []);
140
- for (const [c, l] of le(Ee))
141
- if (t[c])
142
- return /* @__PURE__ */ React.createElement(
143
- ue,
144
- {
145
- schemas: t[c],
146
- type: l,
147
- isOpen: n,
148
- toggleOpen: a,
149
- level: e
150
- }
151
- );
152
- }, ge = ({
153
- name: t,
154
- schema: e,
155
- group: n,
156
- level: r,
157
- defaultOpen: a = !1,
158
- showCollapseButton: c = !0
159
- }) => {
160
- const [l, R] = y(a);
161
- return /* @__PURE__ */ React.createElement("li", { className: "p-4 bg-border/20 hover:bg-border/30" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1 justify-between text-sm" }, /* @__PURE__ */ React.createElement("div", { className: "flex gap-2 items-center" }, /* @__PURE__ */ React.createElement("code", null, t), /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground" }, e.type === "array" && e.items.type ? /* @__PURE__ */ React.createElement("span", null, e.items.type, "[]") : Array.isArray(e.type) ? /* @__PURE__ */ React.createElement("span", null, e.type.join(" | ")) : /* @__PURE__ */ React.createElement("span", null, e.type)), n === "optional" && /* @__PURE__ */ React.createElement("span", { className: "py-px px-1.5 font-medium border rounded-lg" }, "optional")), e.description && /* @__PURE__ */ React.createElement(
162
- p,
163
- {
164
- className: d(u, "text-sm leading-normal line-clamp-4"),
165
- content: e.description
166
- }
167
- ), (x(e) || Re(e)) && /* @__PURE__ */ React.createElement(
168
- b,
169
- {
170
- defaultOpen: a,
171
- open: l,
172
- onOpenChange: () => R(!l)
173
- },
174
- c && /* @__PURE__ */ React.createElement(N, { asChild: !0 }, /* @__PURE__ */ React.createElement(
175
- te,
176
- {
177
- variant: "outline",
178
- size: "sm",
179
- className: "mt-2 flex gap-1.5"
180
- },
181
- /* @__PURE__ */ React.createElement(B, { size: 18 }),
182
- l ? "Hide nested properties" : "Show nested properties"
183
- )),
184
- /* @__PURE__ */ React.createElement(C, null, /* @__PURE__ */ React.createElement("div", { className: "mt-2" }, x(e) ? /* @__PURE__ */ React.createElement(I, { schema: e, level: r + 1 }) : e.type === "object" ? /* @__PURE__ */ React.createElement(g, { schema: e, level: r + 1 }) : e.type === "array" && typeof e.items == "object" && /* @__PURE__ */ React.createElement(g, { schema: e.items, level: r + 1 })))
185
- )));
186
- }, g = ({
187
- schema: t,
188
- level: e = 0,
189
- defaultOpen: n = !1
190
- }) => {
191
- if (!t || Object.keys(t).length === 0)
192
- return /* @__PURE__ */ React.createElement(m, { className: "p-4" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm text-muted-foreground italic" }, "No response specified"));
193
- const r = (a, c) => {
194
- if (x(a))
195
- return /* @__PURE__ */ React.createElement(I, { schema: a, level: c });
196
- if (a.type === "array" && a.items) {
197
- const l = a.items;
198
- return typeof l.type == "string" && ["string", "number", "boolean", "integer"].includes(l.type) ? /* @__PURE__ */ React.createElement(m, { className: "p-4" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm text-muted-foreground" }, l.type, "[]"), a.description && /* @__PURE__ */ React.createElement(
199
- p,
200
- {
201
- className: d(
202
- u,
203
- "text-sm leading-normal line-clamp-4"
204
- ),
205
- content: a.description
206
- }
207
- )) : l.type === "object" ? /* @__PURE__ */ React.createElement(m, { className: "flex flex-col gap-2 bg-border/30 p-4" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm text-muted-foreground" }, "object[]"), r(l, c + 1)) : r(l, c + 1);
208
- }
209
- if (a.type === "object" && !a.properties)
210
- return /* @__PURE__ */ React.createElement(m, { className: "p-4 flex gap-2 items-center" }, "name" in a && /* @__PURE__ */ React.createElement(React.Fragment, null, a.name), /* @__PURE__ */ React.createElement("span", { className: "text-sm text-muted-foreground" }, "object"), a.description && /* @__PURE__ */ React.createElement(
211
- p,
212
- {
213
- className: d(
214
- u,
215
- "text-sm leading-normal line-clamp-4"
216
- ),
217
- content: a.description
218
- }
219
- ));
220
- if (a.properties) {
221
- const l = k(
222
- Object.entries(a.properties),
223
- ([i, s]) => {
224
- var o;
225
- return s.deprecated ? "deprecated" : (o = a.required) != null && o.includes(i) ? "required" : "optional";
226
- }
227
- ), R = ["required", "optional", "deprecated"];
228
- return /* @__PURE__ */ React.createElement(m, { className: "divide-y overflow-hidden" }, R.map(
229
- (i) => l[i] && /* @__PURE__ */ React.createElement("ul", { key: i, className: "divide-y" }, l[i].map(([s, o]) => /* @__PURE__ */ React.createElement(
230
- ge,
231
- {
232
- key: s,
233
- name: s,
234
- schema: o,
235
- group: i,
236
- level: c,
237
- defaultOpen: n
238
- }
239
- )))
240
- ));
241
- }
242
- return typeof a.type == "string" && ["string", "number", "boolean", "integer", "null"].includes(a.type) ? /* @__PURE__ */ React.createElement(m, { className: "p-4" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm text-muted-foreground" }, a.type), a.description && /* @__PURE__ */ React.createElement(
243
- p,
244
- {
245
- className: d(
246
- u,
247
- "text-sm leading-normal line-clamp-4"
248
- ),
249
- content: a.description
250
- }
251
- )) : a.additionalProperties ? /* @__PURE__ */ React.createElement(m, { className: "my-2" }, /* @__PURE__ */ React.createElement(Q, null, /* @__PURE__ */ React.createElement(V, null, "Additional Properties:")), /* @__PURE__ */ React.createElement(_, null, r(
252
- a.additionalProperties,
253
- c + 1
254
- ))) : null;
255
- };
256
- return r(t, e);
257
- }, ye = ["path", "query", "header", "cookie"], fe = ({
258
- operationFragment: t
259
- }) => {
260
- var l, R, i;
261
- const e = ae(xe, t), n = k(
262
- e.parameters ?? [],
263
- (s) => s.in
264
- ), r = e.responses.at(0), [a, c] = y(r == null ? void 0 : r.statusCode);
265
- return /* @__PURE__ */ React.createElement(
266
- "div",
267
- {
268
- key: e.operationId,
269
- className: "grid grid-cols-1 lg:grid-cols-[4fr_3fr] gap-8 items-start border-b-2 mb-16 pb-16"
270
- },
271
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React.createElement(E, { level: 2, id: e.slug, registerSidebarAnchor: !0 }, e.summary), e.description && /* @__PURE__ */ React.createElement(
272
- p,
273
- {
274
- className: `${u} max-w-full prose-img:max-w-prose`,
275
- content: e.description
276
- }
277
- ), e.parameters && e.parameters.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, ye.flatMap(
278
- (s) => {
279
- var o;
280
- return (o = n[s]) != null && o.length ? /* @__PURE__ */ React.createElement(
281
- se,
282
- {
283
- key: s,
284
- id: e.slug,
285
- parameters: n[s],
286
- group: s
287
- }
288
- ) : [];
289
- }
290
- )), re((i = (R = (l = e.requestBody) == null ? void 0 : l.content) == null ? void 0 : R.at(0)) == null ? void 0 : i.schema, (s) => /* @__PURE__ */ React.createElement("div", { className: "mt-4 flex flex-col gap-4" }, /* @__PURE__ */ React.createElement(
291
- E,
292
- {
293
- level: 3,
294
- className: "capitalize",
295
- id: `${e.slug}/request-body`,
296
- registerSidebarAnchor: !0
297
- },
298
- "Request Body"
299
- ), /* @__PURE__ */ React.createElement(g, { schema: s }))), e.responses.length > 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
300
- E,
301
- {
302
- level: 3,
303
- className: "capitalize mt-8 pt-8 border-t",
304
- id: `${e.slug}/responses`,
305
- registerSidebarAnchor: !0
306
- },
307
- "Responses"
308
- ), /* @__PURE__ */ React.createElement(
309
- J,
310
- {
311
- onValueChange: (s) => c(s),
312
- value: a
313
- },
314
- e.responses.length > 1 && /* @__PURE__ */ React.createElement(K, null, e.responses.map((s) => /* @__PURE__ */ React.createElement(
315
- U,
316
- {
317
- value: s.statusCode,
318
- key: s.statusCode,
319
- title: s.description
320
- },
321
- s.statusCode
322
- ))),
323
- /* @__PURE__ */ React.createElement("ul", { className: "list-none m-0 px-0" }, e.responses.map((s) => {
324
- var o, O;
325
- return /* @__PURE__ */ React.createElement(
326
- W,
327
- {
328
- value: s.statusCode,
329
- key: s.statusCode
330
- },
331
- /* @__PURE__ */ React.createElement(
332
- g,
333
- {
334
- schema: (O = (o = s.content) == null ? void 0 : o.find((q) => q.schema)) == null ? void 0 : O.schema
335
- }
336
- )
337
- );
338
- }))
339
- ))),
340
- /* @__PURE__ */ React.createElement(
341
- Z,
342
- {
343
- selectedResponse: a,
344
- onSelectResponse: c,
345
- operation: e
346
- }
347
- )
348
- );
349
- }, xe = S(
350
- /* GraphQL */
351
- `
352
- fragment OperationsFragment on OperationItem {
353
- slug
354
- summary
355
- method
356
- description
357
- operationId
358
- contentTypes
359
- path
360
- parameters {
361
- name
362
- in
363
- description
364
- required
365
- schema
366
- style
367
- examples {
368
- name
369
- description
370
- externalValue
371
- value
372
- summary
373
- }
374
- }
375
- requestBody {
376
- content {
377
- mediaType
378
- encoding {
379
- name
380
- }
381
- schema
382
- }
383
- description
384
- required
385
- }
386
- responses {
387
- statusCode
388
- links
389
- description
390
- content {
391
- mediaType
392
- encoding {
393
- name
394
- }
395
- schema
396
- }
397
- }
398
- }
399
- `
400
- ), be = S(
401
- /* GraphQL */
402
- `
403
- query AllOperations($input: JSON!, $type: SchemaType!) {
404
- schema(input: $input, type: $type) {
405
- description
406
- title
407
- url
408
- version
409
- tags {
410
- name
411
- description
412
- operations {
413
- slug
414
- ...OperationsFragment
415
- }
416
- }
417
- }
418
- }
419
- `
420
- ), Ne = { suspense: !0 }, Ae = () => {
421
- var a;
422
- const { type: t, input: e } = X(), [n] = ee({
423
- query: be,
424
- variables: { type: t, input: e },
425
- context: Ne
426
- }), r = (a = n.error) == null ? void 0 : a.graphQLErrors.at(0);
427
- return r ? /* @__PURE__ */ React.createElement(
428
- P,
429
- {
430
- category: "Error",
431
- title: "Schema cannot be displayed",
432
- message: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(w, { className: "mb-4" }, "Check your configuration value ", /* @__PURE__ */ React.createElement(f, null, "apis.type"), " ", "and ", /* @__PURE__ */ React.createElement(f, null, "apis.input"), " in the Zudoku config."), "An error occurred while trying to fetch the API reference:", /* @__PURE__ */ React.createElement(A, { code: r.toString(), language: "plain" }))
433
- }
434
- ) : n.data ? /* @__PURE__ */ React.createElement("div", { className: "pt-[--padding-content-top]" }, /* @__PURE__ */ React.createElement(
435
- "div",
436
- {
437
- className: d(u, "mb-16 max-w-full prose-img:max-w-prose")
438
- },
439
- /* @__PURE__ */ React.createElement(v, null, "Overview"),
440
- /* @__PURE__ */ React.createElement(E, { level: 1, id: "description", registerSidebarAnchor: !0 }, n.data.schema.title),
441
- /* @__PURE__ */ React.createElement(p, { content: n.data.schema.description ?? "" })
442
- ), /* @__PURE__ */ React.createElement("hr", null), /* @__PURE__ */ React.createElement(ne, { url: n.data.schema.url }), n.data.schema.tags.filter((c) => c.operations.length > 0).map((c) => /* @__PURE__ */ React.createElement("div", { key: c.name }, c.name && /* @__PURE__ */ React.createElement(v, null, c.name), c.description && /* @__PURE__ */ React.createElement(
443
- p,
444
- {
445
- className: `${u} max-w-full prose-img:max-w-prose w-full mt-2 mb-12`,
446
- content: c.description
447
- }
448
- ), /* @__PURE__ */ React.createElement("div", { className: "operation mb-12" }, /* @__PURE__ */ React.createElement(Y, null, c.operations.map((l) => /* @__PURE__ */ React.createElement(
449
- fe,
450
- {
451
- key: l.slug,
452
- operationFragment: l
453
- }
454
- ))))))) : null;
455
- };
456
- export {
457
- Ae as OperationList,
458
- xe as OperationsFragment
459
- };
460
- //# sourceMappingURL=OperationList-C6Ps2keZ.js.map
@@ -1,13 +0,0 @@
1
- import { O as r } from "./index-BF4cn28H.js";
2
- import { P as a } from "./urql-YhcsXYy8.js";
3
- import { O as o } from "./jsx-runtime-lNnQYwFN.js";
4
- function l({
5
- config: e,
6
- client: t
7
- }) {
8
- return /* @__PURE__ */ React.createElement(a, { value: t }, /* @__PURE__ */ React.createElement(r, { value: { config: e } }, /* @__PURE__ */ React.createElement(o, null)));
9
- }
10
- export {
11
- l as OpenApiRoute
12
- };
13
- //# sourceMappingURL=Route-xRJ9mJgH.js.map