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