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