zudoku 0.7.2-dev.11 → 0.7.2-dev.12
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/cli/dev/handler.js +5 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +9 -0
- package/dist/config/validators/InputSidebarSchema.js +2 -0
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/SidebarSchema.d.ts +9 -3
- package/dist/config/validators/SidebarSchema.js +7 -3
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +26 -0
- package/dist/config/validators/validate.js +6 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +5 -3
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +2 -2
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/icons.d.ts +1 -0
- package/dist/lib/icons.js +2 -0
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/vite/plugin-icons.d.ts +3 -0
- package/dist/vite/plugin-icons.js +47 -0
- package/dist/vite/plugin-icons.js.map +1 -0
- package/dist/vite/plugin-sidebar.js +10 -1
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +2 -0
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.js +23 -0
- package/dist/vite/prerender.js.map +1 -1
- package/lib/AuthenticationPlugin-BMjOjKqE.js +54 -0
- package/lib/{AuthenticationPlugin-DYnkydqa.js.map → AuthenticationPlugin-BMjOjKqE.js.map} +1 -1
- package/lib/CategoryHeading-BE8e6QdS.js +9 -0
- package/lib/{CategoryHeading-w2EW676o.js.map → CategoryHeading-BE8e6QdS.js.map} +1 -1
- package/lib/DeveloperHint-Bl9gIdNI.js +12 -0
- package/lib/{DeveloperHint-D87KcpDW.js.map → DeveloperHint-Bl9gIdNI.js.map} +1 -1
- package/lib/ErrorPage-CPR1XVKW.js +12 -0
- package/lib/{ErrorPage-BdHAg3Rg.js.map → ErrorPage-CPR1XVKW.js.map} +1 -1
- package/lib/Input-BBlyeDuG.js +2192 -0
- package/lib/Input-BBlyeDuG.js.map +1 -0
- package/lib/{Markdown-BZUoEvL7.js → Markdown-CCNihH_N.js} +3189 -3354
- package/lib/Markdown-CCNihH_N.js.map +1 -0
- package/lib/MdxPage-BavkYqzi.js +140 -0
- package/lib/MdxPage-BavkYqzi.js.map +1 -0
- package/lib/OperationList-C6Ps2keZ.js +460 -0
- package/lib/OperationList-C6Ps2keZ.js.map +1 -0
- package/lib/Route-xRJ9mJgH.js +13 -0
- package/lib/{Route-5sI-urRK.js.map → Route-xRJ9mJgH.js.map} +1 -1
- package/lib/{SidebarBadge-6EEz-Bwe.js → SidebarBadge-2JcxswKF.js} +47 -47
- package/lib/{SidebarBadge-6EEz-Bwe.js.map → SidebarBadge-2JcxswKF.js.map} +1 -1
- package/lib/SlotletProvider-CuB3Ts8r.js +213 -0
- package/lib/SlotletProvider-CuB3Ts8r.js.map +1 -0
- package/lib/Spinner-BlxzaFFF.js +6 -0
- package/lib/Spinner-BlxzaFFF.js.map +1 -0
- package/lib/{ZudokuContext-BHNQL3XO.js → ZudokuContext-JoyeA9dT.js} +78 -79
- package/lib/{ZudokuContext-BHNQL3XO.js.map → ZudokuContext-JoyeA9dT.js.map} +1 -1
- package/lib/{_commonjsHelpers-BVfed4GL.js → _commonjsHelpers-BkfeUUK-.js} +3 -3
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
- package/lib/{index-DdUotMOQ.js → index-BF4cn28H.js} +1953 -2196
- package/lib/index-BF4cn28H.js.map +1 -0
- package/lib/{index-BGY8VjAV.js → index-BLvMkqjO.js} +26 -26
- package/lib/{index-BGY8VjAV.js.map → index-BLvMkqjO.js.map} +1 -1
- package/lib/{index-CbJpF8Yf.js → index-G1-TGLO1.js} +8 -8
- package/lib/{index-CbJpF8Yf.js.map → index-G1-TGLO1.js.map} +1 -1
- package/lib/jsx-runtime-lNnQYwFN.js +2403 -0
- package/lib/jsx-runtime-lNnQYwFN.js.map +1 -0
- package/lib/{router-BiRCp01d.js → router-D2p7Olpn.js} +22 -22
- package/lib/{router-BiRCp01d.js.map → router-D2p7Olpn.js.map} +1 -1
- package/lib/{slugify-CiPVjteN.js → slugify-DbLhpSPt.js} +2 -2
- package/lib/{slugify-CiPVjteN.js.map → slugify-DbLhpSPt.js.map} +1 -1
- package/lib/{state-DsXXkBLH.js → state-lIwt9isb.js} +15 -15
- package/lib/{state-DsXXkBLH.js.map → state-lIwt9isb.js.map} +1 -1
- package/lib/{utils-BPHLKjns.js → utils-B8R4grFM.js} +152 -153
- package/lib/{utils-BPHLKjns.js.map → utils-B8R4grFM.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +16 -21
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +32 -37
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +485 -505
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1574 -1782
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.icons.js +2 -0
- package/lib/zudoku.icons.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +2 -2
- package/lib/zudoku.plugin-api-keys.js +153 -268
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-page.js +5 -6
- package/lib/zudoku.plugin-custom-page.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +12 -13
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +8 -8
- package/lib/zudoku.plugin-redirect.js +3 -3
- package/lib/zudoku.plugin-search-inkeep.js +20 -21
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +7 -3
- package/src/lib/components/navigation/SidebarCategory.tsx +43 -31
- package/src/lib/components/navigation/SidebarItem.tsx +2 -1
- package/src/lib/icons.ts +1 -0
- package/lib/AuthenticationPlugin-DYnkydqa.js +0 -55
- package/lib/CategoryHeading-w2EW676o.js +0 -10
- package/lib/DeveloperHint-D87KcpDW.js +0 -16
- package/lib/ErrorPage-BdHAg3Rg.js +0 -18
- package/lib/Input-BmwltPfA.js +0 -2214
- package/lib/Input-BmwltPfA.js.map +0 -1
- package/lib/Markdown-BZUoEvL7.js.map +0 -1
- package/lib/MdxPage-E4NFxzHQ.js +0 -183
- package/lib/MdxPage-E4NFxzHQ.js.map +0 -1
- package/lib/OperationList-DVIuzHN7.js +0 -628
- package/lib/OperationList-DVIuzHN7.js.map +0 -1
- package/lib/Route-5sI-urRK.js +0 -14
- package/lib/SlotletProvider-CNyl5wU0.js +0 -262
- package/lib/SlotletProvider-CNyl5wU0.js.map +0 -1
- package/lib/Spinner-B9eFggre.js +0 -15
- package/lib/Spinner-B9eFggre.js.map +0 -1
- package/lib/_commonjsHelpers-BVfed4GL.js.map +0 -1
- package/lib/index-ChhUJhLT.js +0 -1771
- package/lib/index-ChhUJhLT.js.map +0 -1
- package/lib/index-DdUotMOQ.js.map +0 -1
- package/lib/jsx-runtime-B6kdoens.js +0 -635
- package/lib/jsx-runtime-B6kdoens.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zudoku.icons.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -14,8 +14,8 @@ var vn = (t, e, n, i) => ({
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
import { C as Ua, c as Va, m as Ba, f as Ga } from "./urql-YhcsXYy8.js";
|
|
17
|
-
import {
|
|
18
|
-
import { s as xl } from "./slugify-
|
|
17
|
+
import { g as Al } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
18
|
+
import { s as xl } from "./slugify-DbLhpSPt.js";
|
|
19
19
|
function Fl(t, e) {
|
|
20
20
|
for (var n = 0; n < e.length; n++) {
|
|
21
21
|
const i = e[n];
|
|
@@ -1,301 +1,186 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useState as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the ISC license.
|
|
14
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/
|
|
16
|
-
const z = d("EyeOff", [
|
|
17
|
-
["path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24", key: "1jxqfv" }],
|
|
18
|
-
[
|
|
19
|
-
"path",
|
|
20
|
-
{
|
|
21
|
-
d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",
|
|
22
|
-
key: "9wicm4"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
[
|
|
26
|
-
"path",
|
|
27
|
-
{ d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61", key: "1jreej" }
|
|
28
|
-
],
|
|
29
|
-
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
|
|
30
|
-
]);
|
|
31
|
-
/**
|
|
32
|
-
* @license lucide-react v0.378.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/
|
|
37
|
-
const O = d("Eye", [
|
|
38
|
-
["path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z", key: "rwhkz3" }],
|
|
39
|
-
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
40
|
-
]);
|
|
41
|
-
/**
|
|
42
|
-
* @license lucide-react v0.378.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/
|
|
47
|
-
const M = d("RotateCw", [
|
|
48
|
-
["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
|
|
49
|
-
["path", { d: "M21 3v5h-5", key: "1q7to0" }]
|
|
50
|
-
]);
|
|
51
|
-
/**
|
|
52
|
-
* @license lucide-react v0.378.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/
|
|
57
|
-
const T = d("Trash", [
|
|
58
|
-
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
59
|
-
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
60
|
-
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }]
|
|
61
|
-
]);
|
|
62
|
-
function c(t, s) {
|
|
63
|
-
if (t)
|
|
1
|
+
import { S as u, R as f } from "./SlotletProvider-CuB3Ts8r.js";
|
|
2
|
+
import { u as R, a as o, I as g, S as h, b as x, c as v, d as k, e as w, f as d } from "./Input-BBlyeDuG.js";
|
|
3
|
+
import { a as b, L as m, O as K } from "./jsx-runtime-lNnQYwFN.js";
|
|
4
|
+
import { u as y, a as N, b as I } from "./ZudokuContext-JoyeA9dT.js";
|
|
5
|
+
import { B as l, m as S } from "./index-BLvMkqjO.js";
|
|
6
|
+
import { D as A } from "./DeveloperHint-Bl9gIdNI.js";
|
|
7
|
+
import { RotateCwIcon as C, TrashIcon as P, EyeOffIcon as D, EyeIcon as q, CheckIcon as O, CopyIcon as z } from "lucide-react";
|
|
8
|
+
import { useState as p } from "react";
|
|
9
|
+
import { a as T } from "./Markdown-CCNihH_N.js";
|
|
10
|
+
function i(e, t) {
|
|
11
|
+
if (e)
|
|
64
12
|
return;
|
|
65
|
-
const
|
|
66
|
-
throw new F(
|
|
13
|
+
const n = typeof t == "function" ? t() : t;
|
|
14
|
+
throw new F(n ?? "Invariant failed");
|
|
67
15
|
}
|
|
68
16
|
class F extends Error {
|
|
69
|
-
constructor(
|
|
70
|
-
super(
|
|
17
|
+
constructor(t) {
|
|
18
|
+
super(t), this.name = "ZudokuError";
|
|
71
19
|
}
|
|
72
20
|
}
|
|
73
|
-
const
|
|
74
|
-
const
|
|
21
|
+
const j = ({ service: e }) => {
|
|
22
|
+
const t = y(), n = b(), a = R({
|
|
75
23
|
defaultValues: {
|
|
76
24
|
expiresOn: "30"
|
|
77
25
|
}
|
|
78
|
-
}),
|
|
79
|
-
mutationFn: ({ description:
|
|
80
|
-
if (!
|
|
26
|
+
}), s = o({
|
|
27
|
+
mutationFn: ({ description: c, expiresOn: r }) => {
|
|
28
|
+
if (!e.createKey)
|
|
81
29
|
throw new Error("deleteKey not implemented");
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
{ description:
|
|
85
|
-
|
|
30
|
+
const E = r !== "never" ? L(Number(r)) : void 0;
|
|
31
|
+
return e.createKey(
|
|
32
|
+
{ description: c, expiresOn: E },
|
|
33
|
+
t
|
|
86
34
|
);
|
|
87
35
|
},
|
|
88
|
-
onSuccess: () =>
|
|
36
|
+
onSuccess: () => n("/settings/api-keys/")
|
|
89
37
|
});
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
38
|
+
return e.createKey ? /* @__PURE__ */ React.createElement("div", { className: "max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]" }, /* @__PURE__ */ React.createElement("div", { className: "flex justify-between mb-4 border-b pb-1" }, /* @__PURE__ */ React.createElement("h1", { className: "font-medium text-2xl" }, "New API Key")), /* @__PURE__ */ React.createElement(
|
|
39
|
+
"form",
|
|
40
|
+
{
|
|
41
|
+
onSubmit: a.handleSubmit((c) => s.mutate(c))
|
|
42
|
+
},
|
|
43
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex gap-2 flex-col" }, "Note", /* @__PURE__ */ React.createElement(g, { ...a.register("description") }), "Expiration", /* @__PURE__ */ React.createElement(
|
|
44
|
+
h,
|
|
94
45
|
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
] }, i)),
|
|
112
|
-
/* @__PURE__ */ e.jsx(y, { value: "never", children: "Never" })
|
|
113
|
-
] }) })
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
118
|
-
/* @__PURE__ */ e.jsx(l, { children: "Generate Key" }),
|
|
119
|
-
/* @__PURE__ */ e.jsx(l, { variant: "outline", asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/", children: "Cancel" }) })
|
|
120
|
-
] })
|
|
121
|
-
] })
|
|
122
|
-
}
|
|
123
|
-
)
|
|
124
|
-
] }) : null;
|
|
125
|
-
}, V = (t) => {
|
|
126
|
-
const s = /* @__PURE__ */ new Date();
|
|
127
|
-
return s.setDate(s.getDate() + t), s.toISOString();
|
|
128
|
-
}, Z = () => {
|
|
129
|
-
const t = I();
|
|
130
|
-
return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(A, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
|
|
131
|
-
"Please login first to view this page",
|
|
132
|
-
/* @__PURE__ */ e.jsx(l, { onClick: () => t.login(), children: "Login" })
|
|
133
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(P, { className: "max-w-[600px]", children: [
|
|
134
|
-
"Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
|
|
135
|
-
/* @__PURE__ */ e.jsx("code", { children: "authentication" }),
|
|
136
|
-
"."
|
|
137
|
-
] }) });
|
|
138
|
-
}, _ = ({ service: t }) => {
|
|
139
|
-
const s = m(), r = C(), { data: n } = S({
|
|
140
|
-
queryFn: () => t.getKeys(s),
|
|
46
|
+
onValueChange: (c) => a.setValue("expiresOn", c),
|
|
47
|
+
defaultValue: a.getValues("expiresOn")
|
|
48
|
+
},
|
|
49
|
+
/* @__PURE__ */ React.createElement(x, null, /* @__PURE__ */ React.createElement(v, null)),
|
|
50
|
+
/* @__PURE__ */ React.createElement(k, null, /* @__PURE__ */ React.createElement(w, null, [7, 30, 60, 90].map((c) => /* @__PURE__ */ React.createElement(d, { value: String(c), key: c }, c, " days")), /* @__PURE__ */ React.createElement(d, { value: "never" }, "Never")))
|
|
51
|
+
), /* @__PURE__ */ React.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React.createElement(l, null, "Generate Key"), /* @__PURE__ */ React.createElement(l, { variant: "outline", asChild: !0 }, /* @__PURE__ */ React.createElement(m, { to: "/settings/api-keys/" }, "Cancel"))))
|
|
52
|
+
)) : null;
|
|
53
|
+
}, L = (e) => {
|
|
54
|
+
const t = /* @__PURE__ */ new Date();
|
|
55
|
+
return t.setDate(t.getDate() + e), t.toISOString();
|
|
56
|
+
}, V = () => {
|
|
57
|
+
const e = S();
|
|
58
|
+
return e.isAuthEnabled && e.isPending ? null : e.isAuthenticated ? /* @__PURE__ */ React.createElement(K, null) : e.isAuthEnabled ? /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2" }, "Please login first to view this page", /* @__PURE__ */ React.createElement(l, { onClick: () => e.login() }, "Login")) : /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2" }, /* @__PURE__ */ React.createElement(A, { className: "max-w-[600px]" }, "Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ", /* @__PURE__ */ React.createElement("code", null, "authentication"), "."));
|
|
59
|
+
}, M = ({ service: e }) => {
|
|
60
|
+
const t = y(), n = N(), { data: a } = I({
|
|
61
|
+
queryFn: () => e.getKeys(t),
|
|
141
62
|
queryKey: ["api-keys"],
|
|
142
63
|
retry: !1
|
|
143
|
-
}),
|
|
144
|
-
mutationFn: (
|
|
145
|
-
if (!
|
|
64
|
+
}), s = o({
|
|
65
|
+
mutationFn: (r) => {
|
|
66
|
+
if (!e.deleteKey)
|
|
146
67
|
throw new Error("deleteKey not implemented");
|
|
147
|
-
return
|
|
68
|
+
return e.deleteKey(r, t);
|
|
148
69
|
},
|
|
149
70
|
onSuccess: () => {
|
|
150
|
-
|
|
71
|
+
n.invalidateQueries({ queryKey: ["api-keys"] });
|
|
151
72
|
}
|
|
152
|
-
}),
|
|
153
|
-
mutationFn: (
|
|
154
|
-
if (!
|
|
73
|
+
}), c = o({
|
|
74
|
+
mutationFn: (r) => {
|
|
75
|
+
if (!e.rollKey)
|
|
155
76
|
throw new Error("rollKey not implemented");
|
|
156
|
-
return
|
|
77
|
+
return e.rollKey(r, t);
|
|
157
78
|
},
|
|
158
|
-
onSuccess: () =>
|
|
79
|
+
onSuccess: () => n.invalidateQueries({ queryKey: ["api-keys"] })
|
|
159
80
|
});
|
|
160
|
-
return /* @__PURE__ */
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */ e.jsx("br", {}),
|
|
171
|
-
"Get started and create your first key."
|
|
172
|
-
] }),
|
|
173
|
-
t.createKey && /* @__PURE__ */ e.jsx(l, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/new", children: "Create API Key" }) })
|
|
174
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
175
|
-
"ul",
|
|
81
|
+
return /* @__PURE__ */ React.createElement("div", { className: "max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]" }, /* @__PURE__ */ React.createElement(u, { name: "api-keys-list-page" }), /* @__PURE__ */ React.createElement("div", { className: "flex justify-between mb-4 border-b pb-3" }, /* @__PURE__ */ React.createElement("h1", { className: "font-medium text-2xl" }, "API Keys"), e.createKey && /* @__PURE__ */ React.createElement(l, { asChild: !0 }, /* @__PURE__ */ React.createElement(m, { to: "/settings/api-keys/new" }, "Create API Key"))), /* @__PURE__ */ React.createElement(u, { name: "api-keys-list-page-before-keys" }), a.length === 0 ? /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center gap-4 items-center p-8 border rounded bg-muted/30 text-muted-foreground" }, /* @__PURE__ */ React.createElement("p", { className: "text-center" }, "No API keys created yet.", /* @__PURE__ */ React.createElement("br", null), "Get started and create your first key."), e.createKey && /* @__PURE__ */ React.createElement(l, { asChild: !0, variant: "outline" }, /* @__PURE__ */ React.createElement(m, { to: "/settings/api-keys/new" }, "Create API Key"))) : /* @__PURE__ */ React.createElement(
|
|
82
|
+
"ul",
|
|
83
|
+
{
|
|
84
|
+
className: T(
|
|
85
|
+
"grid grid-cols-1 rounded border divide-y divide-border",
|
|
86
|
+
"lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]"
|
|
87
|
+
)
|
|
88
|
+
},
|
|
89
|
+
a.map((r) => /* @__PURE__ */ React.createElement(
|
|
90
|
+
"li",
|
|
176
91
|
{
|
|
177
|
-
className:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
201
|
-
t.rollKey && /* @__PURE__ */ e.jsx(
|
|
202
|
-
l,
|
|
203
|
-
{
|
|
204
|
-
size: "icon",
|
|
205
|
-
title: "Roll this key",
|
|
206
|
-
variant: "ghost",
|
|
207
|
-
onClick: () => {
|
|
208
|
-
confirm("Do you want to roll this key?") && i.mutate(a.id);
|
|
209
|
-
},
|
|
210
|
-
children: /* @__PURE__ */ e.jsx(M, { size: 16 })
|
|
211
|
-
}
|
|
212
|
-
),
|
|
213
|
-
t.deleteKey && /* @__PURE__ */ e.jsx(
|
|
214
|
-
l,
|
|
215
|
-
{
|
|
216
|
-
variant: "ghost",
|
|
217
|
-
size: "icon",
|
|
218
|
-
onClick: () => {
|
|
219
|
-
confirm("Do you want to delete this key?") && o.mutate(a.id);
|
|
220
|
-
},
|
|
221
|
-
disabled: o.isPending,
|
|
222
|
-
children: /* @__PURE__ */ e.jsx(T, { size: 16 })
|
|
223
|
-
}
|
|
224
|
-
)
|
|
225
|
-
] })
|
|
226
|
-
]
|
|
92
|
+
className: "p-5 grid grid-cols-subgrid col-span-full gap-2 items-center",
|
|
93
|
+
key: r.id
|
|
94
|
+
},
|
|
95
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1 text-sm" }, r.description ?? r.id, /* @__PURE__ */ React.createElement("div", { className: "text-muted-foreground text-xs" }, r.createdOn && /* @__PURE__ */ React.createElement("div", null, "Created on ", new Date(r.createdOn).toLocaleDateString()), r.expiresOn && /* @__PURE__ */ React.createElement("div", null, "Expires on ", new Date(r.expiresOn).toLocaleDateString()))),
|
|
96
|
+
/* @__PURE__ */ React.createElement("div", { className: "items-center flex lg:justify-center" }, /* @__PURE__ */ React.createElement(_, { apiKey: r.key })),
|
|
97
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex gap-2" }, e.rollKey && /* @__PURE__ */ React.createElement(
|
|
98
|
+
l,
|
|
99
|
+
{
|
|
100
|
+
size: "icon",
|
|
101
|
+
title: "Roll this key",
|
|
102
|
+
variant: "ghost",
|
|
103
|
+
onClick: () => {
|
|
104
|
+
confirm("Do you want to roll this key?") && c.mutate(r.id);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
/* @__PURE__ */ React.createElement(C, { size: 16 })
|
|
108
|
+
), e.deleteKey && /* @__PURE__ */ React.createElement(
|
|
109
|
+
l,
|
|
110
|
+
{
|
|
111
|
+
variant: "ghost",
|
|
112
|
+
size: "icon",
|
|
113
|
+
onClick: () => {
|
|
114
|
+
confirm("Do you want to delete this key?") && s.mutate(r.id);
|
|
227
115
|
},
|
|
228
|
-
|
|
229
|
-
))
|
|
230
|
-
}
|
|
231
|
-
)
|
|
232
|
-
] });
|
|
233
|
-
}, Q = ({ apiKey: t }) => {
|
|
234
|
-
const [s, r] = h(!1), [n, o] = h(!1);
|
|
235
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm", children: [
|
|
236
|
-
/* @__PURE__ */ e.jsx("div", { className: "border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono truncate h-9 items-center flex px-2", children: s ? t : "•".repeat(t.length) }),
|
|
237
|
-
/* @__PURE__ */ e.jsx(
|
|
238
|
-
l,
|
|
239
|
-
{
|
|
240
|
-
variant: "outline",
|
|
241
|
-
onClick: () => r((i) => !i),
|
|
242
|
-
size: "icon",
|
|
243
|
-
children: s ? /* @__PURE__ */ e.jsx(z, { size: 16 }) : /* @__PURE__ */ e.jsx(O, { size: 16 })
|
|
244
|
-
}
|
|
245
|
-
),
|
|
246
|
-
/* @__PURE__ */ e.jsx(
|
|
247
|
-
l,
|
|
248
|
-
{
|
|
249
|
-
variant: "outline",
|
|
250
|
-
onClick: () => {
|
|
251
|
-
navigator.clipboard.writeText(t).then(() => {
|
|
252
|
-
o(!0), setTimeout(() => o(!1), 2e3);
|
|
253
|
-
});
|
|
116
|
+
disabled: s.isPending
|
|
254
117
|
},
|
|
255
|
-
size:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
118
|
+
/* @__PURE__ */ React.createElement(P, { size: 16 })
|
|
119
|
+
))
|
|
120
|
+
))
|
|
121
|
+
));
|
|
122
|
+
}, _ = ({ apiKey: e }) => {
|
|
123
|
+
const [t, n] = p(!1), [a, s] = p(!1);
|
|
124
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex gap-2 items-center text-sm" }, /* @__PURE__ */ React.createElement("div", { className: "border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono truncate h-9 items-center flex px-2" }, t ? e : "•".repeat(e.length)), /* @__PURE__ */ React.createElement(
|
|
125
|
+
l,
|
|
126
|
+
{
|
|
127
|
+
variant: "outline",
|
|
128
|
+
onClick: () => n((c) => !c),
|
|
129
|
+
size: "icon"
|
|
130
|
+
},
|
|
131
|
+
t ? /* @__PURE__ */ React.createElement(D, { size: 16 }) : /* @__PURE__ */ React.createElement(q, { size: 16 })
|
|
132
|
+
), /* @__PURE__ */ React.createElement(
|
|
133
|
+
l,
|
|
134
|
+
{
|
|
135
|
+
variant: "outline",
|
|
136
|
+
onClick: () => {
|
|
137
|
+
navigator.clipboard.writeText(e).then(() => {
|
|
138
|
+
s(!0), setTimeout(() => s(!1), 2e3);
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
size: "icon"
|
|
142
|
+
},
|
|
143
|
+
a ? /* @__PURE__ */ React.createElement(O, { size: 16 }) : /* @__PURE__ */ React.createElement(z, { size: 16 })
|
|
144
|
+
));
|
|
145
|
+
}, Q = "https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev", Z = (e) => ({
|
|
146
|
+
deleteKey: async (t, n) => {
|
|
147
|
+
const a = new Request(e + `/v1/developer/api-keys/${t}`, {
|
|
263
148
|
method: "DELETE"
|
|
264
149
|
});
|
|
265
|
-
await
|
|
266
|
-
const
|
|
267
|
-
|
|
150
|
+
await n.signRequest(a);
|
|
151
|
+
const s = await fetch(a);
|
|
152
|
+
i(s.ok, "Failed to delete API key");
|
|
268
153
|
},
|
|
269
|
-
rollKey: async (
|
|
270
|
-
const
|
|
271
|
-
await
|
|
272
|
-
new Request(
|
|
154
|
+
rollKey: async (t, n) => {
|
|
155
|
+
const a = await fetch(
|
|
156
|
+
await n.signRequest(
|
|
157
|
+
new Request(e + `/v1/developer/api-keys/${t}/key`, {
|
|
273
158
|
method: "DELETE"
|
|
274
159
|
})
|
|
275
160
|
)
|
|
276
161
|
);
|
|
277
|
-
|
|
162
|
+
i(a.ok, "Failed to delete API key");
|
|
278
163
|
},
|
|
279
|
-
createKey: async (
|
|
280
|
-
const
|
|
164
|
+
createKey: async (t, n) => {
|
|
165
|
+
const a = new Request(e + "/v1/developer/api-keys", {
|
|
281
166
|
method: "POST",
|
|
282
167
|
headers: {
|
|
283
168
|
"Content-Type": "application/json"
|
|
284
169
|
},
|
|
285
|
-
body: JSON.stringify(
|
|
170
|
+
body: JSON.stringify(t)
|
|
286
171
|
});
|
|
287
|
-
await
|
|
288
|
-
const
|
|
289
|
-
|
|
172
|
+
await n.signRequest(a);
|
|
173
|
+
const s = await fetch(a);
|
|
174
|
+
i(s.ok, "Failed to create API key");
|
|
290
175
|
},
|
|
291
|
-
getKeys: async (
|
|
292
|
-
const
|
|
293
|
-
await
|
|
294
|
-
const
|
|
295
|
-
return
|
|
176
|
+
getKeys: async (t) => {
|
|
177
|
+
const n = new Request(e + "/v1/developer/api-keys");
|
|
178
|
+
await t.signRequest(n);
|
|
179
|
+
const a = await fetch(n);
|
|
180
|
+
return i(a.ok, "Failed to fetch API keys"), await a.json();
|
|
296
181
|
}
|
|
297
|
-
}),
|
|
298
|
-
const
|
|
182
|
+
}), ee = (e) => {
|
|
183
|
+
const t = "endpoint" in e ? e.endpoint : Q, n = "getKeys" in e ? e : Z(t);
|
|
299
184
|
return {
|
|
300
185
|
getProfileMenuItems: () => [
|
|
301
186
|
{
|
|
@@ -303,12 +188,12 @@ const L = ({ service: t }) => {
|
|
|
303
188
|
path: "/settings/api-keys"
|
|
304
189
|
}
|
|
305
190
|
],
|
|
306
|
-
getIdentities: async (
|
|
191
|
+
getIdentities: async (a) => {
|
|
307
192
|
try {
|
|
308
|
-
return (await
|
|
309
|
-
authorizeRequest: (
|
|
310
|
-
id:
|
|
311
|
-
label:
|
|
193
|
+
return (await n.getKeys(a)).map((c) => ({
|
|
194
|
+
authorizeRequest: (r) => (r.headers.set("Authorization", `Bearer ${c.key}`), r),
|
|
195
|
+
id: c.id,
|
|
196
|
+
label: c.description ?? c.id
|
|
312
197
|
}));
|
|
313
198
|
} catch {
|
|
314
199
|
return [];
|
|
@@ -316,16 +201,16 @@ const L = ({ service: t }) => {
|
|
|
316
201
|
},
|
|
317
202
|
getRoutes: () => [
|
|
318
203
|
{
|
|
319
|
-
element: /* @__PURE__ */
|
|
320
|
-
errorElement: /* @__PURE__ */
|
|
204
|
+
element: /* @__PURE__ */ React.createElement(V, null),
|
|
205
|
+
errorElement: /* @__PURE__ */ React.createElement(f, null),
|
|
321
206
|
children: [
|
|
322
207
|
{
|
|
323
208
|
path: "/settings/api-keys",
|
|
324
|
-
element: /* @__PURE__ */
|
|
209
|
+
element: /* @__PURE__ */ React.createElement(M, { service: n })
|
|
325
210
|
},
|
|
326
211
|
{
|
|
327
212
|
path: "/settings/api-keys/new",
|
|
328
|
-
element: /* @__PURE__ */
|
|
213
|
+
element: /* @__PURE__ */ React.createElement(j, { service: n })
|
|
329
214
|
}
|
|
330
215
|
]
|
|
331
216
|
}
|
|
@@ -333,6 +218,6 @@ const L = ({ service: t }) => {
|
|
|
333
218
|
};
|
|
334
219
|
};
|
|
335
220
|
export {
|
|
336
|
-
|
|
221
|
+
ee as apiKeyPlugin
|
|
337
222
|
};
|
|
338
223
|
//# sourceMappingURL=zudoku.plugin-api-keys.js.map
|