zudoku 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +8 -2
- package/dist/app/main.js +4 -23
- package/dist/app/main.js.map +1 -1
- package/dist/config/config.d.ts +2 -2
- package/dist/config/file-exists.d.ts +1 -0
- package/dist/config/file-exists.js +5 -0
- package/dist/config/file-exists.js.map +1 -0
- package/dist/config/loader.d.ts +19 -4
- package/dist/config/loader.js +94 -14
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/validate.d.ts +3536 -743
- package/dist/config/validators/validate.js +396 -11
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +7 -2
- package/dist/lib/authentication/AuthenticationPlugin.js +13 -1
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +2 -4
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +62 -43
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +7 -12
- package/dist/lib/authentication/providers/openid.js +11 -22
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.js +3 -5
- package/dist/lib/authentication/providers/supabase.js.map +1 -1
- package/dist/lib/components/Autocomplete.js +1 -1
- package/dist/lib/components/Banner.js +1 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/ErrorPage.js +1 -1
- package/dist/lib/components/Footer.js +5 -5
- package/dist/lib/components/Footer.js.map +1 -1
- package/dist/lib/components/Header.js +16 -8
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.js +6 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/InlineCode.js +1 -1
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/Layout.js +2 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Main.js +2 -2
- package/dist/lib/components/Main.js.map +1 -1
- package/dist/lib/components/Markdown.js +8 -3
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +3 -2
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +1 -1
- package/dist/lib/components/Pagination.js +1 -1
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/Search.js +1 -1
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/Slot.d.ts +17 -0
- package/dist/lib/components/Slot.js +24 -0
- package/dist/lib/components/Slot.js.map +1 -0
- package/dist/lib/components/Slot.test.js +168 -0
- package/dist/lib/components/Slot.test.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +1 -4
- package/dist/lib/components/TopNavigation.js +3 -11
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.js +2 -2
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/SlotProvider.d.ts +26 -0
- package/dist/lib/components/context/SlotProvider.js +83 -0
- package/dist/lib/components/context/SlotProvider.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/context/ZudokuProvider.js +2 -1
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +29 -23
- package/dist/lib/components/index.js +13 -7
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/PoweredByZudoku.js +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -3
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarBadge.js +1 -1
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +3 -3
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +0 -5
- package/dist/lib/components/navigation/SidebarItem.js +19 -23
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/Toc.js +1 -1
- package/dist/lib/components/navigation/Toc.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +8 -0
- package/dist/lib/components/navigation/utils.js +34 -6
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +12 -8
- package/dist/lib/core/ZudokuContext.js +6 -5
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +5 -2
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/hooks/index.d.ts +19 -0
- package/dist/lib/hooks/index.js +11 -0
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.d.ts +3 -2
- package/dist/lib/plugins/api-keys/CreateApiKey.js +8 -4
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.d.ts +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +54 -23
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +18 -9
- package/dist/lib/plugins/api-keys/index.js +49 -34
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/index.d.ts +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +1 -1
- package/dist/lib/plugins/markdown/resolver.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +2 -3
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +5 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +2 -4
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -4
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +6 -5
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +8 -0
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
- package/dist/lib/plugins/openapi/components/ResponseContent.d.ts +12 -0
- package/dist/lib/plugins/openapi/components/ResponseContent.js +21 -0
- package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +2 -0
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/SubmitButton.js +7 -10
- package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +2 -2
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +2 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +3 -3
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +1 -1
- package/dist/lib/ui/Badge.d.ts +2 -2
- package/dist/lib/ui/Badge.js +1 -1
- package/dist/lib/ui/Badge.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +8 -6
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Card.js +1 -1
- package/dist/lib/ui/Checkbox.js +1 -1
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +2 -2
- package/dist/lib/ui/Command.js +3 -3
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/Dialog.js +1 -1
- package/dist/lib/ui/Dialog.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.js +4 -4
- package/dist/lib/ui/DropdownMenu.js.map +1 -1
- package/dist/lib/ui/HoverCard.js +1 -1
- package/dist/lib/ui/HoverCard.js.map +1 -1
- package/dist/lib/ui/Input.js +1 -1
- package/dist/lib/ui/Input.js.map +1 -1
- package/dist/lib/ui/Popover.js +1 -1
- package/dist/lib/ui/Popover.js.map +1 -1
- package/dist/lib/ui/RadioGroup.js +1 -1
- package/dist/lib/ui/RadioGroup.js.map +1 -1
- package/dist/lib/ui/Select.js +2 -2
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/ui/Slider.js +1 -1
- package/dist/lib/ui/Slider.js.map +1 -1
- package/dist/lib/ui/Switch.js +1 -1
- package/dist/lib/ui/Switch.js.map +1 -1
- package/dist/lib/ui/Tabs.js +2 -2
- package/dist/lib/ui/Tabs.js.map +1 -1
- package/dist/lib/ui/Textarea.js +1 -1
- package/dist/lib/ui/Textarea.js.map +1 -1
- package/dist/lib/ui/Toggle.js +1 -1
- package/dist/lib/ui/Toggle.js.map +1 -1
- package/dist/lib/ui/Tooltip.d.ts +2 -1
- package/dist/lib/ui/Tooltip.js +2 -1
- package/dist/lib/ui/Tooltip.js.map +1 -1
- package/dist/lib/util/useExposedProps.d.ts +8 -1
- package/dist/lib/util/useExposedProps.js.map +1 -1
- package/dist/vite/api/SchemaManager.js +16 -1
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/build.js +44 -6
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +2 -9
- package/dist/vite/config.js +6 -95
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +1 -1
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/css/plugin.d.ts +1 -2
- package/dist/vite/css/plugin.js +3 -2
- package/dist/vite/css/plugin.js.map +1 -1
- package/dist/vite/dev-server.d.ts +0 -1
- package/dist/vite/dev-server.js +10 -12
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.d.ts +2 -2
- package/dist/vite/html.js +5 -2
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api-keys.d.ts +1 -2
- package/dist/vite/plugin-api-keys.js +9 -3
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +1 -2
- package/dist/vite/plugin-api.js +5 -4
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.d.ts +1 -2
- package/dist/vite/plugin-auth.js +3 -2
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +1 -2
- package/dist/vite/plugin-component.js +3 -2
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +1 -2
- package/dist/vite/plugin-config-reload.js +21 -22
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +1 -2
- package/dist/vite/plugin-config.js +4 -3
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-configure-tailwind.d.ts +2 -0
- package/dist/vite/plugin-configure-tailwind.js +38 -0
- package/dist/vite/plugin-configure-tailwind.js.map +1 -0
- package/dist/vite/plugin-custom-pages.d.ts +1 -2
- package/dist/vite/plugin-custom-pages.js +3 -2
- package/dist/vite/plugin-custom-pages.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +1 -2
- package/dist/vite/plugin-docs.js +4 -3
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +1 -2
- package/dist/vite/plugin-frontmatter.js +3 -2
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +1 -2
- package/dist/vite/plugin-mdx.js +3 -2
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-redirect.d.ts +1 -2
- package/dist/vite/plugin-redirect.js +3 -2
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +1 -2
- package/dist/vite/plugin-search.js +3 -2
- package/dist/vite/plugin-search.js.map +1 -1
- package/dist/vite/plugin-shiki-register.d.ts +1 -2
- package/dist/vite/plugin-shiki-register.js +2 -1
- package/dist/vite/plugin-shiki-register.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +1 -2
- package/dist/vite/plugin-sidebar.js +3 -2
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin-theme-css.d.ts +1 -2
- package/dist/vite/plugin-theme-css.js +20 -60
- package/dist/vite/plugin-theme-css.js.map +1 -1
- package/dist/vite/plugin.d.ts +1 -2
- package/dist/vite/plugin.js +22 -21
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/sitemap.d.ts +1 -1
- package/dist/zuplo/with-zuplo.d.ts +2 -2
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/Button-BE9IVkWV.js +51 -0
- package/lib/Button-BE9IVkWV.js.map +1 -0
- package/lib/{Callout-XadUe37J.js → Callout-BkgOUkoZ.js} +9 -8
- package/lib/Callout-BkgOUkoZ.js.map +1 -0
- package/lib/{Card-BlCYNw5W.js → Card-DPhGbYUM.js} +3 -3
- package/lib/{Card-BlCYNw5W.js.map → Card-DPhGbYUM.js.map} +1 -1
- package/lib/{CategoryHeading-DZi-Szor.js → CategoryHeading-Cu2RwgjC.js} +2 -2
- package/lib/{CategoryHeading-DZi-Szor.js.map → CategoryHeading-Cu2RwgjC.js.map} +1 -1
- package/lib/{Dialog-CNf2oWXG.js → Dialog-Du6WMcIA.js} +8 -7
- package/lib/Dialog-Du6WMcIA.js.map +1 -0
- package/lib/{Drawer-BPBxzel2.js → Drawer-BzkOKwgC.js} +2 -2
- package/lib/{Drawer-BPBxzel2.js.map → Drawer-BzkOKwgC.js.map} +1 -1
- package/lib/Markdown-BRAyzyUJ.js +15348 -0
- package/lib/Markdown-BRAyzyUJ.js.map +1 -0
- package/lib/{MdxPage-Sjv6y3cA.js → MdxPage-B3v1BSKr.js} +11 -11
- package/lib/MdxPage-B3v1BSKr.js.map +1 -0
- package/lib/{OasProvider-CzRXrs_-.js → OasProvider-5jrFuhVk.js} +3 -3
- package/lib/{OasProvider-CzRXrs_-.js.map → OasProvider-5jrFuhVk.js.map} +1 -1
- package/lib/{OperationList-DefCF3ZI.js → OperationList-BmoMLQPO.js} +1039 -1005
- package/lib/OperationList-BmoMLQPO.js.map +1 -0
- package/lib/Pagination-Cr0fWZS3.js +36 -0
- package/lib/Pagination-Cr0fWZS3.js.map +1 -0
- package/lib/RouteGuard-PrSVLbSr.js +55 -0
- package/lib/RouteGuard-PrSVLbSr.js.map +1 -0
- package/lib/{SchemaList-zHQ2Ekyw.js → SchemaList-B4riYLoP.js} +61 -47
- package/lib/SchemaList-B4riYLoP.js.map +1 -0
- package/lib/{SchemaView-CqF4oMU-.js → SchemaView-CPZ6RgsF.js} +100 -95
- package/lib/SchemaView-CPZ6RgsF.js.map +1 -0
- package/lib/{AuthenticationPlugin-UNaAuxNo.js → SignUp-CWaiH0tY.js} +23 -50
- package/lib/SignUp-CWaiH0tY.js.map +1 -0
- package/lib/Slot-Bo6K4tnb.js +160 -0
- package/lib/Slot-Bo6K4tnb.js.map +1 -0
- package/lib/{SyntaxHighlight-UxOF1xNb.js → SyntaxHighlight-DedRjJNr.js} +233 -212
- package/lib/{SyntaxHighlight-UxOF1xNb.js.map → SyntaxHighlight-DedRjJNr.js.map} +1 -1
- package/lib/{Toc-Ax54Pw8S.js → Toc-lL3fzNkl.js} +5 -5
- package/lib/Toc-lL3fzNkl.js.map +1 -0
- package/lib/{circular-B_TODp4H.js → circular-oB4auIIg.js} +2 -2
- package/lib/{circular-B_TODp4H.js.map → circular-oB4auIIg.js.map} +1 -1
- package/lib/clsx-OuTLNxxd.js +17 -0
- package/lib/clsx-OuTLNxxd.js.map +1 -0
- package/lib/{cn-CwJPJKOE.js → cn-wvCW-ho6.js} +1015 -562
- package/lib/cn-wvCW-ho6.js.map +1 -0
- package/lib/{createServer-CXd8q7nF.js → createServer-DCB82j2t.js} +81 -81
- package/lib/{createServer-CXd8q7nF.js.map → createServer-DCB82j2t.js.map} +1 -1
- package/lib/{hook-BwOB_iZo.js → hook-DawSLaZr.js} +323 -300
- package/lib/hook-DawSLaZr.js.map +1 -0
- package/lib/{index-BY8J3gEh.js → index-BXYvD5-7.js} +868 -758
- package/lib/index-BXYvD5-7.js.map +1 -0
- package/lib/{index-Z13x6tPX.js → index-DI5SPFK9.js} +2 -2
- package/lib/{index-Z13x6tPX.js.map → index-DI5SPFK9.js.map} +1 -1
- package/lib/index-QzXzw_ra.js +24 -0
- package/lib/index-QzXzw_ra.js.map +1 -0
- package/lib/{RouteGuard-lkdEJoDV.js → index.esm-BFcSKCe-.js} +232 -281
- package/lib/index.esm-BFcSKCe-.js.map +1 -0
- package/lib/{index.esm-D2ZUREQN.js → index.esm-DSfX_eMP.js} +3 -3
- package/lib/{index.esm-D2ZUREQN.js.map → index.esm-DSfX_eMP.js.map} +1 -1
- package/lib/joinPath-B7kNnUX4.js +8 -0
- package/lib/joinPath-B7kNnUX4.js.map +1 -0
- package/lib/{mutation-CL2MCRQL.js → mutation-oxMvODNQ.js} +2 -2
- package/lib/{mutation-CL2MCRQL.js.map → mutation-oxMvODNQ.js.map} +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +3 -3
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +20 -18
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +6 -5
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +8 -8
- package/lib/ui/Card.js.map +1 -1
- package/lib/ui/Carousel.js +1 -1
- package/lib/ui/Checkbox.js +7 -7
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/CodeBlock.js +1 -1
- package/lib/ui/Command.js +43 -43
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +2 -2
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +34 -34
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/Form.js +2 -2
- package/lib/ui/HoverCard.js +5 -5
- package/lib/ui/HoverCard.js.map +1 -1
- package/lib/ui/Input.js +2 -2
- package/lib/ui/Input.js.map +1 -1
- package/lib/ui/Label.js +2 -2
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Popover.js +2 -2
- package/lib/ui/Popover.js.map +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +10 -10
- package/lib/ui/RadioGroup.js.map +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Select.js +31 -31
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +5 -5
- package/lib/ui/Slider.js.map +1 -1
- package/lib/ui/Switch.js +5 -5
- package/lib/ui/Switch.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/ui/Tabs.js +16 -16
- package/lib/ui/Tabs.js.map +1 -1
- package/lib/ui/Textarea.js +5 -5
- package/lib/ui/Textarea.js.map +1 -1
- package/lib/ui/Toggle.js +7 -7
- package/lib/ui/Toggle.js.map +1 -1
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +15 -8
- package/lib/ui/Tooltip.js.map +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/useExposedProps-DG8J6ewJ.js.map +1 -1
- package/lib/useMutation-C_j3dA_L.js +97 -0
- package/lib/useMutation-C_j3dA_L.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +99 -82
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +246 -216
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +4957 -33
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +21 -12
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +8 -8
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +5022 -214
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- 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 +3 -3
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +5 -5
- package/lib/zudoku.plugins.js +7 -6
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +15 -16
- package/src/app/defaultTheme.css +54 -0
- package/src/app/font.geist.css +73 -0
- package/src/app/main.css +113 -156
- package/src/app/main.tsx +4 -28
- package/src/lib/authentication/AuthenticationPlugin.tsx +18 -4
- package/src/lib/authentication/authentication.ts +2 -5
- package/src/lib/authentication/providers/auth0.tsx +8 -2
- package/src/lib/authentication/providers/clerk.tsx +72 -48
- package/src/lib/authentication/providers/openid.tsx +19 -26
- package/src/lib/authentication/providers/supabase.tsx +7 -7
- package/src/lib/components/Autocomplete.tsx +1 -1
- package/src/lib/components/Banner.tsx +1 -1
- package/src/lib/components/ErrorPage.tsx +1 -1
- package/src/lib/components/Footer.tsx +7 -10
- package/src/lib/components/Header.tsx +29 -29
- package/src/lib/components/Heading.tsx +9 -5
- package/src/lib/components/InlineCode.tsx +1 -1
- package/src/lib/components/Layout.tsx +3 -3
- package/src/lib/components/Main.tsx +4 -4
- package/src/lib/components/Markdown.tsx +14 -4
- package/src/lib/components/MobileTopNavigation.tsx +3 -2
- package/src/lib/components/NotFoundPage.tsx +1 -1
- package/src/lib/components/Pagination.tsx +3 -9
- package/src/lib/components/Search.tsx +1 -1
- package/src/lib/components/Slot.test.tsx +465 -0
- package/src/lib/components/Slot.tsx +64 -0
- package/src/lib/components/TopNavigation.tsx +5 -17
- package/src/lib/components/Zudoku.tsx +9 -9
- package/src/lib/components/context/SlotProvider.tsx +149 -0
- package/src/lib/components/context/ZudokuProvider.tsx +2 -1
- package/src/lib/components/index.ts +14 -10
- package/src/lib/components/navigation/PoweredByZudoku.tsx +1 -1
- package/src/lib/components/navigation/Sidebar.tsx +3 -3
- package/src/lib/components/navigation/SidebarBadge.tsx +1 -1
- package/src/lib/components/navigation/SidebarCategory.tsx +3 -3
- package/src/lib/components/navigation/SidebarItem.tsx +57 -30
- package/src/lib/components/navigation/SidebarWrapper.tsx +2 -2
- package/src/lib/components/navigation/Toc.tsx +2 -2
- package/src/lib/components/navigation/utils.ts +42 -6
- package/src/lib/core/ZudokuContext.ts +24 -12
- package/src/lib/core/plugins.ts +10 -2
- package/src/lib/errors/ErrorAlert.tsx +1 -1
- package/src/lib/hooks/index.ts +11 -0
- package/src/lib/plugins/api-catalog/Catalog.tsx +1 -1
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +54 -42
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +292 -112
- package/src/lib/plugins/api-keys/index.tsx +101 -55
- package/src/lib/plugins/custom-pages/index.tsx +1 -1
- package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
- package/src/lib/plugins/markdown/index.tsx +2 -2
- package/src/lib/plugins/markdown/resolver.ts +4 -2
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +1 -1
- package/src/lib/plugins/openapi/ColorizedParam.tsx +2 -2
- package/src/lib/plugins/openapi/OperationList.tsx +2 -2
- package/src/lib/plugins/openapi/OperationListItem.tsx +6 -34
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -1
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +5 -16
- package/src/lib/plugins/openapi/SchemaList.tsx +20 -8
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +6 -0
- package/src/lib/plugins/openapi/components/EnumValues.tsx +1 -1
- package/src/lib/plugins/openapi/components/ResponseContent.tsx +104 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +7 -1
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/playground/SubmitButton.tsx +24 -29
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +2 -2
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +7 -3
- package/src/lib/plugins/redirect/index.tsx +1 -1
- package/src/lib/ui/Badge.tsx +2 -2
- package/src/lib/ui/Button.tsx +9 -6
- package/src/lib/ui/Callout.tsx +1 -0
- package/src/lib/ui/Card.tsx +1 -1
- package/src/lib/ui/Checkbox.tsx +1 -1
- package/src/lib/ui/Command.tsx +5 -5
- package/src/lib/ui/Dialog.tsx +1 -1
- package/src/lib/ui/DropdownMenu.tsx +4 -4
- package/src/lib/ui/HoverCard.tsx +1 -1
- package/src/lib/ui/Input.tsx +1 -1
- package/src/lib/ui/Popover.tsx +1 -1
- package/src/lib/ui/RadioGroup.tsx +1 -1
- package/src/lib/ui/Select.tsx +3 -3
- package/src/lib/ui/Slider.tsx +1 -1
- package/src/lib/ui/Switch.tsx +1 -1
- package/src/lib/ui/Tabs.tsx +2 -2
- package/src/lib/ui/Textarea.tsx +1 -1
- package/src/lib/ui/Toggle.tsx +1 -1
- package/src/lib/ui/Tooltip.tsx +16 -1
- package/src/lib/util/useExposedProps.tsx +12 -1
- package/dist/app/tailwind.d.ts +0 -4
- package/dist/app/tailwind.js +0 -97
- package/dist/app/tailwind.js.map +0 -1
- package/dist/config/common.d.ts +0 -10
- package/dist/config/common.js +0 -2
- package/dist/config/common.js.map +0 -1
- package/dist/config/validators/common.d.ts +0 -8001
- package/dist/config/validators/common.js +0 -414
- package/dist/config/validators/common.js.map +0 -1
- package/dist/lib/components/SlotletProvider.d.ts +0 -17
- package/dist/lib/components/SlotletProvider.js +0 -18
- package/dist/lib/components/SlotletProvider.js.map +0 -1
- package/dist/vite/plugin-docs.test.js +0 -22
- package/dist/vite/plugin-docs.test.js.map +0 -1
- package/lib/AuthenticationPlugin-UNaAuxNo.js.map +0 -1
- package/lib/Button-Bdk_Ij3U.js +0 -49
- package/lib/Button-Bdk_Ij3U.js.map +0 -1
- package/lib/Callout-XadUe37J.js.map +0 -1
- package/lib/Dialog-CNf2oWXG.js.map +0 -1
- package/lib/Markdown-D96AphCL.js +0 -7691
- package/lib/Markdown-D96AphCL.js.map +0 -1
- package/lib/MdxPage-Sjv6y3cA.js.map +0 -1
- package/lib/OperationList-DefCF3ZI.js.map +0 -1
- package/lib/Pagination-B89j9KJS.js +0 -48
- package/lib/Pagination-B89j9KJS.js.map +0 -1
- package/lib/RouteGuard-lkdEJoDV.js.map +0 -1
- package/lib/SchemaList-zHQ2Ekyw.js.map +0 -1
- package/lib/SchemaView-CqF4oMU-.js.map +0 -1
- package/lib/Select-HTio1oSE.js +0 -211
- package/lib/Select-HTio1oSE.js.map +0 -1
- package/lib/SlotletProvider-CTgIBRWg.js +0 -257
- package/lib/SlotletProvider-CTgIBRWg.js.map +0 -1
- package/lib/Toc-Ax54Pw8S.js.map +0 -1
- package/lib/cn-CwJPJKOE.js.map +0 -1
- package/lib/hook-BwOB_iZo.js.map +0 -1
- package/lib/index-BY8J3gEh.js.map +0 -1
- package/lib/index-CT2PstvH.js +0 -4982
- package/lib/index-CT2PstvH.js.map +0 -1
- package/src/app/tailwind.ts +0 -103
- package/src/lib/components/SlotletProvider.tsx +0 -55
- /package/dist/{vite/plugin-docs.test.d.ts → lib/components/Slot.test.d.ts} +0 -0
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { g as Pe, Z as
|
|
3
|
-
import { C as
|
|
4
|
-
import { d as xe,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { j as L } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import { g as Pe, Z as Le } from "./invariant-DAFpPywt.js";
|
|
3
|
+
import { C as Ue } from "./ClientOnly-E7hGysn1.js";
|
|
4
|
+
import { d as xe, l as fe, u as x } from "./hook-DawSLaZr.js";
|
|
5
|
+
import { LogOutIcon as Ce } from "lucide-react";
|
|
6
|
+
import { S as Ie, a as je, b as Oe } from "./SignUp-CWaiH0tY.js";
|
|
7
|
+
import { N as ze } from "./chunk-BAXFHI7N-C9WnHsLV.js";
|
|
8
|
+
import { useZudoku as Je } from "./zudoku.components.js";
|
|
9
|
+
var J = { exports: {} }, De = J.exports, re;
|
|
10
|
+
function Ne() {
|
|
10
11
|
return re || (re = 1, function(t) {
|
|
11
12
|
(function(e, n) {
|
|
12
13
|
t.exports ? t.exports = n() : e.log = n();
|
|
13
|
-
})(
|
|
14
|
+
})(De, function() {
|
|
14
15
|
var e = function() {
|
|
15
16
|
}, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [
|
|
16
17
|
"trace",
|
|
@@ -19,8 +20,8 @@ function ze() {
|
|
|
19
20
|
"warn",
|
|
20
21
|
"error"
|
|
21
22
|
], r = {}, i = null;
|
|
22
|
-
function c(l,
|
|
23
|
-
var u = l[
|
|
23
|
+
function c(l, g) {
|
|
24
|
+
var u = l[g];
|
|
24
25
|
if (typeof u.bind == "function")
|
|
25
26
|
return u.bind(l);
|
|
26
27
|
try {
|
|
@@ -38,9 +39,9 @@ function ze() {
|
|
|
38
39
|
return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? f : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
|
|
39
40
|
}
|
|
40
41
|
function p() {
|
|
41
|
-
for (var l = this.getLevel(),
|
|
42
|
-
var u = s[
|
|
43
|
-
this[u] =
|
|
42
|
+
for (var l = this.getLevel(), g = 0; g < s.length; g++) {
|
|
43
|
+
var u = s[g];
|
|
44
|
+
this[u] = g < l ? e : this.methodFactory(u, l, this.name);
|
|
44
45
|
}
|
|
45
46
|
if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
|
|
46
47
|
return "No console available for logging";
|
|
@@ -50,22 +51,22 @@ function ze() {
|
|
|
50
51
|
typeof console !== n && (p.call(this), this[l].apply(this, arguments));
|
|
51
52
|
};
|
|
52
53
|
}
|
|
53
|
-
function b(l,
|
|
54
|
+
function b(l, g, u) {
|
|
54
55
|
return y(l) || A.apply(this, arguments);
|
|
55
56
|
}
|
|
56
|
-
function h(l,
|
|
57
|
-
var u = this,
|
|
57
|
+
function h(l, g) {
|
|
58
|
+
var u = this, O, H, P, _ = "loglevel";
|
|
58
59
|
typeof l == "string" ? _ += ":" + l : typeof l == "symbol" && (_ = void 0);
|
|
59
60
|
function ke(d) {
|
|
60
|
-
var
|
|
61
|
+
var m = (s[d] || "silent").toUpperCase();
|
|
61
62
|
if (!(typeof window === n || !_)) {
|
|
62
63
|
try {
|
|
63
|
-
window.localStorage[_] =
|
|
64
|
+
window.localStorage[_] = m;
|
|
64
65
|
return;
|
|
65
66
|
} catch {
|
|
66
67
|
}
|
|
67
68
|
try {
|
|
68
|
-
window.document.cookie = encodeURIComponent(_) + "=" +
|
|
69
|
+
window.document.cookie = encodeURIComponent(_) + "=" + m + ";";
|
|
69
70
|
} catch {
|
|
70
71
|
}
|
|
71
72
|
}
|
|
@@ -79,9 +80,9 @@ function ze() {
|
|
|
79
80
|
}
|
|
80
81
|
if (typeof d === n)
|
|
81
82
|
try {
|
|
82
|
-
var
|
|
83
|
+
var m = window.document.cookie, z = encodeURIComponent(_), ne = m.indexOf(z + "=");
|
|
83
84
|
ne !== -1 && (d = /^([^;]+)/.exec(
|
|
84
|
-
|
|
85
|
+
m.slice(ne + z.length + 1)
|
|
85
86
|
)[1]);
|
|
86
87
|
} catch {
|
|
87
88
|
}
|
|
@@ -101,9 +102,9 @@ function ze() {
|
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
function U(d) {
|
|
104
|
-
var
|
|
105
|
-
if (typeof
|
|
106
|
-
return
|
|
105
|
+
var m = d;
|
|
106
|
+
if (typeof m == "string" && u.levels[m.toUpperCase()] !== void 0 && (m = u.levels[m.toUpperCase()]), typeof m == "number" && m >= 0 && m <= u.levels.SILENT)
|
|
107
|
+
return m;
|
|
107
108
|
throw new TypeError("log.setLevel() called with invalid level: " + d);
|
|
108
109
|
}
|
|
109
110
|
u.name = l, u.levels = {
|
|
@@ -113,12 +114,12 @@ function ze() {
|
|
|
113
114
|
WARN: 3,
|
|
114
115
|
ERROR: 4,
|
|
115
116
|
SILENT: 5
|
|
116
|
-
}, u.methodFactory =
|
|
117
|
-
return P ??
|
|
118
|
-
}, u.setLevel = function(d,
|
|
119
|
-
return P = U(d),
|
|
117
|
+
}, u.methodFactory = g || b, u.getLevel = function() {
|
|
118
|
+
return P ?? H ?? O;
|
|
119
|
+
}, u.setLevel = function(d, m) {
|
|
120
|
+
return P = U(d), m !== !1 && ke(P), p.call(u);
|
|
120
121
|
}, u.setDefaultLevel = function(d) {
|
|
121
|
-
|
|
122
|
+
H = U(d), ee() || u.setLevel(d, !1);
|
|
122
123
|
}, u.resetLevel = function() {
|
|
123
124
|
P = null, Ee(), p.call(u);
|
|
124
125
|
}, u.enableAll = function(d) {
|
|
@@ -126,21 +127,21 @@ function ze() {
|
|
|
126
127
|
}, u.disableAll = function(d) {
|
|
127
128
|
u.setLevel(u.levels.SILENT, d);
|
|
128
129
|
}, u.rebuild = function() {
|
|
129
|
-
if (i !== u && (
|
|
130
|
+
if (i !== u && (O = U(i.getLevel())), p.call(u), i === u)
|
|
130
131
|
for (var d in r)
|
|
131
132
|
r[d].rebuild();
|
|
132
|
-
},
|
|
133
|
+
}, O = U(
|
|
133
134
|
i ? i.getLevel() : "WARN"
|
|
134
135
|
);
|
|
135
136
|
var te = ee();
|
|
136
137
|
te != null && (P = U(te)), p.call(u);
|
|
137
138
|
}
|
|
138
|
-
i = new h(), i.getLogger = function(
|
|
139
|
-
if (typeof
|
|
139
|
+
i = new h(), i.getLogger = function(g) {
|
|
140
|
+
if (typeof g != "symbol" && typeof g != "string" || g === "")
|
|
140
141
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
141
|
-
var u = r[
|
|
142
|
-
return u || (u = r[
|
|
143
|
-
|
|
142
|
+
var u = r[g];
|
|
143
|
+
return u || (u = r[g] = new h(
|
|
144
|
+
g,
|
|
144
145
|
i.methodFactory
|
|
145
146
|
)), u;
|
|
146
147
|
};
|
|
@@ -151,10 +152,10 @@ function ze() {
|
|
|
151
152
|
return r;
|
|
152
153
|
}, i.default = i, i;
|
|
153
154
|
});
|
|
154
|
-
}(
|
|
155
|
+
}(J)), J.exports;
|
|
155
156
|
}
|
|
156
|
-
var
|
|
157
|
-
const oe = /* @__PURE__ */ Pe(
|
|
157
|
+
var We = Ne();
|
|
158
|
+
const oe = /* @__PURE__ */ Pe(We);
|
|
158
159
|
let B;
|
|
159
160
|
(typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (B = "oauth4webapi/v2.17.0");
|
|
160
161
|
function V(t, e) {
|
|
@@ -166,19 +167,19 @@ function V(t, e) {
|
|
|
166
167
|
return !1;
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
|
-
const
|
|
170
|
+
const N = Symbol(), Ke = Symbol(), G = Symbol(), He = Symbol(), $e = Symbol(), Fe = Symbol(), Me = new TextEncoder(), Be = new TextDecoder();
|
|
170
171
|
function k(t) {
|
|
171
|
-
return typeof t == "string" ?
|
|
172
|
+
return typeof t == "string" ? Me.encode(t) : Be.decode(t);
|
|
172
173
|
}
|
|
173
174
|
const ie = 32768;
|
|
174
|
-
function
|
|
175
|
+
function qe(t) {
|
|
175
176
|
t instanceof ArrayBuffer && (t = new Uint8Array(t));
|
|
176
177
|
const e = [];
|
|
177
178
|
for (let n = 0; n < t.byteLength; n += ie)
|
|
178
179
|
e.push(String.fromCharCode.apply(null, t.subarray(n, n + ie)));
|
|
179
180
|
return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function Ve(t) {
|
|
182
183
|
try {
|
|
183
184
|
const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
|
|
184
185
|
for (let o = 0; o < e.length; o++)
|
|
@@ -189,9 +190,9 @@ function Me(t) {
|
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
function T(t) {
|
|
192
|
-
return typeof t == "string" ?
|
|
193
|
+
return typeof t == "string" ? Ve(t) : qe(t);
|
|
193
194
|
}
|
|
194
|
-
class
|
|
195
|
+
class Ge {
|
|
195
196
|
constructor(e) {
|
|
196
197
|
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
|
|
197
198
|
}
|
|
@@ -220,33 +221,33 @@ class v extends Error {
|
|
|
220
221
|
super(e ?? "operation not supported"), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
|
-
class
|
|
224
|
+
class Ze extends Error {
|
|
224
225
|
constructor(e, n) {
|
|
225
226
|
super(e, n), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
|
-
const a =
|
|
229
|
-
function
|
|
229
|
+
const a = Ze, pe = new Ge(100);
|
|
230
|
+
function we(t) {
|
|
230
231
|
return t instanceof CryptoKey;
|
|
231
232
|
}
|
|
232
|
-
function
|
|
233
|
-
return
|
|
233
|
+
function Ye(t) {
|
|
234
|
+
return we(t) && t.type === "private";
|
|
234
235
|
}
|
|
235
|
-
function
|
|
236
|
-
return
|
|
236
|
+
function Qe(t) {
|
|
237
|
+
return we(t) && t.type === "public";
|
|
237
238
|
}
|
|
238
239
|
function Z(t) {
|
|
239
240
|
try {
|
|
240
241
|
const e = t.headers.get("dpop-nonce");
|
|
241
|
-
e &&
|
|
242
|
+
e && pe.set(new URL(t.url).origin, e);
|
|
242
243
|
} catch {
|
|
243
244
|
}
|
|
244
245
|
return t;
|
|
245
246
|
}
|
|
246
|
-
function
|
|
247
|
+
function C(t) {
|
|
247
248
|
return !(t === null || typeof t != "object" || Array.isArray(t));
|
|
248
249
|
}
|
|
249
|
-
function
|
|
250
|
+
function W(t) {
|
|
250
251
|
V(t, Headers) && (t = Object.fromEntries(t.entries()));
|
|
251
252
|
const e = new Headers(t);
|
|
252
253
|
if (B && !e.has("user-agent") && e.set("user-agent", B), e.has("authorization"))
|
|
@@ -255,12 +256,12 @@ function N(t) {
|
|
|
255
256
|
throw new TypeError('"options.headers" must not include the "dpop" header name');
|
|
256
257
|
return e;
|
|
257
258
|
}
|
|
258
|
-
function
|
|
259
|
+
function Xe(t) {
|
|
259
260
|
if (typeof t == "function" && (t = t()), !(t instanceof AbortSignal))
|
|
260
261
|
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
261
262
|
return t;
|
|
262
263
|
}
|
|
263
|
-
async function
|
|
264
|
+
async function et(t, e) {
|
|
264
265
|
if (!(t instanceof URL))
|
|
265
266
|
throw new TypeError('"issuerIdentifier" must be an instance of URL');
|
|
266
267
|
if (t.protocol !== "https:" && t.protocol !== "http:")
|
|
@@ -277,7 +278,7 @@ async function Ye(t, e) {
|
|
|
277
278
|
default:
|
|
278
279
|
throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
|
|
279
280
|
}
|
|
280
|
-
const o =
|
|
281
|
+
const o = W(e?.headers);
|
|
281
282
|
return o.set("accept", "application/json"), (e?.[G] || fetch)(n.href, {
|
|
282
283
|
headers: Object.fromEntries(o.entries()),
|
|
283
284
|
method: "GET",
|
|
@@ -288,7 +289,7 @@ async function Ye(t, e) {
|
|
|
288
289
|
function w(t) {
|
|
289
290
|
return typeof t == "string" && t.length !== 0;
|
|
290
291
|
}
|
|
291
|
-
async function
|
|
292
|
+
async function tt(t, e) {
|
|
292
293
|
if (!(t instanceof URL))
|
|
293
294
|
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
294
295
|
if (!V(e, Response))
|
|
@@ -302,7 +303,7 @@ async function Qe(t, e) {
|
|
|
302
303
|
} catch (o) {
|
|
303
304
|
throw new a('failed to parse "response" body as JSON', { cause: o });
|
|
304
305
|
}
|
|
305
|
-
if (!
|
|
306
|
+
if (!C(n))
|
|
306
307
|
throw new a('"response" body must be a top level object');
|
|
307
308
|
if (!w(n.issuer))
|
|
308
309
|
throw new a('"response" body "issuer" property must be a non-empty string');
|
|
@@ -313,13 +314,13 @@ async function Qe(t, e) {
|
|
|
313
314
|
function Y() {
|
|
314
315
|
return T(crypto.getRandomValues(new Uint8Array(32)));
|
|
315
316
|
}
|
|
316
|
-
function
|
|
317
|
+
function nt() {
|
|
317
318
|
return Y();
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function rt() {
|
|
320
321
|
return Y();
|
|
321
322
|
}
|
|
322
|
-
async function
|
|
323
|
+
async function ot(t) {
|
|
323
324
|
if (!w(t))
|
|
324
325
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
325
326
|
return T(await crypto.subtle.digest("SHA-256", k(t)));
|
|
@@ -327,11 +328,11 @@ async function tt(t) {
|
|
|
327
328
|
function se(t) {
|
|
328
329
|
return encodeURIComponent(t).replace(/%20/g, "+");
|
|
329
330
|
}
|
|
330
|
-
function
|
|
331
|
+
function it(t, e) {
|
|
331
332
|
const n = se(t), o = se(e);
|
|
332
333
|
return `Basic ${btoa(`${n}:${o}`)}`;
|
|
333
334
|
}
|
|
334
|
-
function
|
|
335
|
+
function st(t) {
|
|
335
336
|
switch (t.algorithm.hash.name) {
|
|
336
337
|
case "SHA-256":
|
|
337
338
|
return "PS256";
|
|
@@ -343,7 +344,7 @@ function rt(t) {
|
|
|
343
344
|
throw new v("unsupported RsaHashedKeyAlgorithm hash name");
|
|
344
345
|
}
|
|
345
346
|
}
|
|
346
|
-
function
|
|
347
|
+
function at(t) {
|
|
347
348
|
switch (t.algorithm.hash.name) {
|
|
348
349
|
case "SHA-256":
|
|
349
350
|
return "RS256";
|
|
@@ -355,7 +356,7 @@ function ot(t) {
|
|
|
355
356
|
throw new v("unsupported RsaHashedKeyAlgorithm hash name");
|
|
356
357
|
}
|
|
357
358
|
}
|
|
358
|
-
function
|
|
359
|
+
function ct(t) {
|
|
359
360
|
switch (t.algorithm.namedCurve) {
|
|
360
361
|
case "P-256":
|
|
361
362
|
return "ES256";
|
|
@@ -367,14 +368,14 @@ function it(t) {
|
|
|
367
368
|
throw new v("unsupported EcKeyAlgorithm namedCurve");
|
|
368
369
|
}
|
|
369
370
|
}
|
|
370
|
-
function
|
|
371
|
+
function ut(t) {
|
|
371
372
|
switch (t.algorithm.name) {
|
|
372
373
|
case "RSA-PSS":
|
|
373
|
-
return
|
|
374
|
+
return st(t);
|
|
374
375
|
case "RSASSA-PKCS1-v1_5":
|
|
375
|
-
return
|
|
376
|
+
return at(t);
|
|
376
377
|
case "ECDSA":
|
|
377
|
-
return
|
|
378
|
+
return ct(t);
|
|
378
379
|
case "Ed25519":
|
|
379
380
|
case "Ed448":
|
|
380
381
|
return "EdDSA";
|
|
@@ -382,25 +383,25 @@ function st(t) {
|
|
|
382
383
|
throw new v("unsupported CryptoKey algorithm name");
|
|
383
384
|
}
|
|
384
385
|
}
|
|
385
|
-
function
|
|
386
|
-
const e = t?.[
|
|
386
|
+
function K(t) {
|
|
387
|
+
const e = t?.[N];
|
|
387
388
|
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
388
389
|
}
|
|
389
|
-
function
|
|
390
|
-
const e = t?.[
|
|
390
|
+
function ge(t) {
|
|
391
|
+
const e = t?.[Ke];
|
|
391
392
|
return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
|
|
392
393
|
}
|
|
393
394
|
function Q() {
|
|
394
395
|
return Math.floor(Date.now() / 1e3);
|
|
395
396
|
}
|
|
396
|
-
function
|
|
397
|
+
function I(t) {
|
|
397
398
|
if (typeof t != "object" || t === null)
|
|
398
399
|
throw new TypeError('"as" must be an object');
|
|
399
400
|
if (!w(t.issuer))
|
|
400
401
|
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
401
402
|
return !0;
|
|
402
403
|
}
|
|
403
|
-
function
|
|
404
|
+
function j(t) {
|
|
404
405
|
if (typeof t != "object" || t === null)
|
|
405
406
|
throw new TypeError('"client" must be an object');
|
|
406
407
|
if (!w(t.client_id))
|
|
@@ -416,11 +417,11 @@ function ce(t, e) {
|
|
|
416
417
|
if (e !== void 0)
|
|
417
418
|
throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
|
|
418
419
|
}
|
|
419
|
-
async function
|
|
420
|
+
async function lt(t, e, n, o, s) {
|
|
420
421
|
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
|
|
421
422
|
case void 0:
|
|
422
423
|
case "client_secret_basic": {
|
|
423
|
-
o.set("authorization",
|
|
424
|
+
o.set("authorization", it(e.client_id, ae(e.client_secret)));
|
|
424
425
|
break;
|
|
425
426
|
}
|
|
426
427
|
case "client_secret_post": {
|
|
@@ -439,26 +440,26 @@ async function at(t, e, n, o, s) {
|
|
|
439
440
|
throw new v("unsupported client token_endpoint_auth_method");
|
|
440
441
|
}
|
|
441
442
|
}
|
|
442
|
-
async function
|
|
443
|
+
async function dt(t, e, n) {
|
|
443
444
|
if (!n.usages.includes("sign"))
|
|
444
445
|
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
445
|
-
const o = `${T(k(JSON.stringify(t)))}.${T(k(JSON.stringify(e)))}`, s = T(await crypto.subtle.sign(
|
|
446
|
+
const o = `${T(k(JSON.stringify(t)))}.${T(k(JSON.stringify(e)))}`, s = T(await crypto.subtle.sign(Te(n), n, k(o)));
|
|
446
447
|
return `${o}.${s}`;
|
|
447
448
|
}
|
|
448
|
-
async function
|
|
449
|
-
const { privateKey: i, publicKey: c, nonce: f =
|
|
450
|
-
if (!
|
|
449
|
+
async function ht(t, e, n, o, s, r) {
|
|
450
|
+
const { privateKey: i, publicKey: c, nonce: f = pe.get(n.origin) } = e;
|
|
451
|
+
if (!Ye(i))
|
|
451
452
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
452
|
-
if (!
|
|
453
|
+
if (!Qe(c))
|
|
453
454
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
454
455
|
if (f !== void 0 && !w(f))
|
|
455
456
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
456
457
|
if (!c.extractable)
|
|
457
458
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
458
459
|
const y = Q() + s, p = {
|
|
459
|
-
alg:
|
|
460
|
+
alg: ut(i),
|
|
460
461
|
typ: "dpop+jwt",
|
|
461
|
-
jwk: await
|
|
462
|
+
jwk: await pt(c)
|
|
462
463
|
}, A = {
|
|
463
464
|
iat: y,
|
|
464
465
|
jti: Y(),
|
|
@@ -467,15 +468,15 @@ async function ut(t, e, n, o, s, r) {
|
|
|
467
468
|
htu: `${n.origin}${n.pathname}`,
|
|
468
469
|
ath: r ? T(await crypto.subtle.digest("SHA-256", k(r))) : void 0
|
|
469
470
|
};
|
|
470
|
-
e[
|
|
471
|
+
e[He]?.(p, A), t.set("dpop", await dt(p, A, i));
|
|
471
472
|
}
|
|
472
|
-
let
|
|
473
|
-
async function
|
|
473
|
+
let D;
|
|
474
|
+
async function ft(t) {
|
|
474
475
|
const { kty: e, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: s, y: r, crv: i };
|
|
475
|
-
return
|
|
476
|
+
return D.set(t, c), c;
|
|
476
477
|
}
|
|
477
|
-
async function
|
|
478
|
-
return
|
|
478
|
+
async function pt(t) {
|
|
479
|
+
return D || (D = /* @__PURE__ */ new WeakMap()), D.get(t) || ft(t);
|
|
479
480
|
}
|
|
480
481
|
function ue(t, e, n) {
|
|
481
482
|
if (typeof t != "string")
|
|
@@ -485,36 +486,36 @@ function ue(t, e, n) {
|
|
|
485
486
|
function me(t, e, n = !1) {
|
|
486
487
|
return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? ue(t.mtls_endpoint_aliases[e], e, n) : ue(t[e], e, n);
|
|
487
488
|
}
|
|
488
|
-
function
|
|
489
|
-
return !!(t.use_mtls_endpoint_aliases || e?.[
|
|
489
|
+
function ye(t, e) {
|
|
490
|
+
return !!(t.use_mtls_endpoint_aliases || e?.[Fe]);
|
|
490
491
|
}
|
|
491
492
|
function q(t) {
|
|
492
493
|
const e = t;
|
|
493
494
|
return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
|
|
494
495
|
}
|
|
495
|
-
async function
|
|
496
|
+
async function wt(t, e, n, o, s, r) {
|
|
496
497
|
if (!w(t))
|
|
497
498
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
498
499
|
if (!(n instanceof URL))
|
|
499
500
|
throw new TypeError('"url" must be an instance of URL');
|
|
500
|
-
return o =
|
|
501
|
+
return o = W(o), r?.DPoP === void 0 ? o.set("authorization", `Bearer ${t}`) : (await ht(o, r.DPoP, n, e.toUpperCase(), K({ [N]: r?.[N] }), t), o.set("authorization", `DPoP ${t}`)), (r?.[G] || fetch)(n.href, {
|
|
501
502
|
body: s,
|
|
502
503
|
headers: Object.fromEntries(o.entries()),
|
|
503
504
|
method: e,
|
|
504
505
|
redirect: "manual",
|
|
505
|
-
signal: r?.signal ?
|
|
506
|
+
signal: r?.signal ? Xe(r.signal) : null
|
|
506
507
|
}).then(Z);
|
|
507
508
|
}
|
|
508
|
-
async function
|
|
509
|
-
|
|
510
|
-
const s = me(t, "userinfo_endpoint",
|
|
511
|
-
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")),
|
|
509
|
+
async function gt(t, e, n, o) {
|
|
510
|
+
I(t), j(e);
|
|
511
|
+
const s = me(t, "userinfo_endpoint", ye(e, o)), r = W(o?.headers);
|
|
512
|
+
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), wt(n, "GET", s, r, null, {
|
|
512
513
|
...o,
|
|
513
|
-
[
|
|
514
|
+
[N]: K(e)
|
|
514
515
|
});
|
|
515
516
|
}
|
|
516
|
-
async function
|
|
517
|
-
return await
|
|
517
|
+
async function mt(t, e, n, o, s, r, i) {
|
|
518
|
+
return await lt(t, e, s, r), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), (i?.[G] || fetch)(o.href, {
|
|
518
519
|
body: s,
|
|
519
520
|
headers: Object.fromEntries(r.entries()),
|
|
520
521
|
method: n,
|
|
@@ -522,33 +523,33 @@ async function pt(t, e, n, o, s, r, i) {
|
|
|
522
523
|
signal: null
|
|
523
524
|
}).then(Z);
|
|
524
525
|
}
|
|
525
|
-
async function
|
|
526
|
-
const r = me(t, "token_endpoint",
|
|
526
|
+
async function be(t, e, n, o, s) {
|
|
527
|
+
const r = me(t, "token_endpoint", ye(e, s));
|
|
527
528
|
o.set("grant_type", n);
|
|
528
|
-
const i =
|
|
529
|
-
return i.set("accept", "application/json"),
|
|
529
|
+
const i = W(s?.headers);
|
|
530
|
+
return i.set("accept", "application/json"), mt(t, e, "POST", r, o, i, s);
|
|
530
531
|
}
|
|
531
|
-
async function
|
|
532
|
-
if (
|
|
532
|
+
async function yt(t, e, n, o) {
|
|
533
|
+
if (I(t), j(e), !w(n))
|
|
533
534
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
534
535
|
const s = new URLSearchParams(o?.additionalParameters);
|
|
535
|
-
return s.set("refresh_token", n),
|
|
536
|
+
return s.set("refresh_token", n), be(t, e, "refresh_token", s, o);
|
|
536
537
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
538
|
+
const _e = /* @__PURE__ */ new WeakMap();
|
|
539
|
+
function bt(t) {
|
|
539
540
|
if (!t.id_token)
|
|
540
541
|
return;
|
|
541
|
-
const e =
|
|
542
|
+
const e = _e.get(t);
|
|
542
543
|
if (!e)
|
|
543
544
|
throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');
|
|
544
545
|
return e[0];
|
|
545
546
|
}
|
|
546
|
-
async function
|
|
547
|
-
if (
|
|
547
|
+
async function ve(t, e, n, o = !1, s = !1) {
|
|
548
|
+
if (I(t), j(e), !V(n, Response))
|
|
548
549
|
throw new TypeError('"response" must be an instance of Response');
|
|
549
550
|
if (n.status !== 200) {
|
|
550
551
|
let i;
|
|
551
|
-
if (i = await
|
|
552
|
+
if (i = await Lt(n))
|
|
552
553
|
return i;
|
|
553
554
|
throw new a('"response" is not a conform Token Endpoint response');
|
|
554
555
|
}
|
|
@@ -559,7 +560,7 @@ async function _e(t, e, n, o = !1, s = !1) {
|
|
|
559
560
|
} catch (i) {
|
|
560
561
|
throw new a('failed to parse "response" body as JSON', { cause: i });
|
|
561
562
|
}
|
|
562
|
-
if (!
|
|
563
|
+
if (!C(r))
|
|
563
564
|
throw new a('"response" body must be a top level object');
|
|
564
565
|
if (!w(r.access_token))
|
|
565
566
|
throw new a('"response" body "access_token" property must be a non-empty string');
|
|
@@ -577,7 +578,7 @@ async function _e(t, e, n, o = !1, s = !1) {
|
|
|
577
578
|
if (r.id_token !== void 0 && !w(r.id_token))
|
|
578
579
|
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
579
580
|
if (r.id_token) {
|
|
580
|
-
const { claims: i, jwt: c } = await
|
|
581
|
+
const { claims: i, jwt: c } = await Ct(r.id_token, It.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ae, K(e), ge(e), e[$e]).then(Et.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(St.bind(void 0, t.issuer)).then(vt.bind(void 0, e.client_id));
|
|
581
582
|
if (Array.isArray(i.aud) && i.aud.length !== 1) {
|
|
582
583
|
if (i.azp === void 0)
|
|
583
584
|
throw new a('ID Token "aud" (audience) claim includes additional untrusted audiences');
|
|
@@ -586,15 +587,15 @@ async function _e(t, e, n, o = !1, s = !1) {
|
|
|
586
587
|
}
|
|
587
588
|
if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
|
|
588
589
|
throw new a('ID Token "auth_time" (authentication time) must be a positive number');
|
|
589
|
-
|
|
590
|
+
_e.set(r, [i, c]);
|
|
590
591
|
}
|
|
591
592
|
}
|
|
592
593
|
return r;
|
|
593
594
|
}
|
|
594
|
-
async function
|
|
595
|
-
return
|
|
595
|
+
async function _t(t, e, n) {
|
|
596
|
+
return ve(t, e, n);
|
|
596
597
|
}
|
|
597
|
-
function
|
|
598
|
+
function vt(t, e) {
|
|
598
599
|
if (Array.isArray(e.claims.aud)) {
|
|
599
600
|
if (!e.claims.aud.includes(t))
|
|
600
601
|
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
@@ -602,17 +603,17 @@ function yt(t, e) {
|
|
|
602
603
|
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
603
604
|
return e;
|
|
604
605
|
}
|
|
605
|
-
function
|
|
606
|
+
function St(t, e) {
|
|
606
607
|
if (e.claims.iss !== t)
|
|
607
608
|
throw new a('unexpected JWT "iss" (issuer) claim value');
|
|
608
609
|
return e;
|
|
609
610
|
}
|
|
610
|
-
const
|
|
611
|
-
function
|
|
612
|
-
return
|
|
611
|
+
const Se = /* @__PURE__ */ new WeakSet();
|
|
612
|
+
function Tt(t) {
|
|
613
|
+
return Se.add(t), t;
|
|
613
614
|
}
|
|
614
|
-
async function
|
|
615
|
-
if (
|
|
615
|
+
async function At(t, e, n, o, s, r) {
|
|
616
|
+
if (I(t), j(e), !Se.has(n))
|
|
616
617
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
617
618
|
if (!w(o))
|
|
618
619
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
@@ -622,9 +623,9 @@ async function vt(t, e, n, o, s, r) {
|
|
|
622
623
|
if (!i)
|
|
623
624
|
throw new a('no authorization code in "callbackParameters"');
|
|
624
625
|
const c = new URLSearchParams(r?.additionalParameters);
|
|
625
|
-
return c.set("redirect_uri", o), c.set("code_verifier", s), c.set("code", i),
|
|
626
|
+
return c.set("redirect_uri", o), c.set("code_verifier", s), c.set("code", i), be(t, e, "authorization_code", c, r);
|
|
626
627
|
}
|
|
627
|
-
const
|
|
628
|
+
const kt = {
|
|
628
629
|
aud: "audience",
|
|
629
630
|
c_hash: "code hash",
|
|
630
631
|
client_id: "client id",
|
|
@@ -640,33 +641,33 @@ const St = {
|
|
|
640
641
|
htu: "http uri",
|
|
641
642
|
cnf: "confirmation"
|
|
642
643
|
};
|
|
643
|
-
function
|
|
644
|
+
function Et(t, e) {
|
|
644
645
|
for (const n of t)
|
|
645
646
|
if (e.claims[n] === void 0)
|
|
646
|
-
throw new a(`JWT "${n}" (${
|
|
647
|
+
throw new a(`JWT "${n}" (${kt[n]}) claim missing`);
|
|
647
648
|
return e;
|
|
648
649
|
}
|
|
649
|
-
const
|
|
650
|
-
async function
|
|
651
|
-
const r = await
|
|
650
|
+
const Rt = Symbol(), $ = Symbol();
|
|
651
|
+
async function Pt(t, e, n, o, s) {
|
|
652
|
+
const r = await ve(t, e, n);
|
|
652
653
|
if (q(r))
|
|
653
654
|
return r;
|
|
654
655
|
if (!w(r.id_token))
|
|
655
656
|
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
656
|
-
s ?? (s = e.default_max_age ??
|
|
657
|
-
const i =
|
|
658
|
-
if ((e.require_auth_time || s !==
|
|
657
|
+
s ?? (s = e.default_max_age ?? $);
|
|
658
|
+
const i = bt(r);
|
|
659
|
+
if ((e.require_auth_time || s !== $) && i.auth_time === void 0)
|
|
659
660
|
throw new a('ID Token "auth_time" (authentication time) claim missing');
|
|
660
|
-
if (s !==
|
|
661
|
+
if (s !== $) {
|
|
661
662
|
if (typeof s != "number" || s < 0)
|
|
662
663
|
throw new TypeError('"maxAge" must be a non-negative number');
|
|
663
|
-
const c = Q() +
|
|
664
|
+
const c = Q() + K(e), f = ge(e);
|
|
664
665
|
if (i.auth_time + s < c - f)
|
|
665
666
|
throw new a("too much time has elapsed since the last End-User authentication");
|
|
666
667
|
}
|
|
667
668
|
switch (o) {
|
|
668
669
|
case void 0:
|
|
669
|
-
case
|
|
670
|
+
case Rt:
|
|
670
671
|
if (i.nonce !== void 0)
|
|
671
672
|
throw new a('unexpected ID Token "nonce" claim value');
|
|
672
673
|
break;
|
|
@@ -684,12 +685,12 @@ function X(t) {
|
|
|
684
685
|
if (t.bodyUsed)
|
|
685
686
|
throw new TypeError('"response" body has been used already');
|
|
686
687
|
}
|
|
687
|
-
async function
|
|
688
|
+
async function Lt(t) {
|
|
688
689
|
if (t.status > 399 && t.status < 500) {
|
|
689
690
|
X(t);
|
|
690
691
|
try {
|
|
691
692
|
const e = await t.json();
|
|
692
|
-
if (
|
|
693
|
+
if (C(e) && typeof e.error == "string" && e.error.length)
|
|
693
694
|
return e.error_description !== void 0 && typeof e.error_description != "string" && delete e.error_description, e.error_uri !== void 0 && typeof e.error_uri != "string" && delete e.error_uri, e.algs !== void 0 && typeof e.algs != "string" && delete e.algs, e.scope !== void 0 && typeof e.scope != "string" && delete e.scope, e;
|
|
694
695
|
} catch {
|
|
695
696
|
}
|
|
@@ -699,7 +700,7 @@ function le(t) {
|
|
|
699
700
|
if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
|
|
700
701
|
throw new a(`${t.name} modulusLength must be at least 2048 bits`);
|
|
701
702
|
}
|
|
702
|
-
function
|
|
703
|
+
function Ut(t) {
|
|
703
704
|
switch (t) {
|
|
704
705
|
case "P-256":
|
|
705
706
|
return "SHA-256";
|
|
@@ -711,12 +712,12 @@ function Rt(t) {
|
|
|
711
712
|
throw new v();
|
|
712
713
|
}
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
+
function Te(t) {
|
|
715
716
|
switch (t.algorithm.name) {
|
|
716
717
|
case "ECDSA":
|
|
717
718
|
return {
|
|
718
719
|
name: t.algorithm.name,
|
|
719
|
-
hash:
|
|
720
|
+
hash: Ut(t.algorithm.namedCurve)
|
|
720
721
|
};
|
|
721
722
|
case "RSA-PSS":
|
|
722
723
|
switch (le(t.algorithm), t.algorithm.hash.name) {
|
|
@@ -738,13 +739,13 @@ function Se(t) {
|
|
|
738
739
|
}
|
|
739
740
|
throw new v();
|
|
740
741
|
}
|
|
741
|
-
const
|
|
742
|
-
async function
|
|
742
|
+
const Ae = Symbol();
|
|
743
|
+
async function xt(t, e, n, o) {
|
|
743
744
|
const s = `${t}.${e}`;
|
|
744
|
-
if (!await crypto.subtle.verify(
|
|
745
|
+
if (!await crypto.subtle.verify(Te(n), n, o, k(s)))
|
|
745
746
|
throw new a("JWT signature verification failed");
|
|
746
747
|
}
|
|
747
|
-
async function
|
|
748
|
+
async function Ct(t, e, n, o, s, r) {
|
|
748
749
|
let { 0: i, 1: c, 2: f, length: y } = t.split(".");
|
|
749
750
|
if (y === 5)
|
|
750
751
|
if (r !== void 0)
|
|
@@ -759,20 +760,20 @@ async function Ut(t, e, n, o, s, r) {
|
|
|
759
760
|
} catch (l) {
|
|
760
761
|
throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
|
|
761
762
|
}
|
|
762
|
-
if (!
|
|
763
|
+
if (!C(p))
|
|
763
764
|
throw new a("JWT Header must be a top level object");
|
|
764
765
|
if (e(p), p.crit !== void 0)
|
|
765
766
|
throw new a('unexpected JWT "crit" header parameter');
|
|
766
767
|
const A = T(f);
|
|
767
768
|
let b;
|
|
768
|
-
n !==
|
|
769
|
+
n !== Ae && (b = await n(p), await xt(i, c, b, A));
|
|
769
770
|
let h;
|
|
770
771
|
try {
|
|
771
772
|
h = JSON.parse(k(T(c)));
|
|
772
773
|
} catch (l) {
|
|
773
774
|
throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
|
|
774
775
|
}
|
|
775
|
-
if (!
|
|
776
|
+
if (!C(h))
|
|
776
777
|
throw new a("JWT Payload must be a top level object");
|
|
777
778
|
const R = Q() + o;
|
|
778
779
|
if (h.exp !== void 0) {
|
|
@@ -795,7 +796,7 @@ async function Ut(t, e, n, o, s, r) {
|
|
|
795
796
|
throw new a('unexpected JWT "aud" (audience) claim type');
|
|
796
797
|
return { header: p, claims: h, signature: A, key: b, jwt: t };
|
|
797
798
|
}
|
|
798
|
-
function
|
|
799
|
+
function It(t, e, n) {
|
|
799
800
|
if (t !== void 0) {
|
|
800
801
|
if (n.alg !== t)
|
|
801
802
|
throw new a('unexpected JWT "alg" header parameter');
|
|
@@ -815,9 +816,9 @@ function S(t, e) {
|
|
|
815
816
|
throw new a(`"${e}" parameter must be provided only once`);
|
|
816
817
|
return n;
|
|
817
818
|
}
|
|
818
|
-
const
|
|
819
|
-
function
|
|
820
|
-
if (
|
|
819
|
+
const jt = Symbol(), Ot = Symbol();
|
|
820
|
+
function zt(t, e, n, o) {
|
|
821
|
+
if (I(t), j(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
821
822
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
822
823
|
if (S(n, "response"))
|
|
823
824
|
throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
@@ -828,11 +829,11 @@ function It(t, e, n, o) {
|
|
|
828
829
|
throw new a('unexpected "iss" (issuer) response parameter value');
|
|
829
830
|
switch (o) {
|
|
830
831
|
case void 0:
|
|
831
|
-
case
|
|
832
|
+
case Ot:
|
|
832
833
|
if (r !== void 0)
|
|
833
834
|
throw new a('unexpected "state" response parameter encountered');
|
|
834
835
|
break;
|
|
835
|
-
case
|
|
836
|
+
case jt:
|
|
836
837
|
break;
|
|
837
838
|
default:
|
|
838
839
|
if (!w(o))
|
|
@@ -852,28 +853,65 @@ function It(t, e, n, o) {
|
|
|
852
853
|
const c = S(n, "id_token"), f = S(n, "token");
|
|
853
854
|
if (c !== void 0 || f !== void 0)
|
|
854
855
|
throw new v("implicit and hybrid flows are not supported");
|
|
855
|
-
return
|
|
856
|
+
return Tt(new URLSearchParams(n));
|
|
856
857
|
}
|
|
857
|
-
|
|
858
|
+
class Jt {
|
|
859
|
+
getRoutes() {
|
|
860
|
+
return [
|
|
861
|
+
{
|
|
862
|
+
path: "/signout",
|
|
863
|
+
element: /* @__PURE__ */ L.jsx(Ie, {})
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
path: "/signin",
|
|
867
|
+
element: /* @__PURE__ */ L.jsx(je, {})
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
path: "/signup",
|
|
871
|
+
element: /* @__PURE__ */ L.jsx(Oe, {})
|
|
872
|
+
}
|
|
873
|
+
];
|
|
874
|
+
}
|
|
875
|
+
async getSidebar(e) {
|
|
876
|
+
return e.startsWith("/settings") ? [
|
|
877
|
+
{
|
|
878
|
+
type: "link",
|
|
879
|
+
label: "Logout",
|
|
880
|
+
href: "/signout"
|
|
881
|
+
}
|
|
882
|
+
] : [];
|
|
883
|
+
}
|
|
884
|
+
getProfileMenuItems() {
|
|
885
|
+
return [
|
|
886
|
+
{
|
|
887
|
+
label: "Logout",
|
|
888
|
+
path: "/signout",
|
|
889
|
+
category: "bottom",
|
|
890
|
+
icon: Ce
|
|
891
|
+
}
|
|
892
|
+
];
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
function Dt(t, e, n = "/") {
|
|
858
896
|
return t.startsWith(e) ? n !== "/" && t.startsWith(e + n) ? t.slice(e.length + n.length) : t.slice(e.length) : t;
|
|
859
897
|
}
|
|
860
|
-
function
|
|
898
|
+
function Nt({
|
|
861
899
|
handleCallback: t
|
|
862
900
|
}) {
|
|
863
|
-
const { options: e } =
|
|
901
|
+
const { options: e } = Je(), n = xe({
|
|
864
902
|
retry: !1,
|
|
865
903
|
queryKey: ["oauth-callback"],
|
|
866
904
|
queryFn: async () => {
|
|
867
905
|
try {
|
|
868
|
-
return
|
|
869
|
-
|
|
906
|
+
return fe(
|
|
907
|
+
Dt(
|
|
870
908
|
await t(),
|
|
871
909
|
window.location.origin,
|
|
872
910
|
e.basePath
|
|
873
911
|
)
|
|
874
912
|
);
|
|
875
913
|
} catch (o) {
|
|
876
|
-
throw new
|
|
914
|
+
throw new Le("Could not validate user", {
|
|
877
915
|
cause: o,
|
|
878
916
|
title: "Authentication Error",
|
|
879
917
|
developerHint: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly."
|
|
@@ -881,7 +919,7 @@ function Ot({
|
|
|
881
919
|
}
|
|
882
920
|
}
|
|
883
921
|
});
|
|
884
|
-
return /* @__PURE__ */
|
|
922
|
+
return /* @__PURE__ */ L.jsx(ze, { to: n.data });
|
|
885
923
|
}
|
|
886
924
|
class E extends Error {
|
|
887
925
|
}
|
|
@@ -890,22 +928,8 @@ class de extends E {
|
|
|
890
928
|
super(e, o), this.error = n;
|
|
891
929
|
}
|
|
892
930
|
}
|
|
893
|
-
const
|
|
894
|
-
class
|
|
895
|
-
constructor(e) {
|
|
896
|
-
super(), this.handleCallback = e;
|
|
897
|
-
}
|
|
898
|
-
getRoutes() {
|
|
899
|
-
return [
|
|
900
|
-
...super.getRoutes(),
|
|
901
|
-
{
|
|
902
|
-
path: Ae,
|
|
903
|
-
element: /* @__PURE__ */ M.jsx(Le, { children: /* @__PURE__ */ M.jsx(Ot, { handleCallback: this.handleCallback }) })
|
|
904
|
-
}
|
|
905
|
-
];
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
class Jt {
|
|
931
|
+
const F = "code-verifier", M = "oauth-state", he = "/oauth/callback";
|
|
932
|
+
class Wt extends Jt {
|
|
909
933
|
client;
|
|
910
934
|
issuer;
|
|
911
935
|
authorizationServer;
|
|
@@ -926,15 +950,15 @@ class Jt {
|
|
|
926
950
|
basePath: c,
|
|
927
951
|
scopes: f
|
|
928
952
|
}) {
|
|
929
|
-
this.client = {
|
|
953
|
+
super(), this.client = {
|
|
930
954
|
client_id: o,
|
|
931
955
|
token_endpoint_auth_method: "none"
|
|
932
|
-
}, this.audience = n, this.issuer = e, this.callbackUrlPath =
|
|
956
|
+
}, this.audience = n, this.issuer = e, this.callbackUrlPath = fe(c, he), this.scopes = f ?? ["openid", "profile", "email"], this.redirectToAfterSignUp = s, this.redirectToAfterSignIn = r, this.redirectToAfterSignOut = i;
|
|
933
957
|
}
|
|
934
958
|
async getAuthServer() {
|
|
935
959
|
if (!this.authorizationServer) {
|
|
936
|
-
const e = new URL(this.issuer), n = await
|
|
937
|
-
this.authorizationServer = await
|
|
960
|
+
const e = new URL(this.issuer), n = await et(e);
|
|
961
|
+
this.authorizationServer = await tt(
|
|
938
962
|
e,
|
|
939
963
|
n
|
|
940
964
|
);
|
|
@@ -957,7 +981,7 @@ class Jt {
|
|
|
957
981
|
expiresOn: new Date(Date.now() + e.expires_in * 1e3),
|
|
958
982
|
tokenType: e.token_type
|
|
959
983
|
};
|
|
960
|
-
|
|
984
|
+
x.setState({
|
|
961
985
|
providerData: n
|
|
962
986
|
});
|
|
963
987
|
}
|
|
@@ -979,8 +1003,8 @@ class Jt {
|
|
|
979
1003
|
const o = "S256", s = await this.getAuthServer();
|
|
980
1004
|
if (!s.authorization_endpoint)
|
|
981
1005
|
throw new E("No authorization endpoint");
|
|
982
|
-
const r =
|
|
983
|
-
sessionStorage.setItem(
|
|
1006
|
+
const r = nt(), i = await ot(r);
|
|
1007
|
+
sessionStorage.setItem(F, r);
|
|
984
1008
|
const c = new URL(
|
|
985
1009
|
s.authorization_endpoint
|
|
986
1010
|
);
|
|
@@ -993,27 +1017,27 @@ class Jt {
|
|
|
993
1017
|
isSignIn: !n,
|
|
994
1018
|
isSignUp: n
|
|
995
1019
|
});
|
|
996
|
-
const y =
|
|
997
|
-
sessionStorage.setItem(
|
|
1020
|
+
const y = rt();
|
|
1021
|
+
sessionStorage.setItem(M, y), c.searchParams.set("state", y), location.href = c.href;
|
|
998
1022
|
}
|
|
999
1023
|
async getAccessToken() {
|
|
1000
|
-
const e = await this.getAuthServer(), { providerData: n } =
|
|
1024
|
+
const e = await this.getAuthServer(), { providerData: n } = x.getState();
|
|
1001
1025
|
if (!n)
|
|
1002
1026
|
throw new E("User is not authenticated");
|
|
1003
1027
|
const o = n;
|
|
1004
1028
|
if (new Date(o.expiresOn) < /* @__PURE__ */ new Date()) {
|
|
1005
1029
|
if (!o.refreshToken)
|
|
1006
|
-
return
|
|
1030
|
+
return x.setState({
|
|
1007
1031
|
isAuthenticated: !1,
|
|
1008
1032
|
isPending: !1,
|
|
1009
1033
|
profile: null,
|
|
1010
1034
|
providerData: null
|
|
1011
1035
|
}), "";
|
|
1012
|
-
const s = await
|
|
1036
|
+
const s = await yt(
|
|
1013
1037
|
e,
|
|
1014
1038
|
this.client,
|
|
1015
1039
|
o.refreshToken
|
|
1016
|
-
), r = await
|
|
1040
|
+
), r = await _t(
|
|
1017
1041
|
e,
|
|
1018
1042
|
this.client,
|
|
1019
1043
|
s
|
|
@@ -1029,7 +1053,7 @@ class Jt {
|
|
|
1029
1053
|
return e.headers.set("Authorization", `Bearer ${n}`), e;
|
|
1030
1054
|
};
|
|
1031
1055
|
signOut = async () => {
|
|
1032
|
-
|
|
1056
|
+
x.setState({
|
|
1033
1057
|
isAuthenticated: !1,
|
|
1034
1058
|
isPending: !1,
|
|
1035
1059
|
profile: void 0,
|
|
@@ -1046,13 +1070,13 @@ class Jt {
|
|
|
1046
1070
|
)) : o = n;
|
|
1047
1071
|
};
|
|
1048
1072
|
handleCallback = async () => {
|
|
1049
|
-
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(
|
|
1050
|
-
if (sessionStorage.removeItem(
|
|
1073
|
+
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(M);
|
|
1074
|
+
if (sessionStorage.removeItem(M), n !== o)
|
|
1051
1075
|
throw new E("Invalid state parameter");
|
|
1052
|
-
const s = sessionStorage.getItem(
|
|
1053
|
-
if (sessionStorage.removeItem(
|
|
1076
|
+
const s = sessionStorage.getItem(F);
|
|
1077
|
+
if (sessionStorage.removeItem(F), !s)
|
|
1054
1078
|
throw new E("No code verifier found in state.");
|
|
1055
|
-
const r = await this.getAuthServer(), i =
|
|
1079
|
+
const r = await this.getAuthServer(), i = zt(
|
|
1056
1080
|
r,
|
|
1057
1081
|
this.client,
|
|
1058
1082
|
e.searchParams,
|
|
@@ -1065,19 +1089,19 @@ class Jt {
|
|
|
1065
1089
|
);
|
|
1066
1090
|
const c = new URL(e);
|
|
1067
1091
|
c.pathname = this.callbackUrlPath, c.search = "";
|
|
1068
|
-
const f = await
|
|
1092
|
+
const f = await At(
|
|
1069
1093
|
r,
|
|
1070
1094
|
this.client,
|
|
1071
1095
|
i,
|
|
1072
1096
|
c.toString(),
|
|
1073
1097
|
s
|
|
1074
|
-
), y = await
|
|
1098
|
+
), y = await Pt(
|
|
1075
1099
|
r,
|
|
1076
1100
|
this.client,
|
|
1077
1101
|
f
|
|
1078
1102
|
);
|
|
1079
1103
|
this.setTokensFromResponse(y);
|
|
1080
|
-
const p = await this.getAccessToken(), b = await (await
|
|
1104
|
+
const p = await this.getAccessToken(), b = await (await gt(
|
|
1081
1105
|
r,
|
|
1082
1106
|
this.client,
|
|
1083
1107
|
p
|
|
@@ -1088,7 +1112,7 @@ class Jt {
|
|
|
1088
1112
|
emailVerified: b.email_verified ?? !1,
|
|
1089
1113
|
pictureUrl: b.picture
|
|
1090
1114
|
};
|
|
1091
|
-
|
|
1115
|
+
x.setState({
|
|
1092
1116
|
isAuthenticated: !0,
|
|
1093
1117
|
isPending: !1,
|
|
1094
1118
|
profile: h
|
|
@@ -1096,14 +1120,20 @@ class Jt {
|
|
|
1096
1120
|
const R = sessionStorage.getItem("redirect-to") ?? "/";
|
|
1097
1121
|
return sessionStorage.removeItem("redirect-to"), R;
|
|
1098
1122
|
};
|
|
1099
|
-
|
|
1100
|
-
return
|
|
1123
|
+
getRoutes() {
|
|
1124
|
+
return [
|
|
1125
|
+
...super.getRoutes(),
|
|
1126
|
+
{
|
|
1127
|
+
path: he,
|
|
1128
|
+
element: /* @__PURE__ */ L.jsx(Ue, { children: /* @__PURE__ */ L.jsx(Nt, { handleCallback: this.handleCallback }) })
|
|
1129
|
+
}
|
|
1130
|
+
];
|
|
1101
1131
|
}
|
|
1102
1132
|
}
|
|
1103
|
-
const
|
|
1133
|
+
const Gt = (t) => new Wt(t);
|
|
1104
1134
|
export {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1135
|
+
he as OPENID_CALLBACK_PATH,
|
|
1136
|
+
Wt as OpenIDAuthenticationProvider,
|
|
1137
|
+
Gt as default
|
|
1108
1138
|
};
|
|
1109
1139
|
//# sourceMappingURL=zudoku.auth-openid.js.map
|