zudoku 0.53.1 → 0.53.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/app/demo.js +2 -1
- package/dist/app/demo.js.map +1 -1
- package/dist/app/main.js +3 -9
- package/dist/app/main.js.map +1 -1
- package/dist/cli/build/handler.js +9 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/config/loader.js +2 -5
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/BuildSchema.js +5 -0
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +1 -1
- package/dist/config/validators/validate.js +11 -2
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +65 -2
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/flat-config.d.ts +325 -0
- package/dist/lib/components/Banner.js +1 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/CategoryHeading.js +1 -1
- package/dist/lib/components/CategoryHeading.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Pagination.js +1 -1
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/StatusPage.js +4 -0
- package/dist/lib/components/StatusPage.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
- package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +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/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +5 -22
- package/dist/lib/plugins/search-inkeep/index.js +35 -29
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +5 -21
- package/dist/lib/plugins/search-inkeep/inkeep.js +10 -19
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +12 -5
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/ui/Alert.d.ts +1 -1
- package/dist/vite/build.js +7 -1
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/mdx/remark-last-modified.js +1 -28
- package/dist/vite/mdx/remark-last-modified.js.map +1 -1
- package/dist/vite/plugin-mdx.js +2 -3
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/lib/{Alert-CT_ViLrJ.js → Alert-FYKbqjIt.js} +2 -2
- package/lib/Alert-FYKbqjIt.js.map +1 -0
- package/lib/{MdxPage-8UuEK446.js → MdxPage-DyRuoE_F.js} +16 -16
- package/lib/{MdxPage-8UuEK446.js.map → MdxPage-DyRuoE_F.js.map} +1 -1
- package/lib/{OasProvider-BsWpguVO.js → OasProvider-CUA-DFGE.js} +2 -2
- package/lib/{OasProvider-BsWpguVO.js.map → OasProvider-CUA-DFGE.js.map} +1 -1
- package/lib/{OperationList-PnZbf3b2.js → OperationList-CRMvWoTv.js} +7 -7
- package/lib/{OperationList-PnZbf3b2.js.map → OperationList-CRMvWoTv.js.map} +1 -1
- package/lib/{Pagination-DY7gCrm4.js → Pagination-HZKe5ncg.js} +9 -8
- package/lib/Pagination-HZKe5ncg.js.map +1 -0
- package/lib/{SchemaList-D6k4DKWH.js → SchemaList-B792ORza.js} +6 -6
- package/lib/{SchemaList-D6k4DKWH.js.map → SchemaList-B792ORza.js.map} +1 -1
- package/lib/{SchemaView-BhgJ9WB8.js → SchemaView-Bo53TeMb.js} +4 -4
- package/lib/{SchemaView-BhgJ9WB8.js.map → SchemaView-Bo53TeMb.js.map} +1 -1
- package/lib/{SignUp-CpUD6DUM.js → SignUp-DfVvOCYB.js} +2 -2
- package/lib/{SignUp-CpUD6DUM.js.map → SignUp-DfVvOCYB.js.map} +1 -1
- package/lib/{Slot-DwZlQ-vX.js → Slot-BpO_AGKJ.js} +13 -5
- package/lib/Slot-BpO_AGKJ.js.map +1 -0
- package/lib/{SyntaxHighlight-CrjhGEwT.js → SyntaxHighlight-CZgjJ7-f.js} +753 -753
- package/lib/SyntaxHighlight-CZgjJ7-f.js.map +1 -0
- package/lib/{Toc-WCmwFkX-.js → Toc-DYMzDvOa.js} +2 -2
- package/lib/{Toc-WCmwFkX-.js.map → Toc-DYMzDvOa.js.map} +1 -1
- package/lib/{circular-BUMjK3JF.js → circular-CLdQ0oUd.js} +2 -2
- package/lib/{circular-BUMjK3JF.js.map → circular-CLdQ0oUd.js.map} +1 -1
- package/lib/{createServer-BPz8ZCrd.js → createServer-Co4BBP-i.js} +4 -4
- package/lib/{createServer-BPz8ZCrd.js.map → createServer-Co4BBP-i.js.map} +1 -1
- package/lib/{errors-DY-qOx9n.js → errors-DE1gK7ms.js} +3 -3
- package/lib/{errors-DY-qOx9n.js.map → errors-DE1gK7ms.js.map} +1 -1
- package/lib/{index-C_xVKbf9.js → index-DLshv89l.js} +581 -566
- package/lib/index-DLshv89l.js.map +1 -0
- package/lib/{index-CcV90rin.js → index-DLzZDv8_.js} +2 -2
- package/lib/{index-CcV90rin.js.map → index-DLzZDv8_.js.map} +1 -1
- package/lib/{index-dVBKCNMa.js → index-DYP-V0jG.js} +10 -10
- package/lib/{index-dVBKCNMa.js.map → index-DYP-V0jG.js.map} +1 -1
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +1553 -1556
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +61 -53
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +54 -57
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +106 -102
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/package.json +11 -10
- package/src/app/demo.tsx +3 -1
- package/src/app/main.tsx +6 -14
- package/src/lib/components/Banner.tsx +0 -1
- package/src/lib/components/CategoryHeading.tsx +4 -1
- package/src/lib/components/Header.tsx +4 -1
- package/src/lib/components/Pagination.tsx +1 -0
- package/src/lib/components/StatusPage.tsx +5 -0
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/navigation/NavigationWrapper.tsx +4 -1
- package/src/lib/core/ZudokuContext.ts +1 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +13 -9
- package/src/lib/plugins/markdown/MdxPage.tsx +1 -1
- package/src/lib/plugins/search-inkeep/index.tsx +54 -58
- package/src/lib/plugins/search-inkeep/inkeep.ts +19 -21
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +1 -0
- package/src/lib/plugins/search-pagefind/ResultList.tsx +13 -4
- package/src/lib/ui/Alert.tsx +1 -1
- package/lib/Alert-CT_ViLrJ.js.map +0 -1
- package/lib/Pagination-DY7gCrm4.js.map +0 -1
- package/lib/Slot-DwZlQ-vX.js.map +0 -1
- package/lib/SyntaxHighlight-CrjhGEwT.js.map +0 -1
- package/lib/index-C_xVKbf9.js.map +0 -1
package/lib/zudoku.auth-clerk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as l } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { LogOutIcon as g } from "lucide-react";
|
|
3
|
-
import { S as f, a as w, b as p } from "./SignUp-
|
|
3
|
+
import { S as f, a as w, b as p } from "./SignUp-DfVvOCYB.js";
|
|
4
4
|
import { u as n } from "./hook-Bd0yS8M0.js";
|
|
5
5
|
const y = ({
|
|
6
6
|
clerkPubKey: d,
|
|
@@ -2,7 +2,7 @@ import { j as ne } from "./jsx-runtime-C5mzlN2N.js";
|
|
|
2
2
|
import { g as Le } from "./invariant-DAFpPywt.js";
|
|
3
3
|
import { C as Ue } from "./ClientOnly-E7hGysn1.js";
|
|
4
4
|
import { j as xe, u as S } from "./hook-Bd0yS8M0.js";
|
|
5
|
-
import { C as Ce, O as re, A as R, a as Ie } from "./errors-
|
|
5
|
+
import { C as Ce, O as re, A as R, a as Ie } from "./errors-DE1gK7ms.js";
|
|
6
6
|
var O = { exports: {} }, je = O.exports, oe;
|
|
7
7
|
function De() {
|
|
8
8
|
return oe || (oe = 1, function(t) {
|
package/lib/zudoku.components.js
CHANGED
|
@@ -2,8 +2,8 @@ import "./RouteGuard-CbKd7_9h.js";
|
|
|
2
2
|
import "./index-ClhS5TxS.js";
|
|
3
3
|
import "./chunk-DQRVZFIR-DHK7_Ilc.js";
|
|
4
4
|
import "./hook-Bd0yS8M0.js";
|
|
5
|
-
import "./Slot-
|
|
6
|
-
import { e as C, f as d, j as h, B as k, m as l, C as S, i as B, H as c, c as y, L as E, M as g, g as H, R as L, d as M, S as R, h as T, T as Z, Z as f, b as A, l as b, k as j, n as v, u as w } from "./index-
|
|
5
|
+
import "./Slot-BpO_AGKJ.js";
|
|
6
|
+
import { e as C, f as d, j as h, B as k, m as l, C as S, i as B, H as c, c as y, L as E, M as g, g as H, R as L, d as M, S as R, h as T, T as Z, Z as f, b as A, l as b, k as j, n as v, u as w } from "./index-DLshv89l.js";
|
|
7
7
|
import "./ui/Button.js";
|
|
8
8
|
import "./ui/Callout.js";
|
|
9
9
|
import "./ClientOnly-E7hGysn1.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { s as f } from "./index-
|
|
2
|
+
import { s as f } from "./index-DLzZDv8_.js";
|
|
3
3
|
import { d as b, m as j } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
|
|
4
4
|
import { u as x, c as v, j as d } from "./hook-Bd0yS8M0.js";
|
|
5
5
|
import { H as y } from "./RouteGuard-CbKd7_9h.js";
|
|
6
|
-
import { L as N } from "./index-
|
|
7
|
-
import { H as k, M as S } from "./Slot-
|
|
6
|
+
import { L as N } from "./index-DLshv89l.js";
|
|
7
|
+
import { H as k, M as S } from "./Slot-BpO_AGKJ.js";
|
|
8
8
|
const w = ({
|
|
9
9
|
items: n,
|
|
10
10
|
filterCatalogItems: o = (r) => r,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { CircleSlashIcon as M, CheckIcon as W, XIcon as ae, PencilLineIcon as oe, RefreshCwIcon as le, EyeOffIcon as ce, EyeIcon as de, CopyIcon as ue, TrashIcon as he, KeyRoundIcon as fe } from "lucide-react";
|
|
3
|
-
import { D as pe, a as B, R as me } from "./Slot-
|
|
4
|
-
import { i as
|
|
3
|
+
import { D as pe, a as B, R as me } from "./Slot-BpO_AGKJ.js";
|
|
4
|
+
import { i as D } from "./invariant-DAFpPywt.js";
|
|
5
5
|
import { O as xe, L as J } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
|
|
6
6
|
import { e as ye, d as ge, g as je, c as Ce } from "./hook-Bd0yS8M0.js";
|
|
7
7
|
import { Button as j } from "./ui/Button.js";
|
|
8
|
-
import { u as S, A as q, a as L } from "./Alert-
|
|
8
|
+
import { u as S, A as q, a as L } from "./Alert-FYKbqjIt.js";
|
|
9
9
|
import * as F from "react";
|
|
10
|
-
import
|
|
10
|
+
import we, { createContext as O, useRef as N, useLayoutEffect as ve, useEffect as X, useId as Q, useContext as H, useInsertionEffect as ke, useMemo as $, useCallback as be, Children as Ee, isValidElement as Ne, useState as P } from "react";
|
|
11
11
|
import { C as Pe, a as De } from "./Card-DPhGbYUM.js";
|
|
12
|
-
import { D as Y, e as G, a as V, c as Z, b as ee, d as te, f as se, g as
|
|
12
|
+
import { D as Y, e as G, a as V, c as Z, b as ee, d as te, f as se, g as R } from "./Dialog-CiIdyz6a.js";
|
|
13
13
|
import { Input as Ie } from "./ui/Input.js";
|
|
14
|
-
import { c as
|
|
14
|
+
import { c as E } from "./cn-wvCW-ho6.js";
|
|
15
15
|
import { u as Ke } from "./CodeBlock-DAKxs_Tu.js";
|
|
16
16
|
const Ae = () => {
|
|
17
17
|
const t = ye();
|
|
@@ -25,10 +25,10 @@ const Ae = () => {
|
|
|
25
25
|
] }) });
|
|
26
26
|
}, Re = O({});
|
|
27
27
|
function ne(t) {
|
|
28
|
-
const i =
|
|
28
|
+
const i = N(null);
|
|
29
29
|
return i.current === null && (i.current = t()), i.current;
|
|
30
30
|
}
|
|
31
|
-
const Te = typeof window < "u", ze = Te ?
|
|
31
|
+
const Te = typeof window < "u", ze = Te ? ve : X, ie = /* @__PURE__ */ O(null), Me = O({
|
|
32
32
|
transformPagePoint: (t) => t,
|
|
33
33
|
isStatic: !1,
|
|
34
34
|
reducedMotion: "never"
|
|
@@ -58,7 +58,7 @@ class Le extends F.Component {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function $e({ children: t, isPresent: i, anchorX: s }) {
|
|
61
|
-
const n = Q(), o =
|
|
61
|
+
const n = Q(), o = N(null), r = N({
|
|
62
62
|
width: 0,
|
|
63
63
|
height: 0,
|
|
64
64
|
top: 0,
|
|
@@ -122,7 +122,7 @@ function Qe(t = !0) {
|
|
|
122
122
|
const f = be(() => t && n && n(r), [r, n, t]);
|
|
123
123
|
return !s && n ? [!1, f] : [!0];
|
|
124
124
|
}
|
|
125
|
-
const
|
|
125
|
+
const I = (t) => t.key || "";
|
|
126
126
|
function U(t) {
|
|
127
127
|
const i = [];
|
|
128
128
|
return Ee.forEach(t, (s) => {
|
|
@@ -130,27 +130,27 @@ function U(t) {
|
|
|
130
130
|
}), i;
|
|
131
131
|
}
|
|
132
132
|
const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: o = !0, mode: r = "sync", propagate: f = !1, anchorX: x = "left" }) => {
|
|
133
|
-
const [u, h] = Qe(f), d = $(() => U(t), [t]), l = f && !u ? [] : d.map(
|
|
133
|
+
const [u, h] = Qe(f), d = $(() => U(t), [t]), l = f && !u ? [] : d.map(I), y = N(!0), p = N(d), k = ne(() => /* @__PURE__ */ new Map()), [a, c] = P(d), [m, w] = P(d);
|
|
134
134
|
ze(() => {
|
|
135
135
|
y.current = !1, p.current = d;
|
|
136
|
-
for (let
|
|
137
|
-
const g =
|
|
136
|
+
for (let v = 0; v < m.length; v++) {
|
|
137
|
+
const g = I(m[v]);
|
|
138
138
|
l.includes(g) ? k.delete(g) : k.get(g) !== !0 && k.set(g, !1);
|
|
139
139
|
}
|
|
140
140
|
}, [m, l.length, l.join("-")]);
|
|
141
141
|
const C = [];
|
|
142
142
|
if (d !== a) {
|
|
143
|
-
let
|
|
143
|
+
let v = [...d];
|
|
144
144
|
for (let g = 0; g < m.length; g++) {
|
|
145
|
-
const b = m[g], z =
|
|
146
|
-
l.includes(z) || (
|
|
145
|
+
const b = m[g], z = I(b);
|
|
146
|
+
l.includes(z) || (v.splice(g, 0, b), C.push(b));
|
|
147
147
|
}
|
|
148
|
-
return r === "wait" && C.length && (
|
|
148
|
+
return r === "wait" && C.length && (v = C), w(U(v)), c(d), null;
|
|
149
149
|
}
|
|
150
150
|
process.env.NODE_ENV !== "production" && r === "wait" && m.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: T } = H(Re);
|
|
152
|
-
return e.jsx(e.Fragment, { children: m.map((
|
|
153
|
-
const g =
|
|
152
|
+
return e.jsx(e.Fragment, { children: m.map((v) => {
|
|
153
|
+
const g = I(v), b = f && !u ? !1 : d === m || l.includes(g), z = () => {
|
|
154
154
|
if (k.has(g))
|
|
155
155
|
k.set(g, !0);
|
|
156
156
|
else
|
|
@@ -158,14 +158,14 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
158
158
|
let _ = !0;
|
|
159
159
|
k.forEach((re) => {
|
|
160
160
|
re || (_ = !1);
|
|
161
|
-
}), _ && (T?.(),
|
|
161
|
+
}), _ && (T?.(), w(p.current), f && h?.(), n && n());
|
|
162
162
|
};
|
|
163
|
-
return e.jsx(Fe, { isPresent: b, initial: !y.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: o, mode: r, onExitComplete: b ? void 0 : z, anchorX: x, children:
|
|
163
|
+
return e.jsx(Fe, { isPresent: b, initial: !y.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: o, mode: r, onExitComplete: b ? void 0 : z, anchorX: x, children: v }, g);
|
|
164
164
|
}) });
|
|
165
165
|
}, _e = ({ service: t }) => {
|
|
166
|
-
const i = ge(), s = je(), [n, o] =
|
|
166
|
+
const i = ge(), s = je(), [n, o] = P(
|
|
167
167
|
null
|
|
168
|
-
), [r, f] =
|
|
168
|
+
), [r, f] = P(""), { data: x, isFetching: u } = Ce({
|
|
169
169
|
queryFn: () => t.getConsumers(i),
|
|
170
170
|
queryKey: ["api-keys"],
|
|
171
171
|
retry: !1
|
|
@@ -183,7 +183,7 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
183
183
|
const m = s.getQueryData([
|
|
184
184
|
"api-keys"
|
|
185
185
|
]);
|
|
186
|
-
return s.setQueryData(["api-keys"], (
|
|
186
|
+
return s.setQueryData(["api-keys"], (w) => w && w.map((C) => C.id === a ? {
|
|
187
187
|
...C,
|
|
188
188
|
apiKeys: C.apiKeys.filter((T) => T.id !== c)
|
|
189
189
|
} : C)), { previousData: m };
|
|
@@ -206,7 +206,7 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
206
206
|
onMutate: async ({ consumerId: a, label: c }) => {
|
|
207
207
|
await s.cancelQueries({ queryKey: ["api-keys"] });
|
|
208
208
|
const m = s.getQueryData(["api-keys"]);
|
|
209
|
-
return s.setQueryData(["api-keys"], (
|
|
209
|
+
return s.setQueryData(["api-keys"], (w) => w && w.map((C) => C.id === a ? {
|
|
210
210
|
...C,
|
|
211
211
|
label: c
|
|
212
212
|
} : C)), { previousData: m };
|
|
@@ -265,9 +265,8 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
265
265
|
] }) : /* @__PURE__ */ e.jsx(
|
|
266
266
|
"ul",
|
|
267
267
|
{
|
|
268
|
-
className:
|
|
269
|
-
"grid grid-cols-
|
|
270
|
-
"lg:grid-cols-[1fr_min-content]"
|
|
268
|
+
className: E(
|
|
269
|
+
"grid grid-cols-[1fr_min-content] divide-y divide-border col-span-6"
|
|
271
270
|
),
|
|
272
271
|
children: x.map((a) => /* @__PURE__ */ e.jsxs(
|
|
273
272
|
Pe,
|
|
@@ -334,14 +333,14 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
334
333
|
{
|
|
335
334
|
variant: "ghost",
|
|
336
335
|
onClick: () => y(a.id, a.label),
|
|
337
|
-
className:
|
|
336
|
+
className: E(
|
|
338
337
|
"flex gap-2",
|
|
339
338
|
n === a.id && "opacity-0! pointer-events-none"
|
|
340
339
|
),
|
|
341
340
|
disabled: n === a.id,
|
|
342
341
|
children: [
|
|
343
342
|
/* @__PURE__ */ e.jsx(oe, { size: 16 }),
|
|
344
|
-
"Edit label"
|
|
343
|
+
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
|
|
345
344
|
]
|
|
346
345
|
}
|
|
347
346
|
),
|
|
@@ -361,7 +360,7 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
361
360
|
className: l.isPending ? "animate-spin" : void 0
|
|
362
361
|
}
|
|
363
362
|
),
|
|
364
|
-
"Roll key"
|
|
363
|
+
/* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
|
|
365
364
|
]
|
|
366
365
|
}
|
|
367
366
|
) }),
|
|
@@ -371,8 +370,8 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
371
370
|
/* @__PURE__ */ e.jsx(te, { children: "Are you sure you want to roll this API key?" })
|
|
372
371
|
] }),
|
|
373
372
|
/* @__PURE__ */ e.jsxs(se, { children: [
|
|
374
|
-
/* @__PURE__ */ e.jsx(
|
|
375
|
-
/* @__PURE__ */ e.jsx(
|
|
373
|
+
/* @__PURE__ */ e.jsx(R, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "outline", children: "Cancel" }) }),
|
|
374
|
+
/* @__PURE__ */ e.jsx(R, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
376
375
|
j,
|
|
377
376
|
{
|
|
378
377
|
onClick: () => {
|
|
@@ -386,7 +385,7 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
386
385
|
] })
|
|
387
386
|
] })
|
|
388
387
|
] }),
|
|
389
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(He, { children: a.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(
|
|
388
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(He, { children: a.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(we.Fragment, { children: [
|
|
390
389
|
/* @__PURE__ */ e.jsx(
|
|
391
390
|
Je,
|
|
392
391
|
{
|
|
@@ -417,24 +416,33 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
417
416
|
onDeleteKey: i,
|
|
418
417
|
className: s
|
|
419
418
|
}) => {
|
|
420
|
-
const [n, o] =
|
|
419
|
+
const [n, o] = P(!1), [r, f] = Ke(), { key: x, createdOn: u, expiresOn: h } = t, d = h && new Date(h) < /* @__PURE__ */ new Date(), l = h ? Math.ceil(
|
|
421
420
|
(new Date(h).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
|
|
422
421
|
) : 1 / 0, y = l <= 7 && !d;
|
|
423
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
422
|
+
return /* @__PURE__ */ e.jsxs("div", { className: E("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
424
423
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
425
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-fit px-1", children: [
|
|
426
|
-
/* @__PURE__ */ e.jsxs("div", { className: "font-mono
|
|
424
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-full max-w-fit px-1", children: [
|
|
425
|
+
/* @__PURE__ */ e.jsxs("div", { className: "font-mono w-full h-9 items-center flex px-2 text-xs gap-2", children: [
|
|
427
426
|
/* @__PURE__ */ e.jsx(
|
|
428
427
|
"div",
|
|
429
428
|
{
|
|
430
|
-
className:
|
|
429
|
+
className: E(
|
|
431
430
|
"rounded-full w-2 h-2 bg-emerald-400 mr-2",
|
|
432
431
|
(y || d) && "bg-neutral-200"
|
|
433
432
|
)
|
|
434
433
|
}
|
|
435
434
|
),
|
|
436
|
-
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
437
|
-
/* @__PURE__ */ e.jsx(
|
|
435
|
+
/* @__PURE__ */ e.jsxs("span", { className: "w-full truncate", children: [
|
|
436
|
+
/* @__PURE__ */ e.jsx(
|
|
437
|
+
"div",
|
|
438
|
+
{
|
|
439
|
+
className: E(
|
|
440
|
+
"w-40 inline-block md:w-full truncate",
|
|
441
|
+
n ? "" : "opacity-20"
|
|
442
|
+
),
|
|
443
|
+
children: n ? x.slice(0, -5) : "**** ".repeat(x.slice(0, -5).length / 5) + "*".repeat(x.slice(0, -5).length % 5)
|
|
444
|
+
}
|
|
445
|
+
),
|
|
438
446
|
/* @__PURE__ */ e.jsx("span", { children: x.slice(-5) })
|
|
439
447
|
] })
|
|
440
448
|
] }),
|
|
@@ -486,8 +494,8 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
486
494
|
/* @__PURE__ */ e.jsx(te, { children: "Are you sure you want to delete this API key?" })
|
|
487
495
|
] }),
|
|
488
496
|
/* @__PURE__ */ e.jsxs(se, { children: [
|
|
489
|
-
/* @__PURE__ */ e.jsx(
|
|
490
|
-
/* @__PURE__ */ e.jsx(
|
|
497
|
+
/* @__PURE__ */ e.jsx(R, { asChild: !0, children: /* @__PURE__ */ e.jsx(j, { variant: "outline", children: "Cancel" }) }),
|
|
498
|
+
/* @__PURE__ */ e.jsx(R, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
491
499
|
j,
|
|
492
500
|
{
|
|
493
501
|
onClick: () => {
|
|
@@ -500,13 +508,13 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
500
508
|
] })
|
|
501
509
|
] }) })
|
|
502
510
|
] });
|
|
503
|
-
},
|
|
511
|
+
}, K = "https://api.zuploedge.com/v2/client", Ue = async (t) => {
|
|
504
512
|
try {
|
|
505
513
|
return await t.json();
|
|
506
514
|
} catch {
|
|
507
515
|
return;
|
|
508
516
|
}
|
|
509
|
-
},
|
|
517
|
+
}, A = async (t) => {
|
|
510
518
|
const i = t.headers.get("content-type");
|
|
511
519
|
if (!t.ok && i?.includes("application/problem+json")) {
|
|
512
520
|
const s = await Ue(t);
|
|
@@ -516,20 +524,20 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
516
524
|
}, We = (t) => ({
|
|
517
525
|
deleteKey: async (i, s, n) => {
|
|
518
526
|
const o = new Request(
|
|
519
|
-
|
|
527
|
+
K + `/${t}/consumers/${i}/keys/${s}`,
|
|
520
528
|
{
|
|
521
529
|
method: "DELETE"
|
|
522
530
|
}
|
|
523
531
|
);
|
|
524
532
|
await n.signRequest(o);
|
|
525
533
|
const r = await fetch(o);
|
|
526
|
-
await
|
|
534
|
+
await A(r), D(r.ok, "Failed to delete API key");
|
|
527
535
|
},
|
|
528
536
|
updateConsumer: async (i, s) => {
|
|
529
537
|
const n = await fetch(
|
|
530
538
|
await s.signRequest(
|
|
531
539
|
new Request(
|
|
532
|
-
|
|
540
|
+
K + `/${t}/consumers/${i.id}`,
|
|
533
541
|
{
|
|
534
542
|
method: "PATCH",
|
|
535
543
|
headers: {
|
|
@@ -542,13 +550,13 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
542
550
|
)
|
|
543
551
|
)
|
|
544
552
|
);
|
|
545
|
-
await
|
|
553
|
+
await A(n), D(n.ok, "Failed to update API key description");
|
|
546
554
|
},
|
|
547
555
|
rollKey: async (i, s) => {
|
|
548
556
|
const n = await fetch(
|
|
549
557
|
await s.signRequest(
|
|
550
558
|
new Request(
|
|
551
|
-
|
|
559
|
+
K + `/${t}/consumers/${i}/roll-key`,
|
|
552
560
|
{
|
|
553
561
|
method: "POST",
|
|
554
562
|
headers: {
|
|
@@ -559,15 +567,15 @@ const He = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presen
|
|
|
559
567
|
)
|
|
560
568
|
)
|
|
561
569
|
);
|
|
562
|
-
await
|
|
570
|
+
await A(n), D(n.ok, "Failed to delete API key");
|
|
563
571
|
},
|
|
564
572
|
getConsumers: async (i) => {
|
|
565
573
|
const s = new Request(
|
|
566
|
-
|
|
574
|
+
K + `/${t}/consumers`
|
|
567
575
|
);
|
|
568
576
|
await i.signRequest(s);
|
|
569
577
|
const n = await fetch(s);
|
|
570
|
-
return await
|
|
578
|
+
return await A(n), D(n.ok, "Failed to fetch API keys"), (await n.json()).data.map((r) => ({
|
|
571
579
|
id: r.id,
|
|
572
580
|
label: r.label || r.subject || "API Key",
|
|
573
581
|
apiKeys: r.apiKeys.data,
|