zudoku 0.3.0-dev.8 → 0.3.0-dev.81
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/app/App.d.ts +1 -2
- package/dist/app/App.js +1 -29
- package/dist/app/App.js.map +1 -1
- package/dist/app/demo.d.ts +2 -0
- package/dist/app/demo.js +32 -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 +72 -12
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +37 -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 +3 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +19 -45
- package/dist/config/validators/validate.d.ts +911 -2
- package/dist/config/validators/validate.js +151 -1
- package/dist/config/validators/validate.js.map +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 +2 -2
- 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 +78 -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/DevPortal.d.ts +5 -19
- package/dist/lib/components/DevPortal.js +57 -15
- 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 +21 -3
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +9 -4
- package/dist/lib/components/Heading.js +17 -2
- package/dist/lib/components/Heading.js.map +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 +4 -2
- package/dist/lib/components/Layout.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/SlotletProvider.d.ts +9 -0
- package/dist/lib/components/SlotletProvider.js +11 -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 +5 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
- package/dist/lib/components/context/DevPortalProvider.js +20 -3
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- 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/SideNavigation.js +3 -2
- package/dist/lib/components/navigation/SideNavigation.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationCategory.js +3 -3
- package/dist/lib/components/navigation/SideNavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -4
- package/dist/lib/components/navigation/SideNavigationItem.js +4 -4
- package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +4 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js +17 -5
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +52 -13
- package/dist/lib/core/DevPortalContext.js +10 -14
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +22 -5
- 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 +8 -5
- 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 -12
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +2 -2
- 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 +40 -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 +12 -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.d.ts +3 -2
- package/dist/lib/plugins/markdown/MdxPage.js +7 -6
- 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 +3 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +4 -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 +17 -5
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +2 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +23 -0
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +3 -9
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
- 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/SchemaListView.js +6 -27
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +22 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.d.ts +4 -0
- package/dist/lib/plugins/openapi/Sidecar.js +43 -19
- 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/{Select.d.ts → SimpleSelect.d.ts} +3 -2
- package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
- 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/client/createServer.js +30 -0
- 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/{worker → client}/worker.js +2 -2
- 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 +62 -21
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +15 -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/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 +26 -14
- package/dist/lib/plugins/openapi/playground/Playground.js +53 -25
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +5 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +12 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
- 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 +5 -9
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
- package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/prose.js +4 -0
- package/dist/lib/plugins/openapi/util/prose.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/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 +7 -5
- 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 +2 -1
- 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/objectEntries.d.ts +4 -0
- package/dist/lib/util/objectEntries.js +2 -0
- package/dist/lib/util/objectEntries.js.map +1 -0
- package/dist/lib/util/renderIf.d.ts +1 -0
- package/dist/lib/util/renderIf.js +2 -0
- package/dist/lib/util/renderIf.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/vite/build.js +30 -7
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +21 -12
- package/dist/vite/config.js +107 -55
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +6 -3
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.d.ts +2 -1
- package/dist/vite/dev-server.js +44 -15
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +18 -5
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api-keys.js +7 -8
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.js +9 -20
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +5 -6
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.js +5 -2
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +0 -2
- 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 +54 -0
- package/dist/vite/plugin-custom-css.js.map +1 -0
- package/dist/vite/plugin-docs.js +15 -5
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +3 -1
- package/dist/vite/plugin-mdx.js +5 -5
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-metadata.js +1 -1
- package/dist/vite/plugin-metadata.js.map +1 -1
- package/dist/vite/plugin-redirect.js +10 -10
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin.js +3 -5
- 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/AnchorLink-BZcpTwOs.js +705 -0
- package/lib/AnchorLink-BZcpTwOs.js.map +1 -0
- package/lib/AuthenticationPlugin-XS0DoAhE.js +55 -0
- package/lib/AuthenticationPlugin-XS0DoAhE.js.map +1 -0
- package/lib/CategoryHeading-DCmchnA1.js +10 -0
- package/lib/CategoryHeading-DCmchnA1.js.map +1 -0
- package/lib/Combination-C442XfGG.js +2789 -0
- package/lib/Combination-C442XfGG.js.map +1 -0
- package/lib/DevPortalProvider-BWeAysxF.js +1126 -0
- package/lib/DevPortalProvider-BWeAysxF.js.map +1 -0
- package/lib/DeveloperHint-DQVwIery.js +10 -0
- package/lib/DeveloperHint-DQVwIery.js.map +1 -0
- package/lib/Input-3IEt27jb.js +2239 -0
- package/lib/Input-3IEt27jb.js.map +1 -0
- package/lib/Markdown-QsZ-PHET.js +14124 -0
- package/lib/Markdown-QsZ-PHET.js.map +1 -0
- package/lib/MdxPage-CA1WmW14.js +201 -0
- package/lib/MdxPage-CA1WmW14.js.map +1 -0
- package/lib/OperationList-Bl6rGF6_.js +432 -0
- package/lib/OperationList-Bl6rGF6_.js.map +1 -0
- package/lib/Route-BEvxtkD4.js +13 -0
- package/lib/Route-BEvxtkD4.js.map +1 -0
- package/lib/SlotletProvider-B71hNEUL.js +82 -0
- package/lib/SlotletProvider-B71hNEUL.js.map +1 -0
- package/lib/Spinner-Coi7ORUV.js +244 -0
- package/lib/Spinner-Coi7ORUV.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-BCcpCNJ7.js → worker-CyHZIIfE.js} +10727 -10300
- package/lib/assets/worker-CyHZIIfE.js.map +1 -0
- package/lib/index-BH-Ub36F.js +124 -0
- package/lib/index-BH-Ub36F.js.map +1 -0
- package/lib/index-BlnQp2oR.js +5950 -0
- package/lib/index-BlnQp2oR.js.map +1 -0
- package/lib/index-Dt-pU7Vu.js +916 -0
- package/lib/index-Dt-pU7Vu.js.map +1 -0
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/index-pI9JkN46.js.map +1 -0
- package/lib/jsx-runtime-CJBdjYYx.js +1526 -0
- package/lib/jsx-runtime-CJBdjYYx.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/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 +740 -573
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +1854 -535
- package/lib/zudoku.components.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +15035 -146
- package/lib/zudoku.openapi-worker.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +303 -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 +48 -0
- package/lib/zudoku.plugin-markdown.js.map +1 -0
- package/lib/zudoku.plugin-openapi.js +12 -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/package.json +60 -25
- package/src/app/App.tsx +0 -41
- package/src/app/demo-cdn.html +26 -0
- package/src/app/demo.html +18 -0
- package/src/app/demo.tsx +45 -0
- package/src/app/entry.client.tsx +47 -0
- package/src/app/entry.server.tsx +160 -0
- package/src/app/main.css +85 -5
- package/src/app/main.tsx +85 -15
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +51 -0
- package/src/app/tailwind.ts +2 -6
- package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
- package/src/lib/authentication/authentication.ts +6 -12
- 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 +2 -2
- 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 +105 -34
- package/src/lib/authentication/state.ts +1 -1
- package/src/lib/components/Bootstrap.tsx +44 -0
- package/src/lib/components/DevPortal.tsx +88 -53
- package/src/lib/components/DeveloperHint.tsx +25 -0
- package/src/lib/components/ErrorPage.tsx +28 -0
- package/src/lib/components/Header.tsx +103 -30
- package/src/lib/components/Heading.tsx +26 -7
- package/src/lib/components/InlineCode.tsx +19 -0
- package/src/lib/components/Layout.tsx +12 -7
- package/src/lib/components/NotFoundPage.tsx +33 -0
- package/src/lib/components/SlotletProvider.tsx +25 -0
- package/src/lib/components/SyntaxHighlight.tsx +53 -44
- package/src/lib/components/TopNavigation.tsx +6 -1
- package/src/lib/components/context/DevPortalProvider.ts +24 -4
- package/src/lib/components/index.ts +25 -3
- package/src/lib/components/navigation/SideNavigation.tsx +3 -0
- package/src/lib/components/navigation/SideNavigationCategory.tsx +5 -9
- package/src/lib/components/navigation/SideNavigationItem.tsx +5 -9
- package/src/lib/components/navigation/useNavigationCollapsibleState.ts +21 -6
- package/src/lib/core/DevPortalContext.ts +64 -28
- package/src/lib/core/plugins.ts +37 -6
- 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 +11 -6
- package/src/lib/oas/parser/index.ts +41 -20
- package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
- package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +21 -9
- package/src/lib/plugins/{api-key → api-keys}/index.tsx +17 -41
- package/src/lib/plugins/custom-page/index.tsx +22 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +51 -34
- package/src/lib/plugins/markdown/Toc.tsx +53 -40
- package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
- package/src/lib/plugins/markdown/index.tsx +10 -7
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -16
- package/src/lib/plugins/openapi/OperationList.tsx +46 -10
- package/src/lib/plugins/openapi/OperationListItem.tsx +68 -42
- package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
- package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +39 -0
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +3 -15
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -2
- package/src/lib/plugins/openapi/Route.tsx +21 -0
- package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +116 -0
- package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +62 -28
- package/src/lib/plugins/openapi/SidecarBox.tsx +13 -2
- package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
- 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/{worker → client}/worker.ts +3 -3
- 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 +117 -53
- package/src/lib/plugins/openapi/interfaces.ts +9 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +76 -50
- package/src/lib/plugins/openapi/playground/Playground.tsx +239 -229
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +40 -0
- 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 +12 -15
- package/src/lib/plugins/openapi/util/prose.ts +7 -0
- package/src/lib/plugins/openapi-worker.ts +1 -1
- package/src/lib/plugins/redirect/index.tsx +3 -4
- 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 +7 -15
- 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 +2 -1
- package/src/lib/util/logInit.ts +9 -0
- package/src/lib/util/objectEntries.ts +5 -0
- package/src/lib/util/renderIf.ts +4 -0
- package/src/lib/util/requestIdleCallbackPolyfill.ts +6 -0
- 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/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/MakeRequest.js +0 -43
- package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/lib/plugins/openapi/Select.js +0 -5
- package/dist/lib/plugins/openapi/Select.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/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-BewqqUU-.js +0 -8413
- 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 -19902
- 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/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/MakeRequest.tsx +0 -63
- package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
- package/src/lib/ui/button-variants.ts +0 -31
- /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,12 +1,13 @@
|
|
|
1
1
|
import logger from "loglevel";
|
|
2
2
|
import * as oauth from "oauth4webapi";
|
|
3
|
+
import { NavigateFunction } from "react-router-dom";
|
|
3
4
|
import { OpenIDAuthenticationConfig } from "../../../config/config.js";
|
|
4
|
-
import {
|
|
5
|
+
import { CommonPlugin } from "../../core/plugins.js";
|
|
5
6
|
import {
|
|
6
7
|
AuthenticationProvider,
|
|
7
8
|
AuthenticationProviderInitializer,
|
|
8
9
|
} from "../authentication.js";
|
|
9
|
-
import {
|
|
10
|
+
import { AuthenticationPlugin } from "../AuthenticationPlugin.js";
|
|
10
11
|
import { AuthorizationError, OAuthAuthorizationError } from "../errors.js";
|
|
11
12
|
import { useAuthState, UserProfile } from "../state.js";
|
|
12
13
|
|
|
@@ -19,6 +20,24 @@ interface TokenState {
|
|
|
19
20
|
tokenType: string;
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
class OpenIdAuthPlugin extends AuthenticationPlugin {
|
|
24
|
+
constructor(
|
|
25
|
+
private callbackUrlPath: string,
|
|
26
|
+
public initialize?: CommonPlugin["initialize"],
|
|
27
|
+
) {
|
|
28
|
+
super();
|
|
29
|
+
}
|
|
30
|
+
getRoutes() {
|
|
31
|
+
return [
|
|
32
|
+
...super.getRoutes(),
|
|
33
|
+
{
|
|
34
|
+
path: this.callbackUrlPath,
|
|
35
|
+
element: <div />,
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
22
41
|
export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
23
42
|
protected client: oauth.Client;
|
|
24
43
|
protected issuer: string;
|
|
@@ -30,20 +49,36 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
30
49
|
|
|
31
50
|
protected callbackUrlPath = "/oauth/callback";
|
|
32
51
|
protected logoutRedirectUrlPath = "/";
|
|
52
|
+
protected onAuthorizationUrl?: (
|
|
53
|
+
authorizationUrl: URL,
|
|
54
|
+
options: { isSignIn: boolean; isSignUp: boolean },
|
|
55
|
+
) => void;
|
|
56
|
+
private readonly redirectToAfterSignUp: string;
|
|
57
|
+
private readonly redirectToAfterSignIn: string;
|
|
58
|
+
private readonly redirectToAfterSignOut: string;
|
|
59
|
+
private readonly audience?: string;
|
|
33
60
|
|
|
34
61
|
constructor({
|
|
35
62
|
issuer,
|
|
63
|
+
audience,
|
|
36
64
|
authorizationEndpoint,
|
|
37
65
|
tokenEndpoint,
|
|
38
66
|
clientId,
|
|
67
|
+
redirectToAfterSignUp,
|
|
68
|
+
redirectToAfterSignIn,
|
|
69
|
+
redirectToAfterSignOut,
|
|
39
70
|
}: OpenIDAuthenticationConfig) {
|
|
40
71
|
this.client = {
|
|
41
72
|
client_id: clientId,
|
|
42
73
|
token_endpoint_auth_method: "none",
|
|
43
74
|
};
|
|
75
|
+
this.audience = audience;
|
|
44
76
|
this.issuer = issuer;
|
|
45
77
|
this.authorizationEndpoint = authorizationEndpoint;
|
|
46
78
|
this.tokenEndpoint = tokenEndpoint;
|
|
79
|
+
this.redirectToAfterSignUp = redirectToAfterSignUp ?? "/";
|
|
80
|
+
this.redirectToAfterSignIn = redirectToAfterSignIn ?? "/";
|
|
81
|
+
this.redirectToAfterSignOut = redirectToAfterSignOut ?? "/";
|
|
47
82
|
}
|
|
48
83
|
|
|
49
84
|
protected async getAuthServer() {
|
|
@@ -89,13 +124,29 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
89
124
|
expiresOn: new Date(Date.now() + response.expires_in * 1000),
|
|
90
125
|
tokenType: response.token_type,
|
|
91
126
|
};
|
|
127
|
+
sessionStorage.setItem("openid-token", JSON.stringify(this.tokens));
|
|
92
128
|
}
|
|
93
129
|
|
|
94
|
-
async
|
|
95
|
-
|
|
130
|
+
async signUp({ redirectTo }: { redirectTo?: string } = {}) {
|
|
131
|
+
return this.authorize({
|
|
132
|
+
redirectTo: redirectTo ?? this.redirectToAfterSignUp,
|
|
133
|
+
isSignUp: true,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async signIn({ redirectTo }: { redirectTo?: string } = {}) {
|
|
138
|
+
return this.authorize({
|
|
139
|
+
redirectTo: redirectTo ?? this.redirectToAfterSignIn,
|
|
140
|
+
});
|
|
96
141
|
}
|
|
97
142
|
|
|
98
|
-
async
|
|
143
|
+
private async authorize({
|
|
144
|
+
redirectTo,
|
|
145
|
+
isSignUp = false,
|
|
146
|
+
}: {
|
|
147
|
+
redirectTo: string;
|
|
148
|
+
isSignUp?: boolean;
|
|
149
|
+
}): Promise<void> {
|
|
99
150
|
const code_challenge_method = "S256";
|
|
100
151
|
const authorizationServer = await this.getAuthServer();
|
|
101
152
|
|
|
@@ -111,14 +162,16 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
111
162
|
const codeVerifier = oauth.generateRandomCodeVerifier();
|
|
112
163
|
const codeChallenge = await oauth.calculatePKCECodeChallenge(codeVerifier);
|
|
113
164
|
|
|
114
|
-
|
|
165
|
+
sessionStorage.setItem(CODE_VERIFIER_KEY, codeVerifier);
|
|
115
166
|
|
|
116
167
|
// redirect user to as.authorization_endpoint
|
|
117
168
|
const authorizationUrl = new URL(
|
|
118
169
|
authorizationServer.authorization_endpoint,
|
|
119
170
|
);
|
|
120
171
|
|
|
121
|
-
|
|
172
|
+
sessionStorage.setItem("redirect-to", redirectTo);
|
|
173
|
+
|
|
174
|
+
const redirectUrl = new URL(window.location.origin);
|
|
122
175
|
redirectUrl.pathname = this.callbackUrlPath;
|
|
123
176
|
redirectUrl.search = "";
|
|
124
177
|
|
|
@@ -131,6 +184,14 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
131
184
|
"code_challenge_method",
|
|
132
185
|
code_challenge_method,
|
|
133
186
|
);
|
|
187
|
+
if (this.audience) {
|
|
188
|
+
authorizationUrl.searchParams.set("audience", this.audience);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
this.onAuthorizationUrl?.(authorizationUrl, {
|
|
192
|
+
isSignIn: !isSignUp,
|
|
193
|
+
isSignUp,
|
|
194
|
+
});
|
|
134
195
|
|
|
135
196
|
/**
|
|
136
197
|
* We cannot be sure the AS supports PKCE so we're going to use state too. Use of PKCE is
|
|
@@ -147,6 +208,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
147
208
|
// now redirect the user to authorizationUrl.href
|
|
148
209
|
location.href = authorizationUrl.href;
|
|
149
210
|
}
|
|
211
|
+
|
|
150
212
|
async getAccessToken(): Promise<string> {
|
|
151
213
|
const as = await this.getAuthServer();
|
|
152
214
|
if (!this.tokens) {
|
|
@@ -154,10 +216,8 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
154
216
|
}
|
|
155
217
|
if (this.tokens.expiresOn < new Date()) {
|
|
156
218
|
if (!this.tokens.refreshToken) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"Token expired and no refresh token available",
|
|
160
|
-
);
|
|
219
|
+
await this.signIn();
|
|
220
|
+
return "";
|
|
161
221
|
}
|
|
162
222
|
|
|
163
223
|
const request = await oauth.refreshTokenGrantRequest(
|
|
@@ -177,16 +237,19 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
177
237
|
return this.tokens.accessToken;
|
|
178
238
|
}
|
|
179
239
|
|
|
180
|
-
async
|
|
240
|
+
signOut = async () => {
|
|
181
241
|
useAuthState.setState({
|
|
182
242
|
isAuthenticated: false,
|
|
183
243
|
isPending: false,
|
|
184
244
|
profile: undefined,
|
|
185
245
|
});
|
|
246
|
+
localStorage.removeItem("auto-login");
|
|
186
247
|
|
|
187
248
|
const as = await this.getAuthServer();
|
|
188
249
|
|
|
189
|
-
const redirectUrl = new URL(
|
|
250
|
+
const redirectUrl = new URL(
|
|
251
|
+
window.location.origin + this.redirectToAfterSignOut,
|
|
252
|
+
);
|
|
190
253
|
redirectUrl.pathname = this.logoutRedirectUrlPath;
|
|
191
254
|
|
|
192
255
|
let logoutUrl: URL;
|
|
@@ -206,29 +269,19 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
206
269
|
} else {
|
|
207
270
|
logoutUrl = redirectUrl;
|
|
208
271
|
}
|
|
209
|
-
}
|
|
210
|
-
getRoutes(): RouteObject[] {
|
|
211
|
-
return [
|
|
212
|
-
{
|
|
213
|
-
path: this.callbackUrlPath,
|
|
214
|
-
element: <Callback handleCallback={this.handleCallback} />,
|
|
215
|
-
},
|
|
216
|
-
];
|
|
217
|
-
}
|
|
272
|
+
};
|
|
218
273
|
|
|
219
|
-
handleCallback = async ()
|
|
274
|
+
handleCallback = async () => {
|
|
220
275
|
const url = new URL(window.location.href);
|
|
221
276
|
const state = url.searchParams.get("state");
|
|
222
277
|
|
|
223
278
|
// one eternity later, the user lands back on the redirect_uri
|
|
224
279
|
// Authorization Code Grant Request & Response
|
|
225
|
-
const codeVerifier =
|
|
226
|
-
|
|
280
|
+
const codeVerifier = sessionStorage.getItem(CODE_VERIFIER_KEY);
|
|
281
|
+
sessionStorage.removeItem(CODE_VERIFIER_KEY);
|
|
227
282
|
|
|
228
283
|
if (!codeVerifier) {
|
|
229
|
-
|
|
230
|
-
"Code verifier not found. Invalid auth state.",
|
|
231
|
-
);
|
|
284
|
+
return "/";
|
|
232
285
|
}
|
|
233
286
|
|
|
234
287
|
const authServer = await this.getAuthServer();
|
|
@@ -248,7 +301,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
248
301
|
}
|
|
249
302
|
|
|
250
303
|
const redirectUrl = new URL(url);
|
|
251
|
-
redirectUrl.pathname = this.
|
|
304
|
+
redirectUrl.pathname = this.redirectToAfterSignIn;
|
|
252
305
|
redirectUrl.search = "";
|
|
253
306
|
|
|
254
307
|
const response = await oauth.authorizationCodeGrantRequest(
|
|
@@ -298,13 +351,31 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
298
351
|
profile,
|
|
299
352
|
});
|
|
300
353
|
|
|
301
|
-
|
|
302
|
-
// // to make the token request
|
|
303
|
-
// history.replaceState({}, "", window.location.pathname);
|
|
354
|
+
localStorage.setItem("auto-login", "1");
|
|
304
355
|
|
|
305
|
-
|
|
306
|
-
// return true;
|
|
356
|
+
return sessionStorage.getItem("redirect-to") ?? "/";
|
|
307
357
|
};
|
|
358
|
+
|
|
359
|
+
getAuthenticationPlugin() {
|
|
360
|
+
return new OpenIdAuthPlugin(
|
|
361
|
+
this.callbackUrlPath,
|
|
362
|
+
async (_, options: { navigate: NavigateFunction }) => {
|
|
363
|
+
if (
|
|
364
|
+
typeof localStorage !== "undefined" &&
|
|
365
|
+
localStorage.getItem("auto-login")
|
|
366
|
+
) {
|
|
367
|
+
localStorage.removeItem("auto-login");
|
|
368
|
+
|
|
369
|
+
await this.authorize({ redirectTo: window.location.pathname });
|
|
370
|
+
} else if (window.location.pathname === "/oauth/callback") {
|
|
371
|
+
const redirect = await this.handleCallback();
|
|
372
|
+
if (redirect) {
|
|
373
|
+
options.navigate(redirect);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
);
|
|
378
|
+
}
|
|
308
379
|
}
|
|
309
380
|
|
|
310
381
|
const openIDAuth: AuthenticationProviderInitializer<
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type HelmetData, HelmetProvider } from "@zudoku/react-helmet-async";
|
|
2
|
+
import { StrictMode } from "react";
|
|
3
|
+
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
4
|
+
import {
|
|
5
|
+
type StaticHandlerContext,
|
|
6
|
+
StaticRouterProvider,
|
|
7
|
+
} from "react-router-dom/server.js";
|
|
8
|
+
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
9
|
+
|
|
10
|
+
const Bootstrap = ({
|
|
11
|
+
router,
|
|
12
|
+
hydrate = false,
|
|
13
|
+
}: {
|
|
14
|
+
hydrate?: boolean;
|
|
15
|
+
router: ReturnType<typeof createBrowserRouter>;
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<StrictMode>
|
|
19
|
+
<HelmetProvider>
|
|
20
|
+
<StaggeredRenderContext.Provider value={{ stagger: !hydrate }}>
|
|
21
|
+
<RouterProvider router={router} />
|
|
22
|
+
</StaggeredRenderContext.Provider>
|
|
23
|
+
</HelmetProvider>
|
|
24
|
+
</StrictMode>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const BootstrapStatic = ({
|
|
29
|
+
router,
|
|
30
|
+
context,
|
|
31
|
+
helmetContext,
|
|
32
|
+
}: {
|
|
33
|
+
helmetContext: HelmetData["context"];
|
|
34
|
+
context: StaticHandlerContext;
|
|
35
|
+
router: ReturnType<typeof createBrowserRouter>;
|
|
36
|
+
}) => (
|
|
37
|
+
<StrictMode>
|
|
38
|
+
<HelmetProvider context={helmetContext}>
|
|
39
|
+
<StaticRouterProvider router={router} context={context} />
|
|
40
|
+
</HelmetProvider>
|
|
41
|
+
</StrictMode>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export { Bootstrap, BootstrapStatic };
|
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
import { MDXProvider } from "@mdx-js/react";
|
|
2
2
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
3
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
4
|
+
import {
|
|
5
|
+
Fragment,
|
|
6
|
+
memo,
|
|
7
|
+
type PropsWithChildren,
|
|
8
|
+
useContext,
|
|
9
|
+
useEffect,
|
|
10
|
+
useMemo,
|
|
11
|
+
useRef,
|
|
12
|
+
useState,
|
|
13
|
+
} from "react";
|
|
14
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
15
|
+
import { Outlet, useNavigate, useNavigation } from "react-router-dom";
|
|
4
16
|
import {
|
|
5
17
|
DevPortalContext,
|
|
6
18
|
queryClient,
|
|
7
|
-
|
|
19
|
+
ZudokuContextOptions,
|
|
8
20
|
} from "../core/DevPortalContext.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
MdxComponents,
|
|
15
|
-
type MdxComponentsType,
|
|
16
|
-
} from "../util/MdxComponents.js";
|
|
21
|
+
import { hasHead, isMdxProviderPlugin } from "../core/plugins.js";
|
|
22
|
+
import { TopLevelError } from "../errors/TopLevelError.js";
|
|
23
|
+
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
24
|
+
import { MdxComponents } from "../util/MdxComponents.js";
|
|
25
|
+
import "../util/requestIdleCallbackPolyfill.js";
|
|
17
26
|
import {
|
|
18
27
|
ComponentsProvider,
|
|
19
28
|
DEFAULT_COMPONENTS,
|
|
20
|
-
type ComponentsContextType,
|
|
21
29
|
} from "./context/ComponentsContext.js";
|
|
22
30
|
import { DevPortalProvider } from "./context/DevPortalProvider.js";
|
|
23
31
|
import { ThemeProvider } from "./context/ThemeContext.js";
|
|
24
32
|
import { ViewportAnchorProvider } from "./context/ViewportAnchorContext.js";
|
|
25
|
-
import {
|
|
33
|
+
import { SlotletProvider } from "./SlotletProvider.js";
|
|
26
34
|
|
|
27
35
|
export const DevPortalSystemPaths = {
|
|
28
36
|
Settings: "/settings",
|
|
@@ -32,71 +40,98 @@ export type DevPortalPath =
|
|
|
32
40
|
| string
|
|
33
41
|
| (typeof DevPortalSystemPaths)[keyof typeof DevPortalSystemPaths];
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
description: string;
|
|
40
|
-
logo: string;
|
|
41
|
-
favicon: string;
|
|
42
|
-
}>;
|
|
43
|
-
authentication?: AuthenticationProvider;
|
|
44
|
-
navigation: NavigationItem[];
|
|
45
|
-
plugins?: DevPortalPlugin[];
|
|
46
|
-
mdxComponents?: MdxComponentsType;
|
|
47
|
-
overrides?: ComponentsContextType;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const DevPortalInner = (props: DevPortalProps) => {
|
|
43
|
+
const DevPortalInner = ({
|
|
44
|
+
children,
|
|
45
|
+
...props
|
|
46
|
+
}: PropsWithChildren<ZudokuContextOptions>) => {
|
|
51
47
|
const components = useMemo(
|
|
52
48
|
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
53
49
|
[props.overrides],
|
|
54
50
|
);
|
|
55
51
|
|
|
56
|
-
const mdxComponents = useMemo(
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
const mdxComponents = useMemo(() => {
|
|
53
|
+
const componentsFromPlugins = (props.plugins ?? [])
|
|
54
|
+
.filter(isMdxProviderPlugin)
|
|
55
|
+
.flatMap((plugin) =>
|
|
56
|
+
plugin.getMdxComponents ? [plugin.getMdxComponents()] : [],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
...componentsFromPlugins.reduce((acc, curr) => ({ ...acc, ...curr }), {}),
|
|
61
|
+
...MdxComponents,
|
|
62
|
+
...props.mdx?.components,
|
|
63
|
+
};
|
|
64
|
+
}, [props.mdx?.components, props.plugins]);
|
|
65
|
+
const [isInitialized, setIsInitialized] = useState(false);
|
|
66
|
+
const { stagger } = useContext(StaggeredRenderContext);
|
|
67
|
+
const [didNavigate, setDidNavigate] = useState(false);
|
|
68
|
+
const navigate = useNavigate();
|
|
69
|
+
const initRef = useRef<"idle" | "pending" | "done">("idle");
|
|
70
|
+
const staggeredValue = useMemo(
|
|
71
|
+
() => (didNavigate ? { stagger: true } : { stagger }),
|
|
72
|
+
[stagger, didNavigate],
|
|
59
73
|
);
|
|
74
|
+
const navigation = useNavigation();
|
|
75
|
+
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (didNavigate) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
setDidNavigate(true);
|
|
81
|
+
}, [didNavigate, navigation.location]);
|
|
60
82
|
|
|
61
|
-
const devPortalContext =
|
|
83
|
+
const [devPortalContext] = useState(() => new DevPortalContext(props));
|
|
62
84
|
|
|
85
|
+
// TODO could be handled more elegantly
|
|
63
86
|
useEffect(() => {
|
|
64
|
-
|
|
65
|
-
|
|
87
|
+
if (initRef.current === "pending") return;
|
|
88
|
+
initRef.current = "pending";
|
|
89
|
+
void devPortalContext.initialize({ navigate }).then(() => {
|
|
90
|
+
initRef.current = "done";
|
|
91
|
+
setIsInitialized(true);
|
|
92
|
+
});
|
|
93
|
+
}, [devPortalContext, navigate]);
|
|
94
|
+
|
|
95
|
+
const heads = props.plugins
|
|
96
|
+
?.filter(hasHead)
|
|
97
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
98
|
+
.map((plugin, i) => <Fragment key={i}>{plugin.getHead?.()}</Fragment>);
|
|
99
|
+
|
|
100
|
+
if (!isInitialized) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
66
103
|
|
|
67
104
|
return (
|
|
68
105
|
<QueryClientProvider client={queryClient}>
|
|
69
|
-
<
|
|
106
|
+
<Helmet>{heads}</Helmet>
|
|
107
|
+
<StaggeredRenderContext.Provider value={staggeredValue}>
|
|
70
108
|
<DevPortalProvider value={devPortalContext}>
|
|
71
109
|
<MDXProvider components={mdxComponents}>
|
|
72
110
|
<ThemeProvider>
|
|
73
111
|
<ComponentsProvider value={components}>
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</div>
|
|
80
|
-
}
|
|
81
|
-
>
|
|
82
|
-
<Router
|
|
83
|
-
plugins={[
|
|
84
|
-
...(props.plugins ?? []),
|
|
85
|
-
...(props.authentication ? [props.authentication] : []),
|
|
86
|
-
]}
|
|
87
|
-
/>
|
|
88
|
-
</Suspense>
|
|
89
|
-
</ViewportAnchorProvider>
|
|
112
|
+
<SlotletProvider slotlets={props.slotlets}>
|
|
113
|
+
<ViewportAnchorProvider>
|
|
114
|
+
{children ?? <Outlet />}
|
|
115
|
+
</ViewportAnchorProvider>
|
|
116
|
+
</SlotletProvider>
|
|
90
117
|
</ComponentsProvider>
|
|
91
118
|
</ThemeProvider>
|
|
92
119
|
</MDXProvider>
|
|
93
120
|
</DevPortalProvider>
|
|
94
|
-
</
|
|
121
|
+
</StaggeredRenderContext.Provider>
|
|
95
122
|
</QueryClientProvider>
|
|
96
123
|
);
|
|
97
124
|
};
|
|
98
125
|
|
|
99
|
-
const
|
|
126
|
+
const Inner = memo(DevPortalInner);
|
|
127
|
+
|
|
128
|
+
const DevPortal = (props: ZudokuContextOptions) => {
|
|
129
|
+
return (
|
|
130
|
+
<ErrorBoundary FallbackComponent={TopLevelError}>
|
|
131
|
+
<Inner {...props} />
|
|
132
|
+
</ErrorBoundary>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
100
135
|
DevPortal.displayName = "DevPortal";
|
|
101
136
|
|
|
102
137
|
export { DevPortal };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Callout } from "../ui/Callout.js";
|
|
3
|
+
|
|
4
|
+
export const DeveloperHint = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
}: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}) => {
|
|
11
|
+
// TODO: figure out a way to do that in consumer dev mode not "internal"
|
|
12
|
+
// so this doesn't get stripped out in the build
|
|
13
|
+
if (!import.meta.env.DEV) return;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Callout type="caution" title="Developer hint" className={className}>
|
|
17
|
+
<div className="flex flex-col gap-2">
|
|
18
|
+
<div>{children}</div>
|
|
19
|
+
<small className="italic">
|
|
20
|
+
Note: This hint is only shown in development mode.
|
|
21
|
+
</small>
|
|
22
|
+
</div>
|
|
23
|
+
</Callout>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { CategoryHeading } from "./CategoryHeading.js";
|
|
4
|
+
import { Heading } from "./Heading.js";
|
|
5
|
+
import { ProseClasses } from "./Markdown.js";
|
|
6
|
+
|
|
7
|
+
export const ErrorPage = ({
|
|
8
|
+
title = "An error occurred",
|
|
9
|
+
message,
|
|
10
|
+
category,
|
|
11
|
+
}: {
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
message?: ReactNode;
|
|
14
|
+
category?: ReactNode;
|
|
15
|
+
}) => {
|
|
16
|
+
return (
|
|
17
|
+
<div className={ProseClasses + " h-full pt-[--padding-content-top]"}>
|
|
18
|
+
{category && <CategoryHeading>{category}</CategoryHeading>}
|
|
19
|
+
{title && (
|
|
20
|
+
<Heading level={1} className="flex gap-3.5 items-center">
|
|
21
|
+
{title}
|
|
22
|
+
</Heading>
|
|
23
|
+
)}
|
|
24
|
+
<p>{message}</p>
|
|
25
|
+
<Link to="/">Go back home</Link>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|