zudoku 0.0.0-f40ea27 → 0.0.0-f42e3678
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/app/demo.js +16 -1
- package/dist/app/demo.js.map +1 -1
- package/dist/app/main.js +3 -9
- package/dist/app/main.js.map +1 -1
- package/dist/cli/build/handler.js +9 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/config/loader.js +2 -5
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/BuildSchema.js +5 -0
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +254 -163
- package/dist/config/validators/InputNavigationSchema.js +4 -4
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.test-d.js +0 -1
- package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -1
- package/dist/config/validators/NavigationSchema.js +3 -2
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +12 -0
- package/dist/config/validators/ProtectedRoutesSchema.js +19 -0
- package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/icon-types.js +16 -0
- package/dist/config/validators/icon-types.js.map +1 -1
- package/dist/config/validators/validate.d.ts +36 -20
- package/dist/config/validators/validate.js +18 -4
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +65 -2
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/flat-config.d.ts +8 -6
- package/dist/lib/authentication/authentication.d.ts +2 -0
- package/dist/lib/authentication/components/CallbackHandler.js +11 -9
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/OAuthErrorPage.d.ts +3 -0
- package/dist/lib/authentication/components/OAuthErrorPage.js +99 -0
- package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -0
- package/dist/lib/authentication/components/SignIn.js +4 -3
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/errors.d.ts +6 -12
- package/dist/lib/authentication/errors.js +2 -1
- package/dist/lib/authentication/errors.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/azureb2c.js +4 -2
- package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +4 -2
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +4 -2
- package/dist/lib/authentication/providers/openid.js +14 -6
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Banner.js +1 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/CategoryHeading.js +1 -1
- package/dist/lib/components/CategoryHeading.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Markdown.js +2 -2
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +11 -6
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +1 -1
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/components/Pagination.js +1 -1
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/StatusPage.js +4 -0
- package/dist/lib/components/StatusPage.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +5 -0
- package/dist/lib/components/TopNavigation.js +20 -15
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Typography.d.ts +1 -1
- package/dist/lib/components/Typography.js +1 -1
- package/dist/lib/components/Typography.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +21 -13
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.d.ts +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +8 -1
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +3 -1
- package/dist/lib/components/navigation/utils.js +6 -3
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +9 -9
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +5 -2
- package/dist/lib/core/ZudokuContext.js +27 -2
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +2 -1
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +6 -4
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +1 -0
- package/dist/lib/plugins/api-keys/index.js +4 -8
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +4 -3
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +2 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- 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 +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +43 -11
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +4 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +5 -22
- package/dist/lib/plugins/search-inkeep/index.js +35 -29
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +5 -21
- package/dist/lib/plugins/search-inkeep/inkeep.js +10 -19
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +12 -5
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/ui/ActionButton.js +1 -1
- package/dist/lib/ui/ActionButton.js.map +1 -1
- package/dist/lib/ui/Alert.d.ts +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/CodeBlock.js +1 -1
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +6 -5
- package/dist/lib/util/invariant.js +1 -1
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/vite/build.js +7 -1
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/dev-server.js +9 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/mdx/remark-last-modified.js +1 -28
- package/dist/vite/mdx/remark-last-modified.js.map +1 -1
- package/dist/vite/plugin-docs.js +20 -13
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-mdx.js +2 -3
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-theme.js +88 -49
- package/dist/vite/plugin-theme.js.map +1 -1
- package/dist/vite/plugin-theme.test.js +25 -4
- package/dist/vite/plugin-theme.test.js.map +1 -1
- package/dist/vite/prerender/worker.js +5 -1
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/vite/shadcn-registry.d.ts +8 -8
- package/lib/{Button-BE9IVkWV.js → Button-B3o-2Xdf.js} +2 -2
- package/lib/{Button-BE9IVkWV.js.map → Button-B3o-2Xdf.js.map} +1 -1
- package/lib/{Card-DPhGbYUM.js → Card-CMDQUPM4.js} +2 -2
- package/lib/{Card-DPhGbYUM.js.map → Card-CMDQUPM4.js.map} +1 -1
- package/lib/ClientOnly-E7hGysn1.js.map +1 -1
- package/lib/{CodeBlock-DAKxs_Tu.js → CodeBlock-B-G0eKtw.js} +3 -3
- package/lib/{CodeBlock-DAKxs_Tu.js.map → CodeBlock-B-G0eKtw.js.map} +1 -1
- package/lib/{Command-xsbs2uhf.js → Command-BYukybsa.js} +3 -3
- package/lib/{Command-xsbs2uhf.js.map → Command-BYukybsa.js.map} +1 -1
- package/lib/{Dialog-CiIdyz6a.js → Dialog-u9Uz9sTt.js} +5 -5
- package/lib/{Dialog-CiIdyz6a.js.map → Dialog-u9Uz9sTt.js.map} +1 -1
- package/lib/{Drawer-BzkOKwgC.js → Drawer-DJ05s2pH.js} +86 -86
- package/lib/{Drawer-BzkOKwgC.js.map → Drawer-DJ05s2pH.js.map} +1 -1
- package/lib/{MdxPage-swXPJ0gf.js → MdxPage-Bsko6_kb.js} +34 -34
- package/lib/MdxPage-Bsko6_kb.js.map +1 -0
- package/lib/OAuthErrorPage-DJzGiIBt.js +150 -0
- package/lib/OAuthErrorPage-DJzGiIBt.js.map +1 -0
- package/lib/{OasProvider-CDAM3TB1.js → OasProvider-DQQRt3oS.js} +3 -3
- package/lib/{OasProvider-CDAM3TB1.js.map → OasProvider-DQQRt3oS.js.map} +1 -1
- package/lib/{OperationList-C9Hb9ql8.js → OperationList-DpmkHf26.js} +212 -210
- package/lib/OperationList-DpmkHf26.js.map +1 -0
- package/lib/{Pagination-VGlgeCmS.js → Pagination-kqFNgtnI.js} +10 -9
- package/lib/Pagination-kqFNgtnI.js.map +1 -0
- package/lib/{RouteGuard-CbKd7_9h.js → RouteGuard-0wPUKdxJ.js} +166 -165
- package/lib/{RouteGuard-CbKd7_9h.js.map → RouteGuard-0wPUKdxJ.js.map} +1 -1
- package/lib/{SchemaList-BAbh1BXO.js → SchemaList-DS-pMd6B.js} +9 -9
- package/lib/{SchemaList-BAbh1BXO.js.map → SchemaList-DS-pMd6B.js.map} +1 -1
- package/lib/{SchemaView-C2Io712T.js → SchemaView-BnN6WHjw.js} +6 -6
- package/lib/{SchemaView-C2Io712T.js.map → SchemaView-BnN6WHjw.js.map} +1 -1
- package/lib/Select-BmTTKNPp.js +273 -0
- package/lib/Select-BmTTKNPp.js.map +1 -0
- package/lib/SignUp-BwOSCD-6.js +56 -0
- package/lib/SignUp-BwOSCD-6.js.map +1 -0
- package/lib/{Slot-DwZlQ-vX.js → Slot-DAyXieeZ.js} +1634 -1643
- package/lib/Slot-DAyXieeZ.js.map +1 -0
- package/lib/Spinner-mNLZ6awP.js.map +1 -1
- package/lib/{SyntaxHighlight-CrjhGEwT.js → SyntaxHighlight-BMKR4pl6.js} +757 -757
- package/lib/SyntaxHighlight-BMKR4pl6.js.map +1 -0
- package/lib/{Toc-WCmwFkX-.js → Toc-BKDRCQzU.js} +3 -3
- package/lib/{Toc-WCmwFkX-.js.map → Toc-BKDRCQzU.js.map} +1 -1
- package/lib/ZudokuContext-CLl5w57E.js +1278 -0
- package/lib/ZudokuContext-CLl5w57E.js.map +1 -0
- package/lib/{chunk-DQRVZFIR-DHK7_Ilc.js → chunk-QMGIS6GS-CEOk3lro.js} +3 -3
- package/lib/chunk-QMGIS6GS-CEOk3lro.js.map +1 -0
- package/lib/{circular-B42RaanD.js → circular-8GWQDvCW.js} +2 -2
- package/lib/{circular-B42RaanD.js.map → circular-8GWQDvCW.js.map} +1 -1
- package/lib/{cn-wvCW-ho6.js → cn-dYga0KKN.js} +2 -2
- package/lib/cn-dYga0KKN.js.map +1 -0
- package/lib/{createServer-BKFsRuuk.js → createServer-BsezSzvV.js} +3398 -3552
- package/lib/createServer-BsezSzvV.js.map +1 -0
- package/lib/errors-Cs7hKmdL.js +45 -0
- package/lib/errors-Cs7hKmdL.js.map +1 -0
- package/lib/hook-DbUCLQNg.js +247 -0
- package/lib/hook-DbUCLQNg.js.map +1 -0
- package/lib/index-A5Qdwj1B.js +4081 -0
- package/lib/index-A5Qdwj1B.js.map +1 -0
- package/lib/{index-B6Re5_cx.js → index-Bg7Js3jB.js} +873 -951
- package/lib/index-Bg7Js3jB.js.map +1 -0
- package/lib/{index-CcV90rin.js → index-BkW9tJ6j.js} +2 -2
- package/lib/{index-CcV90rin.js.map → index-BkW9tJ6j.js.map} +1 -1
- package/lib/index-Bm35Tkgf.js +107 -0
- package/lib/index-Bm35Tkgf.js.map +1 -0
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/index-DI5SPFK9.js.map +1 -1
- package/lib/index-DmNq2fbN.js.map +1 -1
- package/lib/index.esm-CdzlRw50.js +1254 -0
- package/lib/index.esm-CdzlRw50.js.map +1 -0
- package/lib/{invariant-DAFpPywt.js → invariant-Bm-FVUQE.js} +2 -6
- package/lib/invariant-Bm-FVUQE.js.map +1 -0
- package/lib/jsx-runtime-C5mzlN2N.js.map +1 -1
- package/lib/processors/removeExtensions.js.map +1 -1
- package/lib/processors/removeParameters.js.map +1 -1
- package/lib/processors/removePaths.js.map +1 -1
- package/lib/processors/traverse.js.map +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/Accordion.js.map +1 -1
- package/lib/ui/ActionButton.js +10 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Alert.js +1 -1
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/AlertDialog.js.map +1 -1
- package/lib/ui/Badge.js +1 -1
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Breadcrumb.js.map +1 -1
- package/lib/ui/Button.js +1 -1
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +1 -1
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Card.js.map +1 -1
- package/lib/ui/Carousel.js +1 -1
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/CodeBlock.js +2 -2
- package/lib/ui/Command.js +2 -2
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +2 -2
- package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/lib/ui/Form.js +2 -2
- package/lib/ui/Form.js.map +1 -1
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/HoverCard.js.map +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Input.js.map +1 -1
- package/lib/ui/Label.js +1 -1
- package/lib/ui/Label.js.map +1 -1
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Pagination.js.map +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Popover.js.map +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/Progress.js.map +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/RadioGroup.js.map +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/ScrollArea.js.map +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Skeleton.js.map +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Slider.js.map +1 -1
- package/lib/ui/Stepper.js.map +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/Switch.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +4 -4
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Tabs.js.map +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Textarea.js.map +1 -1
- package/lib/ui/Toggle.js +1 -1
- package/lib/ui/Toggle.js.map +1 -1
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/ToggleGroup.js.map +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/ui/Tooltip.js.map +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/{useExposedProps-BIYjecPD.js → useExposedProps-KcgXHKeE.js} +2 -2
- package/lib/{useExposedProps-BIYjecPD.js.map → useExposedProps-KcgXHKeE.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +46 -9883
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +25 -22
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +249 -231
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.auth-supabase.js +97 -0
- package/lib/zudoku.auth-supabase.js.map +1 -0
- package/lib/zudoku.components.js +30 -29
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +17 -16
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.icons.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +26 -25
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +428 -299
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +7 -6
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +54 -57
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +123 -118
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +34 -33
- package/src/app/demo.tsx +19 -2
- package/src/app/main.css +26 -5
- package/src/app/main.tsx +6 -14
- package/src/lib/authentication/authentication.ts +2 -2
- package/src/lib/authentication/components/CallbackHandler.tsx +22 -15
- package/src/lib/authentication/components/OAuthErrorPage.tsx +171 -0
- package/src/lib/authentication/components/SignIn.tsx +5 -12
- package/src/lib/authentication/errors.ts +27 -13
- package/src/lib/authentication/hook.ts +2 -0
- package/src/lib/authentication/providers/azureb2c.tsx +8 -3
- package/src/lib/authentication/providers/clerk.tsx +4 -1
- package/src/lib/authentication/providers/openid.tsx +30 -5
- package/src/lib/components/Banner.tsx +0 -1
- package/src/lib/components/CategoryHeading.tsx +4 -1
- package/src/lib/components/Header.tsx +5 -2
- package/src/lib/components/Heading.tsx +1 -1
- package/src/lib/components/Markdown.tsx +3 -3
- package/src/lib/components/MobileTopNavigation.tsx +60 -8
- package/src/lib/components/NotFoundPage.tsx +3 -2
- package/src/lib/components/Pagination.tsx +1 -0
- package/src/lib/components/StatusPage.tsx +5 -0
- package/src/lib/components/TopNavigation.tsx +34 -18
- package/src/lib/components/Typography.tsx +1 -1
- package/src/lib/components/context/ZudokuContext.ts +25 -18
- package/src/lib/components/navigation/NavigationItem.tsx +9 -1
- package/src/lib/components/navigation/NavigationWrapper.tsx +4 -1
- package/src/lib/components/navigation/utils.ts +9 -3
- package/src/lib/core/RouteGuard.tsx +13 -13
- package/src/lib/core/ZudokuContext.ts +40 -5
- package/src/lib/core/plugins.ts +2 -1
- package/src/lib/errors/ErrorAlert.tsx +5 -7
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +12 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +37 -13
- package/src/lib/plugins/api-keys/index.tsx +8 -9
- package/src/lib/plugins/markdown/MdxPage.tsx +4 -3
- package/src/lib/plugins/openapi/OperationList.tsx +4 -2
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -1
- package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +2 -0
- package/src/lib/plugins/openapi/index.tsx +67 -17
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +8 -2
- package/src/lib/plugins/search-inkeep/index.tsx +54 -58
- package/src/lib/plugins/search-inkeep/inkeep.ts +19 -21
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +1 -0
- package/src/lib/plugins/search-pagefind/ResultList.tsx +13 -4
- package/src/lib/ui/ActionButton.tsx +3 -1
- package/src/lib/ui/Alert.tsx +1 -1
- package/src/lib/ui/CodeBlock.tsx +1 -1
- package/src/lib/ui/EmbeddedCodeBlock.tsx +1 -1
- package/src/lib/util/invariant.ts +7 -5
- package/lib/Alert-CT_ViLrJ.js +0 -161
- package/lib/Alert-CT_ViLrJ.js.map +0 -1
- package/lib/MdxPage-swXPJ0gf.js.map +0 -1
- package/lib/OperationList-C9Hb9ql8.js.map +0 -1
- package/lib/Pagination-VGlgeCmS.js.map +0 -1
- package/lib/SignUp-5RUdVhnq.js +0 -63
- package/lib/SignUp-5RUdVhnq.js.map +0 -1
- package/lib/Slot-DwZlQ-vX.js.map +0 -1
- package/lib/SyntaxHighlight-CrjhGEwT.js.map +0 -1
- package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +0 -1
- package/lib/clerk-BDZ31hjU.js +0 -25190
- package/lib/clerk-BDZ31hjU.js.map +0 -1
- package/lib/cn-wvCW-ho6.js.map +0 -1
- package/lib/createServer-BKFsRuuk.js.map +0 -1
- package/lib/errors-CF2X_x5o.js +0 -78
- package/lib/errors-CF2X_x5o.js.map +0 -1
- package/lib/hook-Bd0yS8M0.js +0 -1503
- package/lib/hook-Bd0yS8M0.js.map +0 -1
- package/lib/index-B6Re5_cx.js.map +0 -1
- package/lib/index-CLy1XyH0.js +0 -3919
- package/lib/index-CLy1XyH0.js.map +0 -1
- package/lib/index-ClhS5TxS.js +0 -107
- package/lib/index-ClhS5TxS.js.map +0 -1
- package/lib/index.esm-Cp4wkyud.js +0 -1236
- package/lib/index.esm-Cp4wkyud.js.map +0 -1
- package/lib/invariant-DAFpPywt.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-f42e3678",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://zudoku.dev",
|
|
6
6
|
"repository": {
|
|
@@ -133,13 +133,13 @@
|
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
135
|
"@apidevtools/json-schema-ref-parser": "12.0.2",
|
|
136
|
-
"@envelop/core": "5.
|
|
136
|
+
"@envelop/core": "5.3.0",
|
|
137
137
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
138
138
|
"@hookform/resolvers": "4.1.3",
|
|
139
|
-
"@lekoarts/rehype-meta-as-attributes": "3.0.
|
|
139
|
+
"@lekoarts/rehype-meta-as-attributes": "3.0.3",
|
|
140
140
|
"@mdx-js/react": "3.1.0",
|
|
141
141
|
"@mdx-js/rollup": "3.1.0",
|
|
142
|
-
"@pothos/core": "4.
|
|
142
|
+
"@pothos/core": "4.7.0",
|
|
143
143
|
"@radix-ui/react-accordion": "1.2.11",
|
|
144
144
|
"@radix-ui/react-alert-dialog": "1.1.14",
|
|
145
145
|
"@radix-ui/react-aspect-ratio": "1.1.7",
|
|
@@ -162,21 +162,21 @@
|
|
|
162
162
|
"@radix-ui/react-toggle-group": "1.1.10",
|
|
163
163
|
"@radix-ui/react-tooltip": "1.2.7",
|
|
164
164
|
"@radix-ui/react-visually-hidden": "1.2.3",
|
|
165
|
-
"@scalar/openapi-parser": "0.
|
|
165
|
+
"@scalar/openapi-parser": "0.18.0",
|
|
166
166
|
"@sentry/node": "9.26.0",
|
|
167
|
-
"@shikijs/langs": "3.
|
|
168
|
-
"@shikijs/rehype": "3.
|
|
169
|
-
"@shikijs/themes": "3.
|
|
170
|
-
"@shikijs/transformers": "3.
|
|
167
|
+
"@shikijs/langs": "3.7.0",
|
|
168
|
+
"@shikijs/rehype": "3.7.0",
|
|
169
|
+
"@shikijs/themes": "3.7.0",
|
|
170
|
+
"@shikijs/transformers": "3.7.0",
|
|
171
171
|
"@sindresorhus/slugify": "2.2.1",
|
|
172
172
|
"@stefanprobst/rehype-extract-toc": "3.0.0",
|
|
173
173
|
"@tailwindcss/typography": "0.5.16",
|
|
174
|
-
"@tailwindcss/vite": "4.1.
|
|
174
|
+
"@tailwindcss/vite": "4.1.11",
|
|
175
175
|
"@tanem/react-nprogress": "5.0.55",
|
|
176
|
-
"@tanstack/react-query": "5.
|
|
176
|
+
"@tanstack/react-query": "5.81.5",
|
|
177
177
|
"@types/react": "19.1.8",
|
|
178
178
|
"@types/react-dom": "19.1.6",
|
|
179
|
-
"@vitejs/plugin-react": "4.
|
|
179
|
+
"@vitejs/plugin-react": "4.6.0",
|
|
180
180
|
"@zudoku/httpsnippet": "10.0.9",
|
|
181
181
|
"@zudoku/react-helmet-async": "2.0.5",
|
|
182
182
|
"allof-merge": "0.6.6",
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
"glob-parent": "6.0.2",
|
|
196
196
|
"graphql": "16.11.0",
|
|
197
197
|
"graphql-type-json": "0.3.2",
|
|
198
|
-
"graphql-yoga": "5.
|
|
198
|
+
"graphql-yoga": "5.14.0",
|
|
199
199
|
"gray-matter": "4.0.3",
|
|
200
200
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
201
201
|
"hast-util-to-string": "3.0.1",
|
|
@@ -203,24 +203,24 @@
|
|
|
203
203
|
"http-terminator": "3.2.0",
|
|
204
204
|
"json-schema-to-typescript-lite": "14.1.0",
|
|
205
205
|
"loglevel": "1.9.2",
|
|
206
|
-
"lru-cache": "11.0
|
|
207
|
-
"lucide-react": "0.
|
|
206
|
+
"lru-cache": "11.1.0",
|
|
207
|
+
"lucide-react": "0.525.0",
|
|
208
208
|
"minimatch": "10.0.1",
|
|
209
|
-
"motion": "12.
|
|
209
|
+
"motion": "12.23.3",
|
|
210
210
|
"nanoevents": "^9.1.0",
|
|
211
|
-
"next-themes": "0.4.
|
|
211
|
+
"next-themes": "0.4.6",
|
|
212
212
|
"oauth4webapi": "2.17.0",
|
|
213
213
|
"object-hash": "3.0.0",
|
|
214
214
|
"openapi-types": "12.1.3",
|
|
215
215
|
"pagefind": "1.4.0-alpha.1",
|
|
216
216
|
"picocolors": "1.1.1",
|
|
217
|
-
"piscina": "5.
|
|
217
|
+
"piscina": "5.1.3",
|
|
218
218
|
"posthog-node": "4.17.1",
|
|
219
|
-
"react-error-boundary": "
|
|
220
|
-
"react-hook-form": "7.
|
|
219
|
+
"react-error-boundary": "6.0.0",
|
|
220
|
+
"react-hook-form": "7.60.0",
|
|
221
221
|
"react-is": "19.1.0",
|
|
222
222
|
"react-markdown": "10.1.0",
|
|
223
|
-
"react-router": "7.6.
|
|
223
|
+
"react-router": "7.6.3",
|
|
224
224
|
"rehype-mdx-import-media": "1.2.0",
|
|
225
225
|
"rehype-raw": "7.0.0",
|
|
226
226
|
"rehype-slug": "6.0.0",
|
|
@@ -229,17 +229,17 @@
|
|
|
229
229
|
"remark-directive-rehype": "0.4.2",
|
|
230
230
|
"remark-frontmatter": "5.0.0",
|
|
231
231
|
"remark-gfm": "4.0.1",
|
|
232
|
-
"remark-mdx-frontmatter": "5.
|
|
232
|
+
"remark-mdx-frontmatter": "5.2.0",
|
|
233
233
|
"remark-parse": "^11.0.0",
|
|
234
234
|
"remark-rehype": "^11.1.2",
|
|
235
|
-
"rollup": "4.
|
|
236
|
-
"semver": "7.7.
|
|
237
|
-
"shiki": "3.
|
|
235
|
+
"rollup": "4.45.0",
|
|
236
|
+
"semver": "7.7.2",
|
|
237
|
+
"shiki": "3.7.0",
|
|
238
238
|
"sitemap": "8.0.0",
|
|
239
239
|
"spin-delay": "2.0.1",
|
|
240
240
|
"strip-ansi": "7.1.0",
|
|
241
|
-
"tailwind-merge": "3.3.
|
|
242
|
-
"tailwindcss": "4.1.
|
|
241
|
+
"tailwind-merge": "3.3.1",
|
|
242
|
+
"tailwindcss": "4.1.11",
|
|
243
243
|
"ulidx": "2.4.1",
|
|
244
244
|
"unified": "^11.0.5",
|
|
245
245
|
"unist-util-visit": "5.0.0",
|
|
@@ -247,18 +247,19 @@
|
|
|
247
247
|
"vfile": "6.0.3",
|
|
248
248
|
"vite": "6.3.5",
|
|
249
249
|
"yaml": "2.8.0",
|
|
250
|
-
"yargs": "
|
|
251
|
-
"zod": "3.25.
|
|
250
|
+
"yargs": "18.0.0",
|
|
251
|
+
"zod": "3.25.74",
|
|
252
252
|
"zod-to-ts": "1.2.0",
|
|
253
253
|
"zustand": "5.0.5"
|
|
254
254
|
},
|
|
255
255
|
"devDependencies": {
|
|
256
256
|
"@graphql-codegen/cli": "5.0.7",
|
|
257
257
|
"@graphql-codegen/client-preset": "4.8.2",
|
|
258
|
+
"@inkeep/cxkit-types": "0.5.90",
|
|
258
259
|
"@testing-library/dom": "10.4.0",
|
|
259
260
|
"@testing-library/jest-dom": "6.6.3",
|
|
260
261
|
"@testing-library/react": "16.3.0",
|
|
261
|
-
"@types/estree": "1.0.
|
|
262
|
+
"@types/estree": "1.0.8",
|
|
262
263
|
"@types/express": "5.0.2",
|
|
263
264
|
"@types/glob-parent": "5.1.3",
|
|
264
265
|
"@types/har-format": "1.2.16",
|
|
@@ -274,14 +275,14 @@
|
|
|
274
275
|
"@types/yargs": "17.0.33",
|
|
275
276
|
"@vitest/coverage-v8": "3.2.1",
|
|
276
277
|
"esbuild": "0.25.1",
|
|
277
|
-
"happy-dom": "
|
|
278
|
+
"happy-dom": "18.0.1",
|
|
278
279
|
"mdast-util-mdx": "3.0.0",
|
|
279
280
|
"react": "19.1.0",
|
|
280
281
|
"react-dom": "19.1.0",
|
|
281
|
-
"rollup-plugin-visualizer": "
|
|
282
|
+
"rollup-plugin-visualizer": "6.0.3",
|
|
282
283
|
"tsx": "4.19.4",
|
|
283
284
|
"typescript": "5.8.3",
|
|
284
|
-
"vitest": "3.2.
|
|
285
|
+
"vitest": "3.2.4"
|
|
285
286
|
},
|
|
286
287
|
"peerDependencies": {
|
|
287
288
|
"@azure/msal-browser": "^4.13.0",
|
package/src/app/demo.tsx
CHANGED
|
@@ -10,6 +10,10 @@ import "./main.css";
|
|
|
10
10
|
import { getRoutesByConfig } from "./main.js";
|
|
11
11
|
|
|
12
12
|
const apiUrl = new URL(window.location.href).searchParams.get("api-url");
|
|
13
|
+
const logoUrl = new URL(window.location.href).searchParams.get("logo-url");
|
|
14
|
+
const logoWidth = new URL(window.location.href).searchParams.get("logo-width");
|
|
15
|
+
const title =
|
|
16
|
+
new URL(window.location.href).searchParams.get("title") ?? "Zudoku Demo";
|
|
13
17
|
|
|
14
18
|
if (!apiUrl) {
|
|
15
19
|
throw new Error(
|
|
@@ -29,9 +33,9 @@ if (!root) {
|
|
|
29
33
|
// IMPORTANT: This component must not contain tailwind classes
|
|
30
34
|
// This directory is not processed by the tailwind plugin
|
|
31
35
|
|
|
32
|
-
const config = {
|
|
36
|
+
const config: ZudokuConfig = {
|
|
33
37
|
site: {
|
|
34
|
-
title
|
|
38
|
+
title,
|
|
35
39
|
banner: {
|
|
36
40
|
message: <DemoAnnouncement />,
|
|
37
41
|
},
|
|
@@ -53,6 +57,19 @@ const config = {
|
|
|
53
57
|
],
|
|
54
58
|
} satisfies ZudokuConfig;
|
|
55
59
|
|
|
60
|
+
if (logoUrl && logoWidth) {
|
|
61
|
+
config.site = {
|
|
62
|
+
...config.site,
|
|
63
|
+
logo: {
|
|
64
|
+
src: {
|
|
65
|
+
light: logoUrl,
|
|
66
|
+
dark: logoUrl,
|
|
67
|
+
},
|
|
68
|
+
width: logoWidth,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
56
73
|
const routes = getRoutesByConfig(config);
|
|
57
74
|
const router = createBrowserRouter(routes, {
|
|
58
75
|
basename: window.location.pathname,
|
package/src/app/main.css
CHANGED
|
@@ -121,6 +121,10 @@
|
|
|
121
121
|
.shiki {
|
|
122
122
|
counter-reset: line;
|
|
123
123
|
@apply leading-normal;
|
|
124
|
+
background-color: var(--shiki-light-bg) !important;
|
|
125
|
+
}
|
|
126
|
+
.dark .shiki {
|
|
127
|
+
background-color: var(--shiki-dark-bg) !important;
|
|
124
128
|
}
|
|
125
129
|
.code-block .shiki {
|
|
126
130
|
@apply grid grid-rows-1;
|
|
@@ -149,17 +153,34 @@
|
|
|
149
153
|
@apply tabular-nums inline-flex items-baseline justify-end me-4 w-3 text-muted-foreground/25;
|
|
150
154
|
}
|
|
151
155
|
|
|
152
|
-
.shiki.not-inline .line {
|
|
156
|
+
.light .shiki.not-inline .line {
|
|
153
157
|
@apply block -mx-4 px-4 w-[calc(100%+2rem)];
|
|
154
|
-
--highlighted-bg: hsl(
|
|
155
|
-
from var(--muted) h s calc(l + 4 * var(--dark)) / 50%
|
|
156
|
-
);
|
|
158
|
+
--highlighted-bg: hsl(from var(--shiki-light-bg) h s calc(l - 6));
|
|
157
159
|
}
|
|
160
|
+
.dark .shiki.not-inline .line {
|
|
161
|
+
@apply block -mx-4 px-4 w-[calc(100%+2rem)];
|
|
162
|
+
--highlighted-bg: hsl(from var(--shiki-dark-bg) h s calc(l + 10));
|
|
163
|
+
}
|
|
164
|
+
|
|
158
165
|
.shiki .line.highlighted {
|
|
159
|
-
@apply bg-(--highlighted-bg);
|
|
166
|
+
@apply bg-(--highlighted-bg) relative;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.shiki .line.highlighted:before {
|
|
170
|
+
position: absolute;
|
|
171
|
+
inset-inline-start: 0;
|
|
172
|
+
inset-block-start: 0;
|
|
173
|
+
inset-block-end: 0;
|
|
174
|
+
border-left: 2px solid
|
|
175
|
+
hsl(from var(--highlighted-bg) h s calc(l + 4 * var(--dark)));
|
|
176
|
+
content: "";
|
|
160
177
|
}
|
|
161
178
|
|
|
162
179
|
.shiki .highlighted-word {
|
|
180
|
+
--highlighted-bg: hsl(
|
|
181
|
+
from var(--muted) h s calc(l + 4 * var(--dark)) / 50%
|
|
182
|
+
);
|
|
183
|
+
|
|
163
184
|
@apply bg-(--highlighted-bg) px-0.5 rounded;
|
|
164
185
|
box-shadow: 0 0 0 4px var(--highlighted-bg);
|
|
165
186
|
}
|
package/src/app/main.tsx
CHANGED
|
@@ -82,22 +82,13 @@ export const getRoutesByOptions = (
|
|
|
82
82
|
.flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
|
|
83
83
|
.concat(
|
|
84
84
|
enableStatusPages
|
|
85
|
-
? [400,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}),
|
|
90
|
-
)
|
|
85
|
+
? [400, 404, 500].map((statusCode) => ({
|
|
86
|
+
path: `/${statusCode}`,
|
|
87
|
+
element: <StatusPage statusCode={statusCode} />,
|
|
88
|
+
}))
|
|
91
89
|
: [],
|
|
92
90
|
)
|
|
93
|
-
.concat([
|
|
94
|
-
{
|
|
95
|
-
path: "*",
|
|
96
|
-
loader: () => {
|
|
97
|
-
throw new Response("Not Found", { status: 404 });
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
]);
|
|
91
|
+
.concat([{ path: "*", element: <StatusPage statusCode={404} /> }]);
|
|
101
92
|
|
|
102
93
|
// @TODO Detect conflicts in routes and log warning
|
|
103
94
|
|
|
@@ -125,6 +116,7 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
|
125
116
|
<Layout />
|
|
126
117
|
</Zudoku>
|
|
127
118
|
),
|
|
119
|
+
hydrateFallbackElement: <div>Loading...</div>,
|
|
128
120
|
children: [
|
|
129
121
|
{
|
|
130
122
|
element: <RouteGuard />,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface AuthenticationPlugin {
|
|
2
|
-
signUp(options?: { redirectTo?: string }): Promise<void>;
|
|
3
|
-
signIn(options?: { redirectTo?: string }): Promise<void>;
|
|
2
|
+
signUp(options?: { redirectTo?: string; replace?: boolean }): Promise<void>;
|
|
3
|
+
signIn(options?: { redirectTo?: string; replace?: boolean }): Promise<void>;
|
|
4
4
|
signOut(): Promise<void>;
|
|
5
5
|
// @deprecated use signRequest instead
|
|
6
6
|
getAccessToken(): Promise<string>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
2
2
|
import { Navigate } from "react-router";
|
|
3
3
|
import { useZudoku } from "zudoku/components";
|
|
4
|
-
import { ZudokuError } from "../../util/invariant.js";
|
|
5
4
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
6
5
|
import { normalizeRedirectUrl } from "../../util/url.js";
|
|
6
|
+
import { OAuthAuthorizationError, type OAuthErrorType } from "../errors.js";
|
|
7
7
|
|
|
8
8
|
export function CallbackHandler({
|
|
9
9
|
handleCallback,
|
|
@@ -15,22 +15,29 @@ export function CallbackHandler({
|
|
|
15
15
|
retry: false,
|
|
16
16
|
queryKey: ["oauth-callback"],
|
|
17
17
|
queryFn: async () => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const url = new URL(window.location.href);
|
|
19
|
+
|
|
20
|
+
const errorParam = url.searchParams.get("error");
|
|
21
|
+
const errorDescription =
|
|
22
|
+
url.searchParams.get("error_description") ?? undefined;
|
|
23
|
+
const errorUri = url.searchParams.get("error_uri") ?? undefined;
|
|
24
|
+
if (errorParam) {
|
|
25
|
+
throw new OAuthAuthorizationError(
|
|
26
|
+
`OAuth error '${errorParam}': ${errorDescription}`,
|
|
27
|
+
{
|
|
28
|
+
error: errorParam as OAuthErrorType,
|
|
29
|
+
error_description: errorDescription,
|
|
30
|
+
error_uri: errorUri,
|
|
31
|
+
},
|
|
25
32
|
);
|
|
26
|
-
} catch (error) {
|
|
27
|
-
throw new ZudokuError("Could not validate user", {
|
|
28
|
-
cause: error,
|
|
29
|
-
title: "Authentication Error",
|
|
30
|
-
developerHint:
|
|
31
|
-
"Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly.",
|
|
32
|
-
});
|
|
33
33
|
}
|
|
34
|
+
return joinUrl(
|
|
35
|
+
normalizeRedirectUrl(
|
|
36
|
+
await handleCallback(),
|
|
37
|
+
window.location.origin,
|
|
38
|
+
options.basePath,
|
|
39
|
+
),
|
|
40
|
+
);
|
|
34
41
|
},
|
|
35
42
|
});
|
|
36
43
|
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { HomeIcon } from "lucide-react";
|
|
2
|
+
import { Link } from "react-router";
|
|
3
|
+
import { Heading } from "../../components/Heading.js";
|
|
4
|
+
import { Typography } from "../../components/Typography.js";
|
|
5
|
+
import { Button } from "../../ui/Button.js";
|
|
6
|
+
import { OAuthAuthorizationError } from "../errors.js";
|
|
7
|
+
import { useAuth } from "../hook.js";
|
|
8
|
+
|
|
9
|
+
const errorDetailsMap: Record<string, { message: string }> = {
|
|
10
|
+
invalid_request: {
|
|
11
|
+
message:
|
|
12
|
+
"The authentication request was invalid. Please try signing in again.",
|
|
13
|
+
},
|
|
14
|
+
unauthorized_client: {
|
|
15
|
+
message:
|
|
16
|
+
"This application is not authorized to access your account. Please contact support.",
|
|
17
|
+
},
|
|
18
|
+
access_denied: {
|
|
19
|
+
message:
|
|
20
|
+
"You denied access to this application. To continue, please sign in and grant access.",
|
|
21
|
+
},
|
|
22
|
+
unsupported_response_type: {
|
|
23
|
+
message:
|
|
24
|
+
"The authentication method is not supported. Please contact support.",
|
|
25
|
+
},
|
|
26
|
+
invalid_scope: {
|
|
27
|
+
message: "The requested permissions are invalid. Please contact support.",
|
|
28
|
+
},
|
|
29
|
+
server_error: {
|
|
30
|
+
message:
|
|
31
|
+
"The authentication server encountered an error. Please try again in a few moments.",
|
|
32
|
+
},
|
|
33
|
+
temporarily_unavailable: {
|
|
34
|
+
message:
|
|
35
|
+
"The authentication service is temporarily unavailable. Please try again in a few moments.",
|
|
36
|
+
},
|
|
37
|
+
// Token errors
|
|
38
|
+
invalid_client: {
|
|
39
|
+
message: "Invalid application credentials. Please contact support.",
|
|
40
|
+
},
|
|
41
|
+
invalid_grant: {
|
|
42
|
+
message:
|
|
43
|
+
"The authentication code has expired or is invalid. Please sign in again.",
|
|
44
|
+
},
|
|
45
|
+
unsupported_grant_type: {
|
|
46
|
+
message:
|
|
47
|
+
"The authentication method is not supported. Please contact support.",
|
|
48
|
+
},
|
|
49
|
+
// Custom errors
|
|
50
|
+
invalid_state: {
|
|
51
|
+
message:
|
|
52
|
+
"Security validation failed. This may be due to a potential security attack. Please try signing in again.",
|
|
53
|
+
},
|
|
54
|
+
missing_code_verifier: {
|
|
55
|
+
message:
|
|
56
|
+
"Authentication security information is missing. Please clear your browser cache and try again.",
|
|
57
|
+
},
|
|
58
|
+
network_error: {
|
|
59
|
+
message:
|
|
60
|
+
"A network error occurred during authentication. Please check your connection and try again.",
|
|
61
|
+
},
|
|
62
|
+
token_expired: {
|
|
63
|
+
message: "Your authentication session has expired. Please sign in again.",
|
|
64
|
+
},
|
|
65
|
+
configuration_error: {
|
|
66
|
+
message:
|
|
67
|
+
"There is an issue with the authentication configuration. Please contact support.",
|
|
68
|
+
},
|
|
69
|
+
unknown_error: {
|
|
70
|
+
message:
|
|
71
|
+
"An unexpected error occurred during authentication. Please try again or contact support.",
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export function OAuthErrorPage({ error }: { error: any }) {
|
|
76
|
+
const { login } = useAuth();
|
|
77
|
+
|
|
78
|
+
if (!(error instanceof OAuthAuthorizationError)) {
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const oauthError = error.error;
|
|
83
|
+
const type = oauthError.error;
|
|
84
|
+
|
|
85
|
+
const details = errorDetailsMap[type] ?? errorDetailsMap.unknown_error;
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div className="min-h-[400px] flex items-center justify-center p-4">
|
|
89
|
+
<div className="max-w-md w-full text-center space-y-6">
|
|
90
|
+
<div className="space-y-4 items-center">
|
|
91
|
+
<Heading level={2} className="text-2xl inline-block font-bold">
|
|
92
|
+
{titles[type] || "Authentication Error"}
|
|
93
|
+
</Heading>
|
|
94
|
+
|
|
95
|
+
<Typography className="text-gray-600 dark:text-gray-300 leading-relaxed">
|
|
96
|
+
{details?.message}
|
|
97
|
+
</Typography>
|
|
98
|
+
|
|
99
|
+
{/* Technical details for developers (only in development) */}
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{/* Action Buttons */}
|
|
103
|
+
<div className="space-y-3 pt-4">
|
|
104
|
+
<div className="space-y-2">
|
|
105
|
+
{(type === "access_denied" ||
|
|
106
|
+
type === "invalid_grant" ||
|
|
107
|
+
type === "token_expired") && (
|
|
108
|
+
<Button
|
|
109
|
+
onClick={login}
|
|
110
|
+
className="w-full capitalize"
|
|
111
|
+
variant={"default"}
|
|
112
|
+
>
|
|
113
|
+
Sign in again
|
|
114
|
+
</Button>
|
|
115
|
+
)}
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div className="flex gap-2">
|
|
119
|
+
<Button asChild className="flex-1" variant="outline">
|
|
120
|
+
<Link to="/">
|
|
121
|
+
<HomeIcon className="w-4 h-4 mr-2" />
|
|
122
|
+
Go Home
|
|
123
|
+
</Link>
|
|
124
|
+
</Button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
{/* Additional Help */}
|
|
129
|
+
{helpMessages[type] && (
|
|
130
|
+
<Typography className="text-sm text-gray-500 dark:text-gray-400">
|
|
131
|
+
{helpMessages[type]}
|
|
132
|
+
</Typography>
|
|
133
|
+
)}
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const titles: Record<string, string> = {
|
|
140
|
+
access_denied: "Access Denied",
|
|
141
|
+
invalid_request: "Invalid Request",
|
|
142
|
+
unauthorized_client: "Unauthorized Application",
|
|
143
|
+
unsupported_response_type: "Unsupported Method",
|
|
144
|
+
invalid_scope: "Invalid Permissions",
|
|
145
|
+
server_error: "Server Error",
|
|
146
|
+
temporarily_unavailable: "Service Unavailable",
|
|
147
|
+
invalid_client: "Invalid Credentials",
|
|
148
|
+
invalid_grant: "Authentication Expired",
|
|
149
|
+
unsupported_grant_type: "Unsupported Authentication",
|
|
150
|
+
invalid_state: "Security Check Failed",
|
|
151
|
+
missing_code_verifier: "Security Information Missing",
|
|
152
|
+
network_error: "Network Error",
|
|
153
|
+
token_expired: "Session Expired",
|
|
154
|
+
configuration_error: "Configuration Error",
|
|
155
|
+
unknown_error: "Authentication Failed",
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const helpMessages: Record<string, string> = {
|
|
159
|
+
access_denied:
|
|
160
|
+
"If you changed your mind, you can try signing in again to grant access.",
|
|
161
|
+
invalid_state:
|
|
162
|
+
"This error can occur if you have multiple tabs open or if your session was compromised.",
|
|
163
|
+
missing_code_verifier:
|
|
164
|
+
"Try clearing your browser's cache and cookies for this site.",
|
|
165
|
+
network_error:
|
|
166
|
+
"Check your internet connection and ensure you can access other websites.",
|
|
167
|
+
server_error:
|
|
168
|
+
"The issue is on our end. Our team has been notified and is working to fix it.",
|
|
169
|
+
temporarily_unavailable:
|
|
170
|
+
"This is usually temporary. Try again in a few minutes.",
|
|
171
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useSearchParams } from "react-router";
|
|
3
|
+
import { Spinner } from "zudoku/components";
|
|
4
4
|
import {
|
|
5
5
|
Card,
|
|
6
6
|
CardContent,
|
|
@@ -16,6 +16,7 @@ export const SignIn = () => {
|
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
void context.authentication?.signIn({
|
|
18
18
|
redirectTo: search.get("redirect") ?? undefined,
|
|
19
|
+
replace: true,
|
|
19
20
|
});
|
|
20
21
|
}, [context.authentication, search]);
|
|
21
22
|
|
|
@@ -30,16 +31,8 @@ export const SignIn = () => {
|
|
|
30
31
|
</CardDescription>
|
|
31
32
|
</CardHeader>
|
|
32
33
|
<CardContent>
|
|
33
|
-
<div className="flex
|
|
34
|
-
<
|
|
35
|
-
onClick={() => context.authentication?.signIn()}
|
|
36
|
-
variant="default"
|
|
37
|
-
>
|
|
38
|
-
Login
|
|
39
|
-
</Button>
|
|
40
|
-
<Button variant="link" className="text-muted-foreground" asChild>
|
|
41
|
-
<Link to="/">Go home</Link>
|
|
42
|
-
</Button>
|
|
34
|
+
<div className="flex items-center text-sm font-medium gap-2">
|
|
35
|
+
<Spinner /> Redirecting...
|
|
43
36
|
</div>
|
|
44
37
|
</CardContent>
|
|
45
38
|
</Card>
|
|
@@ -1,21 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import type { OAuth2Error } from "oauth4webapi";
|
|
2
|
+
import { ZudokuError, type ZudokuErrorOptions } from "../util/invariant.js";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
readonly error: string;
|
|
5
|
-
readonly error_description?: string;
|
|
6
|
-
readonly error_uri?: string;
|
|
7
|
-
readonly algs?: string;
|
|
8
|
-
readonly scope?: string;
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
readonly [parameter: string]: any | undefined;
|
|
11
|
-
}
|
|
4
|
+
export class AuthorizationError extends Error {}
|
|
12
5
|
|
|
13
|
-
export class OAuthAuthorizationError extends
|
|
6
|
+
export class OAuthAuthorizationError extends ZudokuError {
|
|
14
7
|
constructor(
|
|
15
8
|
message: string,
|
|
16
|
-
public error:
|
|
17
|
-
options?:
|
|
9
|
+
public error: OAuth2Error,
|
|
10
|
+
options?: ZudokuErrorOptions,
|
|
18
11
|
) {
|
|
19
12
|
super(message, options);
|
|
20
13
|
}
|
|
21
14
|
}
|
|
15
|
+
|
|
16
|
+
export type OAuthErrorType =
|
|
17
|
+
// Authorization errors
|
|
18
|
+
| "invalid_request"
|
|
19
|
+
| "unauthorized_client"
|
|
20
|
+
| "access_denied"
|
|
21
|
+
| "unsupported_response_type"
|
|
22
|
+
| "invalid_scope"
|
|
23
|
+
| "server_error"
|
|
24
|
+
| "temporarily_unavailable"
|
|
25
|
+
// Token errors
|
|
26
|
+
| "invalid_client"
|
|
27
|
+
| "invalid_grant"
|
|
28
|
+
| "unsupported_grant_type"
|
|
29
|
+
// Custom errors
|
|
30
|
+
| "invalid_state"
|
|
31
|
+
| "missing_code_verifier"
|
|
32
|
+
| "network_error"
|
|
33
|
+
| "token_expired"
|
|
34
|
+
| "configuration_error"
|
|
35
|
+
| "unknown_error";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useZudoku } from "../components/context/ZudokuContext.js";
|
|
2
2
|
import { useAuthState } from "./state.js";
|
|
3
3
|
|
|
4
|
+
export type UseAuthReturn = ReturnType<typeof useAuth>;
|
|
5
|
+
|
|
4
6
|
export const useAuth = () => {
|
|
5
7
|
const { authentication } = useZudoku();
|
|
6
8
|
const authState = useAuthState();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AuthenticationResult, EventMessage } from "@azure/msal-browser";
|
|
2
2
|
import { EventType, PublicClientApplication } from "@azure/msal-browser";
|
|
3
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
3
4
|
import { type AzureB2CAuthenticationConfig } from "../../../config/config.js";
|
|
4
5
|
import { ClientOnly } from "../../components/ClientOnly.js";
|
|
5
6
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
@@ -7,12 +8,12 @@ import {
|
|
|
7
8
|
type AuthenticationPlugin,
|
|
8
9
|
type AuthenticationProviderInitializer,
|
|
9
10
|
} from "../authentication.js";
|
|
11
|
+
import { CoreAuthenticationPlugin } from "../AuthenticationPlugin.js";
|
|
10
12
|
import { CallbackHandler } from "../components/CallbackHandler.js";
|
|
13
|
+
import { OAuthErrorPage } from "../components/OAuthErrorPage.js";
|
|
11
14
|
import { AuthorizationError } from "../errors.js";
|
|
12
15
|
import { useAuthState } from "../state.js";
|
|
13
16
|
|
|
14
|
-
import { CoreAuthenticationPlugin } from "../AuthenticationPlugin.js";
|
|
15
|
-
|
|
16
17
|
const AZUREB2C_CALLBACK_PATH = "/oauth/callback";
|
|
17
18
|
|
|
18
19
|
export class AzureB2CAuthPlugin
|
|
@@ -181,7 +182,11 @@ export class AzureB2CAuthPlugin
|
|
|
181
182
|
path: AZUREB2C_CALLBACK_PATH,
|
|
182
183
|
element: (
|
|
183
184
|
<ClientOnly>
|
|
184
|
-
<
|
|
185
|
+
<ErrorBoundary
|
|
186
|
+
fallbackRender={({ error }) => <OAuthErrorPage error={error} />}
|
|
187
|
+
>
|
|
188
|
+
<CallbackHandler handleCallback={this.handleCallback} />
|
|
189
|
+
</ErrorBoundary>
|
|
185
190
|
</ClientOnly>
|
|
186
191
|
),
|
|
187
192
|
},
|
|
@@ -15,6 +15,7 @@ const clerkAuth: AuthenticationProviderInitializer<
|
|
|
15
15
|
ClerkAuthenticationConfig
|
|
16
16
|
> = ({
|
|
17
17
|
clerkPubKey,
|
|
18
|
+
jwtTemplateName,
|
|
18
19
|
redirectToAfterSignOut = "/",
|
|
19
20
|
redirectToAfterSignUp,
|
|
20
21
|
redirectToAfterSignIn,
|
|
@@ -61,7 +62,9 @@ const clerkAuth: AuthenticationProviderInitializer<
|
|
|
61
62
|
if (!clerkApi?.session) {
|
|
62
63
|
throw new Error("No session available");
|
|
63
64
|
}
|
|
64
|
-
const response = await clerkApi.session.getToken(
|
|
65
|
+
const response = await clerkApi.session.getToken({
|
|
66
|
+
template: jwtTemplateName,
|
|
67
|
+
});
|
|
65
68
|
if (!response) {
|
|
66
69
|
throw new Error("Could not get access token from Clerk");
|
|
67
70
|
}
|