zudoku 0.65.3 → 0.66.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/dist/app/sentry.js +1 -1
- package/dist/config/validators/BuildSchema.js +18 -3
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +45 -3
- package/dist/config/validators/validate.js +7 -1
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +9 -2
- package/dist/lib/components/Mermaid.d.ts +7 -0
- package/dist/lib/components/Mermaid.js +42 -0
- package/dist/lib/components/Mermaid.js.map +1 -0
- package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
- package/dist/lib/components/PagefindSearchMeta.js +7 -0
- package/dist/lib/components/PagefindSearchMeta.js.map +1 -0
- package/dist/lib/components/Zudoku.js +2 -5
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +1 -1
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +3 -3
- package/dist/lib/oas/parser/index.d.ts +1 -0
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/openapi/DownloadSchemaButton.d.ts +3 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.js +3 -6
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OasProvider.js +22 -13
- package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +12 -6
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +2 -2
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +2 -1
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +11 -5
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +16 -13
- 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/schema/SchemaView.d.ts +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +14 -6
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.d.ts +6 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +29 -2
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
- package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
- package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/shiki.d.ts +1 -1
- package/dist/lib/shiki.js +18 -12
- package/dist/lib/shiki.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +9 -8
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/ButtonGroup.d.ts +11 -0
- package/dist/lib/ui/ButtonGroup.js +28 -0
- package/dist/lib/ui/ButtonGroup.js.map +1 -0
- package/dist/lib/ui/Command.js +2 -2
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +21 -23
- package/dist/lib/ui/DropdownMenu.js +47 -32
- package/dist/lib/ui/DropdownMenu.js.map +1 -1
- package/dist/lib/ui/Kbd.d.ts +3 -0
- package/dist/lib/ui/Kbd.js +10 -0
- package/dist/lib/ui/Kbd.js.map +1 -0
- package/dist/lib/util/MdxComponents.d.ts +1 -0
- package/dist/lib/util/MdxComponents.js +2 -0
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/flattenAllOf.js +27 -4
- package/dist/lib/util/flattenAllOf.js.map +1 -1
- package/dist/lib/util/flattenAllOf.test.js +67 -12
- package/dist/lib/util/flattenAllOf.test.js.map +1 -1
- package/dist/vite/api/SchemaManager.d.ts +5 -0
- package/dist/vite/api/SchemaManager.js +24 -0
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +67 -0
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/config.js +8 -2
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +25 -0
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/pagefind-dev-index.d.ts +16 -0
- package/dist/vite/pagefind-dev-index.js +68 -0
- package/dist/vite/pagefind-dev-index.js.map +1 -0
- package/dist/vite/plugin-api.js +41 -3
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/prerender/prerender.js +1 -19
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/utils.d.ts +2 -0
- package/dist/vite/prerender/utils.js +24 -0
- package/dist/vite/prerender/utils.js.map +1 -0
- package/lib/Button-CynVW1JV.js +53 -0
- package/lib/Button-CynVW1JV.js.map +1 -0
- package/lib/ClaudeLogo-PxFjou9w.js +69 -0
- package/lib/ClaudeLogo-PxFjou9w.js.map +1 -0
- package/lib/{Command-CUcrW3qs.js → Command-BpT1iBE6.js} +25 -25
- package/lib/Command-BpT1iBE6.js.map +1 -0
- package/lib/Drawer-Ci7XwhqT.js.map +1 -1
- package/lib/DropdownMenu-C8SX_-S_.js +104 -0
- package/lib/DropdownMenu-C8SX_-S_.js.map +1 -0
- package/lib/{ErrorAlert-D5LKLFOd.js → ErrorAlert-BqjbNHIn.js} +1017 -1015
- package/lib/{ErrorAlert-D5LKLFOd.js.map → ErrorAlert-BqjbNHIn.js.map} +1 -1
- package/lib/IndexingDialog-B5zCiUKr.js +100 -0
- package/lib/IndexingDialog-B5zCiUKr.js.map +1 -0
- package/lib/MdxPage-CVFatbHw.js +210 -0
- package/lib/MdxPage-CVFatbHw.js.map +1 -0
- package/lib/Mermaid-CIFixY6C.js +102 -0
- package/lib/Mermaid-CIFixY6C.js.map +1 -0
- package/lib/{OAuthErrorPage-oXnxcJg4.js → OAuthErrorPage-Dup79DJk.js} +7 -7
- package/lib/{OAuthErrorPage-oXnxcJg4.js.map → OAuthErrorPage-Dup79DJk.js.map} +1 -1
- package/lib/OasProvider-BJeMq29o.js +40 -0
- package/lib/OasProvider-BJeMq29o.js.map +1 -0
- package/lib/{OperationList-CmMoKpGu.js → OperationList-ff3ZvQsO.js} +1701 -1585
- package/lib/OperationList-ff3ZvQsO.js.map +1 -0
- package/lib/{RouteGuard-Brz95MSt.js → RouteGuard-BXy13JSz.js} +19 -19
- package/lib/{RouteGuard-Brz95MSt.js.map → RouteGuard-BXy13JSz.js.map} +1 -1
- package/lib/{RouterError-VGZB_wg4.js → RouterError-CKOZTsDD.js} +3 -3
- package/lib/{RouterError-VGZB_wg4.js.map → RouterError-CKOZTsDD.js.map} +1 -1
- package/lib/{SchemaList-BykD27ga.js → SchemaList-BSC1KM3v.js} +28 -27
- package/lib/SchemaList-BSC1KM3v.js.map +1 -0
- package/lib/{SchemaView-Dt6hbCAt.js → SchemaView-CgwJ9gtb.js} +198 -187
- package/lib/SchemaView-CgwJ9gtb.js.map +1 -0
- package/lib/Select-VmDZ-nKe.js +337 -0
- package/lib/Select-VmDZ-nKe.js.map +1 -0
- package/lib/{SignUp-D2mmQOkg.js → SignUp-Pm_LGm6T.js} +13 -13
- package/lib/{SignUp-D2mmQOkg.js.map → SignUp-Pm_LGm6T.js.map} +1 -1
- package/lib/{SyntaxHighlight-C19vH0V_.js → SyntaxHighlight-bkmst3oV.js} +654 -622
- package/lib/SyntaxHighlight-bkmst3oV.js.map +1 -0
- package/lib/{Toc-CBWfFCVf.js → Toc-TUXNFbKl.js} +2 -2
- package/lib/{Toc-CBWfFCVf.js.map → Toc-TUXNFbKl.js.map} +1 -1
- package/lib/{ZudokuContext-BUZ5hkWB.js → ZudokuContext-np1wheDl.js} +8 -8
- package/lib/{ZudokuContext-BUZ5hkWB.js.map → ZudokuContext-np1wheDl.js.map} +1 -1
- package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js +9 -0
- package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +1 -0
- package/lib/{chunk-PVWAREVJ-BMhpCH5D.js → chunk-PVWAREVJ-dLIqswPy.js} +5 -5
- package/lib/{chunk-PVWAREVJ-BMhpCH5D.js.map → chunk-PVWAREVJ-dLIqswPy.js.map} +1 -1
- package/lib/{circular-CNHs4gAz.js → circular-XPj_dwqA.js} +2 -2
- package/lib/{circular-CNHs4gAz.js.map → circular-XPj_dwqA.js.map} +1 -1
- package/lib/createServer-D01nCTNp.js +16693 -0
- package/lib/createServer-D01nCTNp.js.map +1 -0
- package/lib/{errors-D7xzOd8X.js → errors-B0hNTPFO.js} +3 -3
- package/lib/{errors-D7xzOd8X.js.map → errors-B0hNTPFO.js.map} +1 -1
- package/lib/{hook-CMeoxziF.js → hook-CvSwcbk6.js} +3 -3
- package/lib/{hook-CMeoxziF.js.map → hook-CvSwcbk6.js.map} +1 -1
- package/lib/{index-unv8c40u.js → index-Bjc_QsUR.js} +754 -738
- package/lib/{index-unv8c40u.js.map → index-Bjc_QsUR.js.map} +1 -1
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/index-DnMgJWrI.js +133 -0
- package/lib/index-DnMgJWrI.js.map +1 -0
- package/lib/{index-CF7_erXq.js → index-DscsS121.js} +2 -2
- package/lib/{index-CF7_erXq.js.map → index-DscsS121.js.map} +1 -1
- package/lib/{index-CPws05Tb.js → index-mfkNWYG-.js} +10 -10
- package/lib/{index-CPws05Tb.js.map → index-mfkNWYG-.js.map} +1 -1
- package/lib/{index.esm-BnYHxCYC.js → index.esm-DtzT_KoE.js} +20 -20
- package/lib/{index.esm-BnYHxCYC.js.map → index.esm-DtzT_KoE.js.map} +1 -1
- package/lib/{invariant-Bm-FVUQE.js → invariant-CGOLuIIz.js} +3 -3
- package/lib/{invariant-Bm-FVUQE.js.map → invariant-CGOLuIIz.js.map} +1 -1
- package/lib/{mutation-BSU0xu4m.js → mutation-BlmnL5qL.js} +2 -2
- package/lib/{mutation-BSU0xu4m.js.map → mutation-BlmnL5qL.js.map} +1 -1
- package/lib/ui/ActionButton.js +1 -1
- package/lib/ui/Button.js +25 -24
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/ButtonGroup.js +77 -0
- package/lib/ui/ButtonGroup.js.map +1 -0
- package/lib/ui/Command.js +3 -3
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/DropdownMenu.js +227 -140
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/Kbd.js +32 -0
- package/lib/ui/Kbd.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/zudoku.__internal.js +8 -8
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +4 -4
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +5 -5
- package/lib/zudoku.auth-supabase.js +5 -5
- package/lib/zudoku.components.js +7 -7
- package/lib/zudoku.hooks.js +11 -24
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.mermaid.js +10 -0
- package/lib/zudoku.mermaid.js.map +1 -0
- package/lib/zudoku.plugin-api-catalog.js +6 -6
- package/lib/zudoku.plugin-api-keys.js +223 -198
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +184 -226
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/lib/zudoku.router.js +2 -2
- package/package.json +29 -21
- package/src/app/sentry.ts +1 -1
- package/src/lib/components/Mermaid.tsx +68 -0
- package/src/lib/components/PagefindSearchMeta.tsx +14 -0
- package/src/lib/components/Zudoku.tsx +4 -7
- package/src/lib/core/RouteGuard.tsx +1 -1
- package/src/lib/core/plugins.ts +2 -2
- package/src/lib/oas/parser/index.ts +2 -0
- package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +115 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
- package/src/lib/plugins/openapi/OasProvider.tsx +30 -17
- package/src/lib/plugins/openapi/OperationList.tsx +39 -21
- package/src/lib/plugins/openapi/OperationListItem.tsx +5 -5
- package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
- package/src/lib/plugins/openapi/index.tsx +16 -7
- package/src/lib/plugins/openapi/interfaces.ts +16 -7
- package/src/lib/plugins/openapi/playground/Playground.tsx +1 -1
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +36 -27
- package/src/lib/plugins/openapi/schema/utils.ts +5 -2
- package/src/lib/plugins/openapi/util/getRoutes.tsx +35 -3
- package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
- package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
- package/src/lib/shiki.ts +21 -12
- package/src/lib/ui/Button.tsx +10 -10
- package/src/lib/ui/ButtonGroup.tsx +82 -0
- package/src/lib/ui/Command.tsx +3 -3
- package/src/lib/ui/DropdownMenu.tsx +226 -170
- package/src/lib/ui/Kbd.tsx +28 -0
- package/src/lib/util/MdxComponents.tsx +2 -0
- package/src/lib/util/flattenAllOf.test.ts +71 -19
- package/src/lib/util/flattenAllOf.ts +29 -8
- package/src/shiki/langs/markdown-nix.js +1 -0
- package/src/shiki/langs/openscad.js +1 -0
- package/dist/vite/create-pagefind-index.d.ts +0 -4
- package/dist/vite/create-pagefind-index.js +0 -12
- package/dist/vite/create-pagefind-index.js.map +0 -1
- package/lib/Button-B3ucvvQw.js +0 -52
- package/lib/Button-B3ucvvQw.js.map +0 -1
- package/lib/Command-CUcrW3qs.js.map +0 -1
- package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
- package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
- package/lib/MdxPage-hOCN-u-L.js +0 -240
- package/lib/MdxPage-hOCN-u-L.js.map +0 -1
- package/lib/OasProvider-CpniNNrW.js +0 -36
- package/lib/OasProvider-CpniNNrW.js.map +0 -1
- package/lib/OperationList-CmMoKpGu.js.map +0 -1
- package/lib/Pagination-lLSoHnxa.js +0 -37
- package/lib/Pagination-lLSoHnxa.js.map +0 -1
- package/lib/SchemaList-BykD27ga.js.map +0 -1
- package/lib/SchemaView-Dt6hbCAt.js.map +0 -1
- package/lib/Select-DFRCS31-.js +0 -399
- package/lib/Select-DFRCS31-.js.map +0 -1
- package/lib/SyntaxHighlight-C19vH0V_.js.map +0 -1
- package/lib/createServer-BmcVQAOQ.js +0 -13018
- package/lib/createServer-BmcVQAOQ.js.map +0 -1
- package/lib/useExposedProps-U3pmsHaG.js +0 -113
- package/lib/useExposedProps-U3pmsHaG.js.map +0 -1
|
@@ -1,55 +1,80 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { CircleSlashIcon as
|
|
3
|
-
import { R as
|
|
4
|
-
import { i as I } from "./invariant-
|
|
5
|
-
import { O as
|
|
6
|
-
import { u as
|
|
7
|
-
import { D as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { a as
|
|
10
|
-
import { u as O,
|
|
11
|
-
import * as
|
|
12
|
-
import Pe, { createContext as Q, useRef as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
import { CircleSlashIcon as F, CheckIcon as fe, XIcon as he, PencilLineIcon as pe, RefreshCwIcon as me, TrashIcon as xe, KeyRoundIcon as ye } from "lucide-react";
|
|
3
|
+
import { R as ge } from "./RouterError-CKOZTsDD.js";
|
|
4
|
+
import { i as I } from "./invariant-CGOLuIIz.js";
|
|
5
|
+
import { O as je, u as Ce } from "./chunk-PVWAREVJ-dLIqswPy.js";
|
|
6
|
+
import { u as ve } from "./hook-CvSwcbk6.js";
|
|
7
|
+
import { D as we, a as Y } from "./ErrorAlert-BqjbNHIn.js";
|
|
8
|
+
import { Button as v } from "./ui/Button.js";
|
|
9
|
+
import { a as ne, g as ie, e as be } from "./ZudokuContext-np1wheDl.js";
|
|
10
|
+
import { u as O, S as ke, a as Ne, b as Ke, c as Ee, d as De, e as Z, f as Ae } from "./Select-VmDZ-nKe.js";
|
|
11
|
+
import * as $ from "react";
|
|
12
|
+
import Pe, { createContext as Q, useRef as D, useLayoutEffect as Ie, useEffect as re, useId as _, useContext as B, useInsertionEffect as Re, useMemo as L, useCallback as Se, Children as Te, isValidElement as Oe, useState as E, forwardRef as Me } from "react";
|
|
13
|
+
import { A as M, a as q, b as qe } from "./Mermaid-CIFixY6C.js";
|
|
14
|
+
import { C as $e, a as ze } from "./Card-KFniaZn5.js";
|
|
15
|
+
import { e as H, f as A, D as V, g as G, a as J, b as U, c as W, d as ae } from "./Dialog-BQciPiHN.js";
|
|
16
|
+
import { Input as oe } from "./ui/Input.js";
|
|
17
|
+
import { c as P } from "./cn-dYga0KKN.js";
|
|
18
|
+
import { a as Fe } from "./index.esm-BYObtETB.js";
|
|
19
|
+
import { B as Le } from "./Button-CynVW1JV.js";
|
|
20
|
+
import { S as Qe } from "./Spinner-CI6bRyZw.js";
|
|
21
|
+
import { b as _e } from "./index-DnMgJWrI.js";
|
|
22
|
+
const Be = () => {
|
|
23
|
+
const t = ve();
|
|
24
|
+
return t.isAuthEnabled && t.isPending ? null : t.isAuthEnabled ? t.isAuthenticated ? /* @__PURE__ */ e.jsx(je, {}) : /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
|
|
24
25
|
"Please login first to view this page",
|
|
25
|
-
/* @__PURE__ */ e.jsx(
|
|
26
|
-
] }) : /* @__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(v, { 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(we, { className: "max-w-[600px]", children: [
|
|
27
28
|
"Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
|
|
28
29
|
/* @__PURE__ */ e.jsx("code", { children: "authentication" }),
|
|
29
30
|
"."
|
|
30
31
|
] }) });
|
|
31
|
-
},
|
|
32
|
-
function
|
|
33
|
-
const r =
|
|
32
|
+
}, He = Q({});
|
|
33
|
+
function le(t) {
|
|
34
|
+
const r = D(null);
|
|
34
35
|
return r.current === null && (r.current = t()), r.current;
|
|
35
36
|
}
|
|
36
|
-
const
|
|
37
|
-
function
|
|
37
|
+
const Ve = typeof window < "u", Ge = Ve ? Ie : re, ce = /* @__PURE__ */ Q(null);
|
|
38
|
+
function Je(t) {
|
|
38
39
|
return typeof t == "object" && t !== null;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
41
|
+
function Ue(t) {
|
|
42
|
+
return Je(t) && "offsetHeight" in t;
|
|
42
43
|
}
|
|
43
|
-
const
|
|
44
|
+
const We = Q({
|
|
44
45
|
transformPagePoint: (t) => t,
|
|
45
46
|
isStatic: !1,
|
|
46
47
|
reducedMotion: "never"
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
+
function ee(t, r) {
|
|
50
|
+
if (typeof t == "function")
|
|
51
|
+
return t(r);
|
|
52
|
+
t != null && (t.current = r);
|
|
53
|
+
}
|
|
54
|
+
function Xe(...t) {
|
|
55
|
+
return (r) => {
|
|
56
|
+
let s = !1;
|
|
57
|
+
const n = t.map((i) => {
|
|
58
|
+
const a = ee(i, r);
|
|
59
|
+
return !s && typeof a == "function" && (s = !0), a;
|
|
60
|
+
});
|
|
61
|
+
if (s)
|
|
62
|
+
return () => {
|
|
63
|
+
for (let i = 0; i < n.length; i++) {
|
|
64
|
+
const a = n[i];
|
|
65
|
+
typeof a == "function" ? a() : ee(t[i], null);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function Ye(...t) {
|
|
71
|
+
return $.useCallback(Xe(...t), t);
|
|
72
|
+
}
|
|
73
|
+
class Ze extends $.Component {
|
|
49
74
|
getSnapshotBeforeUpdate(r) {
|
|
50
75
|
const s = this.props.childRef.current;
|
|
51
76
|
if (s && r.isPresent && !this.props.isPresent) {
|
|
52
|
-
const n = s.offsetParent, i =
|
|
77
|
+
const n = s.offsetParent, i = Ue(n) && n.offsetWidth || 0, a = this.props.sizeRef.current;
|
|
53
78
|
a.height = s.offsetHeight || 0, a.width = s.offsetWidth || 0, a.top = s.offsetTop, a.left = s.offsetLeft, a.right = i - a.width - a.left;
|
|
54
79
|
}
|
|
55
80
|
return null;
|
|
@@ -63,63 +88,63 @@ class We extends L.Component {
|
|
|
63
88
|
return this.props.children;
|
|
64
89
|
}
|
|
65
90
|
}
|
|
66
|
-
function
|
|
67
|
-
const i = _(), a =
|
|
91
|
+
function et({ children: t, isPresent: r, anchorX: s, root: n }) {
|
|
92
|
+
const i = _(), a = D(null), l = D({
|
|
68
93
|
width: 0,
|
|
69
94
|
height: 0,
|
|
70
95
|
top: 0,
|
|
71
96
|
left: 0,
|
|
72
97
|
right: 0
|
|
73
|
-
}), { nonce: u } = B(
|
|
98
|
+
}), { nonce: u } = B(We), f = Ye(a, t?.ref);
|
|
74
99
|
return Re(() => {
|
|
75
|
-
const { width:
|
|
76
|
-
if (r || !a.current || !
|
|
100
|
+
const { width: d, height: y, top: h, left: x, right: p } = l.current;
|
|
101
|
+
if (r || !a.current || !d || !y)
|
|
77
102
|
return;
|
|
78
|
-
const
|
|
103
|
+
const b = s === "left" ? `left: ${x}` : `right: ${p}`;
|
|
79
104
|
a.current.dataset.motionPopId = i;
|
|
80
|
-
const
|
|
81
|
-
u && (
|
|
82
|
-
const
|
|
83
|
-
return
|
|
105
|
+
const m = document.createElement("style");
|
|
106
|
+
u && (m.nonce = u);
|
|
107
|
+
const N = n ?? document.head;
|
|
108
|
+
return N.appendChild(m), m.sheet && m.sheet.insertRule(`
|
|
84
109
|
[data-motion-pop-id="${i}"] {
|
|
85
110
|
position: absolute !important;
|
|
86
|
-
width: ${
|
|
87
|
-
height: ${
|
|
88
|
-
${
|
|
89
|
-
top: ${
|
|
111
|
+
width: ${d}px !important;
|
|
112
|
+
height: ${y}px !important;
|
|
113
|
+
${b}px !important;
|
|
114
|
+
top: ${h}px !important;
|
|
90
115
|
}
|
|
91
116
|
`), () => {
|
|
92
|
-
|
|
117
|
+
N.contains(m) && N.removeChild(m);
|
|
93
118
|
};
|
|
94
|
-
}, [r]), e.jsx(
|
|
119
|
+
}, [r]), e.jsx(Ze, { isPresent: r, childRef: a, sizeRef: l, children: $.cloneElement(t, { ref: f }) });
|
|
95
120
|
}
|
|
96
|
-
const
|
|
97
|
-
const d =
|
|
98
|
-
let
|
|
99
|
-
id:
|
|
121
|
+
const tt = ({ children: t, initial: r, isPresent: s, onExitComplete: n, custom: i, presenceAffectsLayout: a, mode: l, anchorX: u, root: f }) => {
|
|
122
|
+
const d = le(st), y = _();
|
|
123
|
+
let h = !0, x = L(() => (h = !1, {
|
|
124
|
+
id: y,
|
|
100
125
|
initial: r,
|
|
101
126
|
isPresent: s,
|
|
102
127
|
custom: i,
|
|
103
128
|
onExitComplete: (p) => {
|
|
104
129
|
d.set(p, !0);
|
|
105
|
-
for (const
|
|
106
|
-
if (!
|
|
130
|
+
for (const b of d.values())
|
|
131
|
+
if (!b)
|
|
107
132
|
return;
|
|
108
133
|
n && n();
|
|
109
134
|
},
|
|
110
135
|
register: (p) => (d.set(p, !1), () => d.delete(p))
|
|
111
136
|
}), [s, d, n]);
|
|
112
|
-
return a &&
|
|
113
|
-
d.forEach((p,
|
|
114
|
-
}, [s]),
|
|
137
|
+
return a && h && (x = { ...x }), L(() => {
|
|
138
|
+
d.forEach((p, b) => d.set(b, !1));
|
|
139
|
+
}, [s]), $.useEffect(() => {
|
|
115
140
|
!s && !d.size && n && n();
|
|
116
|
-
}, [s]), l === "popLayout" && (t = e.jsx(
|
|
141
|
+
}, [s]), l === "popLayout" && (t = e.jsx(et, { isPresent: s, anchorX: u, root: f, children: t })), e.jsx(ce.Provider, { value: x, children: t });
|
|
117
142
|
};
|
|
118
|
-
function
|
|
143
|
+
function st() {
|
|
119
144
|
return /* @__PURE__ */ new Map();
|
|
120
145
|
}
|
|
121
|
-
function
|
|
122
|
-
const r = B(
|
|
146
|
+
function nt(t = !0) {
|
|
147
|
+
const r = B(ce);
|
|
123
148
|
if (r === null)
|
|
124
149
|
return [!0, null];
|
|
125
150
|
const { isPresent: s, onExitComplete: n, register: i } = r, a = _();
|
|
@@ -131,78 +156,78 @@ function et(t = !0) {
|
|
|
131
156
|
return !s && n ? [!1, l] : [!0];
|
|
132
157
|
}
|
|
133
158
|
const R = (t) => t.key || "";
|
|
134
|
-
function
|
|
159
|
+
function te(t) {
|
|
135
160
|
const r = [];
|
|
136
161
|
return Te.forEach(t, (s) => {
|
|
137
162
|
Oe(s) && r.push(s);
|
|
138
163
|
}), r;
|
|
139
164
|
}
|
|
140
|
-
const
|
|
141
|
-
const [d,
|
|
142
|
-
|
|
143
|
-
p.current = !1,
|
|
144
|
-
for (let
|
|
145
|
-
const
|
|
146
|
-
|
|
165
|
+
const it = ({ children: t, custom: r, initial: s = !0, onExitComplete: n, presenceAffectsLayout: i = !0, mode: a = "sync", propagate: l = !1, anchorX: u = "left", root: f }) => {
|
|
166
|
+
const [d, y] = nt(l), h = L(() => te(t), [t]), x = l && !d ? [] : h.map(R), p = D(!0), b = D(h), m = le(() => /* @__PURE__ */ new Map()), [N, o] = E(h), [c, j] = E(h);
|
|
167
|
+
Ge(() => {
|
|
168
|
+
p.current = !1, b.current = h;
|
|
169
|
+
for (let C = 0; C < c.length; C++) {
|
|
170
|
+
const g = R(c[C]);
|
|
171
|
+
x.includes(g) ? m.delete(g) : m.get(g) !== !0 && m.set(g, !1);
|
|
147
172
|
}
|
|
148
|
-
}, [c,
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
151
|
-
let
|
|
152
|
-
for (let
|
|
153
|
-
const
|
|
154
|
-
|
|
173
|
+
}, [c, x.length, x.join("-")]);
|
|
174
|
+
const w = [];
|
|
175
|
+
if (h !== N) {
|
|
176
|
+
let C = [...h];
|
|
177
|
+
for (let g = 0; g < c.length; g++) {
|
|
178
|
+
const K = c[g], z = R(K);
|
|
179
|
+
x.includes(z) || (C.splice(g, 0, K), w.push(K));
|
|
155
180
|
}
|
|
156
|
-
return a === "wait" &&
|
|
181
|
+
return a === "wait" && w.length && (C = w), j(te(C)), o(h), null;
|
|
157
182
|
}
|
|
158
183
|
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:
|
|
160
|
-
return e.jsx(e.Fragment, { children: c.map((
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
163
|
-
|
|
184
|
+
const { forceRender: k } = B(He);
|
|
185
|
+
return e.jsx(e.Fragment, { children: c.map((C) => {
|
|
186
|
+
const g = R(C), K = l && !d ? !1 : h === c || x.includes(g), z = () => {
|
|
187
|
+
if (m.has(g))
|
|
188
|
+
m.set(g, !0);
|
|
164
189
|
else
|
|
165
190
|
return;
|
|
166
191
|
let X = !0;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}), X && (
|
|
192
|
+
m.forEach((ue) => {
|
|
193
|
+
ue || (X = !1);
|
|
194
|
+
}), X && (k?.(), j(b.current), l && y?.(), n && n());
|
|
170
195
|
};
|
|
171
|
-
return e.jsx(
|
|
196
|
+
return e.jsx(tt, { isPresent: K, initial: !p.current || s ? void 0 : !1, custom: r, presenceAffectsLayout: i, mode: a, root: f, onExitComplete: K ? void 0 : z, anchorX: u, children: C }, g);
|
|
172
197
|
}) });
|
|
173
|
-
},
|
|
198
|
+
}, de = Me(
|
|
174
199
|
({ isPending: t, children: r, className: s, ...n }, i) => /* @__PURE__ */ e.jsxs(
|
|
175
|
-
|
|
200
|
+
Le,
|
|
176
201
|
{
|
|
177
202
|
ref: i,
|
|
178
203
|
disabled: t,
|
|
179
204
|
...n,
|
|
180
|
-
className:
|
|
205
|
+
className: P("relative", s),
|
|
181
206
|
children: [
|
|
182
|
-
t && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ e.jsx(
|
|
183
|
-
/* @__PURE__ */ e.jsx("span", { className:
|
|
207
|
+
t && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ e.jsx(Qe, {}) }),
|
|
208
|
+
/* @__PURE__ */ e.jsx("span", { className: P("block", t && "invisible"), children: r })
|
|
184
209
|
]
|
|
185
210
|
}
|
|
186
211
|
)
|
|
187
212
|
);
|
|
188
|
-
|
|
189
|
-
const
|
|
213
|
+
de.displayName = "ActionButton";
|
|
214
|
+
const rt = ({
|
|
190
215
|
service: t,
|
|
191
216
|
onOpenChange: r
|
|
192
217
|
}) => {
|
|
193
|
-
const s =
|
|
218
|
+
const s = ne(), n = ie(), i = Ce(), a = Fe({
|
|
194
219
|
defaultValues: {
|
|
195
220
|
expiresOn: "30"
|
|
196
221
|
}
|
|
197
|
-
}), l =
|
|
198
|
-
mutationFn: ({ description:
|
|
222
|
+
}), l = _e(), u = O({
|
|
223
|
+
mutationFn: ({ description: f, expiresOn: d }) => {
|
|
199
224
|
if (!t.createKey)
|
|
200
225
|
throw new Error("createKey not implemented");
|
|
201
|
-
const
|
|
226
|
+
const y = d !== "never" ? at(Number(d)) : void 0;
|
|
202
227
|
return t.createKey({
|
|
203
228
|
apiKey: {
|
|
204
|
-
description:
|
|
205
|
-
expiresOn:
|
|
229
|
+
description: f || "Secret Key",
|
|
230
|
+
expiresOn: y
|
|
206
231
|
},
|
|
207
232
|
context: s,
|
|
208
233
|
auth: l
|
|
@@ -216,8 +241,8 @@ const st = ({
|
|
|
216
241
|
"form",
|
|
217
242
|
{
|
|
218
243
|
onSubmit: a.handleSubmit(
|
|
219
|
-
(
|
|
220
|
-
{ ...
|
|
244
|
+
(f) => u.mutate(
|
|
245
|
+
{ ...f },
|
|
221
246
|
{
|
|
222
247
|
onSuccess: () => r(!1)
|
|
223
248
|
}
|
|
@@ -226,63 +251,63 @@ const st = ({
|
|
|
226
251
|
children: [
|
|
227
252
|
u.error && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
228
253
|
/* @__PURE__ */ e.jsx(q, { children: "Error" }),
|
|
229
|
-
/* @__PURE__ */ e.jsx(
|
|
254
|
+
/* @__PURE__ */ e.jsx(qe, { children: u.error.message })
|
|
230
255
|
] }),
|
|
231
256
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
|
|
232
257
|
"Name",
|
|
233
|
-
/* @__PURE__ */ e.jsx(
|
|
258
|
+
/* @__PURE__ */ e.jsx(oe, { ...a.register("description") }),
|
|
234
259
|
"Expiration",
|
|
235
260
|
/* @__PURE__ */ e.jsxs(
|
|
236
|
-
|
|
261
|
+
ke,
|
|
237
262
|
{
|
|
238
|
-
onValueChange: (
|
|
263
|
+
onValueChange: (f) => a.setValue("expiresOn", f),
|
|
239
264
|
defaultValue: a.getValues("expiresOn"),
|
|
240
265
|
children: [
|
|
241
266
|
/* @__PURE__ */ e.jsx(Ne, { children: /* @__PURE__ */ e.jsx(Ke, {}) }),
|
|
242
267
|
/* @__PURE__ */ e.jsx(Ee, { children: /* @__PURE__ */ e.jsxs(De, { children: [
|
|
243
|
-
[7, 30, 60, 90].map((
|
|
244
|
-
|
|
268
|
+
[7, 30, 60, 90].map((f) => /* @__PURE__ */ e.jsxs(Z, { value: String(f), children: [
|
|
269
|
+
f,
|
|
245
270
|
" days"
|
|
246
|
-
] },
|
|
271
|
+
] }, f)),
|
|
247
272
|
/* @__PURE__ */ e.jsx(Z, { value: "never", children: "Never" })
|
|
248
273
|
] }) })
|
|
249
274
|
]
|
|
250
275
|
}
|
|
251
276
|
),
|
|
252
277
|
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
253
|
-
/* @__PURE__ */ e.jsx(
|
|
254
|
-
/* @__PURE__ */ e.jsx(
|
|
278
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(v, { variant: "outline", children: "Cancel" }) }),
|
|
279
|
+
/* @__PURE__ */ e.jsx(de, { isPending: u.isPending, children: "Generate Key" })
|
|
255
280
|
] })
|
|
256
281
|
] })
|
|
257
282
|
]
|
|
258
283
|
}
|
|
259
284
|
) : null;
|
|
260
|
-
},
|
|
285
|
+
}, at = (t) => {
|
|
261
286
|
const r = /* @__PURE__ */ new Date();
|
|
262
287
|
return r.setDate(r.getDate() + t), r.toISOString();
|
|
263
|
-
},
|
|
288
|
+
}, se = ({
|
|
264
289
|
service: t,
|
|
265
290
|
isOpen: r,
|
|
266
291
|
onOpenChange: s,
|
|
267
292
|
trigger: n,
|
|
268
293
|
buttonVariant: i = "outline"
|
|
269
294
|
}) => {
|
|
270
|
-
const a = /* @__PURE__ */ e.jsx(
|
|
295
|
+
const a = /* @__PURE__ */ e.jsx(v, { variant: i, children: "Create API Key" });
|
|
271
296
|
return /* @__PURE__ */ e.jsxs(V, { open: r, onOpenChange: s, children: [
|
|
272
297
|
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: n ?? a }),
|
|
273
298
|
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
274
299
|
/* @__PURE__ */ e.jsx(U, { children: /* @__PURE__ */ e.jsx(W, { children: "Create API Key" }) }),
|
|
275
|
-
/* @__PURE__ */ e.jsx(
|
|
300
|
+
/* @__PURE__ */ e.jsx(rt, { service: t, onOpenChange: s })
|
|
276
301
|
] })
|
|
277
302
|
] });
|
|
278
|
-
},
|
|
279
|
-
const r =
|
|
303
|
+
}, ot = ({ service: t }) => {
|
|
304
|
+
const r = ne(), s = ie(), [n, i] = E(
|
|
280
305
|
null
|
|
281
|
-
), [a, l] =
|
|
306
|
+
), [a, l] = E(""), { data: u, isFetching: f } = be({
|
|
282
307
|
queryFn: () => t.getConsumers(r),
|
|
283
308
|
queryKey: ["api-keys"],
|
|
284
309
|
retry: !1
|
|
285
|
-
}), [d,
|
|
310
|
+
}), [d, y] = E(!1), h = O({
|
|
286
311
|
mutationFn: ({
|
|
287
312
|
consumerId: o,
|
|
288
313
|
keyId: c
|
|
@@ -293,21 +318,21 @@ const st = ({
|
|
|
293
318
|
},
|
|
294
319
|
onMutate: async ({ consumerId: o, keyId: c }) => {
|
|
295
320
|
await s.cancelQueries({ queryKey: ["api-keys"] });
|
|
296
|
-
const
|
|
321
|
+
const j = s.getQueryData([
|
|
297
322
|
"api-keys"
|
|
298
323
|
]);
|
|
299
|
-
return s.setQueryData(["api-keys"], (
|
|
300
|
-
...
|
|
301
|
-
apiKeys:
|
|
302
|
-
} :
|
|
324
|
+
return s.setQueryData(["api-keys"], (w) => w && w.map((k) => k.id === o ? {
|
|
325
|
+
...k,
|
|
326
|
+
apiKeys: k.apiKeys.filter((C) => C.id !== c)
|
|
327
|
+
} : k)), { previousData: j };
|
|
303
328
|
},
|
|
304
|
-
onError: (o, c,
|
|
305
|
-
|
|
329
|
+
onError: (o, c, j) => {
|
|
330
|
+
j?.previousData && s.setQueryData(["api-keys"], j.previousData);
|
|
306
331
|
},
|
|
307
332
|
onSuccess: () => {
|
|
308
333
|
s.invalidateQueries({ queryKey: ["api-keys"] });
|
|
309
334
|
}
|
|
310
|
-
}),
|
|
335
|
+
}), x = O({
|
|
311
336
|
mutationFn: ({
|
|
312
337
|
consumerId: o,
|
|
313
338
|
label: c
|
|
@@ -318,14 +343,14 @@ const st = ({
|
|
|
318
343
|
},
|
|
319
344
|
onMutate: async ({ consumerId: o, label: c }) => {
|
|
320
345
|
await s.cancelQueries({ queryKey: ["api-keys"] });
|
|
321
|
-
const
|
|
322
|
-
return s.setQueryData(["api-keys"], (
|
|
323
|
-
...
|
|
346
|
+
const j = s.getQueryData(["api-keys"]);
|
|
347
|
+
return s.setQueryData(["api-keys"], (w) => w && w.map((k) => k.id === o ? {
|
|
348
|
+
...k,
|
|
324
349
|
label: c
|
|
325
|
-
} :
|
|
350
|
+
} : k)), { previousData: j };
|
|
326
351
|
},
|
|
327
|
-
onError: (o, c,
|
|
328
|
-
|
|
352
|
+
onError: (o, c, j) => {
|
|
353
|
+
j?.previousData && s.setQueryData(["api-keys"], j.previousData);
|
|
329
354
|
},
|
|
330
355
|
onSuccess: () => {
|
|
331
356
|
s.invalidateQueries({ queryKey: ["api-keys"] });
|
|
@@ -337,14 +362,14 @@ const st = ({
|
|
|
337
362
|
return t.rollKey(o, r);
|
|
338
363
|
},
|
|
339
364
|
onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
|
|
340
|
-
}),
|
|
365
|
+
}), b = (o, c) => {
|
|
341
366
|
i(o), l(c);
|
|
342
|
-
},
|
|
343
|
-
a.trim() &&
|
|
367
|
+
}, m = (o) => {
|
|
368
|
+
a.trim() && x.mutate({
|
|
344
369
|
consumerId: o,
|
|
345
370
|
label: a.trim()
|
|
346
371
|
}), i(null), l("");
|
|
347
|
-
},
|
|
372
|
+
}, N = () => {
|
|
348
373
|
i(null), l("");
|
|
349
374
|
};
|
|
350
375
|
return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-md h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
|
|
@@ -352,11 +377,11 @@ const st = ({
|
|
|
352
377
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
|
|
353
378
|
/* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
|
|
354
379
|
t.createKey && /* @__PURE__ */ e.jsx(
|
|
355
|
-
|
|
380
|
+
se,
|
|
356
381
|
{
|
|
357
382
|
service: t,
|
|
358
383
|
isOpen: d,
|
|
359
|
-
onOpenChange:
|
|
384
|
+
onOpenChange: y
|
|
360
385
|
}
|
|
361
386
|
)
|
|
362
387
|
] }),
|
|
@@ -364,16 +389,16 @@ const st = ({
|
|
|
364
389
|
/* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page-before-keys" }),
|
|
365
390
|
/* @__PURE__ */ e.jsx("div", { className: "h-8" }),
|
|
366
391
|
p.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
367
|
-
/* @__PURE__ */ e.jsx(
|
|
392
|
+
/* @__PURE__ */ e.jsx(F, { size: 16 }),
|
|
368
393
|
/* @__PURE__ */ e.jsx(q, { children: p.error.message })
|
|
369
394
|
] }),
|
|
370
|
-
|
|
371
|
-
/* @__PURE__ */ e.jsx(
|
|
372
|
-
/* @__PURE__ */ e.jsx(q, { children:
|
|
395
|
+
x.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
396
|
+
/* @__PURE__ */ e.jsx(F, { size: 16 }),
|
|
397
|
+
/* @__PURE__ */ e.jsx(q, { children: x.error.message })
|
|
373
398
|
] }),
|
|
374
|
-
|
|
375
|
-
/* @__PURE__ */ e.jsx(
|
|
376
|
-
/* @__PURE__ */ e.jsx(q, { children:
|
|
399
|
+
h.isError && /* @__PURE__ */ e.jsxs(M, { variant: "destructive", className: "mb-4", children: [
|
|
400
|
+
/* @__PURE__ */ e.jsx(F, { size: 16 }),
|
|
401
|
+
/* @__PURE__ */ e.jsx(q, { children: h.error.message })
|
|
377
402
|
] }),
|
|
378
403
|
/* @__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: [
|
|
379
404
|
/* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
|
|
@@ -382,36 +407,36 @@ const st = ({
|
|
|
382
407
|
t.createKey && "Get started and create your first key."
|
|
383
408
|
] }),
|
|
384
409
|
t.createKey && /* @__PURE__ */ e.jsx(
|
|
385
|
-
|
|
410
|
+
se,
|
|
386
411
|
{
|
|
387
412
|
service: t,
|
|
388
413
|
isOpen: d,
|
|
389
|
-
onOpenChange:
|
|
414
|
+
onOpenChange: y
|
|
390
415
|
}
|
|
391
416
|
)
|
|
392
417
|
] }) : /* @__PURE__ */ e.jsx(
|
|
393
418
|
"ul",
|
|
394
419
|
{
|
|
395
|
-
className:
|
|
420
|
+
className: P(
|
|
396
421
|
"grid grid-cols-[1fr_min-content] divide-y divide-border col-span-6"
|
|
397
422
|
),
|
|
398
423
|
children: u.map((o) => /* @__PURE__ */ e.jsxs(
|
|
399
|
-
|
|
424
|
+
$e,
|
|
400
425
|
{
|
|
401
426
|
className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
|
|
402
427
|
children: [
|
|
403
|
-
/* @__PURE__ */ e.jsxs(
|
|
428
|
+
/* @__PURE__ */ e.jsxs(ze, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
|
|
404
429
|
/* @__PURE__ */ e.jsxs("div", { className: "h-10 flex flex-col text-sm justify-center", children: [
|
|
405
430
|
/* @__PURE__ */ e.jsxs("div", { className: "font-medium text-lg flex items-center gap-2", children: [
|
|
406
431
|
n === o.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
|
|
407
432
|
/* @__PURE__ */ e.jsx(
|
|
408
|
-
|
|
433
|
+
oe,
|
|
409
434
|
{
|
|
410
435
|
maxLength: 32,
|
|
411
436
|
value: a,
|
|
412
437
|
onChange: (c) => l(c.target.value),
|
|
413
438
|
onKeyDown: (c) => {
|
|
414
|
-
c.key === "Enter" ?
|
|
439
|
+
c.key === "Enter" ? m(o.id) : c.key === "Escape" && N();
|
|
415
440
|
},
|
|
416
441
|
className: "text-lg font-medium",
|
|
417
442
|
autoFocus: !0
|
|
@@ -419,21 +444,21 @@ const st = ({
|
|
|
419
444
|
),
|
|
420
445
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
421
446
|
/* @__PURE__ */ e.jsx(
|
|
422
|
-
|
|
447
|
+
v,
|
|
423
448
|
{
|
|
424
449
|
size: "icon",
|
|
425
450
|
variant: "ghost",
|
|
426
|
-
onClick: () =>
|
|
451
|
+
onClick: () => m(o.id),
|
|
427
452
|
disabled: !a.trim(),
|
|
428
|
-
children: /* @__PURE__ */ e.jsx(
|
|
453
|
+
children: /* @__PURE__ */ e.jsx(fe, { size: 16 })
|
|
429
454
|
}
|
|
430
455
|
),
|
|
431
456
|
/* @__PURE__ */ e.jsx(
|
|
432
|
-
|
|
457
|
+
v,
|
|
433
458
|
{
|
|
434
459
|
size: "icon",
|
|
435
460
|
variant: "ghost",
|
|
436
|
-
onClick:
|
|
461
|
+
onClick: N,
|
|
437
462
|
children: /* @__PURE__ */ e.jsx(he, { size: 16 })
|
|
438
463
|
}
|
|
439
464
|
)
|
|
@@ -456,24 +481,24 @@ const st = ({
|
|
|
456
481
|
] }),
|
|
457
482
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
|
|
458
483
|
t.updateConsumer && /* @__PURE__ */ e.jsxs(
|
|
459
|
-
|
|
484
|
+
v,
|
|
460
485
|
{
|
|
461
486
|
variant: "ghost",
|
|
462
|
-
onClick: () =>
|
|
463
|
-
className:
|
|
487
|
+
onClick: () => b(o.id, o.label),
|
|
488
|
+
className: P(
|
|
464
489
|
"flex gap-2",
|
|
465
490
|
n === o.id && "opacity-0! pointer-events-none"
|
|
466
491
|
),
|
|
467
492
|
disabled: n === o.id,
|
|
468
493
|
children: [
|
|
469
|
-
/* @__PURE__ */ e.jsx(
|
|
494
|
+
/* @__PURE__ */ e.jsx(pe, { size: 16 }),
|
|
470
495
|
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
|
|
471
496
|
]
|
|
472
497
|
}
|
|
473
498
|
),
|
|
474
499
|
t.rollKey && /* @__PURE__ */ e.jsxs(V, { children: [
|
|
475
500
|
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
476
|
-
|
|
501
|
+
v,
|
|
477
502
|
{
|
|
478
503
|
title: "Roll this key",
|
|
479
504
|
variant: "ghost",
|
|
@@ -481,7 +506,7 @@ const st = ({
|
|
|
481
506
|
className: "flex items-center gap-2",
|
|
482
507
|
children: [
|
|
483
508
|
/* @__PURE__ */ e.jsx(
|
|
484
|
-
|
|
509
|
+
me,
|
|
485
510
|
{
|
|
486
511
|
size: 16,
|
|
487
512
|
className: p.isPending ? "animate-spin" : void 0
|
|
@@ -494,12 +519,12 @@ const st = ({
|
|
|
494
519
|
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
495
520
|
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
496
521
|
/* @__PURE__ */ e.jsx(W, { children: "Roll API Key" }),
|
|
497
|
-
/* @__PURE__ */ e.jsx(
|
|
522
|
+
/* @__PURE__ */ e.jsx(ae, { children: "Are you sure you want to roll this API key?" })
|
|
498
523
|
] }),
|
|
499
524
|
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
500
|
-
/* @__PURE__ */ e.jsx(
|
|
501
|
-
/* @__PURE__ */ e.jsx(
|
|
502
|
-
|
|
525
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(v, { variant: "outline", children: "Cancel" }) }),
|
|
526
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
527
|
+
v,
|
|
503
528
|
{
|
|
504
529
|
onClick: () => {
|
|
505
530
|
p.mutate(o.id);
|
|
@@ -512,18 +537,18 @@ const st = ({
|
|
|
512
537
|
] })
|
|
513
538
|
] })
|
|
514
539
|
] }),
|
|
515
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(
|
|
540
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(it, { children: o.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(Pe.Fragment, { children: [
|
|
516
541
|
/* @__PURE__ */ e.jsx(
|
|
517
|
-
|
|
542
|
+
ct,
|
|
518
543
|
{
|
|
519
544
|
apiKey: c,
|
|
520
545
|
onDeleteKey: () => {
|
|
521
|
-
|
|
546
|
+
h.mutate({
|
|
522
547
|
consumerId: o.id,
|
|
523
548
|
keyId: c.id
|
|
524
549
|
});
|
|
525
550
|
},
|
|
526
|
-
className:
|
|
551
|
+
className: h.variables?.keyId === c.id && (h.isPending || f) ? "opacity-10!" : void 0
|
|
527
552
|
}
|
|
528
553
|
),
|
|
529
554
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
|
|
@@ -535,25 +560,25 @@ const st = ({
|
|
|
535
560
|
}
|
|
536
561
|
) })
|
|
537
562
|
] });
|
|
538
|
-
},
|
|
563
|
+
}, lt = (t) => {
|
|
539
564
|
const r = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((r.getTime() - s.getTime()) / 1e3), i = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
540
565
|
return n < 60 ? i.format(-n, "second") : n < 3600 ? i.format(-Math.floor(n / 60), "minute") : n < 86400 ? i.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? i.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? i.format(-Math.floor(n / 2592e3), "month") : i.format(-Math.floor(n / 31536e3), "year");
|
|
541
|
-
},
|
|
566
|
+
}, ct = ({
|
|
542
567
|
apiKey: t,
|
|
543
568
|
onDeleteKey: r,
|
|
544
569
|
className: s
|
|
545
570
|
}) => {
|
|
546
|
-
const [n, i] =
|
|
571
|
+
const [n, i] = E(!1), { key: a, createdOn: l, expiresOn: u } = t, f = u && new Date(u) < /* @__PURE__ */ new Date(), d = u ? Math.ceil(
|
|
547
572
|
(new Date(u).getTime() - Date.now()) / (1e3 * 60 * 60 * 24)
|
|
548
|
-
) : 1 / 0,
|
|
549
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
573
|
+
) : 1 / 0, y = d <= 7 && !f;
|
|
574
|
+
return /* @__PURE__ */ e.jsxs("div", { className: P("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
550
575
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
551
576
|
/* @__PURE__ */ e.jsx(
|
|
552
577
|
Ae,
|
|
553
578
|
{
|
|
554
579
|
className: "max-w-fit w-full",
|
|
555
580
|
secret: a,
|
|
556
|
-
status:
|
|
581
|
+
status: f ? "expired" : y ? "expiring" : "active",
|
|
557
582
|
revealed: n,
|
|
558
583
|
onReveal: i
|
|
559
584
|
}
|
|
@@ -561,18 +586,18 @@ const st = ({
|
|
|
561
586
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
|
|
562
587
|
l && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
563
588
|
"Created ",
|
|
564
|
-
|
|
589
|
+
lt(l),
|
|
565
590
|
"."
|
|
566
591
|
] }),
|
|
567
592
|
" ",
|
|
568
|
-
u &&
|
|
593
|
+
u && y && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
569
594
|
"Expires in ",
|
|
570
595
|
d,
|
|
571
596
|
" ",
|
|
572
597
|
d === 1 ? "day" : "days",
|
|
573
598
|
"."
|
|
574
599
|
] }),
|
|
575
|
-
u &&
|
|
600
|
+
u && f && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
576
601
|
"Expired",
|
|
577
602
|
" ",
|
|
578
603
|
d === 0 ? "today." : `${d * -1} days ago.`
|
|
@@ -580,16 +605,16 @@ const st = ({
|
|
|
580
605
|
] })
|
|
581
606
|
] }),
|
|
582
607
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: u && r && /* @__PURE__ */ e.jsxs(V, { children: [
|
|
583
|
-
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
608
|
+
/* @__PURE__ */ e.jsx(G, { asChild: !0, children: /* @__PURE__ */ e.jsx(v, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(xe, { size: 16 }) }) }),
|
|
584
609
|
/* @__PURE__ */ e.jsxs(J, { children: [
|
|
585
610
|
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
586
611
|
/* @__PURE__ */ e.jsx(W, { children: "Delete API Key" }),
|
|
587
|
-
/* @__PURE__ */ e.jsx(
|
|
612
|
+
/* @__PURE__ */ e.jsx(ae, { children: "Are you sure you want to delete this API key?" })
|
|
588
613
|
] }),
|
|
589
614
|
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
590
|
-
/* @__PURE__ */ e.jsx(
|
|
591
|
-
/* @__PURE__ */ e.jsx(
|
|
592
|
-
|
|
615
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(v, { variant: "outline", children: "Cancel" }) }),
|
|
616
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
617
|
+
v,
|
|
593
618
|
{
|
|
594
619
|
onClick: () => {
|
|
595
620
|
r();
|
|
@@ -601,7 +626,7 @@ const st = ({
|
|
|
601
626
|
] })
|
|
602
627
|
] }) })
|
|
603
628
|
] });
|
|
604
|
-
}, S = "https://api.zuploedge.com/v2/client",
|
|
629
|
+
}, S = "https://api.zuploedge.com/v2/client", dt = async (t) => {
|
|
605
630
|
try {
|
|
606
631
|
return await t.json();
|
|
607
632
|
} catch {
|
|
@@ -610,11 +635,11 @@ const st = ({
|
|
|
610
635
|
}, T = async (t) => {
|
|
611
636
|
const r = t.headers.get("content-type");
|
|
612
637
|
if (!t.ok && r?.includes("application/problem+json")) {
|
|
613
|
-
const s = await
|
|
638
|
+
const s = await dt(t);
|
|
614
639
|
if (s.type && s.title)
|
|
615
640
|
throw new Error(s.detail ?? s.title);
|
|
616
641
|
}
|
|
617
|
-
},
|
|
642
|
+
}, ut = (t, r) => ({
|
|
618
643
|
deleteKey: async (s, n, i) => {
|
|
619
644
|
const a = new Request(
|
|
620
645
|
S + `/${t}/consumers/${s}/keys/${n}`,
|
|
@@ -676,15 +701,15 @@ const st = ({
|
|
|
676
701
|
}));
|
|
677
702
|
},
|
|
678
703
|
...r
|
|
679
|
-
}),
|
|
680
|
-
const r = "deploymentName" in t ?
|
|
704
|
+
}), Rt = (t) => t, St = (t) => {
|
|
705
|
+
const r = "deploymentName" in t ? ut(t.deploymentName, t) : t;
|
|
681
706
|
return {
|
|
682
707
|
getProfileMenuItems: () => [
|
|
683
708
|
{
|
|
684
709
|
label: "API Keys",
|
|
685
710
|
path: "/settings/api-keys",
|
|
686
711
|
category: "middle",
|
|
687
|
-
icon:
|
|
712
|
+
icon: ye
|
|
688
713
|
}
|
|
689
714
|
],
|
|
690
715
|
getIdentities: async (s) => {
|
|
@@ -703,12 +728,12 @@ const st = ({
|
|
|
703
728
|
},
|
|
704
729
|
getRoutes: () => [
|
|
705
730
|
{
|
|
706
|
-
element: /* @__PURE__ */ e.jsx(
|
|
707
|
-
errorElement: /* @__PURE__ */ e.jsx(
|
|
731
|
+
element: /* @__PURE__ */ e.jsx(Be, {}),
|
|
732
|
+
errorElement: /* @__PURE__ */ e.jsx(ge, {}),
|
|
708
733
|
children: [
|
|
709
734
|
{
|
|
710
735
|
path: "/settings/api-keys",
|
|
711
|
-
element: /* @__PURE__ */ e.jsx(
|
|
736
|
+
element: /* @__PURE__ */ e.jsx(ot, { service: r })
|
|
712
737
|
}
|
|
713
738
|
]
|
|
714
739
|
}
|
|
@@ -716,7 +741,7 @@ const st = ({
|
|
|
716
741
|
};
|
|
717
742
|
};
|
|
718
743
|
export {
|
|
719
|
-
|
|
720
|
-
|
|
744
|
+
St as apiKeyPlugin,
|
|
745
|
+
Rt as createApiKeyService
|
|
721
746
|
};
|
|
722
747
|
//# sourceMappingURL=zudoku.plugin-api-keys.js.map
|