zudoku 0.3.0-dev.7 → 0.3.0-dev.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/App.d.ts +1 -2
- package/dist/app/App.js +1 -29
- package/dist/app/App.js.map +1 -1
- package/dist/app/demo.d.ts +2 -0
- package/dist/app/demo.js +32 -0
- package/dist/app/demo.js.map +1 -0
- package/dist/app/entry.client.d.ts +2 -0
- package/dist/app/entry.client.js +35 -0
- package/dist/app/entry.client.js.map +1 -0
- package/dist/app/entry.server.d.ts +14 -0
- package/dist/app/entry.server.js +105 -0
- package/dist/app/entry.server.js.map +1 -0
- package/dist/app/main.d.ts +6 -1
- package/dist/app/main.js +68 -12
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +37 -0
- package/dist/app/standalone.js.map +1 -0
- package/dist/app/tailwind.d.ts +1 -1
- package/dist/app/tailwind.js +0 -4
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cmds/dev.js +5 -0
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/dev/handler.d.ts +1 -0
- package/dist/cli/dev/handler.js +3 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +19 -45
- package/dist/config/validators/validate.d.ts +911 -2
- package/dist/config/validators/validate.js +151 -1
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -0
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +13 -0
- package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
- package/dist/lib/authentication/Callback.d.ts +1 -1
- package/dist/lib/authentication/Callback.js +3 -3
- package/dist/lib/authentication/Callback.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +6 -9
- package/dist/lib/authentication/components/SignIn.d.ts +1 -0
- package/dist/lib/authentication/components/SignIn.js +10 -0
- package/dist/lib/authentication/components/SignIn.js.map +1 -0
- package/dist/lib/authentication/components/SignOut.d.ts +1 -0
- package/dist/lib/authentication/components/SignOut.js +10 -0
- package/dist/lib/authentication/components/SignOut.js.map +1 -0
- package/dist/lib/authentication/components/SignUp.d.ts +1 -0
- package/dist/lib/authentication/components/SignUp.js +10 -0
- package/dist/lib/authentication/components/SignUp.js.map +1 -0
- package/dist/lib/authentication/hook.js +2 -2
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +4 -5
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +59 -30
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +20 -7
- package/dist/lib/authentication/providers/openid.js +58 -17
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +13 -0
- package/dist/lib/components/Bootstrap.js +12 -0
- package/dist/lib/components/Bootstrap.js.map +1 -0
- package/dist/lib/components/DevPortal.d.ts +5 -19
- package/dist/lib/components/DevPortal.js +32 -12
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/DeveloperHint.d.ts +5 -0
- package/dist/lib/components/DeveloperHint.js +10 -0
- package/dist/lib/components/DeveloperHint.js.map +1 -0
- package/dist/lib/components/ErrorPage.d.ts +6 -0
- package/dist/lib/components/ErrorPage.js +9 -0
- package/dist/lib/components/ErrorPage.js.map +1 -0
- package/dist/lib/components/Header.js +17 -3
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +9 -4
- package/dist/lib/components/Heading.js +17 -2
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/InlineCode.d.ts +5 -0
- package/dist/lib/components/InlineCode.js +4 -0
- package/dist/lib/components/InlineCode.js.map +1 -0
- package/dist/lib/components/Layout.js +4 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/NotFoundPage.d.ts +1 -0
- package/dist/lib/components/NotFoundPage.js +12 -0
- package/dist/lib/components/NotFoundPage.js.map +1 -0
- package/dist/lib/components/SlotletProvider.d.ts +9 -0
- package/dist/lib/components/SlotletProvider.js +11 -0
- package/dist/lib/components/SlotletProvider.js.map +1 -0
- package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
- package/dist/lib/components/SyntaxHighlight.js +24 -22
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/TopNavigation.js +5 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
- package/dist/lib/components/context/DevPortalProvider.js +20 -3
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +32 -3
- package/dist/lib/components/index.js +21 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigation.js +3 -2
- package/dist/lib/components/navigation/SideNavigation.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationCategory.js +3 -3
- package/dist/lib/components/navigation/SideNavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -4
- package/dist/lib/components/navigation/SideNavigationItem.js +4 -4
- package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +4 -1
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js +17 -5
- package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +48 -12
- package/dist/lib/core/DevPortalContext.js +7 -9
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +16 -4
- package/dist/lib/core/plugins.js +2 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +3 -0
- package/dist/lib/errors/ErrorAlert.js +8 -0
- package/dist/lib/errors/ErrorAlert.js.map +1 -0
- package/dist/lib/errors/RouterError.d.ts +1 -0
- package/dist/lib/errors/RouterError.js +12 -0
- package/dist/lib/errors/RouterError.js.map +1 -0
- package/dist/lib/errors/ServerError.d.ts +3 -0
- package/dist/lib/errors/ServerError.js +6 -0
- package/dist/lib/errors/ServerError.js.map +1 -0
- package/dist/lib/errors/TopLevelError.d.ts +2 -0
- package/dist/lib/errors/TopLevelError.js +7 -0
- package/dist/lib/errors/TopLevelError.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +6 -4
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -1
- package/dist/lib/oas/parser/index.js +38 -12
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +2 -2
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +40 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
- package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +4 -5
- package/dist/lib/plugins/{api-key → api-keys}/index.js +12 -20
- package/dist/lib/plugins/api-keys/index.js.map +1 -0
- package/dist/lib/plugins/custom-page/index.d.ts +8 -0
- package/dist/lib/plugins/custom-page/index.js +12 -0
- package/dist/lib/plugins/custom-page/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
- package/dist/lib/plugins/markdown/MdxPage.js +7 -6
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/Toc.js +17 -9
- package/dist/lib/plugins/markdown/Toc.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +4 -1
- package/dist/lib/plugins/markdown/index.js +3 -7
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.d.ts +2 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +14 -9
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +17 -5
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +4 -16
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +6 -0
- package/dist/lib/plugins/openapi/Route.js +8 -0
- package/dist/lib/plugins/openapi/Route.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListView.js +6 -27
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +26 -19
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.d.ts +1 -0
- package/dist/lib/plugins/openapi/SidecarBox.js +3 -2
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
- package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
- package/dist/lib/plugins/openapi/StaggeredRender.d.ts +8 -0
- package/dist/lib/plugins/openapi/StaggeredRender.js +18 -0
- package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
- package/dist/lib/plugins/openapi/client/createServer.js +30 -0
- package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
- package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
- package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
- package/dist/lib/plugins/openapi/context.d.ts +5 -0
- package/dist/lib/plugins/openapi/context.js +11 -0
- package/dist/lib/plugins/openapi/context.js.map +1 -0
- package/dist/lib/plugins/openapi/index.d.ts +4 -18
- package/dist/lib/plugins/openapi/index.js +35 -20
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
- package/dist/lib/plugins/openapi/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js +9 -12
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -5
- package/dist/lib/plugins/openapi/playground/Playground.js +31 -15
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +12 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/QueryParams.js +13 -9
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.js +5 -9
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
- package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/prose.js +4 -0
- package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +1 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +0 -1
- package/dist/lib/plugins/redirect/index.js +3 -4
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/ui/Callout.js +2 -2
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Card.js +1 -1
- package/dist/lib/ui/Card.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +27 -0
- package/dist/lib/ui/DropdownMenu.js +36 -0
- package/dist/lib/ui/DropdownMenu.js.map +1 -0
- package/dist/lib/ui/Input.js.map +1 -0
- package/dist/lib/ui/button-variants.d.ts +2 -2
- package/dist/lib/ui/button-variants.js +1 -0
- package/dist/lib/ui/button-variants.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +2 -2
- package/dist/lib/util/MdxComponents.js +7 -5
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/groupBy.d.ts +1 -6
- package/dist/lib/util/groupBy.js +10 -8
- package/dist/lib/util/groupBy.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +6 -0
- package/dist/lib/util/invariant.js +21 -0
- package/dist/lib/util/invariant.js.map +1 -0
- package/dist/lib/util/joinPath.js +2 -1
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/lib/util/logInit.d.ts +1 -0
- package/dist/lib/util/logInit.js +9 -0
- package/dist/lib/util/logInit.js.map +1 -0
- package/dist/lib/util/objectEntries.d.ts +4 -0
- package/dist/lib/util/objectEntries.js +2 -0
- package/dist/lib/util/objectEntries.js.map +1 -0
- package/dist/lib/util/renderIf.d.ts +1 -0
- package/dist/lib/util/renderIf.js +2 -0
- package/dist/lib/util/renderIf.js.map +1 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.d.ts +1 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.js +7 -0
- package/dist/lib/util/requestIdleCallbackPolyfill.js.map +1 -0
- package/dist/vite/build.js +30 -7
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +21 -12
- package/dist/vite/config.js +107 -55
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +6 -3
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.d.ts +2 -1
- package/dist/vite/dev-server.js +44 -15
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +18 -5
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api-keys.js +7 -8
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.js +9 -20
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +5 -6
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.js +5 -2
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +0 -2
- package/dist/vite/plugin-config.js +2 -13
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-css.d.ts +6 -0
- package/dist/vite/plugin-custom-css.js +54 -0
- package/dist/vite/plugin-custom-css.js.map +1 -0
- package/dist/vite/plugin-docs.js +15 -5
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +3 -1
- package/dist/vite/plugin-mdx.js +5 -5
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-metadata.js +1 -1
- package/dist/vite/plugin-metadata.js.map +1 -1
- package/dist/vite/plugin-redirect.js +10 -10
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin.js +3 -5
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +17 -0
- package/dist/vite/prerender.js +79 -0
- package/dist/vite/prerender.js.map +1 -0
- package/lib/AnchorLink-C_pYhuZi.js +705 -0
- package/lib/AnchorLink-C_pYhuZi.js.map +1 -0
- package/lib/AuthenticationPlugin-RvXALgvS.js +52 -0
- package/lib/AuthenticationPlugin-RvXALgvS.js.map +1 -0
- package/lib/CategoryHeading-D5Q-X6lE.js +10 -0
- package/lib/CategoryHeading-D5Q-X6lE.js.map +1 -0
- package/lib/Combination-Cq0UkOXq.js +2774 -0
- package/lib/Combination-Cq0UkOXq.js.map +1 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
- package/lib/Input-DdAxw3vC.js +2239 -0
- package/lib/Input-DdAxw3vC.js.map +1 -0
- package/lib/Markdown-DsCvZnhw.js +15035 -0
- package/lib/Markdown-DsCvZnhw.js.map +1 -0
- package/lib/MdxPage-B_7x36CA.js +200 -0
- package/lib/MdxPage-B_7x36CA.js.map +1 -0
- package/lib/OperationList-i6FGZUu4.js +5467 -0
- package/lib/OperationList-i6FGZUu4.js.map +1 -0
- package/lib/Route-Bsrd0acQ.js +13 -0
- package/lib/Route-Bsrd0acQ.js.map +1 -0
- package/lib/SlotletProvider-CpNYmq6S.js +102 -0
- package/lib/SlotletProvider-CpNYmq6S.js.map +1 -0
- package/lib/Spinner-BBPlEab_.js +359 -0
- package/lib/Spinner-BBPlEab_.js.map +1 -0
- package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
- package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
- package/lib/assets/index-BPdJm2ty.js +1 -0
- package/lib/assets/index-BPdJm2ty.js.map +1 -0
- package/lib/assets/{worker-BCcpCNJ7.js → worker-BWwCA-wk.js} +10727 -10300
- package/lib/assets/worker-BWwCA-wk.js.map +1 -0
- package/lib/context-_fYfJFgk.js +14 -0
- package/lib/context-_fYfJFgk.js.map +1 -0
- package/lib/index-DT-cf5tv.js +726 -0
- package/lib/index-DT-cf5tv.js.map +1 -0
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/index-pI9JkN46.js.map +1 -0
- package/lib/jsx-runtime-BIr0WBt_.js +1526 -0
- package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
- package/lib/prism-csharp.min-Yizuc34Y.js +1 -0
- package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
- package/lib/prism-java.min-d5iT_mOd.js +1 -0
- package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
- package/lib/prism-json.min-B1GJqK1k.js +1 -0
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
- package/lib/prism-php.min-o7FpoMP_.js +1 -0
- package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
- package/lib/router-BiRCp01d.js +2971 -0
- package/lib/router-BiRCp01d.js.map +1 -0
- package/lib/slugify-CiPVjteN.js +28 -0
- package/lib/slugify-CiPVjteN.js.map +1 -0
- package/lib/state-DKdaQzvh.js +288 -0
- package/lib/state-DKdaQzvh.js.map +1 -0
- package/lib/urql-DMlBWUKL.js +1 -0
- package/lib/urql-DMlBWUKL.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +15 -13
- package/lib/zudoku.auth-auth0.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +59 -29
- package/lib/zudoku.auth-clerk.js.map +1 -0
- package/lib/zudoku.auth-openid.js +715 -539
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +1835 -550
- package/lib/zudoku.components.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +15035 -146
- package/lib/zudoku.openapi-worker.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +300 -0
- package/lib/zudoku.plugin-api-keys.js.map +1 -0
- package/lib/zudoku.plugin-custom-page.js +13 -0
- package/lib/zudoku.plugin-custom-page.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +48 -0
- package/lib/zudoku.plugin-markdown.js.map +1 -0
- package/lib/zudoku.plugin-openapi.js +10 -0
- package/lib/zudoku.plugin-openapi.js.map +1 -0
- package/lib/zudoku.plugin-redirect.js +11 -0
- package/lib/zudoku.plugin-redirect.js.map +1 -0
- package/package.json +60 -25
- package/src/app/App.tsx +0 -41
- package/src/app/demo-cdn.html +26 -0
- package/src/app/demo.html +18 -0
- package/src/app/demo.tsx +45 -0
- package/src/app/entry.client.tsx +47 -0
- package/src/app/entry.server.tsx +160 -0
- package/src/app/main.css +84 -4
- package/src/app/main.tsx +87 -15
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +51 -0
- package/src/app/tailwind.ts +2 -6
- package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
- package/src/lib/authentication/Callback.tsx +4 -4
- package/src/lib/authentication/authentication.ts +6 -12
- package/src/lib/authentication/components/SignIn.tsx +11 -0
- package/src/lib/authentication/components/SignOut.tsx +11 -0
- package/src/lib/authentication/components/SignUp.tsx +11 -0
- package/src/lib/authentication/hook.ts +2 -2
- package/src/lib/authentication/providers/auth0.tsx +6 -5
- package/src/lib/authentication/providers/clerk.tsx +63 -31
- package/src/lib/authentication/providers/openid.tsx +69 -18
- package/src/lib/components/Bootstrap.tsx +44 -0
- package/src/lib/components/DevPortal.tsx +59 -49
- package/src/lib/components/DeveloperHint.tsx +25 -0
- package/src/lib/components/ErrorPage.tsx +28 -0
- package/src/lib/components/Header.tsx +97 -32
- package/src/lib/components/Heading.tsx +26 -7
- package/src/lib/components/InlineCode.tsx +19 -0
- package/src/lib/components/Layout.tsx +12 -7
- package/src/lib/components/NotFoundPage.tsx +33 -0
- package/src/lib/components/SlotletProvider.tsx +25 -0
- package/src/lib/components/SyntaxHighlight.tsx +53 -44
- package/src/lib/components/TopNavigation.tsx +6 -1
- package/src/lib/components/context/DevPortalProvider.ts +24 -4
- package/src/lib/components/index.ts +25 -3
- package/src/lib/components/navigation/SideNavigation.tsx +3 -0
- package/src/lib/components/navigation/SideNavigationCategory.tsx +5 -9
- package/src/lib/components/navigation/SideNavigationItem.tsx +5 -9
- package/src/lib/components/navigation/useNavigationCollapsibleState.ts +21 -6
- package/src/lib/core/DevPortalContext.ts +56 -25
- package/src/lib/core/plugins.ts +26 -5
- package/src/lib/errors/ErrorAlert.tsx +21 -0
- package/src/lib/errors/RouterError.tsx +13 -0
- package/src/lib/errors/ServerError.tsx +5 -0
- package/src/lib/errors/TopLevelError.tsx +8 -0
- package/src/lib/oas/graphql/index.ts +9 -5
- package/src/lib/oas/parser/index.ts +41 -20
- package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
- package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +19 -9
- package/src/lib/plugins/{api-key → api-keys}/index.tsx +17 -41
- package/src/lib/plugins/custom-page/index.tsx +22 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +51 -34
- package/src/lib/plugins/markdown/Toc.tsx +53 -40
- package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
- package/src/lib/plugins/markdown/index.tsx +10 -7
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -16
- package/src/lib/plugins/openapi/OperationList.tsx +46 -10
- package/src/lib/plugins/openapi/OperationListItem.tsx +68 -42
- package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
- package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
- package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +3 -19
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -2
- package/src/lib/plugins/openapi/Route.tsx +21 -0
- package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
- package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +40 -28
- package/src/lib/plugins/openapi/SidecarBox.tsx +13 -2
- package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
- package/src/lib/plugins/openapi/StaggeredRender.tsx +31 -0
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
- package/src/lib/plugins/openapi/client/createServer.ts +33 -0
- package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
- package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
- package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
- package/src/lib/plugins/openapi/context.tsx +16 -0
- package/src/lib/plugins/openapi/index.tsx +59 -52
- package/src/lib/plugins/openapi/interfaces.ts +9 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +80 -48
- package/src/lib/plugins/openapi/playground/Playground.tsx +200 -210
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +36 -0
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +92 -65
- package/src/lib/plugins/openapi/playground/createUrl.ts +12 -15
- package/src/lib/plugins/openapi/util/prose.ts +7 -0
- package/src/lib/plugins/openapi-worker.ts +1 -1
- package/src/lib/plugins/redirect/index.tsx +3 -4
- package/src/lib/ui/Callout.tsx +4 -4
- package/src/lib/ui/Card.tsx +1 -1
- package/src/lib/ui/DropdownMenu.tsx +199 -0
- package/src/lib/ui/button-variants.ts +1 -0
- package/src/lib/util/MdxComponents.tsx +7 -15
- package/src/lib/util/groupBy.ts +7 -12
- package/src/lib/util/invariant.ts +26 -0
- package/src/lib/util/joinPath.tsx +2 -1
- package/src/lib/util/logInit.ts +9 -0
- package/src/lib/util/objectEntries.ts +5 -0
- package/src/lib/util/renderIf.ts +4 -0
- package/src/lib/util/requestIdleCallbackPolyfill.ts +6 -0
- package/dist/lib/components/Input.js.map +0 -1
- package/dist/lib/components/Link.d.ts +0 -1
- package/dist/lib/components/Link.js +0 -2
- package/dist/lib/components/Link.js.map +0 -1
- package/dist/lib/components/Router.d.ts +0 -4
- package/dist/lib/components/Router.js +0 -20
- package/dist/lib/components/Router.js.map +0 -1
- package/dist/lib/core/helmet.d.ts +0 -4
- package/dist/lib/core/helmet.js +0 -5
- package/dist/lib/core/helmet.js.map +0 -1
- package/dist/lib/core/icons.d.ts +0 -1
- package/dist/lib/core/icons.js +0 -2
- package/dist/lib/core/icons.js.map +0 -1
- package/dist/lib/core/router.d.ts +0 -1
- package/dist/lib/core/router.js +0 -2
- package/dist/lib/core/router.js.map +0 -1
- package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
- package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
- package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
- package/dist/lib/plugins/api-key/index.js.map +0 -1
- package/dist/lib/plugins/index.d.ts +0 -4
- package/dist/lib/plugins/index.js +0 -5
- package/dist/lib/plugins/index.js.map +0 -1
- package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/lib/plugins/openapi/Select.js +0 -5
- package/dist/lib/plugins/openapi/Select.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
- package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
- package/dist/vite/common.d.ts +0 -1
- package/dist/vite/common.js +0 -5
- package/dist/vite/common.js.map +0 -1
- package/dist/vite/plugin-html.d.ts +0 -3
- package/dist/vite/plugin-html.js +0 -47
- package/dist/vite/plugin-html.js.map +0 -1
- package/dist/vite/plugin-openapi-worker.d.ts +0 -4
- package/dist/vite/plugin-openapi-worker.js +0 -28
- package/dist/vite/plugin-openapi-worker.js.map +0 -1
- package/lib/Spinner-BewqqUU-.js +0 -8413
- package/lib/clerk-Wslx_mPo.js +0 -19685
- package/lib/index-PyGcnQFX.js +0 -3462
- package/lib/loglevel-CoH7VSwE.js +0 -152
- package/lib/state-2Hu1renZ.js +0 -313
- package/lib/zudoku.plugins.js +0 -19902
- package/src/lib/components/Link.tsx +0 -1
- package/src/lib/components/Router.tsx +0 -28
- package/src/lib/core/helmet.ts +0 -5
- package/src/lib/core/icons.tsx +0 -1
- package/src/lib/core/router.tsx +0 -1
- package/src/lib/plugins/index.ts +0 -4
- package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
- /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
- /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
- /package/dist/lib/{components → ui}/Input.d.ts +0 -0
- /package/dist/lib/{components → ui}/Input.js +0 -0
- /package/src/lib/{components → ui}/Input.tsx +0 -0
|
@@ -1,125 +1,274 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
(
|
|
11
|
-
function
|
|
12
|
-
|
|
1
|
+
var Re = Object.defineProperty;
|
|
2
|
+
var Pe = (t, e, n) => e in t ? Re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var y = (t, e, n) => Pe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { b as xe, j as A } from "./jsx-runtime-BIr0WBt_.js";
|
|
5
|
+
import { c as Ue, a as Le } from "./_commonjsHelpers-BVfed4GL.js";
|
|
6
|
+
import { A as Ce } from "./AuthenticationPlugin-RvXALgvS.js";
|
|
7
|
+
import { useRef as je, useState as Ie, useEffect as ze } from "react";
|
|
8
|
+
import { u as re } from "./state-DKdaQzvh.js";
|
|
9
|
+
var he = { exports: {} };
|
|
10
|
+
(function(t) {
|
|
11
|
+
(function(e, n) {
|
|
12
|
+
t.exports ? t.exports = n() : e.log = n();
|
|
13
|
+
})(Ue, function() {
|
|
14
|
+
var e = function() {
|
|
15
|
+
}, n = "undefined", r = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [
|
|
16
|
+
"trace",
|
|
17
|
+
"debug",
|
|
18
|
+
"info",
|
|
19
|
+
"warn",
|
|
20
|
+
"error"
|
|
21
|
+
], o = {}, i = null;
|
|
22
|
+
function u(l, f) {
|
|
23
|
+
var c = l[f];
|
|
24
|
+
if (typeof c.bind == "function")
|
|
25
|
+
return c.bind(l);
|
|
26
|
+
try {
|
|
27
|
+
return Function.prototype.bind.call(c, l);
|
|
28
|
+
} catch {
|
|
29
|
+
return function() {
|
|
30
|
+
return Function.prototype.apply.apply(c, [l, arguments]);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function g() {
|
|
35
|
+
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
36
|
+
}
|
|
37
|
+
function m(l) {
|
|
38
|
+
return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && r ? g : console[l] !== void 0 ? u(console, l) : console.log !== void 0 ? u(console, "log") : e;
|
|
39
|
+
}
|
|
40
|
+
function b() {
|
|
41
|
+
for (var l = this.getLevel(), f = 0; f < s.length; f++) {
|
|
42
|
+
var c = s[f];
|
|
43
|
+
this[c] = f < l ? e : this.methodFactory(c, l, this.name);
|
|
44
|
+
}
|
|
45
|
+
if (this.log = this.debug, typeof console === n && l < this.levels.SILENT)
|
|
46
|
+
return "No console available for logging";
|
|
47
|
+
}
|
|
48
|
+
function _(l) {
|
|
49
|
+
return function() {
|
|
50
|
+
typeof console !== n && (b.call(this), this[l].apply(this, arguments));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function h(l, f, c) {
|
|
54
|
+
return m(l) || _.apply(this, arguments);
|
|
55
|
+
}
|
|
56
|
+
function U(l, f) {
|
|
57
|
+
var c = this, z, $, P, v = "loglevel";
|
|
58
|
+
typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
|
|
59
|
+
function Te(d) {
|
|
60
|
+
var p = (s[d] || "silent").toUpperCase();
|
|
61
|
+
if (!(typeof window === n || !v)) {
|
|
62
|
+
try {
|
|
63
|
+
window.localStorage[v] = p;
|
|
64
|
+
return;
|
|
65
|
+
} catch {
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
window.document.cookie = encodeURIComponent(v) + "=" + p + ";";
|
|
69
|
+
} catch {
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function ee() {
|
|
74
|
+
var d;
|
|
75
|
+
if (!(typeof window === n || !v)) {
|
|
76
|
+
try {
|
|
77
|
+
d = window.localStorage[v];
|
|
78
|
+
} catch {
|
|
79
|
+
}
|
|
80
|
+
if (typeof d === n)
|
|
81
|
+
try {
|
|
82
|
+
var p = window.document.cookie, J = encodeURIComponent(v), ne = p.indexOf(J + "=");
|
|
83
|
+
ne !== -1 && (d = /^([^;]+)/.exec(
|
|
84
|
+
p.slice(ne + J.length + 1)
|
|
85
|
+
)[1]);
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
return c.levels[d] === void 0 && (d = void 0), d;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function Ae() {
|
|
92
|
+
if (!(typeof window === n || !v)) {
|
|
93
|
+
try {
|
|
94
|
+
window.localStorage.removeItem(v);
|
|
95
|
+
} catch {
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
window.document.cookie = encodeURIComponent(v) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
99
|
+
} catch {
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function L(d) {
|
|
104
|
+
var p = d;
|
|
105
|
+
if (typeof p == "string" && c.levels[p.toUpperCase()] !== void 0 && (p = c.levels[p.toUpperCase()]), typeof p == "number" && p >= 0 && p <= c.levels.SILENT)
|
|
106
|
+
return p;
|
|
107
|
+
throw new TypeError("log.setLevel() called with invalid level: " + d);
|
|
108
|
+
}
|
|
109
|
+
c.name = l, c.levels = {
|
|
110
|
+
TRACE: 0,
|
|
111
|
+
DEBUG: 1,
|
|
112
|
+
INFO: 2,
|
|
113
|
+
WARN: 3,
|
|
114
|
+
ERROR: 4,
|
|
115
|
+
SILENT: 5
|
|
116
|
+
}, c.methodFactory = f || h, c.getLevel = function() {
|
|
117
|
+
return P ?? $ ?? z;
|
|
118
|
+
}, c.setLevel = function(d, p) {
|
|
119
|
+
return P = L(d), p !== !1 && Te(P), b.call(c);
|
|
120
|
+
}, c.setDefaultLevel = function(d) {
|
|
121
|
+
$ = L(d), ee() || c.setLevel(d, !1);
|
|
122
|
+
}, c.resetLevel = function() {
|
|
123
|
+
P = null, Ae(), b.call(c);
|
|
124
|
+
}, c.enableAll = function(d) {
|
|
125
|
+
c.setLevel(c.levels.TRACE, d);
|
|
126
|
+
}, c.disableAll = function(d) {
|
|
127
|
+
c.setLevel(c.levels.SILENT, d);
|
|
128
|
+
}, c.rebuild = function() {
|
|
129
|
+
if (i !== c && (z = L(i.getLevel())), b.call(c), i === c)
|
|
130
|
+
for (var d in o)
|
|
131
|
+
o[d].rebuild();
|
|
132
|
+
}, z = L(
|
|
133
|
+
i ? i.getLevel() : "WARN"
|
|
134
|
+
);
|
|
135
|
+
var te = ee();
|
|
136
|
+
te != null && (P = L(te)), b.call(c);
|
|
137
|
+
}
|
|
138
|
+
i = new U(), i.getLogger = function(f) {
|
|
139
|
+
if (typeof f != "symbol" && typeof f != "string" || f === "")
|
|
140
|
+
throw new TypeError("You must supply a name when creating a logger.");
|
|
141
|
+
var c = o[f];
|
|
142
|
+
return c || (c = o[f] = new U(
|
|
143
|
+
f,
|
|
144
|
+
i.methodFactory
|
|
145
|
+
)), c;
|
|
146
|
+
};
|
|
147
|
+
var R = typeof window !== n ? window.log : void 0;
|
|
148
|
+
return i.noConflict = function() {
|
|
149
|
+
return typeof window !== n && window.log === i && (window.log = R), i;
|
|
150
|
+
}, i.getLoggers = function() {
|
|
151
|
+
return o;
|
|
152
|
+
}, i.default = i, i;
|
|
153
|
+
});
|
|
154
|
+
})(he);
|
|
155
|
+
var Je = he.exports;
|
|
156
|
+
const oe = /* @__PURE__ */ Le(Je);
|
|
157
|
+
let M;
|
|
158
|
+
var O, de;
|
|
159
|
+
(typeof navigator > "u" || !((de = (O = navigator.userAgent) == null ? void 0 : O.startsWith) != null && de.call(O, "Mozilla/5.0 "))) && (M = "oauth4webapi/v2.11.1");
|
|
160
|
+
function q(t, e) {
|
|
161
|
+
if (t == null)
|
|
13
162
|
return !1;
|
|
14
163
|
try {
|
|
15
|
-
return
|
|
164
|
+
return t instanceof e || Object.getPrototypeOf(t)[Symbol.toStringTag] === e.prototype[Symbol.toStringTag];
|
|
16
165
|
} catch {
|
|
17
166
|
return !1;
|
|
18
167
|
}
|
|
19
168
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
return typeof
|
|
169
|
+
const K = Symbol(), Oe = Symbol(), V = Symbol(), Ne = new TextEncoder(), Ke = new TextDecoder();
|
|
170
|
+
function E(t) {
|
|
171
|
+
return typeof t == "string" ? Ne.encode(t) : Ke.decode(t);
|
|
23
172
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
for (let n = 0; n <
|
|
29
|
-
|
|
30
|
-
return btoa(
|
|
173
|
+
const ie = 32768;
|
|
174
|
+
function We(t) {
|
|
175
|
+
t instanceof ArrayBuffer && (t = new Uint8Array(t));
|
|
176
|
+
const e = [];
|
|
177
|
+
for (let n = 0; n < t.byteLength; n += ie)
|
|
178
|
+
e.push(String.fromCharCode.apply(null, t.subarray(n, n + ie)));
|
|
179
|
+
return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
31
180
|
}
|
|
32
|
-
function
|
|
181
|
+
function De(t) {
|
|
33
182
|
try {
|
|
34
|
-
const
|
|
35
|
-
for (let r = 0; r <
|
|
36
|
-
n[r] =
|
|
183
|
+
const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
|
|
184
|
+
for (let r = 0; r < e.length; r++)
|
|
185
|
+
n[r] = e.charCodeAt(r);
|
|
37
186
|
return n;
|
|
38
|
-
} catch (
|
|
39
|
-
throw new
|
|
187
|
+
} catch (e) {
|
|
188
|
+
throw new a("The input to be decoded is not correctly encoded.", { cause: e });
|
|
40
189
|
}
|
|
41
190
|
}
|
|
42
|
-
function
|
|
43
|
-
return typeof
|
|
191
|
+
function T(t) {
|
|
192
|
+
return typeof t == "string" ? De(t) : We(t);
|
|
44
193
|
}
|
|
45
|
-
class
|
|
46
|
-
constructor(
|
|
47
|
-
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize =
|
|
194
|
+
class He {
|
|
195
|
+
constructor(e) {
|
|
196
|
+
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
|
|
48
197
|
}
|
|
49
|
-
get(
|
|
50
|
-
let n = this.cache.get(
|
|
198
|
+
get(e) {
|
|
199
|
+
let n = this.cache.get(e);
|
|
51
200
|
if (n)
|
|
52
201
|
return n;
|
|
53
|
-
if (n = this._cache.get(
|
|
54
|
-
return this.update(
|
|
202
|
+
if (n = this._cache.get(e))
|
|
203
|
+
return this.update(e, n), n;
|
|
55
204
|
}
|
|
56
|
-
has(
|
|
57
|
-
return this.cache.has(
|
|
205
|
+
has(e) {
|
|
206
|
+
return this.cache.has(e) || this._cache.has(e);
|
|
58
207
|
}
|
|
59
|
-
set(
|
|
60
|
-
return this.cache.has(
|
|
208
|
+
set(e, n) {
|
|
209
|
+
return this.cache.has(e) ? this.cache.set(e, n) : this.update(e, n), this;
|
|
61
210
|
}
|
|
62
|
-
delete(
|
|
63
|
-
return this.cache.has(
|
|
211
|
+
delete(e) {
|
|
212
|
+
return this.cache.has(e) ? this.cache.delete(e) : this._cache.has(e) ? this._cache.delete(e) : !1;
|
|
64
213
|
}
|
|
65
|
-
update(
|
|
66
|
-
this.cache.set(
|
|
214
|
+
update(e, n) {
|
|
215
|
+
this.cache.set(e, n), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
|
|
67
216
|
}
|
|
68
217
|
}
|
|
69
|
-
class
|
|
70
|
-
constructor(
|
|
218
|
+
class S extends Error {
|
|
219
|
+
constructor(e) {
|
|
71
220
|
var n;
|
|
72
|
-
super(
|
|
221
|
+
super(e ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
|
|
73
222
|
}
|
|
74
223
|
}
|
|
75
|
-
class
|
|
76
|
-
constructor(
|
|
224
|
+
class $e extends Error {
|
|
225
|
+
constructor(e, n) {
|
|
77
226
|
var r;
|
|
78
|
-
super(
|
|
227
|
+
super(e, n), this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
|
|
79
228
|
}
|
|
80
229
|
}
|
|
81
|
-
const
|
|
82
|
-
function
|
|
83
|
-
return
|
|
230
|
+
const a = $e, fe = new He(100);
|
|
231
|
+
function pe(t) {
|
|
232
|
+
return t instanceof CryptoKey;
|
|
84
233
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
234
|
+
function we(t) {
|
|
235
|
+
return pe(t) && t.type === "private";
|
|
87
236
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
237
|
+
function Fe(t) {
|
|
238
|
+
return pe(t) && t.type === "public";
|
|
90
239
|
}
|
|
91
|
-
function
|
|
240
|
+
function Y(t) {
|
|
92
241
|
try {
|
|
93
|
-
const
|
|
94
|
-
|
|
242
|
+
const e = t.headers.get("dpop-nonce");
|
|
243
|
+
e && fe.set(new URL(t.url).origin, e);
|
|
95
244
|
} catch {
|
|
96
245
|
}
|
|
97
|
-
return
|
|
246
|
+
return t;
|
|
98
247
|
}
|
|
99
|
-
function
|
|
100
|
-
return !(
|
|
248
|
+
function C(t) {
|
|
249
|
+
return !(t === null || typeof t != "object" || Array.isArray(t));
|
|
101
250
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
251
|
+
function W(t) {
|
|
252
|
+
q(t, Headers) && (t = Object.fromEntries(t.entries()));
|
|
253
|
+
const e = new Headers(t);
|
|
254
|
+
if (M && !e.has("user-agent") && e.set("user-agent", M), e.has("authorization"))
|
|
106
255
|
throw new TypeError('"options.headers" must not include the "authorization" header name');
|
|
107
|
-
if (
|
|
256
|
+
if (e.has("dpop"))
|
|
108
257
|
throw new TypeError('"options.headers" must not include the "dpop" header name');
|
|
109
|
-
return
|
|
258
|
+
return e;
|
|
110
259
|
}
|
|
111
|
-
function
|
|
112
|
-
if (typeof
|
|
260
|
+
function Z(t) {
|
|
261
|
+
if (typeof t == "function" && (t = t()), !(t instanceof AbortSignal))
|
|
113
262
|
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
114
|
-
return
|
|
263
|
+
return t;
|
|
115
264
|
}
|
|
116
|
-
async function
|
|
117
|
-
if (!(
|
|
265
|
+
async function Me(t, e) {
|
|
266
|
+
if (!(t instanceof URL))
|
|
118
267
|
throw new TypeError('"issuerIdentifier" must be an instance of URL');
|
|
119
|
-
if (
|
|
268
|
+
if (t.protocol !== "https:" && t.protocol !== "http:")
|
|
120
269
|
throw new TypeError('"issuer.protocol" must be "https:" or "http:"');
|
|
121
|
-
const n = new URL(
|
|
122
|
-
switch (
|
|
270
|
+
const n = new URL(t.href);
|
|
271
|
+
switch (e == null ? void 0 : e.algorithm) {
|
|
123
272
|
case void 0:
|
|
124
273
|
case "oidc":
|
|
125
274
|
n.pathname = `${n.pathname}/.well-known/openid-configuration`.replace("//", "/");
|
|
@@ -130,71 +279,71 @@ async function Ee(e, t) {
|
|
|
130
279
|
default:
|
|
131
280
|
throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
|
|
132
281
|
}
|
|
133
|
-
const r =
|
|
134
|
-
return r.set("accept", "application/json"), ((
|
|
282
|
+
const r = W(e == null ? void 0 : e.headers);
|
|
283
|
+
return r.set("accept", "application/json"), ((e == null ? void 0 : e[V]) || fetch)(n.href, {
|
|
135
284
|
headers: Object.fromEntries(r.entries()),
|
|
136
285
|
method: "GET",
|
|
137
286
|
redirect: "manual",
|
|
138
|
-
signal:
|
|
139
|
-
}).then(
|
|
287
|
+
signal: e != null && e.signal ? Z(e.signal) : null
|
|
288
|
+
}).then(Y);
|
|
140
289
|
}
|
|
141
|
-
function
|
|
142
|
-
return typeof
|
|
290
|
+
function w(t) {
|
|
291
|
+
return typeof t == "string" && t.length !== 0;
|
|
143
292
|
}
|
|
144
|
-
async function
|
|
145
|
-
if (!(
|
|
293
|
+
async function Be(t, e) {
|
|
294
|
+
if (!(t instanceof URL))
|
|
146
295
|
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
147
|
-
if (!
|
|
296
|
+
if (!q(e, Response))
|
|
148
297
|
throw new TypeError('"response" must be an instance of Response');
|
|
149
|
-
if (
|
|
150
|
-
throw new
|
|
151
|
-
|
|
298
|
+
if (e.status !== 200)
|
|
299
|
+
throw new a('"response" is not a conform Authorization Server Metadata response');
|
|
300
|
+
X(e);
|
|
152
301
|
let n;
|
|
153
302
|
try {
|
|
154
|
-
n = await
|
|
303
|
+
n = await e.json();
|
|
155
304
|
} catch (r) {
|
|
156
|
-
throw new
|
|
157
|
-
}
|
|
158
|
-
if (!
|
|
159
|
-
throw new
|
|
160
|
-
if (!
|
|
161
|
-
throw new
|
|
162
|
-
if (new URL(n.issuer).href !==
|
|
163
|
-
throw new
|
|
305
|
+
throw new a('failed to parse "response" body as JSON', { cause: r });
|
|
306
|
+
}
|
|
307
|
+
if (!C(n))
|
|
308
|
+
throw new a('"response" body must be a top level object');
|
|
309
|
+
if (!w(n.issuer))
|
|
310
|
+
throw new a('"response" body "issuer" property must be a non-empty string');
|
|
311
|
+
if (new URL(n.issuer).href !== t.href)
|
|
312
|
+
throw new a('"response" body "issuer" does not match "expectedIssuer"');
|
|
164
313
|
return n;
|
|
165
314
|
}
|
|
166
|
-
function
|
|
167
|
-
return
|
|
315
|
+
function D() {
|
|
316
|
+
return T(crypto.getRandomValues(new Uint8Array(32)));
|
|
168
317
|
}
|
|
169
|
-
function
|
|
170
|
-
return
|
|
318
|
+
function Ge() {
|
|
319
|
+
return D();
|
|
171
320
|
}
|
|
172
|
-
function
|
|
173
|
-
return
|
|
321
|
+
function qe() {
|
|
322
|
+
return D();
|
|
174
323
|
}
|
|
175
|
-
async function
|
|
176
|
-
if (!
|
|
324
|
+
async function Ve(t) {
|
|
325
|
+
if (!w(t))
|
|
177
326
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
178
|
-
return
|
|
327
|
+
return T(await crypto.subtle.digest("SHA-256", E(t)));
|
|
179
328
|
}
|
|
180
|
-
function
|
|
181
|
-
if (
|
|
182
|
-
return { key:
|
|
183
|
-
if (!((
|
|
329
|
+
function Ye(t) {
|
|
330
|
+
if (t instanceof CryptoKey)
|
|
331
|
+
return { key: t };
|
|
332
|
+
if (!((t == null ? void 0 : t.key) instanceof CryptoKey))
|
|
184
333
|
return {};
|
|
185
|
-
if (
|
|
334
|
+
if (t.kid !== void 0 && !w(t.kid))
|
|
186
335
|
throw new TypeError('"kid" must be a non-empty string');
|
|
187
|
-
return { key:
|
|
336
|
+
return { key: t.key, kid: t.kid };
|
|
188
337
|
}
|
|
189
|
-
function
|
|
190
|
-
return encodeURIComponent(
|
|
338
|
+
function se(t) {
|
|
339
|
+
return encodeURIComponent(t).replace(/%20/g, "+");
|
|
191
340
|
}
|
|
192
|
-
function
|
|
193
|
-
const n =
|
|
341
|
+
function Ze(t, e) {
|
|
342
|
+
const n = se(t), r = se(e);
|
|
194
343
|
return `Basic ${btoa(`${n}:${r}`)}`;
|
|
195
344
|
}
|
|
196
|
-
function
|
|
197
|
-
switch (
|
|
345
|
+
function Qe(t) {
|
|
346
|
+
switch (t.algorithm.hash.name) {
|
|
198
347
|
case "SHA-256":
|
|
199
348
|
return "PS256";
|
|
200
349
|
case "SHA-384":
|
|
@@ -202,11 +351,11 @@ function je(e) {
|
|
|
202
351
|
case "SHA-512":
|
|
203
352
|
return "PS512";
|
|
204
353
|
default:
|
|
205
|
-
throw new
|
|
354
|
+
throw new S("unsupported RsaHashedKeyAlgorithm hash name");
|
|
206
355
|
}
|
|
207
356
|
}
|
|
208
|
-
function
|
|
209
|
-
switch (
|
|
357
|
+
function Xe(t) {
|
|
358
|
+
switch (t.algorithm.hash.name) {
|
|
210
359
|
case "SHA-256":
|
|
211
360
|
return "RS256";
|
|
212
361
|
case "SHA-384":
|
|
@@ -214,11 +363,11 @@ function Ue(e) {
|
|
|
214
363
|
case "SHA-512":
|
|
215
364
|
return "RS512";
|
|
216
365
|
default:
|
|
217
|
-
throw new
|
|
366
|
+
throw new S("unsupported RsaHashedKeyAlgorithm hash name");
|
|
218
367
|
}
|
|
219
368
|
}
|
|
220
|
-
function
|
|
221
|
-
switch (
|
|
369
|
+
function et(t) {
|
|
370
|
+
switch (t.algorithm.namedCurve) {
|
|
222
371
|
case "P-256":
|
|
223
372
|
return "ES256";
|
|
224
373
|
case "P-384":
|
|
@@ -226,281 +375,281 @@ function Ce(e) {
|
|
|
226
375
|
case "P-521":
|
|
227
376
|
return "ES512";
|
|
228
377
|
default:
|
|
229
|
-
throw new
|
|
378
|
+
throw new S("unsupported EcKeyAlgorithm namedCurve");
|
|
230
379
|
}
|
|
231
380
|
}
|
|
232
|
-
function
|
|
233
|
-
switch (
|
|
381
|
+
function ge(t) {
|
|
382
|
+
switch (t.algorithm.name) {
|
|
234
383
|
case "RSA-PSS":
|
|
235
|
-
return
|
|
384
|
+
return Qe(t);
|
|
236
385
|
case "RSASSA-PKCS1-v1_5":
|
|
237
|
-
return
|
|
386
|
+
return Xe(t);
|
|
238
387
|
case "ECDSA":
|
|
239
|
-
return
|
|
388
|
+
return et(t);
|
|
240
389
|
case "Ed25519":
|
|
241
390
|
case "Ed448":
|
|
242
391
|
return "EdDSA";
|
|
243
392
|
default:
|
|
244
|
-
throw new
|
|
393
|
+
throw new S("unsupported CryptoKey algorithm name");
|
|
245
394
|
}
|
|
246
395
|
}
|
|
247
|
-
function
|
|
248
|
-
const
|
|
249
|
-
return typeof
|
|
396
|
+
function H(t) {
|
|
397
|
+
const e = t == null ? void 0 : t[K];
|
|
398
|
+
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
250
399
|
}
|
|
251
|
-
function
|
|
252
|
-
const
|
|
253
|
-
return typeof
|
|
400
|
+
function tt(t) {
|
|
401
|
+
const e = t == null ? void 0 : t[Oe];
|
|
402
|
+
return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
|
|
254
403
|
}
|
|
255
|
-
function
|
|
404
|
+
function Q() {
|
|
256
405
|
return Math.floor(Date.now() / 1e3);
|
|
257
406
|
}
|
|
258
|
-
function
|
|
259
|
-
const n =
|
|
407
|
+
function nt(t, e) {
|
|
408
|
+
const n = Q() + H(e);
|
|
260
409
|
return {
|
|
261
|
-
jti:
|
|
262
|
-
aud: [
|
|
410
|
+
jti: D(),
|
|
411
|
+
aud: [t.issuer, t.token_endpoint],
|
|
263
412
|
exp: n + 60,
|
|
264
413
|
iat: n,
|
|
265
414
|
nbf: n,
|
|
266
|
-
iss:
|
|
267
|
-
sub:
|
|
415
|
+
iss: e.client_id,
|
|
416
|
+
sub: e.client_id
|
|
268
417
|
};
|
|
269
418
|
}
|
|
270
|
-
async function
|
|
271
|
-
return
|
|
272
|
-
alg:
|
|
419
|
+
async function rt(t, e, n, r) {
|
|
420
|
+
return me({
|
|
421
|
+
alg: ge(n),
|
|
273
422
|
kid: r
|
|
274
|
-
},
|
|
423
|
+
}, nt(t, e), n);
|
|
275
424
|
}
|
|
276
|
-
function
|
|
277
|
-
if (typeof
|
|
425
|
+
function j(t) {
|
|
426
|
+
if (typeof t != "object" || t === null)
|
|
278
427
|
throw new TypeError('"as" must be an object');
|
|
279
|
-
if (!
|
|
428
|
+
if (!w(t.issuer))
|
|
280
429
|
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
281
430
|
return !0;
|
|
282
431
|
}
|
|
283
|
-
function
|
|
284
|
-
if (typeof
|
|
432
|
+
function I(t) {
|
|
433
|
+
if (typeof t != "object" || t === null)
|
|
285
434
|
throw new TypeError('"client" must be an object');
|
|
286
|
-
if (!
|
|
435
|
+
if (!w(t.client_id))
|
|
287
436
|
throw new TypeError('"client.client_id" property must be a non-empty string');
|
|
288
437
|
return !0;
|
|
289
438
|
}
|
|
290
|
-
function
|
|
291
|
-
if (!
|
|
439
|
+
function ae(t) {
|
|
440
|
+
if (!w(t))
|
|
292
441
|
throw new TypeError('"client.client_secret" property must be a non-empty string');
|
|
293
|
-
return
|
|
442
|
+
return t;
|
|
294
443
|
}
|
|
295
|
-
function
|
|
296
|
-
if (
|
|
297
|
-
throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${
|
|
444
|
+
function F(t, e) {
|
|
445
|
+
if (e !== void 0)
|
|
446
|
+
throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${t} client authentication method is used.`);
|
|
298
447
|
}
|
|
299
|
-
function
|
|
300
|
-
if (
|
|
301
|
-
throw new TypeError(`"client.client_secret" property must not be provided when ${
|
|
448
|
+
function ce(t, e) {
|
|
449
|
+
if (e !== void 0)
|
|
450
|
+
throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
|
|
302
451
|
}
|
|
303
|
-
async function
|
|
304
|
-
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"),
|
|
452
|
+
async function ot(t, e, n, r, s) {
|
|
453
|
+
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
|
|
305
454
|
case void 0:
|
|
306
455
|
case "client_secret_basic": {
|
|
307
|
-
|
|
456
|
+
F("client_secret_basic", s), r.set("authorization", Ze(e.client_id, ae(e.client_secret)));
|
|
308
457
|
break;
|
|
309
458
|
}
|
|
310
459
|
case "client_secret_post": {
|
|
311
|
-
|
|
460
|
+
F("client_secret_post", s), n.set("client_id", e.client_id), n.set("client_secret", ae(e.client_secret));
|
|
312
461
|
break;
|
|
313
462
|
}
|
|
314
463
|
case "private_key_jwt": {
|
|
315
|
-
if (
|
|
464
|
+
if (ce("private_key_jwt", e.client_secret), s === void 0)
|
|
316
465
|
throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
|
|
317
|
-
const { key:
|
|
318
|
-
if (!
|
|
466
|
+
const { key: o, kid: i } = Ye(s);
|
|
467
|
+
if (!we(o))
|
|
319
468
|
throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
|
|
320
|
-
n.set("client_id",
|
|
469
|
+
n.set("client_id", e.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await rt(t, e, o, i));
|
|
321
470
|
break;
|
|
322
471
|
}
|
|
323
472
|
case "tls_client_auth":
|
|
324
473
|
case "self_signed_tls_client_auth":
|
|
325
474
|
case "none": {
|
|
326
|
-
|
|
475
|
+
ce(e.token_endpoint_auth_method, e.client_secret), F(e.token_endpoint_auth_method, s), n.set("client_id", e.client_id);
|
|
327
476
|
break;
|
|
328
477
|
}
|
|
329
478
|
default:
|
|
330
|
-
throw new
|
|
479
|
+
throw new S("unsupported client token_endpoint_auth_method");
|
|
331
480
|
}
|
|
332
481
|
}
|
|
333
|
-
async function
|
|
482
|
+
async function me(t, e, n) {
|
|
334
483
|
if (!n.usages.includes("sign"))
|
|
335
484
|
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
336
|
-
const r = `${
|
|
337
|
-
return `${r}.${
|
|
485
|
+
const r = `${T(E(JSON.stringify(t)))}.${T(E(JSON.stringify(e)))}`, s = T(await crypto.subtle.sign(Se(n), n, E(r)));
|
|
486
|
+
return `${r}.${s}`;
|
|
338
487
|
}
|
|
339
|
-
async function
|
|
340
|
-
const { privateKey:
|
|
341
|
-
if (!
|
|
488
|
+
async function it(t, e, n, r, s, o) {
|
|
489
|
+
const { privateKey: i, publicKey: u, nonce: g = fe.get(n.origin) } = e;
|
|
490
|
+
if (!we(i))
|
|
342
491
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
343
|
-
if (!
|
|
492
|
+
if (!Fe(u))
|
|
344
493
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
345
|
-
if (
|
|
494
|
+
if (g !== void 0 && !w(g))
|
|
346
495
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
347
|
-
if (!
|
|
496
|
+
if (!u.extractable)
|
|
348
497
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
349
|
-
const
|
|
350
|
-
alg:
|
|
498
|
+
const m = Q() + s, b = await me({
|
|
499
|
+
alg: ge(i),
|
|
351
500
|
typ: "dpop+jwt",
|
|
352
|
-
jwk: await
|
|
501
|
+
jwk: await at(u)
|
|
353
502
|
}, {
|
|
354
|
-
iat:
|
|
355
|
-
jti:
|
|
503
|
+
iat: m,
|
|
504
|
+
jti: D(),
|
|
356
505
|
htm: r,
|
|
357
|
-
nonce:
|
|
506
|
+
nonce: g,
|
|
358
507
|
htu: `${n.origin}${n.pathname}`,
|
|
359
|
-
ath:
|
|
360
|
-
},
|
|
361
|
-
|
|
508
|
+
ath: o ? T(await crypto.subtle.digest("SHA-256", E(o))) : void 0
|
|
509
|
+
}, i);
|
|
510
|
+
t.set("dpop", b);
|
|
362
511
|
}
|
|
363
|
-
let
|
|
364
|
-
async function
|
|
365
|
-
const { kty:
|
|
366
|
-
return
|
|
512
|
+
let N;
|
|
513
|
+
async function st(t) {
|
|
514
|
+
const { kty: e, e: n, n: r, x: s, y: o, crv: i } = await crypto.subtle.exportKey("jwk", t), u = { kty: e, e: n, n: r, x: s, y: o, crv: i };
|
|
515
|
+
return N.set(t, u), u;
|
|
367
516
|
}
|
|
368
|
-
async function
|
|
369
|
-
return
|
|
517
|
+
async function at(t) {
|
|
518
|
+
return N || (N = /* @__PURE__ */ new WeakMap()), N.get(t) || st(t);
|
|
370
519
|
}
|
|
371
|
-
function
|
|
372
|
-
if (typeof
|
|
373
|
-
throw new TypeError(`"as.${
|
|
374
|
-
return new URL(
|
|
520
|
+
function ct(t, e, n) {
|
|
521
|
+
if (typeof t != "string")
|
|
522
|
+
throw new TypeError(`"as.${e}" must be a string`);
|
|
523
|
+
return new URL(t);
|
|
375
524
|
}
|
|
376
|
-
function
|
|
377
|
-
return
|
|
525
|
+
function ye(t, e, n) {
|
|
526
|
+
return ct(t[e], e);
|
|
378
527
|
}
|
|
379
|
-
function
|
|
380
|
-
const
|
|
381
|
-
return typeof
|
|
528
|
+
function B(t) {
|
|
529
|
+
const e = t;
|
|
530
|
+
return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
|
|
382
531
|
}
|
|
383
|
-
async function
|
|
384
|
-
if (!
|
|
532
|
+
async function ut(t, e, n, r, s, o) {
|
|
533
|
+
if (!w(t))
|
|
385
534
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
386
535
|
if (!(n instanceof URL))
|
|
387
536
|
throw new TypeError('"url" must be an instance of URL');
|
|
388
|
-
return r =
|
|
389
|
-
body:
|
|
537
|
+
return r = W(r), (o == null ? void 0 : o.DPoP) === void 0 ? r.set("authorization", `Bearer ${t}`) : (await it(r, o.DPoP, n, "GET", H({ [K]: o == null ? void 0 : o[K] }), t), r.set("authorization", `DPoP ${t}`)), ((o == null ? void 0 : o[V]) || fetch)(n.href, {
|
|
538
|
+
body: s,
|
|
390
539
|
headers: Object.fromEntries(r.entries()),
|
|
391
|
-
method:
|
|
540
|
+
method: e,
|
|
392
541
|
redirect: "manual",
|
|
393
|
-
signal:
|
|
394
|
-
}).then(
|
|
542
|
+
signal: o != null && o.signal ? Z(o.signal) : null
|
|
543
|
+
}).then(Y);
|
|
395
544
|
}
|
|
396
|
-
async function
|
|
397
|
-
|
|
398
|
-
const
|
|
399
|
-
return
|
|
545
|
+
async function lt(t, e, n, r) {
|
|
546
|
+
j(t), I(e);
|
|
547
|
+
const s = ye(t, "userinfo_endpoint"), o = W(r == null ? void 0 : r.headers);
|
|
548
|
+
return e.userinfo_signed_response_alg ? o.set("accept", "application/jwt") : (o.set("accept", "application/json"), o.append("accept", "application/jwt")), ut(n, "GET", s, o, null, {
|
|
400
549
|
...r,
|
|
401
|
-
[
|
|
550
|
+
[K]: H(e)
|
|
402
551
|
});
|
|
403
552
|
}
|
|
404
|
-
async function
|
|
405
|
-
return await
|
|
406
|
-
body:
|
|
407
|
-
headers: Object.fromEntries(
|
|
553
|
+
async function dt(t, e, n, r, s, o, i) {
|
|
554
|
+
return await ot(t, e, s, o, i == null ? void 0 : i.clientPrivateKey), o.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[V]) || fetch)(r.href, {
|
|
555
|
+
body: s,
|
|
556
|
+
headers: Object.fromEntries(o.entries()),
|
|
408
557
|
method: n,
|
|
409
558
|
redirect: "manual",
|
|
410
|
-
signal:
|
|
411
|
-
}).then(
|
|
559
|
+
signal: i != null && i.signal ? Z(i.signal) : null
|
|
560
|
+
}).then(Y);
|
|
412
561
|
}
|
|
413
|
-
async function
|
|
414
|
-
const
|
|
562
|
+
async function _e(t, e, n, r, s) {
|
|
563
|
+
const o = ye(t, "token_endpoint");
|
|
415
564
|
r.set("grant_type", n);
|
|
416
|
-
const
|
|
417
|
-
return
|
|
565
|
+
const i = W(s == null ? void 0 : s.headers);
|
|
566
|
+
return i.set("accept", "application/json"), dt(t, e, "POST", o, r, i, s);
|
|
418
567
|
}
|
|
419
|
-
async function
|
|
420
|
-
if (
|
|
568
|
+
async function ht(t, e, n, r) {
|
|
569
|
+
if (j(t), I(e), !w(n))
|
|
421
570
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
422
|
-
const
|
|
423
|
-
return
|
|
571
|
+
const s = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
|
|
572
|
+
return s.set("refresh_token", n), _e(t, e, "refresh_token", s, r);
|
|
424
573
|
}
|
|
425
|
-
const
|
|
426
|
-
async function
|
|
427
|
-
if (
|
|
574
|
+
const ft = /* @__PURE__ */ new WeakMap();
|
|
575
|
+
async function be(t, e, n, r = !1, s = !1) {
|
|
576
|
+
if (j(t), I(e), !q(n, Response))
|
|
428
577
|
throw new TypeError('"response" must be an instance of Response');
|
|
429
578
|
if (n.status !== 200) {
|
|
430
|
-
let
|
|
431
|
-
if (
|
|
432
|
-
return
|
|
433
|
-
throw new
|
|
579
|
+
let i;
|
|
580
|
+
if (i = await St(n))
|
|
581
|
+
return i;
|
|
582
|
+
throw new a('"response" is not a conform Token Endpoint response');
|
|
434
583
|
}
|
|
435
|
-
|
|
436
|
-
let
|
|
584
|
+
X(n);
|
|
585
|
+
let o;
|
|
437
586
|
try {
|
|
438
|
-
|
|
439
|
-
} catch (
|
|
440
|
-
throw new
|
|
441
|
-
}
|
|
442
|
-
if (!
|
|
443
|
-
throw new
|
|
444
|
-
if (!
|
|
445
|
-
throw new
|
|
446
|
-
if (!
|
|
447
|
-
throw new
|
|
448
|
-
if (
|
|
449
|
-
throw new
|
|
450
|
-
if (
|
|
451
|
-
throw new
|
|
452
|
-
if (!
|
|
453
|
-
throw new
|
|
454
|
-
if (
|
|
455
|
-
throw new
|
|
587
|
+
o = await n.json();
|
|
588
|
+
} catch (i) {
|
|
589
|
+
throw new a('failed to parse "response" body as JSON', { cause: i });
|
|
590
|
+
}
|
|
591
|
+
if (!C(o))
|
|
592
|
+
throw new a('"response" body must be a top level object');
|
|
593
|
+
if (!w(o.access_token))
|
|
594
|
+
throw new a('"response" body "access_token" property must be a non-empty string');
|
|
595
|
+
if (!w(o.token_type))
|
|
596
|
+
throw new a('"response" body "token_type" property must be a non-empty string');
|
|
597
|
+
if (o.token_type = o.token_type.toLowerCase(), o.token_type !== "dpop" && o.token_type !== "bearer")
|
|
598
|
+
throw new S("unsupported `token_type` value");
|
|
599
|
+
if (o.expires_in !== void 0 && (typeof o.expires_in != "number" || o.expires_in <= 0))
|
|
600
|
+
throw new a('"response" body "expires_in" property must be a positive number');
|
|
601
|
+
if (!s && o.refresh_token !== void 0 && !w(o.refresh_token))
|
|
602
|
+
throw new a('"response" body "refresh_token" property must be a non-empty string');
|
|
603
|
+
if (o.scope !== void 0 && typeof o.scope != "string")
|
|
604
|
+
throw new a('"response" body "scope" property must be a string');
|
|
456
605
|
if (!r) {
|
|
457
|
-
if (
|
|
458
|
-
throw new
|
|
459
|
-
if (
|
|
460
|
-
const { claims:
|
|
461
|
-
if (Array.isArray(
|
|
462
|
-
throw new
|
|
463
|
-
if (
|
|
464
|
-
throw new
|
|
465
|
-
|
|
606
|
+
if (o.id_token !== void 0 && !w(o.id_token))
|
|
607
|
+
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
608
|
+
if (o.id_token) {
|
|
609
|
+
const { claims: i } = await Tt(o.id_token, At.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), ke, H(e), tt(e)).then(bt.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(gt.bind(void 0, t.issuer)).then(wt.bind(void 0, e.client_id));
|
|
610
|
+
if (Array.isArray(i.aud) && i.aud.length !== 1 && i.azp !== e.client_id)
|
|
611
|
+
throw new a('unexpected ID Token "azp" (authorized party) claim value');
|
|
612
|
+
if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
|
|
613
|
+
throw new a('ID Token "auth_time" (authentication time) must be a positive number');
|
|
614
|
+
ft.set(o, i);
|
|
466
615
|
}
|
|
467
616
|
}
|
|
468
|
-
return
|
|
617
|
+
return o;
|
|
469
618
|
}
|
|
470
|
-
async function
|
|
471
|
-
return
|
|
619
|
+
async function pt(t, e, n) {
|
|
620
|
+
return be(t, e, n);
|
|
472
621
|
}
|
|
473
|
-
function
|
|
474
|
-
if (Array.isArray(
|
|
475
|
-
if (!
|
|
476
|
-
throw new
|
|
477
|
-
} else if (
|
|
478
|
-
throw new
|
|
479
|
-
return
|
|
622
|
+
function wt(t, e) {
|
|
623
|
+
if (Array.isArray(e.claims.aud)) {
|
|
624
|
+
if (!e.claims.aud.includes(t))
|
|
625
|
+
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
626
|
+
} else if (e.claims.aud !== t)
|
|
627
|
+
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
628
|
+
return e;
|
|
480
629
|
}
|
|
481
|
-
function
|
|
482
|
-
if (
|
|
483
|
-
throw new
|
|
484
|
-
return
|
|
630
|
+
function gt(t, e) {
|
|
631
|
+
if (e.claims.iss !== t)
|
|
632
|
+
throw new a('unexpected JWT "iss" (issuer) claim value');
|
|
633
|
+
return e;
|
|
485
634
|
}
|
|
486
|
-
const
|
|
487
|
-
function
|
|
488
|
-
return
|
|
635
|
+
const ve = /* @__PURE__ */ new WeakSet();
|
|
636
|
+
function mt(t) {
|
|
637
|
+
return ve.add(t), t;
|
|
489
638
|
}
|
|
490
|
-
async function
|
|
491
|
-
if (
|
|
639
|
+
async function yt(t, e, n, r, s, o) {
|
|
640
|
+
if (j(t), I(e), !ve.has(n))
|
|
492
641
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
493
|
-
if (!
|
|
642
|
+
if (!w(r))
|
|
494
643
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
495
|
-
if (!
|
|
644
|
+
if (!w(s))
|
|
496
645
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
497
|
-
const
|
|
498
|
-
if (!
|
|
499
|
-
throw new
|
|
500
|
-
const
|
|
501
|
-
return
|
|
646
|
+
const i = k(n, "code");
|
|
647
|
+
if (!i)
|
|
648
|
+
throw new a('no authorization code in "callbackParameters"');
|
|
649
|
+
const u = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
|
|
650
|
+
return u.set("redirect_uri", r), u.set("code_verifier", s), u.set("code", i), _e(t, e, "authorization_code", u, o);
|
|
502
651
|
}
|
|
503
|
-
const
|
|
652
|
+
const _t = {
|
|
504
653
|
aud: "audience",
|
|
505
654
|
c_hash: "code hash",
|
|
506
655
|
client_id: "client id",
|
|
@@ -516,44 +665,44 @@ const Ze = {
|
|
|
516
665
|
htu: "http uri",
|
|
517
666
|
cnf: "confirmation"
|
|
518
667
|
};
|
|
519
|
-
function
|
|
520
|
-
for (const n of
|
|
521
|
-
if (
|
|
522
|
-
throw new
|
|
523
|
-
return
|
|
668
|
+
function bt(t, e) {
|
|
669
|
+
for (const n of t)
|
|
670
|
+
if (e.claims[n] === void 0)
|
|
671
|
+
throw new a(`JWT "${n}" (${_t[n]}) claim missing`);
|
|
672
|
+
return e;
|
|
524
673
|
}
|
|
525
|
-
async function
|
|
526
|
-
const r = await
|
|
527
|
-
if (
|
|
674
|
+
async function vt(t, e, n) {
|
|
675
|
+
const r = await be(t, e, n, !0);
|
|
676
|
+
if (B(r))
|
|
528
677
|
return r;
|
|
529
678
|
if (r.id_token !== void 0) {
|
|
530
679
|
if (typeof r.id_token == "string" && r.id_token.length)
|
|
531
|
-
throw new
|
|
680
|
+
throw new a("Unexpected ID Token returned, use processAuthorizationCodeOpenIDResponse() for OpenID Connect callback processing");
|
|
532
681
|
delete r.id_token;
|
|
533
682
|
}
|
|
534
683
|
return r;
|
|
535
684
|
}
|
|
536
|
-
function
|
|
537
|
-
if (
|
|
685
|
+
function X(t) {
|
|
686
|
+
if (t.bodyUsed)
|
|
538
687
|
throw new TypeError('"response" body has been used already');
|
|
539
688
|
}
|
|
540
|
-
async function
|
|
541
|
-
if (
|
|
542
|
-
|
|
689
|
+
async function St(t) {
|
|
690
|
+
if (t.status > 399 && t.status < 500) {
|
|
691
|
+
X(t);
|
|
543
692
|
try {
|
|
544
|
-
const
|
|
545
|
-
if (
|
|
546
|
-
return
|
|
693
|
+
const e = await t.json();
|
|
694
|
+
if (C(e) && typeof e.error == "string" && e.error.length)
|
|
695
|
+
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;
|
|
547
696
|
} catch {
|
|
548
697
|
}
|
|
549
698
|
}
|
|
550
699
|
}
|
|
551
|
-
function
|
|
552
|
-
if (typeof
|
|
553
|
-
throw new
|
|
700
|
+
function ue(t) {
|
|
701
|
+
if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
|
|
702
|
+
throw new a(`${t.name} modulusLength must be at least 2048 bits`);
|
|
554
703
|
}
|
|
555
|
-
function
|
|
556
|
-
switch (
|
|
704
|
+
function kt(t) {
|
|
705
|
+
switch (t) {
|
|
557
706
|
case "P-256":
|
|
558
707
|
return "SHA-256";
|
|
559
708
|
case "P-384":
|
|
@@ -561,249 +710,269 @@ function tt(e) {
|
|
|
561
710
|
case "P-521":
|
|
562
711
|
return "SHA-512";
|
|
563
712
|
default:
|
|
564
|
-
throw new
|
|
713
|
+
throw new S();
|
|
565
714
|
}
|
|
566
715
|
}
|
|
567
|
-
function
|
|
568
|
-
switch (
|
|
716
|
+
function Se(t) {
|
|
717
|
+
switch (t.algorithm.name) {
|
|
569
718
|
case "ECDSA":
|
|
570
719
|
return {
|
|
571
|
-
name:
|
|
572
|
-
hash:
|
|
720
|
+
name: t.algorithm.name,
|
|
721
|
+
hash: kt(t.algorithm.namedCurve)
|
|
573
722
|
};
|
|
574
723
|
case "RSA-PSS":
|
|
575
|
-
switch (
|
|
724
|
+
switch (ue(t.algorithm), t.algorithm.hash.name) {
|
|
576
725
|
case "SHA-256":
|
|
577
726
|
case "SHA-384":
|
|
578
727
|
case "SHA-512":
|
|
579
728
|
return {
|
|
580
|
-
name:
|
|
581
|
-
saltLength: parseInt(
|
|
729
|
+
name: t.algorithm.name,
|
|
730
|
+
saltLength: parseInt(t.algorithm.hash.name.slice(-3), 10) >> 3
|
|
582
731
|
};
|
|
583
732
|
default:
|
|
584
|
-
throw new
|
|
733
|
+
throw new S();
|
|
585
734
|
}
|
|
586
735
|
case "RSASSA-PKCS1-v1_5":
|
|
587
|
-
return
|
|
736
|
+
return ue(t.algorithm), t.algorithm.name;
|
|
588
737
|
case "Ed448":
|
|
589
738
|
case "Ed25519":
|
|
590
|
-
return
|
|
591
|
-
}
|
|
592
|
-
throw new
|
|
593
|
-
}
|
|
594
|
-
const
|
|
595
|
-
async function
|
|
596
|
-
const { 0:
|
|
597
|
-
if (
|
|
598
|
-
throw new
|
|
599
|
-
if (
|
|
600
|
-
throw new
|
|
601
|
-
let
|
|
739
|
+
return t.algorithm.name;
|
|
740
|
+
}
|
|
741
|
+
throw new S();
|
|
742
|
+
}
|
|
743
|
+
const ke = Symbol();
|
|
744
|
+
async function Tt(t, e, n, r, s) {
|
|
745
|
+
const { 0: o, 1: i, 2: u, length: g } = t.split(".");
|
|
746
|
+
if (g === 5)
|
|
747
|
+
throw new S("JWE structure JWTs are not supported");
|
|
748
|
+
if (g !== 3)
|
|
749
|
+
throw new a("Invalid JWT");
|
|
750
|
+
let m;
|
|
602
751
|
try {
|
|
603
|
-
|
|
604
|
-
} catch (
|
|
605
|
-
throw new
|
|
606
|
-
}
|
|
607
|
-
if (!
|
|
608
|
-
throw new
|
|
609
|
-
if (
|
|
610
|
-
throw new
|
|
611
|
-
const
|
|
612
|
-
let
|
|
613
|
-
if (n !==
|
|
614
|
-
|
|
615
|
-
const
|
|
616
|
-
if (!await crypto.subtle.verify(
|
|
617
|
-
throw new
|
|
618
|
-
}
|
|
619
|
-
let
|
|
752
|
+
m = JSON.parse(E(T(o)));
|
|
753
|
+
} catch (R) {
|
|
754
|
+
throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: R });
|
|
755
|
+
}
|
|
756
|
+
if (!C(m))
|
|
757
|
+
throw new a("JWT Header must be a top level object");
|
|
758
|
+
if (e(m), m.crit !== void 0)
|
|
759
|
+
throw new a('unexpected JWT "crit" header parameter');
|
|
760
|
+
const b = T(u);
|
|
761
|
+
let _;
|
|
762
|
+
if (n !== ke) {
|
|
763
|
+
_ = await n(m);
|
|
764
|
+
const R = `${o}.${i}`;
|
|
765
|
+
if (!await crypto.subtle.verify(Se(_), _, b, E(R)))
|
|
766
|
+
throw new a("JWT signature verification failed");
|
|
767
|
+
}
|
|
768
|
+
let h;
|
|
620
769
|
try {
|
|
621
|
-
|
|
622
|
-
} catch (
|
|
623
|
-
throw new
|
|
624
|
-
}
|
|
625
|
-
if (!
|
|
626
|
-
throw new
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
629
|
-
if (typeof
|
|
630
|
-
throw new
|
|
631
|
-
if (
|
|
632
|
-
throw new
|
|
633
|
-
}
|
|
634
|
-
if (
|
|
635
|
-
throw new
|
|
636
|
-
if (
|
|
637
|
-
throw new
|
|
638
|
-
if (
|
|
639
|
-
if (typeof
|
|
640
|
-
throw new
|
|
641
|
-
if (
|
|
642
|
-
throw new
|
|
643
|
-
}
|
|
644
|
-
if (
|
|
645
|
-
throw new
|
|
646
|
-
return { header:
|
|
647
|
-
}
|
|
648
|
-
function
|
|
649
|
-
if (
|
|
650
|
-
if (n.alg !==
|
|
651
|
-
throw new
|
|
770
|
+
h = JSON.parse(E(T(i)));
|
|
771
|
+
} catch (R) {
|
|
772
|
+
throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: R });
|
|
773
|
+
}
|
|
774
|
+
if (!C(h))
|
|
775
|
+
throw new a("JWT Payload must be a top level object");
|
|
776
|
+
const U = Q() + r;
|
|
777
|
+
if (h.exp !== void 0) {
|
|
778
|
+
if (typeof h.exp != "number")
|
|
779
|
+
throw new a('unexpected JWT "exp" (expiration time) claim type');
|
|
780
|
+
if (h.exp <= U - s)
|
|
781
|
+
throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
|
|
782
|
+
}
|
|
783
|
+
if (h.iat !== void 0 && typeof h.iat != "number")
|
|
784
|
+
throw new a('unexpected JWT "iat" (issued at) claim type');
|
|
785
|
+
if (h.iss !== void 0 && typeof h.iss != "string")
|
|
786
|
+
throw new a('unexpected JWT "iss" (issuer) claim type');
|
|
787
|
+
if (h.nbf !== void 0) {
|
|
788
|
+
if (typeof h.nbf != "number")
|
|
789
|
+
throw new a('unexpected JWT "nbf" (not before) claim type');
|
|
790
|
+
if (h.nbf > U + s)
|
|
791
|
+
throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
|
|
792
|
+
}
|
|
793
|
+
if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
|
|
794
|
+
throw new a('unexpected JWT "aud" (audience) claim type');
|
|
795
|
+
return { header: m, claims: h, signature: b, key: _ };
|
|
796
|
+
}
|
|
797
|
+
function At(t, e, n) {
|
|
798
|
+
if (t !== void 0) {
|
|
799
|
+
if (n.alg !== t)
|
|
800
|
+
throw new a('unexpected JWT "alg" header parameter');
|
|
652
801
|
return;
|
|
653
802
|
}
|
|
654
|
-
if (Array.isArray(
|
|
655
|
-
if (!
|
|
656
|
-
throw new
|
|
803
|
+
if (Array.isArray(e)) {
|
|
804
|
+
if (!e.includes(n.alg))
|
|
805
|
+
throw new a('unexpected JWT "alg" header parameter');
|
|
657
806
|
return;
|
|
658
807
|
}
|
|
659
808
|
if (n.alg !== "RS256")
|
|
660
|
-
throw new
|
|
809
|
+
throw new a('unexpected JWT "alg" header parameter');
|
|
661
810
|
}
|
|
662
|
-
function
|
|
663
|
-
const { 0: n, length: r } =
|
|
811
|
+
function k(t, e) {
|
|
812
|
+
const { 0: n, length: r } = t.getAll(e);
|
|
664
813
|
if (r > 1)
|
|
665
|
-
throw new
|
|
814
|
+
throw new a(`"${e}" parameter must be provided only once`);
|
|
666
815
|
return n;
|
|
667
816
|
}
|
|
668
|
-
const
|
|
669
|
-
function
|
|
670
|
-
if (
|
|
817
|
+
const Et = Symbol(), Rt = Symbol();
|
|
818
|
+
function Pt(t, e, n, r) {
|
|
819
|
+
if (j(t), I(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
671
820
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
672
|
-
if (
|
|
673
|
-
throw new
|
|
674
|
-
const
|
|
675
|
-
if (!
|
|
676
|
-
throw new
|
|
677
|
-
if (
|
|
678
|
-
throw new
|
|
821
|
+
if (k(n, "response"))
|
|
822
|
+
throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
823
|
+
const s = k(n, "iss"), o = k(n, "state");
|
|
824
|
+
if (!s && t.authorization_response_iss_parameter_supported)
|
|
825
|
+
throw new a('response parameter "iss" (issuer) missing');
|
|
826
|
+
if (s && s !== t.issuer)
|
|
827
|
+
throw new a('unexpected "iss" (issuer) response parameter value');
|
|
679
828
|
switch (r) {
|
|
680
829
|
case void 0:
|
|
681
|
-
case
|
|
682
|
-
if (
|
|
683
|
-
throw new
|
|
830
|
+
case Rt:
|
|
831
|
+
if (o !== void 0)
|
|
832
|
+
throw new a('unexpected "state" response parameter encountered');
|
|
684
833
|
break;
|
|
685
|
-
case
|
|
834
|
+
case Et:
|
|
686
835
|
break;
|
|
687
836
|
default:
|
|
688
|
-
if (!
|
|
689
|
-
throw new
|
|
690
|
-
if (
|
|
691
|
-
throw new
|
|
692
|
-
if (
|
|
693
|
-
throw new
|
|
694
|
-
}
|
|
695
|
-
const
|
|
696
|
-
if (
|
|
837
|
+
if (!w(r))
|
|
838
|
+
throw new a('"expectedState" must be a non-empty string');
|
|
839
|
+
if (o === void 0)
|
|
840
|
+
throw new a('response parameter "state" missing');
|
|
841
|
+
if (o !== r)
|
|
842
|
+
throw new a('unexpected "state" response parameter value');
|
|
843
|
+
}
|
|
844
|
+
const i = k(n, "error");
|
|
845
|
+
if (i)
|
|
697
846
|
return {
|
|
698
|
-
error:
|
|
699
|
-
error_description:
|
|
700
|
-
error_uri:
|
|
847
|
+
error: i,
|
|
848
|
+
error_description: k(n, "error_description"),
|
|
849
|
+
error_uri: k(n, "error_uri")
|
|
701
850
|
};
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
704
|
-
throw new
|
|
705
|
-
return
|
|
851
|
+
const u = k(n, "id_token"), g = k(n, "token");
|
|
852
|
+
if (u !== void 0 || g !== void 0)
|
|
853
|
+
throw new S("implicit and hybrid flows are not supported");
|
|
854
|
+
return mt(new URLSearchParams(n));
|
|
706
855
|
}
|
|
707
|
-
class
|
|
856
|
+
class x extends Error {
|
|
708
857
|
}
|
|
709
|
-
class
|
|
710
|
-
constructor(
|
|
711
|
-
super(
|
|
858
|
+
class G extends x {
|
|
859
|
+
constructor(e, n, r) {
|
|
860
|
+
super(e, r), this.error = n;
|
|
712
861
|
}
|
|
713
862
|
}
|
|
714
|
-
function
|
|
715
|
-
handleCallback:
|
|
863
|
+
function xt({
|
|
864
|
+
handleCallback: t
|
|
716
865
|
}) {
|
|
717
|
-
const
|
|
718
|
-
return
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}).catch((
|
|
722
|
-
r(
|
|
866
|
+
const e = je(!1), [n, r] = Ie(void 0), s = xe();
|
|
867
|
+
return ze(() => {
|
|
868
|
+
e.current || (e.current = !0, t().then((o) => {
|
|
869
|
+
s(o);
|
|
870
|
+
}).catch((o) => {
|
|
871
|
+
r(o);
|
|
723
872
|
}));
|
|
724
|
-
}, []), n ? n instanceof
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
/* @__PURE__ */
|
|
873
|
+
}, []), n ? n instanceof G ? /* @__PURE__ */ A.jsxs("div", { children: [
|
|
874
|
+
/* @__PURE__ */ A.jsx("h2", { children: "Error" }),
|
|
875
|
+
/* @__PURE__ */ A.jsxs("pre", { children: [
|
|
727
876
|
n.error.error,
|
|
728
877
|
n.error.error_description,
|
|
729
878
|
n.error.error_uri
|
|
730
879
|
] })
|
|
731
|
-
] }) : /* @__PURE__ */
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
-
/* @__PURE__ */
|
|
880
|
+
] }) : /* @__PURE__ */ A.jsxs("div", { children: [
|
|
881
|
+
/* @__PURE__ */ A.jsx("h2", { children: "Error" }),
|
|
882
|
+
/* @__PURE__ */ A.jsxs("pre", { children: [
|
|
734
883
|
n.message,
|
|
735
884
|
n.stack
|
|
736
885
|
] })
|
|
737
|
-
] }) : /* @__PURE__ */
|
|
886
|
+
] }) : /* @__PURE__ */ A.jsx("div", { children: "Loading..." });
|
|
738
887
|
}
|
|
739
|
-
const
|
|
740
|
-
class
|
|
888
|
+
const le = "code-verifier";
|
|
889
|
+
class Ut extends Ce {
|
|
890
|
+
constructor(e, n) {
|
|
891
|
+
super(), this.callbackUrlPath = e, this.handleCallback = n;
|
|
892
|
+
}
|
|
893
|
+
getRoutes() {
|
|
894
|
+
return [
|
|
895
|
+
...super.getRoutes(),
|
|
896
|
+
{
|
|
897
|
+
path: this.callbackUrlPath,
|
|
898
|
+
element: /* @__PURE__ */ A.jsx(xt, { handleCallback: this.handleCallback })
|
|
899
|
+
}
|
|
900
|
+
];
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
class Lt {
|
|
741
904
|
constructor({
|
|
742
|
-
issuer:
|
|
905
|
+
issuer: e,
|
|
743
906
|
authorizationEndpoint: n,
|
|
744
907
|
tokenEndpoint: r,
|
|
745
|
-
clientId:
|
|
908
|
+
clientId: s,
|
|
909
|
+
redirectToAfterSignUp: o,
|
|
910
|
+
redirectToAfterSignIn: i,
|
|
911
|
+
redirectToAfterSignOut: u
|
|
746
912
|
}) {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
913
|
+
y(this, "client");
|
|
914
|
+
y(this, "issuer");
|
|
915
|
+
y(this, "authorizationEndpoint");
|
|
916
|
+
y(this, "tokenEndpoint");
|
|
917
|
+
y(this, "authorizationServer");
|
|
918
|
+
y(this, "tokens");
|
|
919
|
+
y(this, "callbackUrlPath", "/oauth/callback");
|
|
920
|
+
y(this, "logoutRedirectUrlPath", "/");
|
|
921
|
+
y(this, "redirectToAfterSignUp");
|
|
922
|
+
y(this, "redirectToAfterSignIn");
|
|
923
|
+
y(this, "redirectToAfterSignOut");
|
|
924
|
+
y(this, "handleCallback", async () => {
|
|
925
|
+
const e = new URL(window.location.href), n = e.searchParams.get("state"), r = localStorage.getItem(le);
|
|
757
926
|
if (!r)
|
|
758
|
-
throw new
|
|
927
|
+
throw new x(
|
|
759
928
|
"Code verifier not found. Invalid auth state."
|
|
760
929
|
);
|
|
761
|
-
const
|
|
762
|
-
|
|
930
|
+
const s = await this.getAuthServer(), o = Pt(
|
|
931
|
+
s,
|
|
763
932
|
this.client,
|
|
764
|
-
|
|
933
|
+
e.searchParams,
|
|
765
934
|
n ?? void 0
|
|
766
935
|
);
|
|
767
|
-
if (
|
|
768
|
-
throw
|
|
936
|
+
if (B(o))
|
|
937
|
+
throw oe.error("Error validating OAuth response", o), new G(
|
|
769
938
|
"Error validating OAuth response",
|
|
770
|
-
|
|
939
|
+
o
|
|
771
940
|
);
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
|
|
941
|
+
const i = new URL(e);
|
|
942
|
+
i.pathname = this.redirectToAfterSignIn ?? this.callbackUrlPath, i.search = "";
|
|
943
|
+
const u = await yt(
|
|
944
|
+
s,
|
|
776
945
|
this.client,
|
|
777
|
-
|
|
778
|
-
|
|
946
|
+
o,
|
|
947
|
+
i.toString(),
|
|
779
948
|
r
|
|
780
|
-
),
|
|
781
|
-
|
|
949
|
+
), g = await vt(
|
|
950
|
+
s,
|
|
782
951
|
this.client,
|
|
783
|
-
|
|
952
|
+
u
|
|
784
953
|
);
|
|
785
|
-
this.setTokensFromResponse(
|
|
786
|
-
const
|
|
787
|
-
|
|
954
|
+
this.setTokensFromResponse(g);
|
|
955
|
+
const m = await this.getAccessToken(), _ = await (await lt(
|
|
956
|
+
s,
|
|
788
957
|
this.client,
|
|
789
|
-
|
|
790
|
-
)).json(),
|
|
791
|
-
sub:
|
|
792
|
-
email:
|
|
793
|
-
name:
|
|
794
|
-
emailVerified:
|
|
795
|
-
pictureUrl:
|
|
958
|
+
m
|
|
959
|
+
)).json(), h = {
|
|
960
|
+
sub: _.sub,
|
|
961
|
+
email: _.email,
|
|
962
|
+
name: _.name,
|
|
963
|
+
emailVerified: _.email_verified ?? !1,
|
|
964
|
+
pictureUrl: _.picture
|
|
796
965
|
};
|
|
797
|
-
|
|
966
|
+
return re.setState({
|
|
798
967
|
isAuthenticated: !0,
|
|
799
968
|
isPending: !1,
|
|
800
|
-
profile:
|
|
801
|
-
});
|
|
969
|
+
profile: h
|
|
970
|
+
}), localStorage.getItem("sign-up") ? this.redirectToAfterSignUp : this.redirectToAfterSignIn;
|
|
802
971
|
});
|
|
803
972
|
this.client = {
|
|
804
|
-
client_id:
|
|
973
|
+
client_id: s,
|
|
805
974
|
token_endpoint_auth_method: "none"
|
|
806
|
-
}, this.issuer =
|
|
975
|
+
}, this.issuer = e, this.authorizationEndpoint = n, this.tokenEndpoint = r, this.redirectToAfterSignUp = o ?? "/", this.redirectToAfterSignIn = i ?? "/", this.redirectToAfterSignOut = u ?? "/";
|
|
807
976
|
}
|
|
808
977
|
async getAuthServer() {
|
|
809
978
|
if (!this.authorizationServer)
|
|
@@ -815,9 +984,9 @@ class ct {
|
|
|
815
984
|
code_challenge_methods_supported: []
|
|
816
985
|
};
|
|
817
986
|
else {
|
|
818
|
-
const
|
|
819
|
-
this.authorizationServer = await
|
|
820
|
-
|
|
987
|
+
const e = new URL(this.issuer), n = await Me(e);
|
|
988
|
+
this.authorizationServer = await Be(
|
|
989
|
+
e,
|
|
821
990
|
n
|
|
822
991
|
);
|
|
823
992
|
}
|
|
@@ -827,54 +996,60 @@ class ct {
|
|
|
827
996
|
* Sets the tokens from various OAuth responses
|
|
828
997
|
* @param response
|
|
829
998
|
*/
|
|
830
|
-
setTokensFromResponse(
|
|
831
|
-
if (
|
|
832
|
-
throw
|
|
833
|
-
if (!
|
|
834
|
-
throw new
|
|
999
|
+
setTokensFromResponse(e) {
|
|
1000
|
+
if (B(e))
|
|
1001
|
+
throw oe.error("Bad Token Response", e), new G("Bad Token Response", e);
|
|
1002
|
+
if (!e.expires_in)
|
|
1003
|
+
throw new x("No expires_in in response");
|
|
835
1004
|
this.tokens = {
|
|
836
|
-
accessToken:
|
|
837
|
-
refreshToken:
|
|
838
|
-
expiresOn: new Date(Date.now() +
|
|
839
|
-
tokenType:
|
|
1005
|
+
accessToken: e.access_token,
|
|
1006
|
+
refreshToken: e.refresh_token,
|
|
1007
|
+
expiresOn: new Date(Date.now() + e.expires_in * 1e3),
|
|
1008
|
+
tokenType: e.token_type
|
|
840
1009
|
};
|
|
841
1010
|
}
|
|
842
|
-
async
|
|
1011
|
+
async signUp() {
|
|
1012
|
+
return this.authorize(!0);
|
|
843
1013
|
}
|
|
844
|
-
async
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
localStorage.setItem(
|
|
1014
|
+
async signIn() {
|
|
1015
|
+
return this.authorize();
|
|
1016
|
+
}
|
|
1017
|
+
async authorize(e = !1) {
|
|
1018
|
+
var g;
|
|
1019
|
+
const n = "S256", r = await this.getAuthServer();
|
|
1020
|
+
if (e ? localStorage.setItem("sign-up", "true") : localStorage.removeItem("sign-up"), !r.authorization_endpoint)
|
|
1021
|
+
throw new x("No authorization endpoint");
|
|
1022
|
+
const s = Ge(), o = await Ve(s);
|
|
1023
|
+
localStorage.setItem(le, s);
|
|
851
1024
|
const i = new URL(
|
|
852
|
-
|
|
853
|
-
),
|
|
854
|
-
|
|
1025
|
+
e ? r.registration_endpoint ?? r.authorization_endpoint : r.authorization_endpoint
|
|
1026
|
+
), u = new URL(
|
|
1027
|
+
(e ? window.location.origin + this.redirectToAfterSignUp : window.location.origin + this.redirectToAfterSignIn) ?? window.location.href
|
|
1028
|
+
);
|
|
1029
|
+
if (u.pathname = this.callbackUrlPath, u.search = "", i.searchParams.set("client_id", this.client.client_id), i.searchParams.set("redirect_uri", u.toString()), i.searchParams.set("response_type", "code"), i.searchParams.set("scope", "openid+profile+email"), i.searchParams.set("code_challenge", o), i.searchParams.set(
|
|
855
1030
|
"code_challenge_method",
|
|
856
|
-
|
|
857
|
-
), ((
|
|
858
|
-
const
|
|
859
|
-
i.searchParams.set("state",
|
|
1031
|
+
n
|
|
1032
|
+
), ((g = r.code_challenge_methods_supported) == null ? void 0 : g.includes("S256")) !== !0) {
|
|
1033
|
+
const m = qe();
|
|
1034
|
+
i.searchParams.set("state", m);
|
|
860
1035
|
}
|
|
861
1036
|
location.href = i.href;
|
|
862
1037
|
}
|
|
863
1038
|
async getAccessToken() {
|
|
864
|
-
const
|
|
1039
|
+
const e = await this.getAuthServer();
|
|
865
1040
|
if (!this.tokens)
|
|
866
|
-
throw new
|
|
1041
|
+
throw new x("User is not authenticated");
|
|
867
1042
|
if (this.tokens.expiresOn < /* @__PURE__ */ new Date()) {
|
|
868
1043
|
if (!this.tokens.refreshToken)
|
|
869
|
-
throw new
|
|
1044
|
+
throw new x(
|
|
870
1045
|
"Token expired and no refresh token available"
|
|
871
1046
|
);
|
|
872
|
-
const n = await
|
|
873
|
-
|
|
1047
|
+
const n = await ht(
|
|
1048
|
+
e,
|
|
874
1049
|
this.client,
|
|
875
1050
|
this.tokens.refreshToken
|
|
876
|
-
), r = await
|
|
877
|
-
|
|
1051
|
+
), r = await pt(
|
|
1052
|
+
e,
|
|
878
1053
|
this.client,
|
|
879
1054
|
n
|
|
880
1055
|
);
|
|
@@ -882,31 +1057,32 @@ class ct {
|
|
|
882
1057
|
}
|
|
883
1058
|
return this.tokens.accessToken;
|
|
884
1059
|
}
|
|
885
|
-
async
|
|
886
|
-
|
|
1060
|
+
async signOut() {
|
|
1061
|
+
re.setState({
|
|
887
1062
|
isAuthenticated: !1,
|
|
888
1063
|
isPending: !1,
|
|
889
1064
|
profile: void 0
|
|
890
1065
|
});
|
|
891
|
-
const
|
|
1066
|
+
const e = await this.getAuthServer(), n = new URL(
|
|
1067
|
+
window.location.origin + this.redirectToAfterSignOut
|
|
1068
|
+
);
|
|
892
1069
|
n.pathname = this.logoutRedirectUrlPath;
|
|
893
1070
|
let r;
|
|
894
|
-
|
|
1071
|
+
e.end_session_endpoint ? (r = new URL(e.end_session_endpoint), r.searchParams.set(
|
|
895
1072
|
"post_logout_redirect_uri",
|
|
896
1073
|
n.toString()
|
|
897
1074
|
)) : r = n;
|
|
898
1075
|
}
|
|
899
|
-
|
|
900
|
-
return
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
}
|
|
905
|
-
];
|
|
1076
|
+
getAuthenticationPlugin() {
|
|
1077
|
+
return new Ut(
|
|
1078
|
+
this.callbackUrlPath,
|
|
1079
|
+
() => this.handleCallback()
|
|
1080
|
+
);
|
|
906
1081
|
}
|
|
907
1082
|
}
|
|
908
|
-
const
|
|
1083
|
+
const Nt = (t) => new Lt(t);
|
|
909
1084
|
export {
|
|
910
|
-
|
|
911
|
-
|
|
1085
|
+
Lt as OpenIDAuthenticationProvider,
|
|
1086
|
+
Nt as default
|
|
912
1087
|
};
|
|
1088
|
+
//# sourceMappingURL=zudoku.auth-openid.js.map
|