@acmekit/dashboard 2.13.7 → 2.13.9

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 (83) hide show
  1. package/dist/api-key-management-create-VWUERPPB.mjs +170 -0
  2. package/dist/api-key-management-detail-V4ENQHYY.mjs +306 -0
  3. package/dist/api-key-management-edit-R44OHS7B.mjs +106 -0
  4. package/dist/api-key-management-list-K2XPKF5E.mjs +400 -0
  5. package/dist/app.js +16765 -1370
  6. package/dist/app.mjs +786 -1030
  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-774WSTCC.mjs +19 -0
  11. package/dist/chunk-C76H5USB.mjs +16 -0
  12. package/dist/chunk-DFFLVEZ5.mjs +40 -0
  13. package/dist/chunk-DN3MIYQH.mjs +140 -0
  14. package/dist/chunk-DQCEH3X2.mjs +28 -0
  15. package/dist/chunk-DTY37DDZ.mjs +20 -0
  16. package/dist/chunk-EFRMWHRX.mjs +84 -0
  17. package/dist/chunk-FXYH54JP.mjs +16 -0
  18. package/dist/chunk-G22WWLPG.mjs +44 -0
  19. package/dist/chunk-G2VJOHHV.mjs +32 -0
  20. package/dist/chunk-GBFVWROS.mjs +58 -0
  21. package/dist/chunk-ITNQKZQQ.mjs +142 -0
  22. package/dist/chunk-IUCDCPJU.mjs +0 -0
  23. package/dist/chunk-LKWTBYYC.mjs +35 -0
  24. package/dist/{chunk-4VYJHIB3.mjs → chunk-ND3ODI36.mjs} +0 -72
  25. package/dist/chunk-OAHCJFG3.mjs +17 -0
  26. package/dist/chunk-RPAL6FHW.mjs +73 -0
  27. package/dist/{chunk-JSJZMTQG.mjs → chunk-RREPQMYC.mjs} +14 -41
  28. package/dist/chunk-S3REQHPQ.mjs +86 -0
  29. package/dist/chunk-S4DMV3ZT.mjs +35 -0
  30. package/dist/chunk-ST2YB7JN.mjs +74 -0
  31. package/dist/chunk-TCNCAWYD.mjs +9 -0
  32. package/dist/chunk-ULSPL3DR.mjs +126 -0
  33. package/dist/chunk-WILMJYUB.mjs +35 -0
  34. package/dist/chunk-XIM7X4FB.mjs +83 -0
  35. package/dist/chunk-YLPAZ2DP.mjs +1837 -0
  36. package/dist/chunk-YRWSG3YM.mjs +80 -0
  37. package/dist/{invite-S5USGDOZ.mjs → invite-XGPZZBUP.mjs} +15 -7
  38. package/dist/{login-AIMR26AL.mjs → login-GNP3QIPI.mjs} +25 -12
  39. package/dist/profile-detail-YX27F7N6.mjs +96 -0
  40. package/dist/profile-edit-2VRDU75O.mjs +173 -0
  41. package/dist/{reset-password-UQPRHMB3.mjs → reset-password-TWRNZO6Z.mjs} +7 -3
  42. package/dist/settings-3XWLL5LG.mjs +545 -0
  43. package/dist/translation-list-CCEQJNED.mjs +581 -0
  44. package/dist/translations-edit-E57GVUFV.mjs +5376 -0
  45. package/dist/user-detail-KUSRRVNX.mjs +169 -0
  46. package/dist/user-edit-HTN3ZGCL.mjs +114 -0
  47. package/dist/user-invite-E3FAAU3V.mjs +361 -0
  48. package/dist/user-list-KNJ5S3IM.mjs +1116 -0
  49. package/dist/user-metadata-5GQK75DT.mjs +425 -0
  50. package/dist/workflow-execution-detail-LZXCRVNC.mjs +819 -0
  51. package/dist/workflow-execution-list-HQ3V6TML.mjs +175 -0
  52. package/package.json +9 -9
  53. package/src/components/layout/settings-layout/settings-layout.tsx +8 -2
  54. package/src/dashboard-app/routes/get-route.map.tsx +1 -14
  55. package/src/hooks/api/api-keys.tsx +0 -49
  56. package/src/hooks/api/index.ts +0 -1
  57. package/src/providers/keybind-provider/hooks.tsx +0 -145
  58. package/src/routes/translations/translation-list/translation-list.tsx +10 -21
  59. package/src/routes/translations/translations-edit/translations-edit.tsx +14 -11
  60. package/src/vite-env.d.ts +3 -1
  61. package/dist/chunk-FBTP4AJM.mjs +0 -221
  62. package/dist/chunk-QYOO4QR6.mjs +0 -73
  63. package/src/components/data-table/helpers/sales-channels/index.ts +0 -4
  64. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-columns.tsx +0 -61
  65. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-empty-state.tsx +0 -22
  66. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-filters.tsx +0 -33
  67. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-query.tsx +0 -30
  68. package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/api-key-sales-channel-section.tsx +0 -206
  69. package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/index.ts +0 -1
  70. package/src/routes/store/common/hooks/use-currencies-table-columns.tsx +0 -29
  71. package/src/routes/store/common/hooks/use-currencies-table-query.tsx +0 -21
  72. package/src/routes/store/common/hooks/use-locales-table-columns.tsx +0 -29
  73. package/src/routes/store/common/hooks/use-locales-table-query.tsx +0 -21
  74. package/src/routes/store/store-detail/components/store-general-section/index.ts +0 -1
  75. package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx +0 -48
  76. package/src/routes/store/store-detail/index.ts +0 -2
  77. package/src/routes/store/store-detail/loader.ts +0 -18
  78. package/src/routes/store/store-detail/store-detail.tsx +0 -42
  79. package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +0 -83
  80. package/src/routes/store/store-edit/index.ts +0 -1
  81. package/src/routes/store/store-edit/store-edit.tsx +0 -25
  82. package/src/routes/store/store-metadata/index.ts +0 -1
  83. package/src/routes/store/store-metadata/store-metadata.tsx +0 -24
@@ -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
+ _DataTable,
12
+ useDataTable
13
+ } from "./chunk-YLPAZ2DP.mjs";
14
+ import {
15
+ useQueryParams
16
+ } from "./chunk-C76H5USB.mjs";
17
+ import {
18
+ useDate
19
+ } from "./chunk-DFFLVEZ5.mjs";
20
+ import "./chunk-535OVBXR.mjs";
21
+ import {
22
+ SingleColumnPage
23
+ } from "./chunk-22YYMH6M.mjs";
24
+ import {
25
+ useExtension
26
+ } from "./chunk-C5P5PL3E.mjs";
27
+ import {
28
+ ActionMenu
29
+ } from "./chunk-S3REQHPQ.mjs";
30
+ import {
31
+ useApiKeys,
32
+ useDeleteApiKey,
33
+ useRevokeApiKey
34
+ } from "./chunk-EFRMWHRX.mjs";
35
+ import "./chunk-ITNQKZQQ.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
+ };