zudoku 0.47.1 → 0.47.2
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/ZuploBuildConfig.d.ts +21 -21
- package/dist/app/ZuploBuildConfig.js +7 -7
- package/dist/app/ZuploBuildConfig.js.map +1 -1
- package/dist/app/entry.client.d.ts +0 -2
- package/dist/app/entry.client.js +0 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +0 -2
- package/dist/app/entry.server.js +0 -2
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/env.d.ts +7 -7
- package/dist/app/env.js +8 -0
- package/dist/app/env.js.map +1 -1
- package/dist/app/main.d.ts +1 -0
- package/dist/app/main.js +1 -0
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/validate.d.ts +199 -76
- package/dist/config/validators/validate.js +22 -11
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/auth/issuer.js +1 -1
- package/dist/lib/auth/issuer.js.map +1 -1
- package/dist/lib/auth/issuer.test.js +1 -1
- package/dist/lib/auth/issuer.test.js.map +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/components/Framed.d.ts +7 -0
- package/dist/lib/components/Framed.js +26 -0
- package/dist/lib/components/Framed.js.map +1 -0
- package/dist/lib/components/MobileTopNavigation.js +2 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +4 -4
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/ui/CodeBlock.js +1 -1
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +6 -0
- package/dist/lib/util/MdxComponents.js +4 -2
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/vite/css/plugin.js +11 -0
- package/dist/vite/css/plugin.js.map +1 -1
- package/dist/vite/plugin-mdx.js +4 -2
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-theme.d.ts +8 -0
- package/dist/vite/plugin-theme.js +223 -0
- package/dist/vite/plugin-theme.js.map +1 -0
- package/dist/vite/plugin-theme.test.d.ts +1 -0
- package/dist/vite/plugin-theme.test.js +270 -0
- package/dist/vite/plugin-theme.test.js.map +1 -0
- package/dist/vite/plugin.js +2 -4
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/shadcn-registry.d.ts +45 -0
- package/dist/vite/shadcn-registry.js +29 -0
- package/dist/vite/shadcn-registry.js.map +1 -0
- package/lib/Drawer-BzkOKwgC.js.map +1 -1
- package/lib/{Markdown-r4buN85T.js → Markdown-C5j8kKSX.js} +444 -404
- package/lib/Markdown-C5j8kKSX.js.map +1 -0
- package/lib/{MdxPage-DYKsTerz.js → MdxPage-CKTMf1cR.js} +3 -3
- package/lib/{MdxPage-DYKsTerz.js.map → MdxPage-CKTMf1cR.js.map} +1 -1
- package/lib/{OasProvider-8vNiLpIG.js → OasProvider-_GzmsbMg.js} +2 -2
- package/lib/{OasProvider-8vNiLpIG.js.map → OasProvider-_GzmsbMg.js.map} +1 -1
- package/lib/{OperationList-BCVHtZNK.js → OperationList-BJAKaG5p.js} +4 -4
- package/lib/{OperationList-BCVHtZNK.js.map → OperationList-BJAKaG5p.js.map} +1 -1
- package/lib/{SchemaList-1oJKvBxh.js → SchemaList-Dgc0A8x5.js} +5 -5
- package/lib/{SchemaList-1oJKvBxh.js.map → SchemaList-Dgc0A8x5.js.map} +1 -1
- package/lib/{SchemaView-CTqaB-79.js → SchemaView-DVx-jFN4.js} +13 -13
- package/lib/{SchemaView-CTqaB-79.js.map → SchemaView-DVx-jFN4.js.map} +1 -1
- package/lib/{Slot-B5qSAnwR.js → Slot-ITby_hMb.js} +2 -2
- package/lib/{Slot-B5qSAnwR.js.map → Slot-ITby_hMb.js.map} +1 -1
- package/lib/{Toc-lxYQEOzX.js → Toc-Csq3UNtW.js} +2 -2
- package/lib/{Toc-lxYQEOzX.js.map → Toc-Csq3UNtW.js.map} +1 -1
- package/lib/{circular-ZGGPtwMq.js → circular-BP4OrHFK.js} +2 -2
- package/lib/{circular-ZGGPtwMq.js.map → circular-BP4OrHFK.js.map} +1 -1
- package/lib/clerk-yAKDC3Qz.js.map +1 -1
- package/lib/{createServer-DUBpXfvA.js → createServer-zu4cDiPe.js} +3 -3
- package/lib/{createServer-DUBpXfvA.js.map → createServer-zu4cDiPe.js.map} +1 -1
- package/lib/{errors-D27ZTQgx.js → errors-CPPSp5F4.js} +8 -8
- package/lib/{errors-D27ZTQgx.js.map → errors-CPPSp5F4.js.map} +1 -1
- package/lib/hook-7wZANGJP.js.map +1 -1
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/index-QzXzw_ra.js.map +1 -1
- package/lib/{index-Cucjfk3D.js → index-jWXxqkni.js} +6 -6
- package/lib/{index-Cucjfk3D.js.map → index-jWXxqkni.js.map} +1 -1
- package/lib/ui/CodeBlock.js +7 -7
- package/lib/ui/CodeBlock.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +25 -24
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +1 -1
- package/lib/zudoku.plugin-api-keys.js +50 -42
- 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 +1 -1
- package/package.json +5 -5
- package/src/app/ZuploBuildConfig.ts +7 -7
- package/src/app/defaultTheme.css +68 -49
- package/src/app/entry.client.tsx +0 -2
- package/src/app/entry.server.tsx +0 -2
- package/src/app/env.ts +8 -0
- package/src/app/main.css +1 -52
- package/src/app/main.tsx +1 -0
- package/src/lib/auth/issuer.test.ts +1 -1
- package/src/lib/auth/issuer.ts +1 -1
- package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
- package/src/lib/components/Framed.tsx +51 -0
- package/src/lib/components/MobileTopNavigation.tsx +4 -0
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +11 -8
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
- package/src/lib/ui/CodeBlock.tsx +1 -1
- package/src/lib/util/MdxComponents.tsx +13 -2
- package/dist/vite/plugin-configure-tailwind.d.ts +0 -2
- package/dist/vite/plugin-configure-tailwind.js +0 -38
- package/dist/vite/plugin-configure-tailwind.js.map +0 -1
- package/dist/vite/plugin-theme-css.d.ts +0 -5
- package/dist/vite/plugin-theme-css.js +0 -77
- package/dist/vite/plugin-theme-css.js.map +0 -1
- package/lib/Markdown-r4buN85T.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { d as b, m as j } from "./chunk-DQRVZFIR-BblmKnHy.js";
|
|
|
4
4
|
import { u as x, d as y, j as m } from "./hook-7wZANGJP.js";
|
|
5
5
|
import { H as v } from "./index.esm-BFcSKCe-.js";
|
|
6
6
|
import { Link as N } from "./zudoku.components.js";
|
|
7
|
-
import { H as S, M as w } from "./Markdown-
|
|
7
|
+
import { H as S, M as w } from "./Markdown-C5j8kKSX.js";
|
|
8
8
|
const H = ({
|
|
9
9
|
items: r,
|
|
10
10
|
filterCatalogItems: o = (n) => n,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { CheckIcon as _, XIcon as se, PencilLineIcon as ne, RotateCwIcon as ie, EyeOffIcon as re, EyeIcon as ae, CopyIcon as oe, TrashIcon as le, KeyRoundIcon as de } from "lucide-react";
|
|
3
|
-
import { D as ce, S as O, R as ue } from "./Slot-
|
|
3
|
+
import { D as ce, S as O, R as ue } from "./Slot-ITby_hMb.js";
|
|
4
4
|
import { i as P } from "./invariant-DAFpPywt.js";
|
|
5
5
|
import { O as he, L as Q } from "./chunk-DQRVZFIR-BblmKnHy.js";
|
|
6
6
|
import { i as fe, k as pe, e as xe, d as me } from "./hook-7wZANGJP.js";
|
|
@@ -27,7 +27,7 @@ function Z(t) {
|
|
|
27
27
|
const i = D(null);
|
|
28
28
|
return i.current === null && (i.current = t()), i.current;
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const Ne = typeof window < "u", Ie = Ne ? ge : B, ee = /* @__PURE__ */ q(null);
|
|
31
31
|
function Ke(t) {
|
|
32
32
|
return typeof t == "object" && t !== null;
|
|
33
33
|
}
|
|
@@ -66,10 +66,10 @@ function ze({ children: t, isPresent: i, anchorX: s }) {
|
|
|
66
66
|
right: 0
|
|
67
67
|
}), { nonce: u } = $(Ae);
|
|
68
68
|
return je(() => {
|
|
69
|
-
const { width: m, height: h, top: x, left:
|
|
69
|
+
const { width: m, height: h, top: x, left: c, right: d } = r.current;
|
|
70
70
|
if (i || !o.current || !m || !h)
|
|
71
71
|
return;
|
|
72
|
-
const y = s === "left" ? `left: ${
|
|
72
|
+
const y = s === "left" ? `left: ${c}` : `right: ${d}`;
|
|
73
73
|
o.current.dataset.motionPopId = n;
|
|
74
74
|
const f = document.createElement("style");
|
|
75
75
|
return u && (f.nonce = u), document.head.appendChild(f), f.sheet && f.sheet.insertRule(`
|
|
@@ -87,7 +87,7 @@ function ze({ children: t, isPresent: i, anchorX: s }) {
|
|
|
87
87
|
}
|
|
88
88
|
const Me = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: r, mode: u, anchorX: m }) => {
|
|
89
89
|
const h = Z(Se), x = L();
|
|
90
|
-
let
|
|
90
|
+
let c = !0, d = M(() => (c = !1, {
|
|
91
91
|
id: x,
|
|
92
92
|
initial: i,
|
|
93
93
|
isPresent: s,
|
|
@@ -101,11 +101,11 @@ const Me = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom:
|
|
|
101
101
|
},
|
|
102
102
|
register: (y) => (h.set(y, !1), () => h.delete(y))
|
|
103
103
|
}), [s, h, n]);
|
|
104
|
-
return r &&
|
|
104
|
+
return r && c && (d = { ...d }), M(() => {
|
|
105
105
|
h.forEach((y, f) => h.set(f, !1));
|
|
106
106
|
}, [s]), S.useEffect(() => {
|
|
107
107
|
!s && !h.size && n && n();
|
|
108
|
-
}, [s]), u === "popLayout" && (t = e.jsx(ze, { isPresent: s, anchorX: m, children: t })), e.jsx(ee.Provider, { value:
|
|
108
|
+
}, [s]), u === "popLayout" && (t = e.jsx(ze, { isPresent: s, anchorX: m, children: t })), e.jsx(ee.Provider, { value: d, children: t });
|
|
109
109
|
};
|
|
110
110
|
function Se() {
|
|
111
111
|
return /* @__PURE__ */ new Map();
|
|
@@ -122,7 +122,7 @@ function qe(t = !0) {
|
|
|
122
122
|
const u = Ce(() => t && n && n(r), [r, n, t]);
|
|
123
123
|
return !s && n ? [!1, u] : [!0];
|
|
124
124
|
}
|
|
125
|
-
const
|
|
125
|
+
const N = (t) => t.key || "";
|
|
126
126
|
function H(t) {
|
|
127
127
|
const i = [];
|
|
128
128
|
return ve.forEach(t, (s) => {
|
|
@@ -130,27 +130,27 @@ function H(t) {
|
|
|
130
130
|
}), i;
|
|
131
131
|
}
|
|
132
132
|
const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: o = !0, mode: r = "sync", propagate: u = !1, anchorX: m = "left" }) => {
|
|
133
|
-
const [h, x] = qe(u),
|
|
134
|
-
|
|
135
|
-
y.current = !1, f.current =
|
|
133
|
+
const [h, x] = qe(u), c = M(() => H(t), [t]), d = u && !h ? [] : c.map(N), y = D(!0), f = D(c), k = Z(() => /* @__PURE__ */ new Map()), [a, l] = E(c), [p, v] = E(c);
|
|
134
|
+
Ie(() => {
|
|
135
|
+
y.current = !1, f.current = c;
|
|
136
136
|
for (let w = 0; w < p.length; w++) {
|
|
137
|
-
const g =
|
|
138
|
-
|
|
137
|
+
const g = N(p[w]);
|
|
138
|
+
d.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
|
|
139
139
|
}
|
|
140
|
-
}, [p,
|
|
140
|
+
}, [p, d.length, d.join("-")]);
|
|
141
141
|
const C = [];
|
|
142
|
-
if (
|
|
143
|
-
let w = [...
|
|
142
|
+
if (c !== a) {
|
|
143
|
+
let w = [...c];
|
|
144
144
|
for (let g = 0; g < p.length; g++) {
|
|
145
|
-
const b = p[g], T =
|
|
146
|
-
|
|
145
|
+
const b = p[g], T = N(b);
|
|
146
|
+
d.includes(T) || (w.splice(g, 0, b), C.push(b));
|
|
147
147
|
}
|
|
148
|
-
return r === "wait" && C.length && (w = C), v(H(w)), l(
|
|
148
|
+
return r === "wait" && C.length && (w = C), v(H(w)), l(c), null;
|
|
149
149
|
}
|
|
150
150
|
process.env.NODE_ENV !== "production" && r === "wait" && p.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.`);
|
|
151
151
|
const { forceRender: A } = $(Pe);
|
|
152
152
|
return e.jsx(e.Fragment, { children: p.map((w) => {
|
|
153
|
-
const g =
|
|
153
|
+
const g = N(w), b = u && !h ? !1 : c === p || d.includes(g), T = () => {
|
|
154
154
|
if (k.has(g))
|
|
155
155
|
k.set(g, !0);
|
|
156
156
|
else
|
|
@@ -194,7 +194,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
194
194
|
onSuccess: () => {
|
|
195
195
|
s.invalidateQueries({ queryKey: ["api-keys"] });
|
|
196
196
|
}
|
|
197
|
-
}),
|
|
197
|
+
}), c = z({
|
|
198
198
|
mutationFn: ({
|
|
199
199
|
consumerId: a,
|
|
200
200
|
label: l
|
|
@@ -217,7 +217,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
217
217
|
onSuccess: () => {
|
|
218
218
|
s.invalidateQueries({ queryKey: ["api-keys"] });
|
|
219
219
|
}
|
|
220
|
-
}),
|
|
220
|
+
}), d = z({
|
|
221
221
|
mutationFn: (a) => {
|
|
222
222
|
if (!t.rollKey)
|
|
223
223
|
throw new Error("rollKey not implemented");
|
|
@@ -227,7 +227,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
227
227
|
}), y = (a, l) => {
|
|
228
228
|
o(a), u(l);
|
|
229
229
|
}, f = (a) => {
|
|
230
|
-
r.trim() &&
|
|
230
|
+
r.trim() && c.mutate({
|
|
231
231
|
consumerId: a,
|
|
232
232
|
label: r.trim()
|
|
233
233
|
}), o(null), u("");
|
|
@@ -331,15 +331,23 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
331
331
|
}
|
|
332
332
|
),
|
|
333
333
|
t.rollKey && /* @__PURE__ */ e.jsxs(U, { children: [
|
|
334
|
-
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.
|
|
334
|
+
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
335
335
|
j,
|
|
336
336
|
{
|
|
337
|
-
size: "icon",
|
|
338
337
|
title: "Roll this key",
|
|
339
338
|
variant: "ghost",
|
|
340
|
-
disabled:
|
|
341
|
-
className:
|
|
342
|
-
children:
|
|
339
|
+
disabled: d.isPending,
|
|
340
|
+
className: "flex items-center gap-1",
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ e.jsx(
|
|
343
|
+
ie,
|
|
344
|
+
{
|
|
345
|
+
size: 16,
|
|
346
|
+
className: d.isPending ? "animate-spin" : void 0
|
|
347
|
+
}
|
|
348
|
+
),
|
|
349
|
+
"Roll"
|
|
350
|
+
]
|
|
343
351
|
}
|
|
344
352
|
) }),
|
|
345
353
|
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
@@ -353,7 +361,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
353
361
|
j,
|
|
354
362
|
{
|
|
355
363
|
onClick: () => {
|
|
356
|
-
|
|
364
|
+
d.mutate(a.id);
|
|
357
365
|
},
|
|
358
366
|
children: "Roll Key"
|
|
359
367
|
}
|
|
@@ -394,9 +402,9 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
394
402
|
onDeleteKey: i,
|
|
395
403
|
className: s
|
|
396
404
|
}) => {
|
|
397
|
-
const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn: h, expiresOn: x } = t,
|
|
405
|
+
const [n, o] = E(!1), [r, u] = E(!1), { key: m, createdOn: h, expiresOn: x } = t, c = x && new Date(x) < /* @__PURE__ */ new Date(), d = x ? Math.ceil(
|
|
398
406
|
(new Date(x).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
|
|
399
|
-
) : 1 / 0, y =
|
|
407
|
+
) : 1 / 0, y = d <= 7 && !c;
|
|
400
408
|
return /* @__PURE__ */ e.jsxs("div", { className: R("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
401
409
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
402
410
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-fit px-1", children: [
|
|
@@ -406,7 +414,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
406
414
|
{
|
|
407
415
|
className: R(
|
|
408
416
|
"rounded-full w-2 h-2 bg-emerald-400 mr-2",
|
|
409
|
-
(y ||
|
|
417
|
+
(y || c) && "bg-neutral-200"
|
|
410
418
|
)
|
|
411
419
|
}
|
|
412
420
|
),
|
|
@@ -447,19 +455,19 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
447
455
|
" ",
|
|
448
456
|
x && y && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
449
457
|
"Expires in ",
|
|
450
|
-
|
|
458
|
+
d,
|
|
451
459
|
" ",
|
|
452
|
-
|
|
460
|
+
d === 1 ? "day" : "days",
|
|
453
461
|
"."
|
|
454
462
|
] }),
|
|
455
|
-
x &&
|
|
463
|
+
x && c && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
|
|
456
464
|
"Expired",
|
|
457
465
|
" ",
|
|
458
|
-
|
|
466
|
+
d === 0 ? "today." : `${d * -1} days ago.`
|
|
459
467
|
] })
|
|
460
468
|
] })
|
|
461
469
|
] }),
|
|
462
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children:
|
|
470
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: x && i && /* @__PURE__ */ e.jsxs(U, { children: [
|
|
463
471
|
/* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(le, { size: 16 }) }) }),
|
|
464
472
|
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
465
473
|
/* @__PURE__ */ e.jsxs(Y, { children: [
|
|
@@ -481,10 +489,10 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
481
489
|
] })
|
|
482
490
|
] }) })
|
|
483
491
|
] });
|
|
484
|
-
},
|
|
492
|
+
}, I = "https://api.zuploedge.com/v2/client", Qe = (t) => ({
|
|
485
493
|
deleteKey: async (i, s, n) => {
|
|
486
494
|
const o = new Request(
|
|
487
|
-
|
|
495
|
+
I + `/${t}/consumers/${i}/keys/${s}`,
|
|
488
496
|
{
|
|
489
497
|
method: "DELETE"
|
|
490
498
|
}
|
|
@@ -497,7 +505,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
497
505
|
const n = await fetch(
|
|
498
506
|
await s.signRequest(
|
|
499
507
|
new Request(
|
|
500
|
-
|
|
508
|
+
I + `/${t}/consumers/${i.id}`,
|
|
501
509
|
{
|
|
502
510
|
method: "PATCH",
|
|
503
511
|
headers: {
|
|
@@ -516,7 +524,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
516
524
|
const n = await fetch(
|
|
517
525
|
await s.signRequest(
|
|
518
526
|
new Request(
|
|
519
|
-
|
|
527
|
+
I + `/${t}/consumers/${i}/roll-key`,
|
|
520
528
|
{
|
|
521
529
|
method: "POST",
|
|
522
530
|
headers: {
|
|
@@ -531,7 +539,7 @@ const Le = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
531
539
|
},
|
|
532
540
|
getConsumers: async (i) => {
|
|
533
541
|
const s = new Request(
|
|
534
|
-
|
|
542
|
+
I + `/${t}/consumers`
|
|
535
543
|
);
|
|
536
544
|
await i.signRequest(s);
|
|
537
545
|
const n = await fetch(s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-api-keys.js","sources":["../src/lib/plugins/api-keys/ProtectedRoute.tsx","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/utils/use-constant.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/utils/is-browser.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/context/PresenceContext.mjs","../../../node_modules/.pnpm/motion-utils@12.12.1/node_modules/motion-utils/dist/es/is-object.mjs","../../../node_modules/.pnpm/motion-dom@12.16.0/node_modules/motion-dom/dist/es/utils/is-html-element.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs","../../../node_modules/.pnpm/framer-motion@12.16.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","../src/lib/plugins/api-keys/SettingsApiKeys.tsx","../src/lib/plugins/api-keys/index.tsx"],"sourcesContent":["import { Outlet } from \"react-router\";\nimport { useAuth } from \"../../authentication/hook.js\";\nimport { DeveloperHint } from \"../../components/DeveloperHint.js\";\nimport { Button } from \"../../ui/Button.js\";\n\nexport const ProtectedRoute = () => {\n const auth = useAuth();\n\n // TODO: should we suspend here somehow?\n if (auth.isAuthEnabled && auth.isPending) {\n return null;\n }\n\n return auth.isAuthenticated ? (\n <Outlet />\n ) : !auth.isAuthEnabled ? (\n <div className=\"flex flex-col justify-center gap-2 items-center h-1/2\">\n <DeveloperHint className=\"max-w-[600px]\">\n Authentication needs to be enabled for API keys to work. Enable it in\n your Zudoku configuration under <code>authentication</code>.\n </DeveloperHint>\n </div>\n ) : (\n <div className=\"flex flex-col justify-center gap-2 items-center h-1/2\">\n Please login first to view this page\n <Button onClick={() => auth.login()}>Login</Button>\n </div>\n );\n};\n","\"use client\";\nimport { createContext } from 'react';\n\nconst LayoutGroupContext = createContext({});\n\nexport { LayoutGroupContext };\n","import { useRef } from 'react';\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nfunction useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n\nexport { useConstant };\n","const isBrowser = typeof window !== \"undefined\";\n\nexport { isBrowser };\n","import { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst PresenceContext = \n/* @__PURE__ */ createContext(null);\n\nexport { PresenceContext };\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return isObject(element) && \"offsetHeight\" in element;\n}\n\nexport { isHTMLElement };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n\nexport { MotionConfigContext };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { isHTMLElement } from 'motion-dom';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const parent = element.offsetParent;\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0;\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n size.right = parentWidth - size.width - size.left;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent, anchorX }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n top: ${top}px !important;\n }\n `);\n }\n return () => {\n if (document.head.contains(style)) {\n document.head.removeChild(style);\n }\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));\n}\n\nexport { PopChild };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n let isReusedContext = true;\n let context = useMemo(() => {\n isReusedContext = false;\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n },\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n };\n }, [isPresent, presenceChildren, onExitComplete]);\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context };\n }\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = (jsx(PopChild, { isPresent: isPresent, anchorX: anchorX, children: children }));\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","import { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n","import { Children, isValidElement } from 'react';\n\nconst getChildKey = (child) => child.key || \"\";\nfunction onlyElements(children) {\n const filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n\nexport { getChildKey, onlyElements };\n","\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, anchorX = \"left\", }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n 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.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender?.();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && safeToRemove?.();\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n","import {\n useMutation,\n useQueryClient,\n useSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport { AnimatePresence } from \"framer-motion\";\nimport {\n CheckIcon,\n CopyIcon,\n EyeIcon,\n EyeOffIcon,\n PencilLineIcon,\n RotateCwIcon,\n TrashIcon,\n XIcon,\n} from \"lucide-react\";\nimport React, { useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { Card, CardHeader } from \"zudoku/ui/Card.js\";\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"zudoku/ui/Dialog.js\";\nimport { useZudoku } from \"../../components/context/ZudokuContext.js\";\nimport { Slot } from \"../../components/Slot.js\";\nimport { Button } from \"../../ui/Button.js\";\nimport { Input } from \"../../ui/Input.js\";\nimport { cn } from \"../../util/cn.js\";\nimport { type ApiConsumer, type ApiKey, type ApiKeyService } from \"./index.js\";\n\nexport const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {\n const context = useZudoku();\n const queryClient = useQueryClient();\n const [editingConsumerId, setEditingConsumerId] = useState<string | null>(\n null,\n );\n const [editingLabel, setEditingLabel] = useState<string>(\"\");\n const { data, isFetching } = useSuspenseQuery({\n queryFn: () => service.getConsumers(context),\n queryKey: [\"api-keys\"],\n retry: false,\n });\n\n const deleteKeyMutation = useMutation({\n mutationFn: ({\n consumerId,\n keyId,\n }: {\n consumerId: string;\n keyId: string;\n }) => {\n if (!service.deleteKey) {\n throw new Error(\"deleteKey not implemented\");\n }\n\n return service.deleteKey(consumerId, keyId, context);\n },\n onMutate: async ({ consumerId, keyId }) => {\n await queryClient.cancelQueries({ queryKey: [\"api-keys\"] });\n const previousData = queryClient.getQueryData<ApiConsumer[]>([\n \"api-keys\",\n ]);\n queryClient.setQueryData<ApiConsumer[]>([\"api-keys\"], (old) => {\n if (!old) {\n return old;\n }\n\n return old.map((consumer) => {\n if (consumer.id === consumerId) {\n return {\n ...consumer,\n apiKeys: consumer.apiKeys.filter((key) => key.id !== keyId),\n };\n }\n return consumer;\n });\n });\n\n return { previousData };\n },\n onError: (err, variables, context) => {\n if (context?.previousData) {\n queryClient.setQueryData([\"api-keys\"], context.previousData);\n }\n },\n onSuccess: () => {\n void queryClient.invalidateQueries({ queryKey: [\"api-keys\"] });\n },\n });\n\n const updateConsumerMutation = useMutation({\n mutationFn: ({\n consumerId,\n label,\n }: {\n consumerId: string;\n label: string;\n }) => {\n if (!service.updateConsumer) {\n throw new Error(\"updateConsumer not implemented\");\n }\n\n return service.updateConsumer({ id: consumerId, label }, context);\n },\n onMutate: async ({ consumerId, label }) => {\n await queryClient.cancelQueries({ queryKey: [\"api-keys\"] });\n\n const previousData = queryClient.getQueryData([\"api-keys\"]);\n queryClient.setQueryData<ApiConsumer[]>([\"api-keys\"], (old) => {\n if (!old) {\n return old;\n }\n\n return old.map((consumer) => {\n if (consumer.id === consumerId) {\n return {\n ...consumer,\n label,\n };\n }\n return consumer;\n });\n });\n\n return { previousData };\n },\n onError: (err, variables, context) => {\n if (context?.previousData) {\n queryClient.setQueryData([\"api-keys\"], context.previousData);\n }\n },\n onSuccess: () => {\n void queryClient.invalidateQueries({ queryKey: [\"api-keys\"] });\n },\n });\n\n const rollKeyMutation = useMutation({\n mutationFn: (id: string) => {\n if (!service.rollKey) {\n throw new Error(\"rollKey not implemented\");\n }\n\n return service.rollKey(id, context);\n },\n onSuccess: () => queryClient.invalidateQueries({ queryKey: [\"api-keys\"] }),\n });\n\n const handleStartEdit = (consumerId: string, currentLabel: string) => {\n setEditingConsumerId(consumerId);\n setEditingLabel(currentLabel);\n };\n\n const handleSaveEdit = (consumerId: string) => {\n if (editingLabel.trim()) {\n updateConsumerMutation.mutate({\n consumerId,\n label: editingLabel.trim(),\n });\n }\n setEditingConsumerId(null);\n setEditingLabel(\"\");\n };\n\n const handleCancelEdit = () => {\n setEditingConsumerId(null);\n setEditingLabel(\"\");\n };\n\n return (\n <div className=\"max-w-screen-lg h-full pt-(--padding-content-top) pb-(--padding-content-bottom)\">\n <Slot.Target name=\"api-keys-list-page\" />\n\n <div className=\"flex justify-between pb-3\">\n <h1 className=\"font-medium text-2xl\">API Keys</h1>\n {service.createKey && (\n <Button asChild>\n <Link to=\"/settings/api-keys/new\">Create API Key</Link>\n </Button>\n )}\n </div>\n <p>Create, manage, and monitor your API keys</p>\n\n <Slot.Target name=\"api-keys-list-page-before-keys\" />\n\n <div className=\"h-8\"></div>\n <div className=\"grid grid-cols-8\">\n {data.length === 0 ? (\n <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\">\n <p className=\"text-center\">\n You have no API keys yet.\n <br />\n {service.createKey && \"Get started and create your first key.\"}\n </p>\n {service.createKey && (\n <Button asChild variant=\"outline\">\n <Link to=\"/settings/api-keys/new\">Create API Key</Link>\n </Button>\n )}\n </div>\n ) : (\n <ul\n className={cn(\n \"grid grid-cols-1 divide-y divide-border col-span-6\",\n \"lg:grid-cols-[1fr_min-content]\",\n )}\n >\n {data.map((consumers) => (\n <Card\n className=\"grid grid-cols-subgrid col-span-full items-center mb-4 group\"\n key={consumers.id}\n >\n <CardHeader className=\"border-b col-span-full grid-cols-subgrid grid\">\n <div className=\"h-10 flex flex-col text-sm justify-center\">\n <div className=\"font-medium text-lg flex items-center gap-2\">\n {editingConsumerId === consumers.id ? (\n <div className=\"flex items-center gap-2 w-full\">\n <Input\n maxLength={32}\n value={editingLabel}\n onChange={(e) => setEditingLabel(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n handleSaveEdit(consumers.id);\n } else if (e.key === \"Escape\") {\n handleCancelEdit();\n }\n }}\n className=\"text-lg font-medium\"\n autoFocus\n />\n <div className=\"flex items-center\">\n <Button\n size=\"icon\"\n variant=\"ghost\"\n onClick={() => handleSaveEdit(consumers.id)}\n disabled={!editingLabel.trim()}\n >\n <CheckIcon size={16} />\n </Button>\n <Button\n size=\"icon\"\n variant=\"ghost\"\n onClick={handleCancelEdit}\n >\n <XIcon size={16} />\n </Button>\n </div>\n </div>\n ) : (\n <>{consumers.label}</>\n )}\n <div className=\"text-muted-foreground text-xs\">\n {consumers.createdOn}\n </div>\n </div>\n <div className=\"text-muted-foreground text-xs\">\n {consumers.createdOn && (\n <div>\n Created on{\" \"}\n {new Date(consumers.createdOn).toLocaleDateString()}\n </div>\n )}\n {consumers.expiresOn && (\n <div>\n Expires on{\" \"}\n {new Date(consumers.expiresOn).toLocaleDateString()}\n </div>\n )}\n </div>\n </div>\n\n <div className=\"flex justify-end\">\n {service.updateConsumer && (\n <Button\n size=\"icon\"\n variant=\"ghost\"\n onClick={() =>\n handleStartEdit(consumers.id, consumers.label)\n }\n className={cn(\n editingConsumerId === consumers.id &&\n \"opacity-0! pointer-events-none\",\n )}\n disabled={editingConsumerId === consumers.id}\n >\n <PencilLineIcon size={16} />\n </Button>\n )}\n {service.rollKey && (\n <Dialog>\n <DialogTrigger asChild>\n <Button\n size=\"icon\"\n title=\"Roll this key\"\n variant=\"ghost\"\n disabled={rollKeyMutation.isPending}\n className={\n rollKeyMutation.isPending\n ? \"animate-spin\"\n : undefined\n }\n >\n <RotateCwIcon size={16} />\n </Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Roll API Key</DialogTitle>\n <DialogDescription>\n Are you sure you want to roll this API key?\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <DialogClose asChild>\n <Button variant=\"outline\">Cancel</Button>\n </DialogClose>\n <DialogClose asChild>\n <Button\n onClick={() => {\n rollKeyMutation.mutate(consumers.id);\n }}\n >\n Roll Key\n </Button>\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )}\n </div>\n </CardHeader>\n <div className=\"col-span-full grid-cols-subgrid grid\">\n <AnimatePresence>\n {consumers.apiKeys.map((apiKey) => (\n <React.Fragment key={apiKey.id}>\n <RevealApiKey\n apiKey={apiKey}\n onDeleteKey={() => {\n deleteKeyMutation.mutate({\n consumerId: consumers.id,\n keyId: apiKey.id,\n });\n }}\n className={\n deleteKeyMutation.variables?.keyId === apiKey.id &&\n (deleteKeyMutation.isPending || isFetching)\n ? \"opacity-10!\"\n : undefined\n }\n />\n <div className=\"col-span-full h-px bg-border\"></div>\n </React.Fragment>\n ))}\n </AnimatePresence>\n </div>\n </Card>\n ))}\n </ul>\n )}\n </div>\n </div>\n );\n};\n\nconst getTimeAgo = (date: string) => {\n const now = new Date();\n const created = new Date(date);\n const diffInSeconds = Math.floor((now.getTime() - created.getTime()) / 1000);\n\n const rtf = new Intl.RelativeTimeFormat(\"en\", { numeric: \"auto\" });\n\n if (diffInSeconds < 60) return rtf.format(-diffInSeconds, \"second\");\n if (diffInSeconds < 3600)\n return rtf.format(-Math.floor(diffInSeconds / 60), \"minute\");\n if (diffInSeconds < 86400)\n return rtf.format(-Math.floor(diffInSeconds / 3600), \"hour\");\n if (diffInSeconds < 2592000)\n return rtf.format(-Math.floor(diffInSeconds / 86400), \"day\");\n if (diffInSeconds < 31536000)\n return rtf.format(-Math.floor(diffInSeconds / 2592000), \"month\");\n return rtf.format(-Math.floor(diffInSeconds / 31536000), \"year\");\n};\n\nconst RevealApiKey = ({\n apiKey,\n onDeleteKey,\n className,\n}: {\n apiKey: ApiKey;\n onDeleteKey: () => void;\n className?: string;\n}) => {\n const [revealed, setRevealed] = useState(false);\n const [copied, setCopied] = useState(false);\n\n const { key, createdOn, expiresOn } = apiKey;\n const isExpired = expiresOn && new Date(expiresOn) < new Date();\n const daysUntilExpiry = expiresOn\n ? Math.ceil(\n (new Date(expiresOn).getTime() - new Date().getTime()) /\n (1000 * 60 * 60 * 24),\n )\n : Infinity;\n const expiresSoon = daysUntilExpiry <= 7 && !isExpired;\n\n return (\n <div className={cn(\"grid col-span-full grid-cols-subgrid p-6\", className)}>\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex gap-2 items-center text-sm border rounded-md w-fit px-1\">\n <div className=\"font-mono truncate h-9 items-center flex px-2 text-xs gap-2\">\n <div\n className={cn(\n \"rounded-full w-2 h-2 bg-emerald-400 mr-2\",\n (expiresSoon || isExpired) && \"bg-neutral-200\",\n )}\n ></div>\n <span>\n <span className={revealed ? \"\" : \"opacity-20\"}>\n {revealed\n ? key.slice(0, -5)\n : \"**** \".repeat(key.slice(0, -5).length / 5) +\n \"*\".repeat(key.slice(0, -5).length % 5)}\n </span>\n <span>{key.slice(-5)}</span>\n </span>\n </div>\n <Button\n variant=\"ghost\"\n onClick={() => setRevealed((prev) => !prev)}\n size=\"icon\"\n >\n {revealed ? <EyeOffIcon size={16} /> : <EyeIcon size={16} />}\n </Button>\n <Button\n variant=\"ghost\"\n onClick={() => {\n void navigator.clipboard.writeText(key).then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n }}\n size=\"icon\"\n >\n {copied ? <CheckIcon size={16} /> : <CopyIcon size={16} />}\n </Button>\n </div>\n <div className=\"flex gap-1 mt-0.5 text-nowrap\">\n {createdOn && (\n <span className=\"text-xs text-muted-foreground\">\n Created {getTimeAgo(createdOn)}.\n </span>\n )}{\" \"}\n {expiresOn && expiresSoon && (\n <span className=\"text-xs text-primary\">\n Expires in {daysUntilExpiry}{\" \"}\n {daysUntilExpiry === 1 ? \"day\" : \"days\"}.\n </span>\n )}\n {expiresOn && isExpired && (\n <span className=\"text-xs text-primary\">\n Expired{\" \"}\n {daysUntilExpiry === 0\n ? \"today.\"\n : `${daysUntilExpiry * -1} days ago.`}\n </span>\n )}\n </div>\n </div>\n <div className=\"flex justify-end\">\n {isExpired && onDeleteKey && (\n <Dialog>\n <DialogTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\">\n <TrashIcon size={16} />\n </Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Delete API Key</DialogTitle>\n <DialogDescription>\n Are you sure you want to delete this API key?\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <DialogClose asChild>\n <Button variant=\"outline\">Cancel</Button>\n </DialogClose>\n <DialogClose asChild>\n <Button\n onClick={() => {\n onDeleteKey();\n }}\n >\n Delete\n </Button>\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )}\n </div>\n </div>\n );\n};\n","import { KeyRoundIcon } from \"lucide-react\";\nimport { type RouteObject } from \"react-router\";\nimport { type ZudokuContext } from \"../../core/ZudokuContext.js\";\nimport {\n type ApiIdentityPlugin,\n type ProfileMenuPlugin,\n type ZudokuPlugin,\n} from \"../../core/plugins.js\";\nimport { RouterError } from \"../../errors/RouterError.js\";\nimport invariant from \"../../util/invariant.js\";\nimport { ProtectedRoute } from \"./ProtectedRoute.js\";\nimport { SettingsApiKeys } from \"./SettingsApiKeys.js\";\n\nconst DEFAULT_API_KEY_ENDPOINT = \"https://api.zuploedge.com/v2/client\";\n\nexport type ApiKeyService = {\n getConsumers: (context: ZudokuContext) => Promise<ApiConsumer[]>;\n rollKey?: (consumerId: string, context: ZudokuContext) => Promise<void>;\n deleteKey?: (\n consumerId: string,\n keyId: string,\n context: ZudokuContext,\n ) => Promise<void>;\n updateConsumer?: (\n consumer: { id: string; label?: string },\n context: ZudokuContext,\n ) => Promise<void>;\n getUsage?: (apiKeys: string[], context: ZudokuContext) => Promise<void>;\n createKey?: (\n apiKey: { description: string; expiresOn?: string },\n context: ZudokuContext,\n ) => Promise<void>;\n};\n\nexport type ApiKeyPluginOptions =\n | ApiKeyService\n | ({ deploymentName: string } & Partial<ApiKeyService>);\n\nexport interface ApiKey {\n id: string;\n description?: string;\n createdOn?: string;\n updatedOn?: string;\n expiresOn?: string;\n key: string;\n}\n\nexport interface ApiConsumer {\n id: string;\n label: string;\n apiKeys: ApiKey[];\n description?: string;\n createdOn?: string;\n updatedOn?: string;\n expiresOn?: string;\n key?: ApiKey;\n}\n\nconst createDefaultHandler = (deploymentName: string): ApiKeyService => {\n return {\n deleteKey: async (consumerId, keyId, context) => {\n const request = new Request(\n DEFAULT_API_KEY_ENDPOINT +\n `/${deploymentName}/consumers/${consumerId}/keys/${keyId}`,\n {\n method: \"DELETE\",\n },\n );\n await context.signRequest(request);\n\n const response = await fetch(request);\n invariant(response.ok, \"Failed to delete API key\");\n },\n updateConsumer: async (consumer, context) => {\n const response = await fetch(\n await context.signRequest(\n new Request(\n DEFAULT_API_KEY_ENDPOINT +\n `/${deploymentName}/consumers/${consumer.id}`,\n {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n label: consumer.label,\n }),\n },\n ),\n ),\n );\n invariant(response.ok, \"Failed to update API key description\");\n },\n rollKey: async (consumerId, context) => {\n const response = await fetch(\n await context.signRequest(\n new Request(\n DEFAULT_API_KEY_ENDPOINT +\n `/${deploymentName}/consumers/${consumerId}/roll-key`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({}),\n },\n ),\n ),\n );\n invariant(response.ok, \"Failed to delete API key\");\n },\n getConsumers: async (context) => {\n const request = new Request(\n DEFAULT_API_KEY_ENDPOINT + `/${deploymentName}/consumers`,\n );\n await context.signRequest(request);\n\n const keys = await fetch(request);\n invariant(keys.ok, \"Failed to fetch API keys\");\n\n const data = (await keys.json()) as {\n data: [\n {\n id: string;\n label: string;\n apiKeys: {\n data: ApiKey[];\n };\n },\n ];\n };\n\n return data.data.map((consumer) => ({\n id: consumer.id,\n label: consumer.label || \"API Key\",\n apiKeys: consumer.apiKeys.data,\n key: consumer.apiKeys.data.at(0),\n }));\n },\n };\n};\n\nexport const createApiKeyService = <T extends ApiKeyService>(service: T): T =>\n service;\n\nexport const apiKeyPlugin = (\n options: ApiKeyPluginOptions,\n): ZudokuPlugin & ApiIdentityPlugin & ProfileMenuPlugin => {\n const service: ApiKeyService =\n \"deploymentName\" in options\n ? createDefaultHandler(options.deploymentName)\n : options;\n\n return {\n getProfileMenuItems: () => [\n {\n label: \"API Keys\",\n path: \"/settings/api-keys\",\n category: \"middle\",\n icon: KeyRoundIcon,\n },\n ],\n\n getIdentities: async (context) => {\n try {\n const consumers = await service.getConsumers(context);\n\n return consumers.map((consumer) => ({\n authorizeRequest: (request) => {\n request.headers.set(\n \"Authorization\",\n `Bearer ${consumer.apiKeys.at(0)?.key}`,\n );\n return request;\n },\n id: consumer.id,\n label: consumer.description ?? consumer.id,\n }));\n } catch {\n return [];\n }\n },\n getRoutes: (): RouteObject[] => {\n // TODO: Make lazy\n return [\n {\n element: <ProtectedRoute />,\n errorElement: <RouterError />,\n children: [\n {\n path: \"/settings/api-keys\",\n element: <SettingsApiKeys service={service} />,\n },\n // {\n // path: \"/settings/api-keys/new\",\n // element: <CreateApiKey service={service} />,\n // },\n ],\n },\n ];\n },\n };\n};\n"],"names":["ProtectedRoute","auth","useAuth","jsx","Outlet","jsxs","Button","DeveloperHint","LayoutGroupContext","createContext","useConstant","init","ref","useRef","isBrowser","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","PresenceContext","isObject","value","isHTMLElement","element","MotionConfigContext","p","PopChildMeasure","React","prevProps","parent","parentWidth","size","PopChild","children","isPresent","anchorX","id","useId","nonce","useContext","useInsertionEffect","width","height","top","left","right","x","style","PresenceChild","initial","onExitComplete","custom","presenceAffectsLayout","mode","presenceChildren","newChildrenMap","isReusedContext","context","useMemo","childId","isComplete","_","key","usePresence","subscribe","register","safeToRemove","useCallback","getChildKey","child","onlyElements","filtered","Children","isValidElement","AnimatePresence","propagate","isParentPresent","presentChildren","presentKeys","isInitialRender","pendingPresentChildren","exitComplete","diffedChildren","setDiffedChildren","useState","renderedChildren","setRenderedChildren","i","exitingChildren","nextChildren","forceRender","Fragment","onExit","isEveryExitComplete","isExitComplete","SettingsApiKeys","service","useZudoku","queryClient","useQueryClient","editingConsumerId","setEditingConsumerId","editingLabel","setEditingLabel","data","isFetching","useSuspenseQuery","deleteKeyMutation","useMutation","consumerId","keyId","previousData","old","consumer","err","variables","updateConsumerMutation","label","rollKeyMutation","handleStartEdit","currentLabel","handleSaveEdit","handleCancelEdit","Slot","Link","cn","consumers","Card","CardHeader","Input","e","CheckIcon","XIcon","PencilLineIcon","Dialog","DialogTrigger","RotateCwIcon","DialogContent","DialogHeader","DialogTitle","DialogDescription","DialogFooter","DialogClose","apiKey","RevealApiKey","getTimeAgo","date","now","created","diffInSeconds","rtf","onDeleteKey","className","revealed","setRevealed","copied","setCopied","createdOn","expiresOn","isExpired","daysUntilExpiry","expiresSoon","prev","EyeOffIcon","EyeIcon","CopyIcon","TrashIcon","DEFAULT_API_KEY_ENDPOINT","createDefaultHandler","deploymentName","request","response","invariant","keys","createApiKeyService","apiKeyPlugin","options","KeyRoundIcon","RouterError"],"mappings":";;;;;;;;;;;;;;AAKO,MAAMA,KAAiB,MAAM;AAClC,QAAMC,IAAOC,GAAQ;AAGjB,SAAAD,EAAK,iBAAiBA,EAAK,YACtB,OAGFA,EAAK,kBACTE,gBAAAA,MAAAC,IAAA,CAAA,CAAO,IACLH,EAAK,gBAQPI,gBAAAA,EAAA,KAAA,OAAA,EAAI,WAAU,yDAAwD,UAAA;AAAA,IAAA;AAAA,0BAEpEC,GAAO,EAAA,SAAS,MAAML,EAAK,SAAS,UAAK,QAAA,CAAA;AAAA,EAAA,GAC5C,IAVAE,gBAAAA,EAAA,IAAC,SAAI,WAAU,yDACb,UAACE,gBAAAA,EAAAA,KAAAE,IAAA,EAAc,WAAU,iBAAgB,UAAA;AAAA,IAAA;AAAA,IAEPJ,gBAAAA,EAAAA,IAAC,UAAK,UAAc,iBAAA,CAAA;AAAA,IAAO;AAAA,EAAA,EAC7D,CAAA,EACF,CAAA;A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,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,MAAMC;AAAA,MAAA;AAAA,IAEV;AAAA,IAEA,eAAe,OAAOxH,MAAY;AAC5B,UAAA;AAGK,gBAFW,MAAMuC,EAAQ,aAAavC,CAAO,GAEnC,IAAI,CAACwD,OAAc;AAAA,UAClC,kBAAkB,CAACyD,OACjBA,EAAQ,QAAQ;AAAA,YACd;AAAA,YACA,UAAUzD,EAAS,QAAQ,GAAG,CAAC,GAAG,GAAG;AAAA,UACvC,GACOyD;AAAA,UAET,IAAIzD,EAAS;AAAA,UACb,OAAOA,EAAS,eAAeA,EAAS;AAAA,QAAA,EACxC;AAAA,MAAA,QACI;AACN,eAAO,CAAC;AAAA,MAAA;AAAA,IAEZ;AAAA,IACA,WAAW,MAEF;AAAA,MACL;AAAA,QACE,+BAAUhH,IAAe,EAAA;AAAA,QACzB,oCAAeiL,IAAY,EAAA;AAAA,QAC3B,UAAU;AAAA,UACR;AAAA,YACE,MAAM;AAAA,YACN,SAAU9K,gBAAAA,EAAA,IAAA2F,IAAA,EAAgB,SAAAC,EAAkB,CAAA;AAAA,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAC9C;AAAA,MAKF;AAAA,IAEJ;AAAA,EAEJ;AACF;","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13]}
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-api-keys.js","sources":["../src/lib/plugins/api-keys/ProtectedRoute.tsx","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/utils/use-constant.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/utils/is-browser.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/context/PresenceContext.mjs","../../../node_modules/.pnpm/motion-utils@12.12.1/node_modules/motion-utils/dist/es/is-object.mjs","../../../node_modules/.pnpm/motion-dom@12.17.0/node_modules/motion-dom/dist/es/utils/is-html-element.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs","../../../node_modules/.pnpm/framer-motion@12.17.0_@emotion+is-prop-valid@0.8.8_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","../src/lib/plugins/api-keys/SettingsApiKeys.tsx","../src/lib/plugins/api-keys/index.tsx"],"sourcesContent":["import { Outlet } from \"react-router\";\nimport { useAuth } from \"../../authentication/hook.js\";\nimport { DeveloperHint } from \"../../components/DeveloperHint.js\";\nimport { Button } from \"../../ui/Button.js\";\n\nexport const ProtectedRoute = () => {\n const auth = useAuth();\n\n // TODO: should we suspend here somehow?\n if (auth.isAuthEnabled && auth.isPending) {\n return null;\n }\n\n return auth.isAuthenticated ? (\n <Outlet />\n ) : !auth.isAuthEnabled ? (\n <div className=\"flex flex-col justify-center gap-2 items-center h-1/2\">\n <DeveloperHint className=\"max-w-[600px]\">\n Authentication needs to be enabled for API keys to work. Enable it in\n your Zudoku configuration under <code>authentication</code>.\n </DeveloperHint>\n </div>\n ) : (\n <div className=\"flex flex-col justify-center gap-2 items-center h-1/2\">\n Please login first to view this page\n <Button onClick={() => auth.login()}>Login</Button>\n </div>\n );\n};\n","\"use client\";\nimport { createContext } from 'react';\n\nconst LayoutGroupContext = createContext({});\n\nexport { LayoutGroupContext };\n","import { useRef } from 'react';\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nfunction useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n\nexport { useConstant };\n","const isBrowser = typeof window !== \"undefined\";\n\nexport { isBrowser };\n","import { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst PresenceContext = \n/* @__PURE__ */ createContext(null);\n\nexport { PresenceContext };\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return isObject(element) && \"offsetHeight\" in element;\n}\n\nexport { isHTMLElement };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n\nexport { MotionConfigContext };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { isHTMLElement } from 'motion-dom';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const parent = element.offsetParent;\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0;\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n size.right = parentWidth - size.width - size.left;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent, anchorX }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n top: ${top}px !important;\n }\n `);\n }\n return () => {\n if (document.head.contains(style)) {\n document.head.removeChild(style);\n }\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));\n}\n\nexport { PopChild };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n let isReusedContext = true;\n let context = useMemo(() => {\n isReusedContext = false;\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n },\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n };\n }, [isPresent, presenceChildren, onExitComplete]);\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context };\n }\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = (jsx(PopChild, { isPresent: isPresent, anchorX: anchorX, children: children }));\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","import { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n","import { Children, isValidElement } from 'react';\n\nconst getChildKey = (child) => child.key || \"\";\nfunction onlyElements(children) {\n const filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n\nexport { getChildKey, onlyElements };\n","\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, anchorX = \"left\", }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n 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.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender?.();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && safeToRemove?.();\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n","import {\n useMutation,\n useQueryClient,\n useSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport { AnimatePresence } from \"framer-motion\";\nimport {\n CheckIcon,\n CopyIcon,\n EyeIcon,\n EyeOffIcon,\n PencilLineIcon,\n RotateCwIcon,\n TrashIcon,\n XIcon,\n} from \"lucide-react\";\nimport React, { useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { Card, CardHeader } from \"zudoku/ui/Card.js\";\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"zudoku/ui/Dialog.js\";\nimport { useZudoku } from \"../../components/context/ZudokuContext.js\";\nimport { Slot } from \"../../components/Slot.js\";\nimport { Button } from \"../../ui/Button.js\";\nimport { Input } from \"../../ui/Input.js\";\nimport { cn } from \"../../util/cn.js\";\nimport { type ApiConsumer, type ApiKey, type ApiKeyService } from \"./index.js\";\n\nexport const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {\n const context = useZudoku();\n const queryClient = useQueryClient();\n const [editingConsumerId, setEditingConsumerId] = useState<string | null>(\n null,\n );\n const [editingLabel, setEditingLabel] = useState<string>(\"\");\n const { data, isFetching } = useSuspenseQuery({\n queryFn: () => service.getConsumers(context),\n queryKey: [\"api-keys\"],\n retry: false,\n });\n\n const deleteKeyMutation = useMutation({\n mutationFn: ({\n consumerId,\n keyId,\n }: {\n consumerId: string;\n keyId: string;\n }) => {\n if (!service.deleteKey) {\n throw new Error(\"deleteKey not implemented\");\n }\n\n return service.deleteKey(consumerId, keyId, context);\n },\n onMutate: async ({ consumerId, keyId }) => {\n await queryClient.cancelQueries({ queryKey: [\"api-keys\"] });\n const previousData = queryClient.getQueryData<ApiConsumer[]>([\n \"api-keys\",\n ]);\n queryClient.setQueryData<ApiConsumer[]>([\"api-keys\"], (old) => {\n if (!old) {\n return old;\n }\n\n return old.map((consumer) => {\n if (consumer.id === consumerId) {\n return {\n ...consumer,\n apiKeys: consumer.apiKeys.filter((key) => key.id !== keyId),\n };\n }\n return consumer;\n });\n });\n\n return { previousData };\n },\n onError: (err, variables, context) => {\n if (context?.previousData) {\n queryClient.setQueryData([\"api-keys\"], context.previousData);\n }\n },\n onSuccess: () => {\n void queryClient.invalidateQueries({ queryKey: [\"api-keys\"] });\n },\n });\n\n const updateConsumerMutation = useMutation({\n mutationFn: ({\n consumerId,\n label,\n }: {\n consumerId: string;\n label: string;\n }) => {\n if (!service.updateConsumer) {\n throw new Error(\"updateConsumer not implemented\");\n }\n\n return service.updateConsumer({ id: consumerId, label }, context);\n },\n onMutate: async ({ consumerId, label }) => {\n await queryClient.cancelQueries({ queryKey: [\"api-keys\"] });\n\n const previousData = queryClient.getQueryData([\"api-keys\"]);\n queryClient.setQueryData<ApiConsumer[]>([\"api-keys\"], (old) => {\n if (!old) {\n return old;\n }\n\n return old.map((consumer) => {\n if (consumer.id === consumerId) {\n return {\n ...consumer,\n label,\n };\n }\n return consumer;\n });\n });\n\n return { previousData };\n },\n onError: (err, variables, context) => {\n if (context?.previousData) {\n queryClient.setQueryData([\"api-keys\"], context.previousData);\n }\n },\n onSuccess: () => {\n void queryClient.invalidateQueries({ queryKey: [\"api-keys\"] });\n },\n });\n\n const rollKeyMutation = useMutation({\n mutationFn: (id: string) => {\n if (!service.rollKey) {\n throw new Error(\"rollKey not implemented\");\n }\n\n return service.rollKey(id, context);\n },\n onSuccess: () => queryClient.invalidateQueries({ queryKey: [\"api-keys\"] }),\n });\n\n const handleStartEdit = (consumerId: string, currentLabel: string) => {\n setEditingConsumerId(consumerId);\n setEditingLabel(currentLabel);\n };\n\n const handleSaveEdit = (consumerId: string) => {\n if (editingLabel.trim()) {\n updateConsumerMutation.mutate({\n consumerId,\n label: editingLabel.trim(),\n });\n }\n setEditingConsumerId(null);\n setEditingLabel(\"\");\n };\n\n const handleCancelEdit = () => {\n setEditingConsumerId(null);\n setEditingLabel(\"\");\n };\n\n return (\n <div className=\"max-w-screen-lg h-full pt-(--padding-content-top) pb-(--padding-content-bottom)\">\n <Slot.Target name=\"api-keys-list-page\" />\n\n <div className=\"flex justify-between pb-3\">\n <h1 className=\"font-medium text-2xl\">API Keys</h1>\n {service.createKey && (\n <Button asChild>\n <Link to=\"/settings/api-keys/new\">Create API Key</Link>\n </Button>\n )}\n </div>\n <p>Create, manage, and monitor your API keys</p>\n\n <Slot.Target name=\"api-keys-list-page-before-keys\" />\n\n <div className=\"h-8\"></div>\n <div className=\"grid grid-cols-8\">\n {data.length === 0 ? (\n <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\">\n <p className=\"text-center\">\n You have no API keys yet.\n <br />\n {service.createKey && \"Get started and create your first key.\"}\n </p>\n {service.createKey && (\n <Button asChild variant=\"outline\">\n <Link to=\"/settings/api-keys/new\">Create API Key</Link>\n </Button>\n )}\n </div>\n ) : (\n <ul\n className={cn(\n \"grid grid-cols-1 divide-y divide-border col-span-6\",\n \"lg:grid-cols-[1fr_min-content]\",\n )}\n >\n {data.map((consumers) => (\n <Card\n className=\"grid grid-cols-subgrid col-span-full items-center mb-4 group\"\n key={consumers.id}\n >\n <CardHeader className=\"border-b col-span-full grid-cols-subgrid grid\">\n <div className=\"h-10 flex flex-col text-sm justify-center\">\n <div className=\"font-medium text-lg flex items-center gap-2\">\n {editingConsumerId === consumers.id ? (\n <div className=\"flex items-center gap-2 w-full\">\n <Input\n maxLength={32}\n value={editingLabel}\n onChange={(e) => setEditingLabel(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n handleSaveEdit(consumers.id);\n } else if (e.key === \"Escape\") {\n handleCancelEdit();\n }\n }}\n className=\"text-lg font-medium\"\n autoFocus\n />\n <div className=\"flex items-center\">\n <Button\n size=\"icon\"\n variant=\"ghost\"\n onClick={() => handleSaveEdit(consumers.id)}\n disabled={!editingLabel.trim()}\n >\n <CheckIcon size={16} />\n </Button>\n <Button\n size=\"icon\"\n variant=\"ghost\"\n onClick={handleCancelEdit}\n >\n <XIcon size={16} />\n </Button>\n </div>\n </div>\n ) : (\n <>{consumers.label}</>\n )}\n <div className=\"text-muted-foreground text-xs\">\n {consumers.createdOn}\n </div>\n </div>\n <div className=\"text-muted-foreground text-xs\">\n {consumers.createdOn && (\n <div>\n Created on{\" \"}\n {new Date(consumers.createdOn).toLocaleDateString()}\n </div>\n )}\n {consumers.expiresOn && (\n <div>\n Expires on{\" \"}\n {new Date(consumers.expiresOn).toLocaleDateString()}\n </div>\n )}\n </div>\n </div>\n\n <div className=\"flex justify-end\">\n {service.updateConsumer && (\n <Button\n size=\"icon\"\n variant=\"ghost\"\n onClick={() =>\n handleStartEdit(consumers.id, consumers.label)\n }\n className={cn(\n editingConsumerId === consumers.id &&\n \"opacity-0! pointer-events-none\",\n )}\n disabled={editingConsumerId === consumers.id}\n >\n <PencilLineIcon size={16} />\n </Button>\n )}\n {service.rollKey && (\n <Dialog>\n <DialogTrigger asChild>\n <Button\n title=\"Roll this key\"\n variant=\"ghost\"\n disabled={rollKeyMutation.isPending}\n className=\"flex items-center gap-1\"\n >\n <RotateCwIcon\n size={16}\n className={\n rollKeyMutation.isPending\n ? \"animate-spin\"\n : undefined\n }\n />\n Roll\n </Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Roll API Key</DialogTitle>\n <DialogDescription>\n Are you sure you want to roll this API key?\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <DialogClose asChild>\n <Button variant=\"outline\">Cancel</Button>\n </DialogClose>\n <DialogClose asChild>\n <Button\n onClick={() => {\n rollKeyMutation.mutate(consumers.id);\n }}\n >\n Roll Key\n </Button>\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )}\n </div>\n </CardHeader>\n <div className=\"col-span-full grid-cols-subgrid grid\">\n <AnimatePresence>\n {consumers.apiKeys.map((apiKey) => (\n <React.Fragment key={apiKey.id}>\n <RevealApiKey\n apiKey={apiKey}\n onDeleteKey={() => {\n deleteKeyMutation.mutate({\n consumerId: consumers.id,\n keyId: apiKey.id,\n });\n }}\n className={\n deleteKeyMutation.variables?.keyId === apiKey.id &&\n (deleteKeyMutation.isPending || isFetching)\n ? \"opacity-10!\"\n : undefined\n }\n />\n <div className=\"col-span-full h-px bg-border\"></div>\n </React.Fragment>\n ))}\n </AnimatePresence>\n </div>\n </Card>\n ))}\n </ul>\n )}\n </div>\n </div>\n );\n};\n\nconst getTimeAgo = (date: string) => {\n const now = new Date();\n const created = new Date(date);\n const diffInSeconds = Math.floor((now.getTime() - created.getTime()) / 1000);\n\n const rtf = new Intl.RelativeTimeFormat(\"en\", { numeric: \"auto\" });\n\n if (diffInSeconds < 60) return rtf.format(-diffInSeconds, \"second\");\n if (diffInSeconds < 3600)\n return rtf.format(-Math.floor(diffInSeconds / 60), \"minute\");\n if (diffInSeconds < 86400)\n return rtf.format(-Math.floor(diffInSeconds / 3600), \"hour\");\n if (diffInSeconds < 2592000)\n return rtf.format(-Math.floor(diffInSeconds / 86400), \"day\");\n if (diffInSeconds < 31536000)\n return rtf.format(-Math.floor(diffInSeconds / 2592000), \"month\");\n return rtf.format(-Math.floor(diffInSeconds / 31536000), \"year\");\n};\n\nconst RevealApiKey = ({\n apiKey,\n onDeleteKey,\n className,\n}: {\n apiKey: ApiKey;\n onDeleteKey: () => void;\n className?: string;\n}) => {\n const [revealed, setRevealed] = useState(false);\n const [copied, setCopied] = useState(false);\n\n const { key, createdOn, expiresOn } = apiKey;\n const isExpired = expiresOn && new Date(expiresOn) < new Date();\n const daysUntilExpiry = expiresOn\n ? Math.ceil(\n (new Date(expiresOn).getTime() - new Date().getTime()) /\n (1000 * 60 * 60 * 24),\n )\n : Infinity;\n const expiresSoon = daysUntilExpiry <= 7 && !isExpired;\n\n return (\n <div className={cn(\"grid col-span-full grid-cols-subgrid p-6\", className)}>\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex gap-2 items-center text-sm border rounded-md w-fit px-1\">\n <div className=\"font-mono truncate h-9 items-center flex px-2 text-xs gap-2\">\n <div\n className={cn(\n \"rounded-full w-2 h-2 bg-emerald-400 mr-2\",\n (expiresSoon || isExpired) && \"bg-neutral-200\",\n )}\n ></div>\n <span>\n <span className={revealed ? \"\" : \"opacity-20\"}>\n {revealed\n ? key.slice(0, -5)\n : \"**** \".repeat(key.slice(0, -5).length / 5) +\n \"*\".repeat(key.slice(0, -5).length % 5)}\n </span>\n <span>{key.slice(-5)}</span>\n </span>\n </div>\n <Button\n variant=\"ghost\"\n onClick={() => setRevealed((prev) => !prev)}\n size=\"icon\"\n >\n {revealed ? <EyeOffIcon size={16} /> : <EyeIcon size={16} />}\n </Button>\n <Button\n variant=\"ghost\"\n onClick={() => {\n void navigator.clipboard.writeText(key).then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n }}\n size=\"icon\"\n >\n {copied ? <CheckIcon size={16} /> : <CopyIcon size={16} />}\n </Button>\n </div>\n <div className=\"flex gap-1 mt-0.5 text-nowrap\">\n {createdOn && (\n <span className=\"text-xs text-muted-foreground\">\n Created {getTimeAgo(createdOn)}.\n </span>\n )}{\" \"}\n {expiresOn && expiresSoon && (\n <span className=\"text-xs text-primary\">\n Expires in {daysUntilExpiry}{\" \"}\n {daysUntilExpiry === 1 ? \"day\" : \"days\"}.\n </span>\n )}\n {expiresOn && isExpired && (\n <span className=\"text-xs text-primary\">\n Expired{\" \"}\n {daysUntilExpiry === 0\n ? \"today.\"\n : `${daysUntilExpiry * -1} days ago.`}\n </span>\n )}\n </div>\n </div>\n <div className=\"flex justify-end\">\n {expiresOn && onDeleteKey && (\n <Dialog>\n <DialogTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\">\n <TrashIcon size={16} />\n </Button>\n </DialogTrigger>\n <DialogContent>\n <DialogHeader>\n <DialogTitle>Delete API Key</DialogTitle>\n <DialogDescription>\n Are you sure you want to delete this API key?\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <DialogClose asChild>\n <Button variant=\"outline\">Cancel</Button>\n </DialogClose>\n <DialogClose asChild>\n <Button\n onClick={() => {\n onDeleteKey();\n }}\n >\n Delete\n </Button>\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )}\n </div>\n </div>\n );\n};\n","import { KeyRoundIcon } from \"lucide-react\";\nimport { type RouteObject } from \"react-router\";\nimport { type ZudokuContext } from \"../../core/ZudokuContext.js\";\nimport {\n type ApiIdentityPlugin,\n type ProfileMenuPlugin,\n type ZudokuPlugin,\n} from \"../../core/plugins.js\";\nimport { RouterError } from \"../../errors/RouterError.js\";\nimport invariant from \"../../util/invariant.js\";\nimport { ProtectedRoute } from \"./ProtectedRoute.js\";\nimport { SettingsApiKeys } from \"./SettingsApiKeys.js\";\n\nconst DEFAULT_API_KEY_ENDPOINT = \"https://api.zuploedge.com/v2/client\";\n\nexport type ApiKeyService = {\n getConsumers: (context: ZudokuContext) => Promise<ApiConsumer[]>;\n rollKey?: (consumerId: string, context: ZudokuContext) => Promise<void>;\n deleteKey?: (\n consumerId: string,\n keyId: string,\n context: ZudokuContext,\n ) => Promise<void>;\n updateConsumer?: (\n consumer: { id: string; label?: string },\n context: ZudokuContext,\n ) => Promise<void>;\n getUsage?: (apiKeys: string[], context: ZudokuContext) => Promise<void>;\n createKey?: (\n apiKey: { description: string; expiresOn?: string },\n context: ZudokuContext,\n ) => Promise<void>;\n};\n\nexport type ApiKeyPluginOptions =\n | ApiKeyService\n | ({ deploymentName: string } & Partial<ApiKeyService>);\n\nexport interface ApiKey {\n id: string;\n description?: string;\n createdOn?: string;\n updatedOn?: string;\n expiresOn?: string;\n key: string;\n}\n\nexport interface ApiConsumer {\n id: string;\n label: string;\n apiKeys: ApiKey[];\n description?: string;\n createdOn?: string;\n updatedOn?: string;\n expiresOn?: string;\n key?: ApiKey;\n}\n\nconst createDefaultHandler = (deploymentName: string): ApiKeyService => {\n return {\n deleteKey: async (consumerId, keyId, context) => {\n const request = new Request(\n DEFAULT_API_KEY_ENDPOINT +\n `/${deploymentName}/consumers/${consumerId}/keys/${keyId}`,\n {\n method: \"DELETE\",\n },\n );\n await context.signRequest(request);\n\n const response = await fetch(request);\n invariant(response.ok, \"Failed to delete API key\");\n },\n updateConsumer: async (consumer, context) => {\n const response = await fetch(\n await context.signRequest(\n new Request(\n DEFAULT_API_KEY_ENDPOINT +\n `/${deploymentName}/consumers/${consumer.id}`,\n {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n label: consumer.label,\n }),\n },\n ),\n ),\n );\n invariant(response.ok, \"Failed to update API key description\");\n },\n rollKey: async (consumerId, context) => {\n const response = await fetch(\n await context.signRequest(\n new Request(\n DEFAULT_API_KEY_ENDPOINT +\n `/${deploymentName}/consumers/${consumerId}/roll-key`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({}),\n },\n ),\n ),\n );\n invariant(response.ok, \"Failed to delete API key\");\n },\n getConsumers: async (context) => {\n const request = new Request(\n DEFAULT_API_KEY_ENDPOINT + `/${deploymentName}/consumers`,\n );\n await context.signRequest(request);\n\n const keys = await fetch(request);\n invariant(keys.ok, \"Failed to fetch API keys\");\n\n const data = (await keys.json()) as {\n data: [\n {\n id: string;\n label: string;\n apiKeys: {\n data: ApiKey[];\n };\n },\n ];\n };\n\n return data.data.map((consumer) => ({\n id: consumer.id,\n label: consumer.label || \"API Key\",\n apiKeys: consumer.apiKeys.data,\n key: consumer.apiKeys.data.at(0),\n }));\n },\n };\n};\n\nexport const createApiKeyService = <T extends ApiKeyService>(service: T): T =>\n service;\n\nexport const apiKeyPlugin = (\n options: ApiKeyPluginOptions,\n): ZudokuPlugin & ApiIdentityPlugin & ProfileMenuPlugin => {\n const service: ApiKeyService =\n \"deploymentName\" in options\n ? createDefaultHandler(options.deploymentName)\n : options;\n\n return {\n getProfileMenuItems: () => [\n {\n label: \"API Keys\",\n path: \"/settings/api-keys\",\n category: \"middle\",\n icon: KeyRoundIcon,\n },\n ],\n\n getIdentities: async (context) => {\n try {\n const consumers = await service.getConsumers(context);\n\n return consumers.map((consumer) => ({\n authorizeRequest: (request) => {\n request.headers.set(\n \"Authorization\",\n `Bearer ${consumer.apiKeys.at(0)?.key}`,\n );\n return request;\n },\n id: consumer.id,\n label: consumer.description ?? consumer.id,\n }));\n } catch {\n return [];\n }\n },\n getRoutes: (): RouteObject[] => {\n // TODO: Make lazy\n return [\n {\n element: <ProtectedRoute />,\n errorElement: <RouterError />,\n children: [\n {\n path: \"/settings/api-keys\",\n element: <SettingsApiKeys service={service} />,\n },\n // {\n // path: \"/settings/api-keys/new\",\n // element: <CreateApiKey service={service} />,\n // },\n ],\n },\n ];\n },\n };\n};\n"],"names":["ProtectedRoute","auth","useAuth","jsx","Outlet","jsxs","Button","DeveloperHint","LayoutGroupContext","createContext","useConstant","init","ref","useRef","isBrowser","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","PresenceContext","isObject","value","isHTMLElement","element","MotionConfigContext","p","PopChildMeasure","React","prevProps","parent","parentWidth","size","PopChild","children","isPresent","anchorX","id","useId","nonce","useContext","useInsertionEffect","width","height","top","left","right","x","style","PresenceChild","initial","onExitComplete","custom","presenceAffectsLayout","mode","presenceChildren","newChildrenMap","isReusedContext","context","useMemo","childId","isComplete","_","key","usePresence","subscribe","register","safeToRemove","useCallback","getChildKey","child","onlyElements","filtered","Children","isValidElement","AnimatePresence","propagate","isParentPresent","presentChildren","presentKeys","isInitialRender","pendingPresentChildren","exitComplete","diffedChildren","setDiffedChildren","useState","renderedChildren","setRenderedChildren","i","exitingChildren","nextChildren","forceRender","Fragment","onExit","isEveryExitComplete","isExitComplete","SettingsApiKeys","service","useZudoku","queryClient","useQueryClient","editingConsumerId","setEditingConsumerId","editingLabel","setEditingLabel","data","isFetching","useSuspenseQuery","deleteKeyMutation","useMutation","consumerId","keyId","previousData","old","consumer","err","variables","updateConsumerMutation","label","rollKeyMutation","handleStartEdit","currentLabel","handleSaveEdit","handleCancelEdit","Slot","Link","cn","consumers","Card","CardHeader","Input","e","CheckIcon","XIcon","PencilLineIcon","Dialog","DialogTrigger","RotateCwIcon","DialogContent","DialogHeader","DialogTitle","DialogDescription","DialogFooter","DialogClose","apiKey","RevealApiKey","getTimeAgo","date","now","created","diffInSeconds","rtf","onDeleteKey","className","revealed","setRevealed","copied","setCopied","createdOn","expiresOn","isExpired","daysUntilExpiry","expiresSoon","prev","EyeOffIcon","EyeIcon","CopyIcon","TrashIcon","DEFAULT_API_KEY_ENDPOINT","createDefaultHandler","deploymentName","request","response","invariant","keys","createApiKeyService","apiKeyPlugin","options","KeyRoundIcon","RouterError"],"mappings":";;;;;;;;;;;;;;AAKO,MAAMA,KAAiB,MAAM;AAClC,QAAMC,IAAOC,GAAQ;AAGjB,SAAAD,EAAK,iBAAiBA,EAAK,YACtB,OAGFA,EAAK,kBACTE,gBAAAA,MAAAC,IAAA,CAAA,CAAO,IACLH,EAAK,gBAQPI,gBAAAA,EAAA,KAAA,OAAA,EAAI,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,9,10,11,12,13]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import a from "react";
|
|
3
|
-
import { P as n } from "./Markdown-
|
|
3
|
+
import { P as n } from "./Markdown-C5j8kKSX.js";
|
|
4
4
|
import { c } from "./cn-wvCW-ho6.js";
|
|
5
5
|
import { u as p } from "./useExposedProps-BZQkZneR.js";
|
|
6
6
|
const u = ({
|
|
@@ -50,7 +50,7 @@ const m = (a) => ({
|
|
|
50
50
|
const c = {
|
|
51
51
|
path: e,
|
|
52
52
|
lazy: async () => {
|
|
53
|
-
const { MdxPage: u } = await import("./MdxPage-
|
|
53
|
+
const { MdxPage: u } = await import("./MdxPage-CKTMf1cR.js"), { default: h, ...p } = await i();
|
|
54
54
|
return {
|
|
55
55
|
element: /* @__PURE__ */ f.jsx(
|
|
56
56
|
u,
|