zudoku 0.0.0-feat-openapi-docs-redesign.dab3fc6a → 0.0.0-feat-navigation-at-property.z8cd07fa5
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.d.ts +6 -6
- package/dist/app/main.js +1 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.js +1 -1
- package/dist/cli/common/version-check.js +12 -3
- package/dist/cli/common/version-check.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 +3 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/BuildSchema.js +18 -3
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +133 -45
- package/dist/config/validators/InputNavigationSchema.js +30 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/NavigationSchema.d.ts +18 -4
- package/dist/config/validators/NavigationSchema.js +15 -5
- 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 +104 -14
- package/dist/config/validators/validate.js +15 -4
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +43 -0
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/flat-config.d.ts +68 -32
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/issuer.js +1 -1
- package/dist/lib/auth/issuer.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +3 -2
- package/dist/lib/authentication/components/CallbackHandler.js +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/SignIn.js +4 -2
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignUp.js +4 -2
- package/dist/lib/authentication/components/SignUp.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +2 -0
- package/dist/lib/authentication/hook.js +10 -0
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +17 -8
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +0 -22
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/firebase.js +67 -9
- package/dist/lib/authentication/providers/firebase.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.js +6 -15
- package/dist/lib/authentication/providers/supabase.js.map +1 -1
- package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
- package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
- package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
- package/dist/lib/authentication/ui/ZudokuAuthUi.js +48 -12
- package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
- package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
- package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
- package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
- 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/Mermaid.d.ts +7 -0
- package/dist/lib/components/Mermaid.js +42 -0
- package/dist/lib/components/Mermaid.js.map +1 -0
- package/dist/lib/components/MobileTopNavigation.js +3 -2
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
- package/dist/lib/components/PagefindSearchMeta.js +7 -0
- package/dist/lib/components/PagefindSearchMeta.js.map +1 -0
- package/dist/lib/components/Pagination.js +2 -2
- package/dist/lib/components/Pagination.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 +8 -3
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.d.ts +4 -1
- package/dist/lib/components/Zudoku.js +5 -11
- 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 +26 -8
- 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 -69
- package/dist/lib/components/index.js +19 -32
- 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 +13 -3
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +6 -1
- package/dist/lib/components/navigation/utils.js +26 -2
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +12 -7
- package/dist/lib/core/RouteGuard.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 +18 -4
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/core/react-query.d.ts +1 -0
- package/dist/lib/core/react-query.js +2 -0
- package/dist/lib/core/react-query.js.map +1 -0
- package/dist/lib/core/transform-config.d.ts +4 -0
- package/dist/lib/core/transform-config.js +42 -0
- package/dist/lib/core/transform-config.js.map +1 -0
- 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/errors/ErrorMessage.d.ts +3 -0
- package/dist/lib/errors/ErrorMessage.js +16 -0
- package/dist/lib/errors/ErrorMessage.js.map +1 -0
- package/dist/lib/hooks/index.d.ts +7 -28
- 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/navigation/pathMatcher.d.ts +8 -0
- package/dist/lib/navigation/pathMatcher.js +62 -0
- package/dist/lib/navigation/pathMatcher.js.map +1 -0
- package/dist/lib/navigation/pathMatcher.test.d.ts +1 -0
- package/dist/lib/navigation/pathMatcher.test.js +115 -0
- package/dist/lib/navigation/pathMatcher.test.js.map +1 -0
- package/dist/lib/navigation/positionItems.d.ts +10 -0
- package/dist/lib/navigation/positionItems.js +54 -0
- package/dist/lib/navigation/positionItems.js.map +1 -0
- package/dist/lib/navigation/positionItems.test.d.ts +1 -0
- package/dist/lib/navigation/positionItems.test.js +229 -0
- package/dist/lib/navigation/positionItems.test.js.map +1 -0
- package/dist/lib/oas/graphql/circular.d.ts +2 -0
- package/dist/lib/oas/graphql/circular.js +21 -16
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
- package/dist/lib/oas/graphql/circular.test.js +183 -0
- package/dist/lib/oas/graphql/circular.test.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +7 -3
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -0
- package/dist/lib/oas/parser/index.js +14 -5
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +11 -4
- package/dist/lib/plugins/api-keys/index.js +36 -22
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.d.ts +3 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.js +3 -6
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/OasProvider.js +26 -13
- package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +20 -10
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
- package/dist/lib/plugins/openapi/ParamInfos.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/ResponsesSidecarBox.d.ts +2 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +4 -3
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +2 -1
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +12 -3
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +11 -5
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +19 -13
- package/dist/lib/plugins/openapi/playground/Playground.js +8 -4
- package/dist/lib/plugins/openapi/playground/Playground.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/SchemaView.d.ts +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +16 -7
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
- package/dist/lib/plugins/openapi/schema/utils.js +11 -3
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
- package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.d.ts +9 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +30 -2
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
- package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
- package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/shiki.d.ts +1 -1
- package/dist/lib/shiki.js +18 -12
- package/dist/lib/shiki.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/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +10 -9
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/ButtonGroup.d.ts +11 -0
- package/dist/lib/ui/ButtonGroup.js +28 -0
- package/dist/lib/ui/ButtonGroup.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +3 -3
- package/dist/lib/ui/Command.js +2 -2
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +21 -23
- package/dist/lib/ui/DropdownMenu.js +47 -32
- package/dist/lib/ui/DropdownMenu.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/Kbd.d.ts +3 -0
- package/dist/lib/ui/Kbd.js +10 -0
- package/dist/lib/ui/Kbd.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/MdxComponents.d.ts +1 -0
- package/dist/lib/util/MdxComponents.js +2 -0
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/flattenAllOf.d.ts +0 -2
- package/dist/lib/util/flattenAllOf.js +0 -23
- package/dist/lib/util/flattenAllOf.js.map +1 -1
- package/dist/lib/util/flattenAllOf.test.js +69 -13
- 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/invariant.d.ts +1 -1
- package/dist/lib/util/invariant.js +2 -2
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/lib/util/readFrontmatter.d.ts +6 -0
- package/dist/lib/util/readFrontmatter.js +13 -0
- package/dist/lib/util/readFrontmatter.js.map +1 -0
- package/dist/vite/api/SchemaManager.d.ts +17 -1
- package/dist/vite/api/SchemaManager.js +52 -11
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +111 -0
- 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 +16 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +25 -0
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/error-handler.js +1 -5
- package/dist/vite/error-handler.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-last-modified.js +57 -3
- package/dist/vite/mdx/remark-last-modified.js.map +1 -1
- package/dist/vite/mdx/remark-link-rewrite.js +4 -3
- package/dist/vite/mdx/remark-link-rewrite.js.map +1 -1
- package/dist/vite/pagefind-dev-index.d.ts +16 -0
- package/dist/vite/pagefind-dev-index.js +68 -0
- package/dist/vite/pagefind-dev-index.js.map +1 -0
- package/dist/vite/plugin-api-keys.js +5 -1
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.js +44 -4
- package/dist/vite/plugin-api.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-frontmatter.js +3 -5
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +8 -7
- 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 +4 -20
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/utils.d.ts +2 -0
- package/dist/vite/prerender/utils.js +30 -0
- package/dist/vite/prerender/utils.js.map +1 -0
- package/dist/vite/prerender/worker.js +6 -1
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/vite/zuplo.d.ts +13 -0
- package/dist/vite/zuplo.js +15 -0
- package/dist/vite/zuplo.js.map +1 -0
- package/lib/ActionButton-B0CXL1Lq.js +25 -0
- package/lib/ActionButton-B0CXL1Lq.js.map +1 -0
- package/lib/Button-GUVe7pmt.js +54 -0
- package/lib/Button-GUVe7pmt.js.map +1 -0
- package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
- package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
- package/lib/ClaudeLogo-DoZ7fHHk.js +73 -0
- package/lib/ClaudeLogo-DoZ7fHHk.js.map +1 -0
- package/lib/{Command-CUcrW3qs.js → Command-N6VujV30.js} +26 -26
- package/lib/Command-N6VujV30.js.map +1 -0
- package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
- package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
- package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
- package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
- package/lib/DropdownMenu-DN0jNrjj.js +104 -0
- package/lib/DropdownMenu-DN0jNrjj.js.map +1 -0
- package/lib/Frame-DKlOmSkU.js +205 -0
- package/lib/Frame-DKlOmSkU.js.map +1 -0
- package/lib/HydrationBoundary-CJu4vUlG.js +601 -0
- package/lib/HydrationBoundary-CJu4vUlG.js.map +1 -0
- package/lib/IndexingDialog-D0YdGfbn.js +100 -0
- package/lib/IndexingDialog-D0YdGfbn.js.map +1 -0
- package/lib/Input-Cx-GeKoF.js +22 -0
- package/lib/Input-Cx-GeKoF.js.map +1 -0
- package/lib/MdxPage-Bc_5OsQ5.js +210 -0
- package/lib/MdxPage-Bc_5OsQ5.js.map +1 -0
- package/lib/Mermaid-Chx5BPHn.js +104 -0
- package/lib/Mermaid-Chx5BPHn.js.map +1 -0
- package/lib/{OAuthErrorPage-DnKnq4xK.js → OAuthErrorPage-D-VcZ5cO.js} +26 -23
- package/lib/OAuthErrorPage-D-VcZ5cO.js.map +1 -0
- package/lib/OasProvider-CZqLHoRo.js +48 -0
- package/lib/OasProvider-CZqLHoRo.js.map +1 -0
- package/lib/{OperationList-D8EDc9v7.js → OperationList-BmV1XvEY.js} +2136 -2002
- package/lib/OperationList-BmV1XvEY.js.map +1 -0
- package/lib/RouteGuard-Dns7HD7C.js +77 -0
- package/lib/RouteGuard-Dns7HD7C.js.map +1 -0
- package/lib/{SchemaList-E6lF7dID.js → SchemaList-D23IyrX5.js} +28 -27
- package/lib/SchemaList-D23IyrX5.js.map +1 -0
- package/lib/SchemaView-DVbiGPo3.js +438 -0
- package/lib/SchemaView-DVbiGPo3.js.map +1 -0
- package/lib/Secret-CyhXSA8i.js +263 -0
- package/lib/Secret-CyhXSA8i.js.map +1 -0
- package/lib/SignUp-DfEe1w5X.js +55 -0
- package/lib/SignUp-DfEe1w5X.js.map +1 -0
- package/lib/{SyntaxHighlight-C19vH0V_.js → SyntaxHighlight-N2RffYNz.js} +1469 -1411
- package/lib/SyntaxHighlight-N2RffYNz.js.map +1 -0
- package/lib/{Toc-DbWS75JZ.js → Toc-Cpo_HSYx.js} +3 -3
- package/lib/{Toc-DbWS75JZ.js.map → Toc-Cpo_HSYx.js.map} +1 -1
- package/lib/{ErrorAlert-_1Zmhr68.js → Zudoku-GbutmWzP.js} +5663 -4482
- package/lib/Zudoku-GbutmWzP.js.map +1 -0
- package/lib/ZudokuContext-LPkD2SQs.js +250 -0
- package/lib/ZudokuContext-LPkD2SQs.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 +8558 -0
- package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
- package/lib/{circular-BoYo7au5.js → circular-DfSpMuY7.js} +6429 -6019
- package/lib/circular-DfSpMuY7.js.map +1 -0
- package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
- package/lib/cn-5-Gd1Dss.js.map +1 -0
- package/lib/{createServer-B_BZ7xX8.js → createServer-4kaAMuIM.js} +2790 -2737
- package/lib/createServer-4kaAMuIM.js.map +1 -0
- package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
- package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
- package/lib/{errors-CD873hrG.js → errors-CtZTDEB6.js} +3 -3
- package/lib/{errors-CD873hrG.js.map → errors-CtZTDEB6.js.map} +1 -1
- package/lib/firebase-D286uF4e.js +7615 -0
- package/lib/firebase-D286uF4e.js.map +1 -0
- package/lib/hook-DyEn6D2Q.js +53 -0
- package/lib/hook-DyEn6D2Q.js.map +1 -0
- package/lib/{index-HNVs5cgX.js → index-B7bvsQHg.js} +853 -802
- package/lib/index-B7bvsQHg.js.map +1 -0
- package/lib/{index-BK0jKRrX.js → index-CVumYRba.js} +2 -2
- package/lib/{index-BK0jKRrX.js.map → index-CVumYRba.js.map} +1 -1
- 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-BkpWrvLZ.js +34 -0
- package/lib/index.esm-BkpWrvLZ.js.map +1 -0
- package/lib/{index.esm-BnYHxCYC.js → index.esm-Ca5zvoff.js} +2 -2
- package/lib/{index.esm-BnYHxCYC.js.map → index.esm-Ca5zvoff.js.map} +1 -1
- package/lib/{invariant-Bm-FVUQE.js → invariant-B_t_F2s_.js} +4 -4
- package/lib/invariant-B_t_F2s_.js.map +1 -0
- package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
- package/lib/{mutation-BSU0xu4m.js → mutation-B7eFBLZY.js} +70 -44
- package/lib/mutation-B7eFBLZY.js.map +1 -0
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +32 -20
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +1 -1
- package/lib/ui/Breadcrumb.js +1 -1
- package/lib/ui/Button.js +27 -25
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/ButtonGroup.js +77 -0
- package/lib/ui/ButtonGroup.js.map +1 -0
- package/lib/ui/Callout.js +1 -1
- package/lib/ui/Card.js +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/CodeBlock.js +1 -1
- package/lib/ui/Command.js +5 -5
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +3 -3
- package/lib/ui/DropdownMenu.js +227 -140
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/Frame.js +1 -1
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/InputGroup.js +155 -0
- package/lib/ui/InputGroup.js.map +1 -0
- package/lib/ui/Item.js +1 -1
- package/lib/ui/Kbd.js +32 -0
- package/lib/ui/Kbd.js.map +1 -0
- package/lib/ui/Label.js +1 -1
- package/lib/ui/NativeSelect.js +1 -1
- package/lib/ui/Pagination.js +1 -1
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Secret.js +3 -3
- package/lib/ui/Secret.js.map +1 -1
- package/lib/ui/Separator.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +1 -1
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Value.js +1 -1
- package/lib/ui/util.js +1 -1
- package/lib/useExposedProps-CzTDfXfq.js +30 -0
- package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
- package/lib/useMutation-CErliDZ9.js +119 -0
- package/lib/useMutation-CErliDZ9.js.map +1 -0
- package/lib/useQuery-ht7aWJ3S.js +1212 -0
- 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 +1540 -1553
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +19 -18
- 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 +52 -75
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-firebase.js +10 -0
- package/lib/zudoku.auth-firebase.js.map +1 -0
- package/lib/zudoku.auth-openid.js +8 -7
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.auth-supabase.js +31 -40
- package/lib/zudoku.auth-supabase.js.map +1 -1
- package/lib/zudoku.components.js +29 -25
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +20 -20
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.mermaid.js +11 -0
- package/lib/zudoku.mermaid.js.map +1 -0
- package/lib/zudoku.plugin-api-catalog.js +42 -37
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +617 -550
- 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 +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +186 -226
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js +9 -8
- package/lib/zudoku.plugins.js.map +1 -1
- package/lib/zudoku.react-query.js +441 -0
- package/lib/zudoku.react-query.js.map +1 -0
- package/lib/zudoku.router.js +1130 -1404
- package/lib/zudoku.router.js.map +1 -1
- package/package.json +63 -37
- package/src/app/defaultTheme.css +4 -0
- package/src/app/main.css +2 -0
- package/src/app/main.tsx +1 -1
- package/src/app/sentry.ts +1 -1
- package/src/lib/auth/issuer.ts +1 -1
- package/src/lib/authentication/authentication.ts +8 -2
- package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
- package/src/lib/authentication/components/SignIn.tsx +5 -2
- package/src/lib/authentication/components/SignUp.tsx +5 -2
- package/src/lib/authentication/hook.ts +16 -0
- package/src/lib/authentication/providers/auth0.tsx +21 -10
- package/src/lib/authentication/providers/clerk.tsx +0 -26
- package/src/lib/authentication/providers/firebase.tsx +98 -6
- package/src/lib/authentication/providers/supabase.tsx +6 -15
- package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +181 -39
- package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
- package/src/lib/components/Bootstrap.tsx +1 -4
- package/src/lib/components/Mermaid.tsx +68 -0
- package/src/lib/components/MobileTopNavigation.tsx +16 -9
- package/src/lib/components/PagefindSearchMeta.tsx +14 -0
- package/src/lib/components/Pagination.tsx +4 -5
- package/src/lib/components/Slot.test.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +26 -8
- package/src/lib/components/Zudoku.tsx +22 -21
- package/src/lib/components/context/ZudokuContext.ts +33 -12
- 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 -35
- 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 +26 -4
- package/src/lib/components/navigation/NavigationWrapper.tsx +1 -1
- package/src/lib/components/navigation/utils.ts +44 -2
- package/src/lib/core/RouteGuard.tsx +30 -24
- package/src/lib/core/ZudokuContext.ts +7 -1
- package/src/lib/core/__internal.tsx +2 -0
- package/src/lib/core/plugins.ts +27 -3
- package/src/lib/core/react-query.ts +1 -0
- package/src/lib/core/transform-config.test.tsx +99 -0
- package/src/lib/core/transform-config.ts +67 -0
- package/src/lib/errors/ErrorAlert.tsx +1 -6
- package/src/lib/errors/ErrorMessage.tsx +38 -0
- package/src/lib/hooks/index.ts +7 -16
- package/src/lib/hooks/useEvent.test.tsx +1 -1
- package/src/lib/navigation/pathMatcher.test.ts +136 -0
- package/src/lib/navigation/pathMatcher.ts +93 -0
- package/src/lib/navigation/positionItems.test.ts +265 -0
- package/src/lib/navigation/positionItems.ts +111 -0
- package/src/lib/oas/graphql/circular.test.ts +221 -0
- package/src/lib/oas/graphql/circular.ts +31 -18
- package/src/lib/oas/graphql/index.ts +7 -3
- package/src/lib/oas/parser/index.ts +19 -6
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
- package/src/lib/plugins/api-keys/index.tsx +76 -32
- package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
- package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
- package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
- package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +115 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
- package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/OasProvider.tsx +38 -17
- package/src/lib/plugins/openapi/OperationList.tsx +48 -28
- package/src/lib/plugins/openapi/OperationListItem.tsx +5 -5
- package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
- package/src/lib/plugins/openapi/ParameterList.tsx +2 -2
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +37 -15
- package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +20 -3
- package/src/lib/plugins/openapi/index.tsx +16 -7
- package/src/lib/plugins/openapi/interfaces.ts +21 -7
- package/src/lib/plugins/openapi/playground/Playground.tsx +8 -4
- 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/SchemaView.tsx +56 -43
- package/src/lib/plugins/openapi/schema/utils.ts +20 -6
- package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
- package/src/lib/plugins/openapi/util/getRoutes.tsx +38 -3
- package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
- package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
- package/src/lib/shiki.ts +21 -12
- package/src/lib/ui/Alert.tsx +17 -5
- package/src/lib/ui/Button.tsx +11 -10
- package/src/lib/ui/ButtonGroup.tsx +82 -0
- package/src/lib/ui/Command.tsx +3 -3
- package/src/lib/ui/DropdownMenu.tsx +226 -170
- package/src/lib/ui/InputGroup.tsx +168 -0
- package/src/lib/ui/Kbd.tsx +28 -0
- package/src/lib/ui/Secret.tsx +2 -2
- package/src/lib/util/MdxComponents.tsx +2 -0
- package/src/lib/util/flattenAllOf.test.ts +73 -20
- package/src/lib/util/flattenAllOf.ts +0 -36
- package/src/lib/util/flattenAllOfProcessor.ts +58 -0
- package/src/lib/util/invariant.ts +2 -1
- package/src/lib/util/readFrontmatter.ts +14 -0
- package/src/shiki/langs/c3.js +1 -0
- package/src/shiki/langs/gn.js +1 -0
- package/src/shiki/langs/markdown-nix.js +1 -0
- package/src/shiki/langs/moonbit.js +1 -0
- package/src/shiki/langs/openscad.js +1 -0
- 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/dist/vite/create-pagefind-index.d.ts +0 -4
- package/dist/vite/create-pagefind-index.js +0 -12
- package/dist/vite/create-pagefind-index.js.map +0 -1
- package/lib/Button-B3ucvvQw.js +0 -52
- package/lib/Button-B3ucvvQw.js.map +0 -1
- package/lib/Command-CUcrW3qs.js.map +0 -1
- package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
- package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
- package/lib/ErrorAlert-_1Zmhr68.js.map +0 -1
- package/lib/MdxPage-B2t1EShN.js +0 -240
- package/lib/MdxPage-B2t1EShN.js.map +0 -1
- package/lib/OAuthErrorPage-DnKnq4xK.js.map +0 -1
- package/lib/OasProvider-BhuIkD4Z.js +0 -36
- package/lib/OasProvider-BhuIkD4Z.js.map +0 -1
- package/lib/OperationList-D8EDc9v7.js.map +0 -1
- package/lib/Pagination-hk-llhpw.js +0 -37
- package/lib/Pagination-hk-llhpw.js.map +0 -1
- package/lib/RouteGuard-Brz95MSt.js +0 -77
- package/lib/RouteGuard-Brz95MSt.js.map +0 -1
- package/lib/RouterError-CMaIfdjb.js +0 -42
- package/lib/RouterError-CMaIfdjb.js.map +0 -1
- package/lib/SchemaList-E6lF7dID.js.map +0 -1
- package/lib/SchemaView-CIv-OXgv.js +0 -572
- package/lib/SchemaView-CIv-OXgv.js.map +0 -1
- package/lib/Select-DFRCS31-.js +0 -399
- package/lib/Select-DFRCS31-.js.map +0 -1
- package/lib/SignUp-sGYAsj2K.js +0 -50
- package/lib/SignUp-sGYAsj2K.js.map +0 -1
- package/lib/SyntaxHighlight-C19vH0V_.js.map +0 -1
- package/lib/ZudokuContext-BUZ5hkWB.js +0 -1508
- package/lib/ZudokuContext-BUZ5hkWB.js.map +0 -1
- package/lib/chunk-PVWAREVJ-BMhpCH5D.js +0 -7965
- package/lib/chunk-PVWAREVJ-BMhpCH5D.js.map +0 -1
- package/lib/circular-BoYo7au5.js.map +0 -1
- package/lib/cn-dYga0KKN.js.map +0 -1
- package/lib/createServer-B_BZ7xX8.js.map +0 -1
- package/lib/hook-CMeoxziF.js +0 -40
- package/lib/hook-CMeoxziF.js.map +0 -1
- package/lib/index-HNVs5cgX.js.map +0 -1
- package/lib/index-pMMX55GH.js +0 -1059
- package/lib/index-pMMX55GH.js.map +0 -1
- package/lib/invariant-Bm-FVUQE.js.map +0 -1
- package/lib/mutation-BSU0xu4m.js.map +0 -1
- package/lib/useExposedProps-U3pmsHaG.js +0 -113
- package/lib/useExposedProps-U3pmsHaG.js.map +0 -1
|
@@ -1,56 +1,182 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { CircleSlashIcon as z, CheckIcon as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import { e as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { a as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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-B_t_F2s_.js";
|
|
4
|
+
import * as F from "react";
|
|
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-GbutmWzP.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-DyEn6D2Q.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-CyhXSA8i.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-LPkD2SQs.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";
|
|
24
|
+
import { B as k } from "./Button-GUVe7pmt.js";
|
|
25
|
+
import { I as Ye } from "./Input-Cx-GeKoF.js";
|
|
26
|
+
function Ue({ error: t }) {
|
|
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;
|
|
28
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ e.jsxs(D, { variant: "destructive", children: [
|
|
30
|
+
/* @__PURE__ */ e.jsx(P, { children: r }),
|
|
31
|
+
/* @__PURE__ */ e.jsx(oe, { children: a })
|
|
32
|
+
] }),
|
|
33
|
+
s && n && /* @__PURE__ */ e.jsx(be, { className: "mb-4", children: n }),
|
|
34
|
+
s && d && /* @__PURE__ */ e.jsx(
|
|
35
|
+
Fe,
|
|
36
|
+
{
|
|
37
|
+
className: "max-h-[400px] [&>pre]:p-4",
|
|
38
|
+
language: "js",
|
|
39
|
+
code: d
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
const We = ({
|
|
45
|
+
service: t,
|
|
46
|
+
onOpenChange: a
|
|
47
|
+
}) => {
|
|
48
|
+
const s = W(), n = ce(), r = Be(), i = _e({
|
|
49
|
+
defaultValues: {
|
|
50
|
+
expiresOn: "30"
|
|
51
|
+
}
|
|
52
|
+
}), o = ae(), d = q({
|
|
53
|
+
mutationFn: ({ description: c, expiresOn: u }) => {
|
|
54
|
+
if (!t.createKey)
|
|
55
|
+
throw new Error("createKey not implemented");
|
|
56
|
+
const f = u !== "never" ? Xe(Number(u)) : void 0;
|
|
57
|
+
return t.createKey({
|
|
58
|
+
apiKey: {
|
|
59
|
+
description: c || "Secret Key",
|
|
60
|
+
expiresOn: f
|
|
61
|
+
},
|
|
62
|
+
context: s,
|
|
63
|
+
auth: o
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
onSuccess: async () => {
|
|
67
|
+
await n.invalidateQueries({ queryKey: ["api-keys"] }), await r("/settings/api-keys/");
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return t.createKey ? /* @__PURE__ */ e.jsxs(
|
|
71
|
+
"form",
|
|
72
|
+
{
|
|
73
|
+
onSubmit: i.handleSubmit(
|
|
74
|
+
(c) => d.mutate(
|
|
75
|
+
{ ...c },
|
|
76
|
+
{
|
|
77
|
+
onSuccess: () => a(!1)
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
),
|
|
81
|
+
children: [
|
|
82
|
+
d.error && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
83
|
+
/* @__PURE__ */ e.jsx(P, { children: "Error" }),
|
|
84
|
+
/* @__PURE__ */ e.jsx(oe, { children: d.error.message })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
|
|
87
|
+
"Name",
|
|
88
|
+
/* @__PURE__ */ e.jsx(Ge, { ...i.register("description") }),
|
|
89
|
+
"Expiration",
|
|
90
|
+
/* @__PURE__ */ e.jsxs(
|
|
91
|
+
$e,
|
|
92
|
+
{
|
|
93
|
+
onValueChange: (c) => i.setValue("expiresOn", c),
|
|
94
|
+
defaultValue: i.getValues("expiresOn"),
|
|
95
|
+
children: [
|
|
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: [
|
|
99
|
+
c,
|
|
100
|
+
" days"
|
|
101
|
+
] }, c)),
|
|
102
|
+
/* @__PURE__ */ e.jsx(se, { value: "never", children: "Never" })
|
|
103
|
+
] }) })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
),
|
|
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" })
|
|
110
|
+
] })
|
|
111
|
+
] })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
) : null;
|
|
115
|
+
}, Xe = (t) => {
|
|
116
|
+
const a = /* @__PURE__ */ new Date();
|
|
117
|
+
return a.setDate(a.getDate() + t), a.toISOString();
|
|
118
|
+
}, de = ({
|
|
119
|
+
service: t,
|
|
120
|
+
isOpen: a,
|
|
121
|
+
onOpenChange: s,
|
|
122
|
+
trigger: n,
|
|
123
|
+
buttonVariant: r = "outline"
|
|
124
|
+
}) => {
|
|
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 })
|
|
131
|
+
] })
|
|
132
|
+
] });
|
|
133
|
+
}, et = Q({});
|
|
134
|
+
function ue(t) {
|
|
135
|
+
const a = A(null);
|
|
136
|
+
return a.current === null && (a.current = t()), a.current;
|
|
35
137
|
}
|
|
36
|
-
const
|
|
37
|
-
function
|
|
138
|
+
const tt = typeof window < "u", st = tt ? Ce : re, pe = /* @__PURE__ */ Q(null);
|
|
139
|
+
function nt(t) {
|
|
38
140
|
return typeof t == "object" && t !== null;
|
|
39
141
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
142
|
+
function it(t) {
|
|
143
|
+
return nt(t) && "offsetHeight" in t;
|
|
42
144
|
}
|
|
43
|
-
const
|
|
145
|
+
const rt = Q({
|
|
44
146
|
transformPagePoint: (t) => t,
|
|
45
147
|
isStatic: !1,
|
|
46
148
|
reducedMotion: "never"
|
|
47
149
|
});
|
|
48
|
-
|
|
49
|
-
|
|
150
|
+
function ne(t, a) {
|
|
151
|
+
if (typeof t == "function")
|
|
152
|
+
return t(a);
|
|
153
|
+
t != null && (t.current = a);
|
|
154
|
+
}
|
|
155
|
+
function at(...t) {
|
|
156
|
+
return (a) => {
|
|
157
|
+
let s = !1;
|
|
158
|
+
const n = t.map((r) => {
|
|
159
|
+
const i = ne(r, a);
|
|
160
|
+
return !s && typeof i == "function" && (s = !0), i;
|
|
161
|
+
});
|
|
162
|
+
if (s)
|
|
163
|
+
return () => {
|
|
164
|
+
for (let r = 0; r < n.length; r++) {
|
|
165
|
+
const i = n[r];
|
|
166
|
+
typeof i == "function" ? i() : ne(t[r], null);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function ot(...t) {
|
|
172
|
+
return F.useCallback(at(...t), t);
|
|
173
|
+
}
|
|
174
|
+
class lt extends F.Component {
|
|
175
|
+
getSnapshotBeforeUpdate(a) {
|
|
50
176
|
const s = this.props.childRef.current;
|
|
51
|
-
if (s &&
|
|
52
|
-
const n = s.offsetParent,
|
|
53
|
-
|
|
177
|
+
if (s && a.isPresent && !this.props.isPresent) {
|
|
178
|
+
const n = s.offsetParent, r = it(n) && n.offsetWidth || 0, i = this.props.sizeRef.current;
|
|
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;
|
|
54
180
|
}
|
|
55
181
|
return null;
|
|
56
182
|
}
|
|
@@ -63,574 +189,502 @@ class We extends L.Component {
|
|
|
63
189
|
return this.props.children;
|
|
64
190
|
}
|
|
65
191
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
192
|
+
function ct({ children: t, isPresent: a, anchorX: s, root: n }) {
|
|
193
|
+
const r = H(), i = A(null), o = A({
|
|
68
194
|
width: 0,
|
|
69
195
|
height: 0,
|
|
70
196
|
top: 0,
|
|
71
197
|
left: 0,
|
|
72
198
|
right: 0
|
|
73
|
-
}), { nonce:
|
|
74
|
-
return
|
|
75
|
-
const { width:
|
|
76
|
-
if (
|
|
199
|
+
}), { nonce: d } = V(rt), c = ot(i, t?.ref);
|
|
200
|
+
return we(() => {
|
|
201
|
+
const { width: u, height: f, top: p, left: m, right: g } = o.current;
|
|
202
|
+
if (a || !i.current || !u || !f)
|
|
77
203
|
return;
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
[data-motion-pop-id="${
|
|
204
|
+
const j = s === "left" ? `left: ${m}` : `right: ${g}`;
|
|
205
|
+
i.current.dataset.motionPopId = r;
|
|
206
|
+
const l = document.createElement("style");
|
|
207
|
+
d && (l.nonce = d);
|
|
208
|
+
const x = n ?? document.head;
|
|
209
|
+
return x.appendChild(l), l.sheet && l.sheet.insertRule(`
|
|
210
|
+
[data-motion-pop-id="${r}"] {
|
|
85
211
|
position: absolute !important;
|
|
86
|
-
width: ${
|
|
87
|
-
height: ${
|
|
88
|
-
${
|
|
89
|
-
top: ${
|
|
212
|
+
width: ${u}px !important;
|
|
213
|
+
height: ${f}px !important;
|
|
214
|
+
${j}px !important;
|
|
215
|
+
top: ${p}px !important;
|
|
90
216
|
}
|
|
91
217
|
`), () => {
|
|
92
|
-
|
|
218
|
+
x.contains(l) && x.removeChild(l);
|
|
93
219
|
};
|
|
94
|
-
}, [
|
|
220
|
+
}, [a]), e.jsx(lt, { isPresent: a, childRef: i, sizeRef: o, children: F.cloneElement(t, { ref: c }) });
|
|
95
221
|
}
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
let
|
|
99
|
-
id:
|
|
100
|
-
initial:
|
|
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,
|
|
226
|
+
initial: a,
|
|
101
227
|
isPresent: s,
|
|
102
|
-
custom:
|
|
103
|
-
onExitComplete: (
|
|
104
|
-
|
|
105
|
-
for (const
|
|
106
|
-
if (!
|
|
228
|
+
custom: r,
|
|
229
|
+
onExitComplete: (g) => {
|
|
230
|
+
u.set(g, !0);
|
|
231
|
+
for (const j of u.values())
|
|
232
|
+
if (!j)
|
|
107
233
|
return;
|
|
108
234
|
n && n();
|
|
109
235
|
},
|
|
110
|
-
register: (
|
|
111
|
-
}), [s,
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
}, [s]),
|
|
115
|
-
!s && !
|
|
116
|
-
}, [s]),
|
|
236
|
+
register: (g) => (u.set(g, !1), () => u.delete(g))
|
|
237
|
+
}), [s, u, n]);
|
|
238
|
+
return i && p && (m = { ...m }), L(() => {
|
|
239
|
+
u.forEach((g, j) => u.set(j, !1));
|
|
240
|
+
}, [s]), F.useEffect(() => {
|
|
241
|
+
!s && !u.size && n && n();
|
|
242
|
+
}, [s]), o === "popLayout" && (t = e.jsx(ct, { isPresent: s, anchorX: d, root: c, children: t })), e.jsx(pe.Provider, { value: m, children: t });
|
|
117
243
|
};
|
|
118
|
-
function
|
|
244
|
+
function ut() {
|
|
119
245
|
return /* @__PURE__ */ new Map();
|
|
120
246
|
}
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
247
|
+
function pt(t = !0) {
|
|
248
|
+
const a = V(pe);
|
|
249
|
+
if (a === null)
|
|
124
250
|
return [!0, null];
|
|
125
|
-
const { isPresent: s, onExitComplete: n, register:
|
|
251
|
+
const { isPresent: s, onExitComplete: n, register: r } = a, i = H();
|
|
126
252
|
re(() => {
|
|
127
253
|
if (t)
|
|
128
|
-
return i
|
|
254
|
+
return r(i);
|
|
129
255
|
}, [t]);
|
|
130
|
-
const
|
|
131
|
-
return !s && n ? [!1,
|
|
256
|
+
const o = ke(() => t && n && n(i), [i, n, t]);
|
|
257
|
+
return !s && n ? [!1, o] : [!0];
|
|
132
258
|
}
|
|
133
259
|
const R = (t) => t.key || "";
|
|
134
|
-
function
|
|
135
|
-
const
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
}),
|
|
260
|
+
function ie(t) {
|
|
261
|
+
const a = [];
|
|
262
|
+
return Ee.forEach(t, (s) => {
|
|
263
|
+
Ie(s) && a.push(s);
|
|
264
|
+
}), a;
|
|
139
265
|
}
|
|
140
|
-
const
|
|
141
|
-
const [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
for (let
|
|
145
|
-
const y = R(
|
|
146
|
-
m.includes(y) ?
|
|
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;
|
|
270
|
+
for (let w = 0; w < h.length; w++) {
|
|
271
|
+
const y = R(h[w]);
|
|
272
|
+
m.includes(y) ? l.delete(y) : l.get(y) !== !0 && l.set(y, !1);
|
|
147
273
|
}
|
|
148
|
-
}, [
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
151
|
-
let
|
|
152
|
-
for (let y = 0; y <
|
|
153
|
-
const
|
|
154
|
-
m.includes($) || (
|
|
274
|
+
}, [h, m.length, m.join("-")]);
|
|
275
|
+
const K = [];
|
|
276
|
+
if (p !== x) {
|
|
277
|
+
let w = [...p];
|
|
278
|
+
for (let y = 0; y < h.length; y++) {
|
|
279
|
+
const b = h[y], $ = R(b);
|
|
280
|
+
m.includes($) || (w.splice(y, 0, b), K.push(b));
|
|
155
281
|
}
|
|
156
|
-
return
|
|
282
|
+
return i === "wait" && K.length && (w = K), C(ie(w)), v(p), null;
|
|
157
283
|
}
|
|
158
|
-
process.env.NODE_ENV !== "production" &&
|
|
159
|
-
const { forceRender:
|
|
160
|
-
return e.jsx(e.Fragment, { children:
|
|
161
|
-
const y = R(
|
|
162
|
-
if (
|
|
163
|
-
|
|
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.`);
|
|
285
|
+
const { forceRender: fe } = V(et);
|
|
286
|
+
return e.jsx(e.Fragment, { children: h.map((w) => {
|
|
287
|
+
const y = R(w), b = o && !u ? !1 : p === h || m.includes(y), $ = () => {
|
|
288
|
+
if (l.has(y))
|
|
289
|
+
l.set(y, !0);
|
|
164
290
|
else
|
|
165
291
|
return;
|
|
166
|
-
let
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}),
|
|
292
|
+
let ee = !0;
|
|
293
|
+
l.forEach((he) => {
|
|
294
|
+
he || (ee = !1);
|
|
295
|
+
}), ee && (fe?.(), C(j.current), o && f?.(), n && n());
|
|
170
296
|
};
|
|
171
|
-
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);
|
|
172
298
|
}) });
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
ref: i,
|
|
178
|
-
disabled: t,
|
|
179
|
-
...n,
|
|
180
|
-
className: A("relative", s),
|
|
181
|
-
children: [
|
|
182
|
-
t && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ e.jsx(Le, {}) }),
|
|
183
|
-
/* @__PURE__ */ e.jsx("span", { className: A("block", t && "invisible"), children: r })
|
|
184
|
-
]
|
|
185
|
-
}
|
|
186
|
-
)
|
|
187
|
-
);
|
|
188
|
-
ce.displayName = "ActionButton";
|
|
189
|
-
const st = ({
|
|
190
|
-
service: t,
|
|
191
|
-
onOpenChange: r
|
|
299
|
+
}, ht = ({
|
|
300
|
+
apiKey: t,
|
|
301
|
+
onDeleteKey: a,
|
|
302
|
+
className: s
|
|
192
303
|
}) => {
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
context: s,
|
|
208
|
-
auth: l
|
|
209
|
-
});
|
|
210
|
-
},
|
|
211
|
-
onSuccess: async () => {
|
|
212
|
-
await n.invalidateQueries({ queryKey: ["api-keys"] }), await i("/settings/api-keys/");
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
return t.createKey ? /* @__PURE__ */ e.jsxs(
|
|
216
|
-
"form",
|
|
217
|
-
{
|
|
218
|
-
onSubmit: a.handleSubmit(
|
|
219
|
-
(h) => u.mutate(
|
|
220
|
-
{ ...h },
|
|
221
|
-
{
|
|
222
|
-
onSuccess: () => r(!1)
|
|
223
|
-
}
|
|
224
|
-
)
|
|
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(
|
|
305
|
+
(new Date(d).getTime() - Date.now()) / (1e3 * 60 * 60 * 24)
|
|
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: [
|
|
308
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
309
|
+
/* @__PURE__ */ e.jsx(
|
|
310
|
+
Ve,
|
|
311
|
+
{
|
|
312
|
+
className: "max-w-fit w-full",
|
|
313
|
+
secret: i,
|
|
314
|
+
status: c ? "expired" : f ? "expiring" : "active",
|
|
315
|
+
revealed: n,
|
|
316
|
+
onReveal: r
|
|
317
|
+
}
|
|
225
318
|
),
|
|
226
|
-
children: [
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
319
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
|
|
320
|
+
o && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
321
|
+
"Created ",
|
|
322
|
+
mt(o),
|
|
323
|
+
"."
|
|
230
324
|
] }),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
325
|
+
" ",
|
|
326
|
+
d && f && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
327
|
+
"Expires in ",
|
|
328
|
+
u,
|
|
329
|
+
" ",
|
|
330
|
+
u === 1 ? "day" : "days",
|
|
331
|
+
"."
|
|
332
|
+
] }),
|
|
333
|
+
d && c && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
334
|
+
"Expired",
|
|
335
|
+
" ",
|
|
336
|
+
u === 0 ? "today." : `${u * -1} days ago.`
|
|
337
|
+
] })
|
|
338
|
+
] })
|
|
339
|
+
] }),
|
|
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?" })
|
|
346
|
+
] }),
|
|
347
|
+
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
348
|
+
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", children: "Cancel" }) }),
|
|
349
|
+
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
350
|
+
k,
|
|
237
351
|
{
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
/* @__PURE__ */ e.jsx(Ee, { children: /* @__PURE__ */ e.jsxs(De, { children: [
|
|
243
|
-
[7, 30, 60, 90].map((h) => /* @__PURE__ */ e.jsxs(Z, { value: String(h), children: [
|
|
244
|
-
h,
|
|
245
|
-
" days"
|
|
246
|
-
] }, h)),
|
|
247
|
-
/* @__PURE__ */ e.jsx(Z, { value: "never", children: "Never" })
|
|
248
|
-
] }) })
|
|
249
|
-
]
|
|
352
|
+
onClick: () => {
|
|
353
|
+
a();
|
|
354
|
+
},
|
|
355
|
+
children: "Delete"
|
|
250
356
|
}
|
|
251
|
-
)
|
|
252
|
-
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
253
|
-
/* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", children: "Cancel" }) }),
|
|
254
|
-
/* @__PURE__ */ e.jsx(ce, { isPending: u.isPending, children: "Generate Key" })
|
|
255
|
-
] })
|
|
357
|
+
) })
|
|
256
358
|
] })
|
|
257
|
-
]
|
|
258
|
-
}
|
|
259
|
-
) : null;
|
|
260
|
-
}, nt = (t) => {
|
|
261
|
-
const r = /* @__PURE__ */ new Date();
|
|
262
|
-
return r.setDate(r.getDate() + t), r.toISOString();
|
|
263
|
-
}, te = ({
|
|
264
|
-
service: t,
|
|
265
|
-
isOpen: r,
|
|
266
|
-
onOpenChange: s,
|
|
267
|
-
trigger: n,
|
|
268
|
-
buttonVariant: i = "outline"
|
|
269
|
-
}) => {
|
|
270
|
-
const a = /* @__PURE__ */ e.jsx(w, { variant: i, children: "Create API Key" });
|
|
271
|
-
return /* @__PURE__ */ e.jsxs(V, { open: r, onOpenChange: s, children: [
|
|
272
|
-
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: n ?? a }),
|
|
273
|
-
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
274
|
-
/* @__PURE__ */ e.jsx(U, { children: /* @__PURE__ */ e.jsx(W, { children: "Create API Key" }) }),
|
|
275
|
-
/* @__PURE__ */ e.jsx(st, { service: t, onOpenChange: s })
|
|
276
|
-
] })
|
|
359
|
+
] })
|
|
360
|
+
] }) })
|
|
277
361
|
] });
|
|
278
|
-
},
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
362
|
+
}, mt = (t) => {
|
|
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" });
|
|
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");
|
|
365
|
+
}, xt = ({
|
|
366
|
+
consumer: t,
|
|
367
|
+
onUpdate: a,
|
|
368
|
+
onRollKey: s,
|
|
369
|
+
onDeleteKey: n
|
|
370
|
+
}) => {
|
|
371
|
+
const [r, i] = I(!1), [o, d] = I(t.label), c = ce(), u = W(), f = q({
|
|
372
|
+
mutationFn: async (l) => {
|
|
373
|
+
if (!s)
|
|
374
|
+
throw new Error("rollKey not implemented");
|
|
375
|
+
return await s?.(l, u);
|
|
376
|
+
},
|
|
377
|
+
onSuccess: () => void c.invalidateQueries({ queryKey: ["api-keys"] })
|
|
378
|
+
}), p = q({
|
|
286
379
|
mutationFn: ({
|
|
287
|
-
consumerId:
|
|
288
|
-
keyId:
|
|
380
|
+
consumerId: l,
|
|
381
|
+
keyId: x
|
|
289
382
|
}) => {
|
|
290
|
-
if (!
|
|
383
|
+
if (!n)
|
|
291
384
|
throw new Error("deleteKey not implemented");
|
|
292
|
-
return
|
|
385
|
+
return n(l, x, u);
|
|
293
386
|
},
|
|
294
|
-
onMutate: async ({ consumerId:
|
|
295
|
-
await
|
|
296
|
-
const
|
|
387
|
+
onMutate: async ({ consumerId: l, keyId: x }) => {
|
|
388
|
+
await c.cancelQueries({ queryKey: ["api-keys"] });
|
|
389
|
+
const v = c.getQueryData([
|
|
297
390
|
"api-keys"
|
|
298
391
|
]);
|
|
299
|
-
return
|
|
300
|
-
...
|
|
301
|
-
apiKeys:
|
|
302
|
-
} :
|
|
392
|
+
return c.setQueryData(["api-keys"], (h) => h && h.map((C) => C.id === l ? {
|
|
393
|
+
...C,
|
|
394
|
+
apiKeys: C.apiKeys.filter((K) => K.id !== x)
|
|
395
|
+
} : C)), { previousData: v };
|
|
303
396
|
},
|
|
304
|
-
onError: (
|
|
305
|
-
|
|
397
|
+
onError: (l, x, v) => {
|
|
398
|
+
v?.previousData && c.setQueryData(["api-keys"], v.previousData);
|
|
306
399
|
},
|
|
307
400
|
onSuccess: () => {
|
|
308
|
-
|
|
401
|
+
c.invalidateQueries({ queryKey: ["api-keys"] });
|
|
309
402
|
}
|
|
310
|
-
}), m =
|
|
403
|
+
}), m = q({
|
|
311
404
|
mutationFn: ({
|
|
312
|
-
consumerId:
|
|
313
|
-
label:
|
|
405
|
+
consumerId: l,
|
|
406
|
+
label: x
|
|
314
407
|
}) => {
|
|
315
|
-
if (!
|
|
408
|
+
if (!a)
|
|
316
409
|
throw new Error("updateConsumer not implemented");
|
|
317
|
-
return
|
|
410
|
+
return a({ id: l, label: x }, u);
|
|
318
411
|
},
|
|
319
|
-
onMutate: async ({ consumerId:
|
|
320
|
-
await
|
|
321
|
-
const
|
|
322
|
-
return
|
|
323
|
-
...
|
|
324
|
-
label:
|
|
325
|
-
} :
|
|
412
|
+
onMutate: async ({ consumerId: l, label: x }) => {
|
|
413
|
+
await c.cancelQueries({ queryKey: ["api-keys"] });
|
|
414
|
+
const v = c.getQueryData(["api-keys"]);
|
|
415
|
+
return c.setQueryData(["api-keys"], (h) => h && h.map((C) => C.id === l ? {
|
|
416
|
+
...C,
|
|
417
|
+
label: x
|
|
418
|
+
} : C)), { previousData: v };
|
|
326
419
|
},
|
|
327
|
-
onError: (
|
|
328
|
-
|
|
420
|
+
onError: (l, x, v) => {
|
|
421
|
+
v?.previousData && c.setQueryData(["api-keys"], v.previousData);
|
|
329
422
|
},
|
|
330
423
|
onSuccess: () => {
|
|
331
|
-
|
|
424
|
+
c.invalidateQueries({ queryKey: ["api-keys"] });
|
|
332
425
|
}
|
|
333
|
-
}),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}), x = (o, c) => {
|
|
341
|
-
i(o), l(c);
|
|
342
|
-
}, j = (o) => {
|
|
343
|
-
a.trim() && m.mutate({
|
|
344
|
-
consumerId: o,
|
|
345
|
-
label: a.trim()
|
|
346
|
-
}), i(null), l("");
|
|
347
|
-
}, P = () => {
|
|
348
|
-
i(null), l("");
|
|
426
|
+
}), g = () => {
|
|
427
|
+
i(!0), d(t.label);
|
|
428
|
+
}, j = () => {
|
|
429
|
+
o.trim() && m.mutate({
|
|
430
|
+
label: o.trim(),
|
|
431
|
+
consumerId: t.id
|
|
432
|
+
}), i(!1);
|
|
349
433
|
};
|
|
350
|
-
return /* @__PURE__ */ e.jsxs(
|
|
351
|
-
/* @__PURE__ */ e.
|
|
352
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
|
|
353
|
-
/* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
|
|
354
|
-
t.createKey && /* @__PURE__ */ e.jsx(
|
|
355
|
-
te,
|
|
356
|
-
{
|
|
357
|
-
service: t,
|
|
358
|
-
isOpen: d,
|
|
359
|
-
onOpenChange: g
|
|
360
|
-
}
|
|
361
|
-
)
|
|
362
|
-
] }),
|
|
363
|
-
/* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
|
|
364
|
-
/* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page-before-keys" }),
|
|
365
|
-
/* @__PURE__ */ e.jsx("div", { className: "h-8" }),
|
|
366
|
-
p.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
434
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
435
|
+
f.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
367
436
|
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
368
|
-
/* @__PURE__ */ e.jsx(
|
|
437
|
+
/* @__PURE__ */ e.jsx(P, { children: f.error.message })
|
|
369
438
|
] }),
|
|
370
|
-
m.isError && /* @__PURE__ */ e.jsxs(
|
|
439
|
+
m.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
371
440
|
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
372
|
-
/* @__PURE__ */ e.jsx(
|
|
441
|
+
/* @__PURE__ */ e.jsx(P, { children: m.error.message })
|
|
373
442
|
] }),
|
|
374
|
-
|
|
443
|
+
p.isError && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
375
444
|
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
376
|
-
/* @__PURE__ */ e.jsx(
|
|
445
|
+
/* @__PURE__ */ e.jsx(P, { children: p.error.message })
|
|
377
446
|
] }),
|
|
378
|
-
/* @__PURE__ */ e.
|
|
379
|
-
|
|
380
|
-
"You have no API keys yet.",
|
|
381
|
-
/* @__PURE__ */ e.jsx("br", {}),
|
|
382
|
-
t.createKey && "Get started and create your first key."
|
|
383
|
-
] }),
|
|
384
|
-
t.createKey && /* @__PURE__ */ e.jsx(
|
|
385
|
-
te,
|
|
386
|
-
{
|
|
387
|
-
service: t,
|
|
388
|
-
isOpen: d,
|
|
389
|
-
onOpenChange: g
|
|
390
|
-
}
|
|
391
|
-
)
|
|
392
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
393
|
-
"ul",
|
|
447
|
+
/* @__PURE__ */ e.jsxs(
|
|
448
|
+
De,
|
|
394
449
|
{
|
|
395
|
-
className:
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
450
|
+
className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ e.jsxs(Pe, { className: "col-span-full flex-row items-start justify-between gap-4", children: [
|
|
453
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
454
|
+
r ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
455
|
+
/* @__PURE__ */ e.jsx(
|
|
456
|
+
Ye,
|
|
457
|
+
{
|
|
458
|
+
maxLength: 32,
|
|
459
|
+
value: o,
|
|
460
|
+
onChange: (l) => d(l.target.value),
|
|
461
|
+
onKeyDown: (l) => {
|
|
462
|
+
l.key === "Enter" ? j() : l.key === "Escape" && i(!1);
|
|
463
|
+
},
|
|
464
|
+
autoFocus: !0
|
|
465
|
+
}
|
|
466
|
+
),
|
|
467
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
468
|
+
/* @__PURE__ */ e.jsx(
|
|
469
|
+
k,
|
|
470
|
+
{
|
|
471
|
+
size: "icon",
|
|
472
|
+
variant: "ghost",
|
|
473
|
+
onClick: j,
|
|
474
|
+
disabled: !o.trim(),
|
|
475
|
+
children: /* @__PURE__ */ e.jsx(xe, { size: 16 })
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
/* @__PURE__ */ e.jsx(
|
|
479
|
+
k,
|
|
480
|
+
{
|
|
481
|
+
size: "icon",
|
|
482
|
+
variant: "ghost",
|
|
483
|
+
onClick: () => i(!1),
|
|
484
|
+
children: /* @__PURE__ */ e.jsx(ye, { size: 16 })
|
|
485
|
+
}
|
|
486
|
+
)
|
|
487
|
+
] })
|
|
488
|
+
] }) : /* @__PURE__ */ e.jsx(Ae, { children: t.label }),
|
|
489
|
+
/* @__PURE__ */ e.jsxs(Se, { children: [
|
|
490
|
+
t.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
491
|
+
"Created on ",
|
|
492
|
+
new Date(t.createdOn).toLocaleDateString()
|
|
493
|
+
] }),
|
|
494
|
+
t.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
495
|
+
"Expires on ",
|
|
496
|
+
new Date(t.expiresOn).toLocaleDateString()
|
|
497
|
+
] })
|
|
498
|
+
] })
|
|
499
|
+
] }),
|
|
500
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
501
|
+
a && /* @__PURE__ */ e.jsxs(
|
|
502
|
+
k,
|
|
503
|
+
{
|
|
504
|
+
variant: "ghost",
|
|
505
|
+
onClick: g,
|
|
506
|
+
className: X(
|
|
507
|
+
"flex gap-2",
|
|
508
|
+
r && "opacity-0! pointer-events-none"
|
|
509
|
+
),
|
|
510
|
+
disabled: r,
|
|
511
|
+
children: [
|
|
512
|
+
/* @__PURE__ */ e.jsx(ge, { size: 16 }),
|
|
513
|
+
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
),
|
|
517
|
+
s && /* @__PURE__ */ e.jsxs(Z, { children: [
|
|
518
|
+
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
519
|
+
k,
|
|
520
|
+
{
|
|
521
|
+
title: "Roll this key",
|
|
522
|
+
variant: "ghost",
|
|
523
|
+
disabled: f.isPending,
|
|
524
|
+
className: "flex items-center gap-2",
|
|
525
|
+
children: [
|
|
407
526
|
/* @__PURE__ */ e.jsx(
|
|
408
|
-
|
|
527
|
+
je,
|
|
409
528
|
{
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
onChange: (c) => l(c.target.value),
|
|
413
|
-
onKeyDown: (c) => {
|
|
414
|
-
c.key === "Enter" ? j(o.id) : c.key === "Escape" && P();
|
|
415
|
-
},
|
|
416
|
-
className: "text-lg font-medium",
|
|
417
|
-
autoFocus: !0
|
|
529
|
+
size: 16,
|
|
530
|
+
className: f.isPending ? "animate-spin" : void 0
|
|
418
531
|
}
|
|
419
532
|
),
|
|
420
|
-
/* @__PURE__ */ e.
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
children: /* @__PURE__ */ e.jsx(ue, { size: 16 })
|
|
429
|
-
}
|
|
430
|
-
),
|
|
431
|
-
/* @__PURE__ */ e.jsx(
|
|
432
|
-
w,
|
|
433
|
-
{
|
|
434
|
-
size: "icon",
|
|
435
|
-
variant: "ghost",
|
|
436
|
-
onClick: P,
|
|
437
|
-
children: /* @__PURE__ */ e.jsx(he, { size: 16 })
|
|
438
|
-
}
|
|
439
|
-
)
|
|
440
|
-
] })
|
|
441
|
-
] }) : o.label,
|
|
442
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: o.createdOn })
|
|
533
|
+
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
) }),
|
|
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?" })
|
|
443
541
|
] }),
|
|
444
|
-
/* @__PURE__ */ e.jsxs(
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
new Date(o.createdOn).toLocaleDateString()
|
|
449
|
-
] }),
|
|
450
|
-
o.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
451
|
-
"Expires on",
|
|
452
|
-
" ",
|
|
453
|
-
new Date(o.expiresOn).toLocaleDateString()
|
|
454
|
-
] })
|
|
455
|
-
] })
|
|
456
|
-
] }),
|
|
457
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
|
|
458
|
-
t.updateConsumer && /* @__PURE__ */ e.jsxs(
|
|
459
|
-
w,
|
|
460
|
-
{
|
|
461
|
-
variant: "ghost",
|
|
462
|
-
onClick: () => x(o.id, o.label),
|
|
463
|
-
className: A(
|
|
464
|
-
"flex gap-2",
|
|
465
|
-
n === o.id && "opacity-0! pointer-events-none"
|
|
466
|
-
),
|
|
467
|
-
disabled: n === o.id,
|
|
468
|
-
children: [
|
|
469
|
-
/* @__PURE__ */ e.jsx(fe, { size: 16 }),
|
|
470
|
-
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
|
|
471
|
-
]
|
|
472
|
-
}
|
|
473
|
-
),
|
|
474
|
-
t.rollKey && /* @__PURE__ */ e.jsxs(V, { children: [
|
|
475
|
-
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
476
|
-
w,
|
|
542
|
+
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
543
|
+
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", children: "Cancel" }) }),
|
|
544
|
+
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
545
|
+
k,
|
|
477
546
|
{
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
children: [
|
|
483
|
-
/* @__PURE__ */ e.jsx(
|
|
484
|
-
pe,
|
|
485
|
-
{
|
|
486
|
-
size: 16,
|
|
487
|
-
className: p.isPending ? "animate-spin" : void 0
|
|
488
|
-
}
|
|
489
|
-
),
|
|
490
|
-
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
|
|
491
|
-
]
|
|
547
|
+
onClick: () => {
|
|
548
|
+
f.mutate(t.id);
|
|
549
|
+
},
|
|
550
|
+
children: "Roll Key"
|
|
492
551
|
}
|
|
493
|
-
) })
|
|
494
|
-
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
495
|
-
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
496
|
-
/* @__PURE__ */ e.jsx(W, { children: "Roll API Key" }),
|
|
497
|
-
/* @__PURE__ */ e.jsx(ie, { children: "Are you sure you want to roll this API key?" })
|
|
498
|
-
] }),
|
|
499
|
-
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
500
|
-
/* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", children: "Cancel" }) }),
|
|
501
|
-
/* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
502
|
-
w,
|
|
503
|
-
{
|
|
504
|
-
onClick: () => {
|
|
505
|
-
p.mutate(o.id);
|
|
506
|
-
},
|
|
507
|
-
children: "Roll Key"
|
|
508
|
-
}
|
|
509
|
-
) })
|
|
510
|
-
] })
|
|
511
|
-
] })
|
|
552
|
+
) })
|
|
512
553
|
] })
|
|
513
554
|
] })
|
|
514
|
-
] })
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
}
|
|
536
|
-
) })
|
|
555
|
+
] })
|
|
556
|
+
] })
|
|
557
|
+
] }),
|
|
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,
|
|
560
|
+
{
|
|
561
|
+
apiKey: l,
|
|
562
|
+
onDeleteKey: () => {
|
|
563
|
+
p.mutate({
|
|
564
|
+
consumerId: t.id,
|
|
565
|
+
keyId: l.id
|
|
566
|
+
});
|
|
567
|
+
},
|
|
568
|
+
className: p.variables?.keyId === l.id && p.isPending ? "opacity-10!" : void 0
|
|
569
|
+
},
|
|
570
|
+
l.id
|
|
571
|
+
)) }) })
|
|
572
|
+
]
|
|
573
|
+
},
|
|
574
|
+
t.id
|
|
575
|
+
)
|
|
537
576
|
] });
|
|
538
|
-
},
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
577
|
+
}, yt = ({ service: t }) => {
|
|
578
|
+
const a = W(), { data: s } = Je({
|
|
579
|
+
queryFn: async () => {
|
|
580
|
+
try {
|
|
581
|
+
return await t.getConsumers(a);
|
|
582
|
+
} catch (i) {
|
|
583
|
+
throw i instanceof M ? i : new M("Cannot get API keys", {
|
|
584
|
+
cause: i,
|
|
585
|
+
title: "Error getting API keys",
|
|
586
|
+
developerHint: "Check the response of the API request for more information."
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
queryKey: ["api-keys"],
|
|
591
|
+
retry: !1
|
|
592
|
+
}), [n, r] = I(!1);
|
|
593
|
+
return /* @__PURE__ */ e.jsx("div", { className: "mt-8", children: s.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex col-span-full flex-col justify-center gap-4 items-center p-8 border rounded-sm bg-muted/30 text-muted-foreground", children: [
|
|
594
|
+
/* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
|
|
595
|
+
"You have no API keys yet.",
|
|
596
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
597
|
+
t.createKey && "Get started and create your first key."
|
|
598
|
+
] }),
|
|
599
|
+
t.createKey && /* @__PURE__ */ e.jsx(
|
|
600
|
+
de,
|
|
601
|
+
{
|
|
602
|
+
service: t,
|
|
603
|
+
isOpen: n,
|
|
604
|
+
onOpenChange: r
|
|
605
|
+
}
|
|
606
|
+
)
|
|
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,
|
|
609
|
+
{
|
|
610
|
+
consumer: i,
|
|
611
|
+
onUpdate: t.updateConsumer,
|
|
612
|
+
onRollKey: t.rollKey,
|
|
613
|
+
onDeleteKey: t.deleteKey
|
|
614
|
+
},
|
|
615
|
+
i.id
|
|
616
|
+
)) }) });
|
|
617
|
+
}, gt = ({ service: t }) => {
|
|
618
|
+
const [a, s] = I(!1), n = ae();
|
|
619
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "max-w-3xl h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
|
|
620
|
+
/* @__PURE__ */ e.jsx(te.Target, { name: "api-keys-list-page" }),
|
|
621
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
|
|
622
|
+
/* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
|
|
623
|
+
t.createKey && /* @__PURE__ */ e.jsx(
|
|
624
|
+
de,
|
|
553
625
|
{
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
revealed: n,
|
|
558
|
-
onReveal: i
|
|
626
|
+
service: t,
|
|
627
|
+
isOpen: a,
|
|
628
|
+
onOpenChange: s
|
|
559
629
|
}
|
|
560
|
-
)
|
|
561
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
|
|
562
|
-
l && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
563
|
-
"Created ",
|
|
564
|
-
it(l),
|
|
565
|
-
"."
|
|
566
|
-
] }),
|
|
567
|
-
" ",
|
|
568
|
-
u && g && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
569
|
-
"Expires in ",
|
|
570
|
-
d,
|
|
571
|
-
" ",
|
|
572
|
-
d === 1 ? "day" : "days",
|
|
573
|
-
"."
|
|
574
|
-
] }),
|
|
575
|
-
u && h && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
576
|
-
"Expired",
|
|
577
|
-
" ",
|
|
578
|
-
d === 0 ? "today." : `${d * -1} days ago.`
|
|
579
|
-
] })
|
|
580
|
-
] })
|
|
630
|
+
)
|
|
581
631
|
] }),
|
|
582
|
-
/* @__PURE__ */ e.jsx("
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
children: "Delete"
|
|
598
|
-
}
|
|
599
|
-
) })
|
|
600
|
-
] })
|
|
601
|
-
] })
|
|
602
|
-
] }) })
|
|
632
|
+
/* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
|
|
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." })
|
|
638
|
+
] }),
|
|
639
|
+
/* @__PURE__ */ e.jsx(Me, { children: /* @__PURE__ */ e.jsx(_, { onClick: () => n.requestEmailVerification(), children: "Verify email" }) })
|
|
640
|
+
] }) : /* @__PURE__ */ e.jsx(
|
|
641
|
+
Ke,
|
|
642
|
+
{
|
|
643
|
+
fallbackRender: ({ error: r }) => /* @__PURE__ */ e.jsx(Ue, { error: r }),
|
|
644
|
+
children: /* @__PURE__ */ e.jsx(yt, { service: t })
|
|
645
|
+
}
|
|
646
|
+
)
|
|
603
647
|
] });
|
|
604
|
-
},
|
|
648
|
+
}, N = "https://api.zuploedge.com/v2/client", jt = async (t) => {
|
|
605
649
|
try {
|
|
606
650
|
return await t.json();
|
|
607
651
|
} catch {
|
|
608
652
|
return;
|
|
609
653
|
}
|
|
610
|
-
},
|
|
611
|
-
const
|
|
612
|
-
if (!t.ok &&
|
|
613
|
-
const s = await
|
|
654
|
+
}, O = async (t) => {
|
|
655
|
+
const a = t.headers.get("content-type");
|
|
656
|
+
if (!t.ok && a?.includes("application/problem+json")) {
|
|
657
|
+
const s = await jt(t);
|
|
614
658
|
if (s.type && s.title)
|
|
615
659
|
throw new Error(s.detail ?? s.title);
|
|
616
660
|
}
|
|
617
|
-
},
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
661
|
+
}, T = {
|
|
662
|
+
developerHint: "This project is not linked to a Zuplo deployment. Run `zuplo link` to get started with API Keys.",
|
|
663
|
+
title: "Not linked to a Zuplo deployment"
|
|
664
|
+
}, vt = ({
|
|
665
|
+
deploymentName: t,
|
|
666
|
+
...a
|
|
667
|
+
}) => ({
|
|
668
|
+
deleteKey: async (s, n, r) => {
|
|
669
|
+
E(t, "Cannot delete API key.", T);
|
|
670
|
+
const i = new Request(
|
|
671
|
+
N + `/${t}/consumers/${s}/keys/${n}`,
|
|
621
672
|
{
|
|
622
673
|
method: "DELETE"
|
|
623
674
|
}
|
|
624
|
-
);
|
|
625
|
-
await
|
|
626
|
-
const l = await fetch(a);
|
|
627
|
-
await T(l), I(l.ok, "Failed to delete API key");
|
|
675
|
+
), o = await fetch(await r.signRequest(i));
|
|
676
|
+
await O(o), E(o.ok, "Failed to delete API key");
|
|
628
677
|
},
|
|
629
678
|
updateConsumer: async (s, n) => {
|
|
630
|
-
|
|
679
|
+
E(
|
|
680
|
+
t,
|
|
681
|
+
"Cannot update API key description.",
|
|
682
|
+
T
|
|
683
|
+
);
|
|
684
|
+
const r = await fetch(
|
|
631
685
|
await n.signRequest(
|
|
632
686
|
new Request(
|
|
633
|
-
|
|
687
|
+
`${N}/${t}/consumers/${s.id}`,
|
|
634
688
|
{
|
|
635
689
|
method: "PATCH",
|
|
636
690
|
headers: {
|
|
@@ -643,13 +697,14 @@ const st = ({
|
|
|
643
697
|
)
|
|
644
698
|
)
|
|
645
699
|
);
|
|
646
|
-
await
|
|
700
|
+
await O(r), E(r.ok, "Failed to update API key description");
|
|
647
701
|
},
|
|
648
702
|
rollKey: async (s, n) => {
|
|
649
|
-
|
|
703
|
+
E(t, "Cannot roll API key.", T);
|
|
704
|
+
const r = await fetch(
|
|
650
705
|
await n.signRequest(
|
|
651
706
|
new Request(
|
|
652
|
-
|
|
707
|
+
`${N}/${t}/consumers/${s}/roll-key`,
|
|
653
708
|
{
|
|
654
709
|
method: "POST",
|
|
655
710
|
headers: {
|
|
@@ -660,42 +715,59 @@ const st = ({
|
|
|
660
715
|
)
|
|
661
716
|
)
|
|
662
717
|
);
|
|
663
|
-
await
|
|
718
|
+
await O(r), E(r.ok, "Failed to roll API key");
|
|
664
719
|
},
|
|
665
720
|
getConsumers: async (s) => {
|
|
721
|
+
E(t, "Cannot get API keys.", T);
|
|
666
722
|
const n = new Request(
|
|
667
|
-
`${
|
|
723
|
+
`${N}/${t}/consumers`
|
|
668
724
|
);
|
|
669
725
|
await s.signRequest(n);
|
|
670
|
-
const
|
|
671
|
-
return await
|
|
672
|
-
id:
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
726
|
+
const r = await fetch(n);
|
|
727
|
+
return await O(r), E(r.ok, "Failed to fetch API keys"), (await r.json()).data.map((o) => ({
|
|
728
|
+
id: o.id,
|
|
729
|
+
createdOn: o.createdOn,
|
|
730
|
+
updatedOn: o.updatedOn,
|
|
731
|
+
expiresOn: o.expiresOn,
|
|
732
|
+
label: o.label || o.subject || "API Key",
|
|
733
|
+
apiKeys: o.apiKeys.data,
|
|
734
|
+
key: o.apiKeys.data.at(0)
|
|
676
735
|
}));
|
|
677
736
|
},
|
|
678
|
-
...
|
|
679
|
-
}),
|
|
680
|
-
|
|
737
|
+
...a
|
|
738
|
+
}), _t = (t) => t, Bt = ({
|
|
739
|
+
deploymentName: t,
|
|
740
|
+
isZuplo: a,
|
|
741
|
+
...s
|
|
742
|
+
}) => {
|
|
743
|
+
a && !t && console.warn(
|
|
744
|
+
"This project is not linked to a Zuplo deployment. Run `zuplo link` to get started."
|
|
745
|
+
);
|
|
746
|
+
const n = a ? vt({ deploymentName: t, ...s }) : s;
|
|
747
|
+
if (!n.getConsumers)
|
|
748
|
+
throw new Error("getConsumers is required when using the apiKeyPlugin");
|
|
749
|
+
const r = {
|
|
750
|
+
...n,
|
|
751
|
+
getConsumers: n.getConsumers
|
|
752
|
+
};
|
|
681
753
|
return {
|
|
682
754
|
getProfileMenuItems: () => [
|
|
683
755
|
{
|
|
684
756
|
label: "API Keys",
|
|
685
757
|
path: "/settings/api-keys",
|
|
686
758
|
category: "middle",
|
|
687
|
-
icon:
|
|
759
|
+
icon: ve
|
|
688
760
|
}
|
|
689
761
|
],
|
|
690
|
-
getIdentities: async (
|
|
762
|
+
getIdentities: async (i) => {
|
|
691
763
|
try {
|
|
692
|
-
return (await r.getConsumers(
|
|
693
|
-
authorizeRequest: (
|
|
764
|
+
return (await r.getConsumers(i)).map((d) => ({
|
|
765
|
+
authorizeRequest: (c) => (c.headers.set(
|
|
694
766
|
"Authorization",
|
|
695
|
-
`Bearer ${
|
|
696
|
-
),
|
|
697
|
-
id:
|
|
698
|
-
label:
|
|
767
|
+
`Bearer ${d.apiKeys.at(0)?.key}`
|
|
768
|
+
), c),
|
|
769
|
+
id: d.id,
|
|
770
|
+
label: d.label
|
|
699
771
|
}));
|
|
700
772
|
} catch {
|
|
701
773
|
return [];
|
|
@@ -703,20 +775,15 @@ const st = ({
|
|
|
703
775
|
},
|
|
704
776
|
getRoutes: () => [
|
|
705
777
|
{
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
children: [
|
|
709
|
-
{
|
|
710
|
-
path: "/settings/api-keys",
|
|
711
|
-
element: /* @__PURE__ */ e.jsx(rt, { service: r })
|
|
712
|
-
}
|
|
713
|
-
]
|
|
778
|
+
path: "/settings/api-keys",
|
|
779
|
+
element: /* @__PURE__ */ e.jsx(gt, { service: r })
|
|
714
780
|
}
|
|
715
|
-
]
|
|
781
|
+
],
|
|
782
|
+
getProtectedRoutes: () => ["/settings/api-keys"]
|
|
716
783
|
};
|
|
717
784
|
};
|
|
718
785
|
export {
|
|
719
|
-
|
|
720
|
-
|
|
786
|
+
Bt as apiKeyPlugin,
|
|
787
|
+
_t as createApiKeyService
|
|
721
788
|
};
|
|
722
789
|
//# sourceMappingURL=zudoku.plugin-api-keys.js.map
|