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