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