zudoku 0.1.1-dev.9 → 0.3.0-dev.10
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 +16 -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 +8 -0
- package/dist/lib/authentication/hook.js +30 -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 +41 -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 +56 -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 +206 -0
- package/dist/lib/authentication/providers/openid.js.map +1 -0
- package/dist/lib/authentication/state.d.ts +14 -0
- package/dist/lib/authentication/state.js +6 -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 +31 -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 +9 -2
- 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 +50 -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 +4 -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 +4 -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 +94 -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 +3 -3
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -0
- 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/Sidecar.js +21 -19
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/{app/plugins/openapi/Select.d.ts → lib/plugins/openapi/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/{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 +6 -0
- package/dist/lib/plugins/openapi/playground/Headers.js +25 -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 +32 -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/config.test.js +1 -1
- package/dist/vite/config.test.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-DCwVN24H.js +8441 -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-PyGcnQFX.js +3462 -0
- package/lib/loglevel-CoH7VSwE.js +152 -0
- package/lib/prism-bash.min-DadFsM4Z.js +6 -0
- package/lib/prism-csharp.min-Yizuc34Y.js +34 -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-objectivec.min-BXSWqpJJ.js +1 -0
- package/lib/prism-php.min-o7FpoMP_.js +10 -0
- package/lib/prism-ruby.min-C7LwcKyz.js +9 -0
- package/lib/state-2Hu1renZ.js +313 -0
- package/lib/urql-DMlBWUKL.js +1591 -0
- package/lib/zudoku.auth-auth0.js +27 -0
- package/lib/zudoku.auth-clerk.js +49 -0
- package/lib/zudoku.auth-openid.js +912 -0
- package/lib/zudoku.components.js +894 -0
- package/lib/zudoku.openapi-worker.js +225 -0
- package/lib/zudoku.plugins.js +19908 -0
- package/package.json +70 -39
- package/src/app/App.tsx +17 -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 +34 -0
- package/src/lib/authentication/providers/auth0.tsx +53 -0
- package/src/lib/authentication/providers/clerk.tsx +66 -0
- package/src/lib/authentication/providers/openid.tsx +314 -0
- package/src/lib/authentication/state.ts +21 -0
- package/src/{app → lib/components}/DevPortal.tsx +29 -42
- package/src/{app → lib}/components/Dialog.tsx +37 -37
- package/src/{app → lib}/components/Header.tsx +28 -23
- 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 +15 -4
- 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 +33 -67
- 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 +94 -0
- package/src/lib/plugins/api-key/SettingsApiKeys.tsx +132 -0
- package/src/lib/plugins/api-key/index.tsx +160 -0
- package/src/lib/plugins/index.ts +4 -0
- package/src/{app → lib}/plugins/markdown/MdxPage.tsx +33 -11
- 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/lib/plugins/openapi/OperationListItem.tsx +93 -0
- 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 +4 -3
- 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 +33 -28
- package/src/{app/plugins/openapi/Select.tsx → lib/plugins/openapi/SimpleSelect.tsx} +5 -2
- 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 +87 -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 +361 -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/RequestBodySidecarBox.js.map +0 -1
- package/dist/app/plugins/openapi/Select.js +0 -5
- package/dist/app/plugins/openapi/Select.js.map +0 -1
- package/dist/app/plugins/openapi/Sidecar.js.map +0 -1
- 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/OperationListItem.tsx +0 -55
- 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/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/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,912 @@
|
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var he = (e, t, n) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var w = (e, t, n) => he(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { a as de, j as g } from "./index-PyGcnQFX.js";
|
|
5
|
+
import { l as I } from "./loglevel-CoH7VSwE.js";
|
|
6
|
+
import { useRef as fe, useState as le, useEffect as pe } from "react";
|
|
7
|
+
import { u as M } from "./state-2Hu1renZ.js";
|
|
8
|
+
let z;
|
|
9
|
+
var v, Z;
|
|
10
|
+
(typeof navigator > "u" || !((Z = (v = navigator.userAgent) == null ? void 0 : v.startsWith) != null && Z.call(v, "Mozilla/5.0 "))) && (z = "oauth4webapi/v2.11.1");
|
|
11
|
+
function O(e, t) {
|
|
12
|
+
if (e == null)
|
|
13
|
+
return !1;
|
|
14
|
+
try {
|
|
15
|
+
return e instanceof t || Object.getPrototypeOf(e)[Symbol.toStringTag] === t.prototype[Symbol.toStringTag];
|
|
16
|
+
} catch {
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const P = Symbol(), we = Symbol(), K = Symbol(), me = new TextEncoder(), ye = new TextDecoder();
|
|
21
|
+
function _(e) {
|
|
22
|
+
return typeof e == "string" ? me.encode(e) : ye.decode(e);
|
|
23
|
+
}
|
|
24
|
+
const B = 32768;
|
|
25
|
+
function ge(e) {
|
|
26
|
+
e instanceof ArrayBuffer && (e = new Uint8Array(e));
|
|
27
|
+
const t = [];
|
|
28
|
+
for (let n = 0; n < e.byteLength; n += B)
|
|
29
|
+
t.push(String.fromCharCode.apply(null, e.subarray(n, n + B)));
|
|
30
|
+
return btoa(t.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
31
|
+
}
|
|
32
|
+
function _e(e) {
|
|
33
|
+
try {
|
|
34
|
+
const t = atob(e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(t.length);
|
|
35
|
+
for (let r = 0; r < t.length; r++)
|
|
36
|
+
n[r] = t.charCodeAt(r);
|
|
37
|
+
return n;
|
|
38
|
+
} catch (t) {
|
|
39
|
+
throw new o("The input to be decoded is not correctly encoded.", { cause: t });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function y(e) {
|
|
43
|
+
return typeof e == "string" ? _e(e) : ge(e);
|
|
44
|
+
}
|
|
45
|
+
class be {
|
|
46
|
+
constructor(t) {
|
|
47
|
+
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = t;
|
|
48
|
+
}
|
|
49
|
+
get(t) {
|
|
50
|
+
let n = this.cache.get(t);
|
|
51
|
+
if (n)
|
|
52
|
+
return n;
|
|
53
|
+
if (n = this._cache.get(t))
|
|
54
|
+
return this.update(t, n), n;
|
|
55
|
+
}
|
|
56
|
+
has(t) {
|
|
57
|
+
return this.cache.has(t) || this._cache.has(t);
|
|
58
|
+
}
|
|
59
|
+
set(t, n) {
|
|
60
|
+
return this.cache.has(t) ? this.cache.set(t, n) : this.update(t, n), this;
|
|
61
|
+
}
|
|
62
|
+
delete(t) {
|
|
63
|
+
return this.cache.has(t) ? this.cache.delete(t) : this._cache.has(t) ? this._cache.delete(t) : !1;
|
|
64
|
+
}
|
|
65
|
+
update(t, n) {
|
|
66
|
+
this.cache.set(t, n), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
class f extends Error {
|
|
70
|
+
constructor(t) {
|
|
71
|
+
var n;
|
|
72
|
+
super(t ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class Se extends Error {
|
|
76
|
+
constructor(t, n) {
|
|
77
|
+
var r;
|
|
78
|
+
super(t, n), this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const o = Se, Q = new be(100);
|
|
82
|
+
function X(e) {
|
|
83
|
+
return e instanceof CryptoKey;
|
|
84
|
+
}
|
|
85
|
+
function ee(e) {
|
|
86
|
+
return X(e) && e.type === "private";
|
|
87
|
+
}
|
|
88
|
+
function ke(e) {
|
|
89
|
+
return X(e) && e.type === "public";
|
|
90
|
+
}
|
|
91
|
+
function N(e) {
|
|
92
|
+
try {
|
|
93
|
+
const t = e.headers.get("dpop-nonce");
|
|
94
|
+
t && Q.set(new URL(e.url).origin, t);
|
|
95
|
+
} catch {
|
|
96
|
+
}
|
|
97
|
+
return e;
|
|
98
|
+
}
|
|
99
|
+
function E(e) {
|
|
100
|
+
return !(e === null || typeof e != "object" || Array.isArray(e));
|
|
101
|
+
}
|
|
102
|
+
function x(e) {
|
|
103
|
+
O(e, Headers) && (e = Object.fromEntries(e.entries()));
|
|
104
|
+
const t = new Headers(e);
|
|
105
|
+
if (z && !t.has("user-agent") && t.set("user-agent", z), t.has("authorization"))
|
|
106
|
+
throw new TypeError('"options.headers" must not include the "authorization" header name');
|
|
107
|
+
if (t.has("dpop"))
|
|
108
|
+
throw new TypeError('"options.headers" must not include the "dpop" header name');
|
|
109
|
+
return t;
|
|
110
|
+
}
|
|
111
|
+
function W(e) {
|
|
112
|
+
if (typeof e == "function" && (e = e()), !(e instanceof AbortSignal))
|
|
113
|
+
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
114
|
+
return e;
|
|
115
|
+
}
|
|
116
|
+
async function Ee(e, t) {
|
|
117
|
+
if (!(e instanceof URL))
|
|
118
|
+
throw new TypeError('"issuerIdentifier" must be an instance of URL');
|
|
119
|
+
if (e.protocol !== "https:" && e.protocol !== "http:")
|
|
120
|
+
throw new TypeError('"issuer.protocol" must be "https:" or "http:"');
|
|
121
|
+
const n = new URL(e.href);
|
|
122
|
+
switch (t == null ? void 0 : t.algorithm) {
|
|
123
|
+
case void 0:
|
|
124
|
+
case "oidc":
|
|
125
|
+
n.pathname = `${n.pathname}/.well-known/openid-configuration`.replace("//", "/");
|
|
126
|
+
break;
|
|
127
|
+
case "oauth2":
|
|
128
|
+
n.pathname === "/" ? n.pathname = ".well-known/oauth-authorization-server" : n.pathname = `.well-known/oauth-authorization-server/${n.pathname}`.replace("//", "/");
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
|
|
132
|
+
}
|
|
133
|
+
const r = x(t == null ? void 0 : t.headers);
|
|
134
|
+
return r.set("accept", "application/json"), ((t == null ? void 0 : t[K]) || fetch)(n.href, {
|
|
135
|
+
headers: Object.fromEntries(r.entries()),
|
|
136
|
+
method: "GET",
|
|
137
|
+
redirect: "manual",
|
|
138
|
+
signal: t != null && t.signal ? W(t.signal) : null
|
|
139
|
+
}).then(N);
|
|
140
|
+
}
|
|
141
|
+
function h(e) {
|
|
142
|
+
return typeof e == "string" && e.length !== 0;
|
|
143
|
+
}
|
|
144
|
+
async function Te(e, t) {
|
|
145
|
+
if (!(e instanceof URL))
|
|
146
|
+
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
147
|
+
if (!O(t, Response))
|
|
148
|
+
throw new TypeError('"response" must be an instance of Response');
|
|
149
|
+
if (t.status !== 200)
|
|
150
|
+
throw new o('"response" is not a conform Authorization Server Metadata response');
|
|
151
|
+
H(t);
|
|
152
|
+
let n;
|
|
153
|
+
try {
|
|
154
|
+
n = await t.json();
|
|
155
|
+
} catch (r) {
|
|
156
|
+
throw new o('failed to parse "response" body as JSON', { cause: r });
|
|
157
|
+
}
|
|
158
|
+
if (!E(n))
|
|
159
|
+
throw new o('"response" body must be a top level object');
|
|
160
|
+
if (!h(n.issuer))
|
|
161
|
+
throw new o('"response" body "issuer" property must be a non-empty string');
|
|
162
|
+
if (new URL(n.issuer).href !== e.href)
|
|
163
|
+
throw new o('"response" body "issuer" does not match "expectedIssuer"');
|
|
164
|
+
return n;
|
|
165
|
+
}
|
|
166
|
+
function j() {
|
|
167
|
+
return y(crypto.getRandomValues(new Uint8Array(32)));
|
|
168
|
+
}
|
|
169
|
+
function Ae() {
|
|
170
|
+
return j();
|
|
171
|
+
}
|
|
172
|
+
function ve() {
|
|
173
|
+
return j();
|
|
174
|
+
}
|
|
175
|
+
async function Re(e) {
|
|
176
|
+
if (!h(e))
|
|
177
|
+
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
178
|
+
return y(await crypto.subtle.digest("SHA-256", _(e)));
|
|
179
|
+
}
|
|
180
|
+
function Pe(e) {
|
|
181
|
+
if (e instanceof CryptoKey)
|
|
182
|
+
return { key: e };
|
|
183
|
+
if (!((e == null ? void 0 : e.key) instanceof CryptoKey))
|
|
184
|
+
return {};
|
|
185
|
+
if (e.kid !== void 0 && !h(e.kid))
|
|
186
|
+
throw new TypeError('"kid" must be a non-empty string');
|
|
187
|
+
return { key: e.key, kid: e.kid };
|
|
188
|
+
}
|
|
189
|
+
function F(e) {
|
|
190
|
+
return encodeURIComponent(e).replace(/%20/g, "+");
|
|
191
|
+
}
|
|
192
|
+
function xe(e, t) {
|
|
193
|
+
const n = F(e), r = F(t);
|
|
194
|
+
return `Basic ${btoa(`${n}:${r}`)}`;
|
|
195
|
+
}
|
|
196
|
+
function je(e) {
|
|
197
|
+
switch (e.algorithm.hash.name) {
|
|
198
|
+
case "SHA-256":
|
|
199
|
+
return "PS256";
|
|
200
|
+
case "SHA-384":
|
|
201
|
+
return "PS384";
|
|
202
|
+
case "SHA-512":
|
|
203
|
+
return "PS512";
|
|
204
|
+
default:
|
|
205
|
+
throw new f("unsupported RsaHashedKeyAlgorithm hash name");
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function Ue(e) {
|
|
209
|
+
switch (e.algorithm.hash.name) {
|
|
210
|
+
case "SHA-256":
|
|
211
|
+
return "RS256";
|
|
212
|
+
case "SHA-384":
|
|
213
|
+
return "RS384";
|
|
214
|
+
case "SHA-512":
|
|
215
|
+
return "RS512";
|
|
216
|
+
default:
|
|
217
|
+
throw new f("unsupported RsaHashedKeyAlgorithm hash name");
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function Ce(e) {
|
|
221
|
+
switch (e.algorithm.namedCurve) {
|
|
222
|
+
case "P-256":
|
|
223
|
+
return "ES256";
|
|
224
|
+
case "P-384":
|
|
225
|
+
return "ES384";
|
|
226
|
+
case "P-521":
|
|
227
|
+
return "ES512";
|
|
228
|
+
default:
|
|
229
|
+
throw new f("unsupported EcKeyAlgorithm namedCurve");
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function te(e) {
|
|
233
|
+
switch (e.algorithm.name) {
|
|
234
|
+
case "RSA-PSS":
|
|
235
|
+
return je(e);
|
|
236
|
+
case "RSASSA-PKCS1-v1_5":
|
|
237
|
+
return Ue(e);
|
|
238
|
+
case "ECDSA":
|
|
239
|
+
return Ce(e);
|
|
240
|
+
case "Ed25519":
|
|
241
|
+
case "Ed448":
|
|
242
|
+
return "EdDSA";
|
|
243
|
+
default:
|
|
244
|
+
throw new f("unsupported CryptoKey algorithm name");
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function U(e) {
|
|
248
|
+
const t = e == null ? void 0 : e[P];
|
|
249
|
+
return typeof t == "number" && Number.isFinite(t) ? t : 0;
|
|
250
|
+
}
|
|
251
|
+
function ze(e) {
|
|
252
|
+
const t = e == null ? void 0 : e[we];
|
|
253
|
+
return typeof t == "number" && Number.isFinite(t) && Math.sign(t) !== -1 ? t : 30;
|
|
254
|
+
}
|
|
255
|
+
function D() {
|
|
256
|
+
return Math.floor(Date.now() / 1e3);
|
|
257
|
+
}
|
|
258
|
+
function Je(e, t) {
|
|
259
|
+
const n = D() + U(t);
|
|
260
|
+
return {
|
|
261
|
+
jti: j(),
|
|
262
|
+
aud: [e.issuer, e.token_endpoint],
|
|
263
|
+
exp: n + 60,
|
|
264
|
+
iat: n,
|
|
265
|
+
nbf: n,
|
|
266
|
+
iss: t.client_id,
|
|
267
|
+
sub: t.client_id
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
async function Le(e, t, n, r) {
|
|
271
|
+
return ne({
|
|
272
|
+
alg: te(n),
|
|
273
|
+
kid: r
|
|
274
|
+
}, Je(e, t), n);
|
|
275
|
+
}
|
|
276
|
+
function T(e) {
|
|
277
|
+
if (typeof e != "object" || e === null)
|
|
278
|
+
throw new TypeError('"as" must be an object');
|
|
279
|
+
if (!h(e.issuer))
|
|
280
|
+
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
281
|
+
return !0;
|
|
282
|
+
}
|
|
283
|
+
function A(e) {
|
|
284
|
+
if (typeof e != "object" || e === null)
|
|
285
|
+
throw new TypeError('"client" must be an object');
|
|
286
|
+
if (!h(e.client_id))
|
|
287
|
+
throw new TypeError('"client.client_id" property must be a non-empty string');
|
|
288
|
+
return !0;
|
|
289
|
+
}
|
|
290
|
+
function q(e) {
|
|
291
|
+
if (!h(e))
|
|
292
|
+
throw new TypeError('"client.client_secret" property must be a non-empty string');
|
|
293
|
+
return e;
|
|
294
|
+
}
|
|
295
|
+
function C(e, t) {
|
|
296
|
+
if (t !== void 0)
|
|
297
|
+
throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${e} client authentication method is used.`);
|
|
298
|
+
}
|
|
299
|
+
function V(e, t) {
|
|
300
|
+
if (t !== void 0)
|
|
301
|
+
throw new TypeError(`"client.client_secret" property must not be provided when ${e} client authentication method is used.`);
|
|
302
|
+
}
|
|
303
|
+
async function Oe(e, t, n, r, a) {
|
|
304
|
+
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), t.token_endpoint_auth_method) {
|
|
305
|
+
case void 0:
|
|
306
|
+
case "client_secret_basic": {
|
|
307
|
+
C("client_secret_basic", a), r.set("authorization", xe(t.client_id, q(t.client_secret)));
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
case "client_secret_post": {
|
|
311
|
+
C("client_secret_post", a), n.set("client_id", t.client_id), n.set("client_secret", q(t.client_secret));
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
case "private_key_jwt": {
|
|
315
|
+
if (V("private_key_jwt", t.client_secret), a === void 0)
|
|
316
|
+
throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
|
|
317
|
+
const { key: i, kid: s } = Pe(a);
|
|
318
|
+
if (!ee(i))
|
|
319
|
+
throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
|
|
320
|
+
n.set("client_id", t.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await Le(e, t, i, s));
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
case "tls_client_auth":
|
|
324
|
+
case "self_signed_tls_client_auth":
|
|
325
|
+
case "none": {
|
|
326
|
+
V(t.token_endpoint_auth_method, t.client_secret), C(t.token_endpoint_auth_method, a), n.set("client_id", t.client_id);
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
default:
|
|
330
|
+
throw new f("unsupported client token_endpoint_auth_method");
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
async function ne(e, t, n) {
|
|
334
|
+
if (!n.usages.includes("sign"))
|
|
335
|
+
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
336
|
+
const r = `${y(_(JSON.stringify(e)))}.${y(_(JSON.stringify(t)))}`, a = y(await crypto.subtle.sign(oe(n), n, _(r)));
|
|
337
|
+
return `${r}.${a}`;
|
|
338
|
+
}
|
|
339
|
+
async function Ke(e, t, n, r, a, i) {
|
|
340
|
+
const { privateKey: s, publicKey: c, nonce: d = Q.get(n.origin) } = t;
|
|
341
|
+
if (!ee(s))
|
|
342
|
+
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
343
|
+
if (!ke(c))
|
|
344
|
+
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
345
|
+
if (d !== void 0 && !h(d))
|
|
346
|
+
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
347
|
+
if (!c.extractable)
|
|
348
|
+
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
349
|
+
const l = D() + a, S = await ne({
|
|
350
|
+
alg: te(s),
|
|
351
|
+
typ: "dpop+jwt",
|
|
352
|
+
jwk: await We(c)
|
|
353
|
+
}, {
|
|
354
|
+
iat: l,
|
|
355
|
+
jti: j(),
|
|
356
|
+
htm: r,
|
|
357
|
+
nonce: d,
|
|
358
|
+
htu: `${n.origin}${n.pathname}`,
|
|
359
|
+
ath: i ? y(await crypto.subtle.digest("SHA-256", _(i))) : void 0
|
|
360
|
+
}, s);
|
|
361
|
+
e.set("dpop", S);
|
|
362
|
+
}
|
|
363
|
+
let R;
|
|
364
|
+
async function Ne(e) {
|
|
365
|
+
const { kty: t, e: n, n: r, x: a, y: i, crv: s } = await crypto.subtle.exportKey("jwk", e), c = { kty: t, e: n, n: r, x: a, y: i, crv: s };
|
|
366
|
+
return R.set(e, c), c;
|
|
367
|
+
}
|
|
368
|
+
async function We(e) {
|
|
369
|
+
return R || (R = /* @__PURE__ */ new WeakMap()), R.get(e) || Ne(e);
|
|
370
|
+
}
|
|
371
|
+
function De(e, t, n) {
|
|
372
|
+
if (typeof e != "string")
|
|
373
|
+
throw new TypeError(`"as.${t}" must be a string`);
|
|
374
|
+
return new URL(e);
|
|
375
|
+
}
|
|
376
|
+
function re(e, t, n) {
|
|
377
|
+
return De(e[t], t);
|
|
378
|
+
}
|
|
379
|
+
function J(e) {
|
|
380
|
+
const t = e;
|
|
381
|
+
return typeof t != "object" || Array.isArray(t) || t === null ? !1 : t.error !== void 0;
|
|
382
|
+
}
|
|
383
|
+
async function He(e, t, n, r, a, i) {
|
|
384
|
+
if (!h(e))
|
|
385
|
+
throw new TypeError('"accessToken" must be a non-empty string');
|
|
386
|
+
if (!(n instanceof URL))
|
|
387
|
+
throw new TypeError('"url" must be an instance of URL');
|
|
388
|
+
return r = x(r), (i == null ? void 0 : i.DPoP) === void 0 ? r.set("authorization", `Bearer ${e}`) : (await Ke(r, i.DPoP, n, "GET", U({ [P]: i == null ? void 0 : i[P] }), e), r.set("authorization", `DPoP ${e}`)), ((i == null ? void 0 : i[K]) || fetch)(n.href, {
|
|
389
|
+
body: a,
|
|
390
|
+
headers: Object.fromEntries(r.entries()),
|
|
391
|
+
method: t,
|
|
392
|
+
redirect: "manual",
|
|
393
|
+
signal: i != null && i.signal ? W(i.signal) : null
|
|
394
|
+
}).then(N);
|
|
395
|
+
}
|
|
396
|
+
async function $e(e, t, n, r) {
|
|
397
|
+
T(e), A(t);
|
|
398
|
+
const a = re(e, "userinfo_endpoint"), i = x(r == null ? void 0 : r.headers);
|
|
399
|
+
return t.userinfo_signed_response_alg ? i.set("accept", "application/jwt") : (i.set("accept", "application/json"), i.append("accept", "application/jwt")), He(n, "GET", a, i, null, {
|
|
400
|
+
...r,
|
|
401
|
+
[P]: U(t)
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
async function Ie(e, t, n, r, a, i, s) {
|
|
405
|
+
return await Oe(e, t, a, i, s == null ? void 0 : s.clientPrivateKey), i.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((s == null ? void 0 : s[K]) || fetch)(r.href, {
|
|
406
|
+
body: a,
|
|
407
|
+
headers: Object.fromEntries(i.entries()),
|
|
408
|
+
method: n,
|
|
409
|
+
redirect: "manual",
|
|
410
|
+
signal: s != null && s.signal ? W(s.signal) : null
|
|
411
|
+
}).then(N);
|
|
412
|
+
}
|
|
413
|
+
async function ie(e, t, n, r, a) {
|
|
414
|
+
const i = re(e, "token_endpoint");
|
|
415
|
+
r.set("grant_type", n);
|
|
416
|
+
const s = x(a == null ? void 0 : a.headers);
|
|
417
|
+
return s.set("accept", "application/json"), Ie(e, t, "POST", i, r, s, a);
|
|
418
|
+
}
|
|
419
|
+
async function Me(e, t, n, r) {
|
|
420
|
+
if (T(e), A(t), !h(n))
|
|
421
|
+
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
422
|
+
const a = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
|
|
423
|
+
return a.set("refresh_token", n), ie(e, t, "refresh_token", a, r);
|
|
424
|
+
}
|
|
425
|
+
const Be = /* @__PURE__ */ new WeakMap();
|
|
426
|
+
async function se(e, t, n, r = !1, a = !1) {
|
|
427
|
+
if (T(e), A(t), !O(n, Response))
|
|
428
|
+
throw new TypeError('"response" must be an instance of Response');
|
|
429
|
+
if (n.status !== 200) {
|
|
430
|
+
let s;
|
|
431
|
+
if (s = await et(n))
|
|
432
|
+
return s;
|
|
433
|
+
throw new o('"response" is not a conform Token Endpoint response');
|
|
434
|
+
}
|
|
435
|
+
H(n);
|
|
436
|
+
let i;
|
|
437
|
+
try {
|
|
438
|
+
i = await n.json();
|
|
439
|
+
} catch (s) {
|
|
440
|
+
throw new o('failed to parse "response" body as JSON', { cause: s });
|
|
441
|
+
}
|
|
442
|
+
if (!E(i))
|
|
443
|
+
throw new o('"response" body must be a top level object');
|
|
444
|
+
if (!h(i.access_token))
|
|
445
|
+
throw new o('"response" body "access_token" property must be a non-empty string');
|
|
446
|
+
if (!h(i.token_type))
|
|
447
|
+
throw new o('"response" body "token_type" property must be a non-empty string');
|
|
448
|
+
if (i.token_type = i.token_type.toLowerCase(), i.token_type !== "dpop" && i.token_type !== "bearer")
|
|
449
|
+
throw new f("unsupported `token_type` value");
|
|
450
|
+
if (i.expires_in !== void 0 && (typeof i.expires_in != "number" || i.expires_in <= 0))
|
|
451
|
+
throw new o('"response" body "expires_in" property must be a positive number');
|
|
452
|
+
if (!a && i.refresh_token !== void 0 && !h(i.refresh_token))
|
|
453
|
+
throw new o('"response" body "refresh_token" property must be a non-empty string');
|
|
454
|
+
if (i.scope !== void 0 && typeof i.scope != "string")
|
|
455
|
+
throw new o('"response" body "scope" property must be a string');
|
|
456
|
+
if (!r) {
|
|
457
|
+
if (i.id_token !== void 0 && !h(i.id_token))
|
|
458
|
+
throw new o('"response" body "id_token" property must be a non-empty string');
|
|
459
|
+
if (i.id_token) {
|
|
460
|
+
const { claims: s } = await nt(i.id_token, rt.bind(void 0, t.id_token_signed_response_alg, e.id_token_signing_alg_values_supported), ce, U(t), ze(t)).then(Qe.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(Ve.bind(void 0, e.issuer)).then(qe.bind(void 0, t.client_id));
|
|
461
|
+
if (Array.isArray(s.aud) && s.aud.length !== 1 && s.azp !== t.client_id)
|
|
462
|
+
throw new o('unexpected ID Token "azp" (authorized party) claim value');
|
|
463
|
+
if (s.auth_time !== void 0 && (!Number.isFinite(s.auth_time) || Math.sign(s.auth_time) !== 1))
|
|
464
|
+
throw new o('ID Token "auth_time" (authentication time) must be a positive number');
|
|
465
|
+
Be.set(i, s);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
return i;
|
|
469
|
+
}
|
|
470
|
+
async function Fe(e, t, n) {
|
|
471
|
+
return se(e, t, n);
|
|
472
|
+
}
|
|
473
|
+
function qe(e, t) {
|
|
474
|
+
if (Array.isArray(t.claims.aud)) {
|
|
475
|
+
if (!t.claims.aud.includes(e))
|
|
476
|
+
throw new o('unexpected JWT "aud" (audience) claim value');
|
|
477
|
+
} else if (t.claims.aud !== e)
|
|
478
|
+
throw new o('unexpected JWT "aud" (audience) claim value');
|
|
479
|
+
return t;
|
|
480
|
+
}
|
|
481
|
+
function Ve(e, t) {
|
|
482
|
+
if (t.claims.iss !== e)
|
|
483
|
+
throw new o('unexpected JWT "iss" (issuer) claim value');
|
|
484
|
+
return t;
|
|
485
|
+
}
|
|
486
|
+
const ae = /* @__PURE__ */ new WeakSet();
|
|
487
|
+
function Ge(e) {
|
|
488
|
+
return ae.add(e), e;
|
|
489
|
+
}
|
|
490
|
+
async function Ye(e, t, n, r, a, i) {
|
|
491
|
+
if (T(e), A(t), !ae.has(n))
|
|
492
|
+
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
493
|
+
if (!h(r))
|
|
494
|
+
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
495
|
+
if (!h(a))
|
|
496
|
+
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
497
|
+
const s = m(n, "code");
|
|
498
|
+
if (!s)
|
|
499
|
+
throw new o('no authorization code in "callbackParameters"');
|
|
500
|
+
const c = new URLSearchParams(i == null ? void 0 : i.additionalParameters);
|
|
501
|
+
return c.set("redirect_uri", r), c.set("code_verifier", a), c.set("code", s), ie(e, t, "authorization_code", c, i);
|
|
502
|
+
}
|
|
503
|
+
const Ze = {
|
|
504
|
+
aud: "audience",
|
|
505
|
+
c_hash: "code hash",
|
|
506
|
+
client_id: "client id",
|
|
507
|
+
exp: "expiration time",
|
|
508
|
+
iat: "issued at",
|
|
509
|
+
iss: "issuer",
|
|
510
|
+
jti: "jwt id",
|
|
511
|
+
nonce: "nonce",
|
|
512
|
+
s_hash: "state hash",
|
|
513
|
+
sub: "subject",
|
|
514
|
+
ath: "access token hash",
|
|
515
|
+
htm: "http method",
|
|
516
|
+
htu: "http uri",
|
|
517
|
+
cnf: "confirmation"
|
|
518
|
+
};
|
|
519
|
+
function Qe(e, t) {
|
|
520
|
+
for (const n of e)
|
|
521
|
+
if (t.claims[n] === void 0)
|
|
522
|
+
throw new o(`JWT "${n}" (${Ze[n]}) claim missing`);
|
|
523
|
+
return t;
|
|
524
|
+
}
|
|
525
|
+
async function Xe(e, t, n) {
|
|
526
|
+
const r = await se(e, t, n, !0);
|
|
527
|
+
if (J(r))
|
|
528
|
+
return r;
|
|
529
|
+
if (r.id_token !== void 0) {
|
|
530
|
+
if (typeof r.id_token == "string" && r.id_token.length)
|
|
531
|
+
throw new o("Unexpected ID Token returned, use processAuthorizationCodeOpenIDResponse() for OpenID Connect callback processing");
|
|
532
|
+
delete r.id_token;
|
|
533
|
+
}
|
|
534
|
+
return r;
|
|
535
|
+
}
|
|
536
|
+
function H(e) {
|
|
537
|
+
if (e.bodyUsed)
|
|
538
|
+
throw new TypeError('"response" body has been used already');
|
|
539
|
+
}
|
|
540
|
+
async function et(e) {
|
|
541
|
+
if (e.status > 399 && e.status < 500) {
|
|
542
|
+
H(e);
|
|
543
|
+
try {
|
|
544
|
+
const t = await e.json();
|
|
545
|
+
if (E(t) && typeof t.error == "string" && t.error.length)
|
|
546
|
+
return t.error_description !== void 0 && typeof t.error_description != "string" && delete t.error_description, t.error_uri !== void 0 && typeof t.error_uri != "string" && delete t.error_uri, t.algs !== void 0 && typeof t.algs != "string" && delete t.algs, t.scope !== void 0 && typeof t.scope != "string" && delete t.scope, t;
|
|
547
|
+
} catch {
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
function G(e) {
|
|
552
|
+
if (typeof e.modulusLength != "number" || e.modulusLength < 2048)
|
|
553
|
+
throw new o(`${e.name} modulusLength must be at least 2048 bits`);
|
|
554
|
+
}
|
|
555
|
+
function tt(e) {
|
|
556
|
+
switch (e) {
|
|
557
|
+
case "P-256":
|
|
558
|
+
return "SHA-256";
|
|
559
|
+
case "P-384":
|
|
560
|
+
return "SHA-384";
|
|
561
|
+
case "P-521":
|
|
562
|
+
return "SHA-512";
|
|
563
|
+
default:
|
|
564
|
+
throw new f();
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
function oe(e) {
|
|
568
|
+
switch (e.algorithm.name) {
|
|
569
|
+
case "ECDSA":
|
|
570
|
+
return {
|
|
571
|
+
name: e.algorithm.name,
|
|
572
|
+
hash: tt(e.algorithm.namedCurve)
|
|
573
|
+
};
|
|
574
|
+
case "RSA-PSS":
|
|
575
|
+
switch (G(e.algorithm), e.algorithm.hash.name) {
|
|
576
|
+
case "SHA-256":
|
|
577
|
+
case "SHA-384":
|
|
578
|
+
case "SHA-512":
|
|
579
|
+
return {
|
|
580
|
+
name: e.algorithm.name,
|
|
581
|
+
saltLength: parseInt(e.algorithm.hash.name.slice(-3), 10) >> 3
|
|
582
|
+
};
|
|
583
|
+
default:
|
|
584
|
+
throw new f();
|
|
585
|
+
}
|
|
586
|
+
case "RSASSA-PKCS1-v1_5":
|
|
587
|
+
return G(e.algorithm), e.algorithm.name;
|
|
588
|
+
case "Ed448":
|
|
589
|
+
case "Ed25519":
|
|
590
|
+
return e.algorithm.name;
|
|
591
|
+
}
|
|
592
|
+
throw new f();
|
|
593
|
+
}
|
|
594
|
+
const ce = Symbol();
|
|
595
|
+
async function nt(e, t, n, r, a) {
|
|
596
|
+
const { 0: i, 1: s, 2: c, length: d } = e.split(".");
|
|
597
|
+
if (d === 5)
|
|
598
|
+
throw new f("JWE structure JWTs are not supported");
|
|
599
|
+
if (d !== 3)
|
|
600
|
+
throw new o("Invalid JWT");
|
|
601
|
+
let l;
|
|
602
|
+
try {
|
|
603
|
+
l = JSON.parse(_(y(i)));
|
|
604
|
+
} catch (k) {
|
|
605
|
+
throw new o("failed to parse JWT Header body as base64url encoded JSON", { cause: k });
|
|
606
|
+
}
|
|
607
|
+
if (!E(l))
|
|
608
|
+
throw new o("JWT Header must be a top level object");
|
|
609
|
+
if (t(l), l.crit !== void 0)
|
|
610
|
+
throw new o('unexpected JWT "crit" header parameter');
|
|
611
|
+
const S = y(c);
|
|
612
|
+
let p;
|
|
613
|
+
if (n !== ce) {
|
|
614
|
+
p = await n(l);
|
|
615
|
+
const k = `${i}.${s}`;
|
|
616
|
+
if (!await crypto.subtle.verify(oe(p), p, S, _(k)))
|
|
617
|
+
throw new o("JWT signature verification failed");
|
|
618
|
+
}
|
|
619
|
+
let u;
|
|
620
|
+
try {
|
|
621
|
+
u = JSON.parse(_(y(s)));
|
|
622
|
+
} catch (k) {
|
|
623
|
+
throw new o("failed to parse JWT Payload body as base64url encoded JSON", { cause: k });
|
|
624
|
+
}
|
|
625
|
+
if (!E(u))
|
|
626
|
+
throw new o("JWT Payload must be a top level object");
|
|
627
|
+
const $ = D() + r;
|
|
628
|
+
if (u.exp !== void 0) {
|
|
629
|
+
if (typeof u.exp != "number")
|
|
630
|
+
throw new o('unexpected JWT "exp" (expiration time) claim type');
|
|
631
|
+
if (u.exp <= $ - a)
|
|
632
|
+
throw new o('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
|
|
633
|
+
}
|
|
634
|
+
if (u.iat !== void 0 && typeof u.iat != "number")
|
|
635
|
+
throw new o('unexpected JWT "iat" (issued at) claim type');
|
|
636
|
+
if (u.iss !== void 0 && typeof u.iss != "string")
|
|
637
|
+
throw new o('unexpected JWT "iss" (issuer) claim type');
|
|
638
|
+
if (u.nbf !== void 0) {
|
|
639
|
+
if (typeof u.nbf != "number")
|
|
640
|
+
throw new o('unexpected JWT "nbf" (not before) claim type');
|
|
641
|
+
if (u.nbf > $ + a)
|
|
642
|
+
throw new o('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
|
|
643
|
+
}
|
|
644
|
+
if (u.aud !== void 0 && typeof u.aud != "string" && !Array.isArray(u.aud))
|
|
645
|
+
throw new o('unexpected JWT "aud" (audience) claim type');
|
|
646
|
+
return { header: l, claims: u, signature: S, key: p };
|
|
647
|
+
}
|
|
648
|
+
function rt(e, t, n) {
|
|
649
|
+
if (e !== void 0) {
|
|
650
|
+
if (n.alg !== e)
|
|
651
|
+
throw new o('unexpected JWT "alg" header parameter');
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
if (Array.isArray(t)) {
|
|
655
|
+
if (!t.includes(n.alg))
|
|
656
|
+
throw new o('unexpected JWT "alg" header parameter');
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
if (n.alg !== "RS256")
|
|
660
|
+
throw new o('unexpected JWT "alg" header parameter');
|
|
661
|
+
}
|
|
662
|
+
function m(e, t) {
|
|
663
|
+
const { 0: n, length: r } = e.getAll(t);
|
|
664
|
+
if (r > 1)
|
|
665
|
+
throw new o(`"${t}" parameter must be provided only once`);
|
|
666
|
+
return n;
|
|
667
|
+
}
|
|
668
|
+
const it = Symbol(), st = Symbol();
|
|
669
|
+
function at(e, t, n, r) {
|
|
670
|
+
if (T(e), A(t), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
671
|
+
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
672
|
+
if (m(n, "response"))
|
|
673
|
+
throw new o('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
674
|
+
const a = m(n, "iss"), i = m(n, "state");
|
|
675
|
+
if (!a && e.authorization_response_iss_parameter_supported)
|
|
676
|
+
throw new o('response parameter "iss" (issuer) missing');
|
|
677
|
+
if (a && a !== e.issuer)
|
|
678
|
+
throw new o('unexpected "iss" (issuer) response parameter value');
|
|
679
|
+
switch (r) {
|
|
680
|
+
case void 0:
|
|
681
|
+
case st:
|
|
682
|
+
if (i !== void 0)
|
|
683
|
+
throw new o('unexpected "state" response parameter encountered');
|
|
684
|
+
break;
|
|
685
|
+
case it:
|
|
686
|
+
break;
|
|
687
|
+
default:
|
|
688
|
+
if (!h(r))
|
|
689
|
+
throw new o('"expectedState" must be a non-empty string');
|
|
690
|
+
if (i === void 0)
|
|
691
|
+
throw new o('response parameter "state" missing');
|
|
692
|
+
if (i !== r)
|
|
693
|
+
throw new o('unexpected "state" response parameter value');
|
|
694
|
+
}
|
|
695
|
+
const s = m(n, "error");
|
|
696
|
+
if (s)
|
|
697
|
+
return {
|
|
698
|
+
error: s,
|
|
699
|
+
error_description: m(n, "error_description"),
|
|
700
|
+
error_uri: m(n, "error_uri")
|
|
701
|
+
};
|
|
702
|
+
const c = m(n, "id_token"), d = m(n, "token");
|
|
703
|
+
if (c !== void 0 || d !== void 0)
|
|
704
|
+
throw new f("implicit and hybrid flows are not supported");
|
|
705
|
+
return Ge(new URLSearchParams(n));
|
|
706
|
+
}
|
|
707
|
+
class b extends Error {
|
|
708
|
+
}
|
|
709
|
+
class L extends b {
|
|
710
|
+
constructor(t, n, r) {
|
|
711
|
+
super(t, r), this.error = n;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
function ot({
|
|
715
|
+
handleCallback: e
|
|
716
|
+
}) {
|
|
717
|
+
const t = fe(!1), [n, r] = le(void 0), a = de();
|
|
718
|
+
return pe(() => {
|
|
719
|
+
t.current || (t.current = !0, e().then(() => {
|
|
720
|
+
a("/");
|
|
721
|
+
}).catch((i) => {
|
|
722
|
+
r(i);
|
|
723
|
+
}));
|
|
724
|
+
}, []), n ? n instanceof L ? /* @__PURE__ */ g.jsxs("div", { children: [
|
|
725
|
+
/* @__PURE__ */ g.jsx("h2", { children: "Error" }),
|
|
726
|
+
/* @__PURE__ */ g.jsxs("pre", { children: [
|
|
727
|
+
n.error.error,
|
|
728
|
+
n.error.error_description,
|
|
729
|
+
n.error.error_uri
|
|
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 {
|
|
741
|
+
constructor({
|
|
742
|
+
issuer: t,
|
|
743
|
+
authorizationEndpoint: n,
|
|
744
|
+
tokenEndpoint: r,
|
|
745
|
+
clientId: a
|
|
746
|
+
}) {
|
|
747
|
+
w(this, "client");
|
|
748
|
+
w(this, "issuer");
|
|
749
|
+
w(this, "authorizationEndpoint");
|
|
750
|
+
w(this, "tokenEndpoint");
|
|
751
|
+
w(this, "authorizationServer");
|
|
752
|
+
w(this, "tokens");
|
|
753
|
+
w(this, "callbackUrlPath", "/oauth/callback");
|
|
754
|
+
w(this, "logoutRedirectUrlPath", "/");
|
|
755
|
+
w(this, "handleCallback", async () => {
|
|
756
|
+
const t = new URL(window.location.href), n = t.searchParams.get("state"), r = localStorage.getItem(Y);
|
|
757
|
+
if (!r)
|
|
758
|
+
throw new b(
|
|
759
|
+
"Code verifier not found. Invalid auth state."
|
|
760
|
+
);
|
|
761
|
+
const a = await this.getAuthServer(), i = at(
|
|
762
|
+
a,
|
|
763
|
+
this.client,
|
|
764
|
+
t.searchParams,
|
|
765
|
+
n ?? void 0
|
|
766
|
+
);
|
|
767
|
+
if (J(i))
|
|
768
|
+
throw I.error("Error validating OAuth response", i), new L(
|
|
769
|
+
"Error validating OAuth response",
|
|
770
|
+
i
|
|
771
|
+
);
|
|
772
|
+
const s = new URL(t);
|
|
773
|
+
s.pathname = this.callbackUrlPath, s.search = "";
|
|
774
|
+
const c = await Ye(
|
|
775
|
+
a,
|
|
776
|
+
this.client,
|
|
777
|
+
i,
|
|
778
|
+
s.toString(),
|
|
779
|
+
r
|
|
780
|
+
), d = await Xe(
|
|
781
|
+
a,
|
|
782
|
+
this.client,
|
|
783
|
+
c
|
|
784
|
+
);
|
|
785
|
+
this.setTokensFromResponse(d);
|
|
786
|
+
const l = await this.getAccessToken(), p = await (await $e(
|
|
787
|
+
a,
|
|
788
|
+
this.client,
|
|
789
|
+
l
|
|
790
|
+
)).json(), u = {
|
|
791
|
+
sub: p.sub,
|
|
792
|
+
email: p.email,
|
|
793
|
+
name: p.name,
|
|
794
|
+
emailVerified: p.email_verified ?? !1,
|
|
795
|
+
pictureUrl: p.picture
|
|
796
|
+
};
|
|
797
|
+
M.setState({
|
|
798
|
+
isAuthenticated: !0,
|
|
799
|
+
isPending: !1,
|
|
800
|
+
profile: u
|
|
801
|
+
});
|
|
802
|
+
});
|
|
803
|
+
this.client = {
|
|
804
|
+
client_id: a,
|
|
805
|
+
token_endpoint_auth_method: "none"
|
|
806
|
+
}, this.issuer = t, this.authorizationEndpoint = n, this.tokenEndpoint = r;
|
|
807
|
+
}
|
|
808
|
+
async getAuthServer() {
|
|
809
|
+
if (!this.authorizationServer)
|
|
810
|
+
if (this.tokenEndpoint && this.authorizationEndpoint)
|
|
811
|
+
this.authorizationServer = {
|
|
812
|
+
issuer: new URL(this.authorizationEndpoint).origin,
|
|
813
|
+
authorization_endpoint: this.authorizationEndpoint,
|
|
814
|
+
token_endpoint: this.tokenEndpoint,
|
|
815
|
+
code_challenge_methods_supported: []
|
|
816
|
+
};
|
|
817
|
+
else {
|
|
818
|
+
const t = new URL(this.issuer), n = await Ee(t);
|
|
819
|
+
this.authorizationServer = await Te(
|
|
820
|
+
t,
|
|
821
|
+
n
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
return this.authorizationServer;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Sets the tokens from various OAuth responses
|
|
828
|
+
* @param response
|
|
829
|
+
*/
|
|
830
|
+
setTokensFromResponse(t) {
|
|
831
|
+
if (J(t))
|
|
832
|
+
throw I.error("Bad Token Response", t), new L("Bad Token Response", t);
|
|
833
|
+
if (!t.expires_in)
|
|
834
|
+
throw new b("No expires_in in response");
|
|
835
|
+
this.tokens = {
|
|
836
|
+
accessToken: t.access_token,
|
|
837
|
+
refreshToken: t.refresh_token,
|
|
838
|
+
expiresOn: new Date(Date.now() + t.expires_in * 1e3),
|
|
839
|
+
tokenType: t.token_type
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
async initialize() {
|
|
843
|
+
}
|
|
844
|
+
async login() {
|
|
845
|
+
var c;
|
|
846
|
+
const t = "S256", n = await this.getAuthServer();
|
|
847
|
+
if (!n.authorization_endpoint)
|
|
848
|
+
throw new b("No authorization endpoint");
|
|
849
|
+
const r = Ae(), a = await Re(r);
|
|
850
|
+
localStorage.setItem(Y, r);
|
|
851
|
+
const i = new URL(
|
|
852
|
+
n.authorization_endpoint
|
|
853
|
+
), s = new URL(window.location.href);
|
|
854
|
+
if (s.pathname = this.callbackUrlPath, s.search = "", i.searchParams.set("client_id", this.client.client_id), i.searchParams.set("redirect_uri", s.toString()), i.searchParams.set("response_type", "code"), i.searchParams.set("scope", "openid+profile+email"), i.searchParams.set("code_challenge", a), i.searchParams.set(
|
|
855
|
+
"code_challenge_method",
|
|
856
|
+
t
|
|
857
|
+
), ((c = n.code_challenge_methods_supported) == null ? void 0 : c.includes("S256")) !== !0) {
|
|
858
|
+
const d = ve();
|
|
859
|
+
i.searchParams.set("state", d);
|
|
860
|
+
}
|
|
861
|
+
location.href = i.href;
|
|
862
|
+
}
|
|
863
|
+
async getAccessToken() {
|
|
864
|
+
const t = await this.getAuthServer();
|
|
865
|
+
if (!this.tokens)
|
|
866
|
+
throw new b("User is not authenticated");
|
|
867
|
+
if (this.tokens.expiresOn < /* @__PURE__ */ new Date()) {
|
|
868
|
+
if (!this.tokens.refreshToken)
|
|
869
|
+
throw new b(
|
|
870
|
+
"Token expired and no refresh token available"
|
|
871
|
+
);
|
|
872
|
+
const n = await Me(
|
|
873
|
+
t,
|
|
874
|
+
this.client,
|
|
875
|
+
this.tokens.refreshToken
|
|
876
|
+
), r = await Fe(
|
|
877
|
+
t,
|
|
878
|
+
this.client,
|
|
879
|
+
n
|
|
880
|
+
);
|
|
881
|
+
this.setTokensFromResponse(r);
|
|
882
|
+
}
|
|
883
|
+
return this.tokens.accessToken;
|
|
884
|
+
}
|
|
885
|
+
async logout() {
|
|
886
|
+
M.setState({
|
|
887
|
+
isAuthenticated: !1,
|
|
888
|
+
isPending: !1,
|
|
889
|
+
profile: void 0
|
|
890
|
+
});
|
|
891
|
+
const t = await this.getAuthServer(), n = new URL(window.location.href);
|
|
892
|
+
n.pathname = this.logoutRedirectUrlPath;
|
|
893
|
+
let r;
|
|
894
|
+
t.end_session_endpoint ? (r = new URL(t.end_session_endpoint), r.searchParams.set(
|
|
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 })
|
|
904
|
+
}
|
|
905
|
+
];
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
const wt = (e) => new ct(e);
|
|
909
|
+
export {
|
|
910
|
+
ct as OpenIDAuthenticationProvider,
|
|
911
|
+
wt as default
|
|
912
|
+
};
|