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