zudoku 0.66.3 → 0.66.4
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/lib/authentication/components/SignIn.js +4 -2
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignUp.js +4 -2
- package/dist/lib/authentication/components/SignUp.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +7 -3
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.js +2 -3
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +3 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +1 -1
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/dist/vite/prerender/worker.js +3 -0
- package/dist/vite/prerender/worker.js.map +1 -1
- package/lib/{ActionButton-DUgvSylL.js → ActionButton-BSM2oNHF.js} +2 -2
- package/lib/{ActionButton-DUgvSylL.js.map → ActionButton-BSM2oNHF.js.map} +1 -1
- package/lib/{Button-CynVW1JV.js → Button-IOAeVaIH.js} +7 -6
- package/lib/{Button-CynVW1JV.js.map → Button-IOAeVaIH.js.map} +1 -1
- package/lib/{ClaudeLogo-BZslN9XF.js → ClaudeLogo-DgjivS8A.js} +2 -2
- package/lib/{ClaudeLogo-BZslN9XF.js.map → ClaudeLogo-DgjivS8A.js.map} +1 -1
- package/lib/Drawer-BRMcpfuF.js.map +1 -1
- package/lib/{IndexingDialog-B5zCiUKr.js → IndexingDialog-DZWj_3cU.js} +2 -2
- package/lib/{IndexingDialog-B5zCiUKr.js.map → IndexingDialog-DZWj_3cU.js.map} +1 -1
- package/lib/Input-D-kqEQ5M.js.map +1 -1
- package/lib/{MdxPage-B4zZq5aR.js → MdxPage-BL-HbZrv.js} +6 -6
- package/lib/{MdxPage-B4zZq5aR.js.map → MdxPage-BL-HbZrv.js.map} +1 -1
- package/lib/{OAuthErrorPage-DRY2hlga.js → OAuthErrorPage-DQtg28Go.js} +3 -3
- package/lib/{OAuthErrorPage-DRY2hlga.js.map → OAuthErrorPage-DQtg28Go.js.map} +1 -1
- package/lib/{OasProvider-lMwTD76Y.js → OasProvider--qcZwrKS.js} +2 -2
- package/lib/{OasProvider-lMwTD76Y.js.map → OasProvider--qcZwrKS.js.map} +1 -1
- package/lib/{OperationList-Bm76b4vl.js → OperationList-CSJYzxQY.js} +1094 -1079
- package/lib/{OperationList-Bm76b4vl.js.map → OperationList-CSJYzxQY.js.map} +1 -1
- package/lib/{RouteGuard-DGc32XJV.js → RouteGuard-D0f743SM.js} +2 -2
- package/lib/{RouteGuard-DGc32XJV.js.map → RouteGuard-D0f743SM.js.map} +1 -1
- package/lib/{SchemaList-DX4FPogg.js → SchemaList-DtyuDrQA.js} +7 -7
- package/lib/{SchemaList-DX4FPogg.js.map → SchemaList-DtyuDrQA.js.map} +1 -1
- package/lib/{SchemaView-CjXvSRxy.js → SchemaView-G-SVXxAG.js} +111 -110
- package/lib/SchemaView-G-SVXxAG.js.map +1 -0
- package/lib/SignUp-CDl7bQj3.js +50 -0
- package/lib/SignUp-CDl7bQj3.js.map +1 -0
- package/lib/{Toc-L1vGGHA1.js → Toc-D_Rj4jVx.js} +2 -2
- package/lib/{Toc-L1vGGHA1.js.map → Toc-D_Rj4jVx.js.map} +1 -1
- package/lib/ZudokuContext-DNHMZfcP.js.map +1 -1
- package/lib/chunk-PVWAREVJ-ClM0m2aJ.js.map +1 -1
- package/lib/{circular-BIN_WQ0c.js → circular-BxODTa7z.js} +2 -2
- package/lib/{circular-BIN_WQ0c.js.map → circular-BxODTa7z.js.map} +1 -1
- package/lib/{createServer-BEl12QFw.js → createServer-BpreIXp6.js} +10 -10
- package/lib/{createServer-BEl12QFw.js.map → createServer-BpreIXp6.js.map} +1 -1
- package/lib/{errors-CtBbD47A.js → errors-DliW1dED.js} +2 -2
- package/lib/{errors-CtBbD47A.js.map → errors-DliW1dED.js.map} +1 -1
- package/lib/{firebase-CT38ugg4.js → firebase-D4tbaCYB.js} +12 -12
- package/lib/{firebase-CT38ugg4.js.map → firebase-D4tbaCYB.js.map} +1 -1
- package/lib/{index-CISwSpdT.js → index-1TbL0HXQ.js} +2 -2
- package/lib/{index-CISwSpdT.js.map → index-1TbL0HXQ.js.map} +1 -1
- package/lib/{index-jI2Fjpy-.js → index-9MxNUgg4.js} +8 -8
- package/lib/{index-jI2Fjpy-.js.map → index-9MxNUgg4.js.map} +1 -1
- package/lib/{index-CG2v-T7-.js → index-CboxZOVW.js} +2 -2
- package/lib/{index-CG2v-T7-.js.map → index-CboxZOVW.js.map} +1 -1
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/index-DXXZDuSJ.js.map +1 -1
- package/lib/index.esm-BYObtETB.js.map +1 -1
- package/lib/index.esm-DtzT_KoE.js.map +1 -1
- package/lib/{index.esm-Bu35TNgg.js → index.esm-ti5zvZS_.js} +2 -2
- package/lib/index.esm-ti5zvZS_.js.map +1 -0
- package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
- package/lib/ui/ActionButton.js +1 -1
- package/lib/ui/Button.js +6 -5
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/zudoku.__internal.js +2 -2
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +3 -3
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-firebase.js +3 -3
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.auth-supabase.js +3 -3
- package/lib/zudoku.components.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +2 -2
- package/lib/zudoku.plugin-api-keys.js +5 -7
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +3 -3
- package/lib/zudoku.router.js.map +1 -1
- package/package.json +4 -4
- package/src/lib/authentication/components/SignIn.tsx +5 -2
- package/src/lib/authentication/components/SignUp.tsx +5 -2
- package/src/lib/oas/graphql/index.ts +7 -3
- package/src/lib/plugins/api-keys/index.tsx +2 -3
- package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +3 -2
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -4
- package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
- package/src/lib/ui/Button.tsx +1 -0
- package/lib/SchemaView-CjXvSRxy.js.map +0 -1
- package/lib/SignUp-CntxjFGS.js +0 -50
- package/lib/SignUp-CntxjFGS.js.map +0 -1
- package/lib/index.esm-Bu35TNgg.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
|
2
2
|
import { H as m } from "./index.esm-DtzT_KoE.js";
|
|
3
3
|
import { createContext as p, use as f } from "react";
|
|
4
4
|
import { u as g, a as x, m as j, O as v } from "./chunk-PVWAREVJ-ClM0m2aJ.js";
|
|
5
|
-
import { B as a } from "./Button-
|
|
5
|
+
import { B as a } from "./Button-IOAeVaIH.js";
|
|
6
6
|
import { D as C, a as R, b as D, c as w, d as T, e as b } from "./Dialog-BQciPiHN.js";
|
|
7
7
|
import { u as k } from "./hook-CHw_R_xu.js";
|
|
8
8
|
import { a as E } from "./ZudokuContext-DNHMZfcP.js";
|
|
@@ -74,4 +74,4 @@ export {
|
|
|
74
74
|
G as R,
|
|
75
75
|
A as S
|
|
76
76
|
};
|
|
77
|
-
//# sourceMappingURL=RouteGuard-
|
|
77
|
+
//# sourceMappingURL=RouteGuard-D0f743SM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteGuard-
|
|
1
|
+
{"version":3,"file":"RouteGuard-D0f743SM.js","sources":["../src/lib/components/context/BypassProtectedRoutesContext.ts","../src/lib/core/RouteGuard.tsx"],"sourcesContent":["import { createContext } from \"react\";\n\nexport const BypassProtectedRoutesContext = createContext(false);\n","import { Helmet } from \"@zudoku/react-helmet-async\";\nimport { use } from \"react\";\nimport { matchPath, Outlet, useLocation, useNavigate } from \"react-router\";\nimport { Button } from \"zudoku/ui/Button.js\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"zudoku/ui/Dialog.js\";\nimport { useAuth } from \"../authentication/hook.js\";\nimport { BypassProtectedRoutesContext } from \"../components/context/BypassProtectedRoutesContext.js\";\nimport { useZudoku } from \"../components/context/ZudokuContext.js\";\nimport { ZudokuError } from \"../util/invariant.js\";\nimport { useLatest } from \"../util/useLatest.js\";\n\nexport const SEARCH_PROTECTED_SECTION = \"protected\";\n\nexport const RouteGuard = () => {\n const auth = useAuth();\n const zudoku = useZudoku();\n const navigate = useNavigate();\n const location = useLocation();\n const latestPath = useLatest(location.pathname);\n const shouldBypass = use(BypassProtectedRoutesContext);\n const { protectedRoutes } = zudoku.options;\n\n const authCheckFn =\n !shouldBypass && protectedRoutes\n ? Object.entries(protectedRoutes).find(([path]) =>\n matchPath({ path, end: true }, location.pathname),\n )?.[1]\n : undefined;\n\n const isProtectedRoute = authCheckFn !== undefined;\n const needsToSignIn =\n isProtectedRoute && !authCheckFn({ auth, context: zudoku });\n\n if (isProtectedRoute && !auth.isAuthEnabled) {\n throw new ZudokuError(\"Authentication is not enabled\", {\n title: \"Authentication is not enabled\",\n developerHint:\n \"To use protectedRoutes you need authentication to be enabled\",\n });\n }\n\n if (needsToSignIn && auth.isPending && typeof window !== \"undefined\") {\n return null;\n }\n\n if (needsToSignIn) {\n return (\n <Dialog\n open={true}\n onOpenChange={(open) => {\n if (!open) {\n void navigate(-1);\n }\n }}\n >\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Login to continue</DialogTitle>\n </DialogHeader>\n <DialogDescription>\n Please wait while we log you in.\n </DialogDescription>\n <DialogFooter>\n <Button variant=\"outline\" onClick={() => void navigate(-1)}>\n Cancel\n </Button>\n <div className=\"w-full\"></div>\n <Button\n variant=\"secondary\"\n onClick={() =>\n void zudoku.authentication?.signUp(\n { navigate },\n { redirectTo: latestPath.current },\n )\n }\n >\n Register\n </Button>\n <Button\n onClick={() =>\n void zudoku.authentication?.signIn(\n { navigate },\n { redirectTo: latestPath.current },\n )\n }\n >\n Login{\" \"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n }\n\n return (\n <>\n {shouldBypass && isProtectedRoute && (\n <Helmet>\n <meta\n name=\"pagefind\"\n data-pagefind-filter={`section:${SEARCH_PROTECTED_SECTION}`}\n content=\"true\"\n />\n </Helmet>\n )}\n <Outlet />\n </>\n );\n};\n"],"names":["BypassProtectedRoutesContext","createContext","SEARCH_PROTECTED_SECTION","RouteGuard","auth","useAuth","zudoku","useZudoku","navigate","useNavigate","location","useLocation","latestPath","useLatest","shouldBypass","use","protectedRoutes","authCheckFn","path","matchPath","isProtectedRoute","needsToSignIn","ZudokuError","jsx","Dialog","open","DialogContent","DialogHeader","DialogTitle","DialogDescription","DialogFooter","Button","jsxs","Fragment","Helmet","Outlet"],"mappings":";;;;;;;;;;AAEO,MAAMA,IAA+BC,EAAc,EAAK,GCgBlDC,IAA2B,aAE3BC,IAAa,MAAM;AAC9B,QAAMC,IAAOC,EAAA,GACPC,IAASC,EAAA,GACTC,IAAWC,EAAA,GACXC,IAAWC,EAAA,GACXC,IAAaC,EAAUH,EAAS,QAAQ,GACxCI,IAAeC,EAAIf,CA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AAA;AAAA,cAAQ;AAAA,cAGtC,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAGDoB,gBAAAA,EAAAA;AAAAA,YAACD;AAAA,YAAA;AAAA,cACC,SAAS,MACP,KAAKzB,EAAO,gBAAgB;AAAA,gBAC1B,EAAE,UAAAE,EAAA;AAAA,gBACF,EAAE,YAAYI,EAAW,QAAA;AAAA,cAAQ;AAAA,cAGtC,UAAA;AAAA,gBAAA;AAAA,gBACO;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACR,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,IAMJoB,gBAAAA,EAAAA,KAAAC,YAAA,EACG,UAAA;AAAA,IAAAnB,KAAgBM,2BACdc,GAAA,EACC,UAAAX,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,wBAAsB,WAAWrB,CAAwB;AAAA,QACzD,SAAQ;AAAA,MAAA;AAAA,IAAA,GAEZ;AAAA,0BAEDiC,GAAA,CAAA,CAAO;AAAA,EAAA,GACV;AAEJ;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { s as o } from "./index-
|
|
2
|
+
import { s as o } from "./index-1TbL0HXQ.js";
|
|
3
3
|
import { e as j } from "./ZudokuContext-DNHMZfcP.js";
|
|
4
4
|
import { H as c } from "./index.esm-DtzT_KoE.js";
|
|
5
5
|
import { ChevronsUpDownIcon as y, ChevronsDownUpIcon as N, ChevronRightIcon as b } from "lucide-react";
|
|
6
|
-
import { B as v } from "./Button-
|
|
7
|
-
import { u as C, a as w, C as m, b as l, c as d, d as S } from "./index-
|
|
6
|
+
import { B as v } from "./Button-IOAeVaIH.js";
|
|
7
|
+
import { u as C, a as w, C as m, b as l, c as d, d as S } from "./index-9MxNUgg4.js";
|
|
8
8
|
import { C as A } from "./CategoryHeading-DhmodDcq.js";
|
|
9
|
-
import { H as p, M as H } from "./index-
|
|
10
|
-
import { T as I } from "./Toc-
|
|
11
|
-
import { P as z, S as M } from "./SchemaView-
|
|
9
|
+
import { H as p, M as H } from "./index-CboxZOVW.js";
|
|
10
|
+
import { T as I } from "./Toc-D_Rj4jVx.js";
|
|
11
|
+
import { P as z, S as M } from "./SchemaView-G-SVXxAG.js";
|
|
12
12
|
const P = S(
|
|
13
13
|
/* GraphQL */
|
|
14
14
|
`
|
|
@@ -148,4 +148,4 @@ function R() {
|
|
|
148
148
|
export {
|
|
149
149
|
R as SchemaList
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=SchemaList-
|
|
151
|
+
//# sourceMappingURL=SchemaList-DtyuDrQA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaList-
|
|
1
|
+
{"version":3,"file":"SchemaList-DtyuDrQA.js","sources":["../src/lib/plugins/openapi/SchemaList.tsx"],"sourcesContent":["import slugify from \"@sindresorhus/slugify\";\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport {\n ChevronRightIcon,\n ChevronsDownUpIcon,\n ChevronsUpDownIcon,\n} from \"lucide-react\";\nimport { Button } from \"zudoku/ui/Button.js\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"zudoku/ui/Collapsible.js\";\nimport { CategoryHeading } from \"../../components/CategoryHeading.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { Toc } from \"../../components/navigation/Toc.js\";\nimport { PagefindSearchMeta } from \"../../components/PagefindSearchMeta.js\";\nimport { useCreateQuery } from \"./client/useCreateQuery.js\";\nimport { useOasConfig } from \"./context.js\";\nimport { graphql } from \"./graphql/gql.js\";\nimport { SchemaView } from \"./schema/SchemaView.js\";\n\nconst GET_SCHEMAS = graphql(/* GraphQL */ `\n query GetSchemas($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n title\n description\n summary\n components {\n schemas {\n name\n schema\n extensions\n }\n }\n }\n }\n`);\n\nexport function SchemaList() {\n const { input, type, versions, version, options } = useOasConfig();\n const schemasQuery = useCreateQuery(GET_SCHEMAS, {\n input,\n type,\n });\n const { data } = useSuspenseQuery(schemasQuery);\n\n const schemas = data.schema.components?.schemas ?? [];\n const hasMultipleVersions = Object.entries(versions).length > 1;\n const showVersions =\n options?.showVersionSelect === \"always\" ||\n (hasMultipleVersions && options?.showVersionSelect !== \"hide\");\n\n if (!schemas.length) {\n return (\n <div>\n <Helmet>\n <title>Schemas {showVersions ? version : \"\"}</title>\n <meta name=\"description\" content=\"List of schemas used by the API.\" />\n </Helmet>\n No schemas found\n </div>\n );\n }\n\n return (\n <div\n className=\"grid grid-cols-(--sidecar-grid-cols) gap-8 justify-between\"\n data-pagefind-filter=\"section:openapi\"\n data-pagefind-meta=\"section:openapi\"\n >\n <PagefindSearchMeta name=\"category\">\n {data.schema.title}\n </PagefindSearchMeta>\n <Helmet>\n <title>Schemas {showVersions ? version : \"\"}</title>\n <meta name=\"description\" content=\"List of schemas used by the API.\" />\n </Helmet>\n <div className=\"pt-(--padding-content-top) pb-(--padding-content-bottom)\">\n <Collapsible className=\"w-full\">\n <div className=\"flex flex-col gap-y-4 sm:flex-row justify-around items-start sm:items-end\">\n <div className=\"flex-1\">\n <CategoryHeading>{data.schema.title}</CategoryHeading>\n <Heading\n level={1}\n id=\"schemas\"\n registerNavigationAnchor\n className=\"mb-0\"\n >\n Schemas\n {showVersions && (\n <span className=\"text-xl text-muted-foreground ms-1.5\">\n ({version})\n </span>\n )}\n </Heading>\n </div>\n {data.schema.description && (\n <CollapsibleTrigger className=\"flex items-center gap-1 text-sm font-medium text-muted-foreground group\">\n <span>API information</span>\n <ChevronsUpDownIcon\n className=\"group-data-[state=open]:hidden translate-y-px\"\n size={14}\n />\n <ChevronsDownUpIcon\n className=\"group-data-[state=closed]:hidden translate-y-px\"\n size={13}\n />\n </CollapsibleTrigger>\n )}\n </div>\n {data.schema.description && (\n <CollapsibleContent className=\"CollapsibleContent\">\n <div className=\"mt-4 max-w-full border rounded-sm bg-muted/25\">\n <Markdown\n className=\"max-w-full prose-img:max-w-prose border-border p-3 lg:p-5\"\n content={data.schema.description}\n />\n </div>\n </CollapsibleContent>\n )}\n </Collapsible>\n <hr className=\"my-8\" />\n <div className=\"flex flex-col gap-y-5\">\n {schemas.map((schema) => (\n <Collapsible key={schema.name} className=\"group\" defaultOpen>\n <Heading\n registerNavigationAnchor\n level={2}\n className=\"flex items-center gap-1 justify-between w-fit\"\n id={slugify(schema.name)}\n >\n {schema.name}{\" \"}\n <CollapsibleTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\" className=\"size-6\">\n <ChevronRightIcon\n size={16}\n className=\"group-data-[state=open]:rotate-90 transition cursor-pointer\"\n />\n </Button>\n </CollapsibleTrigger>\n </Heading>\n <CollapsibleContent className=\"mt-4 CollapsibleContent\">\n <SchemaView schema={schema.schema} />\n </CollapsibleContent>\n </Collapsible>\n ))}\n </div>\n </div>\n <Toc\n entries={schemas.map((schema) => ({\n id: slugify(schema.name),\n value: schema.name,\n depth: 1,\n }))}\n />\n </div>\n );\n}\n"],"names":["GET_SCHEMAS","graphql","SchemaList","input","type","versions","version","options","useOasConfig","schemasQuery","useCreateQuery","data","useSuspenseQuery","schemas","hasMultipleVersions","showVersions","jsxs","jsx","PagefindSearchMeta","Helmet","Collapsible","CategoryHeading","Heading","CollapsibleTrigger","ChevronsUpDownIcon","ChevronsDownUpIcon","CollapsibleContent","Markdown","schema","slugify","Button","ChevronRightIcon","SchemaView","Toc"],"mappings":";;;;;;;;;;;AAwBA,MAAMA,IAAcC;AAAA;AAAA,EAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAezC;AAEM,SAASC,IAAa;AAC3B,QAAM,EAAE,OAAAC,GAAO,MAAAC,GA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"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { ChevronUpIcon as T, ChevronDownIcon as J, ChevronsLeftRightIcon as U, MinusIcon as _, PlusIcon as G, RefreshCcwDotIcon as K, InfoIcon as W } from "lucide-react";
|
|
3
3
|
import { useState as f, isValidElement as Q, Fragment as C } from "react";
|
|
4
|
-
import { I as P, a as g, b as $, c as X, F as N, d as
|
|
5
|
-
import { b as u, I as E, M as V } from "./index-
|
|
6
|
-
import { B as te } from "./Button-
|
|
4
|
+
import { I as P, a as g, b as $, c as X, F as N, d as b, e as S, f as Y, g as Z, h as H, i as ee } from "./Frame-DxlznfVd.js";
|
|
5
|
+
import { b as u, I as E, M as V } from "./index-CboxZOVW.js";
|
|
6
|
+
import { B as te } from "./Button-IOAeVaIH.js";
|
|
7
7
|
import { c as j } from "./cn-dYga0KKN.js";
|
|
8
8
|
import * as F from "@radix-ui/react-collapsible";
|
|
9
|
-
import { Button as
|
|
10
|
-
import { Badge as
|
|
9
|
+
import { Button as re } from "./ui/Button.js";
|
|
10
|
+
import { Badge as se } from "./ui/Badge.js";
|
|
11
11
|
import { Frame as ne, FramePanel as ie } from "./ui/Frame.js";
|
|
12
|
-
import { C as oe } from "./circular-
|
|
12
|
+
import { C as oe } from "./circular-BxODTa7z.js";
|
|
13
13
|
const Se = ({
|
|
14
14
|
name: e,
|
|
15
|
-
children:
|
|
16
|
-
}) => /* @__PURE__ */ t.jsx("span", { "data-pagefind-meta": e, className: "sr-only", children:
|
|
17
|
-
(
|
|
18
|
-
const o =
|
|
19
|
-
return
|
|
15
|
+
children: r
|
|
16
|
+
}) => /* @__PURE__ */ t.jsx("span", { "data-pagefind-meta": e, className: "sr-only", children: r }), le = (e, r) => e.reduce(
|
|
17
|
+
(s, i) => {
|
|
18
|
+
const o = r(i);
|
|
19
|
+
return s[o] || (s[o] = []), s[o].push(i), s;
|
|
20
20
|
},
|
|
21
21
|
{}
|
|
22
22
|
), R = ({
|
|
23
23
|
schema: e,
|
|
24
|
-
hideDescription:
|
|
24
|
+
hideDescription: r = !1
|
|
25
25
|
}) => /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
26
26
|
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Const value: " }),
|
|
27
27
|
/* @__PURE__ */ t.jsx(u, { className: "border rounded px-1 font-mono", children: e.const }),
|
|
28
|
-
!
|
|
29
|
-
] }) }),
|
|
28
|
+
!r && e.description && /* @__PURE__ */ t.jsx("div", { className: "text-muted-foreground", children: e.description })
|
|
29
|
+
] }) }), h = ({
|
|
30
30
|
values: e,
|
|
31
|
-
className:
|
|
32
|
-
maxVisibleValues:
|
|
31
|
+
className: r,
|
|
32
|
+
maxVisibleValues: s = 8
|
|
33
33
|
}) => {
|
|
34
34
|
const [i, o] = f(!1);
|
|
35
35
|
if (!e.length) return null;
|
|
36
|
-
const n = e.length >
|
|
37
|
-
return /* @__PURE__ */ t.jsxs("div", { className: j("flex flex-wrap gap-1.5",
|
|
36
|
+
const n = e.length > s, l = n && !i ? e.slice(0, s) : e;
|
|
37
|
+
return /* @__PURE__ */ t.jsxs("div", { className: j("flex flex-wrap gap-1.5", r), children: [
|
|
38
38
|
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Enum values:" }),
|
|
39
39
|
l.map((d) => /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(u, { className: "border rounded-sm px-1 font-mono", children: d }) }, d)),
|
|
40
40
|
n && /* @__PURE__ */ t.jsx(
|
|
@@ -51,7 +51,7 @@ const Se = ({
|
|
|
51
51
|
/* @__PURE__ */ t.jsx(J, { size: 12 }),
|
|
52
52
|
/* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
|
|
53
53
|
"show ",
|
|
54
|
-
e.length -
|
|
54
|
+
e.length - s,
|
|
55
55
|
" more"
|
|
56
56
|
] })
|
|
57
57
|
] })
|
|
@@ -59,16 +59,16 @@ const Se = ({
|
|
|
59
59
|
)
|
|
60
60
|
] });
|
|
61
61
|
}, ae = ({ pattern: e }) => {
|
|
62
|
-
const [
|
|
62
|
+
const [r, s] = f(!1), i = e.length > 20, o = i ? `${e.slice(0, 20)}…` : e;
|
|
63
63
|
return /* @__PURE__ */ t.jsxs(
|
|
64
64
|
E,
|
|
65
65
|
{
|
|
66
66
|
className: j("text-xs", i && "cursor-pointer"),
|
|
67
|
-
onClick: () =>
|
|
67
|
+
onClick: () => s(!r),
|
|
68
68
|
selectOnClick: !1,
|
|
69
69
|
children: [
|
|
70
|
-
|
|
71
|
-
i && /* @__PURE__ */ t.jsx("button", { type: "button", className: "p-1 translate-y-[2px]", children: !
|
|
70
|
+
r ? e : o,
|
|
71
|
+
i && /* @__PURE__ */ t.jsx("button", { type: "button", className: "p-1 translate-y-[2px]", children: !r && /* @__PURE__ */ t.jsx(U, { size: 12 }) })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
);
|
|
@@ -77,6 +77,7 @@ const Se = ({
|
|
|
77
77
|
e.enum && "enum",
|
|
78
78
|
e.const && "const",
|
|
79
79
|
e.format,
|
|
80
|
+
e.type === "array" && e.items?.contentMediaType,
|
|
80
81
|
e.minimum !== void 0 && `min: ${e.minimum}`,
|
|
81
82
|
e.maximum !== void 0 && `max: ${e.maximum}`,
|
|
82
83
|
e.minLength !== void 0 && `minLength: ${e.minLength}`,
|
|
@@ -95,13 +96,13 @@ const Se = ({
|
|
|
95
96
|
] })
|
|
96
97
|
] : [], v = ({
|
|
97
98
|
schema: e,
|
|
98
|
-
extraItems:
|
|
99
|
-
className:
|
|
99
|
+
extraItems: r = [],
|
|
100
|
+
className: s
|
|
100
101
|
}) => {
|
|
101
|
-
const i = [...de(e), ...
|
|
102
|
+
const i = [...de(e), ...r].flatMap(
|
|
102
103
|
(o) => typeof o == "string" || Q(o) ? o : []
|
|
103
104
|
);
|
|
104
|
-
return /* @__PURE__ */ t.jsx("span", { className:
|
|
105
|
+
return /* @__PURE__ */ t.jsx("span", { className: s, children: i.map((o, n) => (
|
|
105
106
|
// biome-ignore lint/suspicious/noArrayIndexKey: index should be stable
|
|
106
107
|
/* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
|
|
107
108
|
o,
|
|
@@ -111,19 +112,19 @@ const Se = ({
|
|
|
111
112
|
}, I = ({
|
|
112
113
|
schema: e
|
|
113
114
|
}) => {
|
|
114
|
-
const
|
|
115
|
-
return
|
|
116
|
-
|
|
115
|
+
const r = e.examples?.at(0), s = e.default;
|
|
116
|
+
return r === void 0 && s === void 0 ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
117
|
+
r !== void 0 && /* @__PURE__ */ t.jsxs("div", { children: [
|
|
117
118
|
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Example: " }),
|
|
118
|
-
/* @__PURE__ */ t.jsx(u, { className: "border rounded-sm px-1 font-mono", children: typeof
|
|
119
|
+
/* @__PURE__ */ t.jsx(u, { className: "border rounded-sm px-1 font-mono", children: typeof r == "object" || typeof r == "boolean" ? JSON.stringify(r) : r })
|
|
119
120
|
] }),
|
|
120
|
-
|
|
121
|
+
s !== void 0 && /* @__PURE__ */ t.jsxs("div", { children: [
|
|
121
122
|
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Default: " }),
|
|
122
|
-
/* @__PURE__ */ t.jsx(u, { className: "border rounded-sm px-1 font-mono", children: typeof
|
|
123
|
+
/* @__PURE__ */ t.jsx(u, { className: "border rounded-sm px-1 font-mono", children: typeof s == "object" || typeof s == "boolean" ? JSON.stringify(s) : s })
|
|
123
124
|
] })
|
|
124
125
|
] });
|
|
125
|
-
},
|
|
126
|
-
Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "object" && Object.keys(e.properties ?? {}).length > 0 || e.type === "array" && typeof e.items == "object" && (!e.items.type || e.items.type === "object")),
|
|
126
|
+
}, M = (e) => typeof e == "string" && ["string", "number", "boolean", "integer", "null"].includes(e) || Array.isArray(e) && e.every(M), m = (e) => e.type === "array" || // schema.type might be an array of types, so we need to check if "array" is one of them
|
|
127
|
+
Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "object" && Object.keys(e.properties ?? {}).length > 0 || e.type === "array" && typeof e.items == "object" && (!e.items.type || e.items.type === "object")), B = (e) => typeof e == "string" && e.startsWith(oe), w = (e) => m(e) && "items" in e && B(e.items), ce = (e) => typeof e == "string" ? e.split(":")[1] : void 0, q = ({ circularProp: e }) => /* @__PURE__ */ t.jsxs(
|
|
127
128
|
E,
|
|
128
129
|
{
|
|
129
130
|
className: "inline-flex items-center gap-1.5 text-xs translate-y-0.5",
|
|
@@ -135,13 +136,13 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
135
136
|
}
|
|
136
137
|
), pe = ({
|
|
137
138
|
name: e,
|
|
138
|
-
schema:
|
|
139
|
-
group:
|
|
139
|
+
schema: r,
|
|
140
|
+
group: s,
|
|
140
141
|
defaultOpen: i = !1,
|
|
141
142
|
showCollapseButton: o = !0
|
|
142
143
|
}) => {
|
|
143
144
|
const [n, l] = f(i);
|
|
144
|
-
if (
|
|
145
|
+
if (B(r))
|
|
145
146
|
return /* @__PURE__ */ t.jsx(P, { children: /* @__PURE__ */ t.jsxs(g, { className: "gap-y-2", children: [
|
|
146
147
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
147
148
|
/* @__PURE__ */ t.jsx($, { className: "inline me-2", children: /* @__PURE__ */ t.jsx("code", { children: e }) }),
|
|
@@ -149,17 +150,17 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
149
150
|
v,
|
|
150
151
|
{
|
|
151
152
|
className: "inline",
|
|
152
|
-
schema:
|
|
153
|
+
schema: r,
|
|
153
154
|
extraItems: [
|
|
154
|
-
|
|
155
|
+
s !== "optional" && /* @__PURE__ */ t.jsx("span", { className: "text-primary", children: "required" }),
|
|
155
156
|
/* @__PURE__ */ t.jsx(q, {}, "circular-ref")
|
|
156
157
|
]
|
|
157
158
|
}
|
|
158
159
|
)
|
|
159
160
|
] }),
|
|
160
|
-
/* @__PURE__ */ t.jsx(I, { schema:
|
|
161
|
+
/* @__PURE__ */ t.jsx(I, { schema: r })
|
|
161
162
|
] }) });
|
|
162
|
-
const d = !!((
|
|
163
|
+
const d = !!((r.allOf || r.anyOf || r.oneOf || k(r) || m(r) && "items" in r && k(r.items) || r.additionalProperties) && !w(r)), c = !!(r.description || "items" in r && r.items?.enum || r.const || r.enum || r.example !== void 0 || r.default !== void 0);
|
|
163
164
|
return /* @__PURE__ */ t.jsxs(P, { children: [
|
|
164
165
|
/* @__PURE__ */ t.jsxs(g, { className: "gap-y-2", children: [
|
|
165
166
|
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
@@ -176,29 +177,29 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
176
177
|
v,
|
|
177
178
|
{
|
|
178
179
|
className: "inline",
|
|
179
|
-
schema:
|
|
180
|
+
schema: r,
|
|
180
181
|
extraItems: [
|
|
181
|
-
|
|
182
|
-
w(
|
|
182
|
+
s !== "optional" && /* @__PURE__ */ t.jsx("span", { className: "text-primary", children: "required" }),
|
|
183
|
+
w(r) && /* @__PURE__ */ t.jsx(
|
|
183
184
|
q,
|
|
184
185
|
{
|
|
185
|
-
circularProp: ce(
|
|
186
|
+
circularProp: ce(r.items)
|
|
186
187
|
}
|
|
187
188
|
)
|
|
188
189
|
]
|
|
189
190
|
}
|
|
190
191
|
)
|
|
191
192
|
] }),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
"items" in
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
/* @__PURE__ */ t.jsx(I, { schema:
|
|
193
|
+
c && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
194
|
+
r.description && /* @__PURE__ */ t.jsx(V, { className: "prose-sm", content: r.description }),
|
|
195
|
+
"items" in r && r.items?.enum && /* @__PURE__ */ t.jsx(h, { values: r.items.enum }),
|
|
196
|
+
r.const && /* @__PURE__ */ t.jsx(R, { schema: r, hideDescription: !0 }),
|
|
197
|
+
r.enum && /* @__PURE__ */ t.jsx(h, { values: r.enum }),
|
|
198
|
+
/* @__PURE__ */ t.jsx(I, { schema: r })
|
|
198
199
|
] })
|
|
199
200
|
] }),
|
|
200
201
|
d && o && /* @__PURE__ */ t.jsx(X, { className: "self-start", children: /* @__PURE__ */ t.jsx(
|
|
201
|
-
|
|
202
|
+
re,
|
|
202
203
|
{
|
|
203
204
|
variant: "ghost",
|
|
204
205
|
size: "icon",
|
|
@@ -215,54 +216,54 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
215
216
|
open: n,
|
|
216
217
|
onOpenChange: l,
|
|
217
218
|
className: j("w-full", !n && "contents"),
|
|
218
|
-
children: /* @__PURE__ */ t.jsx(F.Content, { asChild: !0, children: /* @__PURE__ */ t.jsx(g, { children:
|
|
219
|
+
children: /* @__PURE__ */ t.jsx(F.Content, { asChild: !0, children: /* @__PURE__ */ t.jsx(g, { children: r.anyOf || r.oneOf || r.type === "object" ? /* @__PURE__ */ t.jsx(x, { schema: r }) : m(r) && "items" in r ? /* @__PURE__ */ t.jsx(x, { schema: r.items }) : null }) })
|
|
219
220
|
}
|
|
220
221
|
)
|
|
221
222
|
] });
|
|
222
223
|
}, z = (e) => {
|
|
223
|
-
const
|
|
224
|
-
return e.properties && Object.keys(e.properties).length > 0 ?
|
|
225
|
-
...
|
|
224
|
+
const r = e.oneOf ?? e.anyOf ?? [];
|
|
225
|
+
return e.properties && Object.keys(e.properties).length > 0 ? r.map((s) => !s.properties && !s.type && !s.oneOf && !s.anyOf ? {
|
|
226
|
+
...s,
|
|
226
227
|
type: "object",
|
|
227
228
|
properties: e.properties,
|
|
228
|
-
required:
|
|
229
|
-
} :
|
|
229
|
+
required: s.required ?? e.required
|
|
230
|
+
} : s) : r;
|
|
230
231
|
}, xe = (e) => {
|
|
231
232
|
if (Array.isArray(e.oneOf)) return "exactly-one";
|
|
232
|
-
const
|
|
233
|
-
if (!
|
|
234
|
-
const
|
|
235
|
-
for (const o of
|
|
236
|
-
const n = o.properties?.[
|
|
233
|
+
const r = e.discriminator?.propertyName;
|
|
234
|
+
if (!r) return "at-least-one";
|
|
235
|
+
const s = z(e), i = /* @__PURE__ */ new Set();
|
|
236
|
+
for (const o of s) {
|
|
237
|
+
const n = o.properties?.[r], l = n?.const ?? (Array.isArray(n?.enum) && n.enum.length === 1 ? String(n.enum[0]) : void 0);
|
|
237
238
|
if (l == null || i.has(String(l))) return "at-least-one";
|
|
238
239
|
i.add(String(l));
|
|
239
240
|
}
|
|
240
241
|
return "exactly-one";
|
|
241
|
-
}, O = (e,
|
|
242
|
-
const
|
|
243
|
-
e.type &&
|
|
242
|
+
}, O = (e, r) => r.title?.trim() || `Variant ${e + 1}`, ue = (e, r) => {
|
|
243
|
+
const s = [];
|
|
244
|
+
e.type && s.push(
|
|
244
245
|
`type = ${Array.isArray(e.type) ? e.type.join("|") : e.type}`
|
|
245
246
|
);
|
|
246
|
-
const i =
|
|
247
|
+
const i = r?.discriminator?.propertyName;
|
|
247
248
|
if (i) {
|
|
248
249
|
const n = e.properties?.[i], l = n?.const ?? (Array.isArray(n?.enum) && n.enum.length === 1 ? n.enum[0] : void 0);
|
|
249
|
-
l !== void 0 &&
|
|
250
|
+
l !== void 0 && s.push(`${i}=${JSON.stringify(l)}`);
|
|
250
251
|
}
|
|
251
252
|
const o = (e.required ?? []).filter((n) => n !== i);
|
|
252
253
|
if (o.length) {
|
|
253
254
|
const n = o.slice(0, 3).join(", "), l = o.length > 3 ? ` +${o.length - 3} more` : "";
|
|
254
|
-
|
|
255
|
+
s.push(`requires: ${n}${l}`);
|
|
255
256
|
}
|
|
256
|
-
return
|
|
257
|
+
return s;
|
|
257
258
|
}, me = ({
|
|
258
259
|
variants: e,
|
|
259
|
-
schema:
|
|
260
|
-
selectedVariant:
|
|
260
|
+
schema: r,
|
|
261
|
+
selectedVariant: s,
|
|
261
262
|
onSelectVariant: i
|
|
262
263
|
}) => {
|
|
263
264
|
const o = e.map((n, l) => ({
|
|
264
265
|
label: O(l, n),
|
|
265
|
-
guards: ue(n,
|
|
266
|
+
guards: ue(n, r)
|
|
266
267
|
}));
|
|
267
268
|
return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2 text-sm", children: [
|
|
268
269
|
/* @__PURE__ */ t.jsx("h4", { className: "font-medium", children: "Decision Table" }),
|
|
@@ -278,7 +279,7 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
278
279
|
type: "button",
|
|
279
280
|
className: j(
|
|
280
281
|
"hover:underline",
|
|
281
|
-
|
|
282
|
+
s === n.label && "text-primary"
|
|
282
283
|
),
|
|
283
284
|
onClick: () => i(n.label),
|
|
284
285
|
children: n.label
|
|
@@ -290,12 +291,12 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
290
291
|
] });
|
|
291
292
|
}, fe = ({
|
|
292
293
|
schema: e,
|
|
293
|
-
cardHeader:
|
|
294
|
+
cardHeader: r
|
|
294
295
|
}) => {
|
|
295
|
-
const
|
|
296
|
+
const s = Array.isArray(e.oneOf) ? "oneOf" : Array.isArray(e.anyOf) ? "anyOf" : void 0, i = s ? z(e) : [], [o, n] = f(
|
|
296
297
|
() => i[0] ? O(0, i[0]) : ""
|
|
297
298
|
);
|
|
298
|
-
if (!
|
|
299
|
+
if (!s) return null;
|
|
299
300
|
const d = xe(e) === "exactly-one" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
300
301
|
"Exactly one variant ",
|
|
301
302
|
/* @__PURE__ */ t.jsx("b", { children: "must match" }),
|
|
@@ -307,14 +308,14 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
307
308
|
" ",
|
|
308
309
|
/* @__PURE__ */ t.jsx("i", { children: "may match" }),
|
|
309
310
|
" simultaneously."
|
|
310
|
-
] }),
|
|
311
|
-
(
|
|
312
|
-
), a =
|
|
311
|
+
] }), c = i.findIndex(
|
|
312
|
+
(p, y) => O(y, p) === o
|
|
313
|
+
), a = c >= 0 ? i[c] : null;
|
|
313
314
|
return /* @__PURE__ */ t.jsxs(ne, { children: [
|
|
314
|
-
|
|
315
|
+
r,
|
|
315
316
|
/* @__PURE__ */ t.jsxs(ie, { className: "text-sm flex flex-col gap-4", children: [
|
|
316
317
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
317
|
-
/* @__PURE__ */ t.jsx(
|
|
318
|
+
/* @__PURE__ */ t.jsx(se, { variant: "outline", children: s }),
|
|
318
319
|
/* @__PURE__ */ t.jsx("div", { className: "flex-1 p-2", children: /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: d }) })
|
|
319
320
|
] }),
|
|
320
321
|
/* @__PURE__ */ t.jsx(
|
|
@@ -340,52 +341,52 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
340
341
|
className: "text-sm leading-normal line-clamp-4",
|
|
341
342
|
content: e
|
|
342
343
|
}
|
|
343
|
-
), ye = (e,
|
|
344
|
+
), ye = (e, r, s) => {
|
|
344
345
|
const i = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
345
346
|
/* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ t.jsx(v, { schema: e }) }),
|
|
346
|
-
e.enum && /* @__PURE__ */ t.jsx(
|
|
347
|
+
e.enum && /* @__PURE__ */ t.jsx(h, { values: e.enum }),
|
|
347
348
|
je(e.description),
|
|
348
349
|
/* @__PURE__ */ t.jsx(I, { schema: e })
|
|
349
350
|
] });
|
|
350
|
-
return
|
|
351
|
-
|
|
352
|
-
/* @__PURE__ */ t.jsx(
|
|
351
|
+
return s ? /* @__PURE__ */ t.jsx("div", { className: "space-y-2 p-4", children: i }) : /* @__PURE__ */ t.jsxs(N, { children: [
|
|
352
|
+
r,
|
|
353
|
+
/* @__PURE__ */ t.jsx(b, { className: "space-y-2", children: i })
|
|
353
354
|
] });
|
|
354
355
|
}, x = ({
|
|
355
356
|
schema: e,
|
|
356
|
-
defaultOpen:
|
|
357
|
-
cardHeader:
|
|
357
|
+
defaultOpen: r = !1,
|
|
358
|
+
cardHeader: s,
|
|
358
359
|
embedded: i
|
|
359
360
|
}) => {
|
|
360
361
|
if (!e || Object.keys(e).length === 0)
|
|
361
362
|
return /* @__PURE__ */ t.jsxs(N, { children: [
|
|
362
|
-
|
|
363
|
-
/* @__PURE__ */ t.jsx(
|
|
363
|
+
s,
|
|
364
|
+
/* @__PURE__ */ t.jsx(b, { children: /* @__PURE__ */ t.jsx("div", { className: "text-sm text-muted-foreground italic", children: "No data returned" }) })
|
|
364
365
|
] });
|
|
365
366
|
if (e.const)
|
|
366
367
|
return /* @__PURE__ */ t.jsx(R, { schema: e });
|
|
367
368
|
if (Array.isArray(e.oneOf) || Array.isArray(e.anyOf))
|
|
368
|
-
return /* @__PURE__ */ t.jsx(fe, { schema: e, cardHeader:
|
|
369
|
-
if (
|
|
370
|
-
return ye(e,
|
|
369
|
+
return /* @__PURE__ */ t.jsx(fe, { schema: e, cardHeader: s });
|
|
370
|
+
if (M(e.type))
|
|
371
|
+
return ye(e, s, i);
|
|
371
372
|
if (m(e) && typeof e.items == "object") {
|
|
372
373
|
const n = {
|
|
373
374
|
type: "object",
|
|
374
375
|
properties: { "": e }
|
|
375
376
|
};
|
|
376
|
-
return /* @__PURE__ */ t.jsx(x, { schema: n, cardHeader:
|
|
377
|
+
return /* @__PURE__ */ t.jsx(x, { schema: n, cardHeader: s, defaultOpen: !0 });
|
|
377
378
|
}
|
|
378
379
|
const o = typeof e.additionalProperties == "object" && /* @__PURE__ */ t.jsx(x, { schema: e.additionalProperties, embedded: !0 });
|
|
379
380
|
if (e.type === "object") {
|
|
380
381
|
const n = le(
|
|
381
382
|
Object.entries(e.properties ?? {}),
|
|
382
|
-
([a,
|
|
383
|
-
),
|
|
384
|
-
const
|
|
385
|
-
return
|
|
386
|
-
}).map(({ group: a, properties:
|
|
383
|
+
([a, p]) => p.deprecated ? "deprecated" : e.required?.includes(a) ? "required" : "optional"
|
|
384
|
+
), c = ["required", "optional", "deprecated"].flatMap((a) => {
|
|
385
|
+
const p = n[a];
|
|
386
|
+
return p ? { group: a, properties: p } : [];
|
|
387
|
+
}).map(({ group: a, properties: p }, y) => /* @__PURE__ */ t.jsxs(C, { children: [
|
|
387
388
|
y > 0 && /* @__PURE__ */ t.jsx(S, {}),
|
|
388
|
-
/* @__PURE__ */ t.jsx(Y, { className: "overflow-clip", children:
|
|
389
|
+
/* @__PURE__ */ t.jsx(Y, { className: "overflow-clip", children: p.map(([A, D], L) => /* @__PURE__ */ t.jsxs(C, { children: [
|
|
389
390
|
L > 0 && /* @__PURE__ */ t.jsx(S, {}),
|
|
390
391
|
/* @__PURE__ */ t.jsx(
|
|
391
392
|
pe,
|
|
@@ -393,16 +394,16 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
393
394
|
name: A,
|
|
394
395
|
schema: D,
|
|
395
396
|
group: a,
|
|
396
|
-
defaultOpen:
|
|
397
|
+
defaultOpen: r
|
|
397
398
|
}
|
|
398
399
|
)
|
|
399
400
|
] }, A)) })
|
|
400
401
|
] }, a));
|
|
401
|
-
return i ?
|
|
402
|
-
|
|
402
|
+
return i ? c : /* @__PURE__ */ t.jsxs(N, { children: [
|
|
403
|
+
s,
|
|
403
404
|
e.description && /* @__PURE__ */ t.jsx(Z, { children: /* @__PURE__ */ t.jsx(H, { children: e.description }) }),
|
|
404
|
-
/* @__PURE__ */ t.jsxs(
|
|
405
|
-
|
|
405
|
+
(c.length > 0 || o) && /* @__PURE__ */ t.jsxs(b, { className: "p-0!", children: [
|
|
406
|
+
c,
|
|
406
407
|
o
|
|
407
408
|
] }),
|
|
408
409
|
e.additionalProperties === !0 && /* @__PURE__ */ t.jsx(ee, { children: /* @__PURE__ */ t.jsxs(
|
|
@@ -422,13 +423,13 @@ Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "
|
|
|
422
423
|
}
|
|
423
424
|
};
|
|
424
425
|
export {
|
|
425
|
-
|
|
426
|
+
h as E,
|
|
426
427
|
Se as P,
|
|
427
428
|
x as S,
|
|
428
429
|
v as a,
|
|
429
430
|
I as b,
|
|
430
|
-
|
|
431
|
+
B as c,
|
|
431
432
|
le as g,
|
|
432
433
|
m as i
|
|
433
434
|
};
|
|
434
|
-
//# sourceMappingURL=SchemaView-
|
|
435
|
+
//# sourceMappingURL=SchemaView-G-SVXxAG.js.map
|