@burdenoff/microfe-devportal 2026.616.1 → 2026.622.1
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/devportal/hooks/usePackageUpload.js +11 -11
- package/dist/devportal/hooks/usePackageUpload.js.map +1 -1
- package/dist/devportal/pages/ApiKeysPage.js +146 -155
- package/dist/devportal/pages/ApiKeysPage.js.map +1 -1
- package/dist/devportal/pages/ApplicationDetailPage.js +1000 -760
- package/dist/devportal/pages/ApplicationDetailPage.js.map +1 -1
- package/dist/devportal/pages/ApplicationVersionsPage.js +286 -217
- package/dist/devportal/pages/ApplicationVersionsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useDevportal as e } from "../providers/DevportalProvider.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { EmptyState as n } from "../components/EmptyState.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useCurrentUserAppsQuery as r, useMyApiKeysQuery as ee, useRevokeApiKeyAuthMutation as te, useRotateApiKeyAuthMutation as ne } from "../../generated/global-operations.js";
|
|
5
5
|
import { getErrorMessage as re } from "../hooks/useGraphQL.js";
|
|
6
6
|
import { PageLayout as i } from "../components/PageLayout.js";
|
|
7
7
|
import { ActiveIndicator as ie } from "../components/StatusBadge.js";
|
|
@@ -11,14 +11,14 @@ import { DataTable as oe } from "../components/DataTable.js";
|
|
|
11
11
|
import { ConfirmDialog as o } from "../components/ConfirmDialog.js";
|
|
12
12
|
import { PermissionGuard as se } from "../components/PermissionGuard.js";
|
|
13
13
|
import "../components/index.js";
|
|
14
|
-
import { DEVPORTAL_PERMISSIONS as
|
|
14
|
+
import { DEVPORTAL_PERMISSIONS as s } from "../constants/permissions.js";
|
|
15
15
|
import "../hooks/index.js";
|
|
16
|
-
import { useMemo as
|
|
17
|
-
import { useI18n as
|
|
18
|
-
import { AlertCircle as
|
|
19
|
-
import { jsx as
|
|
16
|
+
import { useMemo as c, useState as l } from "react";
|
|
17
|
+
import { useI18n as ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
18
|
+
import { AlertCircle as le, AlertTriangle as ue, Ban as u, Clock as de, Key as d, Loader2 as fe, Plus as f, RotateCw as p, Search as pe, Shield as me } from "lucide-react";
|
|
19
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
20
20
|
//#region src/devportal/pages/ApiKeysPage.tsx
|
|
21
|
-
function
|
|
21
|
+
function he(e) {
|
|
22
22
|
return {
|
|
23
23
|
id: e.id,
|
|
24
24
|
name: e.name,
|
|
@@ -31,80 +31,71 @@ function _e(e) {
|
|
|
31
31
|
lastUsedAt: e.lastUsedAt ?? void 0
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var g = (e) => {
|
|
35
35
|
if (!e) return !1;
|
|
36
36
|
let t = Math.ceil((new Date(e).getTime() - Date.now()) / (1e3 * 60 * 60 * 24));
|
|
37
37
|
return t <= 30 && t > 0;
|
|
38
|
-
},
|
|
39
|
-
let { navigate:
|
|
40
|
-
let n =
|
|
38
|
+
}, _ = (e) => e ? new Date(e).getTime() < Date.now() : !1, v = () => {
|
|
39
|
+
let { navigate: v, basePath: ge, activeOrgId: _e } = e(), { t: ve } = ce(), y = (e, t) => {
|
|
40
|
+
let n = ve(e);
|
|
41
41
|
return n === e ? t : n;
|
|
42
|
-
}, [b,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (!_) return null;
|
|
48
|
-
let e = /* @__PURE__ */ new Set();
|
|
49
|
-
for (let t of R?.applications?.edges ?? []) {
|
|
50
|
-
let n = t.node;
|
|
51
|
-
n.developerOrganizationId === _ && e.add(n.id);
|
|
52
|
-
}
|
|
53
|
-
return e;
|
|
54
|
-
}, [_, R?.applications?.edges]), [B, { loading: V }] = te(), [xe, { loading: H }] = ne(), U = s(() => P?.myApiKeys?.apiKeys.map(_e) ?? [], [P?.myApiKeys?.apiKeys]), W = (e) => {
|
|
55
|
-
g?.(`${ve}${e}`);
|
|
42
|
+
}, [b, x] = l(""), [S, ye] = l("all"), [C, w] = l(null), [T, E] = l(null), [D, O] = l(null), [k, A] = l(/* @__PURE__ */ new Set()), [j, M] = l(null), [N, P] = l(!1), { data: F, loading: be, error: I, refetch: L } = ee({ fetchPolicy: "cache-and-network" }), { data: R } = r({ fetchPolicy: "cache-first" }), z = c(() => {
|
|
43
|
+
let e = R?.currentUserApps?.apps;
|
|
44
|
+
return e?.length ? new Set(e.map((e) => e.id)) : null;
|
|
45
|
+
}, [R?.currentUserApps?.apps]), [B, { loading: V }] = te(), [xe, { loading: H }] = ne(), U = c(() => F?.myApiKeys?.apiKeys.map(he) ?? [], [F?.myApiKeys?.apiKeys]), W = (e) => {
|
|
46
|
+
v?.(`${ge}${e}`);
|
|
56
47
|
}, Se = async () => {
|
|
57
|
-
if (
|
|
58
|
-
await B({ variables: { keyId:
|
|
48
|
+
if (C) try {
|
|
49
|
+
await B({ variables: { keyId: C.id } }), w(null), await L();
|
|
59
50
|
} catch {}
|
|
60
51
|
}, Ce = async () => {
|
|
61
|
-
if (
|
|
62
|
-
let e = (await xe({ variables: { keyId:
|
|
63
|
-
e &&
|
|
52
|
+
if (T) try {
|
|
53
|
+
let e = (await xe({ variables: { keyId: T.id } })).data?.rotateAPIKey.apiSecret;
|
|
54
|
+
e && O(e), E(null), await L();
|
|
64
55
|
} catch {}
|
|
65
56
|
}, G = U.filter((e) => {
|
|
66
|
-
let t = !z || z.has(e.appId), n = !b || e.name.toLowerCase().includes(b.toLowerCase()) || e.prefix.toLowerCase().includes(b.toLowerCase()) || (e.appName?.toLowerCase().includes(b.toLowerCase()) ?? !1), r =
|
|
57
|
+
let t = !z || z.has(e.appId), n = !b || e.name.toLowerCase().includes(b.toLowerCase()) || e.prefix.toLowerCase().includes(b.toLowerCase()) || (e.appName?.toLowerCase().includes(b.toLowerCase()) ?? !1), r = S === "all" || S === "active" && !_(e.expiresAt) || S === "expired" && _(e.expiresAt);
|
|
67
58
|
return t && n && r;
|
|
68
|
-
}), K =
|
|
69
|
-
|
|
59
|
+
}), K = c(() => U.filter((e) => k.has(e.id)), [U, k]), q = c(() => K.filter((e) => !_(e.expiresAt)), [K]), J = G.filter((e) => !_(e.expiresAt)), Y = J.length > 0 && J.every((e) => k.has(e.id)), X = J.some((e) => k.has(e.id)) && !Y, we = (e, t) => {
|
|
60
|
+
A((n) => {
|
|
70
61
|
let r = new Set(n);
|
|
71
62
|
return t ? r.add(e) : r.delete(e), r;
|
|
72
63
|
});
|
|
73
64
|
}, Z = (e) => {
|
|
74
|
-
|
|
65
|
+
A((t) => {
|
|
75
66
|
let n = new Set(t);
|
|
76
67
|
return J.forEach((t) => {
|
|
77
68
|
e ? n.add(t.id) : n.delete(t.id);
|
|
78
69
|
}), n;
|
|
79
70
|
});
|
|
80
|
-
}, Q = () =>
|
|
81
|
-
if (
|
|
71
|
+
}, Q = () => A(/* @__PURE__ */ new Set());
|
|
72
|
+
if (be && !F) return /* @__PURE__ */ m(i, {
|
|
82
73
|
title: y("devportal.apiKeys", "API Keys"),
|
|
83
74
|
description: y("devportal.manageApiKeys", "Manage your API keys for programmatic access"),
|
|
84
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ h("div", {
|
|
85
76
|
className: "flex items-center justify-center py-12",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ m(fe, { className: "h-8 w-8 animate-spin text-muted-foreground" }), /* @__PURE__ */ m("span", {
|
|
87
78
|
className: "ml-2 text-muted-foreground",
|
|
88
79
|
children: y("devportal.loadingApiKeys", "Loading API keys...")
|
|
89
80
|
})]
|
|
90
81
|
})
|
|
91
82
|
});
|
|
92
|
-
if (I) return /* @__PURE__ */
|
|
83
|
+
if (I) return /* @__PURE__ */ m(i, {
|
|
93
84
|
title: y("devportal.apiKeys", "API Keys"),
|
|
94
85
|
description: y("devportal.manageApiKeys", "Manage your API keys for programmatic access"),
|
|
95
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ h("div", {
|
|
96
87
|
className: "rounded-lg border border-destructive/50 bg-destructive/10 p-6 text-center",
|
|
97
88
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ m(le, { className: "mx-auto h-8 w-8 text-destructive" }),
|
|
90
|
+
/* @__PURE__ */ m("h3", {
|
|
100
91
|
className: "mt-2 font-medium text-destructive",
|
|
101
92
|
children: y("devportal.failedToLoadApiKeys", "Failed to load API keys")
|
|
102
93
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ m("p", {
|
|
104
95
|
className: "mt-1 text-sm text-muted-foreground",
|
|
105
96
|
children: re(I)
|
|
106
97
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ m("button", {
|
|
108
99
|
onClick: () => L(),
|
|
109
100
|
className: "mt-4 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
|
|
110
101
|
children: y("devportal.tryAgain", "Try Again")
|
|
@@ -115,18 +106,18 @@ var m = (e) => {
|
|
|
115
106
|
let Te = [
|
|
116
107
|
{
|
|
117
108
|
key: "select",
|
|
118
|
-
header: /* @__PURE__ */
|
|
109
|
+
header: /* @__PURE__ */ m(a, {
|
|
119
110
|
checked: Y,
|
|
120
111
|
indeterminate: X,
|
|
121
112
|
onChange: Z,
|
|
122
113
|
ariaLabel: "Select all visible API keys"
|
|
123
114
|
}),
|
|
124
115
|
className: "w-12",
|
|
125
|
-
render: (e) => /* @__PURE__ */
|
|
116
|
+
render: (e) => /* @__PURE__ */ m("div", {
|
|
126
117
|
onClick: (e) => e.stopPropagation(),
|
|
127
|
-
children: /* @__PURE__ */
|
|
128
|
-
checked:
|
|
129
|
-
disabled:
|
|
118
|
+
children: /* @__PURE__ */ m(a, {
|
|
119
|
+
checked: k.has(e.id),
|
|
120
|
+
disabled: _(e.expiresAt),
|
|
130
121
|
onChange: (t) => we(e.id, t),
|
|
131
122
|
ariaLabel: `Select API key ${e.name}`
|
|
132
123
|
})
|
|
@@ -135,28 +126,28 @@ var m = (e) => {
|
|
|
135
126
|
{
|
|
136
127
|
key: "name",
|
|
137
128
|
header: "API Key",
|
|
138
|
-
render: (e) => /* @__PURE__ */
|
|
129
|
+
render: (e) => /* @__PURE__ */ h("div", {
|
|
139
130
|
className: "flex items-center gap-3",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
141
|
-
className: t("flex h-10 w-10 items-center justify-center rounded-lg",
|
|
142
|
-
children: /* @__PURE__ */
|
|
143
|
-
}), /* @__PURE__ */
|
|
131
|
+
children: [/* @__PURE__ */ m("div", {
|
|
132
|
+
className: t("flex h-10 w-10 items-center justify-center rounded-lg", _(e.expiresAt) ? "bg-status-error-bg-subtle text-status-error-text" : "bg-primary/10 text-primary"),
|
|
133
|
+
children: /* @__PURE__ */ m(d, { size: 20 })
|
|
134
|
+
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("div", {
|
|
144
135
|
className: "flex items-center gap-2",
|
|
145
136
|
children: [
|
|
146
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ m("p", {
|
|
147
138
|
className: "font-medium",
|
|
148
139
|
children: e.name
|
|
149
140
|
}),
|
|
150
|
-
|
|
141
|
+
_(e.expiresAt) && /* @__PURE__ */ m("span", {
|
|
151
142
|
className: "rounded bg-status-error-bg-subtle px-1.5 py-0.5 text-xs text-status-error-text",
|
|
152
143
|
children: "Expired"
|
|
153
144
|
}),
|
|
154
|
-
|
|
145
|
+
g(e.expiresAt) && !_(e.expiresAt) && /* @__PURE__ */ m("span", {
|
|
155
146
|
className: "rounded bg-status-warning-bg-subtle px-1.5 py-0.5 text-xs text-status-warning-text",
|
|
156
147
|
children: "Expiring Soon"
|
|
157
148
|
})
|
|
158
149
|
]
|
|
159
|
-
}), e.appName && /* @__PURE__ */
|
|
150
|
+
}), e.appName && /* @__PURE__ */ h("p", {
|
|
160
151
|
className: "text-xs text-muted-foreground",
|
|
161
152
|
children: ["App: ", e.appName]
|
|
162
153
|
})] })]
|
|
@@ -165,7 +156,7 @@ var m = (e) => {
|
|
|
165
156
|
{
|
|
166
157
|
key: "prefix",
|
|
167
158
|
header: "Key Prefix",
|
|
168
|
-
render: (e) => /* @__PURE__ */
|
|
159
|
+
render: (e) => /* @__PURE__ */ h("code", {
|
|
169
160
|
className: "text-sm text-muted-foreground",
|
|
170
161
|
children: [e.prefix, "..."]
|
|
171
162
|
})
|
|
@@ -173,12 +164,12 @@ var m = (e) => {
|
|
|
173
164
|
{
|
|
174
165
|
key: "scopes",
|
|
175
166
|
header: "Scopes",
|
|
176
|
-
render: (e) => /* @__PURE__ */
|
|
167
|
+
render: (e) => /* @__PURE__ */ h("div", {
|
|
177
168
|
className: "flex flex-wrap gap-1",
|
|
178
|
-
children: [e.scopes.slice(0, 3).map((e) => /* @__PURE__ */
|
|
169
|
+
children: [e.scopes.slice(0, 3).map((e) => /* @__PURE__ */ m("span", {
|
|
179
170
|
className: "inline-flex rounded bg-muted px-1.5 py-0.5 text-xs",
|
|
180
171
|
children: e
|
|
181
|
-
}, e)), e.scopes.length > 3 && /* @__PURE__ */
|
|
172
|
+
}, e)), e.scopes.length > 3 && /* @__PURE__ */ h("span", {
|
|
182
173
|
className: "text-xs text-muted-foreground",
|
|
183
174
|
children: ["+", e.scopes.length - 3]
|
|
184
175
|
})]
|
|
@@ -187,7 +178,7 @@ var m = (e) => {
|
|
|
187
178
|
{
|
|
188
179
|
key: "lastUsed",
|
|
189
180
|
header: "Last Used",
|
|
190
|
-
render: (e) => /* @__PURE__ */
|
|
181
|
+
render: (e) => /* @__PURE__ */ m("span", {
|
|
191
182
|
className: "text-sm text-muted-foreground",
|
|
192
183
|
children: e.lastUsedAt ? new Date(e.lastUsedAt).toLocaleDateString() : "Never"
|
|
193
184
|
})
|
|
@@ -195,19 +186,19 @@ var m = (e) => {
|
|
|
195
186
|
{
|
|
196
187
|
key: "expires",
|
|
197
188
|
header: "Expires",
|
|
198
|
-
render: (e) => /* @__PURE__ */
|
|
199
|
-
className: t("text-sm",
|
|
189
|
+
render: (e) => /* @__PURE__ */ m("span", {
|
|
190
|
+
className: t("text-sm", _(e.expiresAt) ? "text-status-error-text" : g(e.expiresAt) ? "text-status-warning-text" : "text-muted-foreground"),
|
|
200
191
|
children: e.expiresAt ? new Date(e.expiresAt).toLocaleDateString() : "Never"
|
|
201
192
|
})
|
|
202
193
|
},
|
|
203
194
|
{
|
|
204
195
|
key: "status",
|
|
205
196
|
header: "Status",
|
|
206
|
-
render: (e) => /* @__PURE__ */
|
|
197
|
+
render: (e) => /* @__PURE__ */ h("div", {
|
|
207
198
|
className: "flex items-center gap-2",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ m(ie, { active: !_(e.expiresAt) }), /* @__PURE__ */ m("span", {
|
|
209
200
|
className: "text-sm",
|
|
210
|
-
children:
|
|
201
|
+
children: _(e.expiresAt) ? "Expired" : "Active"
|
|
211
202
|
})]
|
|
212
203
|
})
|
|
213
204
|
},
|
|
@@ -215,32 +206,32 @@ var m = (e) => {
|
|
|
215
206
|
key: "actions",
|
|
216
207
|
header: "Actions",
|
|
217
208
|
className: "w-28",
|
|
218
|
-
render: (e) =>
|
|
209
|
+
render: (e) => _(e.expiresAt) ? /* @__PURE__ */ m("span", {
|
|
219
210
|
className: "text-xs text-muted-foreground",
|
|
220
211
|
children: "No actions"
|
|
221
|
-
}) : /* @__PURE__ */
|
|
212
|
+
}) : /* @__PURE__ */ h("div", {
|
|
222
213
|
className: "flex items-center gap-1",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ h("button", {
|
|
224
215
|
type: "button",
|
|
225
216
|
title: "Rotate secret",
|
|
226
217
|
disabled: H,
|
|
227
218
|
onClick: (t) => {
|
|
228
|
-
t.stopPropagation(),
|
|
219
|
+
t.stopPropagation(), E(e);
|
|
229
220
|
},
|
|
230
221
|
className: t("inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors", "text-status-info-text hover:bg-status-info-bg-subtle", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
231
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ m(p, { size: 14 }), /* @__PURE__ */ m("span", {
|
|
232
223
|
className: "sr-only sm:not-sr-only",
|
|
233
224
|
children: "Rotate"
|
|
234
225
|
})]
|
|
235
|
-
}), /* @__PURE__ */
|
|
226
|
+
}), /* @__PURE__ */ h("button", {
|
|
236
227
|
type: "button",
|
|
237
228
|
title: "Revoke key",
|
|
238
229
|
disabled: V,
|
|
239
230
|
onClick: (t) => {
|
|
240
|
-
t.stopPropagation(),
|
|
231
|
+
t.stopPropagation(), w(e);
|
|
241
232
|
},
|
|
242
233
|
className: t("inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors", "text-status-error-text hover:bg-status-error-bg-subtle", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
243
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ m(u, { size: 14 }), /* @__PURE__ */ m("span", {
|
|
244
235
|
className: "sr-only sm:not-sr-only",
|
|
245
236
|
children: "Revoke"
|
|
246
237
|
})]
|
|
@@ -249,68 +240,68 @@ var m = (e) => {
|
|
|
249
240
|
}
|
|
250
241
|
], $ = {
|
|
251
242
|
total: G.length,
|
|
252
|
-
active: G.filter((e) => !
|
|
253
|
-
expiringSoon: G.filter((e) =>
|
|
254
|
-
expired: G.filter((e) =>
|
|
243
|
+
active: G.filter((e) => !_(e.expiresAt)).length,
|
|
244
|
+
expiringSoon: G.filter((e) => g(e.expiresAt)).length,
|
|
245
|
+
expired: G.filter((e) => _(e.expiresAt)).length
|
|
255
246
|
};
|
|
256
|
-
return /* @__PURE__ */
|
|
257
|
-
permission:
|
|
258
|
-
children: /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ m(se, {
|
|
248
|
+
permission: s.APP_READ,
|
|
249
|
+
children: /* @__PURE__ */ h(i, {
|
|
259
250
|
title: y("devportal.apiKeys", "API Keys"),
|
|
260
251
|
description: y("devportal.manageApiKeys", "Manage your API keys for programmatic access"),
|
|
261
|
-
actions: /* @__PURE__ */
|
|
252
|
+
actions: /* @__PURE__ */ h("button", {
|
|
262
253
|
onClick: () => W("/api-keys/new"),
|
|
263
254
|
className: "inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
264
|
-
children: [/* @__PURE__ */ f
|
|
255
|
+
children: [/* @__PURE__ */ m(f, { size: 16 }), y("devportal.generateApiKey", "Generate API Key")]
|
|
265
256
|
}),
|
|
266
257
|
children: [
|
|
267
|
-
|
|
258
|
+
D && /* @__PURE__ */ m(ae, {
|
|
268
259
|
title: "API Key Rotated",
|
|
269
|
-
secret:
|
|
260
|
+
secret: D,
|
|
270
261
|
description: "The previous secret has been invalidated. Copy the new secret below — it will not be shown again.",
|
|
271
|
-
onDismiss: () =>
|
|
262
|
+
onDismiss: () => O(null)
|
|
272
263
|
}),
|
|
273
|
-
|
|
274
|
-
className: t("rounded-lg border px-4 py-3 text-sm",
|
|
275
|
-
children: /* @__PURE__ */
|
|
264
|
+
j && /* @__PURE__ */ m("div", {
|
|
265
|
+
className: t("rounded-lg border px-4 py-3 text-sm", j.type === "success" ? "border-border-subtle bg-status-success-bg-subtle text-status-success-text" : "border-destructive/40 bg-destructive/10 text-destructive"),
|
|
266
|
+
children: /* @__PURE__ */ h("div", {
|
|
276
267
|
className: "flex items-center justify-between gap-3",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
278
|
-
onClick: () =>
|
|
268
|
+
children: [/* @__PURE__ */ m("span", { children: j.message }), /* @__PURE__ */ m("button", {
|
|
269
|
+
onClick: () => M(null),
|
|
279
270
|
className: "text-xs font-medium underline underline-offset-2",
|
|
280
271
|
children: "Dismiss"
|
|
281
272
|
})]
|
|
282
273
|
})
|
|
283
274
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ m("div", {
|
|
285
276
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
286
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ h("div", {
|
|
287
278
|
className: "flex flex-1 items-center gap-4",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
279
|
+
children: [/* @__PURE__ */ h("div", {
|
|
289
280
|
className: "relative flex-1 max-w-md",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ m(pe, {
|
|
291
282
|
size: 16,
|
|
292
283
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
293
|
-
}), /* @__PURE__ */
|
|
284
|
+
}), /* @__PURE__ */ m("input", {
|
|
294
285
|
type: "text",
|
|
295
286
|
placeholder: "Search by name, prefix, or app...",
|
|
296
287
|
value: b,
|
|
297
|
-
onChange: (e) =>
|
|
288
|
+
onChange: (e) => x(e.target.value),
|
|
298
289
|
className: "w-full rounded-md border bg-background pl-9 pr-4 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary"
|
|
299
290
|
})]
|
|
300
|
-
}), /* @__PURE__ */
|
|
301
|
-
value:
|
|
302
|
-
onChange: (e) =>
|
|
291
|
+
}), /* @__PURE__ */ h("select", {
|
|
292
|
+
value: S,
|
|
293
|
+
onChange: (e) => ye(e.target.value),
|
|
303
294
|
className: "rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",
|
|
304
295
|
children: [
|
|
305
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ m("option", {
|
|
306
297
|
value: "all",
|
|
307
298
|
children: "All Status"
|
|
308
299
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ m("option", {
|
|
310
301
|
value: "active",
|
|
311
302
|
children: "Active"
|
|
312
303
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ m("option", {
|
|
314
305
|
value: "expired",
|
|
315
306
|
children: "Expired"
|
|
316
307
|
})
|
|
@@ -318,64 +309,64 @@ var m = (e) => {
|
|
|
318
309
|
})]
|
|
319
310
|
})
|
|
320
311
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ h("div", {
|
|
322
313
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
323
314
|
children: [
|
|
324
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ h("div", {
|
|
325
316
|
className: "rounded-lg border bg-card p-4",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ h("div", {
|
|
327
318
|
className: "flex items-center gap-2 text-muted-foreground",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ m(d, { size: 16 }), /* @__PURE__ */ m("span", {
|
|
329
320
|
className: "text-sm",
|
|
330
321
|
children: "Total Keys"
|
|
331
322
|
})]
|
|
332
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ m("p", {
|
|
333
324
|
className: "mt-1 text-2xl font-semibold",
|
|
334
325
|
children: $.total
|
|
335
326
|
})]
|
|
336
327
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ h("div", {
|
|
338
329
|
className: "rounded-lg border bg-card p-4",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ h("div", {
|
|
340
331
|
className: "flex items-center gap-2 text-status-success-text",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ m(me, { size: 16 }), /* @__PURE__ */ m("span", {
|
|
342
333
|
className: "text-sm",
|
|
343
334
|
children: "Active"
|
|
344
335
|
})]
|
|
345
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ m("p", {
|
|
346
337
|
className: "mt-1 text-2xl font-semibold",
|
|
347
338
|
children: $.active
|
|
348
339
|
})]
|
|
349
340
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ h("div", {
|
|
351
342
|
className: "rounded-lg border bg-card p-4",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ h("div", {
|
|
353
344
|
className: "flex items-center gap-2 text-status-warning-text",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ m(de, { size: 16 }), /* @__PURE__ */ m("span", {
|
|
355
346
|
className: "text-sm",
|
|
356
347
|
children: "Expiring Soon"
|
|
357
348
|
})]
|
|
358
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ m("p", {
|
|
359
350
|
className: "mt-1 text-2xl font-semibold",
|
|
360
351
|
children: $.expiringSoon
|
|
361
352
|
})]
|
|
362
353
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ h("div", {
|
|
364
355
|
className: "rounded-lg border bg-card p-4",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ h("div", {
|
|
366
357
|
className: "flex items-center gap-2 text-status-error-text",
|
|
367
|
-
children: [/* @__PURE__ */
|
|
358
|
+
children: [/* @__PURE__ */ m(ue, { size: 16 }), /* @__PURE__ */ m("span", {
|
|
368
359
|
className: "text-sm",
|
|
369
360
|
children: "Expired"
|
|
370
361
|
})]
|
|
371
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ m("p", {
|
|
372
363
|
className: "mt-1 text-2xl font-semibold",
|
|
373
364
|
children: $.expired
|
|
374
365
|
})]
|
|
375
366
|
})
|
|
376
367
|
]
|
|
377
368
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ h("p", {
|
|
379
370
|
className: "text-sm text-muted-foreground",
|
|
380
371
|
children: [
|
|
381
372
|
G.length,
|
|
@@ -385,39 +376,39 @@ var m = (e) => {
|
|
|
385
376
|
"found"
|
|
386
377
|
]
|
|
387
378
|
}),
|
|
388
|
-
G.length > 0 && /* @__PURE__ */
|
|
379
|
+
G.length > 0 && /* @__PURE__ */ m("div", {
|
|
389
380
|
className: "rounded-lg border bg-card p-4",
|
|
390
|
-
children: /* @__PURE__ */
|
|
381
|
+
children: /* @__PURE__ */ h("div", {
|
|
391
382
|
className: "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ h("div", {
|
|
393
384
|
className: "flex flex-wrap items-center gap-3",
|
|
394
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ h("div", {
|
|
395
386
|
className: "flex items-center gap-2",
|
|
396
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ m(a, {
|
|
397
388
|
checked: Y,
|
|
398
389
|
indeterminate: X,
|
|
399
390
|
onChange: Z,
|
|
400
391
|
ariaLabel: "Select all visible API keys"
|
|
401
|
-
}), /* @__PURE__ */
|
|
392
|
+
}), /* @__PURE__ */ m("span", {
|
|
402
393
|
className: "text-sm font-medium",
|
|
403
394
|
children: "Select all active keys"
|
|
404
395
|
})]
|
|
405
|
-
}),
|
|
396
|
+
}), k.size > 0 && /* @__PURE__ */ m("button", {
|
|
406
397
|
onClick: Q,
|
|
407
398
|
className: "text-sm text-muted-foreground hover:text-foreground",
|
|
408
399
|
children: "Clear selection"
|
|
409
400
|
})]
|
|
410
|
-
}), /* @__PURE__ */
|
|
401
|
+
}), /* @__PURE__ */ h("div", {
|
|
411
402
|
className: "flex flex-wrap items-center gap-2",
|
|
412
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ h("span", {
|
|
413
404
|
className: "rounded-full bg-muted px-3 py-1 text-sm font-medium text-muted-foreground",
|
|
414
|
-
children: [
|
|
415
|
-
}), /* @__PURE__ */
|
|
416
|
-
onClick: () =>
|
|
405
|
+
children: [k.size, " selected"]
|
|
406
|
+
}), /* @__PURE__ */ h("button", {
|
|
407
|
+
onClick: () => P(!0),
|
|
417
408
|
disabled: q.length === 0,
|
|
418
409
|
className: "inline-flex items-center gap-2 rounded-md border border-status-error-bg px-3 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:cursor-not-allowed disabled:opacity-50",
|
|
419
410
|
children: [
|
|
420
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ m(u, { size: 16 }),
|
|
421
412
|
"Revoke Selected",
|
|
422
413
|
q.length > 0 ? ` (${q.length})` : ""
|
|
423
414
|
]
|
|
@@ -425,56 +416,56 @@ var m = (e) => {
|
|
|
425
416
|
})]
|
|
426
417
|
})
|
|
427
418
|
}),
|
|
428
|
-
G.length > 0 ? /* @__PURE__ */
|
|
419
|
+
G.length > 0 ? /* @__PURE__ */ m(oe, {
|
|
429
420
|
data: G,
|
|
430
421
|
columns: Te,
|
|
431
422
|
keyField: "id"
|
|
432
|
-
}) : /* @__PURE__ */
|
|
433
|
-
icon: /* @__PURE__ */
|
|
423
|
+
}) : /* @__PURE__ */ m(n, {
|
|
424
|
+
icon: /* @__PURE__ */ m(d, { size: 32 }),
|
|
434
425
|
title: y("devportal.noApiKeysFound", "No API keys found"),
|
|
435
|
-
description: b ||
|
|
436
|
-
action: !b &&
|
|
426
|
+
description: b || S !== "all" ? y("devportal.tryAdjustingFilters", "Try adjusting your filters") : y("devportal.generateFirstApiKey", "Generate your first API key to start making API calls"),
|
|
427
|
+
action: !b && S === "all" ? /* @__PURE__ */ h("button", {
|
|
437
428
|
onClick: () => W("/api-keys/new"),
|
|
438
429
|
className: "inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
|
|
439
|
-
children: [/* @__PURE__ */ f
|
|
430
|
+
children: [/* @__PURE__ */ m(f, { size: 16 }), y("devportal.generateApiKey", "Generate API Key")]
|
|
440
431
|
}) : void 0
|
|
441
432
|
}),
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
open:
|
|
433
|
+
/* @__PURE__ */ m(o, {
|
|
434
|
+
open: C !== null,
|
|
444
435
|
onOpenChange: (e) => {
|
|
445
|
-
e ||
|
|
436
|
+
e || w(null);
|
|
446
437
|
},
|
|
447
438
|
onConfirm: Se,
|
|
448
439
|
title: "Revoke API Key",
|
|
449
|
-
description: `Are you sure you want to revoke "${
|
|
440
|
+
description: `Are you sure you want to revoke "${C?.name ?? ""}"? This action cannot be undone. Any application or service using this key will immediately lose access.`,
|
|
450
441
|
confirmLabel: "Revoke Key",
|
|
451
442
|
cancelLabel: "Cancel",
|
|
452
443
|
variant: "danger",
|
|
453
444
|
loading: V
|
|
454
445
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
open:
|
|
446
|
+
/* @__PURE__ */ m(o, {
|
|
447
|
+
open: T !== null,
|
|
457
448
|
onOpenChange: (e) => {
|
|
458
|
-
e ||
|
|
449
|
+
e || E(null);
|
|
459
450
|
},
|
|
460
451
|
onConfirm: Ce,
|
|
461
452
|
title: "Rotate API Key Secret",
|
|
462
|
-
description: `This will generate a new secret for "${
|
|
453
|
+
description: `This will generate a new secret for "${T?.name ?? ""}" and immediately invalidate the current one. Make sure to update all services using this key before the old secret stops working.`,
|
|
463
454
|
confirmLabel: "Rotate Secret",
|
|
464
455
|
cancelLabel: "Cancel",
|
|
465
456
|
variant: "warning",
|
|
466
457
|
loading: H
|
|
467
458
|
}),
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
open:
|
|
470
|
-
onOpenChange:
|
|
459
|
+
/* @__PURE__ */ m(o, {
|
|
460
|
+
open: N,
|
|
461
|
+
onOpenChange: P,
|
|
471
462
|
onConfirm: async () => {
|
|
472
463
|
if (q.length === 0) return;
|
|
473
464
|
let e = await Promise.allSettled(q.map((e) => B({ variables: { keyId: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
|
|
474
|
-
|
|
465
|
+
M({
|
|
475
466
|
type: n === 0 ? "success" : "error",
|
|
476
467
|
message: `Revoked ${t} API key${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`
|
|
477
|
-
}),
|
|
468
|
+
}), P(!1), Q(), await L();
|
|
478
469
|
},
|
|
479
470
|
title: "Revoke selected API keys",
|
|
480
471
|
description: `Revoke ${q.length} selected API key${q.length === 1 ? "" : "s"}? Any service using these keys will immediately lose access.`,
|
|
@@ -488,6 +479,6 @@ var m = (e) => {
|
|
|
488
479
|
});
|
|
489
480
|
};
|
|
490
481
|
//#endregion
|
|
491
|
-
export {
|
|
482
|
+
export { v as ApiKeysPage };
|
|
492
483
|
|
|
493
484
|
//# sourceMappingURL=ApiKeysPage.js.map
|