@acmekit/dashboard 2.13.6 → 2.13.8

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 (64) hide show
  1. package/dist/api-key-management-create-D57V3NN2.mjs +170 -0
  2. package/dist/api-key-management-detail-QURSBB6T.mjs +307 -0
  3. package/dist/api-key-management-edit-GG5V77GY.mjs +106 -0
  4. package/dist/api-key-management-list-PL64LD22.mjs +400 -0
  5. package/dist/app.js +16930 -1004
  6. package/dist/app.mjs +793 -884
  7. package/dist/chunk-22YYMH6M.mjs +382 -0
  8. package/dist/chunk-2U3RK3JG.mjs +474 -0
  9. package/dist/chunk-535OVBXR.mjs +226 -0
  10. package/dist/chunk-6SQCO25J.mjs +65 -0
  11. package/dist/chunk-774WSTCC.mjs +19 -0
  12. package/dist/chunk-7ZHDHEUH.mjs +1837 -0
  13. package/dist/chunk-C76H5USB.mjs +16 -0
  14. package/dist/chunk-DFFLVEZ5.mjs +40 -0
  15. package/dist/chunk-DN3MIYQH.mjs +140 -0
  16. package/dist/chunk-DQCEH3X2.mjs +28 -0
  17. package/dist/chunk-DTY37DDZ.mjs +20 -0
  18. package/dist/chunk-FXYH54JP.mjs +16 -0
  19. package/dist/chunk-G22WWLPG.mjs +44 -0
  20. package/dist/chunk-G2VJOHHV.mjs +32 -0
  21. package/dist/chunk-GBFVWROS.mjs +58 -0
  22. package/dist/chunk-ITNQKZQQ.mjs +142 -0
  23. package/dist/chunk-IUCDCPJU.mjs +0 -0
  24. package/dist/chunk-LKWTBYYC.mjs +35 -0
  25. package/dist/{chunk-4VYJHIB3.mjs → chunk-ND3ODI36.mjs} +0 -72
  26. package/dist/chunk-OAHCJFG3.mjs +17 -0
  27. package/dist/chunk-OHAFITSB.mjs +54 -0
  28. package/dist/chunk-RPAL6FHW.mjs +73 -0
  29. package/dist/{chunk-JSJZMTQG.mjs → chunk-RREPQMYC.mjs} +14 -41
  30. package/dist/chunk-S3REQHPQ.mjs +86 -0
  31. package/dist/chunk-S4DMV3ZT.mjs +35 -0
  32. package/dist/chunk-TCNCAWYD.mjs +9 -0
  33. package/dist/chunk-ULSPL3DR.mjs +126 -0
  34. package/dist/chunk-VBT5YZ4K.mjs +129 -0
  35. package/dist/chunk-WILMJYUB.mjs +35 -0
  36. package/dist/chunk-XIM7X4FB.mjs +83 -0
  37. package/dist/chunk-YB52HEIR.mjs +387 -0
  38. package/dist/chunk-YRWSG3YM.mjs +80 -0
  39. package/dist/{invite-S5USGDOZ.mjs → invite-BAFXQBLJ.mjs} +15 -7
  40. package/dist/{login-BRUR5XXN.mjs → login-YURMNRCS.mjs} +23 -9
  41. package/dist/profile-detail-SJWODS2K.mjs +96 -0
  42. package/dist/profile-edit-HSGF4UXZ.mjs +173 -0
  43. package/dist/{reset-password-UQPRHMB3.mjs → reset-password-RQ5M7HQC.mjs} +8 -4
  44. package/dist/settings-3XWLL5LG.mjs +545 -0
  45. package/dist/store-detail-SQKV5KBD.mjs +109 -0
  46. package/dist/store-edit-WGGIJMYJ.mjs +97 -0
  47. package/dist/store-metadata-CSBUGX6Z.mjs +49 -0
  48. package/dist/translation-list-H5X4DVCC.mjs +587 -0
  49. package/dist/translations-edit-NPAUN2GZ.mjs +5376 -0
  50. package/dist/user-detail-7SUQ35G7.mjs +169 -0
  51. package/dist/user-edit-KUZV37AH.mjs +114 -0
  52. package/dist/user-invite-OREFWWYL.mjs +361 -0
  53. package/dist/user-list-OWUR75OP.mjs +1116 -0
  54. package/dist/user-metadata-QHUX5SHZ.mjs +51 -0
  55. package/dist/workflow-execution-detail-MWNM25TF.mjs +820 -0
  56. package/dist/workflow-execution-list-IGYF44UH.mjs +175 -0
  57. package/package.json +9 -9
  58. package/src/components/layout/settings-layout/settings-layout.tsx +74 -6
  59. package/src/dashboard-app/routes/get-route.map.tsx +225 -0
  60. package/src/routes/login/login.tsx +1 -1
  61. package/dist/chunk-FBTP4AJM.mjs +0 -221
  62. package/dist/chunk-NQEMGMWU.mjs +0 -159
  63. package/dist/chunk-QYOO4QR6.mjs +0 -73
  64. package/dist/login-AIMR26AL.mjs +0 -291
@@ -0,0 +1,400 @@
1
+ import {
2
+ getApiKeyStatusProps,
3
+ getApiKeyTypeFromPathname,
4
+ getApiKeyTypeProps,
5
+ prettifyRedactedToken
6
+ } from "./chunk-G22WWLPG.mjs";
7
+ import {
8
+ StatusCell
9
+ } from "./chunk-WILMJYUB.mjs";
10
+ import {
11
+ useApiKeys,
12
+ useDeleteApiKey,
13
+ useRevokeApiKey
14
+ } from "./chunk-VBT5YZ4K.mjs";
15
+ import {
16
+ SingleColumnPage
17
+ } from "./chunk-22YYMH6M.mjs";
18
+ import {
19
+ useExtension
20
+ } from "./chunk-C5P5PL3E.mjs";
21
+ import {
22
+ _DataTable,
23
+ useDataTable
24
+ } from "./chunk-7ZHDHEUH.mjs";
25
+ import "./chunk-ITNQKZQQ.mjs";
26
+ import {
27
+ useQueryParams
28
+ } from "./chunk-C76H5USB.mjs";
29
+ import {
30
+ useDate
31
+ } from "./chunk-DFFLVEZ5.mjs";
32
+ import "./chunk-535OVBXR.mjs";
33
+ import {
34
+ ActionMenu
35
+ } from "./chunk-S3REQHPQ.mjs";
36
+ import {
37
+ ConditionalTooltip
38
+ } from "./chunk-OAHCJFG3.mjs";
39
+ import "./chunk-S4DMV3ZT.mjs";
40
+ import "./chunk-FXYH54JP.mjs";
41
+ import "./chunk-774WSTCC.mjs";
42
+ import "./chunk-DTY37DDZ.mjs";
43
+ import "./chunk-QZ7TP4HQ.mjs";
44
+
45
+ // src/routes/api-key-management/api-key-management-list/api-key-management-list.tsx
46
+ import { useLocation } from "react-router-dom";
47
+
48
+ // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-management-list-table.tsx
49
+ import { Button, Container, Heading, Text } from "@acmekit/ui";
50
+ import { keepPreviousData } from "@tanstack/react-query";
51
+ import { useTranslation as useTranslation5 } from "react-i18next";
52
+ import { Link } from "react-router-dom";
53
+
54
+ // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-columns.tsx
55
+ import { Badge } from "@acmekit/ui";
56
+ import { createColumnHelper } from "@tanstack/react-table";
57
+ import { useMemo } from "react";
58
+ import { useTranslation as useTranslation3 } from "react-i18next";
59
+
60
+ // src/components/table/table-cells/common/date-cell/date-cell.tsx
61
+ import { Tooltip } from "@acmekit/ui";
62
+ import { useTranslation } from "react-i18next";
63
+
64
+ // src/components/table/table-cells/common/placeholder-cell/placeholder-cell.tsx
65
+ import { jsx } from "react/jsx-runtime";
66
+ var PlaceholderCell = () => {
67
+ return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted", children: "-" }) });
68
+ };
69
+
70
+ // src/components/table/table-cells/common/date-cell/date-cell.tsx
71
+ import { jsx as jsx2 } from "react/jsx-runtime";
72
+ var DateCell = ({ date }) => {
73
+ const { getFullDate } = useDate();
74
+ if (!date) {
75
+ return /* @__PURE__ */ jsx2(PlaceholderCell, {});
76
+ }
77
+ return /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx2(
78
+ Tooltip,
79
+ {
80
+ className: "z-10",
81
+ content: /* @__PURE__ */ jsx2("span", { className: "text-pretty", children: `${getFullDate({
82
+ date,
83
+ includeTime: true
84
+ })}` }),
85
+ children: /* @__PURE__ */ jsx2("span", { className: "truncate", children: getFullDate({ date, includeTime: false }) })
86
+ }
87
+ ) });
88
+ };
89
+
90
+ // src/components/table/table-cells/common/text-cell/text-cell.tsx
91
+ import { clx } from "@acmekit/ui";
92
+ import { jsx as jsx3 } from "react/jsx-runtime";
93
+ var TextCell = ({ text, align = "left", maxWidth = 220 }) => {
94
+ if (!text) {
95
+ return /* @__PURE__ */ jsx3(PlaceholderCell, {});
96
+ }
97
+ const stringLength = text.toString().length;
98
+ return /* @__PURE__ */ jsx3(ConditionalTooltip, { content: text, showTooltip: stringLength > 20, children: /* @__PURE__ */ jsx3(
99
+ "div",
100
+ {
101
+ className: clx("flex h-full w-full items-center gap-x-3 overflow-hidden", {
102
+ "justify-start text-start": align === "left",
103
+ "justify-center text-center": align === "center",
104
+ "justify-end text-end": align === "right"
105
+ }),
106
+ style: {
107
+ maxWidth
108
+ },
109
+ children: /* @__PURE__ */ jsx3("span", { className: "truncate", children: text })
110
+ }
111
+ ) });
112
+ };
113
+
114
+ // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-row-actions.tsx
115
+ import { PencilSquare, SquareTwoStack, Trash, XCircle } from "@acmekit/icons";
116
+ import { toast, usePrompt } from "@acmekit/ui";
117
+ import { useTranslation as useTranslation2 } from "react-i18next";
118
+ import { jsx as jsx4 } from "react/jsx-runtime";
119
+ var ApiKeyRowActions = ({
120
+ apiKey
121
+ }) => {
122
+ const { mutateAsync: revokeAsync } = useRevokeApiKey(apiKey.id);
123
+ const { mutateAsync: deleteAsync } = useDeleteApiKey(apiKey.id);
124
+ const { t } = useTranslation2();
125
+ const prompt = usePrompt();
126
+ const handleDelete = async () => {
127
+ const res = await prompt({
128
+ title: t("general.areYouSure"),
129
+ description: t("apiKeyManagement.delete.warning", {
130
+ title: apiKey.title
131
+ }),
132
+ confirmText: t("actions.delete"),
133
+ cancelText: t("actions.cancel")
134
+ });
135
+ if (!res) {
136
+ return;
137
+ }
138
+ await deleteAsync(void 0, {
139
+ onSuccess: () => {
140
+ toast.success(
141
+ t("apiKeyManagement.delete.successToast", {
142
+ title: apiKey.title
143
+ })
144
+ );
145
+ },
146
+ onError: (err) => {
147
+ toast.error(err.message);
148
+ }
149
+ });
150
+ };
151
+ const handleRevoke = async () => {
152
+ const res = await prompt({
153
+ title: t("general.areYouSure"),
154
+ description: t("apiKeyManagement.revoke.warning", {
155
+ title: apiKey.title
156
+ }),
157
+ confirmText: t("apiKeyManagement.actions.revoke"),
158
+ cancelText: t("actions.cancel")
159
+ });
160
+ if (!res) {
161
+ return;
162
+ }
163
+ await revokeAsync(void 0, {
164
+ onSuccess: () => {
165
+ toast.success(
166
+ t("apiKeyManagement.revoke.successToast", {
167
+ title: apiKey.title
168
+ })
169
+ );
170
+ },
171
+ onError: (err) => {
172
+ toast.error(err.message);
173
+ }
174
+ });
175
+ };
176
+ const handleCopyToken = () => {
177
+ navigator.clipboard.writeText(apiKey.token);
178
+ toast.success(t("apiKeyManagement.actions.copySuccessToast"));
179
+ };
180
+ return /* @__PURE__ */ jsx4(
181
+ ActionMenu,
182
+ {
183
+ groups: [
184
+ {
185
+ actions: [
186
+ {
187
+ icon: /* @__PURE__ */ jsx4(PencilSquare, {}),
188
+ label: t("actions.edit"),
189
+ to: `${apiKey.id}/edit`
190
+ },
191
+ ...apiKey.type !== "secret" ? [
192
+ {
193
+ label: t("apiKeyManagement.actions.copy"),
194
+ onClick: handleCopyToken,
195
+ icon: /* @__PURE__ */ jsx4(SquareTwoStack, {})
196
+ }
197
+ ] : []
198
+ ]
199
+ },
200
+ {
201
+ actions: [
202
+ {
203
+ icon: /* @__PURE__ */ jsx4(XCircle, {}),
204
+ label: t("apiKeyManagement.actions.revoke"),
205
+ onClick: handleRevoke,
206
+ disabled: !!apiKey.revoked_at
207
+ },
208
+ {
209
+ icon: /* @__PURE__ */ jsx4(Trash, {}),
210
+ label: t("actions.delete"),
211
+ onClick: handleDelete,
212
+ disabled: !apiKey.revoked_at
213
+ }
214
+ ]
215
+ }
216
+ ]
217
+ }
218
+ );
219
+ };
220
+
221
+ // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-columns.tsx
222
+ import { jsx as jsx5 } from "react/jsx-runtime";
223
+ var columnHelper = createColumnHelper();
224
+ var useApiKeyManagementTableColumns = () => {
225
+ const { t } = useTranslation3();
226
+ return useMemo(
227
+ () => [
228
+ columnHelper.accessor("title", {
229
+ header: t("fields.title"),
230
+ cell: ({ getValue }) => /* @__PURE__ */ jsx5("div", { className: "flex size-full items-center", children: /* @__PURE__ */ jsx5("span", { className: "truncate", children: getValue() }) })
231
+ }),
232
+ columnHelper.accessor("redacted", {
233
+ header: "Token",
234
+ cell: ({ getValue }) => {
235
+ const token = getValue();
236
+ return /* @__PURE__ */ jsx5(Badge, { size: "2xsmall", children: prettifyRedactedToken(token) });
237
+ }
238
+ }),
239
+ columnHelper.accessor("type", {
240
+ header: t("fields.type"),
241
+ cell: ({ getValue }) => {
242
+ const { label } = getApiKeyTypeProps(getValue(), t);
243
+ return /* @__PURE__ */ jsx5(TextCell, { text: label });
244
+ }
245
+ }),
246
+ columnHelper.accessor("revoked_at", {
247
+ header: t("fields.status"),
248
+ cell: ({ getValue }) => {
249
+ const { color, label } = getApiKeyStatusProps(getValue(), t);
250
+ return /* @__PURE__ */ jsx5(StatusCell, { color, children: label });
251
+ }
252
+ }),
253
+ columnHelper.accessor("last_used_at", {
254
+ header: t("apiKeyManagement.table.lastUsedAtHeader"),
255
+ cell: ({ getValue }) => {
256
+ const date = getValue();
257
+ return /* @__PURE__ */ jsx5(DateCell, { date });
258
+ }
259
+ }),
260
+ columnHelper.accessor("created_at", {
261
+ header: t("fields.created"),
262
+ cell: ({ getValue }) => {
263
+ const date = getValue();
264
+ return /* @__PURE__ */ jsx5(DateCell, { date });
265
+ }
266
+ }),
267
+ columnHelper.display({
268
+ id: "actions",
269
+ cell: ({ row }) => {
270
+ return /* @__PURE__ */ jsx5(ApiKeyRowActions, { apiKey: row.original });
271
+ }
272
+ })
273
+ ],
274
+ [t]
275
+ );
276
+ };
277
+
278
+ // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-filters.tsx
279
+ import { useTranslation as useTranslation4 } from "react-i18next";
280
+ var useApiKeyManagementTableFilters = () => {
281
+ const { t } = useTranslation4();
282
+ let filters = [];
283
+ const dateFilters = [
284
+ { label: t("fields.createdAt"), key: "created_at", type: "date" },
285
+ { label: t("fields.updatedAt"), key: "updated_at", type: "date" },
286
+ { label: t("fields.revokedAt"), key: "revoked_at", type: "date" }
287
+ ];
288
+ filters = [...filters, ...dateFilters];
289
+ return filters;
290
+ };
291
+
292
+ // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-query.tsx
293
+ var useApiKeyManagementTableQuery = ({
294
+ prefix,
295
+ pageSize = 20
296
+ }) => {
297
+ const queryObject = useQueryParams(
298
+ ["offset", "q", "created_at", "updated_at", "revoked_at", "order"],
299
+ prefix
300
+ );
301
+ const { offset, created_at, updated_at, revoked_at, q, order } = queryObject;
302
+ const searchParams = {
303
+ limit: pageSize,
304
+ offset: offset ? Number(offset) : 0,
305
+ created_at: created_at ? JSON.parse(created_at) : void 0,
306
+ updated_at: updated_at ? JSON.parse(updated_at) : void 0,
307
+ revoked_at: revoked_at ? JSON.parse(revoked_at) : void 0,
308
+ order,
309
+ q
310
+ };
311
+ return {
312
+ searchParams,
313
+ raw: queryObject
314
+ };
315
+ };
316
+
317
+ // src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-management-list-table.tsx
318
+ import { jsx as jsx6, jsxs } from "react/jsx-runtime";
319
+ var PAGE_SIZE = 20;
320
+ var ApiKeyManagementListTable = ({
321
+ keyType
322
+ }) => {
323
+ const { t } = useTranslation5();
324
+ const { searchParams, raw } = useApiKeyManagementTableQuery({
325
+ pageSize: PAGE_SIZE
326
+ });
327
+ const query = {
328
+ ...searchParams,
329
+ type: keyType,
330
+ fields: "id,title,redacted,token,type,created_at,updated_at,revoked_at,last_used_at,created_by,revoked_by"
331
+ };
332
+ const { api_keys, count, isLoading, isError, error } = useApiKeys(query, {
333
+ placeholderData: keepPreviousData
334
+ });
335
+ const filters = useApiKeyManagementTableFilters();
336
+ const columns = useApiKeyManagementTableColumns();
337
+ const { table } = useDataTable({
338
+ data: api_keys || [],
339
+ columns,
340
+ count,
341
+ enablePagination: true,
342
+ getRowId: (row) => row.id,
343
+ pageSize: PAGE_SIZE
344
+ });
345
+ if (isError) {
346
+ throw error;
347
+ }
348
+ return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
349
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
350
+ /* @__PURE__ */ jsxs("div", { children: [
351
+ /* @__PURE__ */ jsx6(Heading, { level: "h1", children: keyType === "publishable" ? t(`apiKeyManagement.domain.publishable`) : t("apiKeyManagement.domain.secret") }),
352
+ /* @__PURE__ */ jsx6(Text, { className: "text-ui-fg-subtle", size: "small", children: keyType === "publishable" ? t(`apiKeyManagement.subtitle.publishable`) : t("apiKeyManagement.subtitle.secret") })
353
+ ] }),
354
+ /* @__PURE__ */ jsx6(Link, { to: "create", children: /* @__PURE__ */ jsx6(Button, { variant: "secondary", size: "small", children: t("actions.create") }) })
355
+ ] }),
356
+ /* @__PURE__ */ jsx6(
357
+ _DataTable,
358
+ {
359
+ table,
360
+ filters,
361
+ columns,
362
+ count,
363
+ pageSize: PAGE_SIZE,
364
+ orderBy: [
365
+ { key: "title", label: t("fields.title") },
366
+ { key: "created_at", label: t("fields.createdAt") },
367
+ { key: "updated_at", label: t("fields.updatedAt") },
368
+ { key: "revoked_at", label: t("fields.revokedAt") }
369
+ ],
370
+ navigateTo: (row) => row.id,
371
+ pagination: true,
372
+ search: true,
373
+ queryObject: raw,
374
+ isLoading
375
+ }
376
+ )
377
+ ] });
378
+ };
379
+
380
+ // src/routes/api-key-management/api-key-management-list/api-key-management-list.tsx
381
+ import { jsx as jsx7 } from "react/jsx-runtime";
382
+ var ApiKeyManagementList = () => {
383
+ const { pathname } = useLocation();
384
+ const { getWidgets } = useExtension();
385
+ const keyType = getApiKeyTypeFromPathname(pathname);
386
+ return /* @__PURE__ */ jsx7(
387
+ SingleColumnPage,
388
+ {
389
+ hasOutlet: true,
390
+ widgets: {
391
+ before: getWidgets("api_key.list.before"),
392
+ after: getWidgets("api_key.list.after")
393
+ },
394
+ children: /* @__PURE__ */ jsx7(ApiKeyManagementListTable, { keyType })
395
+ }
396
+ );
397
+ };
398
+ export {
399
+ ApiKeyManagementList as Component
400
+ };