zudoku 0.3.0-dev.14 → 0.3.0-dev.140
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/cli.js +5 -1
- package/dist/app/App.d.ts +1 -2
- package/dist/app/App.js +1 -31
- package/dist/app/App.js.map +1 -1
- package/dist/app/demo.d.ts +2 -0
- package/dist/app/demo.js +48 -0
- package/dist/app/demo.js.map +1 -0
- package/dist/app/entry.client.d.ts +2 -0
- package/dist/app/entry.client.js +35 -0
- package/dist/app/entry.client.js.map +1 -0
- package/dist/app/entry.server.d.ts +14 -0
- package/dist/app/entry.server.js +105 -0
- package/dist/app/entry.server.js.map +1 -0
- package/dist/app/main.d.ts +6 -1
- package/dist/app/main.js +81 -12
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +53 -0
- package/dist/app/standalone.js.map +1 -0
- package/dist/app/tailwind.d.ts +1 -1
- package/dist/app/tailwind.js +0 -4
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cmds/dev.js +5 -0
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/dev/handler.d.ts +1 -0
- package/dist/cli/dev/handler.js +4 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +17 -34
- package/dist/config/validators/InputSidebarSchema.d.ts +176 -0
- package/dist/config/validators/InputSidebarSchema.js +71 -0
- package/dist/config/validators/InputSidebarSchema.js.map +1 -0
- package/dist/config/validators/SidebarSchema.d.ts +17 -0
- package/dist/config/validators/SidebarSchema.js +81 -0
- package/dist/config/validators/SidebarSchema.js.map +1 -0
- package/dist/config/validators/validate.d.ts +1323 -2
- package/dist/config/validators/validate.js +179 -1
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -0
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +13 -0
- package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
- package/dist/lib/authentication/authentication.d.ts +10 -9
- package/dist/lib/authentication/components/SignIn.d.ts +1 -0
- package/dist/lib/authentication/components/SignIn.js +14 -0
- package/dist/lib/authentication/components/SignIn.js.map +1 -0
- package/dist/lib/authentication/components/SignOut.d.ts +1 -0
- package/dist/lib/authentication/components/SignOut.js +12 -0
- package/dist/lib/authentication/components/SignOut.js.map +1 -0
- package/dist/lib/authentication/components/SignUp.d.ts +1 -0
- package/dist/lib/authentication/components/SignUp.js +10 -0
- package/dist/lib/authentication/components/SignUp.js.map +1 -0
- package/dist/lib/authentication/hook.js +4 -4
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +11 -6
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +59 -30
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +30 -7
- package/dist/lib/authentication/providers/openid.js +79 -29
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.js +1 -1
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +13 -0
- package/dist/lib/components/Bootstrap.js +12 -0
- package/dist/lib/components/Bootstrap.js.map +1 -0
- package/dist/lib/components/ClientOnly.d.ts +3 -0
- package/dist/lib/components/ClientOnly.js +7 -0
- package/dist/lib/components/ClientOnly.js.map +1 -0
- package/dist/lib/components/DevPortal.d.ts +4 -4
- package/dist/lib/components/DevPortal.js +37 -19
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/DeveloperHint.d.ts +5 -0
- package/dist/lib/components/DeveloperHint.js +10 -0
- package/dist/lib/components/DeveloperHint.js.map +1 -0
- package/dist/lib/components/ErrorPage.d.ts +6 -0
- package/dist/lib/components/ErrorPage.js +9 -0
- package/dist/lib/components/ErrorPage.js.map +1 -0
- package/dist/lib/components/Header.js +26 -5
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/InlineCode.d.ts +5 -0
- package/dist/lib/components/InlineCode.js +4 -0
- package/dist/lib/components/InlineCode.js.map +1 -0
- package/dist/lib/components/Layout.js +7 -5
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +3 -2
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/NotFoundPage.d.ts +1 -0
- package/dist/lib/components/NotFoundPage.js +12 -0
- package/dist/lib/components/NotFoundPage.js.map +1 -0
- package/dist/lib/components/Search.d.ts +1 -0
- package/dist/lib/components/Search.js +34 -0
- package/dist/lib/components/Search.js.map +1 -0
- package/dist/lib/components/SlotletProvider.d.ts +9 -0
- package/dist/lib/components/SlotletProvider.js +16 -0
- package/dist/lib/components/SlotletProvider.js.map +1 -0
- package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
- package/dist/lib/components/SyntaxHighlight.js +24 -22
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/TopNavigation.js +8 -4
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ThemeContext.d.ts +1 -4
- package/dist/lib/components/context/ThemeContext.js +3 -29
- package/dist/lib/components/context/ThemeContext.js.map +1 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +4 -0
- package/dist/lib/components/context/ThemeProvider.js +23 -0
- package/dist/lib/components/context/ThemeProvider.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +15 -0
- package/dist/lib/components/context/ZudokuContext.js +46 -0
- package/dist/lib/components/context/ZudokuContext.js.map +1 -0
- package/dist/lib/components/context/ZudokuProvider.d.ts +5 -0
- package/dist/lib/components/context/ZudokuProvider.js +16 -0
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -0
- package/dist/lib/components/index.d.ts +32 -3
- package/dist/lib/components/index.js +21 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +1 -0
- package/dist/lib/components/navigation/Sidebar.js +12 -0
- package/dist/lib/components/navigation/Sidebar.js.map +1 -0
- package/dist/lib/components/navigation/SidebarBadge.d.ts +23 -0
- package/dist/lib/components/navigation/SidebarBadge.js +24 -0
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -0
- package/dist/lib/components/navigation/SidebarCategory.d.ts +5 -0
- package/dist/lib/components/navigation/SidebarCategory.js +37 -0
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -0
- package/dist/lib/components/navigation/SidebarItem.d.ts +12 -0
- package/dist/lib/components/navigation/SidebarItem.js +43 -0
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -0
- package/dist/lib/components/navigation/{SideNavigationWrapper.d.ts → SidebarWrapper.d.ts} +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +6 -0
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -0
- package/dist/lib/components/navigation/utils.d.ts +16 -0
- package/dist/lib/components/navigation/utils.js +85 -0
- package/dist/lib/components/navigation/utils.js.map +1 -0
- package/dist/lib/core/DevPortalContext.d.ts +34 -48
- package/dist/lib/core/DevPortalContext.js +15 -18
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +27 -8
- package/dist/lib/core/plugins.js +3 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +3 -0
- package/dist/lib/errors/ErrorAlert.js +8 -0
- package/dist/lib/errors/ErrorAlert.js.map +1 -0
- package/dist/lib/errors/RouterError.d.ts +1 -0
- package/dist/lib/errors/RouterError.js +12 -0
- package/dist/lib/errors/RouterError.js.map +1 -0
- package/dist/lib/errors/ServerError.d.ts +3 -0
- package/dist/lib/errors/ServerError.js +6 -0
- package/dist/lib/errors/ServerError.js.map +1 -0
- package/dist/lib/errors/TopLevelError.d.ts +2 -0
- package/dist/lib/errors/TopLevelError.js +7 -0
- package/dist/lib/errors/TopLevelError.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +34 -10
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -1
- package/dist/lib/oas/parser/index.js +38 -14
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +4 -4
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +54 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
- package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +4 -5
- package/dist/lib/plugins/{api-key → api-keys}/index.js +18 -20
- package/dist/lib/plugins/api-keys/index.js.map +1 -0
- package/dist/lib/plugins/custom-page/index.d.ts +8 -0
- package/dist/lib/plugins/custom-page/index.js +12 -0
- package/dist/lib/plugins/custom-page/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.js +7 -38
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/Toc.js +17 -9
- package/dist/lib/plugins/markdown/Toc.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.js +20 -43
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/markdown/index.js +3 -7
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.d.ts +2 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +14 -9
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +14 -3
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +7 -5
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +4 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +8 -28
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +3 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +3 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +5 -9
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +6 -0
- package/dist/lib/plugins/openapi/Route.js +8 -0
- package/dist/lib/plugins/openapi/Route.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.d.ts +7 -1
- package/dist/lib/plugins/openapi/Sidecar.js +58 -20
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.d.ts +1 -0
- package/dist/lib/plugins/openapi/SidecarBox.js +3 -2
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -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/StaggeredRender.d.ts +8 -0
- package/dist/lib/plugins/openapi/StaggeredRender.js +18 -0
- package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
- package/dist/lib/plugins/openapi/{worker/worker.js → client/createServer.js} +5 -19
- package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
- package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
- package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/client/worker.js +20 -0
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
- package/dist/lib/plugins/openapi/context.d.ts +5 -0
- package/dist/lib/plugins/openapi/context.js +11 -0
- package/dist/lib/plugins/openapi/context.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -6
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +15 -15
- package/dist/lib/plugins/openapi/graphql/graphql.js +67 -67
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +4 -18
- package/dist/lib/plugins/openapi/index.js +79 -34
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +16 -0
- package/dist/lib/plugins/openapi/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +4 -5
- package/dist/lib/plugins/openapi/playground/PathParams.js +9 -13
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +23 -11
- package/dist/lib/plugins/openapi/playground/Playground.js +51 -20
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +4 -3
- package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -12
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +4 -0
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +40 -0
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js +9 -9
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.d.ts +13 -0
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js +28 -0
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +6 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.js +58 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/utils.d.ts +3 -0
- package/dist/lib/plugins/openapi/schema/utils.js +6 -0
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -0
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +1 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +0 -1
- package/dist/lib/plugins/redirect/index.js +3 -4
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.d.ts +2 -0
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js +3 -0
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js.map +1 -0
- package/dist/lib/plugins/search-inkeep/index.d.ts +6 -0
- package/dist/lib/plugins/search-inkeep/index.js +18 -0
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -0
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +23 -0
- package/dist/lib/plugins/search-inkeep/inkeep.js +23 -0
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -0
- package/dist/lib/themeToggle.d.ts +1 -0
- package/dist/lib/themeToggle.js +7 -0
- package/dist/lib/themeToggle.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +5 -1
- package/dist/lib/ui/Button.js +24 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.js +2 -2
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Card.js +1 -1
- package/dist/lib/ui/Card.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +27 -0
- package/dist/lib/ui/DropdownMenu.js +36 -0
- package/dist/lib/ui/DropdownMenu.js.map +1 -0
- package/dist/lib/ui/Input.js.map +1 -0
- package/dist/lib/util/MdxComponents.d.ts +2 -2
- package/dist/lib/util/MdxComponents.js +9 -7
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/fetchTimeout.d.ts +1 -0
- package/dist/lib/util/fetchTimeout.js +14 -0
- package/dist/lib/util/fetchTimeout.js.map +1 -0
- package/dist/lib/util/groupBy.d.ts +1 -6
- package/dist/lib/util/groupBy.js +10 -8
- package/dist/lib/util/groupBy.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +6 -0
- package/dist/lib/util/invariant.js +21 -0
- package/dist/lib/util/invariant.js.map +1 -0
- package/dist/lib/util/joinPath.js +3 -2
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/lib/util/logInit.d.ts +1 -0
- package/dist/lib/util/logInit.js +9 -0
- package/dist/lib/util/logInit.js.map +1 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.d.ts +1 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.js +7 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.js.map +1 -0
- package/dist/lib/util/useScrollToAnchor.js +31 -17
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/build.js +30 -7
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +20 -12
- package/dist/vite/config.js +110 -55
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +7 -4
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.d.ts +2 -2
- package/dist/vite/dev-server.js +38 -28
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +9 -5
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api-keys.d.ts +3 -3
- package/dist/vite/plugin-api-keys.js +9 -9
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +3 -3
- package/dist/vite/plugin-api.js +10 -25
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.d.ts +3 -3
- package/dist/vite/plugin-auth.js +7 -7
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +4 -4
- package/dist/vite/plugin-component.js +18 -10
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +4 -0
- package/dist/vite/plugin-config-reload.js +24 -0
- package/dist/vite/plugin-config-reload.js.map +1 -0
- package/dist/vite/plugin-config.d.ts +2 -4
- package/dist/vite/plugin-config.js +2 -13
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-css.d.ts +6 -0
- package/dist/vite/plugin-custom-css.js +55 -0
- package/dist/vite/plugin-custom-css.js.map +1 -0
- package/dist/vite/plugin-docs.d.ts +3 -3
- package/dist/vite/plugin-docs.js +12 -5
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-html-transform.d.ts +2 -0
- package/dist/vite/plugin-html-transform.js +15 -0
- package/dist/vite/plugin-html-transform.js.map +1 -0
- package/dist/vite/plugin-mdx.d.ts +4 -2
- package/dist/vite/plugin-mdx.js +6 -5
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-metadata.d.ts +1 -1
- package/dist/vite/plugin-metadata.js +1 -1
- package/dist/vite/plugin-metadata.js.map +1 -1
- package/dist/vite/plugin-redirect.d.ts +3 -3
- package/dist/vite/plugin-redirect.js +12 -11
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +3 -0
- package/dist/vite/plugin-sidebar.js +24 -0
- package/dist/vite/plugin-sidebar.js.map +1 -0
- package/dist/vite/plugin.d.ts +3 -2
- package/dist/vite/plugin.js +19 -14
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +17 -0
- package/dist/vite/prerender.js +79 -0
- package/dist/vite/prerender.js.map +1 -0
- package/lib/AuthenticationPlugin-CH5NSVOu.js +55 -0
- package/lib/AuthenticationPlugin-CH5NSVOu.js.map +1 -0
- package/lib/CategoryHeading-z15xh7Jb.js +10 -0
- package/lib/CategoryHeading-z15xh7Jb.js.map +1 -0
- package/lib/Combination-DTfV-c98.js +2789 -0
- package/lib/Combination-DTfV-c98.js.map +1 -0
- package/lib/DeveloperHint-BQSFXH01.js +10 -0
- package/lib/DeveloperHint-BQSFXH01.js.map +1 -0
- package/lib/InkeepCustomTrigger-CE5-K5ex.js +6 -0
- package/lib/InkeepCustomTrigger-CE5-K5ex.js.map +1 -0
- package/lib/Input-DB9VROFR.js +2239 -0
- package/lib/Input-DB9VROFR.js.map +1 -0
- package/lib/Markdown-CEccPMI_.js +20508 -0
- package/lib/Markdown-CEccPMI_.js.map +1 -0
- package/lib/MdxPage-CnqOoqvp.js +184 -0
- package/lib/MdxPage-CnqOoqvp.js.map +1 -0
- package/lib/OperationList-Cxiw2Z-v.js +457 -0
- package/lib/OperationList-Cxiw2Z-v.js.map +1 -0
- package/lib/Route-DfAFiR7v.js +14 -0
- package/lib/Route-DfAFiR7v.js.map +1 -0
- package/lib/SlotletProvider-ByLSCZQa.js +262 -0
- package/lib/SlotletProvider-ByLSCZQa.js.map +1 -0
- package/lib/Spinner-BT_AYFrA.js +276 -0
- package/lib/Spinner-BT_AYFrA.js.map +1 -0
- package/lib/ZudokuContext-BIZ8zHbZ.js +1084 -0
- package/lib/ZudokuContext-BIZ8zHbZ.js.map +1 -0
- package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
- package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
- package/lib/assets/index-BPdJm2ty.js +1 -0
- package/lib/assets/index-BPdJm2ty.js.map +1 -0
- package/lib/assets/{worker-DGvzLstc.js → worker-CzHUifWA.js} +3124 -2733
- package/lib/assets/worker-CzHUifWA.js.map +1 -0
- package/lib/index-7kcHaXD6.js +1771 -0
- package/lib/index-7kcHaXD6.js.map +1 -0
- package/lib/index-D-9zqIOh.js +5954 -0
- package/lib/index-D-9zqIOh.js.map +1 -0
- package/lib/index-Dz4LyXZI.js +124 -0
- package/lib/index-Dz4LyXZI.js.map +1 -0
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/index-pI9JkN46.js.map +1 -0
- package/lib/joinPath-B7kNnUX4.js +8 -0
- package/lib/joinPath-B7kNnUX4.js.map +1 -0
- package/lib/jsx-runtime-B6kdoens.js +635 -0
- package/lib/jsx-runtime-B6kdoens.js.map +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
- package/lib/prism-csharp.min-Yizuc34Y.js +1 -0
- package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
- package/lib/prism-java.min-d5iT_mOd.js +1 -0
- package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
- package/lib/prism-json.min-B1GJqK1k.js +1 -0
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
- package/lib/prism-php.min-o7FpoMP_.js +1 -0
- package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
- package/lib/router-BiRCp01d.js +2971 -0
- package/lib/router-BiRCp01d.js.map +1 -0
- package/lib/slugify-CiPVjteN.js +28 -0
- package/lib/slugify-CiPVjteN.js.map +1 -0
- package/lib/state-DsXXkBLH.js +288 -0
- package/lib/state-DsXXkBLH.js.map +1 -0
- package/lib/{urql-DMlBWUKL.js → urql-DrBfkb92.js} +2 -2
- package/lib/urql-DrBfkb92.js.map +1 -0
- package/lib/utils-Bh4upQ0e.js +749 -0
- package/lib/utils-Bh4upQ0e.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +31 -20
- package/lib/zudoku.auth-auth0.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +59 -29
- package/lib/zudoku.auth-clerk.js.map +1 -0
- package/lib/zudoku.auth-openid.js +742 -573
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +2084 -701
- package/lib/zudoku.components.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +15042 -146
- package/lib/zudoku.openapi-worker.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +325 -0
- package/lib/zudoku.plugin-api-keys.js.map +1 -0
- package/lib/zudoku.plugin-custom-page.js +13 -0
- package/lib/zudoku.plugin-custom-page.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +31 -0
- package/lib/zudoku.plugin-markdown.js.map +1 -0
- package/lib/zudoku.plugin-openapi.js +14 -0
- package/lib/zudoku.plugin-openapi.js.map +1 -0
- package/lib/zudoku.plugin-redirect.js +11 -0
- package/lib/zudoku.plugin-redirect.js.map +1 -0
- package/lib/zudoku.plugin-search-inkeep.js +51 -0
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -0
- package/package.json +124 -61
- package/src/app/App.tsx +0 -44
- package/src/app/demo-cdn.html +26 -0
- package/src/app/demo.html +18 -0
- package/src/app/demo.tsx +59 -0
- package/src/app/entry.client.tsx +47 -0
- package/src/app/entry.server.tsx +160 -0
- package/src/app/main.css +105 -3
- package/src/app/main.tsx +95 -15
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +58 -0
- package/src/app/tailwind.ts +2 -6
- package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
- package/src/lib/authentication/authentication.ts +6 -9
- package/src/lib/authentication/components/SignIn.tsx +15 -0
- package/src/lib/authentication/components/SignOut.tsx +13 -0
- package/src/lib/authentication/components/SignUp.tsx +11 -0
- package/src/lib/authentication/hook.ts +4 -4
- package/src/lib/authentication/providers/auth0.tsx +16 -6
- package/src/lib/authentication/providers/clerk.tsx +63 -31
- package/src/lib/authentication/providers/openid.tsx +104 -34
- package/src/lib/authentication/state.ts +1 -1
- package/src/lib/components/Bootstrap.tsx +45 -0
- package/src/lib/components/ClientOnly.tsx +13 -0
- package/src/lib/components/DevPortal.tsx +68 -44
- package/src/lib/components/DeveloperHint.tsx +25 -0
- package/src/lib/components/ErrorPage.tsx +28 -0
- package/src/lib/components/Header.tsx +112 -41
- package/src/lib/components/InlineCode.tsx +19 -0
- package/src/lib/components/Layout.tsx +18 -10
- package/src/lib/components/Markdown.tsx +3 -2
- package/src/lib/components/NotFoundPage.tsx +33 -0
- package/src/lib/components/Search.tsx +60 -0
- package/src/lib/components/SlotletProvider.tsx +30 -0
- package/src/lib/components/SyntaxHighlight.tsx +53 -44
- package/src/lib/components/TopNavigation.tsx +10 -5
- package/src/lib/components/context/ThemeContext.tsx +3 -41
- package/src/lib/components/context/ThemeProvider.tsx +27 -0
- package/src/lib/components/context/{DevPortalProvider.ts → ZudokuContext.ts} +19 -15
- package/src/lib/components/context/ZudokuProvider.tsx +26 -0
- package/src/lib/components/index.ts +25 -3
- package/src/lib/components/navigation/Sidebar.tsx +24 -0
- package/src/lib/components/navigation/SidebarBadge.tsx +43 -0
- package/src/lib/components/navigation/SidebarCategory.tsx +116 -0
- package/src/lib/components/navigation/SidebarItem.tsx +129 -0
- package/src/lib/components/navigation/SidebarWrapper.tsx +26 -0
- package/src/lib/components/navigation/utils.ts +117 -0
- package/src/lib/core/DevPortalContext.ts +44 -68
- package/src/lib/core/plugins.ts +45 -13
- package/src/lib/errors/ErrorAlert.tsx +21 -0
- package/src/lib/errors/RouterError.tsx +13 -0
- package/src/lib/errors/ServerError.tsx +5 -0
- package/src/lib/errors/TopLevelError.tsx +8 -0
- package/src/lib/oas/graphql/index.ts +46 -16
- package/src/lib/oas/parser/index.ts +41 -22
- package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +4 -4
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
- package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +49 -16
- package/src/lib/plugins/{api-key → api-keys}/index.tsx +27 -41
- package/src/lib/plugins/custom-page/index.tsx +22 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +17 -54
- package/src/lib/plugins/markdown/Toc.tsx +53 -40
- package/src/lib/plugins/markdown/generateRoutes.tsx +30 -58
- package/src/lib/plugins/markdown/index.tsx +3 -7
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -16
- package/src/lib/plugins/openapi/OperationList.tsx +37 -7
- package/src/lib/plugins/openapi/OperationListItem.tsx +39 -34
- package/src/lib/plugins/openapi/ParameterList.tsx +15 -10
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +9 -33
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +3 -1
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +51 -40
- package/src/lib/plugins/openapi/Route.tsx +21 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +101 -44
- package/src/lib/plugins/openapi/SidecarBox.tsx +13 -2
- package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
- package/src/lib/plugins/openapi/StaggeredRender.tsx +31 -0
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
- package/src/lib/plugins/openapi/client/createServer.ts +33 -0
- package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
- package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
- package/src/lib/plugins/openapi/client/worker.ts +30 -0
- package/src/lib/plugins/openapi/context.tsx +16 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +8 -8
- package/src/lib/plugins/openapi/graphql/graphql.ts +80 -80
- package/src/lib/plugins/openapi/index.tsx +131 -75
- package/src/lib/plugins/openapi/interfaces.ts +10 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +1 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +76 -50
- package/src/lib/plugins/openapi/playground/Playground.tsx +121 -84
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +13 -7
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +107 -66
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +76 -0
- package/src/lib/plugins/openapi/playground/createUrl.ts +13 -15
- package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +126 -0
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +172 -0
- package/src/lib/plugins/openapi/schema/utils.ts +10 -0
- package/src/lib/plugins/openapi-worker.ts +1 -1
- package/src/lib/plugins/redirect/index.tsx +3 -4
- package/src/lib/plugins/search-inkeep/InkeepCustomTrigger.tsx +3 -0
- package/src/lib/plugins/search-inkeep/index.tsx +63 -0
- package/src/lib/plugins/search-inkeep/inkeep.ts +32 -0
- package/src/lib/themeToggle.ts +7 -0
- package/src/lib/ui/Button.tsx +32 -2
- package/src/lib/ui/Callout.tsx +4 -4
- package/src/lib/ui/Card.tsx +1 -1
- package/src/lib/ui/DropdownMenu.tsx +199 -0
- package/src/lib/util/MdxComponents.tsx +15 -23
- package/src/lib/util/fetchTimeout.tsx +21 -0
- package/src/lib/util/groupBy.ts +7 -12
- package/src/lib/util/invariant.ts +26 -0
- package/src/lib/util/joinPath.tsx +3 -2
- package/src/lib/util/logInit.ts +9 -0
- package/src/lib/util/requestIdleCallbackPolyfill.ts +6 -0
- package/src/lib/util/useScrollToAnchor.ts +39 -18
- package/dist/lib/authentication/Callback.d.ts +0 -3
- package/dist/lib/authentication/Callback.js +0 -34
- package/dist/lib/authentication/Callback.js.map +0 -1
- package/dist/lib/components/Input.js.map +0 -1
- package/dist/lib/components/Link.d.ts +0 -1
- package/dist/lib/components/Link.js +0 -2
- package/dist/lib/components/Link.js.map +0 -1
- package/dist/lib/components/Router.d.ts +0 -4
- package/dist/lib/components/Router.js +0 -20
- package/dist/lib/components/Router.js.map +0 -1
- package/dist/lib/components/context/DevPortalProvider.d.ts +0 -9
- package/dist/lib/components/context/DevPortalProvider.js +0 -39
- package/dist/lib/components/context/DevPortalProvider.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigation.d.ts +0 -1
- package/dist/lib/components/navigation/SideNavigation.js +0 -11
- package/dist/lib/components/navigation/SideNavigation.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationCategory.d.ts +0 -4
- package/dist/lib/components/navigation/SideNavigationCategory.js +0 -26
- package/dist/lib/components/navigation/SideNavigationCategory.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -13
- package/dist/lib/components/navigation/SideNavigationItem.js +0 -44
- package/dist/lib/components/navigation/SideNavigationItem.js.map +0 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.js +0 -7
- package/dist/lib/components/navigation/SideNavigationWrapper.js.map +0 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +0 -6
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js +0 -16
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +0 -1
- package/dist/lib/components/navigation/util.d.ts +0 -8
- package/dist/lib/components/navigation/util.js +0 -15
- package/dist/lib/components/navigation/util.js.map +0 -1
- package/dist/lib/core/helmet.d.ts +0 -4
- package/dist/lib/core/helmet.js +0 -5
- package/dist/lib/core/helmet.js.map +0 -1
- package/dist/lib/core/icons.d.ts +0 -1
- package/dist/lib/core/icons.js +0 -2
- package/dist/lib/core/icons.js.map +0 -1
- package/dist/lib/core/router.d.ts +0 -1
- package/dist/lib/core/router.js +0 -2
- package/dist/lib/core/router.js.map +0 -1
- package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
- package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
- package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
- package/dist/lib/plugins/api-key/index.js.map +0 -1
- package/dist/lib/plugins/index.d.ts +0 -4
- package/dist/lib/plugins/index.js +0 -5
- package/dist/lib/plugins/index.js.map +0 -1
- package/dist/lib/plugins/openapi/MethodBadge.d.ts +0 -13
- package/dist/lib/plugins/openapi/MethodBadge.js +0 -26
- package/dist/lib/plugins/openapi/MethodBadge.js.map +0 -1
- package/dist/lib/plugins/openapi/SchemaListView.d.ts +0 -7
- package/dist/lib/plugins/openapi/SchemaListView.js +0 -21
- package/dist/lib/plugins/openapi/SchemaListView.js.map +0 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +0 -7
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +0 -16
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +0 -1
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +0 -8
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +0 -17
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
- package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
- package/dist/lib/ui/button-variants.d.ts +0 -4
- package/dist/lib/ui/button-variants.js +0 -24
- package/dist/lib/ui/button-variants.js.map +0 -1
- package/dist/lib/util/traverseNavigation.d.ts +0 -6
- package/dist/lib/util/traverseNavigation.js +0 -30
- package/dist/lib/util/traverseNavigation.js.map +0 -1
- package/dist/vite/common.d.ts +0 -1
- package/dist/vite/common.js +0 -5
- package/dist/vite/common.js.map +0 -1
- package/dist/vite/plugin-html.d.ts +0 -3
- package/dist/vite/plugin-html.js +0 -47
- package/dist/vite/plugin-html.js.map +0 -1
- package/dist/vite/plugin-openapi-worker.d.ts +0 -4
- package/dist/vite/plugin-openapi-worker.js +0 -28
- package/dist/vite/plugin-openapi-worker.js.map +0 -1
- package/lib/Spinner-D-NVRYkd.js +0 -8458
- package/lib/clerk-Wslx_mPo.js +0 -19685
- package/lib/index-PyGcnQFX.js +0 -3462
- package/lib/loglevel-CoH7VSwE.js +0 -152
- package/lib/state-2Hu1renZ.js +0 -313
- package/lib/zudoku.plugins.js +0 -19918
- package/src/lib/authentication/Callback.tsx +0 -60
- package/src/lib/components/Link.tsx +0 -1
- package/src/lib/components/Router.tsx +0 -28
- package/src/lib/components/navigation/SideNavigation.tsx +0 -21
- package/src/lib/components/navigation/SideNavigationCategory.tsx +0 -76
- package/src/lib/components/navigation/SideNavigationItem.tsx +0 -152
- package/src/lib/components/navigation/SideNavigationWrapper.tsx +0 -24
- package/src/lib/components/navigation/useNavigationCollapsibleState.ts +0 -27
- package/src/lib/components/navigation/util.ts +0 -38
- package/src/lib/core/helmet.ts +0 -5
- package/src/lib/core/icons.tsx +0 -1
- package/src/lib/core/router.tsx +0 -1
- package/src/lib/plugins/index.ts +0 -4
- package/src/lib/plugins/openapi/MethodBadge.tsx +0 -36
- package/src/lib/plugins/openapi/SchemaListView.tsx +0 -61
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +0 -110
- package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +0 -63
- package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
- package/src/lib/plugins/openapi/worker/worker.ts +0 -56
- package/src/lib/ui/button-variants.ts +0 -31
- package/src/lib/util/traverseNavigation.ts +0 -55
- /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
- /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
- /package/dist/lib/{components → ui}/Input.d.ts +0 -0
- /package/dist/lib/{components → ui}/Input.js +0 -0
- /package/src/lib/{components → ui}/Input.tsx +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { NavigateFunction } from "react-router-dom";
|
|
3
|
+
import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
|
|
4
4
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
5
5
|
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
6
|
-
import {
|
|
6
|
+
import { Slotlets } from "../components/SlotletProvider.js";
|
|
7
|
+
import { joinPath } from "../util/joinPath.js";
|
|
7
8
|
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
8
9
|
import {
|
|
9
10
|
type DevPortalPlugin,
|
|
@@ -19,53 +20,12 @@ export interface ApiIdentity {
|
|
|
19
20
|
id: string;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
type BaseNavigationCategoryItem = {
|
|
23
|
-
label: ReactNode;
|
|
24
|
-
title?: string;
|
|
25
|
-
muted?: boolean;
|
|
26
|
-
icon?: ReactNode;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type PathNavigationCategoryItem = BaseNavigationCategoryItem & {
|
|
30
|
-
path: string;
|
|
31
|
-
children?: NavigationCategoryItem[];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type HrefNavigationCategoryItem = BaseNavigationCategoryItem & {
|
|
35
|
-
href: string;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type NavigationCategoryItem =
|
|
39
|
-
| PathNavigationCategoryItem
|
|
40
|
-
| HrefNavigationCategoryItem;
|
|
41
|
-
|
|
42
|
-
export type NavigationCategory = {
|
|
43
|
-
label: string;
|
|
44
|
-
path?: string;
|
|
45
|
-
expanded?: boolean;
|
|
46
|
-
collapsible?: boolean;
|
|
47
|
-
icon?: ReactNode;
|
|
48
|
-
children: NavigationCategoryItem[];
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export type NavigationItem = {
|
|
52
|
-
label: string;
|
|
53
|
-
path: DevPortalPath;
|
|
54
|
-
categories?: NavigationCategory[];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export type RoutingState = {
|
|
58
|
-
path?: string;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
23
|
export const queryClient = new QueryClient();
|
|
62
24
|
|
|
63
|
-
export const useRoutingState = create<RoutingState>(() => ({}));
|
|
64
|
-
|
|
65
25
|
export type ApiKeyCache = "api-keys";
|
|
66
26
|
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
67
27
|
|
|
68
|
-
|
|
28
|
+
type Metadata = Partial<{
|
|
69
29
|
title: string;
|
|
70
30
|
description: string;
|
|
71
31
|
logo: string;
|
|
@@ -78,46 +38,62 @@ export type ZudokuContextMetadataOptions = Partial<{
|
|
|
78
38
|
creator: string;
|
|
79
39
|
publisher: string;
|
|
80
40
|
}>;
|
|
81
|
-
|
|
41
|
+
|
|
42
|
+
type Page = Partial<{
|
|
82
43
|
pageTitle?: string;
|
|
83
|
-
logo?:
|
|
44
|
+
logo?: {
|
|
45
|
+
src: {
|
|
46
|
+
light: string;
|
|
47
|
+
dark: string;
|
|
48
|
+
};
|
|
49
|
+
width?: string;
|
|
50
|
+
alt?: string;
|
|
51
|
+
};
|
|
84
52
|
}>;
|
|
53
|
+
|
|
85
54
|
export type ZudokuContextOptions = {
|
|
86
|
-
metadata?:
|
|
87
|
-
page?:
|
|
55
|
+
metadata?: Metadata;
|
|
56
|
+
page?: Page;
|
|
88
57
|
authentication?: AuthenticationProvider;
|
|
89
|
-
|
|
58
|
+
topNavigation?: Array<{ id: string; label: string }>;
|
|
59
|
+
sidebars?: SidebarConfig;
|
|
90
60
|
plugins?: DevPortalPlugin[];
|
|
91
|
-
|
|
61
|
+
slotlets?: Slotlets;
|
|
62
|
+
mdx?: {
|
|
63
|
+
components?: MdxComponentsType;
|
|
64
|
+
};
|
|
92
65
|
overrides?: ComponentsContextType;
|
|
93
66
|
};
|
|
94
67
|
|
|
95
68
|
export class DevPortalContext {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
public navigation: NavigationItem[];
|
|
69
|
+
public plugins: NonNullable<ZudokuContextOptions["plugins"]>;
|
|
70
|
+
public sidebars: NonNullable<ZudokuContextOptions["sidebars"]>;
|
|
71
|
+
public topNavigation: NonNullable<ZudokuContextOptions["topNavigation"]>;
|
|
100
72
|
public meta: ZudokuContextOptions["metadata"];
|
|
101
73
|
public page: ZudokuContextOptions["page"];
|
|
102
|
-
public authentication?:
|
|
103
|
-
|
|
74
|
+
public authentication?: ZudokuContextOptions["authentication"];
|
|
75
|
+
private navigationPlugins: NavigationPlugin[];
|
|
104
76
|
|
|
105
77
|
constructor(config: ZudokuContextOptions) {
|
|
106
78
|
this.plugins = config.plugins ?? [];
|
|
107
|
-
this.
|
|
79
|
+
this.topNavigation = config.topNavigation ?? [];
|
|
80
|
+
this.sidebars = config.sidebars ?? {};
|
|
108
81
|
this.navigationPlugins = this.plugins.filter(isNavigationPlugin);
|
|
109
82
|
this.authentication = config.authentication;
|
|
110
83
|
this.meta = config.metadata;
|
|
111
84
|
this.page = config.page;
|
|
112
|
-
this.state = useRoutingState;
|
|
113
85
|
}
|
|
114
86
|
|
|
115
|
-
initialize = async (
|
|
116
|
-
|
|
87
|
+
initialize = async ({
|
|
88
|
+
navigate,
|
|
89
|
+
}: {
|
|
90
|
+
navigate: NavigateFunction;
|
|
91
|
+
}): Promise<void> => {
|
|
92
|
+
await Promise.all(
|
|
117
93
|
this.plugins
|
|
118
94
|
.filter(needsInitialization)
|
|
119
|
-
.map((plugin) => plugin.initialize?.(this)),
|
|
120
|
-
|
|
95
|
+
.map((plugin) => plugin.initialize?.(this, { navigate })),
|
|
96
|
+
);
|
|
121
97
|
};
|
|
122
98
|
|
|
123
99
|
invalidateCache = async (key: DevPortalCacheKey[]) => {
|
|
@@ -134,17 +110,17 @@ export class DevPortalContext {
|
|
|
134
110
|
return keys.flat();
|
|
135
111
|
};
|
|
136
112
|
|
|
137
|
-
|
|
113
|
+
getPluginSidebar = async (path: string) => {
|
|
138
114
|
const navigations = await Promise.all(
|
|
139
|
-
this.navigationPlugins.map(
|
|
140
|
-
plugin.
|
|
115
|
+
this.navigationPlugins.map((plugin) =>
|
|
116
|
+
plugin.getSidebar?.(joinPath(path)),
|
|
141
117
|
),
|
|
142
118
|
);
|
|
143
119
|
|
|
144
120
|
return navigations.flatMap((nav) => nav ?? []);
|
|
145
121
|
};
|
|
146
122
|
|
|
147
|
-
async
|
|
123
|
+
signRequest = async (request: Request) => {
|
|
148
124
|
if (!this.authentication) {
|
|
149
125
|
throw new Error("No authentication provider configured");
|
|
150
126
|
}
|
|
@@ -154,5 +130,5 @@ export class DevPortalContext {
|
|
|
154
130
|
request.headers.set("Authorization", `Bearer ${accessToken}`);
|
|
155
131
|
|
|
156
132
|
return request;
|
|
157
|
-
}
|
|
133
|
+
};
|
|
158
134
|
}
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -1,39 +1,66 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
|
-
import { type RouteObject } from "react-router-dom";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type NavigationCategory,
|
|
7
|
-
} from "./DevPortalContext.js";
|
|
8
|
-
|
|
9
|
-
export type PluginNavigationCategory = {
|
|
10
|
-
path: string;
|
|
11
|
-
} & NavigationCategory;
|
|
2
|
+
import { NavigateFunction, type RouteObject } from "react-router-dom";
|
|
3
|
+
import type { Sidebar } from "../../config/validators/SidebarSchema.js";
|
|
4
|
+
import { MdxComponentsType } from "../util/MdxComponents.js";
|
|
5
|
+
import { DevPortalContext, type ApiIdentity } from "./DevPortalContext.js";
|
|
12
6
|
|
|
13
7
|
export type DevPortalPlugin =
|
|
14
8
|
| CommonPlugin
|
|
9
|
+
| ProfileMenuPlugin
|
|
15
10
|
| NavigationPlugin
|
|
16
|
-
| ApiIdentityPlugin
|
|
11
|
+
| ApiIdentityPlugin
|
|
12
|
+
| SearchProviderPlugin;
|
|
17
13
|
|
|
18
14
|
export interface NavigationPlugin {
|
|
19
15
|
getRoutes: () => RouteObject[];
|
|
20
|
-
|
|
16
|
+
getSidebar?: (path: string) => Promise<Sidebar>;
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
export interface ApiIdentityPlugin {
|
|
24
20
|
getIdentities: (context: DevPortalContext) => Promise<ApiIdentity[]>;
|
|
25
21
|
}
|
|
26
22
|
|
|
23
|
+
export interface SearchProviderPlugin {
|
|
24
|
+
renderSearch: (o: {
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
}) => React.JSX.Element | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ProfileMenuPlugin {
|
|
31
|
+
getProfileMenuItems: (context: DevPortalContext) => ProfileNavigationItem[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type ProfileNavigationItem = {
|
|
35
|
+
label: string;
|
|
36
|
+
path?: string;
|
|
37
|
+
children?: ProfileNavigationItem[];
|
|
38
|
+
};
|
|
39
|
+
|
|
27
40
|
export interface CommonPlugin {
|
|
28
|
-
initialize?: (
|
|
41
|
+
initialize?: (
|
|
42
|
+
context: DevPortalContext,
|
|
43
|
+
options: { navigate: NavigateFunction },
|
|
44
|
+
) => Promise<void | boolean> | void | boolean;
|
|
29
45
|
getHead?: () => ReactElement | undefined;
|
|
46
|
+
getMdxComponents?: () => MdxComponentsType;
|
|
30
47
|
}
|
|
31
48
|
|
|
49
|
+
export const isProfileMenuPlugin = (
|
|
50
|
+
obj: DevPortalPlugin,
|
|
51
|
+
): obj is ProfileMenuPlugin =>
|
|
52
|
+
"getProfileMenuItems" in obj && typeof obj.getProfileMenuItems === "function";
|
|
53
|
+
|
|
32
54
|
export const isNavigationPlugin = (
|
|
33
55
|
obj: DevPortalPlugin,
|
|
34
56
|
): obj is NavigationPlugin =>
|
|
35
57
|
"getRoutes" in obj && typeof obj.getRoutes === "function";
|
|
36
58
|
|
|
59
|
+
export const isSearchPlugin = (
|
|
60
|
+
obj: DevPortalPlugin,
|
|
61
|
+
): obj is SearchProviderPlugin =>
|
|
62
|
+
"renderSearch" in obj && typeof obj.renderSearch === "function";
|
|
63
|
+
|
|
37
64
|
export const needsInitialization = (
|
|
38
65
|
obj: DevPortalPlugin,
|
|
39
66
|
): obj is CommonPlugin =>
|
|
@@ -42,6 +69,11 @@ export const needsInitialization = (
|
|
|
42
69
|
export const hasHead = (obj: DevPortalPlugin): obj is CommonPlugin =>
|
|
43
70
|
"getHead" in obj && typeof obj.getHead === "function";
|
|
44
71
|
|
|
72
|
+
export const isMdxProviderPlugin = (
|
|
73
|
+
obj: DevPortalPlugin,
|
|
74
|
+
): obj is CommonPlugin =>
|
|
75
|
+
"getMdxComponents" in obj && typeof obj.getMdxComponents === "function";
|
|
76
|
+
|
|
45
77
|
export const isApiIdentityPlugin = (
|
|
46
78
|
obj: DevPortalPlugin,
|
|
47
79
|
): obj is ApiIdentityPlugin =>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
+
export function ErrorAlert({ error }: { error: any }) {
|
|
3
|
+
const message = error?.message ?? "Something went wrong";
|
|
4
|
+
const stack = error?.stack;
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8">
|
|
8
|
+
<div className="mx-auto max-w-[85%] sm:max-w-[50%]">
|
|
9
|
+
<h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
|
|
10
|
+
Something went wrong
|
|
11
|
+
</h1>
|
|
12
|
+
<p className="mt-5 text-h1-text">{message}</p>
|
|
13
|
+
{stack ? (
|
|
14
|
+
<pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
|
|
15
|
+
{stack}
|
|
16
|
+
</pre>
|
|
17
|
+
) : null}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isRouteErrorResponse, useRouteError } from "react-router-dom";
|
|
2
|
+
import { NotFoundPage } from "../components/NotFoundPage.js";
|
|
3
|
+
import { ErrorAlert } from "./ErrorAlert.js";
|
|
4
|
+
|
|
5
|
+
export function RouterError() {
|
|
6
|
+
const error = useRouteError();
|
|
7
|
+
|
|
8
|
+
if (isRouteErrorResponse(error) && error.status === 404) {
|
|
9
|
+
return <NotFoundPage />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return <ErrorAlert error={error} />;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FallbackProps } from "react-error-boundary";
|
|
2
|
+
import { ErrorAlert } from "./ErrorAlert.js";
|
|
3
|
+
|
|
4
|
+
export function TopLevelError({ error, resetErrorBoundary }: FallbackProps) {
|
|
5
|
+
// Call resetErrorBoundary() to reset the error boundary and retry the render.
|
|
6
|
+
|
|
7
|
+
return <ErrorAlert error={error} />;
|
|
8
|
+
}
|
|
@@ -36,11 +36,16 @@ type OperationLike = {
|
|
|
36
36
|
method: string;
|
|
37
37
|
};
|
|
38
38
|
export const slugifyOperation = (operation: OperationLike, tag?: string) => {
|
|
39
|
+
const summary =
|
|
40
|
+
(operation.summary ?? "") +
|
|
41
|
+
(operation.operationId
|
|
42
|
+
? "-" +
|
|
43
|
+
operation.operationId.slice(0, operation.summary ? Infinity : Infinity)
|
|
44
|
+
: "");
|
|
45
|
+
|
|
39
46
|
return slugify(
|
|
40
47
|
(tag ? tag + "-" : "") +
|
|
41
|
-
(operation.
|
|
42
|
-
operation.operationId ??
|
|
43
|
-
`${operation.method}-${operation.path}`),
|
|
48
|
+
(summary || `${operation.method}-${operation.path}`),
|
|
44
49
|
{ lower: true, trim: true },
|
|
45
50
|
);
|
|
46
51
|
};
|
|
@@ -63,6 +68,25 @@ const builder = new SchemaBuilder<{
|
|
|
63
68
|
const JSONScalar = builder.addScalarType("JSON", GraphQLJSON);
|
|
64
69
|
const JSONObjectScalar = builder.addScalarType("JSONObject", GraphQLJSONObject);
|
|
65
70
|
|
|
71
|
+
const getAllTags = (schema: OpenAPIDocument): TagObject[] => {
|
|
72
|
+
const tags = schema.tags ?? [];
|
|
73
|
+
|
|
74
|
+
// Extract tags from operations
|
|
75
|
+
const operationTags = Object.values(schema.paths ?? {})
|
|
76
|
+
.flatMap((path) => Object.values(path ?? {}))
|
|
77
|
+
.flatMap((operation) =>
|
|
78
|
+
typeof operation === "object" && "tags" in operation
|
|
79
|
+
? operation.tags ?? []
|
|
80
|
+
: [],
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Remove duplicates and tags that appear in the schema
|
|
84
|
+
const uniqueOperationTags = [...new Set(operationTags)].filter(
|
|
85
|
+
(tag) => !tags.some((rootTag) => rootTag.name === tag),
|
|
86
|
+
);
|
|
87
|
+
return [...tags, ...uniqueOperationTags.map((tag) => ({ name: tag }))];
|
|
88
|
+
};
|
|
89
|
+
|
|
66
90
|
const getAllOperations = (paths?: PathsObject, tag?: string) => {
|
|
67
91
|
return Object.entries(paths ?? {}).flatMap(([path, value]) =>
|
|
68
92
|
HttpMethods.flatMap((method) => {
|
|
@@ -90,6 +114,7 @@ const getAllOperations = (paths?: PathsObject, tag?: string) => {
|
|
|
90
114
|
method,
|
|
91
115
|
path,
|
|
92
116
|
parameters,
|
|
117
|
+
tags: operation.tags ?? [],
|
|
93
118
|
slug: slugifyOperation(
|
|
94
119
|
{
|
|
95
120
|
summary: operation.summary,
|
|
@@ -110,12 +135,17 @@ const SchemaTag = builder.objectRef<TagObject>("SchemaTag").implement({
|
|
|
110
135
|
description: t.exposeString("description", { nullable: true }),
|
|
111
136
|
operations: t.field({
|
|
112
137
|
type: [OperationItem],
|
|
113
|
-
resolve: (parent, _args, ctx) =>
|
|
114
|
-
|
|
138
|
+
resolve: (parent, _args, ctx) => {
|
|
139
|
+
const rootTags = getAllTags(ctx.schema).map((tag) => tag.name);
|
|
140
|
+
|
|
141
|
+
return getAllOperations(ctx.schema.paths, parent.name).filter((item) =>
|
|
115
142
|
parent.name
|
|
116
|
-
? item.tags
|
|
117
|
-
:
|
|
118
|
-
|
|
143
|
+
? item.tags.includes(parent.name)
|
|
144
|
+
: item.tags.length === 0 ||
|
|
145
|
+
// If none of the tags are present in the root tags, then show them here
|
|
146
|
+
item.tags.every((tag) => !rootTags.includes(tag)),
|
|
147
|
+
);
|
|
148
|
+
},
|
|
119
149
|
}),
|
|
120
150
|
}),
|
|
121
151
|
});
|
|
@@ -207,7 +237,7 @@ const MediaTypeItem = builder
|
|
|
207
237
|
.implement({
|
|
208
238
|
fields: (t) => ({
|
|
209
239
|
mediaType: t.exposeString("mediaType"),
|
|
210
|
-
schema: t.expose("schema", { type: JSONScalar }),
|
|
240
|
+
schema: t.expose("schema", { type: JSONScalar, nullable: true }),
|
|
211
241
|
examples: t.expose("examples", { type: [ExampleItem], nullable: true }),
|
|
212
242
|
encoding: t.expose("encoding", { type: [EncodingItem], nullable: true }),
|
|
213
243
|
}),
|
|
@@ -235,7 +265,7 @@ const RequestBodyObject = builder
|
|
|
235
265
|
const ResponseItem = builder
|
|
236
266
|
.objectRef<{
|
|
237
267
|
statusCode: string;
|
|
238
|
-
description
|
|
268
|
+
description?: string;
|
|
239
269
|
content: Array<{
|
|
240
270
|
mediaType: string;
|
|
241
271
|
schema: any;
|
|
@@ -247,7 +277,7 @@ const ResponseItem = builder
|
|
|
247
277
|
.implement({
|
|
248
278
|
fields: (t) => ({
|
|
249
279
|
statusCode: t.exposeString("statusCode"),
|
|
250
|
-
description: t.exposeString("description"),
|
|
280
|
+
description: t.exposeString("description", { nullable: true }),
|
|
251
281
|
content: t.expose("content", { type: [MediaTypeItem], nullable: true }),
|
|
252
282
|
headers: t.expose("headers", { type: JSONScalar, nullable: true }),
|
|
253
283
|
links: t.expose("links", { type: JSONScalar, nullable: true }),
|
|
@@ -352,10 +382,10 @@ const Schema = builder.objectRef<OpenAPIDocument>("Schema").implement({
|
|
|
352
382
|
name: t.arg.string(),
|
|
353
383
|
},
|
|
354
384
|
type: [SchemaTag],
|
|
355
|
-
resolve: (root, args) =>
|
|
356
|
-
[...(root
|
|
357
|
-
|
|
358
|
-
|
|
385
|
+
resolve: (root, args) => {
|
|
386
|
+
const tags = [...getAllTags(root), { name: "" }];
|
|
387
|
+
return args.name ? tags.filter((tag) => tag.name === args.name) : tags;
|
|
388
|
+
},
|
|
359
389
|
}),
|
|
360
390
|
operations: t.field({
|
|
361
391
|
type: [OperationItem],
|
|
@@ -371,7 +401,7 @@ const Schema = builder.objectRef<OpenAPIDocument>("Schema").implement({
|
|
|
371
401
|
(!args.operationId || item.operationId === args.operationId) &&
|
|
372
402
|
(!args.path || item.path === args.path) &&
|
|
373
403
|
(!args.method || item.method === args.method) &&
|
|
374
|
-
(!args.tag || item.tags
|
|
404
|
+
(!args.tag || item.tags.includes(args.tag)),
|
|
375
405
|
),
|
|
376
406
|
}),
|
|
377
407
|
}),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GraphQLError } from "graphql/error/index.js";
|
|
1
2
|
import { OpenAPIV3, type OpenAPIV3_1 } from "openapi-types";
|
|
2
3
|
import { dereference, type JSONSchema } from "./dereference/index.js";
|
|
3
4
|
import { upgradeSchema } from "./upgrade/index.js";
|
|
@@ -9,10 +10,6 @@ type DeepOmitReference<T> = T extends ReferenceObject
|
|
|
9
10
|
? { [K in keyof T]: DeepOmitReference<T[K]> }
|
|
10
11
|
: T;
|
|
11
12
|
|
|
12
|
-
// type Prettify<T> = {
|
|
13
|
-
// [K in keyof T]: T[K];
|
|
14
|
-
// } & {};
|
|
15
|
-
|
|
16
13
|
export type OpenAPIDocument = DeepOmitReference<OpenAPIV3_1.Document>;
|
|
17
14
|
export type ResponseObject = DeepOmitReference<OpenAPIV3_1.ResponseObject>;
|
|
18
15
|
export type OperationObject = DeepOmitReference<OpenAPIV3_1.OperationObject>;
|
|
@@ -46,37 +43,63 @@ export const HttpMethods = Object.values(OpenAPIV3.HttpMethods);
|
|
|
46
43
|
// };
|
|
47
44
|
|
|
48
45
|
const parseSchemaInput = async (
|
|
49
|
-
|
|
50
|
-
schemaInput: any,
|
|
46
|
+
schemaInput: unknown,
|
|
51
47
|
): Promise<JSONSchema & { openapi?: string }> => {
|
|
52
48
|
if (typeof schemaInput === "string") {
|
|
53
49
|
if (schemaInput.trim().startsWith("{")) {
|
|
54
|
-
|
|
50
|
+
try {
|
|
51
|
+
return JSON.parse(schemaInput);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
throw new GraphQLError("Invalid JSON schema", {
|
|
54
|
+
originalError: err,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
55
57
|
}
|
|
56
58
|
if (schemaInput.includes("://")) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
let response;
|
|
60
|
+
try {
|
|
61
|
+
response = await fetch(schemaInput, {
|
|
62
|
+
cache: "force-cache",
|
|
63
|
+
});
|
|
64
|
+
} catch (err) {
|
|
65
|
+
throw new GraphQLError("Failed to fetch schema", {
|
|
66
|
+
originalError: err,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!response.ok) {
|
|
71
|
+
throw new GraphQLError(
|
|
72
|
+
`Failed to fetch schema: ${response.statusText}`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
return (await response.json()) as JSONSchema;
|
|
78
|
+
} catch (err) {
|
|
79
|
+
throw new GraphQLError("Fetched invalid JSON schema", {
|
|
80
|
+
originalError: err,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
61
83
|
}
|
|
62
84
|
const yaml = await import("yaml");
|
|
63
|
-
|
|
85
|
+
const parsed = yaml.parse(schemaInput);
|
|
86
|
+
|
|
87
|
+
if (typeof parsed === "object") return parsed;
|
|
64
88
|
}
|
|
65
89
|
|
|
66
|
-
if (typeof schemaInput === "object") return schemaInput;
|
|
90
|
+
if (typeof schemaInput === "object") return schemaInput as JSONSchema;
|
|
67
91
|
|
|
68
|
-
throw new
|
|
92
|
+
throw new GraphQLError("Unsupported schema input: " + schemaInput);
|
|
69
93
|
};
|
|
70
94
|
|
|
71
95
|
/**
|
|
72
96
|
* Validates, dereferences and upgrades the OpenAPI schema (to v3.1) if necessary.
|
|
73
97
|
*/
|
|
74
|
-
|
|
75
|
-
export const validate = async (schemaInput: any) => {
|
|
98
|
+
export const validate = async (schemaInput: unknown) => {
|
|
76
99
|
const schema = await parseSchemaInput(schemaInput);
|
|
77
100
|
|
|
78
101
|
if (!schema.openapi) {
|
|
79
|
-
throw new
|
|
102
|
+
throw new GraphQLError("OpenAPI version is not defined");
|
|
80
103
|
}
|
|
81
104
|
|
|
82
105
|
// const validator = await getValidator(schema.openapi);
|
|
@@ -88,9 +111,5 @@ export const validate = async (schemaInput: any) => {
|
|
|
88
111
|
|
|
89
112
|
const dereferenced = await dereference(schema);
|
|
90
113
|
|
|
91
|
-
|
|
92
|
-
dereferenced as OpenAPIV3_1.Document | OpenAPIV3.Document,
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
return upgraded;
|
|
114
|
+
return upgradeSchema(dereferenced);
|
|
96
115
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { useForm } from "react-hook-form";
|
|
3
3
|
import { Link, useNavigate } from "react-router-dom";
|
|
4
|
-
import {
|
|
5
|
-
import { Input } from "../../components/Input.js";
|
|
4
|
+
import { useZudoku } from "../../components/context/ZudokuContext.js";
|
|
6
5
|
import {
|
|
7
6
|
Select,
|
|
8
7
|
SelectContent,
|
|
@@ -12,12 +11,13 @@ import {
|
|
|
12
11
|
SelectValue,
|
|
13
12
|
} from "../../components/Select.js";
|
|
14
13
|
import { Button } from "../../ui/Button.js";
|
|
14
|
+
import { Input } from "../../ui/Input.js";
|
|
15
15
|
import { ApiKeyService } from "./index.js";
|
|
16
16
|
|
|
17
17
|
type CreateApiKey = { description: string; expiresOn?: string };
|
|
18
18
|
|
|
19
19
|
export const CreateApiKey = ({ service }: { service: ApiKeyService }) => {
|
|
20
|
-
const context =
|
|
20
|
+
const context = useZudoku();
|
|
21
21
|
const navigate = useNavigate();
|
|
22
22
|
const form = useForm<CreateApiKey>({
|
|
23
23
|
defaultValues: {
|
|
@@ -47,7 +47,7 @@ export const CreateApiKey = ({ service }: { service: ApiKeyService }) => {
|
|
|
47
47
|
|
|
48
48
|
return (
|
|
49
49
|
<div className="max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]">
|
|
50
|
-
<div className="flex justify-between mb-4 border-b
|
|
50
|
+
<div className="flex justify-between mb-4 border-b pb-1">
|
|
51
51
|
<h1 className="font-medium text-2xl">New API Key</h1>
|
|
52
52
|
</div>
|
|
53
53
|
<form
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Outlet } from "react-router-dom";
|
|
2
|
+
import { useAuth } from "../../authentication/hook.js";
|
|
3
|
+
import { DeveloperHint } from "../../components/DeveloperHint.js";
|
|
4
|
+
import { Button } from "../../ui/Button.js";
|
|
5
|
+
|
|
6
|
+
export const ProtectedRoute = () => {
|
|
7
|
+
const auth = useAuth();
|
|
8
|
+
|
|
9
|
+
// TODO: should we suspend here somehow?
|
|
10
|
+
if (auth.isAuthEnabled && auth.isPending) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return auth.isAuthenticated ? (
|
|
15
|
+
<Outlet />
|
|
16
|
+
) : !auth.isAuthEnabled ? (
|
|
17
|
+
<div className="flex flex-col justify-center gap-2 items-center h-1/2">
|
|
18
|
+
<DeveloperHint className="max-w-[600px]">
|
|
19
|
+
Authentication needs to be enabled for API keys to work. Enable it in
|
|
20
|
+
your Zudoku configuration under <code>authentication</code>.
|
|
21
|
+
</DeveloperHint>
|
|
22
|
+
</div>
|
|
23
|
+
) : (
|
|
24
|
+
<div className="flex flex-col justify-center gap-2 items-center h-1/2">
|
|
25
|
+
Please login first to view this page
|
|
26
|
+
<Button onClick={() => auth.login()}>Login</Button>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|