zudoku 0.0.0-z6bcd96da → 0.0.0-z6e949a6d
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/config/loader.js +3 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +170 -120
- package/dist/config/validators/InputNavigationSchema.js +17 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/NavigationSchema.d.ts +10 -2
- package/dist/config/validators/NavigationSchema.js +6 -0
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +7 -7
- package/dist/flat-config.d.ts +35 -24
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/MobileTopNavigation.js +2 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +7 -1
- package/dist/lib/components/TopNavigation.js +7 -2
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +8 -1
- package/dist/lib/components/context/ZudokuContext.js +2 -0
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +18 -74
- package/dist/lib/components/index.js +19 -36
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Navigation.js +4 -3
- package/dist/lib/components/navigation/Navigation.js.map +1 -1
- package/dist/lib/components/navigation/NavigationCategory.js +8 -0
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/NavigationFilterContext.d.ts +8 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js +12 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js.map +1 -0
- package/dist/lib/components/navigation/NavigationFilterInput.d.ts +3 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js +9 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js.map +1 -0
- package/dist/lib/components/navigation/NavigationItem.js +11 -1
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +2 -1
- package/dist/lib/components/navigation/utils.js +22 -1
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +11 -1
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/core/transform-config.d.ts +2 -0
- package/dist/lib/core/transform-config.js +22 -0
- package/dist/lib/core/transform-config.js.map +1 -0
- package/dist/lib/hooks/index.d.ts +7 -30
- package/dist/lib/hooks/index.js +7 -15
- package/dist/lib/hooks/index.js.map +1 -1
- package/dist/lib/oas/graphql/circular.d.ts +1 -1
- package/dist/lib/oas/graphql/circular.js +18 -35
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/graphql/circular.test.js +33 -2
- package/dist/lib/oas/graphql/circular.test.js.map +1 -1
- package/dist/lib/oas/parser/index.js +14 -5
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/fileUtils.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js +3 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js +20 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +7 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +3 -3
- package/dist/lib/ui/InputGroup.d.ts +16 -0
- package/dist/lib/ui/InputGroup.js +65 -0
- package/dist/lib/ui/InputGroup.js.map +1 -0
- package/dist/lib/util/flattenAllOf.d.ts +0 -2
- package/dist/lib/util/flattenAllOf.js +0 -46
- package/dist/lib/util/flattenAllOf.js.map +1 -1
- package/dist/lib/util/flattenAllOf.test.js +2 -1
- package/dist/lib/util/flattenAllOf.test.js.map +1 -1
- package/dist/lib/util/flattenAllOfProcessor.d.ts +2 -0
- package/dist/lib/util/flattenAllOfProcessor.js +48 -0
- package/dist/lib/util/flattenAllOfProcessor.js.map +1 -0
- package/dist/lib/util/readFrontmatter.js +2 -1
- package/dist/lib/util/readFrontmatter.js.map +1 -1
- package/dist/vite/api/SchemaManager.js +1 -1
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +1 -1
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/build.js +91 -73
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/mdx/remark-inject-filepath.js +5 -1
- package/dist/vite/mdx/remark-inject-filepath.js.map +1 -1
- package/dist/vite/mdx/remark-link-rewrite.js +3 -2
- package/dist/vite/mdx/remark-link-rewrite.js.map +1 -1
- package/dist/vite/plugin-docs.js +9 -7
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +4 -2
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/lib/{ClaudeLogo-DJ9bU-sO.js → ClaudeLogo-OpUSMQJe.js} +26 -22
- package/lib/{ClaudeLogo-DJ9bU-sO.js.map → ClaudeLogo-OpUSMQJe.js.map} +1 -1
- package/lib/{MdxPage-stpAoBtx.js → MdxPage-dzCPGdvD.js} +8 -8
- package/lib/{MdxPage-stpAoBtx.js.map → MdxPage-dzCPGdvD.js.map} +1 -1
- package/lib/{Mermaid-Koc3z8mU.js → Mermaid-JEnWyK0s.js} +3 -2
- package/lib/{Mermaid-Koc3z8mU.js.map → Mermaid-JEnWyK0s.js.map} +1 -1
- package/lib/{OAuthErrorPage-DJ811Bn_.js → OAuthErrorPage-D7n-_cqN.js} +20 -18
- package/lib/{OAuthErrorPage-DJ811Bn_.js.map → OAuthErrorPage-D7n-_cqN.js.map} +1 -1
- package/lib/{OasProvider-CS_ASmBB.js → OasProvider-DPPdikt_.js} +3 -3
- package/lib/{OasProvider-CS_ASmBB.js.map → OasProvider-DPPdikt_.js.map} +1 -1
- package/lib/{OperationList-Dq_AB4W9.js → OperationList-cEveQ_l5.js} +948 -946
- package/lib/OperationList-cEveQ_l5.js.map +1 -0
- package/lib/{RouteGuard--A04ESy8.js → RouteGuard-BMbu_Yb7.js} +5 -5
- package/lib/{RouteGuard--A04ESy8.js.map → RouteGuard-BMbu_Yb7.js.map} +1 -1
- package/lib/{SchemaList-BJZJv1gD.js → SchemaList-CRC8n5co.js} +7 -7
- package/lib/{SchemaList-BJZJv1gD.js.map → SchemaList-CRC8n5co.js.map} +1 -1
- package/lib/{SchemaView-U4JMYB3N.js → SchemaView-BR6dtnPg.js} +3 -3
- package/lib/{SchemaView-U4JMYB3N.js.map → SchemaView-BR6dtnPg.js.map} +1 -1
- package/lib/{SignUp-DCBViNUi.js → SignUp-ChqXj9vd.js} +31 -26
- package/lib/{SignUp-DCBViNUi.js.map → SignUp-ChqXj9vd.js.map} +1 -1
- package/lib/{SyntaxHighlight-Dshjn3Zf.js → SyntaxHighlight-O-IZOPLg.js} +3 -3
- package/lib/{SyntaxHighlight-Dshjn3Zf.js.map → SyntaxHighlight-O-IZOPLg.js.map} +1 -1
- package/lib/{Toc-Cgz6CPiE.js → Toc-DQF7trHT.js} +2 -2
- package/lib/{Toc-Cgz6CPiE.js.map → Toc-DQF7trHT.js.map} +1 -1
- package/lib/{index-CL8eDnQW.js → Zudoku-DA1yA-te.js} +2609 -2452
- package/lib/Zudoku-DA1yA-te.js.map +1 -0
- package/lib/{ZudokuContext-BZB1TWdT.js → ZudokuContext-C6wlLMUH.js} +137 -135
- package/lib/{ZudokuContext-BZB1TWdT.js.map → ZudokuContext-C6wlLMUH.js.map} +1 -1
- package/lib/{circular-BmMJjG1v.js → circular-C4l1Kj1N.js} +1327 -1346
- package/lib/{circular-BmMJjG1v.js.map → circular-C4l1Kj1N.js.map} +1 -1
- package/lib/createServer-DoRZ6tMa.js +13036 -0
- package/lib/createServer-DoRZ6tMa.js.map +1 -0
- package/lib/{errors-b9I-fAOY.js → errors-CYLN8SNc.js} +3 -3
- package/lib/{errors-b9I-fAOY.js.map → errors-CYLN8SNc.js.map} +1 -1
- package/lib/{firebase-BCXX7Qv5.js → firebase-DF-VVKB7.js} +14 -14
- package/lib/firebase-DF-VVKB7.js.map +1 -0
- package/lib/{hook-BGlHBdET.js → hook-C35h0YhF.js} +2 -2
- package/lib/{hook-BGlHBdET.js.map → hook-C35h0YhF.js.map} +1 -1
- package/lib/{index-O9RHI87z.js → index-Ck4TmzTO.js} +574 -538
- package/lib/index-Ck4TmzTO.js.map +1 -0
- package/lib/index-DAWHN3cH.js +86 -0
- package/lib/index-DAWHN3cH.js.map +1 -0
- package/lib/{index-UOLtazB8.js → index-DrAVvbXa.js} +2 -2
- package/lib/{index-UOLtazB8.js.map → index-DrAVvbXa.js.map} +1 -1
- package/lib/{index.esm-C5CBsVzN.js → index.esm-B2cLXwjS.js} +2 -2
- package/lib/index.esm-B2cLXwjS.js.map +1 -0
- package/lib/{index.esm-B_0dvNjB.js → index.esm-Ca5zvoff.js} +20 -20
- package/lib/{index.esm-B_0dvNjB.js.map → index.esm-Ca5zvoff.js.map} +1 -1
- package/lib/{invariant-BJAl77rw.js → invariant-B_t_F2s_.js} +3 -3
- package/lib/{invariant-BJAl77rw.js.map → invariant-B_t_F2s_.js.map} +1 -1
- package/lib/ui/InputGroup.js +155 -0
- package/lib/ui/InputGroup.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/useExposedProps-CzTDfXfq.js +30 -0
- package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
- package/lib/zudoku.__internal.js +1493 -1031
- package/lib/zudoku.__internal.js.map +1 -1
- 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-firebase.js +5 -5
- package/lib/zudoku.auth-openid.js +5 -5
- package/lib/zudoku.auth-supabase.js +4 -4
- package/lib/zudoku.components.js +31 -29
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +24 -11
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.mermaid.js +4 -3
- package/lib/zudoku.mermaid.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +36 -32
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +131 -130
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugin-search-pagefind.js +2 -2
- package/lib/zudoku.plugins.js +9 -8
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +6 -4
- package/src/lib/components/MobileTopNavigation.tsx +13 -8
- package/src/lib/components/TopNavigation.tsx +25 -7
- package/src/lib/components/context/ZudokuContext.ts +1 -0
- package/src/lib/components/index.ts +19 -39
- package/src/lib/components/navigation/Navigation.tsx +4 -3
- package/src/lib/components/navigation/NavigationCategory.tsx +9 -0
- package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -0
- package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -0
- package/src/lib/components/navigation/NavigationItem.tsx +17 -1
- package/src/lib/components/navigation/utils.ts +32 -1
- package/src/lib/core/plugins.ts +21 -1
- package/src/lib/core/transform-config.ts +29 -0
- package/src/lib/hooks/index.ts +7 -16
- package/src/lib/oas/graphql/circular.test.ts +37 -2
- package/src/lib/oas/graphql/circular.ts +25 -51
- package/src/lib/oas/parser/index.ts +17 -6
- package/src/lib/plugins/openapi/playground/fileUtils.ts +4 -0
- package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +33 -17
- package/src/lib/ui/InputGroup.tsx +168 -0
- package/src/lib/util/flattenAllOf.test.ts +2 -1
- package/src/lib/util/flattenAllOf.ts +0 -57
- package/src/lib/util/flattenAllOfProcessor.ts +58 -0
- package/src/lib/util/readFrontmatter.ts +2 -1
- package/src/zuplo/enrich-with-zuplo-mcp.ts +168 -0
- package/src/zuplo/enrich-with-zuplo.ts +254 -0
- package/src/zuplo/policy-types.ts +46 -0
- package/src/zuplo/with-zuplo-processors.ts +35 -0
- package/src/zuplo/with-zuplo.ts +14 -0
- package/lib/OperationList-Dq_AB4W9.js.map +0 -1
- package/lib/Separator-BXt1LYnm.js +0 -27
- package/lib/Separator-BXt1LYnm.js.map +0 -1
- package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js +0 -9
- package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +0 -1
- package/lib/createServer-CLSZ7hWJ.js +0 -16693
- package/lib/createServer-CLSZ7hWJ.js.map +0 -1
- package/lib/firebase-BCXX7Qv5.js.map +0 -1
- package/lib/index-CL8eDnQW.js.map +0 -1
- package/lib/index-DBjOT2H1.js +0 -133
- package/lib/index-DBjOT2H1.js.map +0 -1
- package/lib/index-O9RHI87z.js.map +0 -1
- package/lib/index.esm-C5CBsVzN.js.map +0 -1
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { TrashIcon as me, CircleSlashIcon as z, CheckIcon as xe, XIcon as ye, PencilLineIcon as ge, RefreshCwIcon as je, KeyRoundIcon as ve } from "lucide-react";
|
|
3
|
-
import { Z as M, i as E } from "./invariant-
|
|
3
|
+
import { Z as M, i as E } from "./invariant-B_t_F2s_.js";
|
|
4
4
|
import * as F from "react";
|
|
5
|
-
import { createContext as Q, useRef as A, useLayoutEffect as Ce, useEffect as
|
|
6
|
-
import { D as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { a as
|
|
5
|
+
import { createContext as Q, useRef as A, useLayoutEffect as Ce, useEffect as re, useId as H, useContext as V, useInsertionEffect as we, useMemo as L, useCallback as ke, Children as Ee, isValidElement as Ie, useState as I } from "react";
|
|
6
|
+
import { D as Ke, d as be, a as te, E as De } from "./Zudoku-DA1yA-te.js";
|
|
7
|
+
import { Button as _ } from "./ui/Button.js";
|
|
8
|
+
import { a as B } from "./ZudokuContext-C6wlLMUH.js";
|
|
9
|
+
import "./index-DAWHN3cH.js";
|
|
10
|
+
import { u as ae } from "./hook-C35h0YhF.js";
|
|
11
|
+
import { F as Pe, g as Ae, j as Se, h as Re, d as Ne, I as Oe, a as Te, b as qe, k as Me, c as Fe } from "./Frame-DKlOmSkU.js";
|
|
12
|
+
import { A as D, a as P, b as oe } from "./Mermaid-JEnWyK0s.js";
|
|
13
|
+
import { e as Z, f as S, D as G, g as J, a as Y, b as U, c as W, d as le } from "./Dialog-hlvmmQ_c.js";
|
|
14
|
+
import { a as ce, u as $e } from "./useSuspenseQuery-CSB_rVek.js";
|
|
13
15
|
import { u as q } from "./useMutation-CFMGlAMW.js";
|
|
14
|
-
import { a as
|
|
15
|
-
import { u as
|
|
16
|
-
import { A as
|
|
17
|
-
import { S as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { c as W } from "./cn-5-Gd1Dss.js";
|
|
16
|
+
import { a as ze } from "./index.esm-BYObtETB.js";
|
|
17
|
+
import { u as Le } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
18
|
+
import { A as Qe } from "./ActionButton-B0CXL1Lq.js";
|
|
19
|
+
import { S as He, a as Ve, b as _e, c as Be, d as Ze, e as se, f as Ge } from "./Secret-BDBqq4p3.js";
|
|
20
|
+
import { Input as Je } from "./ui/Input.js";
|
|
21
|
+
import { c as X } from "./cn-5-Gd1Dss.js";
|
|
21
22
|
import { B as k } from "./Button-GUVe7pmt.js";
|
|
22
|
-
import { I as
|
|
23
|
-
function
|
|
23
|
+
import { I as Ye } from "./Input-Cx-GeKoF.js";
|
|
24
|
+
function Ue({ error: t }) {
|
|
24
25
|
const a = t instanceof Error ? t.message : "Something went wrong", s = process.env.NODE_ENV === "development", n = t instanceof M ? t.developerHint : void 0, r = t instanceof M ? t.title : "Something went wrong", i = t instanceof Error ? t.stack : void 0, o = t instanceof Error ? t.cause : void 0, d = o instanceof Error ? String(o.stack) : i;
|
|
25
26
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
26
27
|
/* @__PURE__ */ e.jsxs(D, { variant: "destructive", children: [
|
|
27
28
|
/* @__PURE__ */ e.jsx(P, { children: r }),
|
|
28
|
-
/* @__PURE__ */ e.jsx(
|
|
29
|
+
/* @__PURE__ */ e.jsx(oe, { children: a })
|
|
29
30
|
] }),
|
|
30
|
-
s && n && /* @__PURE__ */ e.jsx(
|
|
31
|
+
s && n && /* @__PURE__ */ e.jsx(Ke, { className: "mb-4", children: n }),
|
|
31
32
|
s && d && /* @__PURE__ */ e.jsx(
|
|
32
|
-
|
|
33
|
+
be,
|
|
33
34
|
{
|
|
34
35
|
className: "max-h-[400px] [&>pre]:p-4",
|
|
35
36
|
language: "js",
|
|
@@ -38,19 +39,19 @@ function We({ error: t }) {
|
|
|
38
39
|
)
|
|
39
40
|
] });
|
|
40
41
|
}
|
|
41
|
-
const
|
|
42
|
+
const We = ({
|
|
42
43
|
service: t,
|
|
43
44
|
onOpenChange: a
|
|
44
45
|
}) => {
|
|
45
|
-
const s =
|
|
46
|
+
const s = B(), n = ce(), r = Le(), i = ze({
|
|
46
47
|
defaultValues: {
|
|
47
48
|
expiresOn: "30"
|
|
48
49
|
}
|
|
49
|
-
}), o =
|
|
50
|
+
}), o = ae(), d = q({
|
|
50
51
|
mutationFn: ({ description: c, expiresOn: u }) => {
|
|
51
52
|
if (!t.createKey)
|
|
52
53
|
throw new Error("createKey not implemented");
|
|
53
|
-
const p = u !== "never" ?
|
|
54
|
+
const p = u !== "never" ? Xe(Number(u)) : void 0;
|
|
54
55
|
return t.createKey({
|
|
55
56
|
apiKey: {
|
|
56
57
|
description: c || "Secret Key",
|
|
@@ -78,38 +79,38 @@ const Xe = ({
|
|
|
78
79
|
children: [
|
|
79
80
|
d.error && /* @__PURE__ */ e.jsxs(D, { variant: "destructive", className: "mb-4", children: [
|
|
80
81
|
/* @__PURE__ */ e.jsx(P, { children: "Error" }),
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
82
|
+
/* @__PURE__ */ e.jsx(oe, { children: d.error.message })
|
|
82
83
|
] }),
|
|
83
84
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
|
|
84
85
|
"Name",
|
|
85
|
-
/* @__PURE__ */ e.jsx(
|
|
86
|
+
/* @__PURE__ */ e.jsx(Je, { ...i.register("description") }),
|
|
86
87
|
"Expiration",
|
|
87
88
|
/* @__PURE__ */ e.jsxs(
|
|
88
|
-
|
|
89
|
+
He,
|
|
89
90
|
{
|
|
90
91
|
onValueChange: (c) => i.setValue("expiresOn", c),
|
|
91
92
|
defaultValue: i.getValues("expiresOn"),
|
|
92
93
|
children: [
|
|
93
|
-
/* @__PURE__ */ e.jsx(
|
|
94
|
-
/* @__PURE__ */ e.jsx(
|
|
95
|
-
[7, 30, 60, 90].map((c) => /* @__PURE__ */ e.jsxs(
|
|
94
|
+
/* @__PURE__ */ e.jsx(Ve, { children: /* @__PURE__ */ e.jsx(_e, {}) }),
|
|
95
|
+
/* @__PURE__ */ e.jsx(Be, { children: /* @__PURE__ */ e.jsxs(Ze, { children: [
|
|
96
|
+
[7, 30, 60, 90].map((c) => /* @__PURE__ */ e.jsxs(se, { value: String(c), children: [
|
|
96
97
|
c,
|
|
97
98
|
" days"
|
|
98
99
|
] }, c)),
|
|
99
|
-
/* @__PURE__ */ e.jsx(
|
|
100
|
+
/* @__PURE__ */ e.jsx(se, { value: "never", children: "Never" })
|
|
100
101
|
] }) })
|
|
101
102
|
]
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
|
-
/* @__PURE__ */ e.jsxs(
|
|
105
|
-
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
106
|
-
/* @__PURE__ */ e.jsx(
|
|
105
|
+
/* @__PURE__ */ e.jsxs(Z, { children: [
|
|
106
|
+
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(_, { variant: "outline", children: "Cancel" }) }),
|
|
107
|
+
/* @__PURE__ */ e.jsx(Qe, { isPending: d.isPending, children: "Generate Key" })
|
|
107
108
|
] })
|
|
108
109
|
] })
|
|
109
110
|
]
|
|
110
111
|
}
|
|
111
112
|
) : null;
|
|
112
|
-
},
|
|
113
|
+
}, Xe = (t) => {
|
|
113
114
|
const a = /* @__PURE__ */ new Date();
|
|
114
115
|
return a.setDate(a.getDate() + t), a.toISOString();
|
|
115
116
|
}, de = ({
|
|
@@ -119,60 +120,60 @@ const Xe = ({
|
|
|
119
120
|
trigger: n,
|
|
120
121
|
buttonVariant: r = "outline"
|
|
121
122
|
}) => {
|
|
122
|
-
const i = /* @__PURE__ */ e.jsx(
|
|
123
|
-
return /* @__PURE__ */ e.jsxs(
|
|
124
|
-
/* @__PURE__ */ e.jsx(
|
|
125
|
-
/* @__PURE__ */ e.jsxs(
|
|
126
|
-
/* @__PURE__ */ e.jsx(
|
|
127
|
-
/* @__PURE__ */ e.jsx(
|
|
123
|
+
const i = /* @__PURE__ */ e.jsx(_, { variant: r, children: "Create API Key" });
|
|
124
|
+
return /* @__PURE__ */ e.jsxs(G, { open: a, onOpenChange: s, children: [
|
|
125
|
+
/* @__PURE__ */ e.jsx(J, { asChild: !0, children: n ?? i }),
|
|
126
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
127
|
+
/* @__PURE__ */ e.jsx(U, { children: /* @__PURE__ */ e.jsx(W, { children: "Create API Key" }) }),
|
|
128
|
+
/* @__PURE__ */ e.jsx(We, { service: t, onOpenChange: s })
|
|
128
129
|
] })
|
|
129
130
|
] });
|
|
130
|
-
},
|
|
131
|
+
}, et = Q({});
|
|
131
132
|
function ue(t) {
|
|
132
133
|
const a = A(null);
|
|
133
134
|
return a.current === null && (a.current = t()), a.current;
|
|
134
135
|
}
|
|
135
|
-
const
|
|
136
|
-
function
|
|
136
|
+
const tt = typeof window < "u", st = tt ? Ce : re, fe = /* @__PURE__ */ Q(null);
|
|
137
|
+
function nt(t) {
|
|
137
138
|
return typeof t == "object" && t !== null;
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
-
return
|
|
140
|
+
function it(t) {
|
|
141
|
+
return nt(t) && "offsetHeight" in t;
|
|
141
142
|
}
|
|
142
|
-
const
|
|
143
|
+
const rt = Q({
|
|
143
144
|
transformPagePoint: (t) => t,
|
|
144
145
|
isStatic: !1,
|
|
145
146
|
reducedMotion: "never"
|
|
146
147
|
});
|
|
147
|
-
function
|
|
148
|
+
function ne(t, a) {
|
|
148
149
|
if (typeof t == "function")
|
|
149
150
|
return t(a);
|
|
150
151
|
t != null && (t.current = a);
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
+
function at(...t) {
|
|
153
154
|
return (a) => {
|
|
154
155
|
let s = !1;
|
|
155
156
|
const n = t.map((r) => {
|
|
156
|
-
const i =
|
|
157
|
+
const i = ne(r, a);
|
|
157
158
|
return !s && typeof i == "function" && (s = !0), i;
|
|
158
159
|
});
|
|
159
160
|
if (s)
|
|
160
161
|
return () => {
|
|
161
162
|
for (let r = 0; r < n.length; r++) {
|
|
162
163
|
const i = n[r];
|
|
163
|
-
typeof i == "function" ? i() :
|
|
164
|
+
typeof i == "function" ? i() : ne(t[r], null);
|
|
164
165
|
}
|
|
165
166
|
};
|
|
166
167
|
};
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
-
return F.useCallback(
|
|
169
|
+
function ot(...t) {
|
|
170
|
+
return F.useCallback(at(...t), t);
|
|
170
171
|
}
|
|
171
|
-
class
|
|
172
|
+
class lt extends F.Component {
|
|
172
173
|
getSnapshotBeforeUpdate(a) {
|
|
173
174
|
const s = this.props.childRef.current;
|
|
174
175
|
if (s && a.isPresent && !this.props.isPresent) {
|
|
175
|
-
const n = s.offsetParent, r =
|
|
176
|
+
const n = s.offsetParent, r = it(n) && n.offsetWidth || 0, i = this.props.sizeRef.current;
|
|
176
177
|
i.height = s.offsetHeight || 0, i.width = s.offsetWidth || 0, i.top = s.offsetTop, i.left = s.offsetLeft, i.right = r - i.width - i.left;
|
|
177
178
|
}
|
|
178
179
|
return null;
|
|
@@ -186,14 +187,14 @@ class ct extends F.Component {
|
|
|
186
187
|
return this.props.children;
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
function
|
|
190
|
+
function ct({ children: t, isPresent: a, anchorX: s, root: n }) {
|
|
190
191
|
const r = H(), i = A(null), o = A({
|
|
191
192
|
width: 0,
|
|
192
193
|
height: 0,
|
|
193
194
|
top: 0,
|
|
194
195
|
left: 0,
|
|
195
196
|
right: 0
|
|
196
|
-
}), { nonce: d } = V(
|
|
197
|
+
}), { nonce: d } = V(rt), c = ot(i, t?.ref);
|
|
197
198
|
return we(() => {
|
|
198
199
|
const { width: u, height: p, top: f, left: m, right: g } = o.current;
|
|
199
200
|
if (a || !i.current || !u || !p)
|
|
@@ -214,10 +215,10 @@ function dt({ children: t, isPresent: a, anchorX: s, root: n }) {
|
|
|
214
215
|
`), () => {
|
|
215
216
|
x.contains(l) && x.removeChild(l);
|
|
216
217
|
};
|
|
217
|
-
}, [a]), e.jsx(
|
|
218
|
+
}, [a]), e.jsx(lt, { isPresent: a, childRef: i, sizeRef: o, children: F.cloneElement(t, { ref: c }) });
|
|
218
219
|
}
|
|
219
|
-
const
|
|
220
|
-
const u = ue(
|
|
220
|
+
const dt = ({ children: t, initial: a, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: i, mode: o, anchorX: d, root: c }) => {
|
|
221
|
+
const u = ue(ut), p = H();
|
|
221
222
|
let f = !0, m = L(() => (f = !1, {
|
|
222
223
|
id: p,
|
|
223
224
|
initial: a,
|
|
@@ -236,17 +237,17 @@ const ut = ({ children: t, initial: a, isPresent: s, onExitComplete: n, custom:
|
|
|
236
237
|
u.forEach((g, j) => u.set(j, !1));
|
|
237
238
|
}, [s]), F.useEffect(() => {
|
|
238
239
|
!s && !u.size && n && n();
|
|
239
|
-
}, [s]), o === "popLayout" && (t = e.jsx(
|
|
240
|
+
}, [s]), o === "popLayout" && (t = e.jsx(ct, { isPresent: s, anchorX: d, root: c, children: t })), e.jsx(fe.Provider, { value: m, children: t });
|
|
240
241
|
};
|
|
241
|
-
function
|
|
242
|
+
function ut() {
|
|
242
243
|
return /* @__PURE__ */ new Map();
|
|
243
244
|
}
|
|
244
|
-
function
|
|
245
|
+
function ft(t = !0) {
|
|
245
246
|
const a = V(fe);
|
|
246
247
|
if (a === null)
|
|
247
248
|
return [!0, null];
|
|
248
249
|
const { isPresent: s, onExitComplete: n, register: r } = a, i = H();
|
|
249
|
-
|
|
250
|
+
re(() => {
|
|
250
251
|
if (t)
|
|
251
252
|
return r(i);
|
|
252
253
|
}, [t]);
|
|
@@ -254,46 +255,46 @@ function pt(t = !0) {
|
|
|
254
255
|
return !s && n ? [!1, o] : [!0];
|
|
255
256
|
}
|
|
256
257
|
const R = (t) => t.key || "";
|
|
257
|
-
function
|
|
258
|
+
function ie(t) {
|
|
258
259
|
const a = [];
|
|
259
260
|
return Ee.forEach(t, (s) => {
|
|
260
261
|
Ie(s) && a.push(s);
|
|
261
262
|
}), a;
|
|
262
263
|
}
|
|
263
|
-
const
|
|
264
|
-
const [u, p] =
|
|
265
|
-
|
|
264
|
+
const pt = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: i = "sync", propagate: o = !1, anchorX: d = "left", root: c }) => {
|
|
265
|
+
const [u, p] = ft(o), f = L(() => ie(t), [t]), m = o && !u ? [] : f.map(R), g = A(!0), j = A(f), l = ue(() => /* @__PURE__ */ new Map()), [x, v] = I(f), [h, C] = I(f);
|
|
266
|
+
st(() => {
|
|
266
267
|
g.current = !1, j.current = f;
|
|
267
268
|
for (let w = 0; w < h.length; w++) {
|
|
268
269
|
const y = R(h[w]);
|
|
269
270
|
m.includes(y) ? l.delete(y) : l.get(y) !== !0 && l.set(y, !1);
|
|
270
271
|
}
|
|
271
272
|
}, [h, m.length, m.join("-")]);
|
|
272
|
-
const
|
|
273
|
+
const b = [];
|
|
273
274
|
if (f !== x) {
|
|
274
275
|
let w = [...f];
|
|
275
276
|
for (let y = 0; y < h.length; y++) {
|
|
276
|
-
const
|
|
277
|
-
m.includes($) || (w.splice(y, 0,
|
|
277
|
+
const K = h[y], $ = R(K);
|
|
278
|
+
m.includes($) || (w.splice(y, 0, K), b.push(K));
|
|
278
279
|
}
|
|
279
|
-
return i === "wait" &&
|
|
280
|
+
return i === "wait" && b.length && (w = b), C(ie(w)), v(f), null;
|
|
280
281
|
}
|
|
281
282
|
process.env.NODE_ENV !== "production" && i === "wait" && h.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
|
|
282
|
-
const { forceRender: pe } = V(
|
|
283
|
+
const { forceRender: pe } = V(et);
|
|
283
284
|
return e.jsx(e.Fragment, { children: h.map((w) => {
|
|
284
|
-
const y = R(w),
|
|
285
|
+
const y = R(w), K = o && !u ? !1 : f === h || m.includes(y), $ = () => {
|
|
285
286
|
if (l.has(y))
|
|
286
287
|
l.set(y, !0);
|
|
287
288
|
else
|
|
288
289
|
return;
|
|
289
|
-
let
|
|
290
|
+
let ee = !0;
|
|
290
291
|
l.forEach((he) => {
|
|
291
|
-
he || (
|
|
292
|
-
}),
|
|
292
|
+
he || (ee = !1);
|
|
293
|
+
}), ee && (pe?.(), C(j.current), o && p?.(), n && n());
|
|
293
294
|
};
|
|
294
|
-
return e.jsx(
|
|
295
|
+
return e.jsx(dt, { isPresent: K, initial: !g.current || s ? void 0 : !1, custom: a, presenceAffectsLayout: r, mode: i, root: c, onExitComplete: K ? void 0 : $, anchorX: d, children: w }, y);
|
|
295
296
|
}) });
|
|
296
|
-
},
|
|
297
|
+
}, ht = ({
|
|
297
298
|
apiKey: t,
|
|
298
299
|
onDeleteKey: a,
|
|
299
300
|
className: s
|
|
@@ -301,10 +302,10 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
301
302
|
const [n, r] = I(!1), { key: i, createdOn: o, expiresOn: d } = t, c = d && new Date(d) < /* @__PURE__ */ new Date(), u = d ? Math.ceil(
|
|
302
303
|
(new Date(d).getTime() - Date.now()) / (1e3 * 60 * 60 * 24)
|
|
303
304
|
) : 1 / 0, p = u <= 7 && !c;
|
|
304
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
305
|
+
return /* @__PURE__ */ e.jsxs("div", { className: X("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
305
306
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
306
307
|
/* @__PURE__ */ e.jsx(
|
|
307
|
-
|
|
308
|
+
Ge,
|
|
308
309
|
{
|
|
309
310
|
className: "max-w-fit w-full",
|
|
310
311
|
secret: i,
|
|
@@ -316,7 +317,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
316
317
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
|
|
317
318
|
o && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
318
319
|
"Created ",
|
|
319
|
-
|
|
320
|
+
mt(o),
|
|
320
321
|
"."
|
|
321
322
|
] }),
|
|
322
323
|
" ",
|
|
@@ -334,14 +335,14 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
334
335
|
] })
|
|
335
336
|
] })
|
|
336
337
|
] }),
|
|
337
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && a && /* @__PURE__ */ e.jsxs(
|
|
338
|
-
/* @__PURE__ */ e.jsx(
|
|
339
|
-
/* @__PURE__ */ e.jsxs(
|
|
340
|
-
/* @__PURE__ */ e.jsxs(
|
|
341
|
-
/* @__PURE__ */ e.jsx(
|
|
342
|
-
/* @__PURE__ */ e.jsx(
|
|
338
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && a && /* @__PURE__ */ e.jsxs(G, { children: [
|
|
339
|
+
/* @__PURE__ */ e.jsx(J, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(me, { size: 16 }) }) }),
|
|
340
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
341
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
342
|
+
/* @__PURE__ */ e.jsx(W, { children: "Delete API Key" }),
|
|
343
|
+
/* @__PURE__ */ e.jsx(le, { children: "Are you sure you want to delete this API key?" })
|
|
343
344
|
] }),
|
|
344
|
-
/* @__PURE__ */ e.jsxs(
|
|
345
|
+
/* @__PURE__ */ e.jsxs(Z, { children: [
|
|
345
346
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", children: "Cancel" }) }),
|
|
346
347
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
347
348
|
k,
|
|
@@ -356,16 +357,16 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
356
357
|
] })
|
|
357
358
|
] }) })
|
|
358
359
|
] });
|
|
359
|
-
},
|
|
360
|
+
}, mt = (t) => {
|
|
360
361
|
const a = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((a.getTime() - s.getTime()) / 1e3), r = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
361
362
|
return n < 60 ? r.format(-n, "second") : n < 3600 ? r.format(-Math.floor(n / 60), "minute") : n < 86400 ? r.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? r.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? r.format(-Math.floor(n / 2592e3), "month") : r.format(-Math.floor(n / 31536e3), "year");
|
|
362
|
-
},
|
|
363
|
+
}, xt = ({
|
|
363
364
|
consumer: t,
|
|
364
365
|
onUpdate: a,
|
|
365
366
|
onRollKey: s,
|
|
366
367
|
onDeleteKey: n
|
|
367
368
|
}) => {
|
|
368
|
-
const [r, i] = I(!1), [o, d] = I(t.label), c = ce(), u =
|
|
369
|
+
const [r, i] = I(!1), [o, d] = I(t.label), c = ce(), u = B(), p = q({
|
|
369
370
|
mutationFn: async (l) => {
|
|
370
371
|
if (!s)
|
|
371
372
|
throw new Error("rollKey not implemented");
|
|
@@ -388,7 +389,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
388
389
|
]);
|
|
389
390
|
return c.setQueryData(["api-keys"], (h) => h && h.map((C) => C.id === l ? {
|
|
390
391
|
...C,
|
|
391
|
-
apiKeys: C.apiKeys.filter((
|
|
392
|
+
apiKeys: C.apiKeys.filter((b) => b.id !== x)
|
|
392
393
|
} : C)), { previousData: v };
|
|
393
394
|
},
|
|
394
395
|
onError: (l, x, v) => {
|
|
@@ -442,15 +443,15 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
442
443
|
/* @__PURE__ */ e.jsx(P, { children: f.error.message })
|
|
443
444
|
] }),
|
|
444
445
|
/* @__PURE__ */ e.jsxs(
|
|
445
|
-
|
|
446
|
+
Pe,
|
|
446
447
|
{
|
|
447
448
|
className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
|
|
448
449
|
children: [
|
|
449
|
-
/* @__PURE__ */ e.jsxs(
|
|
450
|
+
/* @__PURE__ */ e.jsxs(Ae, { className: "col-span-full flex-row items-start justify-between gap-4", children: [
|
|
450
451
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
451
452
|
r ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
452
453
|
/* @__PURE__ */ e.jsx(
|
|
453
|
-
|
|
454
|
+
Ye,
|
|
454
455
|
{
|
|
455
456
|
maxLength: 32,
|
|
456
457
|
value: o,
|
|
@@ -482,8 +483,8 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
482
483
|
}
|
|
483
484
|
)
|
|
484
485
|
] })
|
|
485
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
486
|
-
/* @__PURE__ */ e.jsxs(
|
|
486
|
+
] }) : /* @__PURE__ */ e.jsx(Se, { children: t.label }),
|
|
487
|
+
/* @__PURE__ */ e.jsxs(Re, { children: [
|
|
487
488
|
t.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
488
489
|
"Created on ",
|
|
489
490
|
new Date(t.createdOn).toLocaleDateString()
|
|
@@ -500,7 +501,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
500
501
|
{
|
|
501
502
|
variant: "ghost",
|
|
502
503
|
onClick: g,
|
|
503
|
-
className:
|
|
504
|
+
className: X(
|
|
504
505
|
"flex gap-2",
|
|
505
506
|
r && "opacity-0! pointer-events-none"
|
|
506
507
|
),
|
|
@@ -511,8 +512,8 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
511
512
|
]
|
|
512
513
|
}
|
|
513
514
|
),
|
|
514
|
-
s && /* @__PURE__ */ e.jsxs(
|
|
515
|
-
/* @__PURE__ */ e.jsx(
|
|
515
|
+
s && /* @__PURE__ */ e.jsxs(G, { children: [
|
|
516
|
+
/* @__PURE__ */ e.jsx(J, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
516
517
|
k,
|
|
517
518
|
{
|
|
518
519
|
title: "Roll this key",
|
|
@@ -531,12 +532,12 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
531
532
|
]
|
|
532
533
|
}
|
|
533
534
|
) }),
|
|
534
|
-
/* @__PURE__ */ e.jsxs(
|
|
535
|
-
/* @__PURE__ */ e.jsxs(
|
|
536
|
-
/* @__PURE__ */ e.jsx(
|
|
537
|
-
/* @__PURE__ */ e.jsx(
|
|
535
|
+
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
536
|
+
/* @__PURE__ */ e.jsxs(U, { children: [
|
|
537
|
+
/* @__PURE__ */ e.jsx(W, { children: "Roll API Key" }),
|
|
538
|
+
/* @__PURE__ */ e.jsx(le, { children: "Are you sure you want to roll this API key?" })
|
|
538
539
|
] }),
|
|
539
|
-
/* @__PURE__ */ e.jsxs(
|
|
540
|
+
/* @__PURE__ */ e.jsxs(Z, { children: [
|
|
540
541
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", children: "Cancel" }) }),
|
|
541
542
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
542
543
|
k,
|
|
@@ -552,8 +553,8 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
552
553
|
] })
|
|
553
554
|
] })
|
|
554
555
|
] }),
|
|
555
|
-
/* @__PURE__ */ e.jsx(
|
|
556
|
-
|
|
556
|
+
/* @__PURE__ */ e.jsx(Ne, { className: "p-0 grid grid-cols-subgrid col-span-full divide-y divide-border", children: /* @__PURE__ */ e.jsx(pt, { children: t.apiKeys.map((l) => /* @__PURE__ */ e.jsx(
|
|
557
|
+
ht,
|
|
557
558
|
{
|
|
558
559
|
apiKey: l,
|
|
559
560
|
onDeleteKey: () => {
|
|
@@ -571,8 +572,8 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
571
572
|
t.id
|
|
572
573
|
)
|
|
573
574
|
] });
|
|
574
|
-
},
|
|
575
|
-
const a =
|
|
575
|
+
}, yt = ({ service: t }) => {
|
|
576
|
+
const a = B(), { data: s } = $e({
|
|
576
577
|
queryFn: async () => {
|
|
577
578
|
try {
|
|
578
579
|
return await t.getConsumers(a);
|
|
@@ -601,8 +602,8 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
601
602
|
onOpenChange: r
|
|
602
603
|
}
|
|
603
604
|
)
|
|
604
|
-
] }) : /* @__PURE__ */ e.jsx("ul", { className:
|
|
605
|
-
|
|
605
|
+
] }) : /* @__PURE__ */ e.jsx("ul", { className: X("grid grid-cols-[1fr_min-content] col-span-6"), children: s.map((i) => /* @__PURE__ */ e.jsx(
|
|
606
|
+
xt,
|
|
606
607
|
{
|
|
607
608
|
consumer: i,
|
|
608
609
|
onUpdate: t.updateConsumer,
|
|
@@ -611,10 +612,10 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
611
612
|
},
|
|
612
613
|
i.id
|
|
613
614
|
)) }) });
|
|
614
|
-
},
|
|
615
|
-
const [a, s] = I(!1), n =
|
|
615
|
+
}, gt = ({ service: t }) => {
|
|
616
|
+
const [a, s] = I(!1), n = ae();
|
|
616
617
|
return /* @__PURE__ */ e.jsxs("div", { className: "max-w-3xl h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
|
|
617
|
-
/* @__PURE__ */ e.jsx(
|
|
618
|
+
/* @__PURE__ */ e.jsx(te.Target, { name: "api-keys-list-page" }),
|
|
618
619
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
|
|
619
620
|
/* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
|
|
620
621
|
t.createKey && /* @__PURE__ */ e.jsx(
|
|
@@ -627,22 +628,22 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
627
628
|
)
|
|
628
629
|
] }),
|
|
629
630
|
/* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
|
|
630
|
-
/* @__PURE__ */ e.jsx(
|
|
631
|
-
n.profile?.emailVerified === !1 ? /* @__PURE__ */ e.jsxs(
|
|
632
|
-
/* @__PURE__ */ e.jsxs(
|
|
633
|
-
/* @__PURE__ */ e.jsx(
|
|
634
|
-
/* @__PURE__ */ e.jsx(
|
|
631
|
+
/* @__PURE__ */ e.jsx(te.Target, { name: "api-keys-list-page-before-keys" }),
|
|
632
|
+
n.profile?.emailVerified === !1 ? /* @__PURE__ */ e.jsxs(Oe, { variant: "outline", children: [
|
|
633
|
+
/* @__PURE__ */ e.jsxs(Te, { children: [
|
|
634
|
+
/* @__PURE__ */ e.jsx(qe, { children: "Verified email required" }),
|
|
635
|
+
/* @__PURE__ */ e.jsx(Me, { children: "You need to verify your email to access API keys." })
|
|
635
636
|
] }),
|
|
636
|
-
/* @__PURE__ */ e.jsx(
|
|
637
|
+
/* @__PURE__ */ e.jsx(Fe, { children: /* @__PURE__ */ e.jsx(_, { onClick: () => n.requestEmailVerification(), children: "Verify email" }) })
|
|
637
638
|
] }) : /* @__PURE__ */ e.jsx(
|
|
638
|
-
|
|
639
|
+
De,
|
|
639
640
|
{
|
|
640
|
-
fallbackRender: ({ error: r }) => /* @__PURE__ */ e.jsx(
|
|
641
|
-
children: /* @__PURE__ */ e.jsx(
|
|
641
|
+
fallbackRender: ({ error: r }) => /* @__PURE__ */ e.jsx(Ue, { error: r }),
|
|
642
|
+
children: /* @__PURE__ */ e.jsx(yt, { service: t })
|
|
642
643
|
}
|
|
643
644
|
)
|
|
644
645
|
] });
|
|
645
|
-
}, N = "https://api.zuploedge.com/v2/client",
|
|
646
|
+
}, N = "https://api.zuploedge.com/v2/client", jt = async (t) => {
|
|
646
647
|
try {
|
|
647
648
|
return await t.json();
|
|
648
649
|
} catch {
|
|
@@ -651,14 +652,14 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
651
652
|
}, O = async (t) => {
|
|
652
653
|
const a = t.headers.get("content-type");
|
|
653
654
|
if (!t.ok && a?.includes("application/problem+json")) {
|
|
654
|
-
const s = await
|
|
655
|
+
const s = await jt(t);
|
|
655
656
|
if (s.type && s.title)
|
|
656
657
|
throw new Error(s.detail ?? s.title);
|
|
657
658
|
}
|
|
658
659
|
}, T = {
|
|
659
660
|
developerHint: "This project is not linked to a Zuplo deployment. Run `zuplo link` to get started with API Keys.",
|
|
660
661
|
title: "Not linked to a Zuplo deployment"
|
|
661
|
-
},
|
|
662
|
+
}, vt = ({
|
|
662
663
|
deploymentName: t,
|
|
663
664
|
...a
|
|
664
665
|
}) => ({
|
|
@@ -740,7 +741,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
740
741
|
a && !t && console.warn(
|
|
741
742
|
"This project is not linked to a Zuplo deployment. Run `zuplo link` to get started."
|
|
742
743
|
);
|
|
743
|
-
const n = a ?
|
|
744
|
+
const n = a ? vt({ deploymentName: t, ...s }) : s;
|
|
744
745
|
if (!n.getConsumers)
|
|
745
746
|
throw new Error("getConsumers is required when using the apiKeyPlugin");
|
|
746
747
|
const r = {
|
|
@@ -773,7 +774,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
773
774
|
getRoutes: () => [
|
|
774
775
|
{
|
|
775
776
|
path: "/settings/api-keys",
|
|
776
|
-
element: /* @__PURE__ */ e.jsx(
|
|
777
|
+
element: /* @__PURE__ */ e.jsx(gt, { service: r })
|
|
777
778
|
}
|
|
778
779
|
],
|
|
779
780
|
getProtectedRoutes: () => ["/settings/api-keys"]
|