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