zudoku 0.9.0 → 0.11.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.
- package/README.md +121 -0
- package/dist/config/config.d.ts +2 -6
- package/dist/config/validators/InputSidebarSchema.d.ts +1 -0
- package/dist/config/validators/validate.d.ts +151 -37
- package/dist/config/validators/validate.js +14 -11
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/authentication/state.d.ts +16 -0
- package/dist/lib/authentication/state.js +5 -0
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/InlineCode.d.ts +2 -1
- package/dist/lib/components/InlineCode.js +9 -1
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/oas/graphql/index.d.ts +2 -1
- package/dist/lib/oas/graphql/index.js +22 -10
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -0
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +2 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.js +8 -6
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/lib/plugins/markdown/index.js +2 -2
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -3
- package/dist/lib/plugins/openapi/Endpoint.js +46 -8
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -2
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +14 -3
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.d.ts +2 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +10 -2
- package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +29 -3
- package/dist/lib/plugins/openapi/graphql/graphql.js +87 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +2 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +12 -4
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js +3 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
- package/dist/vite/config.d.ts +1 -1
- package/dist/vite/config.js +7 -3
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.d.ts +1 -0
- package/dist/vite/dev-server.js +7 -13
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +4 -7
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +9 -4
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-docs.js +7 -5
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -0
- package/dist/vite/plugin-frontmatter.js +30 -0
- package/dist/vite/plugin-frontmatter.js.map +1 -0
- package/dist/vite/plugin-sidebar.js +14 -1
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{CategoryHeading-XnFqN2lJ.js → CategoryHeading-ovR-zHRq.js} +2 -2
- package/lib/{CategoryHeading-XnFqN2lJ.js.map → CategoryHeading-ovR-zHRq.js.map} +1 -1
- package/lib/{DeveloperHint-FBb2uXJe.js → DeveloperHint-YeWHKvyr.js} +2 -2
- package/lib/{DeveloperHint-FBb2uXJe.js.map → DeveloperHint-YeWHKvyr.js.map} +1 -1
- package/lib/{ErrorPage-knunPbKI.js → ErrorPage-Dri5_2lr.js} +3 -3
- package/lib/{ErrorPage-knunPbKI.js.map → ErrorPage-Dri5_2lr.js.map} +1 -1
- package/lib/{Input-BEDZAKw0.js → Input-CtVUl3eT.js} +3 -3
- package/lib/{Input-BEDZAKw0.js.map → Input-CtVUl3eT.js.map} +1 -1
- package/lib/{Markdown-B4aR03g6.js → Markdown-DapSf3wG.js} +795 -793
- package/lib/Markdown-DapSf3wG.js.map +1 -0
- package/lib/{MdxPage-BZyQsH8Z.js → MdxPage-BqBWsXZ1.js} +23 -23
- package/lib/MdxPage-BqBWsXZ1.js.map +1 -0
- package/lib/{OperationList-2NeWEM0u.js → OperationList-JAQF5-tn.js} +151 -109
- package/lib/OperationList-JAQF5-tn.js.map +1 -0
- package/lib/{Route-BZPewmrN.js → Route-DSANUy5e.js} +2 -2
- package/lib/{Route-BZPewmrN.js.map → Route-DSANUy5e.js.map} +1 -1
- package/lib/{SidebarBadge-COz0hgfa.js → SidebarBadge-Dx7jtnoA.js} +3 -3
- package/lib/{SidebarBadge-COz0hgfa.js.map → SidebarBadge-Dx7jtnoA.js.map} +1 -1
- package/lib/{SlotletProvider-DJMaOUDs.js → SlotletProvider-D3UD5Go3.js} +4 -4
- package/lib/{SlotletProvider-DJMaOUDs.js.map → SlotletProvider-D3UD5Go3.js.map} +1 -1
- package/lib/assets/{worker-BvD7B6MG.js → worker-Bcj4NA2p.js} +3430 -1351
- package/lib/assets/worker-Bcj4NA2p.js.map +1 -0
- package/lib/index-Bn6Lc9tq.js +9 -0
- package/lib/index-Bn6Lc9tq.js.map +1 -0
- package/lib/{index-1EDgIO6b.js → index-BngPzhKn.js} +3 -3
- package/lib/{index-1EDgIO6b.js.map → index-BngPzhKn.js.map} +1 -1
- package/lib/{index-Zezcv0xb.js → index-Dolisrci.js} +3 -3
- package/lib/{index-Zezcv0xb.js.map → index-Dolisrci.js.map} +1 -1
- package/lib/{index-Dv2KZuEw.js → index-DyJyULzS.js} +1774 -1643
- package/lib/index-DyJyULzS.js.map +1 -0
- package/lib/index-LNp6rxyU.js +2094 -0
- package/lib/index-LNp6rxyU.js.map +1 -0
- package/lib/state-hNe1dw4B.js +548 -0
- package/lib/state-hNe1dw4B.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +4 -4
- package/lib/zudoku.components.js +6 -6
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +497 -489
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-custom-page.js +1 -1
- package/lib/zudoku.plugin-markdown.js +18 -15
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/package.json +14 -4
- package/src/lib/authentication/state.ts +17 -0
- package/src/lib/components/InlineCode.tsx +10 -0
- package/src/lib/components/Layout.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +33 -13
- package/src/lib/oas/parser/index.ts +1 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
- package/src/lib/plugins/markdown/generateRoutes.tsx +8 -5
- package/src/lib/plugins/markdown/index.tsx +3 -1
- package/src/lib/plugins/openapi/Endpoint.tsx +86 -22
- package/src/lib/plugins/openapi/OperationList.tsx +3 -1
- package/src/lib/plugins/openapi/OperationListItem.tsx +1 -1
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +3 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +17 -2
- package/src/lib/plugins/openapi/SimpleSelect.tsx +10 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +11 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +116 -4
- package/src/lib/plugins/openapi/interfaces.ts +4 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +38 -4
- package/src/lib/plugins/openapi/playground/createUrl.ts +6 -1
- package/dist/lib/util/slugify.d.ts +0 -2
- package/dist/lib/util/slugify.js +0 -3
- package/dist/lib/util/slugify.js.map +0 -1
- package/dist/vite/plugin-icons.d.ts +0 -3
- package/dist/vite/plugin-icons.js +0 -47
- package/dist/vite/plugin-icons.js.map +0 -1
- package/lib/Markdown-B4aR03g6.js.map +0 -1
- package/lib/MdxPage-BZyQsH8Z.js.map +0 -1
- package/lib/OperationList-2NeWEM0u.js.map +0 -1
- package/lib/assets/worker-BvD7B6MG.js.map +0 -1
- package/lib/index-Dv2KZuEw.js.map +0 -1
- package/lib/slugify-DbLhpSPt.js +0 -28
- package/lib/slugify-DbLhpSPt.js.map +0 -1
- package/lib/state-lIwt9isb.js +0 -288
- package/lib/state-lIwt9isb.js.map +0 -1
- package/src/lib/util/slugify.ts +0 -3
|
@@ -1,53 +1,95 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { C as
|
|
3
|
-
import { D as
|
|
4
|
-
import { E as
|
|
5
|
-
import { I as y, M as m, H as
|
|
6
|
-
import { CheckIcon as
|
|
7
|
-
import { useState as f, useCallback as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { u as se } from "./
|
|
11
|
-
import {
|
|
12
|
-
|
|
2
|
+
import { C as I } from "./CategoryHeading-ovR-zHRq.js";
|
|
3
|
+
import { D as z } from "./DeveloperHint-YeWHKvyr.js";
|
|
4
|
+
import { E as R } from "./ErrorPage-Dri5_2lr.js";
|
|
5
|
+
import { I as y, M as m, H as h, a as x, P as u, S as E } from "./Markdown-DapSf3wG.js";
|
|
6
|
+
import { CheckIcon as F, CopyIcon as B, ChevronDownIcon as D, CircleFadingPlusIcon as H, CircleDotIcon as M, CircleIcon as G, SquareMinusIcon as Q, SquarePlusIcon as V, ListPlusIcon as _ } from "lucide-react";
|
|
7
|
+
import { useTransition as J, useState as f, useCallback as K } from "react";
|
|
8
|
+
import { a as U } from "./state-hNe1dw4B.js";
|
|
9
|
+
import { B as P } from "./index-Dolisrci.js";
|
|
10
|
+
import { g as N, u as T, S as W, C as Z, a as p, b as X, c as Y, d as ee, T as se, e as te, f as re, h as ne, i as ie } from "./index-DyJyULzS.js";
|
|
11
|
+
import { u as A } from "./urql-YhcsXYy8.js";
|
|
12
|
+
import { R as v, T as C, C as O, S as ae } from "./index-BngPzhKn.js";
|
|
13
|
+
function oe(t, s) {
|
|
13
14
|
return s;
|
|
14
15
|
}
|
|
15
|
-
const
|
|
16
|
+
const le = N(
|
|
17
|
+
/* GraphQL */
|
|
18
|
+
`
|
|
19
|
+
query ServersQuery($input: JSON!, $type: SchemaType!) {
|
|
20
|
+
schema(input: $input, type: $type) {
|
|
21
|
+
url
|
|
22
|
+
servers {
|
|
23
|
+
url
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`
|
|
28
|
+
), w = ({ url: t }) => {
|
|
16
29
|
const [s, n] = f(!1);
|
|
17
|
-
return /* @__PURE__ */ e.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return /* @__PURE__ */ e.jsx(
|
|
31
|
+
P,
|
|
32
|
+
{
|
|
33
|
+
onClick: () => {
|
|
34
|
+
navigator.clipboard.writeText(t).then(() => {
|
|
35
|
+
n(!0), setTimeout(() => n(!1), 2e3);
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
variant: "ghost",
|
|
39
|
+
size: "icon",
|
|
40
|
+
children: s ? /* @__PURE__ */ e.jsx(F, { className: "text-green-600", size: 14 }) : /* @__PURE__ */ e.jsx(B, { size: 14, strokeWidth: 1.3 })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}, ce = { suspense: !0 }, de = () => {
|
|
44
|
+
const [t] = A({
|
|
45
|
+
query: le,
|
|
46
|
+
variables: T(),
|
|
47
|
+
context: ce
|
|
48
|
+
}), [, s] = J(), { selectedServer: n, setSelectedServer: i } = U();
|
|
49
|
+
if (!t.data) return null;
|
|
50
|
+
const { servers: r } = t.data.schema;
|
|
51
|
+
return r.length === 1 ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
52
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: "Endpoint:" }),
|
|
53
|
+
/* @__PURE__ */ e.jsx(y, { className: "text-xs px-2 py-1.5", selectOnClick: !0, children: r[0].url }),
|
|
54
|
+
/* @__PURE__ */ e.jsx(w, { url: r[0].url })
|
|
55
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
56
|
+
/* @__PURE__ */ e.jsxs("span", { className: "font-medium text-sm", children: [
|
|
57
|
+
r.length > 1 ? "Endpoints" : "Endpoint",
|
|
58
|
+
":"
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ e.jsx(
|
|
61
|
+
W,
|
|
62
|
+
{
|
|
63
|
+
className: "font-mono text-xs bg-border/50 dark:bg-border/70 py-1.5 max-w-[450px] truncate",
|
|
64
|
+
onChange: (a) => s(() => {
|
|
65
|
+
i(a.target.value);
|
|
66
|
+
}),
|
|
67
|
+
value: n ?? t.data.schema.url,
|
|
68
|
+
showChevrons: r.length > 1,
|
|
69
|
+
options: r.map((a) => ({
|
|
70
|
+
value: a.url,
|
|
71
|
+
label: a.url
|
|
72
|
+
}))
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ e.jsx(w, { url: n ?? t.data.schema.url })
|
|
34
76
|
] });
|
|
35
|
-
},
|
|
77
|
+
}, k = (t, s) => t.reduce(
|
|
36
78
|
(n, i) => {
|
|
37
79
|
const r = s(i);
|
|
38
80
|
return n[r] || (n[r] = []), n[r].push(i), n;
|
|
39
81
|
},
|
|
40
82
|
{}
|
|
41
|
-
),
|
|
83
|
+
), pe = (t, s) => t ? s(t) : void 0, q = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
|
|
42
84
|
type: "string"
|
|
43
|
-
},
|
|
85
|
+
}, me = ({
|
|
44
86
|
parameter: t,
|
|
45
87
|
group: s,
|
|
46
88
|
id: n
|
|
47
89
|
}) => /* @__PURE__ */ e.jsxs("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1", children: [
|
|
48
90
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
49
91
|
/* @__PURE__ */ e.jsx("code", { children: s === "path" ? /* @__PURE__ */ e.jsx(
|
|
50
|
-
|
|
92
|
+
Z,
|
|
51
93
|
{
|
|
52
94
|
name: t.name,
|
|
53
95
|
backgroundOpacity: "15%",
|
|
@@ -55,7 +97,7 @@ const ne = ({ url: t }) => {
|
|
|
55
97
|
}
|
|
56
98
|
) : t.name }),
|
|
57
99
|
t.required && /* @__PURE__ */ e.jsx("span", { className: "py-px px-1.5 font-medium bg-primary/75 text-muted rounded-lg", children: "required" }),
|
|
58
|
-
|
|
100
|
+
q(t).type && /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: q(t).type })
|
|
59
101
|
] }),
|
|
60
102
|
t.description && /* @__PURE__ */ e.jsx(
|
|
61
103
|
m,
|
|
@@ -64,14 +106,14 @@ const ne = ({ url: t }) => {
|
|
|
64
106
|
className: "text-sm prose-p:my-1 prose-code:whitespace-pre-line"
|
|
65
107
|
}
|
|
66
108
|
)
|
|
67
|
-
] }),
|
|
109
|
+
] }), xe = ({
|
|
68
110
|
group: t,
|
|
69
111
|
parameters: s,
|
|
70
112
|
id: n
|
|
71
113
|
}) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
72
|
-
/* @__PURE__ */ e.jsx(
|
|
114
|
+
/* @__PURE__ */ e.jsx(h, { level: 3, id: `${n}/${t}-parameters`, className: "capitalize", children: t === "header" ? "Headers" : `${t} Parameters` }),
|
|
73
115
|
/* @__PURE__ */ e.jsx(p, { children: /* @__PURE__ */ e.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: s.sort((i, r) => i.required === r.required ? 0 : i.required ? -1 : 1).map((i) => /* @__PURE__ */ e.jsx(
|
|
74
|
-
|
|
116
|
+
me,
|
|
75
117
|
{
|
|
76
118
|
parameter: i,
|
|
77
119
|
id: n,
|
|
@@ -79,15 +121,15 @@ const ne = ({ url: t }) => {
|
|
|
79
121
|
},
|
|
80
122
|
`${i.name}-${i.in}`
|
|
81
123
|
)) }) })
|
|
82
|
-
] }),
|
|
83
|
-
AND: /* @__PURE__ */ e.jsx(
|
|
84
|
-
OR: /* @__PURE__ */ e.jsx(
|
|
85
|
-
ONE: /* @__PURE__ */ e.jsx(
|
|
86
|
-
},
|
|
124
|
+
] }), ue = (t) => Object.entries(t), je = {
|
|
125
|
+
AND: /* @__PURE__ */ e.jsx(H, { size: 16, className: "fill-card" }),
|
|
126
|
+
OR: /* @__PURE__ */ e.jsx(M, { size: 16, className: "fill-card" }),
|
|
127
|
+
ONE: /* @__PURE__ */ e.jsx(G, { size: 14, className: "fill-card" })
|
|
128
|
+
}, he = {
|
|
87
129
|
AND: "text-green-500 dark:text-green-300/60",
|
|
88
130
|
OR: "text-blue-400 dark:text-blue-500",
|
|
89
131
|
ONE: "text-purple-500 dark:text-purple-300/60"
|
|
90
|
-
},
|
|
132
|
+
}, ge = ({
|
|
91
133
|
type: t,
|
|
92
134
|
isOpen: s,
|
|
93
135
|
className: n
|
|
@@ -95,13 +137,13 @@ const ne = ({ url: t }) => {
|
|
|
95
137
|
"div",
|
|
96
138
|
{
|
|
97
139
|
className: x(
|
|
98
|
-
|
|
140
|
+
he[t],
|
|
99
141
|
"relative text-sm flex py-2",
|
|
100
142
|
"before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
|
|
101
143
|
n
|
|
102
144
|
),
|
|
103
145
|
children: /* @__PURE__ */ e.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
|
|
104
|
-
|
|
146
|
+
je[t],
|
|
105
147
|
/* @__PURE__ */ e.jsx(
|
|
106
148
|
"div",
|
|
107
149
|
{
|
|
@@ -109,45 +151,45 @@ const ne = ({ url: t }) => {
|
|
|
109
151
|
"translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
|
|
110
152
|
!s && "-rotate-90"
|
|
111
153
|
),
|
|
112
|
-
children: /* @__PURE__ */ e.jsx(
|
|
154
|
+
children: /* @__PURE__ */ e.jsx(D, { size: 16 })
|
|
113
155
|
}
|
|
114
156
|
)
|
|
115
157
|
] })
|
|
116
158
|
}
|
|
117
|
-
),
|
|
159
|
+
), fe = (t) => {
|
|
118
160
|
const [s, n] = f(!0);
|
|
119
161
|
return /* @__PURE__ */ e.jsxs(
|
|
120
|
-
|
|
162
|
+
v,
|
|
121
163
|
{
|
|
122
164
|
open: s,
|
|
123
165
|
onOpenChange: () => n((i) => !i),
|
|
124
166
|
className: "group",
|
|
125
167
|
children: [
|
|
126
|
-
/* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(
|
|
168
|
+
/* @__PURE__ */ e.jsx(C, { children: /* @__PURE__ */ e.jsx(ge, { type: t.type, isOpen: s }) }),
|
|
127
169
|
!s && /* @__PURE__ */ e.jsx("div", { className: "wavy-line bg-border translate-y-1" }),
|
|
128
|
-
/* @__PURE__ */ e.jsx(O, { children: /* @__PURE__ */ e.jsx(
|
|
170
|
+
/* @__PURE__ */ e.jsx(O, { children: /* @__PURE__ */ e.jsx(g, { schema: t.schema, level: t.level + 1 }) })
|
|
129
171
|
]
|
|
130
172
|
}
|
|
131
173
|
);
|
|
132
|
-
},
|
|
174
|
+
}, ye = {
|
|
133
175
|
AND: "All of",
|
|
134
176
|
OR: "Any of",
|
|
135
177
|
ONE: "One of"
|
|
136
|
-
},
|
|
178
|
+
}, be = ({
|
|
137
179
|
schemas: t,
|
|
138
180
|
type: s,
|
|
139
181
|
isOpen: n,
|
|
140
182
|
level: i,
|
|
141
183
|
toggleOpen: r
|
|
142
|
-
}) => /* @__PURE__ */ e.jsx(
|
|
184
|
+
}) => /* @__PURE__ */ e.jsx(v, { open: n, onOpenChange: r, asChild: !0, children: /* @__PURE__ */ e.jsxs(p, { className: "px-6", children: [
|
|
143
185
|
/* @__PURE__ */ e.jsxs(C, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5", children: [
|
|
144
|
-
n ? /* @__PURE__ */ e.jsx(
|
|
145
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
186
|
+
n ? /* @__PURE__ */ e.jsx(Q, { size: 14 }) : /* @__PURE__ */ e.jsx(V, { size: 14 }),
|
|
187
|
+
/* @__PURE__ */ e.jsx("span", { children: ye[s] })
|
|
146
188
|
] }),
|
|
147
189
|
/* @__PURE__ */ e.jsx(O, { className: "pb-4", children: t.map((a, l) => (
|
|
148
190
|
// eslint-disable-next-line react/no-array-index-key
|
|
149
191
|
/* @__PURE__ */ e.jsx(
|
|
150
|
-
|
|
192
|
+
fe,
|
|
151
193
|
{
|
|
152
194
|
type: s,
|
|
153
195
|
schema: a,
|
|
@@ -156,19 +198,19 @@ const ne = ({ url: t }) => {
|
|
|
156
198
|
l
|
|
157
199
|
)
|
|
158
200
|
)) })
|
|
159
|
-
] }) }),
|
|
201
|
+
] }) }), Ne = (t) => t.type === "object" || t.type === "array" && typeof t.items == "object" && (!t.items.type || t.items.type === "object"), b = (t) => !!(t.oneOf ?? t.allOf ?? t.anyOf), ve = {
|
|
160
202
|
allOf: "AND",
|
|
161
203
|
anyOf: "OR",
|
|
162
204
|
oneOf: "ONE"
|
|
163
|
-
},
|
|
205
|
+
}, $ = ({
|
|
164
206
|
schema: t,
|
|
165
207
|
level: s
|
|
166
208
|
}) => {
|
|
167
|
-
const [n, i] = f(!0), r =
|
|
168
|
-
for (const [a, l] of
|
|
209
|
+
const [n, i] = f(!0), r = K(() => i((a) => !a), []);
|
|
210
|
+
for (const [a, l] of ue(ve))
|
|
169
211
|
if (t[a])
|
|
170
212
|
return /* @__PURE__ */ e.jsx(
|
|
171
|
-
|
|
213
|
+
be,
|
|
172
214
|
{
|
|
173
215
|
schemas: t[a],
|
|
174
216
|
type: l,
|
|
@@ -177,7 +219,7 @@ const ne = ({ url: t }) => {
|
|
|
177
219
|
level: s
|
|
178
220
|
}
|
|
179
221
|
);
|
|
180
|
-
},
|
|
222
|
+
}, Ce = ({
|
|
181
223
|
name: t,
|
|
182
224
|
schema: s,
|
|
183
225
|
group: n,
|
|
@@ -202,31 +244,31 @@ const ne = ({ url: t }) => {
|
|
|
202
244
|
content: s.description
|
|
203
245
|
}
|
|
204
246
|
),
|
|
205
|
-
(b(s) ||
|
|
206
|
-
|
|
247
|
+
(b(s) || Ne(s)) && /* @__PURE__ */ e.jsxs(
|
|
248
|
+
v,
|
|
207
249
|
{
|
|
208
250
|
defaultOpen: r,
|
|
209
251
|
open: l,
|
|
210
252
|
onOpenChange: () => j(!l),
|
|
211
253
|
children: [
|
|
212
254
|
a && /* @__PURE__ */ e.jsx(C, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
213
|
-
|
|
255
|
+
P,
|
|
214
256
|
{
|
|
215
257
|
variant: "outline",
|
|
216
258
|
size: "sm",
|
|
217
259
|
className: "mt-2 flex gap-1.5",
|
|
218
260
|
children: [
|
|
219
|
-
/* @__PURE__ */ e.jsx(
|
|
261
|
+
/* @__PURE__ */ e.jsx(_, { size: 18 }),
|
|
220
262
|
l ? "Hide nested properties" : "Show nested properties"
|
|
221
263
|
]
|
|
222
264
|
}
|
|
223
265
|
) }),
|
|
224
|
-
/* @__PURE__ */ e.jsx(O, { children: /* @__PURE__ */ e.jsx("div", { className: "mt-2", children: b(s) ? /* @__PURE__ */ e.jsx(
|
|
266
|
+
/* @__PURE__ */ e.jsx(O, { children: /* @__PURE__ */ e.jsx("div", { className: "mt-2", children: b(s) ? /* @__PURE__ */ e.jsx($, { schema: s, level: i + 1 }) : s.type === "object" ? /* @__PURE__ */ e.jsx(g, { schema: s, level: i + 1 }) : s.type === "array" && typeof s.items == "object" && /* @__PURE__ */ e.jsx(g, { schema: s.items, level: i + 1 }) }) })
|
|
225
267
|
]
|
|
226
268
|
}
|
|
227
269
|
)
|
|
228
270
|
] }) });
|
|
229
|
-
},
|
|
271
|
+
}, g = ({
|
|
230
272
|
schema: t,
|
|
231
273
|
level: s = 0,
|
|
232
274
|
defaultOpen: n = !1
|
|
@@ -235,7 +277,7 @@ const ne = ({ url: t }) => {
|
|
|
235
277
|
return /* @__PURE__ */ e.jsx(p, { className: "p-4", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No response specified" }) });
|
|
236
278
|
const i = (r, a) => {
|
|
237
279
|
if (b(r))
|
|
238
|
-
return /* @__PURE__ */ e.jsx(
|
|
280
|
+
return /* @__PURE__ */ e.jsx($, { schema: r, level: a });
|
|
239
281
|
if (r.type === "array" && r.items) {
|
|
240
282
|
const l = r.items;
|
|
241
283
|
return typeof l.type == "string" && ["string", "number", "boolean", "integer"].includes(l.type) ? /* @__PURE__ */ e.jsxs(p, { className: "p-4", children: [
|
|
@@ -274,7 +316,7 @@ const ne = ({ url: t }) => {
|
|
|
274
316
|
)
|
|
275
317
|
] });
|
|
276
318
|
if (r.properties) {
|
|
277
|
-
const l =
|
|
319
|
+
const l = k(
|
|
278
320
|
Object.entries(r.properties),
|
|
279
321
|
([d, o]) => {
|
|
280
322
|
var c;
|
|
@@ -283,7 +325,7 @@ const ne = ({ url: t }) => {
|
|
|
283
325
|
), j = ["required", "optional", "deprecated"];
|
|
284
326
|
return /* @__PURE__ */ e.jsx(p, { className: "divide-y overflow-hidden", children: j.map(
|
|
285
327
|
(d) => l[d] && /* @__PURE__ */ e.jsx("ul", { className: "divide-y", children: l[d].map(([o, c]) => /* @__PURE__ */ e.jsx(
|
|
286
|
-
|
|
328
|
+
Ce,
|
|
287
329
|
{
|
|
288
330
|
name: o,
|
|
289
331
|
schema: c,
|
|
@@ -308,19 +350,19 @@ const ne = ({ url: t }) => {
|
|
|
308
350
|
}
|
|
309
351
|
)
|
|
310
352
|
] }) : r.additionalProperties ? /* @__PURE__ */ e.jsxs(p, { className: "my-2", children: [
|
|
311
|
-
/* @__PURE__ */ e.jsx(
|
|
312
|
-
/* @__PURE__ */ e.jsx(
|
|
353
|
+
/* @__PURE__ */ e.jsx(X, { children: /* @__PURE__ */ e.jsx(Y, { children: "Additional Properties:" }) }),
|
|
354
|
+
/* @__PURE__ */ e.jsx(ee, { children: i(
|
|
313
355
|
r.additionalProperties,
|
|
314
356
|
a + 1
|
|
315
357
|
) })
|
|
316
358
|
] }) : null;
|
|
317
359
|
};
|
|
318
360
|
return i(t, s);
|
|
319
|
-
},
|
|
361
|
+
}, Oe = ["path", "query", "header", "cookie"], Se = ({
|
|
320
362
|
operationFragment: t
|
|
321
363
|
}) => {
|
|
322
364
|
var l, j, d;
|
|
323
|
-
const s =
|
|
365
|
+
const s = oe(Ie, t), n = k(
|
|
324
366
|
s.parameters ?? [],
|
|
325
367
|
(o) => o.in
|
|
326
368
|
), i = s.responses.at(0), [r, a] = f(i == null ? void 0 : i.statusCode);
|
|
@@ -330,7 +372,7 @@ const ne = ({ url: t }) => {
|
|
|
330
372
|
className: "grid grid-cols-1 lg:grid-cols-[4fr_3fr] gap-8 items-start border-b-2 mb-16 pb-16",
|
|
331
373
|
children: [
|
|
332
374
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
333
|
-
/* @__PURE__ */ e.jsx(
|
|
375
|
+
/* @__PURE__ */ e.jsx(h, { level: 2, id: s.slug, registerSidebarAnchor: !0, children: s.summary }),
|
|
334
376
|
s.description && /* @__PURE__ */ e.jsx(
|
|
335
377
|
m,
|
|
336
378
|
{
|
|
@@ -338,11 +380,11 @@ const ne = ({ url: t }) => {
|
|
|
338
380
|
content: s.description
|
|
339
381
|
}
|
|
340
382
|
),
|
|
341
|
-
s.parameters && s.parameters.length > 0 && /* @__PURE__ */ e.jsx(e.Fragment, { children:
|
|
383
|
+
s.parameters && s.parameters.length > 0 && /* @__PURE__ */ e.jsx(e.Fragment, { children: Oe.flatMap(
|
|
342
384
|
(o) => {
|
|
343
385
|
var c;
|
|
344
386
|
return (c = n[o]) != null && c.length ? /* @__PURE__ */ e.jsx(
|
|
345
|
-
|
|
387
|
+
xe,
|
|
346
388
|
{
|
|
347
389
|
id: s.slug,
|
|
348
390
|
parameters: n[o],
|
|
@@ -352,9 +394,9 @@ const ne = ({ url: t }) => {
|
|
|
352
394
|
) : [];
|
|
353
395
|
}
|
|
354
396
|
) }),
|
|
355
|
-
|
|
397
|
+
pe((d = (j = (l = s.requestBody) == null ? void 0 : l.content) == null ? void 0 : j.at(0)) == null ? void 0 : d.schema, (o) => /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
|
|
356
398
|
/* @__PURE__ */ e.jsx(
|
|
357
|
-
|
|
399
|
+
h,
|
|
358
400
|
{
|
|
359
401
|
level: 3,
|
|
360
402
|
className: "capitalize",
|
|
@@ -363,11 +405,11 @@ const ne = ({ url: t }) => {
|
|
|
363
405
|
children: "Request Body"
|
|
364
406
|
}
|
|
365
407
|
),
|
|
366
|
-
/* @__PURE__ */ e.jsx(
|
|
408
|
+
/* @__PURE__ */ e.jsx(g, { schema: o })
|
|
367
409
|
] })),
|
|
368
410
|
s.responses.length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
369
411
|
/* @__PURE__ */ e.jsx(
|
|
370
|
-
|
|
412
|
+
h,
|
|
371
413
|
{
|
|
372
414
|
level: 3,
|
|
373
415
|
className: "capitalize mt-8 pt-8 border-t",
|
|
@@ -377,30 +419,30 @@ const ne = ({ url: t }) => {
|
|
|
377
419
|
}
|
|
378
420
|
),
|
|
379
421
|
/* @__PURE__ */ e.jsxs(
|
|
380
|
-
|
|
422
|
+
se,
|
|
381
423
|
{
|
|
382
424
|
onValueChange: (o) => a(o),
|
|
383
425
|
value: r,
|
|
384
426
|
children: [
|
|
385
|
-
s.responses.length > 1 && /* @__PURE__ */ e.jsx(
|
|
386
|
-
|
|
427
|
+
s.responses.length > 1 && /* @__PURE__ */ e.jsx(te, { children: s.responses.map((o) => /* @__PURE__ */ e.jsx(
|
|
428
|
+
re,
|
|
387
429
|
{
|
|
388
430
|
value: o.statusCode,
|
|
389
|
-
title: o.description,
|
|
431
|
+
title: o.description ?? void 0,
|
|
390
432
|
children: o.statusCode
|
|
391
433
|
},
|
|
392
434
|
o.statusCode
|
|
393
435
|
)) }),
|
|
394
436
|
/* @__PURE__ */ e.jsx("ul", { className: "list-none m-0 px-0", children: s.responses.map((o) => {
|
|
395
|
-
var c,
|
|
437
|
+
var c, S;
|
|
396
438
|
return /* @__PURE__ */ e.jsx(
|
|
397
|
-
|
|
439
|
+
ne,
|
|
398
440
|
{
|
|
399
441
|
value: o.statusCode,
|
|
400
442
|
children: /* @__PURE__ */ e.jsx(
|
|
401
|
-
|
|
443
|
+
g,
|
|
402
444
|
{
|
|
403
|
-
schema: (
|
|
445
|
+
schema: (S = (c = o.content) == null ? void 0 : c.find((L) => L.schema)) == null ? void 0 : S.schema
|
|
404
446
|
}
|
|
405
447
|
)
|
|
406
448
|
},
|
|
@@ -413,7 +455,7 @@ const ne = ({ url: t }) => {
|
|
|
413
455
|
] })
|
|
414
456
|
] }),
|
|
415
457
|
/* @__PURE__ */ e.jsx(
|
|
416
|
-
|
|
458
|
+
ie,
|
|
417
459
|
{
|
|
418
460
|
selectedResponse: r,
|
|
419
461
|
onSelectResponse: a,
|
|
@@ -424,7 +466,7 @@ const ne = ({ url: t }) => {
|
|
|
424
466
|
},
|
|
425
467
|
s.operationId
|
|
426
468
|
);
|
|
427
|
-
},
|
|
469
|
+
}, Ie = N(
|
|
428
470
|
/* GraphQL */
|
|
429
471
|
`
|
|
430
472
|
fragment OperationsFragment on OperationItem {
|
|
@@ -475,7 +517,7 @@ const ne = ({ url: t }) => {
|
|
|
475
517
|
}
|
|
476
518
|
}
|
|
477
519
|
`
|
|
478
|
-
),
|
|
520
|
+
), we = N(
|
|
479
521
|
/* GraphQL */
|
|
480
522
|
`
|
|
481
523
|
query AllOperations($input: JSON!, $type: SchemaType!) {
|
|
@@ -495,20 +537,20 @@ const ne = ({ url: t }) => {
|
|
|
495
537
|
}
|
|
496
538
|
}
|
|
497
539
|
`
|
|
498
|
-
),
|
|
540
|
+
), qe = { suspense: !0 }, He = () => {
|
|
499
541
|
var r;
|
|
500
|
-
const { type: t, input: s } =
|
|
501
|
-
query:
|
|
542
|
+
const { type: t, input: s } = T(), [n] = A({
|
|
543
|
+
query: we,
|
|
502
544
|
variables: { type: t, input: s },
|
|
503
|
-
context:
|
|
545
|
+
context: qe
|
|
504
546
|
}), i = (r = n.error) == null ? void 0 : r.graphQLErrors.at(0);
|
|
505
547
|
return i ? /* @__PURE__ */ e.jsx(
|
|
506
|
-
|
|
548
|
+
R,
|
|
507
549
|
{
|
|
508
550
|
category: "Error",
|
|
509
551
|
title: "Schema cannot be displayed",
|
|
510
552
|
message: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
511
|
-
/* @__PURE__ */ e.jsxs(
|
|
553
|
+
/* @__PURE__ */ e.jsxs(z, { className: "mb-4", children: [
|
|
512
554
|
"Check your configuration value ",
|
|
513
555
|
/* @__PURE__ */ e.jsx(y, { children: "apis.type" }),
|
|
514
556
|
" ",
|
|
@@ -517,7 +559,7 @@ const ne = ({ url: t }) => {
|
|
|
517
559
|
" in the Zudoku config."
|
|
518
560
|
] }),
|
|
519
561
|
"An error occurred while trying to fetch the API reference:",
|
|
520
|
-
/* @__PURE__ */ e.jsx(
|
|
562
|
+
/* @__PURE__ */ e.jsx(E, { code: i.toString(), language: "plain" })
|
|
521
563
|
] })
|
|
522
564
|
}
|
|
523
565
|
) : n.data ? /* @__PURE__ */ e.jsxs("div", { className: "pt-[--padding-content-top]", children: [
|
|
@@ -526,16 +568,16 @@ const ne = ({ url: t }) => {
|
|
|
526
568
|
{
|
|
527
569
|
className: x(u, "mb-16 max-w-full prose-img:max-w-prose"),
|
|
528
570
|
children: [
|
|
529
|
-
/* @__PURE__ */ e.jsx(
|
|
530
|
-
/* @__PURE__ */ e.jsx(
|
|
571
|
+
/* @__PURE__ */ e.jsx(I, { children: "Overview" }),
|
|
572
|
+
/* @__PURE__ */ e.jsx(h, { level: 1, id: "description", registerSidebarAnchor: !0, children: n.data.schema.title }),
|
|
531
573
|
/* @__PURE__ */ e.jsx(m, { content: n.data.schema.description ?? "" })
|
|
532
574
|
]
|
|
533
575
|
}
|
|
534
576
|
),
|
|
535
577
|
/* @__PURE__ */ e.jsx("hr", {}),
|
|
536
|
-
/* @__PURE__ */ e.jsx(
|
|
578
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ e.jsx(de, {}) }),
|
|
537
579
|
n.data.schema.tags.filter((a) => a.operations.length > 0).map((a) => /* @__PURE__ */ e.jsxs("div", { children: [
|
|
538
|
-
a.name && /* @__PURE__ */ e.jsx(
|
|
580
|
+
a.name && /* @__PURE__ */ e.jsx(I, { children: a.name }),
|
|
539
581
|
a.description && /* @__PURE__ */ e.jsx(
|
|
540
582
|
m,
|
|
541
583
|
{
|
|
@@ -543,8 +585,8 @@ const ne = ({ url: t }) => {
|
|
|
543
585
|
content: a.description
|
|
544
586
|
}
|
|
545
587
|
),
|
|
546
|
-
/* @__PURE__ */ e.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ e.jsx(
|
|
547
|
-
|
|
588
|
+
/* @__PURE__ */ e.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ e.jsx(ae, { children: a.operations.map((l) => /* @__PURE__ */ e.jsx(
|
|
589
|
+
Se,
|
|
548
590
|
{
|
|
549
591
|
operationFragment: l
|
|
550
592
|
},
|
|
@@ -554,7 +596,7 @@ const ne = ({ url: t }) => {
|
|
|
554
596
|
] }) : null;
|
|
555
597
|
};
|
|
556
598
|
export {
|
|
557
|
-
|
|
558
|
-
|
|
599
|
+
He as OperationList,
|
|
600
|
+
Ie as OperationsFragment
|
|
559
601
|
};
|
|
560
|
-
//# sourceMappingURL=OperationList-
|
|
602
|
+
//# sourceMappingURL=OperationList-JAQF5-tn.js.map
|