zudoku 0.53.4 → 0.53.5
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/config/validators/InputNavigationSchema.d.ts +0 -5
- package/dist/config/validators/InputNavigationSchema.js +0 -3
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.test-d.js +0 -1
- package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -1
- package/dist/config/validators/NavigationSchema.js +3 -2
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +3 -0
- package/dist/config/validators/validate.js +1 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Markdown.js +2 -2
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +1 -1
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/components/Typography.d.ts +1 -1
- package/dist/lib/components/Typography.js +1 -1
- package/dist/lib/components/Typography.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +1 -0
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +4 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/ui/CodeBlock.js +1 -1
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/dist/vite/dev-server.js +9 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-docs.js +11 -9
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-theme.js +88 -49
- package/dist/vite/plugin-theme.js.map +1 -1
- package/dist/vite/plugin-theme.test.js +25 -4
- package/dist/vite/plugin-theme.test.js.map +1 -1
- package/lib/{Alert-SijAp9LN.js → Alert-CWApD0CL.js} +3 -3
- package/lib/{Alert-SijAp9LN.js.map → Alert-CWApD0CL.js.map} +1 -1
- package/lib/{Button-BE9IVkWV.js → Button-B3o-2Xdf.js} +2 -2
- package/lib/{Button-BE9IVkWV.js.map → Button-B3o-2Xdf.js.map} +1 -1
- package/lib/CallbackHandler-Dr5Lva9x.js +38 -0
- package/lib/CallbackHandler-Dr5Lva9x.js.map +1 -0
- package/lib/{Card-DPhGbYUM.js → Card-CMDQUPM4.js} +2 -2
- package/lib/{Card-DPhGbYUM.js.map → Card-CMDQUPM4.js.map} +1 -1
- package/lib/ClientOnly-E7hGysn1.js.map +1 -1
- package/lib/{CodeBlock-DAKxs_Tu.js → CodeBlock-B-G0eKtw.js} +3 -3
- package/lib/{CodeBlock-DAKxs_Tu.js.map → CodeBlock-B-G0eKtw.js.map} +1 -1
- package/lib/{Command-xsbs2uhf.js → Command-C9AC5cf-.js} +3 -3
- package/lib/{Command-xsbs2uhf.js.map → Command-C9AC5cf-.js.map} +1 -1
- package/lib/{Dialog-CiIdyz6a.js → Dialog-DMWw1doX.js} +2 -2
- package/lib/{Dialog-CiIdyz6a.js.map → Dialog-DMWw1doX.js.map} +1 -1
- package/lib/{Drawer-BzkOKwgC.js → Drawer-DJ05s2pH.js} +86 -86
- package/lib/{Drawer-BzkOKwgC.js.map → Drawer-DJ05s2pH.js.map} +1 -1
- package/lib/{MdxPage-BFKqQsmK.js → MdxPage-DVI4iYgW.js} +7 -7
- package/lib/{MdxPage-BFKqQsmK.js.map → MdxPage-DVI4iYgW.js.map} +1 -1
- package/lib/{OasProvider-Bdyvd6Ic.js → OasProvider-CbwsKPNc.js} +2 -2
- package/lib/{OasProvider-Bdyvd6Ic.js.map → OasProvider-CbwsKPNc.js.map} +1 -1
- package/lib/{OperationList-YZ7k-Rkt.js → OperationList-Bn9ggxw8.js} +12 -12
- package/lib/OperationList-Bn9ggxw8.js.map +1 -0
- package/lib/{Pagination-EViy7EHt.js → Pagination-bavPec-z.js} +3 -3
- package/lib/{Pagination-EViy7EHt.js.map → Pagination-bavPec-z.js.map} +1 -1
- package/lib/{RouteGuard-CX6A77iy.js → RouteGuard-Vnlz_t51.js} +2 -2
- package/lib/{RouteGuard-CX6A77iy.js.map → RouteGuard-Vnlz_t51.js.map} +1 -1
- package/lib/{SchemaList--_f8Azv0.js → SchemaList-DETyCVqu.js} +8 -8
- package/lib/{SchemaList--_f8Azv0.js.map → SchemaList-DETyCVqu.js.map} +1 -1
- package/lib/{SchemaView-7XWvSrbX.js → SchemaView-Dvxo2RNe.js} +6 -6
- package/lib/{SchemaView-7XWvSrbX.js.map → SchemaView-Dvxo2RNe.js.map} +1 -1
- package/lib/{SignUp-CXCezG-m.js → SignUp-ClYhZq9H.js} +3 -3
- package/lib/{SignUp-CXCezG-m.js.map → SignUp-ClYhZq9H.js.map} +1 -1
- package/lib/{Slot-tFjhrd8V.js → Slot-B31yZlfB.js} +316 -336
- package/lib/{Slot-tFjhrd8V.js.map → Slot-B31yZlfB.js.map} +1 -1
- package/lib/Spinner-mNLZ6awP.js.map +1 -1
- package/lib/{SyntaxHighlight-Bp_UsIXG.js → SyntaxHighlight-bm761HDo.js} +3 -3
- package/lib/{SyntaxHighlight-Bp_UsIXG.js.map → SyntaxHighlight-bm761HDo.js.map} +1 -1
- package/lib/{Toc-Ck0YQtmd.js → Toc-D4oBWE8D.js} +3 -3
- package/lib/{Toc-Ck0YQtmd.js.map → Toc-D4oBWE8D.js.map} +1 -1
- package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +1 -1
- package/lib/{circular-BtKlhs07.js → circular-CRbFI6Zl.js} +2 -2
- package/lib/{circular-BtKlhs07.js.map → circular-CRbFI6Zl.js.map} +1 -1
- package/lib/{cn-wvCW-ho6.js → cn-dYga0KKN.js} +2 -2
- package/lib/cn-dYga0KKN.js.map +1 -0
- package/lib/{createServer-Di2U1Dg0.js → createServer-DNyGJJNX.js} +3398 -3552
- package/lib/createServer-DNyGJJNX.js.map +1 -0
- package/lib/errors-C1GlNcV3.js +44 -0
- package/lib/errors-C1GlNcV3.js.map +1 -0
- package/lib/hook-CZjW2buS.js.map +1 -1
- package/lib/index-Bm35Tkgf.js.map +1 -1
- package/lib/{index-CeQqiMIG.js → index-CZTEgYDd.js} +2 -2
- package/lib/{index-CeQqiMIG.js.map → index-CZTEgYDd.js.map} +1 -1
- package/lib/{index-BTqwnlI5.js → index-C_PXQ8Bx.js} +612 -610
- package/lib/{index-BTqwnlI5.js.map → index-C_PXQ8Bx.js.map} +1 -1
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/{index-DKCEJ4Kd.js → index-D09PbNex.js} +911 -911
- package/lib/index-D09PbNex.js.map +1 -0
- package/lib/index-DI5SPFK9.js.map +1 -1
- package/lib/index-DmNq2fbN.js.map +1 -1
- package/lib/index.esm-Cp4wkyud.js.map +1 -1
- package/lib/invariant-DAFpPywt.js.map +1 -1
- package/lib/jsx-runtime-C5mzlN2N.js.map +1 -1
- package/lib/processors/removeExtensions.js.map +1 -1
- package/lib/processors/removeParameters.js.map +1 -1
- package/lib/processors/removePaths.js.map +1 -1
- package/lib/processors/traverse.js.map +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/Accordion.js.map +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Alert.js +1 -1
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/AlertDialog.js.map +1 -1
- package/lib/ui/Badge.js +1 -1
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Breadcrumb.js.map +1 -1
- package/lib/ui/Button.js +1 -1
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +1 -1
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Card.js.map +1 -1
- package/lib/ui/Carousel.js +1 -1
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +1 -1
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/CodeBlock.js +2 -2
- package/lib/ui/Command.js +2 -2
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +2 -2
- package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/Form.js.map +1 -1
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/HoverCard.js.map +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Input.js.map +1 -1
- package/lib/ui/Label.js +1 -1
- package/lib/ui/Label.js.map +1 -1
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Pagination.js.map +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Popover.js.map +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/Progress.js.map +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/RadioGroup.js.map +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/ScrollArea.js.map +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Skeleton.js.map +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Slider.js.map +1 -1
- package/lib/ui/Stepper.js.map +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/Switch.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Tabs.js.map +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Textarea.js.map +1 -1
- package/lib/ui/Toggle.js +1 -1
- package/lib/ui/Toggle.js.map +1 -1
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/ToggleGroup.js.map +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/ui/Tooltip.js.map +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/useExposedProps-BIYjecPD.js.map +1 -1
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +40 -9882
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +20 -19
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.auth-supabase.js +97 -0
- package/lib/zudoku.auth-supabase.js.map +1 -0
- package/lib/zudoku.components.js +3 -3
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.icons.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +4 -4
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +6 -6
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +5 -5
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +15 -15
- package/src/app/main.css +26 -5
- package/src/lib/components/Header.tsx +1 -1
- package/src/lib/components/Markdown.tsx +3 -3
- package/src/lib/components/NotFoundPage.tsx +3 -2
- package/src/lib/components/Typography.tsx +1 -1
- package/src/lib/core/ZudokuContext.ts +1 -0
- package/src/lib/errors/ErrorAlert.tsx +5 -7
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +8 -2
- package/src/lib/ui/CodeBlock.tsx +1 -1
- package/src/lib/ui/EmbeddedCodeBlock.tsx +1 -1
- package/dist/flat-config.d.ts +0 -325
- package/lib/OperationList-YZ7k-Rkt.js.map +0 -1
- package/lib/clerk-BDZ31hjU.js +0 -25190
- package/lib/clerk-BDZ31hjU.js.map +0 -1
- package/lib/cn-wvCW-ho6.js.map +0 -1
- package/lib/createServer-Di2U1Dg0.js.map +0 -1
- package/lib/errors-Dv_yAK6M.js +0 -78
- package/lib/errors-Dv_yAK6M.js.map +0 -1
- package/lib/index-DKCEJ4Kd.js.map +0 -1
package/lib/zudoku.auth-clerk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as l } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { LogOutIcon as g } from "lucide-react";
|
|
3
|
-
import { S as f, a as w, b as p } from "./SignUp-
|
|
3
|
+
import { S as f, a as w, b as p } from "./SignUp-ClYhZq9H.js";
|
|
4
4
|
import { u as n } from "./hook-CZjW2buS.js";
|
|
5
5
|
const y = ({
|
|
6
6
|
clerkPubKey: d,
|
|
@@ -11,7 +11,7 @@ const y = ({
|
|
|
11
11
|
let s;
|
|
12
12
|
const a = (async () => {
|
|
13
13
|
if (typeof window > "u") return;
|
|
14
|
-
const { Clerk: e } = await import("
|
|
14
|
+
const { Clerk: e } = await import("@clerk/clerk-js");
|
|
15
15
|
if (s = new e(d), await s.load(), s.user) {
|
|
16
16
|
const i = s.user.emailAddresses.find(
|
|
17
17
|
(o) => o.verification.status === "verified"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.auth-clerk.js","sources":["../src/lib/authentication/providers/clerk.tsx"],"sourcesContent":["import type { Clerk } from \"@clerk/clerk-js\";\nimport { LogOutIcon } from \"lucide-react\";\nimport { type ZudokuPlugin } from \"zudoku/plugins\";\nimport { type ClerkAuthenticationConfig } from \"../../../config/config.js\";\nimport {\n type AuthenticationPlugin,\n type AuthenticationProviderInitializer,\n} from \"../authentication.js\";\nimport { SignIn } from \"../components/SignIn.js\";\nimport { SignOut } from \"../components/SignOut.js\";\nimport { SignUp } from \"../components/SignUp.js\";\nimport { useAuthState } from \"../state.js\";\n\nconst clerkAuth: AuthenticationProviderInitializer<\n ClerkAuthenticationConfig\n> = ({\n clerkPubKey,\n redirectToAfterSignOut = \"/\",\n redirectToAfterSignUp,\n redirectToAfterSignIn,\n}): AuthenticationPlugin & ZudokuPlugin => {\n let clerkApi: Clerk | undefined;\n const ensureLoaded = (async () => {\n if (typeof window === \"undefined\") return;\n const { Clerk } = await import(\"@clerk/clerk-js\");\n clerkApi = new Clerk(clerkPubKey);\n\n await clerkApi.load();\n\n if (clerkApi.user) {\n const verifiedEmail = clerkApi.user.emailAddresses.find(\n (email) => email.verification.status === \"verified\",\n );\n useAuthState.getState().setLoggedIn({\n profile: {\n sub: clerkApi.user.id,\n name: clerkApi.user.fullName ?? undefined,\n email:\n verifiedEmail?.emailAddress ??\n clerkApi.user.emailAddresses[0]?.emailAddress,\n emailVerified: verifiedEmail !== undefined,\n pictureUrl: clerkApi.user.imageUrl,\n },\n providerData: {\n user: {\n publicMetadata: clerkApi.user.publicMetadata,\n id: clerkApi.user.id,\n emailAddresses: clerkApi.user.emailAddresses,\n imageUrl: clerkApi.user.imageUrl,\n fullName: clerkApi.user.fullName,\n },\n },\n });\n }\n\n return clerkApi;\n })();\n\n async function getAccessToken() {\n await ensureLoaded;\n if (!clerkApi?.session) {\n throw new Error(\"No session available\");\n }\n const response = await clerkApi.session.getToken();\n if (!response) {\n throw new Error(\"Could not get access token from Clerk\");\n }\n return response;\n }\n\n async function signRequest(request: Request): Promise<Request> {\n const response = await getAccessToken();\n request.headers.set(\"Authorization\", `Bearer ${response}`);\n return request;\n }\n\n return {\n getRoutes: () => {\n return [\n {\n path: \"/signout\",\n element: <SignOut />,\n },\n {\n path: \"/signin\",\n element: <SignIn />,\n },\n {\n path: \"/signup\",\n element: <SignUp />,\n },\n ];\n },\n\n getProfileMenuItems() {\n return [\n {\n label: \"Logout\",\n path: \"/signout\",\n category: \"bottom\",\n icon: LogOutIcon,\n } as const,\n ];\n },\n initialize: async () => {\n const clerk = await ensureLoaded;\n\n if (!clerk) {\n return;\n }\n\n if (clerk.session) {\n const verifiedEmail = clerk.session.user.emailAddresses.find(\n (email) => email.verification.status === \"verified\",\n );\n useAuthState.getState().setLoggedIn({\n profile: {\n sub: clerk.session.user.id,\n name: clerk.session.user.fullName ?? undefined,\n email:\n verifiedEmail?.emailAddress ??\n clerk.session.user.emailAddresses[0]?.emailAddress,\n emailVerified: verifiedEmail !== undefined,\n pictureUrl: clerk.session.user.imageUrl,\n },\n providerData: {\n user: clerk.session.user,\n },\n });\n } else {\n useAuthState.setState({\n isAuthenticated: false,\n isPending: false,\n profile: undefined,\n });\n }\n },\n getAccessToken,\n signRequest,\n signOut: async () => {\n await ensureLoaded;\n await clerkApi?.signOut({\n redirectUrl: window.location.origin + redirectToAfterSignOut,\n });\n useAuthState.getState().setLoggedOut();\n },\n signIn: async ({ redirectTo }: { redirectTo?: string } = {}) => {\n await ensureLoaded;\n await clerkApi?.redirectToSignIn({\n signInForceRedirectUrl: redirectToAfterSignIn\n ? window.location.origin + redirectToAfterSignIn\n : redirectTo,\n signUpForceRedirectUrl: redirectToAfterSignUp\n ? window.location.origin + redirectToAfterSignUp\n : redirectTo,\n });\n },\n signUp: async ({ redirectTo }: { redirectTo?: string } = {}) => {\n await ensureLoaded;\n await clerkApi?.redirectToSignUp({\n signInForceRedirectUrl: redirectToAfterSignIn\n ? window.location.origin + redirectToAfterSignIn\n : redirectTo,\n signUpForceRedirectUrl: redirectToAfterSignUp\n ? window.location.origin + redirectToAfterSignUp\n : redirectTo,\n });\n },\n };\n};\n\nexport default clerkAuth;\n"],"names":["clerkAuth","clerkPubKey","redirectToAfterSignOut","redirectToAfterSignUp","redirectToAfterSignIn","clerkApi","ensureLoaded","Clerk","verifiedEmail","email","useAuthState","getAccessToken","response","signRequest","request","SignOut","SignIn","SignUp","LogOutIcon","clerk","redirectTo"],"mappings":";;;;AAaA,MAAMA,IAEF,CAAC;AAAA,EACH,aAAAC;AAAA,EACA,wBAAAC,IAAyB;AAAA,EACzB,uBAAAC;AAAA,EACA,uBAAAC;AACF,MAA2C;
|
|
1
|
+
{"version":3,"file":"zudoku.auth-clerk.js","sources":["../src/lib/authentication/providers/clerk.tsx"],"sourcesContent":["import type { Clerk } from \"@clerk/clerk-js\";\nimport { LogOutIcon } from \"lucide-react\";\nimport { type ZudokuPlugin } from \"zudoku/plugins\";\nimport { type ClerkAuthenticationConfig } from \"../../../config/config.js\";\nimport {\n type AuthenticationPlugin,\n type AuthenticationProviderInitializer,\n} from \"../authentication.js\";\nimport { SignIn } from \"../components/SignIn.js\";\nimport { SignOut } from \"../components/SignOut.js\";\nimport { SignUp } from \"../components/SignUp.js\";\nimport { useAuthState } from \"../state.js\";\n\nconst clerkAuth: AuthenticationProviderInitializer<\n ClerkAuthenticationConfig\n> = ({\n clerkPubKey,\n redirectToAfterSignOut = \"/\",\n redirectToAfterSignUp,\n redirectToAfterSignIn,\n}): AuthenticationPlugin & ZudokuPlugin => {\n let clerkApi: Clerk | undefined;\n const ensureLoaded = (async () => {\n if (typeof window === \"undefined\") return;\n const { Clerk } = await import(\"@clerk/clerk-js\");\n clerkApi = new Clerk(clerkPubKey);\n\n await clerkApi.load();\n\n if (clerkApi.user) {\n const verifiedEmail = clerkApi.user.emailAddresses.find(\n (email) => email.verification.status === \"verified\",\n );\n useAuthState.getState().setLoggedIn({\n profile: {\n sub: clerkApi.user.id,\n name: clerkApi.user.fullName ?? undefined,\n email:\n verifiedEmail?.emailAddress ??\n clerkApi.user.emailAddresses[0]?.emailAddress,\n emailVerified: verifiedEmail !== undefined,\n pictureUrl: clerkApi.user.imageUrl,\n },\n providerData: {\n user: {\n publicMetadata: clerkApi.user.publicMetadata,\n id: clerkApi.user.id,\n emailAddresses: clerkApi.user.emailAddresses,\n imageUrl: clerkApi.user.imageUrl,\n fullName: clerkApi.user.fullName,\n },\n },\n });\n }\n\n return clerkApi;\n })();\n\n async function getAccessToken() {\n await ensureLoaded;\n if (!clerkApi?.session) {\n throw new Error(\"No session available\");\n }\n const response = await clerkApi.session.getToken();\n if (!response) {\n throw new Error(\"Could not get access token from Clerk\");\n }\n return response;\n }\n\n async function signRequest(request: Request): Promise<Request> {\n const response = await getAccessToken();\n request.headers.set(\"Authorization\", `Bearer ${response}`);\n return request;\n }\n\n return {\n getRoutes: () => {\n return [\n {\n path: \"/signout\",\n element: <SignOut />,\n },\n {\n path: \"/signin\",\n element: <SignIn />,\n },\n {\n path: \"/signup\",\n element: <SignUp />,\n },\n ];\n },\n\n getProfileMenuItems() {\n return [\n {\n label: \"Logout\",\n path: \"/signout\",\n category: \"bottom\",\n icon: LogOutIcon,\n } as const,\n ];\n },\n initialize: async () => {\n const clerk = await ensureLoaded;\n\n if (!clerk) {\n return;\n }\n\n if (clerk.session) {\n const verifiedEmail = clerk.session.user.emailAddresses.find(\n (email) => email.verification.status === \"verified\",\n );\n useAuthState.getState().setLoggedIn({\n profile: {\n sub: clerk.session.user.id,\n name: clerk.session.user.fullName ?? undefined,\n email:\n verifiedEmail?.emailAddress ??\n clerk.session.user.emailAddresses[0]?.emailAddress,\n emailVerified: verifiedEmail !== undefined,\n pictureUrl: clerk.session.user.imageUrl,\n },\n providerData: {\n user: clerk.session.user,\n },\n });\n } else {\n useAuthState.setState({\n isAuthenticated: false,\n isPending: false,\n profile: undefined,\n });\n }\n },\n getAccessToken,\n signRequest,\n signOut: async () => {\n await ensureLoaded;\n await clerkApi?.signOut({\n redirectUrl: window.location.origin + redirectToAfterSignOut,\n });\n useAuthState.getState().setLoggedOut();\n },\n signIn: async ({ redirectTo }: { redirectTo?: string } = {}) => {\n await ensureLoaded;\n await clerkApi?.redirectToSignIn({\n signInForceRedirectUrl: redirectToAfterSignIn\n ? window.location.origin + redirectToAfterSignIn\n : redirectTo,\n signUpForceRedirectUrl: redirectToAfterSignUp\n ? window.location.origin + redirectToAfterSignUp\n : redirectTo,\n });\n },\n signUp: async ({ redirectTo }: { redirectTo?: string } = {}) => {\n await ensureLoaded;\n await clerkApi?.redirectToSignUp({\n signInForceRedirectUrl: redirectToAfterSignIn\n ? window.location.origin + redirectToAfterSignIn\n : redirectTo,\n signUpForceRedirectUrl: redirectToAfterSignUp\n ? window.location.origin + redirectToAfterSignUp\n : redirectTo,\n });\n },\n };\n};\n\nexport default clerkAuth;\n"],"names":["clerkAuth","clerkPubKey","redirectToAfterSignOut","redirectToAfterSignUp","redirectToAfterSignIn","clerkApi","ensureLoaded","Clerk","verifiedEmail","email","useAuthState","getAccessToken","response","signRequest","request","SignOut","SignIn","SignUp","LogOutIcon","clerk","redirectTo"],"mappings":";;;;AAaA,MAAMA,IAEF,CAAC;AAAA,EACH,aAAAC;AAAA,EACA,wBAAAC,IAAyB;AAAA,EACzB,uBAAAC;AAAA,EACA,uBAAAC;AACF,MAA2C;AACzC,MAAIC;AACJ,QAAMC,KAAgB,YAAY;AAChC,QAAI,OAAO,SAAW,IAAa;AACnC,UAAM,EAAE,OAAAC,EAAA,IAAU,MAAM,OAAO,iBAAiB;AAKhD,QAJAF,IAAW,IAAIE,EAAMN,CAAW,GAEhC,MAAMI,EAAS,KAAA,GA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A,QACJ,wBAAwBjB,IACpB,OAAO,SAAS,SAASA,IACzBiB;AAAA,MAAA,CACL;AAAA,IACH;AAAA,IACA,QAAQ,OAAO,EAAE,YAAAA,EAAA,IAAwC,OAAO;AAC9D,YAAMd,GACN,MAAMD,GAAU,iBAAiB;AAAA,QAC/B,wBAAwBD,IACpB,OAAO,SAAS,SAASA,IACzBgB;AAAA,QACJ,wBAAwBjB,IACpB,OAAO,SAAS,SAASA,IACzBiB;AAAA,MAAA,CACL;AAAA,IACH;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { j as ne } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { g as Le } from "./invariant-DAFpPywt.js";
|
|
3
3
|
import { C as Ue } from "./ClientOnly-E7hGysn1.js";
|
|
4
|
-
import { j as
|
|
5
|
-
import { C as
|
|
4
|
+
import { j as Ce, u as S } from "./hook-CZjW2buS.js";
|
|
5
|
+
import { C as xe, O as re, A as R } from "./errors-C1GlNcV3.js";
|
|
6
|
+
import { C as Ie } from "./CallbackHandler-Dr5Lva9x.js";
|
|
6
7
|
var O = { exports: {} }, je = O.exports, oe;
|
|
7
8
|
function De() {
|
|
8
9
|
return oe || (oe = 1, function(t) {
|
|
@@ -241,7 +242,7 @@ function G(t) {
|
|
|
241
242
|
}
|
|
242
243
|
return t;
|
|
243
244
|
}
|
|
244
|
-
function
|
|
245
|
+
function C(t) {
|
|
245
246
|
return !(t === null || typeof t != "object" || Array.isArray(t));
|
|
246
247
|
}
|
|
247
248
|
function N(t) {
|
|
@@ -300,7 +301,7 @@ async function Ze(t, e) {
|
|
|
300
301
|
} catch (o) {
|
|
301
302
|
throw new a('failed to parse "response" body as JSON', { cause: o });
|
|
302
303
|
}
|
|
303
|
-
if (!
|
|
304
|
+
if (!C(n))
|
|
304
305
|
throw new a('"response" body must be a top level object');
|
|
305
306
|
if (!w(n.issuer))
|
|
306
307
|
throw new a('"response" body "issuer" property must be a non-empty string');
|
|
@@ -391,7 +392,7 @@ function ge(t) {
|
|
|
391
392
|
function Z() {
|
|
392
393
|
return Math.floor(Date.now() / 1e3);
|
|
393
394
|
}
|
|
394
|
-
function
|
|
395
|
+
function x(t) {
|
|
395
396
|
if (typeof t != "object" || t === null)
|
|
396
397
|
throw new TypeError('"as" must be an object');
|
|
397
398
|
if (!w(t.issuer))
|
|
@@ -504,7 +505,7 @@ async function dt(t, e, n, o, s, r) {
|
|
|
504
505
|
}).then(G);
|
|
505
506
|
}
|
|
506
507
|
async function ht(t, e, n, o) {
|
|
507
|
-
|
|
508
|
+
x(t), I(e);
|
|
508
509
|
const s = ye(t, "userinfo_endpoint", be(e, o)), r = N(o?.headers);
|
|
509
510
|
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), dt(n, "GET", s, r, null, {
|
|
510
511
|
...o,
|
|
@@ -527,7 +528,7 @@ async function _e(t, e, n, o, s) {
|
|
|
527
528
|
return i.set("accept", "application/json"), ft(t, e, "POST", r, o, i, s);
|
|
528
529
|
}
|
|
529
530
|
async function de(t, e, n, o) {
|
|
530
|
-
if (
|
|
531
|
+
if (x(t), I(e), !w(n))
|
|
531
532
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
532
533
|
const s = new URLSearchParams(o?.additionalParameters);
|
|
533
534
|
return s.set("refresh_token", n), _e(t, e, "refresh_token", s, o);
|
|
@@ -542,7 +543,7 @@ function pt(t) {
|
|
|
542
543
|
return e[0];
|
|
543
544
|
}
|
|
544
545
|
async function Se(t, e, n, o = !1, s = !1) {
|
|
545
|
-
if (
|
|
546
|
+
if (x(t), I(e), !q(n, Response))
|
|
546
547
|
throw new TypeError('"response" must be an instance of Response');
|
|
547
548
|
if (n.status !== 200) {
|
|
548
549
|
let i;
|
|
@@ -557,7 +558,7 @@ async function Se(t, e, n, o = !1, s = !1) {
|
|
|
557
558
|
} catch (i) {
|
|
558
559
|
throw new a('failed to parse "response" body as JSON', { cause: i });
|
|
559
560
|
}
|
|
560
|
-
if (!
|
|
561
|
+
if (!C(r))
|
|
561
562
|
throw new a('"response" body must be a top level object');
|
|
562
563
|
if (!w(r.access_token))
|
|
563
564
|
throw new a('"response" body "access_token" property must be a non-empty string');
|
|
@@ -610,7 +611,7 @@ function gt(t) {
|
|
|
610
611
|
return Te.add(t), t;
|
|
611
612
|
}
|
|
612
613
|
async function yt(t, e, n, o, s, r) {
|
|
613
|
-
if (
|
|
614
|
+
if (x(t), I(e), !Te.has(n))
|
|
614
615
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
615
616
|
if (!w(o))
|
|
616
617
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
@@ -687,7 +688,7 @@ async function Tt(t) {
|
|
|
687
688
|
Q(t);
|
|
688
689
|
try {
|
|
689
690
|
const e = await t.json();
|
|
690
|
-
if (
|
|
691
|
+
if (C(e) && typeof e.error == "string" && e.error.length)
|
|
691
692
|
return e.error_description !== void 0 && typeof e.error_description != "string" && delete e.error_description, e.error_uri !== void 0 && typeof e.error_uri != "string" && delete e.error_uri, e.algs !== void 0 && typeof e.algs != "string" && delete e.algs, e.scope !== void 0 && typeof e.scope != "string" && delete e.scope, e;
|
|
692
693
|
} catch {
|
|
693
694
|
}
|
|
@@ -757,7 +758,7 @@ async function Et(t, e, n, o, s, r) {
|
|
|
757
758
|
} catch (l) {
|
|
758
759
|
throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
|
|
759
760
|
}
|
|
760
|
-
if (!
|
|
761
|
+
if (!C(p))
|
|
761
762
|
throw new a("JWT Header must be a top level object");
|
|
762
763
|
if (e(p), p.crit !== void 0)
|
|
763
764
|
throw new a('unexpected JWT "crit" header parameter');
|
|
@@ -770,7 +771,7 @@ async function Et(t, e, n, o, s, r) {
|
|
|
770
771
|
} catch (l) {
|
|
771
772
|
throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
|
|
772
773
|
}
|
|
773
|
-
if (!
|
|
774
|
+
if (!C(f))
|
|
774
775
|
throw new a("JWT Payload must be a top level object");
|
|
775
776
|
const P = Z() + o;
|
|
776
777
|
if (f.exp !== void 0) {
|
|
@@ -815,7 +816,7 @@ function T(t, e) {
|
|
|
815
816
|
}
|
|
816
817
|
const Pt = Symbol(), Lt = Symbol();
|
|
817
818
|
function Ut(t, e, n, o) {
|
|
818
|
-
if (
|
|
819
|
+
if (x(t), I(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
819
820
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
820
821
|
if (T(n, "response"))
|
|
821
822
|
throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
@@ -853,7 +854,7 @@ function Ut(t, e, n, o) {
|
|
|
853
854
|
return gt(new URLSearchParams(n));
|
|
854
855
|
}
|
|
855
856
|
const $ = "code-verifier", F = "oauth-state", pe = "/oauth/callback";
|
|
856
|
-
class
|
|
857
|
+
class Ct extends xe {
|
|
857
858
|
client;
|
|
858
859
|
issuer;
|
|
859
860
|
authorizationServer;
|
|
@@ -877,7 +878,7 @@ class xt extends Ce {
|
|
|
877
878
|
super(), this.client = {
|
|
878
879
|
client_id: o,
|
|
879
880
|
token_endpoint_auth_method: "none"
|
|
880
|
-
}, this.audience = n, this.issuer = e, this.callbackUrlPath =
|
|
881
|
+
}, this.audience = n, this.issuer = e, this.callbackUrlPath = Ce(u, pe), this.scopes = d ?? ["openid", "profile", "email"], this.redirectToAfterSignUp = s, this.redirectToAfterSignIn = r, this.redirectToAfterSignOut = i;
|
|
881
882
|
}
|
|
882
883
|
async getAuthServer() {
|
|
883
884
|
if (!this.authorizationServer) {
|
|
@@ -1105,10 +1106,10 @@ class xt extends Ce {
|
|
|
1105
1106
|
];
|
|
1106
1107
|
}
|
|
1107
1108
|
}
|
|
1108
|
-
const
|
|
1109
|
+
const zt = (t) => new Ct(t);
|
|
1109
1110
|
export {
|
|
1110
1111
|
pe as OPENID_CALLBACK_PATH,
|
|
1111
|
-
|
|
1112
|
-
|
|
1112
|
+
Ct as OpenIDAuthenticationProvider,
|
|
1113
|
+
zt as default
|
|
1113
1114
|
};
|
|
1114
1115
|
//# sourceMappingURL=zudoku.auth-openid.js.map
|