zudoku 0.6.2-dev.4 → 0.6.2-dev.6

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.
Files changed (119) hide show
  1. package/dist/cli/dev/handler.js +5 -1
  2. package/dist/cli/dev/handler.js.map +1 -1
  3. package/dist/config/validators/InputSidebarSchema.d.ts +9 -0
  4. package/dist/config/validators/InputSidebarSchema.js +2 -0
  5. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  6. package/dist/config/validators/SidebarSchema.d.ts +9 -3
  7. package/dist/config/validators/SidebarSchema.js +7 -3
  8. package/dist/config/validators/SidebarSchema.js.map +1 -1
  9. package/dist/config/validators/validate.d.ts +26 -0
  10. package/dist/config/validators/validate.js +6 -0
  11. package/dist/config/validators/validate.js.map +1 -1
  12. package/dist/lib/components/navigation/SidebarCategory.js +5 -3
  13. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  14. package/dist/lib/components/navigation/SidebarItem.js +2 -2
  15. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  16. package/dist/lib/icons.d.ts +1 -0
  17. package/dist/lib/icons.js +2 -0
  18. package/dist/lib/icons.js.map +1 -0
  19. package/dist/lib/ui/Button.d.ts +2 -2
  20. package/dist/vite/plugin-icons.d.ts +3 -0
  21. package/dist/vite/plugin-icons.js +47 -0
  22. package/dist/vite/plugin-icons.js.map +1 -0
  23. package/dist/vite/plugin-sidebar.js +10 -1
  24. package/dist/vite/plugin-sidebar.js.map +1 -1
  25. package/dist/vite/plugin.js +2 -0
  26. package/dist/vite/plugin.js.map +1 -1
  27. package/dist/vite/prerender.js +23 -0
  28. package/dist/vite/prerender.js.map +1 -1
  29. package/lib/AuthenticationPlugin-BMjOjKqE.js +54 -0
  30. package/lib/{AuthenticationPlugin-DYnkydqa.js.map → AuthenticationPlugin-BMjOjKqE.js.map} +1 -1
  31. package/lib/CategoryHeading-BE8e6QdS.js +9 -0
  32. package/lib/{CategoryHeading-w2EW676o.js.map → CategoryHeading-BE8e6QdS.js.map} +1 -1
  33. package/lib/DeveloperHint-Bl9gIdNI.js +12 -0
  34. package/lib/{DeveloperHint-D87KcpDW.js.map → DeveloperHint-Bl9gIdNI.js.map} +1 -1
  35. package/lib/ErrorPage-CPR1XVKW.js +12 -0
  36. package/lib/{ErrorPage-BdHAg3Rg.js.map → ErrorPage-CPR1XVKW.js.map} +1 -1
  37. package/lib/Input-BBlyeDuG.js +2192 -0
  38. package/lib/Input-BBlyeDuG.js.map +1 -0
  39. package/lib/{Markdown-BZUoEvL7.js → Markdown-CCNihH_N.js} +3189 -3354
  40. package/lib/Markdown-CCNihH_N.js.map +1 -0
  41. package/lib/MdxPage-BavkYqzi.js +140 -0
  42. package/lib/MdxPage-BavkYqzi.js.map +1 -0
  43. package/lib/OperationList-C6Ps2keZ.js +460 -0
  44. package/lib/OperationList-C6Ps2keZ.js.map +1 -0
  45. package/lib/Route-xRJ9mJgH.js +13 -0
  46. package/lib/{Route-5sI-urRK.js.map → Route-xRJ9mJgH.js.map} +1 -1
  47. package/lib/{SidebarBadge-6EEz-Bwe.js → SidebarBadge-2JcxswKF.js} +47 -47
  48. package/lib/{SidebarBadge-6EEz-Bwe.js.map → SidebarBadge-2JcxswKF.js.map} +1 -1
  49. package/lib/SlotletProvider-CuB3Ts8r.js +213 -0
  50. package/lib/SlotletProvider-CuB3Ts8r.js.map +1 -0
  51. package/lib/Spinner-BlxzaFFF.js +6 -0
  52. package/lib/Spinner-BlxzaFFF.js.map +1 -0
  53. package/lib/{ZudokuContext-BHNQL3XO.js → ZudokuContext-JoyeA9dT.js} +78 -79
  54. package/lib/{ZudokuContext-BHNQL3XO.js.map → ZudokuContext-JoyeA9dT.js.map} +1 -1
  55. package/lib/{_commonjsHelpers-BVfed4GL.js → _commonjsHelpers-BkfeUUK-.js} +3 -3
  56. package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
  57. package/lib/{index-DdUotMOQ.js → index-BF4cn28H.js} +1953 -2196
  58. package/lib/index-BF4cn28H.js.map +1 -0
  59. package/lib/{index-BGY8VjAV.js → index-BLvMkqjO.js} +26 -26
  60. package/lib/{index-BGY8VjAV.js.map → index-BLvMkqjO.js.map} +1 -1
  61. package/lib/{index-CbJpF8Yf.js → index-G1-TGLO1.js} +8 -8
  62. package/lib/{index-CbJpF8Yf.js.map → index-G1-TGLO1.js.map} +1 -1
  63. package/lib/jsx-runtime-lNnQYwFN.js +2403 -0
  64. package/lib/jsx-runtime-lNnQYwFN.js.map +1 -0
  65. package/lib/{router-BiRCp01d.js → router-D2p7Olpn.js} +22 -22
  66. package/lib/{router-BiRCp01d.js.map → router-D2p7Olpn.js.map} +1 -1
  67. package/lib/{slugify-CiPVjteN.js → slugify-DbLhpSPt.js} +2 -2
  68. package/lib/{slugify-CiPVjteN.js.map → slugify-DbLhpSPt.js.map} +1 -1
  69. package/lib/{state-DsXXkBLH.js → state-lIwt9isb.js} +15 -15
  70. package/lib/{state-DsXXkBLH.js.map → state-lIwt9isb.js.map} +1 -1
  71. package/lib/{utils-BPHLKjns.js → utils-B8R4grFM.js} +152 -153
  72. package/lib/{utils-BPHLKjns.js.map → utils-B8R4grFM.js.map} +1 -1
  73. package/lib/zudoku.auth-auth0.js +16 -21
  74. package/lib/zudoku.auth-auth0.js.map +1 -1
  75. package/lib/zudoku.auth-clerk.js +32 -37
  76. package/lib/zudoku.auth-clerk.js.map +1 -1
  77. package/lib/zudoku.auth-openid.js +485 -505
  78. package/lib/zudoku.auth-openid.js.map +1 -1
  79. package/lib/zudoku.components.js +1574 -1782
  80. package/lib/zudoku.components.js.map +1 -1
  81. package/lib/zudoku.icons.js +2 -0
  82. package/lib/zudoku.icons.js.map +1 -0
  83. package/lib/zudoku.openapi-worker.js +2 -2
  84. package/lib/zudoku.plugin-api-keys.js +153 -268
  85. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  86. package/lib/zudoku.plugin-custom-page.js +5 -6
  87. package/lib/zudoku.plugin-custom-page.js.map +1 -1
  88. package/lib/zudoku.plugin-markdown.js +12 -13
  89. package/lib/zudoku.plugin-markdown.js.map +1 -1
  90. package/lib/zudoku.plugin-openapi.js +8 -8
  91. package/lib/zudoku.plugin-redirect.js +3 -3
  92. package/lib/zudoku.plugin-search-inkeep.js +20 -21
  93. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  94. package/package.json +7 -3
  95. package/src/lib/components/navigation/SidebarCategory.tsx +43 -31
  96. package/src/lib/components/navigation/SidebarItem.tsx +2 -1
  97. package/src/lib/icons.ts +1 -0
  98. package/lib/AuthenticationPlugin-DYnkydqa.js +0 -55
  99. package/lib/CategoryHeading-w2EW676o.js +0 -10
  100. package/lib/DeveloperHint-D87KcpDW.js +0 -16
  101. package/lib/ErrorPage-BdHAg3Rg.js +0 -18
  102. package/lib/Input-BmwltPfA.js +0 -2214
  103. package/lib/Input-BmwltPfA.js.map +0 -1
  104. package/lib/Markdown-BZUoEvL7.js.map +0 -1
  105. package/lib/MdxPage-E4NFxzHQ.js +0 -183
  106. package/lib/MdxPage-E4NFxzHQ.js.map +0 -1
  107. package/lib/OperationList-DVIuzHN7.js +0 -628
  108. package/lib/OperationList-DVIuzHN7.js.map +0 -1
  109. package/lib/Route-5sI-urRK.js +0 -14
  110. package/lib/SlotletProvider-CNyl5wU0.js +0 -262
  111. package/lib/SlotletProvider-CNyl5wU0.js.map +0 -1
  112. package/lib/Spinner-B9eFggre.js +0 -15
  113. package/lib/Spinner-B9eFggre.js.map +0 -1
  114. package/lib/_commonjsHelpers-BVfed4GL.js.map +0 -1
  115. package/lib/index-ChhUJhLT.js +0 -1771
  116. package/lib/index-ChhUJhLT.js.map +0 -1
  117. package/lib/index-DdUotMOQ.js.map +0 -1
  118. package/lib/jsx-runtime-B6kdoens.js +0 -635
  119. package/lib/jsx-runtime-B6kdoens.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ export * from "lucide-react";
2
+ //# sourceMappingURL=zudoku.icons.js.map
@@ -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 { a as Al } from "./_commonjsHelpers-BVfed4GL.js";
18
- import { s as xl } from "./slugify-CiPVjteN.js";
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 { j as e } from "./jsx-runtime-B6kdoens.js";
2
- import { S as p, R as g } from "./SlotletProvider-CNyl5wU0.js";
3
- import { u as j, a as u, I as v, S as k, b as w, c as b, d as K, e as N, f as y } from "./Input-BmwltPfA.js";
4
- import { e as E, L as x, O as A } from "./index-ChhUJhLT.js";
5
- import { u as m, t as C, j as S } from "./ZudokuContext-BHNQL3XO.js";
6
- import { B as l, p as I } from "./index-BGY8VjAV.js";
7
- import { D as P } from "./DeveloperHint-D87KcpDW.js";
8
- import { useState as h } from "react";
9
- import { c as d, a as D, C as R, g as q } from "./Markdown-BZUoEvL7.js";
10
- /**
11
- * @license lucide-react v0.378.0 - ISC
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 r = typeof s == "function" ? s() : s;
66
- throw new F(r ?? "Invariant failed");
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(s) {
70
- super(s), this.name = "ZudokuError";
17
+ constructor(t) {
18
+ super(t), this.name = "ZudokuError";
71
19
  }
72
20
  }
73
- const L = ({ service: t }) => {
74
- const s = m(), r = E(), n = j({
21
+ const j = ({ service: e }) => {
22
+ const t = y(), n = b(), a = R({
75
23
  defaultValues: {
76
24
  expiresOn: "30"
77
25
  }
78
- }), o = u({
79
- mutationFn: ({ description: i, expiresOn: a }) => {
80
- if (!t.createKey)
26
+ }), s = o({
27
+ mutationFn: ({ description: c, expiresOn: r }) => {
28
+ if (!e.createKey)
81
29
  throw new Error("deleteKey not implemented");
82
- const f = a !== "never" ? V(Number(a)) : void 0;
83
- return t.createKey(
84
- { description: i, expiresOn: f },
85
- s
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: () => r("/settings/api-keys/")
36
+ onSuccess: () => n("/settings/api-keys/")
89
37
  });
90
- return t.createKey ? /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
91
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-between mb-4 border-b pb-1", children: /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "New API Key" }) }),
92
- /* @__PURE__ */ e.jsx(
93
- "form",
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
- onSubmit: n.handleSubmit((i) => o.mutate(i)),
96
- children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col", children: [
97
- "Note",
98
- /* @__PURE__ */ e.jsx(v, { ...n.register("description") }),
99
- "Expiration",
100
- /* @__PURE__ */ e.jsxs(
101
- k,
102
- {
103
- onValueChange: (i) => n.setValue("expiresOn", i),
104
- defaultValue: n.getValues("expiresOn"),
105
- children: [
106
- /* @__PURE__ */ e.jsx(w, { children: /* @__PURE__ */ e.jsx(b, {}) }),
107
- /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsxs(N, { children: [
108
- [7, 30, 60, 90].map((i) => /* @__PURE__ */ e.jsxs(y, { value: String(i), children: [
109
- i,
110
- " days"
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
- }), o = u({
144
- mutationFn: (a) => {
145
- if (!t.deleteKey)
64
+ }), s = o({
65
+ mutationFn: (r) => {
66
+ if (!e.deleteKey)
146
67
  throw new Error("deleteKey not implemented");
147
- return t.deleteKey(a, s);
68
+ return e.deleteKey(r, t);
148
69
  },
149
70
  onSuccess: () => {
150
- r.invalidateQueries({ queryKey: ["api-keys"] });
71
+ n.invalidateQueries({ queryKey: ["api-keys"] });
151
72
  }
152
- }), i = u({
153
- mutationFn: (a) => {
154
- if (!t.rollKey)
73
+ }), c = o({
74
+ mutationFn: (r) => {
75
+ if (!e.rollKey)
155
76
  throw new Error("rollKey not implemented");
156
- return t.rollKey(a, s);
77
+ return e.rollKey(r, t);
157
78
  },
158
- onSuccess: () => r.invalidateQueries({ queryKey: ["api-keys"] })
79
+ onSuccess: () => n.invalidateQueries({ queryKey: ["api-keys"] })
159
80
  });
160
- return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
161
- /* @__PURE__ */ e.jsx(p, { name: "api-keys-list-page" }),
162
- /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mb-4 border-b pb-3", children: [
163
- /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
164
- t.createKey && /* @__PURE__ */ e.jsx(l, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/new", children: "Create API Key" }) })
165
- ] }),
166
- /* @__PURE__ */ e.jsx(p, { name: "api-keys-list-page-before-keys" }),
167
- n.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-4 items-center p-8 border rounded bg-muted/30 text-muted-foreground", children: [
168
- /* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
169
- "No API keys created yet.",
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: D(
178
- "grid grid-cols-1 rounded border divide-y divide-border",
179
- "lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]"
180
- ),
181
- children: n.map((a) => /* @__PURE__ */ e.jsxs(
182
- "li",
183
- {
184
- className: "p-5 grid grid-cols-subgrid col-span-full gap-2 items-center",
185
- children: [
186
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 text-sm", children: [
187
- a.description ?? a.id,
188
- /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
189
- a.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
190
- "Created on ",
191
- new Date(a.createdOn).toLocaleDateString()
192
- ] }),
193
- a.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
194
- "Expires on ",
195
- new Date(a.expiresOn).toLocaleDateString()
196
- ] })
197
- ] })
198
- ] }),
199
- /* @__PURE__ */ e.jsx("div", { className: "items-center flex lg:justify-center", children: /* @__PURE__ */ e.jsx(Q, { apiKey: a.key }) }),
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
- a.id
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: "icon",
256
- children: n ? /* @__PURE__ */ e.jsx(R, { size: 16 }) : /* @__PURE__ */ e.jsx(q, { size: 16 })
257
- }
258
- )
259
- ] });
260
- }, B = "https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev", G = (t) => ({
261
- deleteKey: async (s, r) => {
262
- const n = new Request(t + `/v1/developer/api-keys/${s}`, {
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 r.signRequest(n);
266
- const o = await fetch(n);
267
- c(o.ok, "Failed to delete API key");
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 (s, r) => {
270
- const n = await fetch(
271
- await r.signRequest(
272
- new Request(t + `/v1/developer/api-keys/${s}/key`, {
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
- c(n.ok, "Failed to delete API key");
162
+ i(a.ok, "Failed to delete API key");
278
163
  },
279
- createKey: async (s, r) => {
280
- const n = new Request(t + "/v1/developer/api-keys", {
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(s)
170
+ body: JSON.stringify(t)
286
171
  });
287
- await r.signRequest(n);
288
- const o = await fetch(n);
289
- c(o.ok, "Failed to create API key");
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 (s) => {
292
- const r = new Request(t + "/v1/developer/api-keys");
293
- await s.signRequest(r);
294
- const n = await fetch(r);
295
- return c(n.ok, "Failed to fetch API keys"), await n.json();
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
- }), se = (t) => {
298
- const s = "endpoint" in t ? t.endpoint : B, r = "getKeys" in t ? t : G(s);
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 (n) => {
191
+ getIdentities: async (a) => {
307
192
  try {
308
- return (await r.getKeys(n)).map((i) => ({
309
- authorizeRequest: (a) => (a.headers.set("Authorization", `Bearer ${i.key}`), a),
310
- id: i.id,
311
- label: i.description ?? i.id
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__ */ e.jsx(Z, {}),
320
- errorElement: /* @__PURE__ */ e.jsx(g, {}),
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__ */ e.jsx(_, { service: r })
209
+ element: /* @__PURE__ */ React.createElement(M, { service: n })
325
210
  },
326
211
  {
327
212
  path: "/settings/api-keys/new",
328
- element: /* @__PURE__ */ e.jsx(L, { service: r })
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
- se as apiKeyPlugin
221
+ ee as apiKeyPlugin
337
222
  };
338
223
  //# sourceMappingURL=zudoku.plugin-api-keys.js.map