zudoku 0.0.0-z7b86faab → 0.0.0-z8ac421f0
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/main.js +1 -1
- package/dist/app/main.js.map +1 -1
- package/dist/config/create-plugin.d.ts +2 -0
- package/dist/config/create-plugin.js +55 -0
- package/dist/config/create-plugin.js.map +1 -0
- package/dist/config/loader.js +2 -2
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +174 -124
- package/dist/config/validators/InputNavigationSchema.js +17 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/NavigationSchema.d.ts +10 -2
- package/dist/config/validators/NavigationSchema.js +7 -0
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +6 -5
- package/dist/config/validators/validate.js +2 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +36 -24
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Bootstrap.js +1 -2
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/MobileTopNavigation.js +2 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Slot.test.js +1 -1
- package/dist/lib/components/Slot.test.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +7 -1
- package/dist/lib/components/TopNavigation.js +7 -2
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.d.ts +4 -1
- package/dist/lib/components/Zudoku.js +4 -7
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +9 -4
- package/dist/lib/components/context/ZudokuContext.js +4 -2
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuProvider.js +1 -1
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
- package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
- package/dist/lib/components/context/ZudokuReactContext.js +4 -0
- package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
- package/dist/lib/components/index.d.ts +18 -74
- package/dist/lib/components/index.js +19 -36
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Navigation.js +4 -3
- package/dist/lib/components/navigation/Navigation.js.map +1 -1
- package/dist/lib/components/navigation/NavigationCategory.js +8 -0
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/NavigationFilterContext.d.ts +8 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js +12 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js.map +1 -0
- package/dist/lib/components/navigation/NavigationFilterInput.d.ts +3 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js +9 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js.map +1 -0
- package/dist/lib/components/navigation/NavigationItem.js +11 -1
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +2 -1
- package/dist/lib/components/navigation/utils.js +22 -1
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +2 -1
- package/dist/lib/core/ZudokuContext.js +3 -1
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/__internal.d.ts +1 -0
- package/dist/lib/core/__internal.js +2 -0
- package/dist/lib/core/__internal.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +5 -1
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/core/transform-config.d.ts +4 -2
- package/dist/lib/core/transform-config.js +33 -13
- package/dist/lib/core/transform-config.js.map +1 -1
- package/dist/lib/core/transform-config.test.d.ts +1 -0
- package/dist/lib/core/transform-config.test.js +83 -0
- package/dist/lib/core/transform-config.test.js.map +1 -0
- package/dist/lib/errors/ErrorAlert.js +1 -2
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/hooks/index.d.ts +7 -30
- package/dist/lib/hooks/index.js +7 -15
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/hooks/useEvent.test.js +1 -1
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/oas/graphql/circular.d.ts +1 -1
- package/dist/lib/oas/graphql/circular.js +18 -35
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/graphql/circular.test.js +33 -2
- package/dist/lib/oas/graphql/circular.test.js.map +1 -1
- package/dist/lib/oas/parser/index.js +14 -5
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.js +8 -5
- package/dist/lib/plugins/openapi/ParamInfos.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/playground/fileUtils.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js +3 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js +20 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +7 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +2 -2
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/ui/Alert.d.ts +3 -2
- package/dist/lib/ui/Alert.js +9 -5
- package/dist/lib/ui/Alert.js.map +1 -1
- package/dist/lib/ui/InputGroup.d.ts +16 -0
- package/dist/lib/ui/InputGroup.js +65 -0
- package/dist/lib/ui/InputGroup.js.map +1 -0
- package/dist/lib/ui/Secret.js +2 -2
- package/dist/lib/ui/Secret.js.map +1 -1
- package/dist/lib/util/flattenAllOf.d.ts +0 -2
- package/dist/lib/util/flattenAllOf.js +6 -46
- package/dist/lib/util/flattenAllOf.js.map +1 -1
- package/dist/lib/util/flattenAllOf.test.js +28 -1
- package/dist/lib/util/flattenAllOf.test.js.map +1 -1
- package/dist/lib/util/flattenAllOfProcessor.d.ts +2 -0
- package/dist/lib/util/flattenAllOfProcessor.js +48 -0
- package/dist/lib/util/flattenAllOfProcessor.js.map +1 -0
- package/dist/lib/util/readFrontmatter.js +2 -1
- package/dist/lib/util/readFrontmatter.js.map +1 -1
- package/dist/vite/api/SchemaManager.js +1 -1
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +1 -1
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/build.js +91 -73
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +5 -2
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/mdx/remark-inject-filepath.js +5 -1
- package/dist/vite/mdx/remark-inject-filepath.js.map +1 -1
- package/dist/vite/mdx/remark-link-rewrite.js +3 -2
- package/dist/vite/mdx/remark-link-rewrite.js.map +1 -1
- package/dist/vite/plugin-config.js +16 -4
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.js +9 -7
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +4 -2
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/dist/vite/plugin-theme.js +2 -1
- package/dist/vite/plugin-theme.js.map +1 -1
- package/dist/vite/prerender/prerender.js +3 -1
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/worker.js +3 -1
- package/dist/vite/prerender/worker.js.map +1 -1
- package/lib/{ClaudeLogo-DJ9bU-sO.js → ClaudeLogo-Br8C_vTq.js} +26 -22
- package/lib/{ClaudeLogo-DJ9bU-sO.js.map → ClaudeLogo-Br8C_vTq.js.map} +1 -1
- package/lib/Drawer-Ch7927PF.js.map +1 -1
- package/lib/{HydrationBoundary-CNF2ZV3E.js → HydrationBoundary-CJu4vUlG.js} +6 -6
- package/lib/{HydrationBoundary-CNF2ZV3E.js.map → HydrationBoundary-CJu4vUlG.js.map} +1 -1
- package/lib/{MdxPage-stpAoBtx.js → MdxPage-C0QFAsgv.js} +8 -8
- package/lib/{MdxPage-stpAoBtx.js.map → MdxPage-C0QFAsgv.js.map} +1 -1
- package/lib/Mermaid-Chx5BPHn.js +104 -0
- package/lib/Mermaid-Chx5BPHn.js.map +1 -0
- package/lib/{OAuthErrorPage-DJ811Bn_.js → OAuthErrorPage-CFz_gBFx.js} +22 -19
- package/lib/{OAuthErrorPage-DJ811Bn_.js.map → OAuthErrorPage-CFz_gBFx.js.map} +1 -1
- package/lib/{OasProvider-CS_ASmBB.js → OasProvider-BwIOIlky.js} +3 -3
- package/lib/{OasProvider-CS_ASmBB.js.map → OasProvider-BwIOIlky.js.map} +1 -1
- package/lib/OperationList-DYRzbPJu.js +5908 -0
- package/lib/OperationList-DYRzbPJu.js.map +1 -0
- package/lib/{RouteGuard--A04ESy8.js → RouteGuard-CVs3yvEs.js} +5 -5
- package/lib/{RouteGuard--A04ESy8.js.map → RouteGuard-CVs3yvEs.js.map} +1 -1
- package/lib/{SchemaList-BJZJv1gD.js → SchemaList-D4FEyoDV.js} +8 -8
- package/lib/{SchemaList-BJZJv1gD.js.map → SchemaList-D4FEyoDV.js.map} +1 -1
- package/lib/{SchemaView-U4JMYB3N.js → SchemaView-ScvkhsYE.js} +116 -110
- package/lib/SchemaView-ScvkhsYE.js.map +1 -0
- package/lib/{Secret-BDBqq4p3.js → Secret-DUpgv4V3.js} +92 -72
- package/lib/Secret-DUpgv4V3.js.map +1 -0
- package/lib/{SignUp-DCBViNUi.js → SignUp-Dug1jAGC.js} +31 -26
- package/lib/{SignUp-DCBViNUi.js.map → SignUp-Dug1jAGC.js.map} +1 -1
- package/lib/{SyntaxHighlight-Dshjn3Zf.js → SyntaxHighlight-BMu0b_hF.js} +9 -9
- package/lib/{SyntaxHighlight-Dshjn3Zf.js.map → SyntaxHighlight-BMu0b_hF.js.map} +1 -1
- package/lib/{Toc-Cgz6CPiE.js → Toc-BiJ2YL0O.js} +2 -2
- package/lib/{Toc-Cgz6CPiE.js.map → Toc-BiJ2YL0O.js.map} +1 -1
- package/lib/{index-CL8eDnQW.js → Zudoku-iyiXgWFY.js} +2996 -2859
- package/lib/Zudoku-iyiXgWFY.js.map +1 -0
- package/lib/ZudokuContext-CYyb_PB_.js +175 -0
- package/lib/ZudokuContext-CYyb_PB_.js.map +1 -0
- package/lib/ZudokuReactContext-DGJAP1sN.js +222 -0
- package/lib/ZudokuReactContext-DGJAP1sN.js.map +1 -0
- package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -1
- package/lib/{circular-BmMJjG1v.js → circular-BOpxmAie.js} +1327 -1346
- package/lib/{circular-BmMJjG1v.js.map → circular-BOpxmAie.js.map} +1 -1
- package/lib/createServer-BunbJzB5.js +13038 -0
- package/lib/createServer-BunbJzB5.js.map +1 -0
- package/lib/{errors-b9I-fAOY.js → errors-B77S9iOc.js} +3 -3
- package/lib/{errors-b9I-fAOY.js.map → errors-B77S9iOc.js.map} +1 -1
- package/lib/{firebase-BCXX7Qv5.js → firebase-C7XKRGLf.js} +26 -25
- package/lib/{firebase-BCXX7Qv5.js.map → firebase-C7XKRGLf.js.map} +1 -1
- package/lib/{hook-BGlHBdET.js → hook-Dz_n9SoE.js} +16 -15
- package/lib/{hook-BGlHBdET.js.map → hook-Dz_n9SoE.js.map} +1 -1
- package/lib/{index-UOLtazB8.js → index-BDp2MTiq.js} +2 -2
- package/lib/{index-UOLtazB8.js.map → index-BDp2MTiq.js.map} +1 -1
- package/lib/{index-O9RHI87z.js → index-Bx29qHVi.js} +589 -551
- package/lib/index-Bx29qHVi.js.map +1 -0
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/index-DAWHN3cH.js +86 -0
- package/lib/index-DAWHN3cH.js.map +1 -0
- package/lib/index.esm-BYObtETB.js.map +1 -1
- package/lib/{index.esm-B_0dvNjB.js → index.esm-Ca5zvoff.js} +20 -20
- package/lib/{index.esm-B_0dvNjB.js.map → index.esm-Ca5zvoff.js.map} +1 -1
- package/lib/{index.esm-C5CBsVzN.js → index.esm-Cth49JBv.js} +2 -2
- package/lib/index.esm-Cth49JBv.js.map +1 -0
- package/lib/{invariant-BJAl77rw.js → invariant-B_t_F2s_.js} +3 -3
- package/lib/{invariant-BJAl77rw.js.map → invariant-B_t_F2s_.js.map} +1 -1
- package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
- package/lib/{mutation-BISOc7OM.js → mutation-B7eFBLZY.js} +2 -2
- package/lib/{mutation-BISOc7OM.js.map → mutation-B7eFBLZY.js.map} +1 -1
- package/lib/ui/Alert.js +32 -20
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/InputGroup.js +155 -0
- package/lib/ui/InputGroup.js.map +1 -0
- package/lib/ui/Secret.js +2 -2
- package/lib/ui/Secret.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/useExposedProps-CzTDfXfq.js +30 -0
- package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
- package/lib/{useMutation-CFMGlAMW.js → useMutation-CErliDZ9.js} +5 -5
- package/lib/{useMutation-CFMGlAMW.js.map → useMutation-CErliDZ9.js.map} +1 -1
- package/lib/{useSuspenseQuery-CSB_rVek.js → useQuery-ht7aWJ3S.js} +432 -446
- package/lib/useQuery-ht7aWJ3S.js.map +1 -0
- package/lib/useSuspenseQuery-DQH4Bmc2.js +18 -0
- package/lib/useSuspenseQuery-DQH4Bmc2.js.map +1 -0
- package/lib/zudoku.__internal.js +1519 -1033
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +6 -5
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +14 -13
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-firebase.js +5 -5
- package/lib/zudoku.auth-openid.js +8 -7
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.auth-supabase.js +4 -4
- package/lib/zudoku.components.js +31 -29
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +24 -11
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.mermaid.js +5 -4
- package/lib/zudoku.mermaid.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +41 -36
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +156 -153
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugin-search-pagefind.js +19 -18
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/lib/zudoku.react-query.js +26 -25
- package/lib/zudoku.react-query.js.map +1 -1
- package/lib/zudoku.router.js.map +1 -1
- package/package.json +17 -10
- package/src/app/defaultTheme.css +4 -0
- package/src/app/main.css +2 -0
- package/src/app/main.tsx +1 -1
- package/src/lib/components/Bootstrap.tsx +1 -4
- package/src/lib/components/MobileTopNavigation.tsx +13 -8
- package/src/lib/components/Slot.test.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +25 -7
- package/src/lib/components/Zudoku.tsx +18 -14
- package/src/lib/components/context/ZudokuContext.ts +3 -6
- package/src/lib/components/context/ZudokuProvider.tsx +1 -1
- package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
- package/src/lib/components/index.ts +19 -39
- package/src/lib/components/navigation/Navigation.tsx +4 -3
- package/src/lib/components/navigation/NavigationCategory.tsx +9 -0
- package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -0
- package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -0
- package/src/lib/components/navigation/NavigationItem.tsx +17 -1
- package/src/lib/components/navigation/utils.ts +32 -1
- package/src/lib/core/ZudokuContext.ts +7 -1
- package/src/lib/core/__internal.tsx +2 -0
- package/src/lib/core/plugins.ts +7 -3
- package/src/lib/core/transform-config.test.tsx +99 -0
- package/src/lib/core/transform-config.ts +57 -19
- package/src/lib/errors/ErrorAlert.tsx +1 -6
- package/src/lib/hooks/index.ts +7 -16
- package/src/lib/hooks/useEvent.test.tsx +1 -1
- package/src/lib/oas/graphql/circular.test.ts +37 -2
- package/src/lib/oas/graphql/circular.ts +25 -51
- package/src/lib/oas/parser/index.ts +17 -6
- package/src/lib/plugins/openapi/ParamInfos.tsx +10 -5
- package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -0
- package/src/lib/plugins/openapi/playground/fileUtils.ts +4 -0
- package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +33 -17
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +2 -0
- package/src/lib/ui/Alert.tsx +17 -5
- package/src/lib/ui/InputGroup.tsx +168 -0
- package/src/lib/ui/Secret.tsx +2 -2
- package/src/lib/util/flattenAllOf.test.ts +34 -1
- package/src/lib/util/flattenAllOf.ts +7 -57
- package/src/lib/util/flattenAllOfProcessor.ts +58 -0
- package/src/lib/util/readFrontmatter.ts +2 -1
- package/src/zuplo/enrich-with-zuplo-mcp.ts +168 -0
- package/src/zuplo/enrich-with-zuplo.ts +254 -0
- package/src/zuplo/policy-types.ts +46 -0
- package/src/zuplo/with-zuplo-processors.ts +35 -0
- package/src/zuplo/with-zuplo.ts +14 -0
- package/lib/Mermaid-Koc3z8mU.js +0 -102
- package/lib/Mermaid-Koc3z8mU.js.map +0 -1
- package/lib/OperationList-Dq_AB4W9.js +0 -5820
- package/lib/OperationList-Dq_AB4W9.js.map +0 -1
- package/lib/SchemaView-U4JMYB3N.js.map +0 -1
- package/lib/Secret-BDBqq4p3.js.map +0 -1
- package/lib/Separator-BXt1LYnm.js +0 -27
- package/lib/Separator-BXt1LYnm.js.map +0 -1
- package/lib/ZudokuContext-BZB1TWdT.js +0 -387
- package/lib/ZudokuContext-BZB1TWdT.js.map +0 -1
- package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js +0 -9
- package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +0 -1
- package/lib/createServer-CLSZ7hWJ.js +0 -16693
- package/lib/createServer-CLSZ7hWJ.js.map +0 -1
- package/lib/index-CL8eDnQW.js.map +0 -1
- package/lib/index-DBjOT2H1.js +0 -133
- package/lib/index-DBjOT2H1.js.map +0 -1
- package/lib/index-O9RHI87z.js.map +0 -1
- package/lib/index.esm-C5CBsVzN.js.map +0 -1
- package/lib/useSuspenseQuery-CSB_rVek.js.map +0 -1
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { TrashIcon as me, CircleSlashIcon as z, CheckIcon as xe, XIcon as ye, PencilLineIcon as ge, RefreshCwIcon as je, KeyRoundIcon as ve } from "lucide-react";
|
|
3
|
-
import { Z as M, i as E } from "./invariant-
|
|
3
|
+
import { Z as M, i as E } from "./invariant-B_t_F2s_.js";
|
|
4
4
|
import * as F from "react";
|
|
5
|
-
import { createContext as Q, useRef as A, useLayoutEffect as Ce, useEffect as
|
|
6
|
-
import { D as be,
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { a as
|
|
13
|
-
import {
|
|
14
|
-
import { a as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
5
|
+
import { createContext as Q, useRef as A, useLayoutEffect as Ce, useEffect as re, useId as H, useContext as V, useInsertionEffect as we, useMemo as L, useCallback as ke, Children as Ee, isValidElement as Ie, useState as I } from "react";
|
|
6
|
+
import { D as be, a as te, E as Ke } from "./Zudoku-iyiXgWFY.js";
|
|
7
|
+
import { Button as _ } from "./ui/Button.js";
|
|
8
|
+
import "./ZudokuReactContext-DGJAP1sN.js";
|
|
9
|
+
import "./index-DAWHN3cH.js";
|
|
10
|
+
import { u as ae } from "./hook-Dz_n9SoE.js";
|
|
11
|
+
import { F as De, g as Pe, j as Ae, h as Se, d as Re, I as Ne, a as Oe, b as Te, k as qe, c as Me } from "./Frame-DKlOmSkU.js";
|
|
12
|
+
import { A as D, a as P, b as oe } from "./Mermaid-Chx5BPHn.js";
|
|
13
|
+
import { S as Fe, a as $e, b as ze, c as Le, d as Qe, e as He, f as se, g as Ve } from "./Secret-DUpgv4V3.js";
|
|
14
|
+
import { e as B, f as S, D as Z, g as G, a as J, b as Y, c as U, d as le } from "./Dialog-hlvmmQ_c.js";
|
|
15
|
+
import { b as ce } from "./useQuery-ht7aWJ3S.js";
|
|
16
|
+
import { u as q } from "./useMutation-CErliDZ9.js";
|
|
17
|
+
import { a as _e } from "./index.esm-BYObtETB.js";
|
|
18
|
+
import { u as Be } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
19
|
+
import { A as Ze } from "./ActionButton-B0CXL1Lq.js";
|
|
20
|
+
import { a as W } from "./ZudokuContext-CYyb_PB_.js";
|
|
21
|
+
import { Input as Ge } from "./ui/Input.js";
|
|
22
|
+
import { u as Je } from "./useSuspenseQuery-DQH4Bmc2.js";
|
|
23
|
+
import { c as X } from "./cn-5-Gd1Dss.js";
|
|
21
24
|
import { B as k } from "./Button-GUVe7pmt.js";
|
|
22
|
-
import { I as
|
|
23
|
-
function
|
|
25
|
+
import { I as Ye } from "./Input-Cx-GeKoF.js";
|
|
26
|
+
function Ue({ error: t }) {
|
|
24
27
|
const a = t instanceof Error ? t.message : "Something went wrong", s = process.env.NODE_ENV === "development", n = t instanceof M ? t.developerHint : void 0, r = t instanceof M ? t.title : "Something went wrong", i = t instanceof Error ? t.stack : void 0, o = t instanceof Error ? t.cause : void 0, d = o instanceof Error ? String(o.stack) : i;
|
|
25
28
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
26
29
|
/* @__PURE__ */ e.jsxs(D, { variant: "destructive", children: [
|
|
27
30
|
/* @__PURE__ */ e.jsx(P, { children: r }),
|
|
28
|
-
/* @__PURE__ */ e.jsx(
|
|
31
|
+
/* @__PURE__ */ e.jsx(oe, { children: a })
|
|
29
32
|
] }),
|
|
30
33
|
s && n && /* @__PURE__ */ e.jsx(be, { className: "mb-4", children: n }),
|
|
31
34
|
s && d && /* @__PURE__ */ e.jsx(
|
|
32
|
-
|
|
35
|
+
Fe,
|
|
33
36
|
{
|
|
34
37
|
className: "max-h-[400px] [&>pre]:p-4",
|
|
35
38
|
language: "js",
|
|
@@ -38,23 +41,23 @@ function We({ error: t }) {
|
|
|
38
41
|
)
|
|
39
42
|
] });
|
|
40
43
|
}
|
|
41
|
-
const
|
|
44
|
+
const We = ({
|
|
42
45
|
service: t,
|
|
43
46
|
onOpenChange: a
|
|
44
47
|
}) => {
|
|
45
|
-
const s =
|
|
48
|
+
const s = W(), n = ce(), r = Be(), i = _e({
|
|
46
49
|
defaultValues: {
|
|
47
50
|
expiresOn: "30"
|
|
48
51
|
}
|
|
49
|
-
}), o =
|
|
52
|
+
}), o = ae(), d = q({
|
|
50
53
|
mutationFn: ({ description: c, expiresOn: u }) => {
|
|
51
54
|
if (!t.createKey)
|
|
52
55
|
throw new Error("createKey not implemented");
|
|
53
|
-
const
|
|
56
|
+
const f = u !== "never" ? Xe(Number(u)) : void 0;
|
|
54
57
|
return t.createKey({
|
|
55
58
|
apiKey: {
|
|
56
59
|
description: c || "Secret Key",
|
|
57
|
-
expiresOn:
|
|
60
|
+
expiresOn: f
|
|
58
61
|
},
|
|
59
62
|
context: s,
|
|
60
63
|
auth: o
|
|
@@ -78,38 +81,38 @@ const Xe = ({
|
|
|
78
81
|
children: [
|
|
79
82
|
d.error && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
80
83
|
/* @__PURE__ */ e.jsx(P, { children: "Error" }),
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
84
|
+
/* @__PURE__ */ e.jsx(oe, { children: d.error.message })
|
|
82
85
|
] }),
|
|
83
86
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
|
|
84
87
|
"Name",
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
88
|
+
/* @__PURE__ */ e.jsx(Ge, { ...i.register("description") }),
|
|
86
89
|
"Expiration",
|
|
87
90
|
/* @__PURE__ */ e.jsxs(
|
|
88
|
-
|
|
91
|
+
$e,
|
|
89
92
|
{
|
|
90
93
|
onValueChange: (c) => i.setValue("expiresOn", c),
|
|
91
94
|
defaultValue: i.getValues("expiresOn"),
|
|
92
95
|
children: [
|
|
93
|
-
/* @__PURE__ */ e.jsx(
|
|
94
|
-
/* @__PURE__ */ e.jsx(
|
|
95
|
-
[7, 30, 60, 90].map((c) => /* @__PURE__ */ e.jsxs(
|
|
96
|
+
/* @__PURE__ */ e.jsx(ze, { children: /* @__PURE__ */ e.jsx(Le, {}) }),
|
|
97
|
+
/* @__PURE__ */ e.jsx(Qe, { children: /* @__PURE__ */ e.jsxs(He, { children: [
|
|
98
|
+
[7, 30, 60, 90].map((c) => /* @__PURE__ */ e.jsxs(se, { value: String(c), children: [
|
|
96
99
|
c,
|
|
97
100
|
" days"
|
|
98
101
|
] }, c)),
|
|
99
|
-
/* @__PURE__ */ e.jsx(
|
|
102
|
+
/* @__PURE__ */ e.jsx(se, { value: "never", children: "Never" })
|
|
100
103
|
] }) })
|
|
101
104
|
]
|
|
102
105
|
}
|
|
103
106
|
),
|
|
104
|
-
/* @__PURE__ */ e.jsxs(
|
|
105
|
-
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
106
|
-
/* @__PURE__ */ e.jsx(
|
|
107
|
+
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
108
|
+
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(_, { variant: "outline", children: "Cancel" }) }),
|
|
109
|
+
/* @__PURE__ */ e.jsx(Ze, { isPending: d.isPending, children: "Generate Key" })
|
|
107
110
|
] })
|
|
108
111
|
] })
|
|
109
112
|
]
|
|
110
113
|
}
|
|
111
114
|
) : null;
|
|
112
|
-
},
|
|
115
|
+
}, Xe = (t) => {
|
|
113
116
|
const a = /* @__PURE__ */ new Date();
|
|
114
117
|
return a.setDate(a.getDate() + t), a.toISOString();
|
|
115
118
|
}, de = ({
|
|
@@ -119,60 +122,60 @@ const Xe = ({
|
|
|
119
122
|
trigger: n,
|
|
120
123
|
buttonVariant: r = "outline"
|
|
121
124
|
}) => {
|
|
122
|
-
const i = /* @__PURE__ */ e.jsx(
|
|
123
|
-
return /* @__PURE__ */ e.jsxs(
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
125
|
-
/* @__PURE__ */ e.jsxs(
|
|
126
|
-
/* @__PURE__ */ e.jsx(
|
|
127
|
-
/* @__PURE__ */ e.jsx(
|
|
125
|
+
const i = /* @__PURE__ */ e.jsx(_, { variant: r, children: "Create API Key" });
|
|
126
|
+
return /* @__PURE__ */ e.jsxs(Z, { open: a, onOpenChange: s, children: [
|
|
127
|
+
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: n ?? i }),
|
|
128
|
+
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
129
|
+
/* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsx(U, { children: "Create API Key" }) }),
|
|
130
|
+
/* @__PURE__ */ e.jsx(We, { service: t, onOpenChange: s })
|
|
128
131
|
] })
|
|
129
132
|
] });
|
|
130
|
-
},
|
|
133
|
+
}, et = Q({});
|
|
131
134
|
function ue(t) {
|
|
132
135
|
const a = A(null);
|
|
133
136
|
return a.current === null && (a.current = t()), a.current;
|
|
134
137
|
}
|
|
135
|
-
const
|
|
136
|
-
function
|
|
138
|
+
const tt = typeof window < "u", st = tt ? Ce : re, pe = /* @__PURE__ */ Q(null);
|
|
139
|
+
function nt(t) {
|
|
137
140
|
return typeof t == "object" && t !== null;
|
|
138
141
|
}
|
|
139
|
-
function
|
|
140
|
-
return
|
|
142
|
+
function it(t) {
|
|
143
|
+
return nt(t) && "offsetHeight" in t;
|
|
141
144
|
}
|
|
142
|
-
const
|
|
145
|
+
const rt = Q({
|
|
143
146
|
transformPagePoint: (t) => t,
|
|
144
147
|
isStatic: !1,
|
|
145
148
|
reducedMotion: "never"
|
|
146
149
|
});
|
|
147
|
-
function
|
|
150
|
+
function ne(t, a) {
|
|
148
151
|
if (typeof t == "function")
|
|
149
152
|
return t(a);
|
|
150
153
|
t != null && (t.current = a);
|
|
151
154
|
}
|
|
152
|
-
function
|
|
155
|
+
function at(...t) {
|
|
153
156
|
return (a) => {
|
|
154
157
|
let s = !1;
|
|
155
158
|
const n = t.map((r) => {
|
|
156
|
-
const i =
|
|
159
|
+
const i = ne(r, a);
|
|
157
160
|
return !s && typeof i == "function" && (s = !0), i;
|
|
158
161
|
});
|
|
159
162
|
if (s)
|
|
160
163
|
return () => {
|
|
161
164
|
for (let r = 0; r < n.length; r++) {
|
|
162
165
|
const i = n[r];
|
|
163
|
-
typeof i == "function" ? i() :
|
|
166
|
+
typeof i == "function" ? i() : ne(t[r], null);
|
|
164
167
|
}
|
|
165
168
|
};
|
|
166
169
|
};
|
|
167
170
|
}
|
|
168
|
-
function
|
|
169
|
-
return F.useCallback(
|
|
171
|
+
function ot(...t) {
|
|
172
|
+
return F.useCallback(at(...t), t);
|
|
170
173
|
}
|
|
171
|
-
class
|
|
174
|
+
class lt extends F.Component {
|
|
172
175
|
getSnapshotBeforeUpdate(a) {
|
|
173
176
|
const s = this.props.childRef.current;
|
|
174
177
|
if (s && a.isPresent && !this.props.isPresent) {
|
|
175
|
-
const n = s.offsetParent, r =
|
|
178
|
+
const n = s.offsetParent, r = it(n) && n.offsetWidth || 0, i = this.props.sizeRef.current;
|
|
176
179
|
i.height = s.offsetHeight || 0, i.width = s.offsetWidth || 0, i.top = s.offsetTop, i.left = s.offsetLeft, i.right = r - i.width - i.left;
|
|
177
180
|
}
|
|
178
181
|
return null;
|
|
@@ -186,17 +189,17 @@ class ct extends F.Component {
|
|
|
186
189
|
return this.props.children;
|
|
187
190
|
}
|
|
188
191
|
}
|
|
189
|
-
function
|
|
192
|
+
function ct({ children: t, isPresent: a, anchorX: s, root: n }) {
|
|
190
193
|
const r = H(), i = A(null), o = A({
|
|
191
194
|
width: 0,
|
|
192
195
|
height: 0,
|
|
193
196
|
top: 0,
|
|
194
197
|
left: 0,
|
|
195
198
|
right: 0
|
|
196
|
-
}), { nonce: d } = V(
|
|
199
|
+
}), { nonce: d } = V(rt), c = ot(i, t?.ref);
|
|
197
200
|
return we(() => {
|
|
198
|
-
const { width: u, height:
|
|
199
|
-
if (a || !i.current || !u || !
|
|
201
|
+
const { width: u, height: f, top: p, left: m, right: g } = o.current;
|
|
202
|
+
if (a || !i.current || !u || !f)
|
|
200
203
|
return;
|
|
201
204
|
const j = s === "left" ? `left: ${m}` : `right: ${g}`;
|
|
202
205
|
i.current.dataset.motionPopId = r;
|
|
@@ -207,19 +210,19 @@ function dt({ children: t, isPresent: a, anchorX: s, root: n }) {
|
|
|
207
210
|
[data-motion-pop-id="${r}"] {
|
|
208
211
|
position: absolute !important;
|
|
209
212
|
width: ${u}px !important;
|
|
210
|
-
height: ${
|
|
213
|
+
height: ${f}px !important;
|
|
211
214
|
${j}px !important;
|
|
212
|
-
top: ${
|
|
215
|
+
top: ${p}px !important;
|
|
213
216
|
}
|
|
214
217
|
`), () => {
|
|
215
218
|
x.contains(l) && x.removeChild(l);
|
|
216
219
|
};
|
|
217
|
-
}, [a]), e.jsx(
|
|
220
|
+
}, [a]), e.jsx(lt, { isPresent: a, childRef: i, sizeRef: o, children: F.cloneElement(t, { ref: c }) });
|
|
218
221
|
}
|
|
219
|
-
const
|
|
220
|
-
const u = ue(
|
|
221
|
-
let
|
|
222
|
-
id:
|
|
222
|
+
const dt = ({ children: t, initial: a, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: i, mode: o, anchorX: d, root: c }) => {
|
|
223
|
+
const u = ue(ut), f = H();
|
|
224
|
+
let p = !0, m = L(() => (p = !1, {
|
|
225
|
+
id: f,
|
|
223
226
|
initial: a,
|
|
224
227
|
isPresent: s,
|
|
225
228
|
custom: r,
|
|
@@ -232,21 +235,21 @@ const ut = ({ children: t, initial: a, isPresent: s, onExitComplete: n, custom:
|
|
|
232
235
|
},
|
|
233
236
|
register: (g) => (u.set(g, !1), () => u.delete(g))
|
|
234
237
|
}), [s, u, n]);
|
|
235
|
-
return i &&
|
|
238
|
+
return i && p && (m = { ...m }), L(() => {
|
|
236
239
|
u.forEach((g, j) => u.set(j, !1));
|
|
237
240
|
}, [s]), F.useEffect(() => {
|
|
238
241
|
!s && !u.size && n && n();
|
|
239
|
-
}, [s]), o === "popLayout" && (t = e.jsx(
|
|
242
|
+
}, [s]), o === "popLayout" && (t = e.jsx(ct, { isPresent: s, anchorX: d, root: c, children: t })), e.jsx(pe.Provider, { value: m, children: t });
|
|
240
243
|
};
|
|
241
|
-
function
|
|
244
|
+
function ut() {
|
|
242
245
|
return /* @__PURE__ */ new Map();
|
|
243
246
|
}
|
|
244
247
|
function pt(t = !0) {
|
|
245
|
-
const a = V(
|
|
248
|
+
const a = V(pe);
|
|
246
249
|
if (a === null)
|
|
247
250
|
return [!0, null];
|
|
248
251
|
const { isPresent: s, onExitComplete: n, register: r } = a, i = H();
|
|
249
|
-
|
|
252
|
+
re(() => {
|
|
250
253
|
if (t)
|
|
251
254
|
return r(i);
|
|
252
255
|
}, [t]);
|
|
@@ -254,61 +257,61 @@ function pt(t = !0) {
|
|
|
254
257
|
return !s && n ? [!1, o] : [!0];
|
|
255
258
|
}
|
|
256
259
|
const R = (t) => t.key || "";
|
|
257
|
-
function
|
|
260
|
+
function ie(t) {
|
|
258
261
|
const a = [];
|
|
259
262
|
return Ee.forEach(t, (s) => {
|
|
260
263
|
Ie(s) && a.push(s);
|
|
261
264
|
}), a;
|
|
262
265
|
}
|
|
263
|
-
const
|
|
264
|
-
const [u,
|
|
265
|
-
|
|
266
|
-
g.current = !1, j.current =
|
|
266
|
+
const ft = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: i = "sync", propagate: o = !1, anchorX: d = "left", root: c }) => {
|
|
267
|
+
const [u, f] = pt(o), p = L(() => ie(t), [t]), m = o && !u ? [] : p.map(R), g = A(!0), j = A(p), l = ue(() => /* @__PURE__ */ new Map()), [x, v] = I(p), [h, C] = I(p);
|
|
268
|
+
st(() => {
|
|
269
|
+
g.current = !1, j.current = p;
|
|
267
270
|
for (let w = 0; w < h.length; w++) {
|
|
268
271
|
const y = R(h[w]);
|
|
269
272
|
m.includes(y) ? l.delete(y) : l.get(y) !== !0 && l.set(y, !1);
|
|
270
273
|
}
|
|
271
274
|
}, [h, m.length, m.join("-")]);
|
|
272
275
|
const K = [];
|
|
273
|
-
if (
|
|
274
|
-
let w = [...
|
|
276
|
+
if (p !== x) {
|
|
277
|
+
let w = [...p];
|
|
275
278
|
for (let y = 0; y < h.length; y++) {
|
|
276
279
|
const b = h[y], $ = R(b);
|
|
277
280
|
m.includes($) || (w.splice(y, 0, b), K.push(b));
|
|
278
281
|
}
|
|
279
|
-
return i === "wait" && K.length && (w = K), C(
|
|
282
|
+
return i === "wait" && K.length && (w = K), C(ie(w)), v(p), null;
|
|
280
283
|
}
|
|
281
284
|
process.env.NODE_ENV !== "production" && i === "wait" && h.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
282
|
-
const { forceRender:
|
|
285
|
+
const { forceRender: fe } = V(et);
|
|
283
286
|
return e.jsx(e.Fragment, { children: h.map((w) => {
|
|
284
|
-
const y = R(w), b = o && !u ? !1 :
|
|
287
|
+
const y = R(w), b = o && !u ? !1 : p === h || m.includes(y), $ = () => {
|
|
285
288
|
if (l.has(y))
|
|
286
289
|
l.set(y, !0);
|
|
287
290
|
else
|
|
288
291
|
return;
|
|
289
|
-
let
|
|
292
|
+
let ee = !0;
|
|
290
293
|
l.forEach((he) => {
|
|
291
|
-
he || (
|
|
292
|
-
}),
|
|
294
|
+
he || (ee = !1);
|
|
295
|
+
}), ee && (fe?.(), C(j.current), o && f?.(), n && n());
|
|
293
296
|
};
|
|
294
|
-
return e.jsx(
|
|
297
|
+
return e.jsx(dt, { isPresent: b, initial: !g.current || s ? void 0 : !1, custom: a, presenceAffectsLayout: r, mode: i, root: c, onExitComplete: b ? void 0 : $, anchorX: d, children: w }, y);
|
|
295
298
|
}) });
|
|
296
|
-
},
|
|
299
|
+
}, ht = ({
|
|
297
300
|
apiKey: t,
|
|
298
301
|
onDeleteKey: a,
|
|
299
302
|
className: s
|
|
300
303
|
}) => {
|
|
301
304
|
const [n, r] = I(!1), { key: i, createdOn: o, expiresOn: d } = t, c = d && new Date(d) < /* @__PURE__ */ new Date(), u = d ? Math.ceil(
|
|
302
305
|
(new Date(d).getTime() - Date.now()) / (1e3 * 60 * 60 * 24)
|
|
303
|
-
) : 1 / 0,
|
|
304
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
306
|
+
) : 1 / 0, f = u <= 7 && !c;
|
|
307
|
+
return /* @__PURE__ */ e.jsxs("div", { className: X("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
305
308
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
306
309
|
/* @__PURE__ */ e.jsx(
|
|
307
|
-
|
|
310
|
+
Ve,
|
|
308
311
|
{
|
|
309
312
|
className: "max-w-fit w-full",
|
|
310
313
|
secret: i,
|
|
311
|
-
status: c ? "expired" :
|
|
314
|
+
status: c ? "expired" : f ? "expiring" : "active",
|
|
312
315
|
revealed: n,
|
|
313
316
|
onReveal: r
|
|
314
317
|
}
|
|
@@ -316,11 +319,11 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
316
319
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
|
|
317
320
|
o && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
318
321
|
"Created ",
|
|
319
|
-
|
|
322
|
+
mt(o),
|
|
320
323
|
"."
|
|
321
324
|
] }),
|
|
322
325
|
" ",
|
|
323
|
-
d &&
|
|
326
|
+
d && f && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
324
327
|
"Expires in ",
|
|
325
328
|
u,
|
|
326
329
|
" ",
|
|
@@ -334,14 +337,14 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
334
337
|
] })
|
|
335
338
|
] })
|
|
336
339
|
] }),
|
|
337
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && a && /* @__PURE__ */ e.jsxs(
|
|
338
|
-
/* @__PURE__ */ e.jsx(
|
|
339
|
-
/* @__PURE__ */ e.jsxs(
|
|
340
|
-
/* @__PURE__ */ e.jsxs(
|
|
341
|
-
/* @__PURE__ */ e.jsx(
|
|
342
|
-
/* @__PURE__ */ e.jsx(
|
|
340
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && a && /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
341
|
+
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(me, { size: 16 }) }) }),
|
|
342
|
+
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
343
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
344
|
+
/* @__PURE__ */ e.jsx(U, { children: "Delete API Key" }),
|
|
345
|
+
/* @__PURE__ */ e.jsx(le, { children: "Are you sure you want to delete this API key?" })
|
|
343
346
|
] }),
|
|
344
|
-
/* @__PURE__ */ e.jsxs(
|
|
347
|
+
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
345
348
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", children: "Cancel" }) }),
|
|
346
349
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
347
350
|
k,
|
|
@@ -356,23 +359,23 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
356
359
|
] })
|
|
357
360
|
] }) })
|
|
358
361
|
] });
|
|
359
|
-
},
|
|
362
|
+
}, mt = (t) => {
|
|
360
363
|
const a = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((a.getTime() - s.getTime()) / 1e3), r = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
361
364
|
return n < 60 ? r.format(-n, "second") : n < 3600 ? r.format(-Math.floor(n / 60), "minute") : n < 86400 ? r.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? r.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? r.format(-Math.floor(n / 2592e3), "month") : r.format(-Math.floor(n / 31536e3), "year");
|
|
362
|
-
},
|
|
365
|
+
}, xt = ({
|
|
363
366
|
consumer: t,
|
|
364
367
|
onUpdate: a,
|
|
365
368
|
onRollKey: s,
|
|
366
369
|
onDeleteKey: n
|
|
367
370
|
}) => {
|
|
368
|
-
const [r, i] = I(!1), [o, d] = I(t.label), c = ce(), u =
|
|
371
|
+
const [r, i] = I(!1), [o, d] = I(t.label), c = ce(), u = W(), f = q({
|
|
369
372
|
mutationFn: async (l) => {
|
|
370
373
|
if (!s)
|
|
371
374
|
throw new Error("rollKey not implemented");
|
|
372
375
|
return await s?.(l, u);
|
|
373
376
|
},
|
|
374
377
|
onSuccess: () => void c.invalidateQueries({ queryKey: ["api-keys"] })
|
|
375
|
-
}),
|
|
378
|
+
}), p = q({
|
|
376
379
|
mutationFn: ({
|
|
377
380
|
consumerId: l,
|
|
378
381
|
keyId: x
|
|
@@ -429,28 +432,28 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
429
432
|
}), i(!1);
|
|
430
433
|
};
|
|
431
434
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
432
|
-
|
|
435
|
+
f.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
433
436
|
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
434
|
-
/* @__PURE__ */ e.jsx(P, { children:
|
|
437
|
+
/* @__PURE__ */ e.jsx(P, { children: f.error.message })
|
|
435
438
|
] }),
|
|
436
439
|
m.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
437
440
|
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
438
441
|
/* @__PURE__ */ e.jsx(P, { children: m.error.message })
|
|
439
442
|
] }),
|
|
440
|
-
|
|
443
|
+
p.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
441
444
|
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
442
|
-
/* @__PURE__ */ e.jsx(P, { children:
|
|
445
|
+
/* @__PURE__ */ e.jsx(P, { children: p.error.message })
|
|
443
446
|
] }),
|
|
444
447
|
/* @__PURE__ */ e.jsxs(
|
|
445
|
-
|
|
448
|
+
De,
|
|
446
449
|
{
|
|
447
450
|
className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
|
|
448
451
|
children: [
|
|
449
|
-
/* @__PURE__ */ e.jsxs(
|
|
452
|
+
/* @__PURE__ */ e.jsxs(Pe, { className: "col-span-full flex-row items-start justify-between gap-4", children: [
|
|
450
453
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
451
454
|
r ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
452
455
|
/* @__PURE__ */ e.jsx(
|
|
453
|
-
|
|
456
|
+
Ye,
|
|
454
457
|
{
|
|
455
458
|
maxLength: 32,
|
|
456
459
|
value: o,
|
|
@@ -482,8 +485,8 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
482
485
|
}
|
|
483
486
|
)
|
|
484
487
|
] })
|
|
485
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
486
|
-
/* @__PURE__ */ e.jsxs(
|
|
488
|
+
] }) : /* @__PURE__ */ e.jsx(Ae, { children: t.label }),
|
|
489
|
+
/* @__PURE__ */ e.jsxs(Se, { children: [
|
|
487
490
|
t.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
488
491
|
"Created on ",
|
|
489
492
|
new Date(t.createdOn).toLocaleDateString()
|
|
@@ -500,7 +503,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
500
503
|
{
|
|
501
504
|
variant: "ghost",
|
|
502
505
|
onClick: g,
|
|
503
|
-
className:
|
|
506
|
+
className: X(
|
|
504
507
|
"flex gap-2",
|
|
505
508
|
r && "opacity-0! pointer-events-none"
|
|
506
509
|
),
|
|
@@ -511,38 +514,38 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
511
514
|
]
|
|
512
515
|
}
|
|
513
516
|
),
|
|
514
|
-
s && /* @__PURE__ */ e.jsxs(
|
|
515
|
-
/* @__PURE__ */ e.jsx(
|
|
517
|
+
s && /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
518
|
+
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
516
519
|
k,
|
|
517
520
|
{
|
|
518
521
|
title: "Roll this key",
|
|
519
522
|
variant: "ghost",
|
|
520
|
-
disabled:
|
|
523
|
+
disabled: f.isPending,
|
|
521
524
|
className: "flex items-center gap-2",
|
|
522
525
|
children: [
|
|
523
526
|
/* @__PURE__ */ e.jsx(
|
|
524
527
|
je,
|
|
525
528
|
{
|
|
526
529
|
size: 16,
|
|
527
|
-
className:
|
|
530
|
+
className: f.isPending ? "animate-spin" : void 0
|
|
528
531
|
}
|
|
529
532
|
),
|
|
530
533
|
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
|
|
531
534
|
]
|
|
532
535
|
}
|
|
533
536
|
) }),
|
|
534
|
-
/* @__PURE__ */ e.jsxs(
|
|
535
|
-
/* @__PURE__ */ e.jsxs(
|
|
536
|
-
/* @__PURE__ */ e.jsx(
|
|
537
|
-
/* @__PURE__ */ e.jsx(
|
|
537
|
+
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
538
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
539
|
+
/* @__PURE__ */ e.jsx(U, { children: "Roll API Key" }),
|
|
540
|
+
/* @__PURE__ */ e.jsx(le, { children: "Are you sure you want to roll this API key?" })
|
|
538
541
|
] }),
|
|
539
|
-
/* @__PURE__ */ e.jsxs(
|
|
542
|
+
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
540
543
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", children: "Cancel" }) }),
|
|
541
544
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
542
545
|
k,
|
|
543
546
|
{
|
|
544
547
|
onClick: () => {
|
|
545
|
-
|
|
548
|
+
f.mutate(t.id);
|
|
546
549
|
},
|
|
547
550
|
children: "Roll Key"
|
|
548
551
|
}
|
|
@@ -552,17 +555,17 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
552
555
|
] })
|
|
553
556
|
] })
|
|
554
557
|
] }),
|
|
555
|
-
/* @__PURE__ */ e.jsx(
|
|
556
|
-
|
|
558
|
+
/* @__PURE__ */ e.jsx(Re, { className: "p-0 grid grid-cols-subgrid col-span-full divide-y divide-border", children: /* @__PURE__ */ e.jsx(ft, { children: t.apiKeys.map((l) => /* @__PURE__ */ e.jsx(
|
|
559
|
+
ht,
|
|
557
560
|
{
|
|
558
561
|
apiKey: l,
|
|
559
562
|
onDeleteKey: () => {
|
|
560
|
-
|
|
563
|
+
p.mutate({
|
|
561
564
|
consumerId: t.id,
|
|
562
565
|
keyId: l.id
|
|
563
566
|
});
|
|
564
567
|
},
|
|
565
|
-
className:
|
|
568
|
+
className: p.variables?.keyId === l.id && p.isPending ? "opacity-10!" : void 0
|
|
566
569
|
},
|
|
567
570
|
l.id
|
|
568
571
|
)) }) })
|
|
@@ -571,8 +574,8 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
571
574
|
t.id
|
|
572
575
|
)
|
|
573
576
|
] });
|
|
574
|
-
},
|
|
575
|
-
const a =
|
|
577
|
+
}, yt = ({ service: t }) => {
|
|
578
|
+
const a = W(), { data: s } = Je({
|
|
576
579
|
queryFn: async () => {
|
|
577
580
|
try {
|
|
578
581
|
return await t.getConsumers(a);
|
|
@@ -601,8 +604,8 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
601
604
|
onOpenChange: r
|
|
602
605
|
}
|
|
603
606
|
)
|
|
604
|
-
] }) : /* @__PURE__ */ e.jsx("ul", { className:
|
|
605
|
-
|
|
607
|
+
] }) : /* @__PURE__ */ e.jsx("ul", { className: X("grid grid-cols-[1fr_min-content] col-span-6"), children: s.map((i) => /* @__PURE__ */ e.jsx(
|
|
608
|
+
xt,
|
|
606
609
|
{
|
|
607
610
|
consumer: i,
|
|
608
611
|
onUpdate: t.updateConsumer,
|
|
@@ -611,10 +614,10 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
611
614
|
},
|
|
612
615
|
i.id
|
|
613
616
|
)) }) });
|
|
614
|
-
},
|
|
615
|
-
const [a, s] = I(!1), n =
|
|
617
|
+
}, gt = ({ service: t }) => {
|
|
618
|
+
const [a, s] = I(!1), n = ae();
|
|
616
619
|
return /* @__PURE__ */ e.jsxs("div", { className: "max-w-3xl h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
|
|
617
|
-
/* @__PURE__ */ e.jsx(
|
|
620
|
+
/* @__PURE__ */ e.jsx(te.Target, { name: "api-keys-list-page" }),
|
|
618
621
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
|
|
619
622
|
/* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
|
|
620
623
|
t.createKey && /* @__PURE__ */ e.jsx(
|
|
@@ -627,22 +630,22 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
627
630
|
)
|
|
628
631
|
] }),
|
|
629
632
|
/* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
|
|
630
|
-
/* @__PURE__ */ e.jsx(
|
|
631
|
-
n.profile?.emailVerified === !1 ? /* @__PURE__ */ e.jsxs(
|
|
632
|
-
/* @__PURE__ */ e.jsxs(
|
|
633
|
-
/* @__PURE__ */ e.jsx(
|
|
634
|
-
/* @__PURE__ */ e.jsx(
|
|
633
|
+
/* @__PURE__ */ e.jsx(te.Target, { name: "api-keys-list-page-before-keys" }),
|
|
634
|
+
n.profile?.emailVerified === !1 ? /* @__PURE__ */ e.jsxs(Ne, { variant: "outline", children: [
|
|
635
|
+
/* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
636
|
+
/* @__PURE__ */ e.jsx(Te, { children: "Verified email required" }),
|
|
637
|
+
/* @__PURE__ */ e.jsx(qe, { children: "You need to verify your email to access API keys." })
|
|
635
638
|
] }),
|
|
636
|
-
/* @__PURE__ */ e.jsx(
|
|
639
|
+
/* @__PURE__ */ e.jsx(Me, { children: /* @__PURE__ */ e.jsx(_, { onClick: () => n.requestEmailVerification(), children: "Verify email" }) })
|
|
637
640
|
] }) : /* @__PURE__ */ e.jsx(
|
|
638
|
-
|
|
641
|
+
Ke,
|
|
639
642
|
{
|
|
640
|
-
fallbackRender: ({ error: r }) => /* @__PURE__ */ e.jsx(
|
|
641
|
-
children: /* @__PURE__ */ e.jsx(
|
|
643
|
+
fallbackRender: ({ error: r }) => /* @__PURE__ */ e.jsx(Ue, { error: r }),
|
|
644
|
+
children: /* @__PURE__ */ e.jsx(yt, { service: t })
|
|
642
645
|
}
|
|
643
646
|
)
|
|
644
647
|
] });
|
|
645
|
-
}, N = "https://api.zuploedge.com/v2/client",
|
|
648
|
+
}, N = "https://api.zuploedge.com/v2/client", jt = async (t) => {
|
|
646
649
|
try {
|
|
647
650
|
return await t.json();
|
|
648
651
|
} catch {
|
|
@@ -651,14 +654,14 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
651
654
|
}, O = async (t) => {
|
|
652
655
|
const a = t.headers.get("content-type");
|
|
653
656
|
if (!t.ok && a?.includes("application/problem+json")) {
|
|
654
|
-
const s = await
|
|
657
|
+
const s = await jt(t);
|
|
655
658
|
if (s.type && s.title)
|
|
656
659
|
throw new Error(s.detail ?? s.title);
|
|
657
660
|
}
|
|
658
661
|
}, T = {
|
|
659
662
|
developerHint: "This project is not linked to a Zuplo deployment. Run `zuplo link` to get started with API Keys.",
|
|
660
663
|
title: "Not linked to a Zuplo deployment"
|
|
661
|
-
},
|
|
664
|
+
}, vt = ({
|
|
662
665
|
deploymentName: t,
|
|
663
666
|
...a
|
|
664
667
|
}) => ({
|
|
@@ -732,7 +735,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
732
735
|
}));
|
|
733
736
|
},
|
|
734
737
|
...a
|
|
735
|
-
}),
|
|
738
|
+
}), _t = (t) => t, Bt = ({
|
|
736
739
|
deploymentName: t,
|
|
737
740
|
isZuplo: a,
|
|
738
741
|
...s
|
|
@@ -740,7 +743,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
740
743
|
a && !t && console.warn(
|
|
741
744
|
"This project is not linked to a Zuplo deployment. Run `zuplo link` to get started."
|
|
742
745
|
);
|
|
743
|
-
const n = a ?
|
|
746
|
+
const n = a ? vt({ deploymentName: t, ...s }) : s;
|
|
744
747
|
if (!n.getConsumers)
|
|
745
748
|
throw new Error("getConsumers is required when using the apiKeyPlugin");
|
|
746
749
|
const r = {
|
|
@@ -773,14 +776,14 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
773
776
|
getRoutes: () => [
|
|
774
777
|
{
|
|
775
778
|
path: "/settings/api-keys",
|
|
776
|
-
element: /* @__PURE__ */ e.jsx(
|
|
779
|
+
element: /* @__PURE__ */ e.jsx(gt, { service: r })
|
|
777
780
|
}
|
|
778
781
|
],
|
|
779
782
|
getProtectedRoutes: () => ["/settings/api-keys"]
|
|
780
783
|
};
|
|
781
784
|
};
|
|
782
785
|
export {
|
|
783
|
-
|
|
784
|
-
|
|
786
|
+
Bt as apiKeyPlugin,
|
|
787
|
+
_t as createApiKeyService
|
|
785
788
|
};
|
|
786
789
|
//# sourceMappingURL=zudoku.plugin-api-keys.js.map
|