zudoku 0.0.0-fd0986c → 0.0.0-fdf886de
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/demo.js +1 -1
- package/dist/app/entry.client.js +1 -1
- package/dist/app/entry.server.js +1 -1
- package/dist/app/main.d.ts +1 -1
- package/dist/app/main.js +12 -6
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js +1 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/config/validators/InputNavigationSchema.d.ts +251 -156
- package/dist/config/validators/InputNavigationSchema.js +5 -4
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.test-d.js +0 -1
- package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -1
- package/dist/config/validators/NavigationSchema.js +6 -3
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +13 -0
- package/dist/config/validators/ProtectedRoutesSchema.js +10 -0
- package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/icon-types.js +16 -0
- package/dist/config/validators/icon-types.js.map +1 -1
- package/dist/config/validators/validate.d.ts +44 -30
- package/dist/config/validators/validate.js +8 -2
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +11 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js +11 -9
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/OAuthErrorPage.d.ts +3 -0
- package/dist/lib/authentication/components/OAuthErrorPage.js +99 -0
- package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -0
- package/dist/lib/authentication/errors.d.ts +6 -12
- package/dist/lib/authentication/errors.js +2 -1
- package/dist/lib/authentication/errors.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/azureb2c.js +4 -2
- package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +4 -2
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.js +3 -1
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/BuildCheck.d.ts +2 -1
- package/dist/lib/components/BuildCheck.js +9 -3
- package/dist/lib/components/BuildCheck.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +4 -7
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +2 -2
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/Meta.d.ts +2 -0
- package/dist/lib/components/Meta.js +11 -0
- package/dist/lib/components/Meta.js.map +1 -0
- package/dist/lib/components/MobileTopNavigation.js +5 -3
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +1 -1
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +4 -3
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Typography.d.ts +1 -1
- package/dist/lib/components/Typography.js +1 -1
- package/dist/lib/components/Typography.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +22 -14
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +0 -27
- package/dist/lib/components/index.js +0 -15
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/NavigationCategory.js +1 -1
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.d.ts +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +11 -3
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +3 -1
- package/dist/lib/components/navigation/utils.js +18 -14
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +9 -9
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +5 -1
- package/dist/lib/core/ZudokuContext.js +23 -1
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/__internal.d.ts +37 -0
- package/dist/lib/core/__internal.js +26 -0
- package/dist/lib/core/__internal.js.map +1 -0
- package/dist/lib/core/plugins.d.ts +2 -1
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/core/router.d.ts +1 -0
- package/dist/lib/core/router.js +2 -0
- package/dist/lib/core/router.js.map +1 -0
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +13 -3
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +3 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +9 -4
- package/dist/lib/plugins/api-keys/index.js +3 -7
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/index.js +3 -0
- package/dist/lib/plugins/custom-pages/index.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +42 -10
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +4 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/shiki.d.ts +4 -0
- package/dist/lib/shiki.js +2 -0
- package/dist/lib/shiki.js.map +1 -1
- package/dist/lib/ui/ActionButton.js +1 -1
- package/dist/lib/ui/ActionButton.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/CodeBlock.js +30 -4
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/ui/Dialog.js +2 -2
- package/dist/lib/ui/Dialog.js.map +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +6 -5
- package/dist/lib/util/invariant.js +1 -1
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/vite/config.js +6 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +9 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/mdx/remark-inject-filepath.d.ts +3 -0
- package/dist/vite/mdx/remark-inject-filepath.js +6 -0
- package/dist/vite/mdx/remark-inject-filepath.js.map +1 -0
- package/dist/vite/mdx/remark-link-rewrite.d.ts +2 -0
- package/dist/vite/mdx/remark-link-rewrite.js +20 -0
- package/dist/vite/mdx/remark-link-rewrite.js.map +1 -0
- package/dist/vite/mdx/remark-normalize-image-url.d.ts +2 -0
- package/dist/vite/mdx/remark-normalize-image-url.js +12 -0
- package/dist/vite/mdx/remark-normalize-image-url.js.map +1 -0
- package/dist/vite/{remarkStaticGeneration.d.ts → mdx/remark-static-generation.d.ts} +2 -2
- package/dist/vite/{remarkStaticGeneration.js → mdx/remark-static-generation.js} +1 -1
- package/dist/vite/mdx/remark-static-generation.js.map +1 -0
- package/dist/vite/plugin-config.d.ts +1 -1
- package/dist/vite/plugin-config.js +2 -1
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.js +18 -13
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-mdx.js +6 -23
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-theme.js +80 -40
- package/dist/vite/plugin-theme.js.map +1 -1
- package/dist/vite/prerender/worker.js +5 -1
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/vite/shadcn-registry.d.ts +4 -4
- package/dist/vite/sitemap.js +10 -9
- package/dist/vite/sitemap.js.map +1 -1
- package/lib/Button-B3o-2Xdf.js.map +1 -1
- package/lib/Card-CMDQUPM4.js.map +1 -1
- package/lib/CategoryHeading-DCpZu3yG.js +17 -0
- package/lib/CategoryHeading-DCpZu3yG.js.map +1 -0
- package/lib/ClientOnly-E7hGysn1.js.map +1 -1
- package/lib/CodeBlock-yJjjRwj-.js +98 -0
- package/lib/CodeBlock-yJjjRwj-.js.map +1 -0
- package/lib/{Command-C9AC5cf-.js → Command-CDn17s8X.js} +2 -2
- package/lib/{Command-C9AC5cf-.js.map → Command-CDn17s8X.js.map} +1 -1
- package/lib/Dialog-BrIjMmUK.js +114 -0
- package/lib/Dialog-BrIjMmUK.js.map +1 -0
- package/lib/{Drawer-DXGPOKPx.js → Drawer-DJ05s2pH.js} +86 -86
- package/lib/{Drawer-DXGPOKPx.js.map → Drawer-DJ05s2pH.js.map} +1 -1
- package/lib/{MdxPage-BI0vLjSn.js → MdxPage-BmOQ5m5g.js} +19 -18
- package/lib/{MdxPage-BI0vLjSn.js.map → MdxPage-BmOQ5m5g.js.map} +1 -1
- package/lib/OAuthErrorPage-Jv3r8wnL.js +150 -0
- package/lib/OAuthErrorPage-Jv3r8wnL.js.map +1 -0
- package/lib/{OasProvider-CK4C2QI3.js → OasProvider-CA_lpILt.js} +3 -3
- package/lib/{OasProvider-CK4C2QI3.js.map → OasProvider-CA_lpILt.js.map} +1 -1
- package/lib/{OperationList-DhA6x6qm.js → OperationList-C-TObVw6.js} +47 -44
- package/lib/OperationList-C-TObVw6.js.map +1 -0
- package/lib/{Pagination-YjKVdgm9.js → Pagination-CBiRGddW.js} +3 -3
- package/lib/{Pagination-YjKVdgm9.js.map → Pagination-CBiRGddW.js.map} +1 -1
- package/lib/RouteGuard-JLH6tCY8.js +56 -0
- package/lib/RouteGuard-JLH6tCY8.js.map +1 -0
- package/lib/RouterError-DcVonMP1.js +41 -0
- package/lib/RouterError-DcVonMP1.js.map +1 -0
- package/lib/{SchemaList-Cx9MS7Wf.js → SchemaList-BeYWvBC7.js} +15 -14
- package/lib/{SchemaList-Cx9MS7Wf.js.map → SchemaList-BeYWvBC7.js.map} +1 -1
- package/lib/{SchemaView-C6sTKWyS.js → SchemaView-CRcShewo.js} +4 -4
- package/lib/{SchemaView-C6sTKWyS.js.map → SchemaView-CRcShewo.js.map} +1 -1
- package/lib/Select-C3efYI1n.js +273 -0
- package/lib/Select-C3efYI1n.js.map +1 -0
- package/lib/{SignUp-DiDmVb3x.js → SignUp-CxBGHgba.js} +6 -6
- package/lib/{SignUp-DiDmVb3x.js.map → SignUp-CxBGHgba.js.map} +1 -1
- package/lib/{Slot-CrCBhP3G.js → Slot-DOtTvoyj.js} +2050 -2288
- package/lib/{Slot-CrCBhP3G.js.map → Slot-DOtTvoyj.js.map} +1 -1
- package/lib/Spinner-mNLZ6awP.js.map +1 -1
- package/lib/{SyntaxHighlight-CVe58ZSY.js → SyntaxHighlight-GR0eix_L.js} +411 -409
- package/lib/SyntaxHighlight-GR0eix_L.js.map +1 -0
- package/lib/{Toc-CpsFSXeD.js → Toc-BlcGIkXc.js} +2 -2
- package/lib/{Toc-CpsFSXeD.js.map → Toc-BlcGIkXc.js.map} +1 -1
- package/lib/ZudokuContext-BuJD7yIX.js +1286 -0
- package/lib/ZudokuContext-BuJD7yIX.js.map +1 -0
- package/lib/chunk-QMGIS6GS-DqecZ6nq.js +9204 -0
- package/lib/chunk-QMGIS6GS-DqecZ6nq.js.map +1 -0
- package/lib/{circular-OvXQH6UK.js → circular-CGTcsqA3.js} +2 -2
- package/lib/{circular-OvXQH6UK.js.map → circular-CGTcsqA3.js.map} +1 -1
- package/lib/cn-dYga0KKN.js.map +1 -1
- package/lib/{createServer-B5U_8E3S.js → createServer-DjgpuLne.js} +5 -5
- package/lib/{createServer-B5U_8E3S.js.map → createServer-DjgpuLne.js.map} +1 -1
- package/lib/errors-CrI3s7mR.js +45 -0
- package/lib/errors-CrI3s7mR.js.map +1 -0
- package/lib/hook-bv3iuX7X.js +247 -0
- package/lib/hook-bv3iuX7X.js.map +1 -0
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/{index-BzcS9JBW.js → index-CvTWnHZF.js} +860 -938
- package/lib/index-CvTWnHZF.js.map +1 -0
- package/lib/index-DI5SPFK9.js.map +1 -1
- package/lib/index-DmNq2fbN.js.map +1 -1
- package/lib/index-DzO-Qh6S.js +1061 -0
- package/lib/index-DzO-Qh6S.js.map +1 -0
- package/lib/{index-4XtG1tlD.js → index-HarEI51d.js} +2 -2
- package/lib/{index-4XtG1tlD.js.map → index-HarEI51d.js.map} +1 -1
- package/lib/index.esm-BnYHxCYC.js +683 -0
- package/lib/index.esm-BnYHxCYC.js.map +1 -0
- package/lib/index.esm-CdzlRw50.js +1254 -0
- package/lib/index.esm-CdzlRw50.js.map +1 -0
- package/lib/{invariant-DAFpPywt.js → invariant-Bm-FVUQE.js} +2 -6
- package/lib/invariant-Bm-FVUQE.js.map +1 -0
- package/lib/jsx-runtime-C5mzlN2N.js.map +1 -1
- package/lib/mutation-Dy_5up8v.js +196 -0
- package/lib/mutation-Dy_5up8v.js.map +1 -0
- package/lib/processors/removeExtensions.js.map +1 -1
- package/lib/processors/removeParameters.js.map +1 -1
- package/lib/processors/removePaths.js.map +1 -1
- package/lib/processors/traverse.js.map +1 -1
- package/lib/ui/Accordion.js.map +1 -1
- package/lib/ui/ActionButton.js +9 -9
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/AlertDialog.js.map +1 -1
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Breadcrumb.js.map +1 -1
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js.map +1 -1
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/CodeBlock.js +1 -1
- package/lib/ui/Command.js +1 -1
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +56 -41
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/Drawer.js +1 -1
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +1 -1
- package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/Form.js.map +1 -1
- package/lib/ui/HoverCard.js.map +1 -1
- package/lib/ui/Input.js.map +1 -1
- package/lib/ui/Label.js.map +1 -1
- package/lib/ui/Pagination.js.map +1 -1
- package/lib/ui/Popover.js.map +1 -1
- package/lib/ui/Progress.js.map +1 -1
- package/lib/ui/RadioGroup.js.map +1 -1
- package/lib/ui/ScrollArea.js.map +1 -1
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Skeleton.js.map +1 -1
- package/lib/ui/Slider.js.map +1 -1
- package/lib/ui/Stepper.js.map +1 -1
- package/lib/ui/Switch.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +4 -4
- package/lib/ui/Tabs.js.map +1 -1
- package/lib/ui/Textarea.js.map +1 -1
- package/lib/ui/Toggle.js.map +1 -1
- package/lib/ui/ToggleGroup.js.map +1 -1
- package/lib/ui/Tooltip.js.map +1 -1
- package/lib/useExposedProps-BH9aq4MD.js +113 -0
- package/lib/useExposedProps-BH9aq4MD.js.map +1 -0
- package/lib/useLatest-hmRS46UF.js +11 -0
- package/lib/useLatest-hmRS46UF.js.map +1 -0
- package/lib/zudoku.__internal.js +2965 -0
- package/lib/zudoku.__internal.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +46 -9880
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +25 -22
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +204 -195
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.auth-supabase.js +97 -0
- package/lib/zudoku.auth-supabase.js.map +1 -0
- package/lib/zudoku.components.js +21 -28
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +7 -7
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.icons.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +23 -22
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +410 -295
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +8 -5
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +7 -6
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +3 -3
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +28 -27
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/lib/zudoku.router.js +123 -0
- package/lib/zudoku.router.js.map +1 -0
- package/package.json +31 -23
- package/src/app/demo.tsx +1 -1
- package/src/app/entry.client.tsx +1 -1
- package/src/app/entry.server.tsx +1 -1
- package/src/app/main.css +22 -5
- package/src/app/main.tsx +23 -11
- package/src/app/standalone.tsx +1 -1
- package/src/lib/authentication/components/CallbackHandler.tsx +22 -15
- package/src/lib/authentication/components/OAuthErrorPage.tsx +171 -0
- package/src/lib/authentication/errors.ts +27 -13
- package/src/lib/authentication/hook.ts +2 -0
- package/src/lib/authentication/providers/azureb2c.tsx +8 -3
- package/src/lib/authentication/providers/clerk.tsx +4 -1
- package/src/lib/authentication/providers/openid.tsx +7 -1
- package/src/lib/components/BuildCheck.tsx +13 -3
- package/src/lib/components/Header.tsx +4 -3
- package/src/lib/components/Heading.tsx +1 -1
- package/src/lib/components/Layout.tsx +2 -21
- package/src/lib/components/Markdown.tsx +3 -3
- package/src/lib/components/Meta.tsx +32 -0
- package/src/lib/components/MobileTopNavigation.tsx +6 -3
- package/src/lib/components/NotFoundPage.tsx +3 -2
- package/src/lib/components/TopNavigation.tsx +4 -4
- package/src/lib/components/Typography.tsx +1 -1
- package/src/lib/components/context/ZudokuContext.ts +26 -19
- package/src/lib/components/index.ts +0 -18
- package/src/lib/components/navigation/NavigationCategory.tsx +1 -1
- package/src/lib/components/navigation/NavigationItem.tsx +13 -3
- package/src/lib/components/navigation/utils.ts +21 -15
- package/src/lib/core/RouteGuard.tsx +13 -13
- package/src/lib/core/ZudokuContext.ts +37 -5
- package/src/lib/core/__internal.tsx +30 -0
- package/src/lib/core/plugins.ts +2 -1
- package/src/lib/core/router.ts +1 -0
- package/src/lib/errors/ErrorAlert.tsx +5 -7
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +17 -3
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +21 -3
- package/src/lib/plugins/api-keys/index.tsx +16 -11
- package/src/lib/plugins/custom-pages/index.tsx +3 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -1
- package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +2 -0
- package/src/lib/plugins/openapi/index.tsx +66 -16
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +8 -2
- package/src/lib/shiki.ts +2 -0
- package/src/lib/ui/ActionButton.tsx +3 -1
- package/src/lib/ui/CodeBlock.tsx +38 -13
- package/src/lib/ui/Dialog.tsx +12 -3
- package/src/lib/ui/EmbeddedCodeBlock.tsx +1 -1
- package/src/lib/util/invariant.ts +7 -5
- package/src/shiki/langs/vue-vine.js +1 -0
- package/dist/vite/remarkStaticGeneration.js.map +0 -1
- package/lib/Alert-Cig_8hW6.js +0 -161
- package/lib/Alert-Cig_8hW6.js.map +0 -1
- package/lib/CodeBlock-BaBgX9Wy.js +0 -85
- package/lib/CodeBlock-BaBgX9Wy.js.map +0 -1
- package/lib/Dialog-DMWw1doX.js +0 -99
- package/lib/Dialog-DMWw1doX.js.map +0 -1
- package/lib/OperationList-DhA6x6qm.js.map +0 -1
- package/lib/RouteGuard-Vnlz_t51.js +0 -737
- package/lib/RouteGuard-Vnlz_t51.js.map +0 -1
- package/lib/SyntaxHighlight-CVe58ZSY.js.map +0 -1
- package/lib/chunk-DQRVZFIR-DHK7_Ilc.js +0 -1839
- package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +0 -1
- package/lib/clerk-BDZ31hjU.js +0 -25190
- package/lib/clerk-BDZ31hjU.js.map +0 -1
- package/lib/errors-DOCWNkkS.js +0 -78
- package/lib/errors-DOCWNkkS.js.map +0 -1
- package/lib/hook-CZjW2buS.js +0 -1510
- package/lib/hook-CZjW2buS.js.map +0 -1
- package/lib/index-Bm35Tkgf.js +0 -107
- package/lib/index-Bm35Tkgf.js.map +0 -1
- package/lib/index-BzcS9JBW.js.map +0 -1
- package/lib/index-Sb7nQNHJ.js +0 -3980
- package/lib/index-Sb7nQNHJ.js.map +0 -1
- package/lib/index.esm-Cp4wkyud.js +0 -1236
- package/lib/index.esm-Cp4wkyud.js.map +0 -1
- package/lib/invariant-DAFpPywt.js.map +0 -1
- package/lib/useExposedProps-BIYjecPD.js +0 -9
- package/lib/useExposedProps-BIYjecPD.js.map +0 -1
|
@@ -1,50 +1,57 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { CircleSlashIcon as
|
|
3
|
-
import {
|
|
4
|
-
import { i as
|
|
5
|
-
import { O as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { D as
|
|
13
|
-
import {
|
|
14
|
-
import { c as
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
import { CircleSlashIcon as $, CheckIcon as te, XIcon as ue, PencilLineIcon as he, RefreshCwIcon as fe, EyeOffIcon as pe, EyeIcon as me, CopyIcon as xe, TrashIcon as ye, KeyRoundIcon as ge } from "lucide-react";
|
|
3
|
+
import { R as je } from "./RouterError-DcVonMP1.js";
|
|
4
|
+
import { i as A } from "./invariant-Bm-FVUQE.js";
|
|
5
|
+
import { O as Ce, aP as ve, L as we } from "./chunk-QMGIS6GS-DqecZ6nq.js";
|
|
6
|
+
import { a as be } from "./hook-bv3iuX7X.js";
|
|
7
|
+
import { D as ke, a as Y } from "./Slot-DOtTvoyj.js";
|
|
8
|
+
import { Button as y } from "./ui/Button.js";
|
|
9
|
+
import { d as se, g as ne, b as Ne } from "./ZudokuContext-BuJD7yIX.js";
|
|
10
|
+
import { u as z, A as O, a as M, b as Ee, S as Ke, c as De, d as Ie, e as Pe, f as Ae, g as Z } from "./Select-C3efYI1n.js";
|
|
11
|
+
import * as _ from "react";
|
|
12
|
+
import Re, { createContext as G, useRef as D, useLayoutEffect as Se, useEffect as ie, useId as J, useContext as U, useInsertionEffect as Te, useMemo as F, useCallback as ze, Children as Oe, isValidElement as Me, useState as K, forwardRef as qe } from "react";
|
|
13
|
+
import { C as $e, a as Fe } from "./Card-CMDQUPM4.js";
|
|
14
|
+
import { e as W, f as I, D as L, g as Q, a as B, b as H, c as V, d as re } from "./Dialog-BrIjMmUK.js";
|
|
15
|
+
import { Input as ae } from "./ui/Input.js";
|
|
16
|
+
import { c as N } from "./cn-dYga0KKN.js";
|
|
17
|
+
import { u as Le } from "./CodeBlock-yJjjRwj-.js";
|
|
18
|
+
import { a as Qe } from "./index.esm-CdzlRw50.js";
|
|
19
|
+
import { B as Be } from "./Button-B3o-2Xdf.js";
|
|
20
|
+
import { S as He } from "./Spinner-mNLZ6awP.js";
|
|
21
|
+
import { useAuth as Ve } from "./zudoku.hooks.js";
|
|
22
|
+
const _e = () => {
|
|
23
|
+
const t = be();
|
|
24
|
+
return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(Ce, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
|
|
19
25
|
"Please login first to view this page",
|
|
20
|
-
/* @__PURE__ */ e.jsx(
|
|
21
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(
|
|
26
|
+
/* @__PURE__ */ e.jsx(y, { onClick: () => t.login(), children: "Login" })
|
|
27
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(ke, { className: "max-w-[600px]", children: [
|
|
22
28
|
"Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
|
|
23
29
|
/* @__PURE__ */ e.jsx("code", { children: "authentication" }),
|
|
24
30
|
"."
|
|
25
31
|
] }) });
|
|
26
|
-
},
|
|
27
|
-
function
|
|
28
|
-
const i =
|
|
32
|
+
}, Ge = G({});
|
|
33
|
+
function oe(t) {
|
|
34
|
+
const i = D(null);
|
|
29
35
|
return i.current === null && (i.current = t()), i.current;
|
|
30
36
|
}
|
|
31
|
-
const
|
|
37
|
+
const Je = typeof window < "u", Ue = Je ? Se : ie, le = /* @__PURE__ */ G(null);
|
|
38
|
+
function We(t) {
|
|
39
|
+
return typeof t == "object" && t !== null;
|
|
40
|
+
}
|
|
41
|
+
function Xe(t) {
|
|
42
|
+
return We(t) && "offsetHeight" in t;
|
|
43
|
+
}
|
|
44
|
+
const Ye = G({
|
|
32
45
|
transformPagePoint: (t) => t,
|
|
33
46
|
isStatic: !1,
|
|
34
47
|
reducedMotion: "never"
|
|
35
48
|
});
|
|
36
|
-
|
|
37
|
-
return typeof t == "object" && t !== null;
|
|
38
|
-
}
|
|
39
|
-
function qe(t) {
|
|
40
|
-
return Se(t) && "offsetHeight" in t;
|
|
41
|
-
}
|
|
42
|
-
class Le extends F.Component {
|
|
49
|
+
class Ze extends _.Component {
|
|
43
50
|
getSnapshotBeforeUpdate(i) {
|
|
44
51
|
const s = this.props.childRef.current;
|
|
45
52
|
if (s && i.isPresent && !this.props.isPresent) {
|
|
46
|
-
const n = s.offsetParent,
|
|
47
|
-
|
|
53
|
+
const n = s.offsetParent, r = Xe(n) && n.offsetWidth || 0, a = this.props.sizeRef.current;
|
|
54
|
+
a.height = s.offsetHeight || 0, a.width = s.offsetWidth || 0, a.top = s.offsetTop, a.left = s.offsetLeft, a.right = r - a.width - a.left;
|
|
48
55
|
}
|
|
49
56
|
return null;
|
|
50
57
|
}
|
|
@@ -57,234 +64,345 @@ class Le extends F.Component {
|
|
|
57
64
|
return this.props.children;
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
|
-
function
|
|
61
|
-
const
|
|
67
|
+
function et({ children: t, isPresent: i, anchorX: s, root: n }) {
|
|
68
|
+
const r = J(), a = D(null), c = D({
|
|
62
69
|
width: 0,
|
|
63
70
|
height: 0,
|
|
64
71
|
top: 0,
|
|
65
72
|
left: 0,
|
|
66
73
|
right: 0
|
|
67
|
-
}), { nonce: f } =
|
|
68
|
-
return
|
|
69
|
-
const { width:
|
|
70
|
-
if (i || !
|
|
74
|
+
}), { nonce: f } = U(Ye);
|
|
75
|
+
return Te(() => {
|
|
76
|
+
const { width: h, height: d, top: g, left: u, right: p } = c.current;
|
|
77
|
+
if (i || !a.current || !h || !d)
|
|
71
78
|
return;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
const m = s === "left" ? `left: ${u}` : `right: ${p}`;
|
|
80
|
+
a.current.dataset.motionPopId = r;
|
|
81
|
+
const x = document.createElement("style");
|
|
82
|
+
f && (x.nonce = f);
|
|
83
|
+
const j = n ?? document.head;
|
|
84
|
+
return j.appendChild(x), x.sheet && x.sheet.insertRule(`
|
|
85
|
+
[data-motion-pop-id="${r}"] {
|
|
77
86
|
position: absolute !important;
|
|
78
|
-
width: ${
|
|
79
|
-
height: ${
|
|
80
|
-
${
|
|
81
|
-
top: ${
|
|
87
|
+
width: ${h}px !important;
|
|
88
|
+
height: ${d}px !important;
|
|
89
|
+
${m}px !important;
|
|
90
|
+
top: ${g}px !important;
|
|
82
91
|
}
|
|
83
92
|
`), () => {
|
|
84
|
-
|
|
93
|
+
j.removeChild(x), j.contains(x) && j.removeChild(x);
|
|
85
94
|
};
|
|
86
|
-
}, [i]), e.jsx(
|
|
95
|
+
}, [i]), e.jsx(Ze, { isPresent: i, childRef: a, sizeRef: c, children: _.cloneElement(t, { ref: a }) });
|
|
87
96
|
}
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
let
|
|
91
|
-
id:
|
|
97
|
+
const tt = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: a, mode: c, anchorX: f, root: h }) => {
|
|
98
|
+
const d = oe(st), g = J();
|
|
99
|
+
let u = !0, p = F(() => (u = !1, {
|
|
100
|
+
id: g,
|
|
92
101
|
initial: i,
|
|
93
102
|
isPresent: s,
|
|
94
|
-
custom:
|
|
95
|
-
onExitComplete: (
|
|
96
|
-
|
|
97
|
-
for (const
|
|
98
|
-
if (!
|
|
103
|
+
custom: r,
|
|
104
|
+
onExitComplete: (m) => {
|
|
105
|
+
d.set(m, !0);
|
|
106
|
+
for (const x of d.values())
|
|
107
|
+
if (!x)
|
|
99
108
|
return;
|
|
100
109
|
n && n();
|
|
101
110
|
},
|
|
102
|
-
register: (
|
|
103
|
-
}), [s,
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
}, [s]),
|
|
107
|
-
!s && !
|
|
108
|
-
}, [s]),
|
|
111
|
+
register: (m) => (d.set(m, !1), () => d.delete(m))
|
|
112
|
+
}), [s, d, n]);
|
|
113
|
+
return a && u && (p = { ...p }), F(() => {
|
|
114
|
+
d.forEach((m, x) => d.set(x, !1));
|
|
115
|
+
}, [s]), _.useEffect(() => {
|
|
116
|
+
!s && !d.size && n && n();
|
|
117
|
+
}, [s]), c === "popLayout" && (t = e.jsx(et, { isPresent: s, anchorX: f, root: h, children: t })), e.jsx(le.Provider, { value: p, children: t });
|
|
109
118
|
};
|
|
110
|
-
function
|
|
119
|
+
function st() {
|
|
111
120
|
return /* @__PURE__ */ new Map();
|
|
112
121
|
}
|
|
113
|
-
function
|
|
114
|
-
const i =
|
|
122
|
+
function nt(t = !0) {
|
|
123
|
+
const i = U(le);
|
|
115
124
|
if (i === null)
|
|
116
125
|
return [!0, null];
|
|
117
|
-
const { isPresent: s, onExitComplete: n, register:
|
|
118
|
-
|
|
126
|
+
const { isPresent: s, onExitComplete: n, register: r } = i, a = J();
|
|
127
|
+
ie(() => {
|
|
119
128
|
if (t)
|
|
120
|
-
return
|
|
129
|
+
return r(a);
|
|
121
130
|
}, [t]);
|
|
122
|
-
const
|
|
123
|
-
return !s && n ? [!1,
|
|
131
|
+
const c = ze(() => t && n && n(a), [a, n, t]);
|
|
132
|
+
return !s && n ? [!1, c] : [!0];
|
|
124
133
|
}
|
|
125
|
-
const
|
|
126
|
-
function
|
|
134
|
+
const R = (t) => t.key || "";
|
|
135
|
+
function ee(t) {
|
|
127
136
|
const i = [];
|
|
128
|
-
return
|
|
129
|
-
|
|
137
|
+
return Oe.forEach(t, (s) => {
|
|
138
|
+
Me(s) && i.push(s);
|
|
130
139
|
}), i;
|
|
131
140
|
}
|
|
132
|
-
const
|
|
133
|
-
const [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
for (let
|
|
137
|
-
const
|
|
138
|
-
|
|
141
|
+
const it = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: a = "sync", propagate: c = !1, anchorX: f = "left", root: h }) => {
|
|
142
|
+
const [d, g] = nt(c), u = F(() => ee(t), [t]), p = c && !d ? [] : u.map(R), m = D(!0), x = D(u), j = oe(() => /* @__PURE__ */ new Map()), [P, o] = K(u), [l, v] = K(u);
|
|
143
|
+
Ue(() => {
|
|
144
|
+
m.current = !1, x.current = u;
|
|
145
|
+
for (let w = 0; w < l.length; w++) {
|
|
146
|
+
const C = R(l[w]);
|
|
147
|
+
p.includes(C) ? j.delete(C) : j.get(C) !== !0 && j.set(C, !1);
|
|
139
148
|
}
|
|
140
|
-
}, [
|
|
141
|
-
const
|
|
142
|
-
if (
|
|
143
|
-
let
|
|
144
|
-
for (let
|
|
145
|
-
const
|
|
146
|
-
|
|
149
|
+
}, [l, p.length, p.join("-")]);
|
|
150
|
+
const b = [];
|
|
151
|
+
if (u !== P) {
|
|
152
|
+
let w = [...u];
|
|
153
|
+
for (let C = 0; C < l.length; C++) {
|
|
154
|
+
const E = l[C], q = R(E);
|
|
155
|
+
p.includes(q) || (w.splice(C, 0, E), b.push(E));
|
|
147
156
|
}
|
|
148
|
-
return
|
|
157
|
+
return a === "wait" && b.length && (w = b), v(ee(w)), o(u), null;
|
|
149
158
|
}
|
|
150
|
-
process.env.NODE_ENV !== "production" &&
|
|
151
|
-
const { forceRender:
|
|
152
|
-
return e.jsx(e.Fragment, { children:
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
|
|
159
|
+
process.env.NODE_ENV !== "production" && a === "wait" && l.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.`);
|
|
160
|
+
const { forceRender: k } = U(Ge);
|
|
161
|
+
return e.jsx(e.Fragment, { children: l.map((w) => {
|
|
162
|
+
const C = R(w), E = c && !d ? !1 : u === l || p.includes(C), q = () => {
|
|
163
|
+
if (j.has(C))
|
|
164
|
+
j.set(C, !0);
|
|
156
165
|
else
|
|
157
166
|
return;
|
|
158
|
-
let
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}),
|
|
167
|
+
let X = !0;
|
|
168
|
+
j.forEach((de) => {
|
|
169
|
+
de || (X = !1);
|
|
170
|
+
}), X && (k?.(), v(x.current), c && g?.(), n && n());
|
|
162
171
|
};
|
|
163
|
-
return e.jsx(
|
|
172
|
+
return e.jsx(tt, { isPresent: E, initial: !m.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: r, mode: a, root: h, onExitComplete: E ? void 0 : q, anchorX: f, children: w }, C);
|
|
164
173
|
}) });
|
|
165
|
-
},
|
|
166
|
-
|
|
174
|
+
}, ce = qe(
|
|
175
|
+
({ isPending: t, children: i, className: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
|
|
176
|
+
Be,
|
|
177
|
+
{
|
|
178
|
+
ref: r,
|
|
179
|
+
disabled: t,
|
|
180
|
+
...n,
|
|
181
|
+
className: N("relative", s),
|
|
182
|
+
children: [
|
|
183
|
+
t && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ e.jsx(He, {}) }),
|
|
184
|
+
/* @__PURE__ */ e.jsx("span", { className: N("block", t && "invisible"), children: i })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
);
|
|
189
|
+
ce.displayName = "ActionButton";
|
|
190
|
+
const rt = ({
|
|
191
|
+
service: t,
|
|
192
|
+
onOpenChange: i
|
|
193
|
+
}) => {
|
|
194
|
+
const s = se(), n = ne(), r = ve(), a = Qe({
|
|
195
|
+
defaultValues: {
|
|
196
|
+
expiresOn: "30"
|
|
197
|
+
}
|
|
198
|
+
}), c = Ve(), f = z({
|
|
199
|
+
mutationFn: ({ description: h, expiresOn: d }) => {
|
|
200
|
+
if (!t.createKey)
|
|
201
|
+
throw new Error("createKey not implemented");
|
|
202
|
+
const g = d !== "never" ? at(Number(d)) : void 0;
|
|
203
|
+
return t.createKey({
|
|
204
|
+
apiKey: {
|
|
205
|
+
description: h || "Secret Key",
|
|
206
|
+
expiresOn: g
|
|
207
|
+
},
|
|
208
|
+
context: s,
|
|
209
|
+
auth: c
|
|
210
|
+
});
|
|
211
|
+
},
|
|
212
|
+
onSuccess: async () => {
|
|
213
|
+
await n.invalidateQueries({ queryKey: ["api-keys"] }), await r("/settings/api-keys/");
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
return t.createKey ? /* @__PURE__ */ e.jsxs(
|
|
217
|
+
"form",
|
|
218
|
+
{
|
|
219
|
+
onSubmit: a.handleSubmit(
|
|
220
|
+
(h) => f.mutate(
|
|
221
|
+
{ ...h },
|
|
222
|
+
{
|
|
223
|
+
onSuccess: () => i(!1)
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
),
|
|
227
|
+
children: [
|
|
228
|
+
f.error && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
|
|
229
|
+
/* @__PURE__ */ e.jsx(M, { children: "Error" }),
|
|
230
|
+
/* @__PURE__ */ e.jsx(Ee, { children: f.error.message })
|
|
231
|
+
] }),
|
|
232
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
|
|
233
|
+
"Name",
|
|
234
|
+
/* @__PURE__ */ e.jsx(ae, { ...a.register("description") }),
|
|
235
|
+
"Expiration",
|
|
236
|
+
/* @__PURE__ */ e.jsxs(
|
|
237
|
+
Ke,
|
|
238
|
+
{
|
|
239
|
+
onValueChange: (h) => a.setValue("expiresOn", h),
|
|
240
|
+
defaultValue: a.getValues("expiresOn"),
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx(Ie, {}) }),
|
|
243
|
+
/* @__PURE__ */ e.jsx(Pe, { children: /* @__PURE__ */ e.jsxs(Ae, { children: [
|
|
244
|
+
[7, 30, 60, 90].map((h) => /* @__PURE__ */ e.jsxs(Z, { value: String(h), children: [
|
|
245
|
+
h,
|
|
246
|
+
" days"
|
|
247
|
+
] }, h)),
|
|
248
|
+
/* @__PURE__ */ e.jsx(Z, { value: "never", children: "Never" })
|
|
249
|
+
] }) })
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ e.jsxs(W, { children: [
|
|
254
|
+
/* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
|
|
255
|
+
/* @__PURE__ */ e.jsx(ce, { isPending: f.isPending, children: "Generate Key" })
|
|
256
|
+
] })
|
|
257
|
+
] })
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
) : null;
|
|
261
|
+
}, at = (t) => {
|
|
262
|
+
const i = /* @__PURE__ */ new Date();
|
|
263
|
+
return i.setDate(i.getDate() + t), i.toISOString();
|
|
264
|
+
}, ot = ({ service: t }) => {
|
|
265
|
+
const i = se(), s = ne(), [n, r] = K(
|
|
167
266
|
null
|
|
168
|
-
), [
|
|
267
|
+
), [a, c] = K(""), { data: f, isFetching: h } = Ne({
|
|
169
268
|
queryFn: () => t.getConsumers(i),
|
|
170
269
|
queryKey: ["api-keys"],
|
|
171
270
|
retry: !1
|
|
172
|
-
}),
|
|
271
|
+
}), [d, g] = K(!1), u = z({
|
|
173
272
|
mutationFn: ({
|
|
174
|
-
consumerId:
|
|
175
|
-
keyId:
|
|
273
|
+
consumerId: o,
|
|
274
|
+
keyId: l
|
|
176
275
|
}) => {
|
|
177
276
|
if (!t.deleteKey)
|
|
178
277
|
throw new Error("deleteKey not implemented");
|
|
179
|
-
return t.deleteKey(
|
|
278
|
+
return t.deleteKey(o, l, i);
|
|
180
279
|
},
|
|
181
|
-
onMutate: async ({ consumerId:
|
|
280
|
+
onMutate: async ({ consumerId: o, keyId: l }) => {
|
|
182
281
|
await s.cancelQueries({ queryKey: ["api-keys"] });
|
|
183
|
-
const
|
|
282
|
+
const v = s.getQueryData([
|
|
184
283
|
"api-keys"
|
|
185
284
|
]);
|
|
186
|
-
return s.setQueryData(["api-keys"], (
|
|
187
|
-
...
|
|
188
|
-
apiKeys:
|
|
189
|
-
} :
|
|
285
|
+
return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
|
|
286
|
+
...k,
|
|
287
|
+
apiKeys: k.apiKeys.filter((w) => w.id !== l)
|
|
288
|
+
} : k)), { previousData: v };
|
|
190
289
|
},
|
|
191
|
-
onError: (
|
|
192
|
-
|
|
290
|
+
onError: (o, l, v) => {
|
|
291
|
+
v?.previousData && s.setQueryData(["api-keys"], v.previousData);
|
|
193
292
|
},
|
|
194
293
|
onSuccess: () => {
|
|
195
294
|
s.invalidateQueries({ queryKey: ["api-keys"] });
|
|
196
295
|
}
|
|
197
|
-
}),
|
|
296
|
+
}), p = z({
|
|
198
297
|
mutationFn: ({
|
|
199
|
-
consumerId:
|
|
200
|
-
label:
|
|
298
|
+
consumerId: o,
|
|
299
|
+
label: l
|
|
201
300
|
}) => {
|
|
202
301
|
if (!t.updateConsumer)
|
|
203
302
|
throw new Error("updateConsumer not implemented");
|
|
204
|
-
return t.updateConsumer({ id:
|
|
303
|
+
return t.updateConsumer({ id: o, label: l }, i);
|
|
205
304
|
},
|
|
206
|
-
onMutate: async ({ consumerId:
|
|
305
|
+
onMutate: async ({ consumerId: o, label: l }) => {
|
|
207
306
|
await s.cancelQueries({ queryKey: ["api-keys"] });
|
|
208
|
-
const
|
|
209
|
-
return s.setQueryData(["api-keys"], (
|
|
210
|
-
...
|
|
211
|
-
label:
|
|
212
|
-
} :
|
|
307
|
+
const v = s.getQueryData(["api-keys"]);
|
|
308
|
+
return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
|
|
309
|
+
...k,
|
|
310
|
+
label: l
|
|
311
|
+
} : k)), { previousData: v };
|
|
213
312
|
},
|
|
214
|
-
onError: (
|
|
215
|
-
|
|
313
|
+
onError: (o, l, v) => {
|
|
314
|
+
v?.previousData && s.setQueryData(["api-keys"], v.previousData);
|
|
216
315
|
},
|
|
217
316
|
onSuccess: () => {
|
|
218
317
|
s.invalidateQueries({ queryKey: ["api-keys"] });
|
|
219
318
|
}
|
|
220
|
-
}),
|
|
221
|
-
mutationFn: (
|
|
319
|
+
}), m = z({
|
|
320
|
+
mutationFn: (o) => {
|
|
222
321
|
if (!t.rollKey)
|
|
223
322
|
throw new Error("rollKey not implemented");
|
|
224
|
-
return t.rollKey(
|
|
323
|
+
return t.rollKey(o, i);
|
|
225
324
|
},
|
|
226
325
|
onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
|
|
227
|
-
}),
|
|
228
|
-
o
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
consumerId:
|
|
232
|
-
label:
|
|
233
|
-
}),
|
|
234
|
-
},
|
|
235
|
-
|
|
326
|
+
}), x = (o, l) => {
|
|
327
|
+
r(o), c(l);
|
|
328
|
+
}, j = (o) => {
|
|
329
|
+
a.trim() && p.mutate({
|
|
330
|
+
consumerId: o,
|
|
331
|
+
label: a.trim()
|
|
332
|
+
}), r(null), c("");
|
|
333
|
+
}, P = () => {
|
|
334
|
+
r(null), c("");
|
|
236
335
|
};
|
|
237
336
|
return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-md h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
|
|
238
|
-
/* @__PURE__ */ e.jsx(
|
|
337
|
+
/* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page" }),
|
|
239
338
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
|
|
240
339
|
/* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
|
|
241
|
-
t.createKey && /* @__PURE__ */ e.
|
|
340
|
+
t.createKey && /* @__PURE__ */ e.jsxs(
|
|
341
|
+
L,
|
|
342
|
+
{
|
|
343
|
+
open: d,
|
|
344
|
+
onOpenChange: g,
|
|
345
|
+
children: [
|
|
346
|
+
/* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Create API Key" }) }),
|
|
347
|
+
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
348
|
+
/* @__PURE__ */ e.jsx(H, { children: /* @__PURE__ */ e.jsx(V, { children: "Create API Key" }) }),
|
|
349
|
+
/* @__PURE__ */ e.jsx(
|
|
350
|
+
rt,
|
|
351
|
+
{
|
|
352
|
+
service: t,
|
|
353
|
+
onOpenChange: g
|
|
354
|
+
}
|
|
355
|
+
)
|
|
356
|
+
] })
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
)
|
|
242
360
|
] }),
|
|
243
361
|
/* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
|
|
244
|
-
/* @__PURE__ */ e.jsx(
|
|
362
|
+
/* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page-before-keys" }),
|
|
245
363
|
/* @__PURE__ */ e.jsx("div", { className: "h-8" }),
|
|
246
|
-
|
|
247
|
-
/* @__PURE__ */ e.jsx(
|
|
248
|
-
/* @__PURE__ */ e.jsx(
|
|
364
|
+
m.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
|
|
365
|
+
/* @__PURE__ */ e.jsx($, { size: 16 }),
|
|
366
|
+
/* @__PURE__ */ e.jsx(M, { children: m.error.message })
|
|
249
367
|
] }),
|
|
250
|
-
|
|
251
|
-
/* @__PURE__ */ e.jsx(
|
|
252
|
-
/* @__PURE__ */ e.jsx(
|
|
368
|
+
p.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
|
|
369
|
+
/* @__PURE__ */ e.jsx($, { size: 16 }),
|
|
370
|
+
/* @__PURE__ */ e.jsx(M, { children: p.error.message })
|
|
253
371
|
] }),
|
|
254
|
-
|
|
255
|
-
/* @__PURE__ */ e.jsx(
|
|
256
|
-
/* @__PURE__ */ e.jsx(
|
|
372
|
+
u.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
|
|
373
|
+
/* @__PURE__ */ e.jsx($, { size: 16 }),
|
|
374
|
+
/* @__PURE__ */ e.jsx(M, { children: u.error.message })
|
|
257
375
|
] }),
|
|
258
|
-
/* @__PURE__ */ e.jsx("div", { className: "", children:
|
|
376
|
+
/* @__PURE__ */ e.jsx("div", { className: "", children: f.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: [
|
|
259
377
|
/* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
|
|
260
378
|
"You have no API keys yet.",
|
|
261
379
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
262
380
|
t.createKey && "Get started and create your first key."
|
|
263
381
|
] }),
|
|
264
|
-
t.createKey && /* @__PURE__ */ e.jsx(
|
|
382
|
+
t.createKey && /* @__PURE__ */ e.jsx(y, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx(we, { to: "/settings/api-keys/new", children: "Create API Key" }) })
|
|
265
383
|
] }) : /* @__PURE__ */ e.jsx(
|
|
266
384
|
"ul",
|
|
267
385
|
{
|
|
268
|
-
className:
|
|
386
|
+
className: N(
|
|
269
387
|
"grid grid-cols-[1fr_min-content] divide-y divide-border col-span-6"
|
|
270
388
|
),
|
|
271
|
-
children:
|
|
272
|
-
|
|
389
|
+
children: f.map((o) => /* @__PURE__ */ e.jsxs(
|
|
390
|
+
$e,
|
|
273
391
|
{
|
|
274
392
|
className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
|
|
275
393
|
children: [
|
|
276
|
-
/* @__PURE__ */ e.jsxs(
|
|
394
|
+
/* @__PURE__ */ e.jsxs(Fe, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
|
|
277
395
|
/* @__PURE__ */ e.jsxs("div", { className: "h-10 flex flex-col text-sm justify-center", children: [
|
|
278
396
|
/* @__PURE__ */ e.jsxs("div", { className: "font-medium text-lg flex items-center gap-2", children: [
|
|
279
|
-
n ===
|
|
397
|
+
n === o.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
|
|
280
398
|
/* @__PURE__ */ e.jsx(
|
|
281
|
-
|
|
399
|
+
ae,
|
|
282
400
|
{
|
|
283
401
|
maxLength: 32,
|
|
284
|
-
value:
|
|
285
|
-
onChange: (
|
|
286
|
-
onKeyDown: (
|
|
287
|
-
|
|
402
|
+
value: a,
|
|
403
|
+
onChange: (l) => c(l.target.value),
|
|
404
|
+
onKeyDown: (l) => {
|
|
405
|
+
l.key === "Enter" ? j(o.id) : l.key === "Escape" && P();
|
|
288
406
|
},
|
|
289
407
|
className: "text-lg font-medium",
|
|
290
408
|
autoFocus: !0
|
|
@@ -292,90 +410,90 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
292
410
|
),
|
|
293
411
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
294
412
|
/* @__PURE__ */ e.jsx(
|
|
295
|
-
|
|
413
|
+
y,
|
|
296
414
|
{
|
|
297
415
|
size: "icon",
|
|
298
416
|
variant: "ghost",
|
|
299
|
-
onClick: () =>
|
|
300
|
-
disabled: !
|
|
301
|
-
children: /* @__PURE__ */ e.jsx(
|
|
417
|
+
onClick: () => j(o.id),
|
|
418
|
+
disabled: !a.trim(),
|
|
419
|
+
children: /* @__PURE__ */ e.jsx(te, { size: 16 })
|
|
302
420
|
}
|
|
303
421
|
),
|
|
304
422
|
/* @__PURE__ */ e.jsx(
|
|
305
|
-
|
|
423
|
+
y,
|
|
306
424
|
{
|
|
307
425
|
size: "icon",
|
|
308
426
|
variant: "ghost",
|
|
309
|
-
onClick:
|
|
310
|
-
children: /* @__PURE__ */ e.jsx(
|
|
427
|
+
onClick: P,
|
|
428
|
+
children: /* @__PURE__ */ e.jsx(ue, { size: 16 })
|
|
311
429
|
}
|
|
312
430
|
)
|
|
313
431
|
] })
|
|
314
|
-
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children:
|
|
315
|
-
/* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children:
|
|
432
|
+
] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: o.label }),
|
|
433
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: o.createdOn })
|
|
316
434
|
] }),
|
|
317
435
|
/* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
|
|
318
|
-
|
|
436
|
+
o.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
319
437
|
"Created on",
|
|
320
438
|
" ",
|
|
321
|
-
new Date(
|
|
439
|
+
new Date(o.createdOn).toLocaleDateString()
|
|
322
440
|
] }),
|
|
323
|
-
|
|
441
|
+
o.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
324
442
|
"Expires on",
|
|
325
443
|
" ",
|
|
326
|
-
new Date(
|
|
444
|
+
new Date(o.expiresOn).toLocaleDateString()
|
|
327
445
|
] })
|
|
328
446
|
] })
|
|
329
447
|
] }),
|
|
330
448
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
|
|
331
449
|
t.updateConsumer && /* @__PURE__ */ e.jsxs(
|
|
332
|
-
|
|
450
|
+
y,
|
|
333
451
|
{
|
|
334
452
|
variant: "ghost",
|
|
335
|
-
onClick: () =>
|
|
336
|
-
className:
|
|
453
|
+
onClick: () => x(o.id, o.label),
|
|
454
|
+
className: N(
|
|
337
455
|
"flex gap-2",
|
|
338
|
-
n ===
|
|
456
|
+
n === o.id && "opacity-0! pointer-events-none"
|
|
339
457
|
),
|
|
340
|
-
disabled: n ===
|
|
458
|
+
disabled: n === o.id,
|
|
341
459
|
children: [
|
|
342
|
-
/* @__PURE__ */ e.jsx(
|
|
460
|
+
/* @__PURE__ */ e.jsx(he, { size: 16 }),
|
|
343
461
|
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
|
|
344
462
|
]
|
|
345
463
|
}
|
|
346
464
|
),
|
|
347
|
-
t.rollKey && /* @__PURE__ */ e.jsxs(
|
|
348
|
-
/* @__PURE__ */ e.jsx(
|
|
349
|
-
|
|
465
|
+
t.rollKey && /* @__PURE__ */ e.jsxs(L, { children: [
|
|
466
|
+
/* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
467
|
+
y,
|
|
350
468
|
{
|
|
351
469
|
title: "Roll this key",
|
|
352
470
|
variant: "ghost",
|
|
353
|
-
disabled:
|
|
471
|
+
disabled: m.isPending,
|
|
354
472
|
className: "flex items-center gap-2",
|
|
355
473
|
children: [
|
|
356
474
|
/* @__PURE__ */ e.jsx(
|
|
357
|
-
|
|
475
|
+
fe,
|
|
358
476
|
{
|
|
359
477
|
size: 16,
|
|
360
|
-
className:
|
|
478
|
+
className: m.isPending ? "animate-spin" : void 0
|
|
361
479
|
}
|
|
362
480
|
),
|
|
363
481
|
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
|
|
364
482
|
]
|
|
365
483
|
}
|
|
366
484
|
) }),
|
|
367
|
-
/* @__PURE__ */ e.jsxs(
|
|
368
|
-
/* @__PURE__ */ e.jsxs(
|
|
369
|
-
/* @__PURE__ */ e.jsx(
|
|
370
|
-
/* @__PURE__ */ e.jsx(
|
|
485
|
+
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
486
|
+
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
487
|
+
/* @__PURE__ */ e.jsx(V, { children: "Roll API Key" }),
|
|
488
|
+
/* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to roll this API key?" })
|
|
371
489
|
] }),
|
|
372
|
-
/* @__PURE__ */ e.jsxs(
|
|
373
|
-
/* @__PURE__ */ e.jsx(
|
|
374
|
-
/* @__PURE__ */ e.jsx(
|
|
375
|
-
|
|
490
|
+
/* @__PURE__ */ e.jsxs(W, { children: [
|
|
491
|
+
/* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
|
|
492
|
+
/* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
493
|
+
y,
|
|
376
494
|
{
|
|
377
495
|
onClick: () => {
|
|
378
|
-
|
|
496
|
+
m.mutate(o.id);
|
|
379
497
|
},
|
|
380
498
|
children: "Roll Key"
|
|
381
499
|
}
|
|
@@ -385,50 +503,50 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
385
503
|
] })
|
|
386
504
|
] })
|
|
387
505
|
] }),
|
|
388
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(
|
|
506
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(it, { children: o.apiKeys.map((l) => /* @__PURE__ */ e.jsxs(Re.Fragment, { children: [
|
|
389
507
|
/* @__PURE__ */ e.jsx(
|
|
390
|
-
|
|
508
|
+
ct,
|
|
391
509
|
{
|
|
392
|
-
apiKey:
|
|
510
|
+
apiKey: l,
|
|
393
511
|
onDeleteKey: () => {
|
|
394
|
-
|
|
395
|
-
consumerId:
|
|
396
|
-
keyId:
|
|
512
|
+
u.mutate({
|
|
513
|
+
consumerId: o.id,
|
|
514
|
+
keyId: l.id
|
|
397
515
|
});
|
|
398
516
|
},
|
|
399
|
-
className:
|
|
517
|
+
className: u.variables?.keyId === l.id && (u.isPending || h) ? "opacity-10!" : void 0
|
|
400
518
|
}
|
|
401
519
|
),
|
|
402
520
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
|
|
403
|
-
] },
|
|
521
|
+
] }, l.id)) }) })
|
|
404
522
|
]
|
|
405
523
|
},
|
|
406
|
-
|
|
524
|
+
o.id
|
|
407
525
|
))
|
|
408
526
|
}
|
|
409
527
|
) })
|
|
410
528
|
] });
|
|
411
|
-
},
|
|
412
|
-
const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3),
|
|
413
|
-
return n < 60 ?
|
|
414
|
-
},
|
|
529
|
+
}, lt = (t) => {
|
|
530
|
+
const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), r = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
531
|
+
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");
|
|
532
|
+
}, ct = ({
|
|
415
533
|
apiKey: t,
|
|
416
534
|
onDeleteKey: i,
|
|
417
535
|
className: s
|
|
418
536
|
}) => {
|
|
419
|
-
const [n,
|
|
420
|
-
(new Date(
|
|
421
|
-
) : 1 / 0,
|
|
422
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
537
|
+
const [n, r] = K(!1), [a, c] = Le(), { key: f, createdOn: h, expiresOn: d } = t, g = d && new Date(d) < /* @__PURE__ */ new Date(), u = d ? Math.ceil(
|
|
538
|
+
(new Date(d).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
|
|
539
|
+
) : 1 / 0, p = u <= 7 && !g;
|
|
540
|
+
return /* @__PURE__ */ e.jsxs("div", { className: N("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
423
541
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
424
542
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-full max-w-fit px-1", children: [
|
|
425
543
|
/* @__PURE__ */ e.jsxs("div", { className: "font-mono w-full h-9 items-center flex px-2 text-xs gap-2", children: [
|
|
426
544
|
/* @__PURE__ */ e.jsx(
|
|
427
545
|
"div",
|
|
428
546
|
{
|
|
429
|
-
className:
|
|
547
|
+
className: N(
|
|
430
548
|
"rounded-full w-2 h-2 bg-emerald-400 mr-2",
|
|
431
|
-
(
|
|
549
|
+
(p || g) && "bg-neutral-200"
|
|
432
550
|
)
|
|
433
551
|
}
|
|
434
552
|
),
|
|
@@ -436,67 +554,67 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
436
554
|
/* @__PURE__ */ e.jsx(
|
|
437
555
|
"div",
|
|
438
556
|
{
|
|
439
|
-
className:
|
|
557
|
+
className: N(
|
|
440
558
|
"w-40 inline-block md:w-full truncate",
|
|
441
559
|
n ? "" : "opacity-20"
|
|
442
560
|
),
|
|
443
|
-
children: n ?
|
|
561
|
+
children: n ? f.slice(0, -5) : "**** ".repeat(f.slice(0, -5).length / 5) + "*".repeat(f.slice(0, -5).length % 5)
|
|
444
562
|
}
|
|
445
563
|
),
|
|
446
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
564
|
+
/* @__PURE__ */ e.jsx("span", { children: f.slice(-5) })
|
|
447
565
|
] })
|
|
448
566
|
] }),
|
|
449
567
|
/* @__PURE__ */ e.jsx(
|
|
450
|
-
|
|
568
|
+
y,
|
|
451
569
|
{
|
|
452
570
|
variant: "ghost",
|
|
453
|
-
onClick: () =>
|
|
571
|
+
onClick: () => r((m) => !m),
|
|
454
572
|
size: "icon",
|
|
455
|
-
children: n ? /* @__PURE__ */ e.jsx(
|
|
573
|
+
children: n ? /* @__PURE__ */ e.jsx(pe, { size: 16 }) : /* @__PURE__ */ e.jsx(me, { size: 16 })
|
|
456
574
|
}
|
|
457
575
|
),
|
|
458
576
|
/* @__PURE__ */ e.jsx(
|
|
459
|
-
|
|
577
|
+
y,
|
|
460
578
|
{
|
|
461
579
|
variant: "ghost",
|
|
462
|
-
onClick: () => f
|
|
580
|
+
onClick: () => c(f),
|
|
463
581
|
size: "icon",
|
|
464
|
-
children:
|
|
582
|
+
children: a ? /* @__PURE__ */ e.jsx(te, { size: 16 }) : /* @__PURE__ */ e.jsx(xe, { size: 16 })
|
|
465
583
|
}
|
|
466
584
|
)
|
|
467
585
|
] }),
|
|
468
586
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
|
|
469
|
-
|
|
587
|
+
h && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
470
588
|
"Created ",
|
|
471
|
-
|
|
589
|
+
lt(h),
|
|
472
590
|
"."
|
|
473
591
|
] }),
|
|
474
592
|
" ",
|
|
475
|
-
|
|
593
|
+
d && p && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
476
594
|
"Expires in ",
|
|
477
|
-
|
|
595
|
+
u,
|
|
478
596
|
" ",
|
|
479
|
-
|
|
597
|
+
u === 1 ? "day" : "days",
|
|
480
598
|
"."
|
|
481
599
|
] }),
|
|
482
|
-
|
|
600
|
+
d && g && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
483
601
|
"Expired",
|
|
484
602
|
" ",
|
|
485
|
-
|
|
603
|
+
u === 0 ? "today." : `${u * -1} days ago.`
|
|
486
604
|
] })
|
|
487
605
|
] })
|
|
488
606
|
] }),
|
|
489
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children:
|
|
490
|
-
/* @__PURE__ */ e.jsx(
|
|
491
|
-
/* @__PURE__ */ e.jsxs(
|
|
492
|
-
/* @__PURE__ */ e.jsxs(
|
|
493
|
-
/* @__PURE__ */ e.jsx(
|
|
494
|
-
/* @__PURE__ */ e.jsx(
|
|
607
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && i && /* @__PURE__ */ e.jsxs(L, { children: [
|
|
608
|
+
/* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(ye, { size: 16 }) }) }),
|
|
609
|
+
/* @__PURE__ */ e.jsxs(B, { children: [
|
|
610
|
+
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
611
|
+
/* @__PURE__ */ e.jsx(V, { children: "Delete API Key" }),
|
|
612
|
+
/* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to delete this API key?" })
|
|
495
613
|
] }),
|
|
496
|
-
/* @__PURE__ */ e.jsxs(
|
|
497
|
-
/* @__PURE__ */ e.jsx(
|
|
498
|
-
/* @__PURE__ */ e.jsx(
|
|
499
|
-
|
|
614
|
+
/* @__PURE__ */ e.jsxs(W, { children: [
|
|
615
|
+
/* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
|
|
616
|
+
/* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
617
|
+
y,
|
|
500
618
|
{
|
|
501
619
|
onClick: () => {
|
|
502
620
|
i();
|
|
@@ -508,55 +626,55 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
508
626
|
] })
|
|
509
627
|
] }) })
|
|
510
628
|
] });
|
|
511
|
-
},
|
|
629
|
+
}, S = "https://api.zuploedge.com/v2/client", dt = async (t) => {
|
|
512
630
|
try {
|
|
513
631
|
return await t.json();
|
|
514
632
|
} catch {
|
|
515
633
|
return;
|
|
516
634
|
}
|
|
517
|
-
},
|
|
635
|
+
}, T = async (t) => {
|
|
518
636
|
const i = t.headers.get("content-type");
|
|
519
637
|
if (!t.ok && i?.includes("application/problem+json")) {
|
|
520
|
-
const s = await
|
|
638
|
+
const s = await dt(t);
|
|
521
639
|
if (s.type && s.title)
|
|
522
640
|
throw new Error(s.detail ?? s.title);
|
|
523
641
|
}
|
|
524
|
-
},
|
|
525
|
-
deleteKey: async (
|
|
526
|
-
const
|
|
527
|
-
|
|
642
|
+
}, ut = (t, i) => ({
|
|
643
|
+
deleteKey: async (s, n, r) => {
|
|
644
|
+
const a = new Request(
|
|
645
|
+
S + `/${t}/consumers/${s}/keys/${n}`,
|
|
528
646
|
{
|
|
529
647
|
method: "DELETE"
|
|
530
648
|
}
|
|
531
649
|
);
|
|
532
|
-
await
|
|
533
|
-
const
|
|
534
|
-
await
|
|
650
|
+
await r.signRequest(a);
|
|
651
|
+
const c = await fetch(a);
|
|
652
|
+
await T(c), A(c.ok, "Failed to delete API key");
|
|
535
653
|
},
|
|
536
|
-
updateConsumer: async (
|
|
537
|
-
const
|
|
538
|
-
await
|
|
654
|
+
updateConsumer: async (s, n) => {
|
|
655
|
+
const r = await fetch(
|
|
656
|
+
await n.signRequest(
|
|
539
657
|
new Request(
|
|
540
|
-
|
|
658
|
+
S + `/${t}/consumers/${s.id}`,
|
|
541
659
|
{
|
|
542
660
|
method: "PATCH",
|
|
543
661
|
headers: {
|
|
544
662
|
"Content-Type": "application/json"
|
|
545
663
|
},
|
|
546
664
|
body: JSON.stringify({
|
|
547
|
-
label:
|
|
665
|
+
label: s.label
|
|
548
666
|
})
|
|
549
667
|
}
|
|
550
668
|
)
|
|
551
669
|
)
|
|
552
670
|
);
|
|
553
|
-
await
|
|
671
|
+
await T(r), A(r.ok, "Failed to update API key description");
|
|
554
672
|
},
|
|
555
|
-
rollKey: async (
|
|
556
|
-
const
|
|
557
|
-
await
|
|
673
|
+
rollKey: async (s, n) => {
|
|
674
|
+
const r = await fetch(
|
|
675
|
+
await n.signRequest(
|
|
558
676
|
new Request(
|
|
559
|
-
|
|
677
|
+
S + `/${t}/consumers/${s}/roll-key`,
|
|
560
678
|
{
|
|
561
679
|
method: "POST",
|
|
562
680
|
headers: {
|
|
@@ -567,41 +685,42 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
567
685
|
)
|
|
568
686
|
)
|
|
569
687
|
);
|
|
570
|
-
await
|
|
688
|
+
await T(r), A(r.ok, "Failed to delete API key");
|
|
571
689
|
},
|
|
572
|
-
getConsumers: async (
|
|
573
|
-
const
|
|
574
|
-
|
|
690
|
+
getConsumers: async (s) => {
|
|
691
|
+
const n = new Request(
|
|
692
|
+
S + `/${t}/consumers`
|
|
575
693
|
);
|
|
576
|
-
await
|
|
577
|
-
const
|
|
578
|
-
return await
|
|
579
|
-
id:
|
|
580
|
-
label:
|
|
581
|
-
apiKeys:
|
|
582
|
-
key:
|
|
694
|
+
await s.signRequest(n);
|
|
695
|
+
const r = await fetch(n);
|
|
696
|
+
return await T(r), A(r.ok, "Failed to fetch API keys"), (await r.json()).data.map((c) => ({
|
|
697
|
+
id: c.id,
|
|
698
|
+
label: c.label || c.subject || "API Key",
|
|
699
|
+
apiKeys: c.apiKeys.data,
|
|
700
|
+
key: c.apiKeys.data.at(0)
|
|
583
701
|
}));
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
|
|
702
|
+
},
|
|
703
|
+
...i
|
|
704
|
+
}), Rt = (t) => t, St = (t) => {
|
|
705
|
+
const i = "deploymentName" in t ? ut(t.deploymentName, t) : t;
|
|
587
706
|
return {
|
|
588
707
|
getProfileMenuItems: () => [
|
|
589
708
|
{
|
|
590
709
|
label: "API Keys",
|
|
591
710
|
path: "/settings/api-keys",
|
|
592
711
|
category: "middle",
|
|
593
|
-
icon:
|
|
712
|
+
icon: ge
|
|
594
713
|
}
|
|
595
714
|
],
|
|
596
715
|
getIdentities: async (s) => {
|
|
597
716
|
try {
|
|
598
|
-
return (await i.getConsumers(s)).map((
|
|
599
|
-
authorizeRequest: (
|
|
717
|
+
return (await i.getConsumers(s)).map((r) => ({
|
|
718
|
+
authorizeRequest: (a) => (a.headers.set(
|
|
600
719
|
"Authorization",
|
|
601
|
-
`Bearer ${
|
|
602
|
-
),
|
|
603
|
-
id:
|
|
604
|
-
label:
|
|
720
|
+
`Bearer ${r.apiKeys.at(0)?.key}`
|
|
721
|
+
), a),
|
|
722
|
+
id: r.id,
|
|
723
|
+
label: r.label
|
|
605
724
|
}));
|
|
606
725
|
} catch {
|
|
607
726
|
return [];
|
|
@@ -609,24 +728,20 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
609
728
|
},
|
|
610
729
|
getRoutes: () => [
|
|
611
730
|
{
|
|
612
|
-
element: /* @__PURE__ */ e.jsx(
|
|
613
|
-
errorElement: /* @__PURE__ */ e.jsx(
|
|
731
|
+
element: /* @__PURE__ */ e.jsx(_e, {}),
|
|
732
|
+
errorElement: /* @__PURE__ */ e.jsx(je, {}),
|
|
614
733
|
children: [
|
|
615
734
|
{
|
|
616
735
|
path: "/settings/api-keys",
|
|
617
|
-
element: /* @__PURE__ */ e.jsx(
|
|
736
|
+
element: /* @__PURE__ */ e.jsx(ot, { service: i })
|
|
618
737
|
}
|
|
619
|
-
// {
|
|
620
|
-
// path: "/settings/api-keys/new",
|
|
621
|
-
// element: <CreateApiKey service={service} />,
|
|
622
|
-
// },
|
|
623
738
|
]
|
|
624
739
|
}
|
|
625
740
|
]
|
|
626
741
|
};
|
|
627
742
|
};
|
|
628
743
|
export {
|
|
629
|
-
|
|
630
|
-
|
|
744
|
+
St as apiKeyPlugin,
|
|
745
|
+
Rt as createApiKeyService
|
|
631
746
|
};
|
|
632
747
|
//# sourceMappingURL=zudoku.plugin-api-keys.js.map
|