zudoku 0.61.5 → 0.63.0
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/README.md +1 -1
- package/dist/cli/cli.d.ts +9 -0
- package/dist/cli/cli.js +4 -10
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/version-check.d.ts +2 -0
- package/dist/cli/common/version-check.js +58 -0
- package/dist/cli/common/version-check.js.map +1 -0
- package/dist/config/config.d.ts +3 -0
- package/dist/config/validators/InputNavigationSchema.d.ts +64 -4
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/icon-types.js +15 -0
- package/dist/config/validators/icon-types.js.map +1 -1
- package/dist/config/validators/validate.d.ts +39 -9
- package/dist/config/validators/validate.js +23 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +22 -2
- package/dist/lib/assets/language-icons/c.d.ts +3 -0
- package/dist/lib/assets/language-icons/c.js +4 -0
- package/dist/lib/assets/language-icons/c.js.map +1 -0
- package/dist/lib/assets/language-icons/commonlisp.d.ts +3 -0
- package/dist/lib/assets/language-icons/commonlisp.js +4 -0
- package/dist/lib/assets/language-icons/commonlisp.js.map +1 -0
- package/dist/lib/assets/language-icons/cpp.d.ts +3 -0
- package/dist/lib/assets/language-icons/cpp.js +4 -0
- package/dist/lib/assets/language-icons/cpp.js.map +1 -0
- package/dist/lib/assets/language-icons/dart.d.ts +3 -0
- package/dist/lib/assets/language-icons/dart.js +4 -0
- package/dist/lib/assets/language-icons/dart.js.map +1 -0
- package/dist/lib/assets/language-icons/elixir.d.ts +3 -0
- package/dist/lib/assets/language-icons/elixir.js +4 -0
- package/dist/lib/assets/language-icons/elixir.js.map +1 -0
- package/dist/lib/assets/language-icons/ocaml.d.ts +3 -0
- package/dist/lib/assets/language-icons/ocaml.js +4 -0
- package/dist/lib/assets/language-icons/ocaml.js.map +1 -0
- package/dist/lib/assets/language-icons/powershell.d.ts +3 -0
- package/dist/lib/assets/language-icons/powershell.js +4 -0
- package/dist/lib/assets/language-icons/powershell.js.map +1 -0
- package/dist/lib/assets/language-icons/scala.d.ts +3 -0
- package/dist/lib/assets/language-icons/scala.js +4 -0
- package/dist/lib/assets/language-icons/scala.js.map +1 -0
- package/dist/lib/assets/language-icons/zig.d.ts +3 -0
- package/dist/lib/assets/language-icons/zig.js +4 -0
- package/dist/lib/assets/language-icons/zig.js.map +1 -0
- package/dist/lib/authentication/providers/auth0.js +7 -3
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/components/BuildCheck.js +2 -2
- package/dist/lib/components/BuildCheck.js.map +1 -1
- package/dist/lib/components/Heading.js +1 -5
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/LanguageIcon.js +45 -0
- package/dist/lib/components/LanguageIcon.js.map +1 -1
- package/dist/lib/components/Main.js +1 -1
- package/dist/lib/components/Main.js.map +1 -1
- package/dist/lib/components/cache.d.ts +3 -1
- package/dist/lib/components/cache.js +3 -5
- package/dist/lib/components/cache.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +10 -2
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +1 -2
- package/dist/lib/hooks/index.d.ts +1 -1
- package/dist/lib/oas/graphql/index.js +17 -0
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +26 -3
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/assets/ChatGPTLogo.d.ts +2 -0
- package/dist/lib/plugins/markdown/assets/ChatGPTLogo.js +3 -0
- package/dist/lib/plugins/markdown/assets/ChatGPTLogo.js.map +1 -0
- package/dist/lib/plugins/markdown/assets/ClaudeLogo.d.ts +2 -0
- package/dist/lib/plugins/markdown/assets/ClaudeLogo.js +3 -0
- package/dist/lib/plugins/markdown/assets/ClaudeLogo.js.map +1 -0
- package/dist/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/MCPEndpoint.js +9 -18
- package/dist/lib/plugins/openapi/MCPEndpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +8 -3
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -2
- package/dist/lib/plugins/openapi/OperationListItem.js +6 -3
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -1
- package/dist/lib/plugins/openapi/Sidecar.js +6 -9
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +8 -2
- package/dist/lib/plugins/openapi/graphql/graphql.js +8 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +15 -3
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/shiki.js +9 -0
- package/dist/lib/shiki.js.map +1 -1
- package/dist/lib/ui/Carousel.js.map +1 -1
- package/dist/lib/ui/Dialog.d.ts +12 -18
- package/dist/lib/ui/Dialog.js +30 -17
- package/dist/lib/ui/Dialog.js.map +1 -1
- package/dist/lib/ui/Secret.d.ts +6 -0
- package/dist/lib/ui/Secret.js +7 -4
- package/dist/lib/ui/Secret.js.map +1 -1
- package/dist/lib/util/pastellize.js +4 -4
- package/dist/lib/util/pastellize.js.map +1 -1
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/llms.d.ts +12 -0
- package/dist/vite/llms.js +66 -0
- package/dist/vite/llms.js.map +1 -0
- package/dist/vite/plugin-api.js +1 -1
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +9 -0
- package/dist/vite/plugin-docs.js +67 -48
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-markdown-export.d.ts +21 -0
- package/dist/vite/plugin-markdown-export.js +139 -0
- package/dist/vite/plugin-markdown-export.js.map +1 -0
- package/dist/vite/plugin-mdx.d.ts +1 -1
- package/dist/vite/plugin-mdx.js +5 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-navigation.js +4 -0
- package/dist/vite/plugin-navigation.js.map +1 -1
- package/dist/vite/plugin.js +2 -0
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender/prerender.js +30 -0
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/lib/{Button-DTDRi4CT.js → Button-DmS4u8Lj.js} +2 -2
- package/lib/{Button-DTDRi4CT.js.map → Button-DmS4u8Lj.js.map} +1 -1
- package/lib/{Card-hTy9PAnh.js → Card-KFniaZn5.js} +2 -2
- package/lib/{Card-hTy9PAnh.js.map → Card-KFniaZn5.js.map} +1 -1
- package/lib/{CategoryHeading-BGCNu3VK.js → CategoryHeading-DhmodDcq.js} +2 -2
- package/lib/{CategoryHeading-BGCNu3VK.js.map → CategoryHeading-DhmodDcq.js.map} +1 -1
- package/lib/CodeBlock-CanTUJLl.js +221 -0
- package/lib/CodeBlock-CanTUJLl.js.map +1 -0
- package/lib/{Command-TEBTONf1.js → Command-CUcrW3qs.js} +3 -3
- package/lib/{Command-TEBTONf1.js.map → Command-CUcrW3qs.js.map} +1 -1
- package/lib/Dialog-BQciPiHN.js +144 -0
- package/lib/Dialog-BQciPiHN.js.map +1 -0
- package/lib/{Drawer-DM9wJUC6.js → Drawer-Ci7XwhqT.js} +2 -2
- package/lib/Drawer-Ci7XwhqT.js.map +1 -0
- package/lib/DropdownMenu-BZ2NKQ3K.js +126 -0
- package/lib/DropdownMenu-BZ2NKQ3K.js.map +1 -0
- package/lib/{ErrorAlert-xpVkFS_n.js → ErrorAlert-VBJ8aHH7.js} +100 -103
- package/lib/ErrorAlert-VBJ8aHH7.js.map +1 -0
- package/lib/MdxPage-DFRNwSsc.js +239 -0
- package/lib/MdxPage-DFRNwSsc.js.map +1 -0
- package/lib/{OAuthErrorPage-DCjFngGS.js → OAuthErrorPage-DJUOdr6Q.js} +7 -7
- package/lib/{OAuthErrorPage-DCjFngGS.js.map → OAuthErrorPage-DJUOdr6Q.js.map} +1 -1
- package/lib/{OasProvider-DH82Y-KM.js → OasProvider-D2NYAaBN.js} +3 -3
- package/lib/{OasProvider-DH82Y-KM.js.map → OasProvider-D2NYAaBN.js.map} +1 -1
- package/lib/{OperationList-Dr87uHqG.js → OperationList-DmXCI4NU.js} +1848 -1853
- package/lib/OperationList-DmXCI4NU.js.map +1 -0
- package/lib/{Pagination-Cdi_qiXc.js → Pagination-CT4VUR6u.js} +3 -3
- package/lib/{Pagination-Cdi_qiXc.js.map → Pagination-CT4VUR6u.js.map} +1 -1
- package/lib/{RouteGuard-dji1UEYe.js → RouteGuard-Bg0Lu0OU.js} +5 -5
- package/lib/{RouteGuard-dji1UEYe.js.map → RouteGuard-Bg0Lu0OU.js.map} +1 -1
- package/lib/{RouterError-D1I15Qyy.js → RouterError-fm21cqlj.js} +4 -4
- package/lib/{RouterError-D1I15Qyy.js.map → RouterError-fm21cqlj.js.map} +1 -1
- package/lib/{SchemaList-07lprC0m.js → SchemaList-uElsscMN.js} +10 -10
- package/lib/{SchemaList-07lprC0m.js.map → SchemaList-uElsscMN.js.map} +1 -1
- package/lib/{SchemaView-m0NDK2i0.js → SchemaView-CNQ3VAbI.js} +5 -5
- package/lib/{SchemaView-m0NDK2i0.js.map → SchemaView-CNQ3VAbI.js.map} +1 -1
- package/lib/Select-CPoGZU_V.js +372 -0
- package/lib/Select-CPoGZU_V.js.map +1 -0
- package/lib/{SignUp-C-YP_Rxi.js → SignUp-BraHuRN_.js} +9 -9
- package/lib/{SignUp-C-YP_Rxi.js.map → SignUp-BraHuRN_.js.map} +1 -1
- package/lib/{Spinner-Cf6E803I.js → Spinner-CI6bRyZw.js} +2 -2
- package/lib/{Spinner-Cf6E803I.js.map → Spinner-CI6bRyZw.js.map} +1 -1
- package/lib/{SyntaxHighlight-CPF64UHi.js → SyntaxHighlight-B0laqAqK.js} +6 -6
- package/lib/{SyntaxHighlight-CPF64UHi.js.map → SyntaxHighlight-B0laqAqK.js.map} +1 -1
- package/lib/{Toc-Cf5UojVb.js → Toc-KzXCRqrX.js} +3 -3
- package/lib/{Toc-Cf5UojVb.js.map → Toc-KzXCRqrX.js.map} +1 -1
- package/lib/ZudokuContext-BXTZApgy.js +1506 -0
- package/lib/ZudokuContext-BXTZApgy.js.map +1 -0
- package/lib/c-B-NUhs61.js +46 -0
- package/lib/c-B-NUhs61.js.map +1 -0
- package/lib/chunk-PVWAREVJ-BO6B-RAk.js.map +1 -1
- package/lib/{circular-ga83n0Za.js → circular-BWT7_Ahq.js} +30 -30
- package/lib/{circular-ga83n0Za.js.map → circular-BWT7_Ahq.js.map} +1 -1
- package/lib/commonlisp-De080z23.js +28 -0
- package/lib/commonlisp-De080z23.js.map +1 -0
- package/lib/cpp-79Paht7T.js +53 -0
- package/lib/cpp-79Paht7T.js.map +1 -0
- package/lib/{createServer-DL1AYSpR.js → createServer-zhJZSgor.js} +3225 -3165
- package/lib/createServer-zhJZSgor.js.map +1 -0
- package/lib/{csharp-rrJEDRrV.js → csharp-D8MIL50B.js} +2 -2
- package/lib/{csharp-rrJEDRrV.js.map → csharp-D8MIL50B.js.map} +1 -1
- package/lib/{css-Dpk9bCql.js → css-Bt6hr1td.js} +2 -2
- package/lib/{css-Dpk9bCql.js.map → css-Bt6hr1td.js.map} +1 -1
- package/lib/dart-B0vy1jWB.js +60 -0
- package/lib/dart-B0vy1jWB.js.map +1 -0
- package/lib/elixir-Ds8r0sF8.js +25 -0
- package/lib/elixir-Ds8r0sF8.js.map +1 -0
- package/lib/{errors-ouIp07AW.js → errors-XqO6MsfU.js} +3 -3
- package/lib/{errors-ouIp07AW.js.map → errors-XqO6MsfU.js.map} +1 -1
- package/lib/{go-D8SJIQ0Z.js → go-D2VsmIOS.js} +2 -2
- package/lib/{go-D8SJIQ0Z.js.map → go-D2VsmIOS.js.map} +1 -1
- package/lib/{graphql-aeVKJNa2.js → graphql-BtA6M4m5.js} +2 -2
- package/lib/{graphql-aeVKJNa2.js.map → graphql-BtA6M4m5.js.map} +1 -1
- package/lib/hook-CAebs2rv.js +31 -0
- package/lib/hook-CAebs2rv.js.map +1 -0
- package/lib/{html-D_7om-nA.js → html-MGnI2uzP.js} +2 -2
- package/lib/{html-D_7om-nA.js.map → html-MGnI2uzP.js.map} +1 -1
- package/lib/{index-CVfG8Pb4.js → index-BPSpOxTK.js} +26 -26
- package/lib/index-BPSpOxTK.js.map +1 -0
- package/lib/{index-DhL3LhWV.js → index-C5L4favO.js} +166 -50
- package/lib/index-C5L4favO.js.map +1 -0
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/{index-DQ8kWcE8.js → index-D8Btv4uT.js} +723 -811
- package/lib/index-D8Btv4uT.js.map +1 -0
- package/lib/index.esm-BYObtETB.js +1294 -0
- package/lib/index.esm-BYObtETB.js.map +1 -0
- package/lib/index.esm-BnYHxCYC.js.map +1 -1
- package/lib/{java-DUh-EL8n.js → java-CVLzHfb1.js} +2 -2
- package/lib/{java-DUh-EL8n.js.map → java-CVLzHfb1.js.map} +1 -1
- package/lib/{javascript-CrY8dcGu.js → javascript-CcmIpL4G.js} +2 -2
- package/lib/{javascript-CrY8dcGu.js.map → javascript-CcmIpL4G.js.map} +1 -1
- package/lib/{json-DLK2_sdf.js → json-4AyP4uiY.js} +2 -2
- package/lib/{json-DLK2_sdf.js.map → json-4AyP4uiY.js.map} +1 -1
- package/lib/{jsx-runtime-DywqP_6a.js → jsx-runtime-BzflLqGi.js} +109 -111
- package/lib/jsx-runtime-BzflLqGi.js.map +1 -0
- package/lib/{kotlin-rJMOGl7D.js → kotlin-v2plddBQ.js} +2 -2
- package/lib/{kotlin-rJMOGl7D.js.map → kotlin-v2plddBQ.js.map} +1 -1
- package/lib/{markdown-BD9bIU5J.js → markdown-DYGWCmGQ.js} +2 -2
- package/lib/{markdown-BD9bIU5J.js.map → markdown-DYGWCmGQ.js.map} +1 -1
- package/lib/{mdx-G25UCvf3.js → mdx-CHwYvXd4.js} +2 -2
- package/lib/{mdx-G25UCvf3.js.map → mdx-CHwYvXd4.js.map} +1 -1
- package/lib/{mutation-De-1gXxl.js → mutation-CdGPxHNX.js} +2 -2
- package/lib/{mutation-De-1gXxl.js.map → mutation-CdGPxHNX.js.map} +1 -1
- package/lib/{objectivec-DDpj0aWX.js → objectivec-HZY8shkd.js} +2 -2
- package/lib/{objectivec-DDpj0aWX.js.map → objectivec-HZY8shkd.js.map} +1 -1
- package/lib/ocaml-DqsdDdwb.js +52 -0
- package/lib/ocaml-DqsdDdwb.js.map +1 -0
- package/lib/{php-BeG18bSy.js → php-rQXzo7K_.js} +2 -2
- package/lib/{php-BeG18bSy.js.map → php-rQXzo7K_.js.map} +1 -1
- package/lib/powershell-CQje9pm1.js +39 -0
- package/lib/powershell-CQje9pm1.js.map +1 -0
- package/lib/{python-BaF2byD-.js → python-QIQAE5Ei.js} +2 -2
- package/lib/{python-BaF2byD-.js.map → python-QIQAE5Ei.js.map} +1 -1
- package/lib/{react-CQvDN20M.js → react-DHpVpxRv.js} +2 -2
- package/lib/{react-CQvDN20M.js.map → react-DHpVpxRv.js.map} +1 -1
- package/lib/{ruby-CmxRVHMR.js → ruby-B2dU8Ny5.js} +2 -2
- package/lib/{ruby-CmxRVHMR.js.map → ruby-B2dU8Ny5.js.map} +1 -1
- package/lib/{rust-IfSC62c5.js → rust-DYnLHAi2.js} +2 -2
- package/lib/{rust-IfSC62c5.js.map → rust-DYnLHAi2.js.map} +1 -1
- package/lib/scala-CeKInBR8.js +25 -0
- package/lib/scala-CeKInBR8.js.map +1 -0
- package/lib/{shell-BFu0M6m4.js → shell-HUv9oVtp.js} +2 -2
- package/lib/{shell-BFu0M6m4.js.map → shell-HUv9oVtp.js.map} +1 -1
- package/lib/{swift-DckbsN4v.js → swift-B4z6ig1Z.js} +2 -2
- package/lib/{swift-DckbsN4v.js.map → swift-B4z6ig1Z.js.map} +1 -1
- package/lib/{toml-BJsCc8TC.js → toml-Co9mpdct.js} +2 -2
- package/lib/{toml-BJsCc8TC.js.map → toml-Co9mpdct.js.map} +1 -1
- package/lib/{typescript-7qOVMjOC.js → typescript-C26xdBDC.js} +2 -2
- package/lib/{typescript-7qOVMjOC.js.map → typescript-C26xdBDC.js.map} +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +3 -3
- package/lib/ui/Alert.js +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 +1 -1
- 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 +2 -2
- package/lib/ui/Command.js +2 -2
- package/lib/ui/Dialog.js +135 -105
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +1 -1
- package/lib/ui/Form.js +2 -2
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.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/ReactComponentDoc.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Secret.js +64 -54
- package/lib/ui/Secret.js.map +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Stepper.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +4 -4
- 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/Tooltip.js +1 -1
- package/lib/ui/Value.js +1 -1
- package/lib/{useExposedProps-B8NHdNRq.js → useExposedProps-Cd7Yg_uG.js} +3 -3
- package/lib/useExposedProps-Cd7Yg_uG.js.map +1 -0
- package/lib/{xml-DAaTIkBX.js → xml-BQOOC04j.js} +2 -2
- package/lib/{xml-DAaTIkBX.js.map → xml-BQOOC04j.js.map} +1 -1
- package/lib/{yaml-DUi-dbfu.js → yaml-BGsJItKv.js} +2 -2
- package/lib/{yaml-DUi-dbfu.js.map → yaml-BGsJItKv.js.map} +1 -1
- package/lib/zig-CUV2sTct.js +35 -0
- package/lib/zig-CUV2sTct.js.map +1 -0
- package/lib/zudoku.__internal.js +1041 -938
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +22 -21
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +14 -15
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +3 -3
- package/lib/zudoku.auth-openid.js +57 -58
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.auth-supabase.js +2 -2
- package/lib/zudoku.components.js +6 -6
- package/lib/zudoku.hooks.js +6 -6
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.icons.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +27 -28
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +215 -301
- 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 +2 -2
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/lib/zudoku.plugin-search-inkeep.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +27 -28
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.router.js +1 -1
- package/lib/zudoku.router.js.map +1 -1
- package/package.json +39 -39
- package/src/lib/assets/language-icons/c.tsx +31 -0
- package/src/lib/assets/language-icons/commonlisp.tsx +22 -0
- package/src/lib/assets/language-icons/cpp.tsx +35 -0
- package/src/lib/assets/language-icons/dart.tsx +39 -0
- package/src/lib/assets/language-icons/elixir.tsx +19 -0
- package/src/lib/assets/language-icons/ocaml.tsx +34 -0
- package/src/lib/assets/language-icons/powershell.tsx +27 -0
- package/src/lib/assets/language-icons/scala.tsx +19 -0
- package/src/lib/assets/language-icons/zig.tsx +32 -0
- package/src/lib/authentication/providers/auth0.tsx +7 -3
- package/src/lib/components/BuildCheck.tsx +12 -10
- package/src/lib/components/Heading.tsx +2 -6
- package/src/lib/components/LanguageIcon.tsx +45 -0
- package/src/lib/components/Main.tsx +1 -1
- package/src/lib/components/cache.ts +9 -5
- package/src/lib/components/context/ZudokuContext.ts +11 -2
- package/src/lib/oas/graphql/index.ts +19 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +122 -8
- package/src/lib/plugins/markdown/assets/ChatGPTLogo.tsx +11 -0
- package/src/lib/plugins/markdown/assets/ClaudeLogo.tsx +19 -0
- package/src/lib/plugins/markdown/index.tsx +3 -7
- package/src/lib/plugins/openapi/MCPEndpoint.tsx +8 -28
- package/src/lib/plugins/openapi/OperationList.tsx +14 -3
- package/src/lib/plugins/openapi/OperationListItem.tsx +10 -5
- package/src/lib/plugins/openapi/Sidecar.tsx +8 -8
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +1 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +4 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +20 -3
- package/src/lib/plugins/openapi/index.tsx +1 -1
- package/src/lib/plugins/openapi/interfaces.ts +1 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +1 -1
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +31 -3
- package/src/lib/shiki.ts +9 -0
- package/src/lib/ui/Carousel.tsx +0 -1
- package/src/lib/ui/Dialog.tsx +112 -106
- package/src/lib/ui/Secret.tsx +44 -27
- package/src/lib/util/pastellize.ts +4 -4
- package/src/shiki/langs/hurl.js +1 -0
- package/src/shiki/langs/kdl.js +1 -0
- package/src/shiki/langs/pkl.js +1 -0
- package/src/shiki/langs/rosmsg.js +1 -0
- package/lib/CodeBlock-i0BM_QFf.js +0 -176
- package/lib/CodeBlock-i0BM_QFf.js.map +0 -1
- package/lib/Dialog-VIMic7xI.js +0 -114
- package/lib/Dialog-VIMic7xI.js.map +0 -1
- package/lib/Drawer-DM9wJUC6.js.map +0 -1
- package/lib/ErrorAlert-xpVkFS_n.js.map +0 -1
- package/lib/MdxPage-Ud1w_GV-.js +0 -111
- package/lib/MdxPage-Ud1w_GV-.js.map +0 -1
- package/lib/OperationList-Dr87uHqG.js.map +0 -1
- package/lib/Select-BiBMWiLv.js +0 -273
- package/lib/Select-BiBMWiLv.js.map +0 -1
- package/lib/ZudokuContext-BcqSiygJ.js +0 -1294
- package/lib/ZudokuContext-BcqSiygJ.js.map +0 -1
- package/lib/createServer-DL1AYSpR.js.map +0 -1
- package/lib/hook-BkLXq8pm.js +0 -243
- package/lib/hook-BkLXq8pm.js.map +0 -1
- package/lib/index-CVfG8Pb4.js.map +0 -1
- package/lib/index-DQ8kWcE8.js.map +0 -1
- package/lib/index-DhL3LhWV.js.map +0 -1
- package/lib/index.esm-DpgNxKa2.js +0 -1267
- package/lib/index.esm-DpgNxKa2.js.map +0 -1
- package/lib/jsx-runtime-DywqP_6a.js.map +0 -1
- package/lib/useExposedProps-B8NHdNRq.js.map +0 -1
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { R as
|
|
4
|
-
import { i as
|
|
5
|
-
import { O as
|
|
6
|
-
import {
|
|
7
|
-
import { D as
|
|
8
|
-
import { Button as
|
|
9
|
-
import {
|
|
10
|
-
import { u as O, A as
|
|
1
|
+
import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { CircleSlashIcon as z, CheckIcon as ue, XIcon as he, PencilLineIcon as fe, RefreshCwIcon as pe, TrashIcon as me, KeyRoundIcon as xe } from "lucide-react";
|
|
3
|
+
import { R as ye } from "./RouterError-fm21cqlj.js";
|
|
4
|
+
import { i as I } from "./invariant-Bm-FVUQE.js";
|
|
5
|
+
import { O as ge, b as je } from "./chunk-PVWAREVJ-BO6B-RAk.js";
|
|
6
|
+
import { u as Ce } from "./hook-CAebs2rv.js";
|
|
7
|
+
import { D as ve, a as Y } from "./ErrorAlert-VBJ8aHH7.js";
|
|
8
|
+
import { Button as w } from "./ui/Button.js";
|
|
9
|
+
import { a as se, i as ne, b as we } from "./ZudokuContext-BXTZApgy.js";
|
|
10
|
+
import { u as O, A as M, a as q, b as be, S as ke, c as Ne, d as Ke, e as Ee, f as De, g as Z, h as Ae } from "./Select-CPoGZU_V.js";
|
|
11
11
|
import * as L from "react";
|
|
12
|
-
import
|
|
13
|
-
import { C as
|
|
14
|
-
import { e as H, f as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
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: [
|
|
12
|
+
import Pe, { createContext as Q, useRef as E, useLayoutEffect as Ie, useEffect as ie, useId as _, useContext as B, useInsertionEffect as Re, useMemo as F, useCallback as Se, Children as Te, isValidElement as Oe, useState as K, forwardRef as Me } from "react";
|
|
13
|
+
import { C as qe, a as $e } from "./Card-KFniaZn5.js";
|
|
14
|
+
import { e as H, f as D, D as V, g as G, a as J, b as U, c as W, d as re } from "./Dialog-BQciPiHN.js";
|
|
15
|
+
import { Input as ae } from "./ui/Input.js";
|
|
16
|
+
import { c as A } from "./cn-dYga0KKN.js";
|
|
17
|
+
import { a as ze } from "./index.esm-BYObtETB.js";
|
|
18
|
+
import { B as Fe } from "./Button-DmS4u8Lj.js";
|
|
19
|
+
import { S as Le } from "./Spinner-CI6bRyZw.js";
|
|
20
|
+
import { useAuth as Qe } from "./zudoku.hooks.js";
|
|
21
|
+
const _e = () => {
|
|
22
|
+
const t = Ce();
|
|
23
|
+
return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(ge, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
|
|
25
24
|
"Please login first to view this page",
|
|
26
|
-
/* @__PURE__ */ e.jsx(
|
|
27
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(
|
|
25
|
+
/* @__PURE__ */ e.jsx(w, { onClick: () => t.login(), children: "Login" })
|
|
26
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(ve, { className: "max-w-[600px]", children: [
|
|
28
27
|
"Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
|
|
29
28
|
/* @__PURE__ */ e.jsx("code", { children: "authentication" }),
|
|
30
29
|
"."
|
|
31
30
|
] }) });
|
|
32
|
-
},
|
|
33
|
-
function
|
|
34
|
-
const i =
|
|
31
|
+
}, Be = Q({});
|
|
32
|
+
function oe(t) {
|
|
33
|
+
const i = E(null);
|
|
35
34
|
return i.current === null && (i.current = t()), i.current;
|
|
36
35
|
}
|
|
37
|
-
const
|
|
38
|
-
function
|
|
36
|
+
const He = typeof window < "u", Ve = He ? Ie : ie, le = /* @__PURE__ */ Q(null);
|
|
37
|
+
function Ge(t) {
|
|
39
38
|
return typeof t == "object" && t !== null;
|
|
40
39
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
40
|
+
function Je(t) {
|
|
41
|
+
return Ge(t) && "offsetHeight" in t;
|
|
43
42
|
}
|
|
44
|
-
const
|
|
43
|
+
const Ue = Q({
|
|
45
44
|
transformPagePoint: (t) => t,
|
|
46
45
|
isStatic: !1,
|
|
47
46
|
reducedMotion: "never"
|
|
48
47
|
});
|
|
49
|
-
class
|
|
48
|
+
class We extends L.Component {
|
|
50
49
|
getSnapshotBeforeUpdate(i) {
|
|
51
50
|
const s = this.props.childRef.current;
|
|
52
51
|
if (s && i.isPresent && !this.props.isPresent) {
|
|
53
|
-
const n = s.offsetParent, r =
|
|
52
|
+
const n = s.offsetParent, r = Je(n) && n.offsetWidth || 0, a = this.props.sizeRef.current;
|
|
54
53
|
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;
|
|
55
54
|
}
|
|
56
55
|
return null;
|
|
@@ -64,231 +63,146 @@ class Ze extends L.Component {
|
|
|
64
63
|
return this.props.children;
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
|
-
function
|
|
68
|
-
const r = _(), a =
|
|
66
|
+
function Xe({ children: t, isPresent: i, anchorX: s, root: n }) {
|
|
67
|
+
const r = _(), a = E(null), l = E({
|
|
69
68
|
width: 0,
|
|
70
69
|
height: 0,
|
|
71
70
|
top: 0,
|
|
72
71
|
left: 0,
|
|
73
72
|
right: 0
|
|
74
|
-
}), { nonce:
|
|
75
|
-
return
|
|
76
|
-
const { width:
|
|
77
|
-
if (i || !a.current || !
|
|
73
|
+
}), { nonce: u } = B(Ue);
|
|
74
|
+
return Re(() => {
|
|
75
|
+
const { width: h, height: d, top: g, left: f, right: m } = l.current;
|
|
76
|
+
if (i || !a.current || !h || !d)
|
|
78
77
|
return;
|
|
79
78
|
const p = s === "left" ? `left: ${f}` : `right: ${m}`;
|
|
80
79
|
a.current.dataset.motionPopId = r;
|
|
81
80
|
const x = document.createElement("style");
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
return
|
|
81
|
+
u && (x.nonce = u);
|
|
82
|
+
const j = n ?? document.head;
|
|
83
|
+
return j.appendChild(x), x.sheet && x.sheet.insertRule(`
|
|
85
84
|
[data-motion-pop-id="${r}"] {
|
|
86
85
|
position: absolute !important;
|
|
87
|
-
width: ${
|
|
88
|
-
height: ${
|
|
86
|
+
width: ${h}px !important;
|
|
87
|
+
height: ${d}px !important;
|
|
89
88
|
${p}px !important;
|
|
90
|
-
top: ${
|
|
89
|
+
top: ${g}px !important;
|
|
91
90
|
}
|
|
92
91
|
`), () => {
|
|
93
|
-
|
|
92
|
+
j.contains(x) && j.removeChild(x);
|
|
94
93
|
};
|
|
95
|
-
}, [i]), e.jsx(
|
|
94
|
+
}, [i]), e.jsx(We, { isPresent: i, childRef: a, sizeRef: l, children: L.cloneElement(t, { ref: a }) });
|
|
96
95
|
}
|
|
97
|
-
const
|
|
98
|
-
const
|
|
96
|
+
const Ye = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: a, mode: l, anchorX: u, root: h }) => {
|
|
97
|
+
const d = oe(Ze), g = _();
|
|
99
98
|
let f = !0, m = F(() => (f = !1, {
|
|
100
|
-
id:
|
|
99
|
+
id: g,
|
|
101
100
|
initial: i,
|
|
102
101
|
isPresent: s,
|
|
103
102
|
custom: r,
|
|
104
103
|
onExitComplete: (p) => {
|
|
105
|
-
|
|
106
|
-
for (const x of
|
|
104
|
+
d.set(p, !0);
|
|
105
|
+
for (const x of d.values())
|
|
107
106
|
if (!x)
|
|
108
107
|
return;
|
|
109
108
|
n && n();
|
|
110
109
|
},
|
|
111
|
-
register: (p) => (
|
|
112
|
-
}), [s,
|
|
110
|
+
register: (p) => (d.set(p, !1), () => d.delete(p))
|
|
111
|
+
}), [s, d, n]);
|
|
113
112
|
return a && f && (m = { ...m }), F(() => {
|
|
114
|
-
|
|
113
|
+
d.forEach((p, x) => d.set(x, !1));
|
|
115
114
|
}, [s]), L.useEffect(() => {
|
|
116
|
-
!s && !
|
|
117
|
-
}, [s]), l === "popLayout" && (t = e.jsx(
|
|
115
|
+
!s && !d.size && n && n();
|
|
116
|
+
}, [s]), l === "popLayout" && (t = e.jsx(Xe, { isPresent: s, anchorX: u, root: h, children: t })), e.jsx(le.Provider, { value: m, children: t });
|
|
118
117
|
};
|
|
119
|
-
function
|
|
118
|
+
function Ze() {
|
|
120
119
|
return /* @__PURE__ */ new Map();
|
|
121
120
|
}
|
|
122
|
-
function
|
|
123
|
-
const i = B(
|
|
121
|
+
function et(t = !0) {
|
|
122
|
+
const i = B(le);
|
|
124
123
|
if (i === null)
|
|
125
124
|
return [!0, null];
|
|
126
125
|
const { isPresent: s, onExitComplete: n, register: r } = i, a = _();
|
|
127
|
-
|
|
126
|
+
ie(() => {
|
|
128
127
|
if (t)
|
|
129
128
|
return r(a);
|
|
130
129
|
}, [t]);
|
|
131
|
-
const l =
|
|
130
|
+
const l = Se(() => t && n && n(a), [a, n, t]);
|
|
132
131
|
return !s && n ? [!1, l] : [!0];
|
|
133
132
|
}
|
|
134
133
|
const R = (t) => t.key || "";
|
|
135
134
|
function ee(t) {
|
|
136
135
|
const i = [];
|
|
137
|
-
return
|
|
138
|
-
|
|
136
|
+
return Te.forEach(t, (s) => {
|
|
137
|
+
Oe(s) && i.push(s);
|
|
139
138
|
}), i;
|
|
140
139
|
}
|
|
141
|
-
const
|
|
142
|
-
const [
|
|
143
|
-
|
|
140
|
+
const tt = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: a = "sync", propagate: l = !1, anchorX: u = "left", root: h }) => {
|
|
141
|
+
const [d, g] = et(l), f = F(() => ee(t), [t]), m = l && !d ? [] : f.map(R), p = E(!0), x = E(f), j = oe(() => /* @__PURE__ */ new Map()), [P, o] = K(f), [c, C] = K(f);
|
|
142
|
+
Ve(() => {
|
|
144
143
|
p.current = !1, x.current = f;
|
|
145
|
-
for (let
|
|
146
|
-
const
|
|
147
|
-
m.includes(
|
|
144
|
+
for (let v = 0; v < c.length; v++) {
|
|
145
|
+
const y = R(c[v]);
|
|
146
|
+
m.includes(y) ? j.delete(y) : j.get(y) !== !0 && j.set(y, !1);
|
|
148
147
|
}
|
|
149
|
-
}, [
|
|
148
|
+
}, [c, m.length, m.join("-")]);
|
|
150
149
|
const b = [];
|
|
151
|
-
if (f !==
|
|
152
|
-
let
|
|
153
|
-
for (let
|
|
154
|
-
const
|
|
155
|
-
m.includes(
|
|
150
|
+
if (f !== P) {
|
|
151
|
+
let v = [...f];
|
|
152
|
+
for (let y = 0; y < c.length; y++) {
|
|
153
|
+
const N = c[y], $ = R(N);
|
|
154
|
+
m.includes($) || (v.splice(y, 0, N), b.push(N));
|
|
156
155
|
}
|
|
157
|
-
return a === "wait" && b.length && (
|
|
156
|
+
return a === "wait" && b.length && (v = b), C(ee(v)), o(f), null;
|
|
158
157
|
}
|
|
159
|
-
process.env.NODE_ENV !== "production" && a === "wait" &&
|
|
160
|
-
const { forceRender: k } = B(
|
|
161
|
-
return e.jsx(e.Fragment, { children:
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
164
|
-
|
|
158
|
+
process.env.NODE_ENV !== "production" && a === "wait" && c.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.`);
|
|
159
|
+
const { forceRender: k } = B(Be);
|
|
160
|
+
return e.jsx(e.Fragment, { children: c.map((v) => {
|
|
161
|
+
const y = R(v), N = l && !d ? !1 : f === c || m.includes(y), $ = () => {
|
|
162
|
+
if (j.has(y))
|
|
163
|
+
j.set(y, !0);
|
|
165
164
|
else
|
|
166
165
|
return;
|
|
167
166
|
let X = !0;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}), X && (k?.(), C(x.current), l &&
|
|
167
|
+
j.forEach((de) => {
|
|
168
|
+
de || (X = !1);
|
|
169
|
+
}), X && (k?.(), C(x.current), l && g?.(), n && n());
|
|
171
170
|
};
|
|
172
|
-
return e.jsx(
|
|
171
|
+
return e.jsx(Ye, { isPresent: N, initial: !p.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: r, mode: a, root: h, onExitComplete: N ? void 0 : $, anchorX: u, children: v }, y);
|
|
173
172
|
}) });
|
|
174
|
-
},
|
|
175
|
-
secret: t,
|
|
176
|
-
preview: i = 5,
|
|
177
|
-
className: s,
|
|
178
|
-
status: n,
|
|
179
|
-
onCopy: r,
|
|
180
|
-
revealed: a,
|
|
181
|
-
onReveal: l,
|
|
182
|
-
noReveal: h
|
|
183
|
-
}) => {
|
|
184
|
-
const c = Math.abs(i), [u, y] = E(!1), [f, m] = Le(), p = a ?? u;
|
|
185
|
-
return /* @__PURE__ */ e.jsxs(
|
|
186
|
-
"div",
|
|
187
|
-
{
|
|
188
|
-
className: N(
|
|
189
|
-
"flex gap-2 items-center text-sm border rounded-md px-1",
|
|
190
|
-
s
|
|
191
|
-
),
|
|
192
|
-
children: [
|
|
193
|
-
/* @__PURE__ */ e.jsxs("div", { className: "font-mono w-full h-9 items-center flex px-2 text-xs gap-2", children: [
|
|
194
|
-
n && /* @__PURE__ */ e.jsx(
|
|
195
|
-
"div",
|
|
196
|
-
{
|
|
197
|
-
className: N(
|
|
198
|
-
"rounded-full shrink-0 w-2 h-2 mr-2",
|
|
199
|
-
n === "active" && "bg-emerald-400",
|
|
200
|
-
n === "expired" && "bg-neutral-200",
|
|
201
|
-
n === "expiring" && "bg-yellow-400",
|
|
202
|
-
n === "revoked" && "bg-red-400",
|
|
203
|
-
n === "none" && "opacity-0"
|
|
204
|
-
)
|
|
205
|
-
}
|
|
206
|
-
),
|
|
207
|
-
/* @__PURE__ */ e.jsxs("span", { className: "w-full truncate", children: [
|
|
208
|
-
/* @__PURE__ */ e.jsx(
|
|
209
|
-
"div",
|
|
210
|
-
{
|
|
211
|
-
className: N(
|
|
212
|
-
"w-40 inline-block md:w-fit",
|
|
213
|
-
p ? "" : "opacity-50"
|
|
214
|
-
),
|
|
215
|
-
children: p ? t.slice(
|
|
216
|
-
0,
|
|
217
|
-
c === 0 ? t.length : -c
|
|
218
|
-
) : "•••• ".repeat(
|
|
219
|
-
t.slice(
|
|
220
|
-
0,
|
|
221
|
-
c === 0 ? t.length : -c
|
|
222
|
-
).length / 5
|
|
223
|
-
) + "•".repeat(
|
|
224
|
-
t.slice(
|
|
225
|
-
0,
|
|
226
|
-
c === 0 ? t.length : -c
|
|
227
|
-
).length % 5
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
),
|
|
231
|
-
c > 0 && /* @__PURE__ */ e.jsx("span", { children: t.slice(-c) })
|
|
232
|
-
] })
|
|
233
|
-
] }),
|
|
234
|
-
h !== !0 && /* @__PURE__ */ e.jsx(
|
|
235
|
-
j,
|
|
236
|
-
{
|
|
237
|
-
variant: "ghost",
|
|
238
|
-
onClick: () => {
|
|
239
|
-
y((x) => !x), l?.(!p);
|
|
240
|
-
},
|
|
241
|
-
size: "icon",
|
|
242
|
-
children: p ? /* @__PURE__ */ e.jsx(he, { size: 16 }) : /* @__PURE__ */ e.jsx(fe, { size: 16 })
|
|
243
|
-
}
|
|
244
|
-
),
|
|
245
|
-
/* @__PURE__ */ e.jsx(
|
|
246
|
-
j,
|
|
247
|
-
{
|
|
248
|
-
variant: "ghost",
|
|
249
|
-
onClick: () => {
|
|
250
|
-
m(t), r?.(t);
|
|
251
|
-
},
|
|
252
|
-
size: "icon",
|
|
253
|
-
children: f ? /* @__PURE__ */ e.jsx(se, { size: 16 }) : /* @__PURE__ */ e.jsx(pe, { size: 16 })
|
|
254
|
-
}
|
|
255
|
-
)
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
);
|
|
259
|
-
}, de = qe(
|
|
173
|
+
}, ce = Me(
|
|
260
174
|
({ isPending: t, children: i, className: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
|
|
261
|
-
|
|
175
|
+
Fe,
|
|
262
176
|
{
|
|
263
177
|
ref: r,
|
|
264
178
|
disabled: t,
|
|
265
179
|
...n,
|
|
266
|
-
className:
|
|
180
|
+
className: A("relative", s),
|
|
267
181
|
children: [
|
|
268
|
-
t && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ e.jsx(
|
|
269
|
-
/* @__PURE__ */ e.jsx("span", { className:
|
|
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: i })
|
|
270
184
|
]
|
|
271
185
|
}
|
|
272
186
|
)
|
|
273
187
|
);
|
|
274
|
-
|
|
275
|
-
const
|
|
188
|
+
ce.displayName = "ActionButton";
|
|
189
|
+
const st = ({
|
|
276
190
|
service: t,
|
|
277
191
|
onOpenChange: i
|
|
278
192
|
}) => {
|
|
279
|
-
const s =
|
|
193
|
+
const s = se(), n = ne(), r = je(), a = ze({
|
|
280
194
|
defaultValues: {
|
|
281
195
|
expiresOn: "30"
|
|
282
196
|
}
|
|
283
|
-
}), l =
|
|
284
|
-
mutationFn: ({ description:
|
|
197
|
+
}), l = Qe(), u = O({
|
|
198
|
+
mutationFn: ({ description: h, expiresOn: d }) => {
|
|
285
199
|
if (!t.createKey)
|
|
286
200
|
throw new Error("createKey not implemented");
|
|
287
|
-
const
|
|
201
|
+
const g = d !== "never" ? nt(Number(d)) : void 0;
|
|
288
202
|
return t.createKey({
|
|
289
203
|
apiKey: {
|
|
290
|
-
description:
|
|
291
|
-
expiresOn:
|
|
204
|
+
description: h || "Secret Key",
|
|
205
|
+
expiresOn: g
|
|
292
206
|
},
|
|
293
207
|
context: s,
|
|
294
208
|
auth: l
|
|
@@ -302,48 +216,48 @@ const at = ({
|
|
|
302
216
|
"form",
|
|
303
217
|
{
|
|
304
218
|
onSubmit: a.handleSubmit(
|
|
305
|
-
(
|
|
306
|
-
{ ...
|
|
219
|
+
(h) => u.mutate(
|
|
220
|
+
{ ...h },
|
|
307
221
|
{
|
|
308
222
|
onSuccess: () => i(!1)
|
|
309
223
|
}
|
|
310
224
|
)
|
|
311
225
|
),
|
|
312
226
|
children: [
|
|
313
|
-
|
|
314
|
-
/* @__PURE__ */ e.jsx(
|
|
315
|
-
/* @__PURE__ */ e.jsx(
|
|
227
|
+
u.error && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
228
|
+
/* @__PURE__ */ e.jsx(q, { children: "Error" }),
|
|
229
|
+
/* @__PURE__ */ e.jsx(be, { children: u.error.message })
|
|
316
230
|
] }),
|
|
317
231
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
|
|
318
232
|
"Name",
|
|
319
|
-
/* @__PURE__ */ e.jsx(
|
|
233
|
+
/* @__PURE__ */ e.jsx(ae, { ...a.register("description") }),
|
|
320
234
|
"Expiration",
|
|
321
235
|
/* @__PURE__ */ e.jsxs(
|
|
322
|
-
|
|
236
|
+
ke,
|
|
323
237
|
{
|
|
324
|
-
onValueChange: (
|
|
238
|
+
onValueChange: (h) => a.setValue("expiresOn", h),
|
|
325
239
|
defaultValue: a.getValues("expiresOn"),
|
|
326
240
|
children: [
|
|
327
|
-
/* @__PURE__ */ e.jsx(
|
|
328
|
-
/* @__PURE__ */ e.jsx(
|
|
329
|
-
[7, 30, 60, 90].map((
|
|
330
|
-
|
|
241
|
+
/* @__PURE__ */ e.jsx(Ne, { children: /* @__PURE__ */ e.jsx(Ke, {}) }),
|
|
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,
|
|
331
245
|
" days"
|
|
332
|
-
] },
|
|
246
|
+
] }, h)),
|
|
333
247
|
/* @__PURE__ */ e.jsx(Z, { value: "never", children: "Never" })
|
|
334
248
|
] }) })
|
|
335
249
|
]
|
|
336
250
|
}
|
|
337
251
|
),
|
|
338
252
|
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
339
|
-
/* @__PURE__ */ e.jsx(
|
|
340
|
-
/* @__PURE__ */ e.jsx(
|
|
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" })
|
|
341
255
|
] })
|
|
342
256
|
] })
|
|
343
257
|
]
|
|
344
258
|
}
|
|
345
259
|
) : null;
|
|
346
|
-
},
|
|
260
|
+
}, nt = (t) => {
|
|
347
261
|
const i = /* @__PURE__ */ new Date();
|
|
348
262
|
return i.setDate(i.getDate() + t), i.toISOString();
|
|
349
263
|
}, te = ({
|
|
@@ -353,41 +267,41 @@ const at = ({
|
|
|
353
267
|
trigger: n,
|
|
354
268
|
buttonVariant: r = "outline"
|
|
355
269
|
}) => {
|
|
356
|
-
const a = /* @__PURE__ */ e.jsx(
|
|
270
|
+
const a = /* @__PURE__ */ e.jsx(w, { variant: r, children: "Create API Key" });
|
|
357
271
|
return /* @__PURE__ */ e.jsxs(V, { open: i, onOpenChange: s, children: [
|
|
358
272
|
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: n ?? a }),
|
|
359
273
|
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
360
274
|
/* @__PURE__ */ e.jsx(U, { children: /* @__PURE__ */ e.jsx(W, { children: "Create API Key" }) }),
|
|
361
|
-
/* @__PURE__ */ e.jsx(
|
|
275
|
+
/* @__PURE__ */ e.jsx(st, { service: t, onOpenChange: s })
|
|
362
276
|
] })
|
|
363
277
|
] });
|
|
364
|
-
},
|
|
365
|
-
const i =
|
|
278
|
+
}, it = ({ service: t }) => {
|
|
279
|
+
const i = se(), s = ne(), [n, r] = K(
|
|
366
280
|
null
|
|
367
|
-
), [a, l] =
|
|
281
|
+
), [a, l] = K(""), { data: u, isFetching: h } = we({
|
|
368
282
|
queryFn: () => t.getConsumers(i),
|
|
369
283
|
queryKey: ["api-keys"],
|
|
370
284
|
retry: !1
|
|
371
|
-
}), [
|
|
285
|
+
}), [d, g] = K(!1), f = O({
|
|
372
286
|
mutationFn: ({
|
|
373
287
|
consumerId: o,
|
|
374
|
-
keyId:
|
|
288
|
+
keyId: c
|
|
375
289
|
}) => {
|
|
376
290
|
if (!t.deleteKey)
|
|
377
291
|
throw new Error("deleteKey not implemented");
|
|
378
|
-
return t.deleteKey(o,
|
|
292
|
+
return t.deleteKey(o, c, i);
|
|
379
293
|
},
|
|
380
|
-
onMutate: async ({ consumerId: o, keyId:
|
|
294
|
+
onMutate: async ({ consumerId: o, keyId: c }) => {
|
|
381
295
|
await s.cancelQueries({ queryKey: ["api-keys"] });
|
|
382
296
|
const C = s.getQueryData([
|
|
383
297
|
"api-keys"
|
|
384
298
|
]);
|
|
385
299
|
return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
|
|
386
300
|
...k,
|
|
387
|
-
apiKeys: k.apiKeys.filter((
|
|
301
|
+
apiKeys: k.apiKeys.filter((v) => v.id !== c)
|
|
388
302
|
} : k)), { previousData: C };
|
|
389
303
|
},
|
|
390
|
-
onError: (o,
|
|
304
|
+
onError: (o, c, C) => {
|
|
391
305
|
C?.previousData && s.setQueryData(["api-keys"], C.previousData);
|
|
392
306
|
},
|
|
393
307
|
onSuccess: () => {
|
|
@@ -396,21 +310,21 @@ const at = ({
|
|
|
396
310
|
}), m = O({
|
|
397
311
|
mutationFn: ({
|
|
398
312
|
consumerId: o,
|
|
399
|
-
label:
|
|
313
|
+
label: c
|
|
400
314
|
}) => {
|
|
401
315
|
if (!t.updateConsumer)
|
|
402
316
|
throw new Error("updateConsumer not implemented");
|
|
403
|
-
return t.updateConsumer({ id: o, label:
|
|
317
|
+
return t.updateConsumer({ id: o, label: c }, i);
|
|
404
318
|
},
|
|
405
|
-
onMutate: async ({ consumerId: o, label:
|
|
319
|
+
onMutate: async ({ consumerId: o, label: c }) => {
|
|
406
320
|
await s.cancelQueries({ queryKey: ["api-keys"] });
|
|
407
321
|
const C = s.getQueryData(["api-keys"]);
|
|
408
322
|
return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
|
|
409
323
|
...k,
|
|
410
|
-
label:
|
|
324
|
+
label: c
|
|
411
325
|
} : k)), { previousData: C };
|
|
412
326
|
},
|
|
413
|
-
onError: (o,
|
|
327
|
+
onError: (o, c, C) => {
|
|
414
328
|
C?.previousData && s.setQueryData(["api-keys"], C.previousData);
|
|
415
329
|
},
|
|
416
330
|
onSuccess: () => {
|
|
@@ -423,14 +337,14 @@ const at = ({
|
|
|
423
337
|
return t.rollKey(o, i);
|
|
424
338
|
},
|
|
425
339
|
onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
|
|
426
|
-
}), x = (o,
|
|
427
|
-
r(o), l(
|
|
428
|
-
},
|
|
340
|
+
}), x = (o, c) => {
|
|
341
|
+
r(o), l(c);
|
|
342
|
+
}, j = (o) => {
|
|
429
343
|
a.trim() && m.mutate({
|
|
430
344
|
consumerId: o,
|
|
431
345
|
label: a.trim()
|
|
432
346
|
}), r(null), l("");
|
|
433
|
-
},
|
|
347
|
+
}, P = () => {
|
|
434
348
|
r(null), l("");
|
|
435
349
|
};
|
|
436
350
|
return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-md h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
|
|
@@ -441,27 +355,27 @@ const at = ({
|
|
|
441
355
|
te,
|
|
442
356
|
{
|
|
443
357
|
service: t,
|
|
444
|
-
isOpen:
|
|
445
|
-
onOpenChange:
|
|
358
|
+
isOpen: d,
|
|
359
|
+
onOpenChange: g
|
|
446
360
|
}
|
|
447
361
|
)
|
|
448
362
|
] }),
|
|
449
363
|
/* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
|
|
450
364
|
/* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page-before-keys" }),
|
|
451
365
|
/* @__PURE__ */ e.jsx("div", { className: "h-8" }),
|
|
452
|
-
p.isError && /* @__PURE__ */ e.jsxs(
|
|
453
|
-
/* @__PURE__ */ e.jsx(
|
|
454
|
-
/* @__PURE__ */ e.jsx(
|
|
366
|
+
p.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
367
|
+
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
368
|
+
/* @__PURE__ */ e.jsx(q, { children: p.error.message })
|
|
455
369
|
] }),
|
|
456
|
-
m.isError && /* @__PURE__ */ e.jsxs(
|
|
457
|
-
/* @__PURE__ */ e.jsx(
|
|
458
|
-
/* @__PURE__ */ e.jsx(
|
|
370
|
+
m.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
371
|
+
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
372
|
+
/* @__PURE__ */ e.jsx(q, { children: m.error.message })
|
|
459
373
|
] }),
|
|
460
|
-
f.isError && /* @__PURE__ */ e.jsxs(
|
|
461
|
-
/* @__PURE__ */ e.jsx(
|
|
462
|
-
/* @__PURE__ */ e.jsx(
|
|
374
|
+
f.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
375
|
+
/* @__PURE__ */ e.jsx(z, { size: 16 }),
|
|
376
|
+
/* @__PURE__ */ e.jsx(q, { children: f.error.message })
|
|
463
377
|
] }),
|
|
464
|
-
/* @__PURE__ */ e.jsx("div", { className: "", children:
|
|
378
|
+
/* @__PURE__ */ e.jsx("div", { className: "", children: u.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: [
|
|
465
379
|
/* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
|
|
466
380
|
"You have no API keys yet.",
|
|
467
381
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -471,33 +385,33 @@ const at = ({
|
|
|
471
385
|
te,
|
|
472
386
|
{
|
|
473
387
|
service: t,
|
|
474
|
-
isOpen:
|
|
475
|
-
onOpenChange:
|
|
388
|
+
isOpen: d,
|
|
389
|
+
onOpenChange: g
|
|
476
390
|
}
|
|
477
391
|
)
|
|
478
392
|
] }) : /* @__PURE__ */ e.jsx(
|
|
479
393
|
"ul",
|
|
480
394
|
{
|
|
481
|
-
className:
|
|
395
|
+
className: A(
|
|
482
396
|
"grid grid-cols-[1fr_min-content] divide-y divide-border col-span-6"
|
|
483
397
|
),
|
|
484
|
-
children:
|
|
485
|
-
|
|
398
|
+
children: u.map((o) => /* @__PURE__ */ e.jsxs(
|
|
399
|
+
qe,
|
|
486
400
|
{
|
|
487
401
|
className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
|
|
488
402
|
children: [
|
|
489
|
-
/* @__PURE__ */ e.jsxs(
|
|
403
|
+
/* @__PURE__ */ e.jsxs($e, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
|
|
490
404
|
/* @__PURE__ */ e.jsxs("div", { className: "h-10 flex flex-col text-sm justify-center", children: [
|
|
491
405
|
/* @__PURE__ */ e.jsxs("div", { className: "font-medium text-lg flex items-center gap-2", children: [
|
|
492
406
|
n === o.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
|
|
493
407
|
/* @__PURE__ */ e.jsx(
|
|
494
|
-
|
|
408
|
+
ae,
|
|
495
409
|
{
|
|
496
410
|
maxLength: 32,
|
|
497
411
|
value: a,
|
|
498
|
-
onChange: (
|
|
499
|
-
onKeyDown: (
|
|
500
|
-
|
|
412
|
+
onChange: (c) => l(c.target.value),
|
|
413
|
+
onKeyDown: (c) => {
|
|
414
|
+
c.key === "Enter" ? j(o.id) : c.key === "Escape" && P();
|
|
501
415
|
},
|
|
502
416
|
className: "text-lg font-medium",
|
|
503
417
|
autoFocus: !0
|
|
@@ -505,22 +419,22 @@ const at = ({
|
|
|
505
419
|
),
|
|
506
420
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
507
421
|
/* @__PURE__ */ e.jsx(
|
|
508
|
-
|
|
422
|
+
w,
|
|
509
423
|
{
|
|
510
424
|
size: "icon",
|
|
511
425
|
variant: "ghost",
|
|
512
|
-
onClick: () =>
|
|
426
|
+
onClick: () => j(o.id),
|
|
513
427
|
disabled: !a.trim(),
|
|
514
|
-
children: /* @__PURE__ */ e.jsx(
|
|
428
|
+
children: /* @__PURE__ */ e.jsx(ue, { size: 16 })
|
|
515
429
|
}
|
|
516
430
|
),
|
|
517
431
|
/* @__PURE__ */ e.jsx(
|
|
518
|
-
|
|
432
|
+
w,
|
|
519
433
|
{
|
|
520
434
|
size: "icon",
|
|
521
435
|
variant: "ghost",
|
|
522
|
-
onClick:
|
|
523
|
-
children: /* @__PURE__ */ e.jsx(
|
|
436
|
+
onClick: P,
|
|
437
|
+
children: /* @__PURE__ */ e.jsx(he, { size: 16 })
|
|
524
438
|
}
|
|
525
439
|
)
|
|
526
440
|
] })
|
|
@@ -542,24 +456,24 @@ const at = ({
|
|
|
542
456
|
] }),
|
|
543
457
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
|
|
544
458
|
t.updateConsumer && /* @__PURE__ */ e.jsxs(
|
|
545
|
-
|
|
459
|
+
w,
|
|
546
460
|
{
|
|
547
461
|
variant: "ghost",
|
|
548
462
|
onClick: () => x(o.id, o.label),
|
|
549
|
-
className:
|
|
463
|
+
className: A(
|
|
550
464
|
"flex gap-2",
|
|
551
465
|
n === o.id && "opacity-0! pointer-events-none"
|
|
552
466
|
),
|
|
553
467
|
disabled: n === o.id,
|
|
554
468
|
children: [
|
|
555
|
-
/* @__PURE__ */ e.jsx(
|
|
469
|
+
/* @__PURE__ */ e.jsx(fe, { size: 16 }),
|
|
556
470
|
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
|
|
557
471
|
]
|
|
558
472
|
}
|
|
559
473
|
),
|
|
560
474
|
t.rollKey && /* @__PURE__ */ e.jsxs(V, { children: [
|
|
561
475
|
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
562
|
-
|
|
476
|
+
w,
|
|
563
477
|
{
|
|
564
478
|
title: "Roll this key",
|
|
565
479
|
variant: "ghost",
|
|
@@ -567,7 +481,7 @@ const at = ({
|
|
|
567
481
|
className: "flex items-center gap-2",
|
|
568
482
|
children: [
|
|
569
483
|
/* @__PURE__ */ e.jsx(
|
|
570
|
-
|
|
484
|
+
pe,
|
|
571
485
|
{
|
|
572
486
|
size: 16,
|
|
573
487
|
className: p.isPending ? "animate-spin" : void 0
|
|
@@ -580,12 +494,12 @@ const at = ({
|
|
|
580
494
|
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
581
495
|
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
582
496
|
/* @__PURE__ */ e.jsx(W, { children: "Roll API Key" }),
|
|
583
|
-
/* @__PURE__ */ e.jsx(
|
|
497
|
+
/* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to roll this API key?" })
|
|
584
498
|
] }),
|
|
585
499
|
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
586
|
-
/* @__PURE__ */ e.jsx(
|
|
587
|
-
/* @__PURE__ */ e.jsx(
|
|
588
|
-
|
|
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,
|
|
589
503
|
{
|
|
590
504
|
onClick: () => {
|
|
591
505
|
p.mutate(o.id);
|
|
@@ -598,22 +512,22 @@ const at = ({
|
|
|
598
512
|
] })
|
|
599
513
|
] })
|
|
600
514
|
] }),
|
|
601
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(
|
|
515
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(tt, { children: o.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(Pe.Fragment, { children: [
|
|
602
516
|
/* @__PURE__ */ e.jsx(
|
|
603
|
-
|
|
517
|
+
at,
|
|
604
518
|
{
|
|
605
|
-
apiKey:
|
|
519
|
+
apiKey: c,
|
|
606
520
|
onDeleteKey: () => {
|
|
607
521
|
f.mutate({
|
|
608
522
|
consumerId: o.id,
|
|
609
|
-
keyId:
|
|
523
|
+
keyId: c.id
|
|
610
524
|
});
|
|
611
525
|
},
|
|
612
|
-
className: f.variables?.keyId ===
|
|
526
|
+
className: f.variables?.keyId === c.id && (f.isPending || h) ? "opacity-10!" : void 0
|
|
613
527
|
}
|
|
614
528
|
),
|
|
615
529
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
|
|
616
|
-
] },
|
|
530
|
+
] }, c.id)) }) })
|
|
617
531
|
]
|
|
618
532
|
},
|
|
619
533
|
o.id
|
|
@@ -621,25 +535,25 @@ const at = ({
|
|
|
621
535
|
}
|
|
622
536
|
) })
|
|
623
537
|
] });
|
|
624
|
-
},
|
|
538
|
+
}, rt = (t) => {
|
|
625
539
|
const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), r = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
626
540
|
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");
|
|
627
|
-
},
|
|
541
|
+
}, at = ({
|
|
628
542
|
apiKey: t,
|
|
629
543
|
onDeleteKey: i,
|
|
630
544
|
className: s
|
|
631
545
|
}) => {
|
|
632
|
-
const [n, r] =
|
|
633
|
-
(new Date(
|
|
634
|
-
) : 1 / 0,
|
|
635
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
546
|
+
const [n, r] = K(!1), { key: a, createdOn: l, expiresOn: u } = t, h = u && new Date(u) < /* @__PURE__ */ new Date(), d = u ? Math.ceil(
|
|
547
|
+
(new Date(u).getTime() - Date.now()) / (1e3 * 60 * 60 * 24)
|
|
548
|
+
) : 1 / 0, g = d <= 7 && !h;
|
|
549
|
+
return /* @__PURE__ */ e.jsxs("div", { className: A("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
636
550
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
637
551
|
/* @__PURE__ */ e.jsx(
|
|
638
|
-
|
|
552
|
+
Ae,
|
|
639
553
|
{
|
|
640
554
|
className: "max-w-fit w-full",
|
|
641
555
|
secret: a,
|
|
642
|
-
status:
|
|
556
|
+
status: h ? "expired" : g ? "expiring" : "active",
|
|
643
557
|
revealed: n,
|
|
644
558
|
onReveal: r
|
|
645
559
|
}
|
|
@@ -647,35 +561,35 @@ const at = ({
|
|
|
647
561
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
|
|
648
562
|
l && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
649
563
|
"Created ",
|
|
650
|
-
|
|
564
|
+
rt(l),
|
|
651
565
|
"."
|
|
652
566
|
] }),
|
|
653
567
|
" ",
|
|
654
|
-
|
|
568
|
+
u && g && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
655
569
|
"Expires in ",
|
|
656
|
-
|
|
570
|
+
d,
|
|
657
571
|
" ",
|
|
658
|
-
|
|
572
|
+
d === 1 ? "day" : "days",
|
|
659
573
|
"."
|
|
660
574
|
] }),
|
|
661
|
-
|
|
575
|
+
u && h && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
662
576
|
"Expired",
|
|
663
577
|
" ",
|
|
664
|
-
|
|
578
|
+
d === 0 ? "today." : `${d * -1} days ago.`
|
|
665
579
|
] })
|
|
666
580
|
] })
|
|
667
581
|
] }),
|
|
668
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children:
|
|
669
|
-
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
582
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: u && i && /* @__PURE__ */ e.jsxs(V, { children: [
|
|
583
|
+
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(me, { size: 16 }) }) }),
|
|
670
584
|
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
671
585
|
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
672
586
|
/* @__PURE__ */ e.jsx(W, { children: "Delete API Key" }),
|
|
673
|
-
/* @__PURE__ */ e.jsx(
|
|
587
|
+
/* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to delete this API key?" })
|
|
674
588
|
] }),
|
|
675
589
|
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
676
|
-
/* @__PURE__ */ e.jsx(
|
|
677
|
-
/* @__PURE__ */ e.jsx(
|
|
678
|
-
|
|
590
|
+
/* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", children: "Cancel" }) }),
|
|
591
|
+
/* @__PURE__ */ e.jsx(D, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
592
|
+
w,
|
|
679
593
|
{
|
|
680
594
|
onClick: () => {
|
|
681
595
|
i();
|
|
@@ -687,7 +601,7 @@ const at = ({
|
|
|
687
601
|
] })
|
|
688
602
|
] }) })
|
|
689
603
|
] });
|
|
690
|
-
}, S = "https://api.zuploedge.com/v2/client",
|
|
604
|
+
}, S = "https://api.zuploedge.com/v2/client", ot = async (t) => {
|
|
691
605
|
try {
|
|
692
606
|
return await t.json();
|
|
693
607
|
} catch {
|
|
@@ -696,11 +610,11 @@ const at = ({
|
|
|
696
610
|
}, T = async (t) => {
|
|
697
611
|
const i = t.headers.get("content-type");
|
|
698
612
|
if (!t.ok && i?.includes("application/problem+json")) {
|
|
699
|
-
const s = await
|
|
613
|
+
const s = await ot(t);
|
|
700
614
|
if (s.type && s.title)
|
|
701
615
|
throw new Error(s.detail ?? s.title);
|
|
702
616
|
}
|
|
703
|
-
},
|
|
617
|
+
}, lt = (t, i) => ({
|
|
704
618
|
deleteKey: async (s, n, r) => {
|
|
705
619
|
const a = new Request(
|
|
706
620
|
S + `/${t}/consumers/${s}/keys/${n}`,
|
|
@@ -710,7 +624,7 @@ const at = ({
|
|
|
710
624
|
);
|
|
711
625
|
await r.signRequest(a);
|
|
712
626
|
const l = await fetch(a);
|
|
713
|
-
await T(l),
|
|
627
|
+
await T(l), I(l.ok, "Failed to delete API key");
|
|
714
628
|
},
|
|
715
629
|
updateConsumer: async (s, n) => {
|
|
716
630
|
const r = await fetch(
|
|
@@ -729,7 +643,7 @@ const at = ({
|
|
|
729
643
|
)
|
|
730
644
|
)
|
|
731
645
|
);
|
|
732
|
-
await T(r),
|
|
646
|
+
await T(r), I(r.ok, "Failed to update API key description");
|
|
733
647
|
},
|
|
734
648
|
rollKey: async (s, n) => {
|
|
735
649
|
const r = await fetch(
|
|
@@ -746,7 +660,7 @@ const at = ({
|
|
|
746
660
|
)
|
|
747
661
|
)
|
|
748
662
|
);
|
|
749
|
-
await T(r),
|
|
663
|
+
await T(r), I(r.ok, "Failed to delete API key");
|
|
750
664
|
},
|
|
751
665
|
getConsumers: async (s) => {
|
|
752
666
|
const n = new Request(
|
|
@@ -754,7 +668,7 @@ const at = ({
|
|
|
754
668
|
);
|
|
755
669
|
await s.signRequest(n);
|
|
756
670
|
const r = await fetch(n);
|
|
757
|
-
return await T(r),
|
|
671
|
+
return await T(r), I(r.ok, "Failed to fetch API keys"), (await r.json()).data.map((l) => ({
|
|
758
672
|
id: l.id,
|
|
759
673
|
label: l.label || l.subject || "API Key",
|
|
760
674
|
apiKeys: l.apiKeys.data,
|
|
@@ -762,15 +676,15 @@ const at = ({
|
|
|
762
676
|
}));
|
|
763
677
|
},
|
|
764
678
|
...i
|
|
765
|
-
}),
|
|
766
|
-
const i = "deploymentName" in t ?
|
|
679
|
+
}), Dt = (t) => t, At = (t) => {
|
|
680
|
+
const i = "deploymentName" in t ? lt(t.deploymentName, t) : t;
|
|
767
681
|
return {
|
|
768
682
|
getProfileMenuItems: () => [
|
|
769
683
|
{
|
|
770
684
|
label: "API Keys",
|
|
771
685
|
path: "/settings/api-keys",
|
|
772
686
|
category: "middle",
|
|
773
|
-
icon:
|
|
687
|
+
icon: xe
|
|
774
688
|
}
|
|
775
689
|
],
|
|
776
690
|
getIdentities: async (s) => {
|
|
@@ -789,12 +703,12 @@ const at = ({
|
|
|
789
703
|
},
|
|
790
704
|
getRoutes: () => [
|
|
791
705
|
{
|
|
792
|
-
element: /* @__PURE__ */ e.jsx(
|
|
793
|
-
errorElement: /* @__PURE__ */ e.jsx(
|
|
706
|
+
element: /* @__PURE__ */ e.jsx(_e, {}),
|
|
707
|
+
errorElement: /* @__PURE__ */ e.jsx(ye, {}),
|
|
794
708
|
children: [
|
|
795
709
|
{
|
|
796
710
|
path: "/settings/api-keys",
|
|
797
|
-
element: /* @__PURE__ */ e.jsx(
|
|
711
|
+
element: /* @__PURE__ */ e.jsx(it, { service: i })
|
|
798
712
|
}
|
|
799
713
|
]
|
|
800
714
|
}
|
|
@@ -802,7 +716,7 @@ const at = ({
|
|
|
802
716
|
};
|
|
803
717
|
};
|
|
804
718
|
export {
|
|
805
|
-
|
|
806
|
-
|
|
719
|
+
At as apiKeyPlugin,
|
|
720
|
+
Dt as createApiKeyService
|
|
807
721
|
};
|
|
808
722
|
//# sourceMappingURL=zudoku.plugin-api-keys.js.map
|