@acmekit/dashboard 2.13.7 → 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 (60) 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-AIMR26AL.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 +8 -2
  59. package/dist/chunk-FBTP4AJM.mjs +0 -221
  60. package/dist/chunk-QYOO4QR6.mjs +0 -73
@@ -0,0 +1,83 @@
1
+ import {
2
+ queryClient
3
+ } from "./chunk-FXYH54JP.mjs";
4
+ import {
5
+ queryKeysFactory
6
+ } from "./chunk-774WSTCC.mjs";
7
+ import {
8
+ sdk
9
+ } from "./chunk-DTY37DDZ.mjs";
10
+
11
+ // src/hooks/api/invites.tsx
12
+ import {
13
+ useMutation,
14
+ useQuery
15
+ } from "@tanstack/react-query";
16
+ var INVITES_QUERY_KEY = "invites";
17
+ var invitesQueryKeys = queryKeysFactory(INVITES_QUERY_KEY);
18
+ var useInvites = (query, options) => {
19
+ const { data, ...rest } = useQuery({
20
+ queryFn: () => sdk.admin.invite.list(query),
21
+ queryKey: invitesQueryKeys.list(query),
22
+ ...options
23
+ });
24
+ return { ...data, ...rest };
25
+ };
26
+ var useCreateInvite = (options) => {
27
+ return useMutation({
28
+ mutationFn: (payload) => sdk.admin.invite.create(payload),
29
+ onSuccess: (data, variables, context) => {
30
+ queryClient.invalidateQueries({ queryKey: invitesQueryKeys.lists() });
31
+ options?.onSuccess?.(data, variables, context);
32
+ },
33
+ ...options
34
+ });
35
+ };
36
+ var useResendInvite = (id, options) => {
37
+ return useMutation({
38
+ mutationFn: () => sdk.admin.invite.resend(id),
39
+ onSuccess: (data, variables, context) => {
40
+ queryClient.invalidateQueries({ queryKey: invitesQueryKeys.lists() });
41
+ queryClient.invalidateQueries({ queryKey: invitesQueryKeys.detail(id) });
42
+ options?.onSuccess?.(data, variables, context);
43
+ },
44
+ ...options
45
+ });
46
+ };
47
+ var useDeleteInvite = (id, options) => {
48
+ return useMutation({
49
+ mutationFn: () => sdk.admin.invite.delete(id),
50
+ onSuccess: (data, variables, context) => {
51
+ queryClient.invalidateQueries({ queryKey: invitesQueryKeys.lists() });
52
+ queryClient.invalidateQueries({ queryKey: invitesQueryKeys.detail(id) });
53
+ options?.onSuccess?.(data, variables, context);
54
+ },
55
+ ...options
56
+ });
57
+ };
58
+ var useAcceptInvite = (inviteToken, options) => {
59
+ return useMutation({
60
+ mutationFn: (payload) => {
61
+ const { auth_token, ...rest } = payload;
62
+ return sdk.admin.invite.accept(
63
+ { invite_token: inviteToken, ...rest },
64
+ {},
65
+ {
66
+ Authorization: `Bearer ${auth_token}`
67
+ }
68
+ );
69
+ },
70
+ onSuccess: (data, variables, context) => {
71
+ options?.onSuccess?.(data, variables, context);
72
+ },
73
+ ...options
74
+ });
75
+ };
76
+
77
+ export {
78
+ useInvites,
79
+ useCreateInvite,
80
+ useResendInvite,
81
+ useDeleteInvite,
82
+ useAcceptInvite
83
+ };
@@ -0,0 +1,387 @@
1
+ import {
2
+ Skeleton
3
+ } from "./chunk-ITNQKZQQ.mjs";
4
+ import {
5
+ KeyboundForm,
6
+ RouteDrawer,
7
+ useRouteModal
8
+ } from "./chunk-2U3RK3JG.mjs";
9
+ import {
10
+ Form
11
+ } from "./chunk-ND3ODI36.mjs";
12
+ import {
13
+ ConditionalTooltip
14
+ } from "./chunk-OAHCJFG3.mjs";
15
+ import {
16
+ useDocumentDirection
17
+ } from "./chunk-S4DMV3ZT.mjs";
18
+
19
+ // src/components/forms/metadata-form/metadata-form.tsx
20
+ import { zodResolver } from "@hookform/resolvers/zod";
21
+ import {
22
+ Button,
23
+ DropdownMenu,
24
+ Heading,
25
+ IconButton,
26
+ InlineTip,
27
+ clx,
28
+ toast
29
+ } from "@acmekit/ui";
30
+ import { useFieldArray, useForm } from "react-hook-form";
31
+ import { useTranslation } from "react-i18next";
32
+ import { z } from "zod";
33
+ import {
34
+ ArrowDownMini,
35
+ ArrowUpMini,
36
+ EllipsisVertical,
37
+ Trash
38
+ } from "@acmekit/icons";
39
+ import { forwardRef } from "react";
40
+ import { jsx, jsxs } from "react/jsx-runtime";
41
+ var MetadataFieldSchema = z.object({
42
+ key: z.string(),
43
+ disabled: z.boolean().optional(),
44
+ value: z.any()
45
+ });
46
+ var MetadataSchema = z.object({
47
+ metadata: z.array(MetadataFieldSchema)
48
+ });
49
+ var MetadataForm = (props) => {
50
+ const { t } = useTranslation();
51
+ const { isPending, ...innerProps } = props;
52
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
53
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
54
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: t("metadata.edit.header") }) }),
55
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { className: "sr-only", children: t("metadata.edit.description") })
56
+ ] }),
57
+ isPending ? /* @__PURE__ */ jsx(PlaceholderInner, {}) : /* @__PURE__ */ jsx(InnerForm, { ...innerProps })
58
+ ] });
59
+ };
60
+ var METADATA_KEY_LABEL_ID = "metadata-form-key-label";
61
+ var METADATA_VALUE_LABEL_ID = "metadata-form-value-label";
62
+ var InnerForm = ({
63
+ metadata,
64
+ hook,
65
+ isMutating
66
+ }) => {
67
+ const { t } = useTranslation();
68
+ const { handleSuccess } = useRouteModal();
69
+ const direction = useDocumentDirection();
70
+ const hasUneditableRows = getHasUneditableRows(metadata);
71
+ const form = useForm({
72
+ defaultValues: {
73
+ metadata: getDefaultValues(metadata)
74
+ },
75
+ resolver: zodResolver(MetadataSchema)
76
+ });
77
+ const handleSubmit = form.handleSubmit(async (data) => {
78
+ const parsedData = parseValues(data, metadata);
79
+ await hook(
80
+ {
81
+ metadata: parsedData
82
+ },
83
+ {
84
+ onSuccess: () => {
85
+ toast.success(t("metadata.edit.successToast"));
86
+ handleSuccess();
87
+ },
88
+ onError: (error) => {
89
+ toast.error(error.message);
90
+ }
91
+ }
92
+ );
93
+ });
94
+ const { fields, insert, remove } = useFieldArray({
95
+ control: form.control,
96
+ name: "metadata"
97
+ });
98
+ function deleteRow(index) {
99
+ remove(index);
100
+ if (fields.length === 1) {
101
+ insert(0, {
102
+ key: "",
103
+ value: "",
104
+ disabled: false
105
+ });
106
+ }
107
+ }
108
+ function insertRow(index, position) {
109
+ insert(index + (position === "above" ? 0 : 1), {
110
+ key: "",
111
+ value: "",
112
+ disabled: false
113
+ });
114
+ }
115
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
116
+ KeyboundForm,
117
+ {
118
+ onSubmit: handleSubmit,
119
+ className: "flex flex-1 flex-col overflow-hidden",
120
+ children: [
121
+ /* @__PURE__ */ jsxs(RouteDrawer.Body, { className: "flex flex-1 flex-col gap-y-8 overflow-y-auto", children: [
122
+ /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-base shadow-elevation-card-rest grid grid-cols-1 divide-y rounded-lg", children: [
123
+ /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle grid grid-cols-2 divide-x rounded-t-lg", children: [
124
+ /* @__PURE__ */ jsx("div", { className: "txt-compact-small-plus text-ui-fg-subtle px-2 py-1.5", children: /* @__PURE__ */ jsx("label", { id: METADATA_KEY_LABEL_ID, children: t("metadata.edit.labels.key") }) }),
125
+ /* @__PURE__ */ jsx("div", { className: "txt-compact-small-plus text-ui-fg-subtle px-2 py-1.5", children: /* @__PURE__ */ jsx("label", { id: METADATA_VALUE_LABEL_ID, children: t("metadata.edit.labels.value") }) })
126
+ ] }),
127
+ fields.map((field, index) => {
128
+ const isDisabled = field.disabled || false;
129
+ let placeholder = "-";
130
+ if (typeof field.value === "object") {
131
+ placeholder = "{ ... }";
132
+ }
133
+ if (Array.isArray(field.value)) {
134
+ placeholder = "[ ... ]";
135
+ }
136
+ return /* @__PURE__ */ jsx(
137
+ ConditionalTooltip,
138
+ {
139
+ showTooltip: isDisabled,
140
+ content: t("metadata.edit.complexRow.tooltip"),
141
+ children: /* @__PURE__ */ jsxs("div", { className: "group/table relative", children: [
142
+ /* @__PURE__ */ jsxs(
143
+ "div",
144
+ {
145
+ className: clx("grid grid-cols-2 divide-x", {
146
+ "overflow-hidden rounded-b-lg": index === fields.length - 1
147
+ }),
148
+ children: [
149
+ /* @__PURE__ */ jsx(
150
+ Form.Field,
151
+ {
152
+ control: form.control,
153
+ name: `metadata.${index}.key`,
154
+ render: ({ field: field2 }) => {
155
+ return /* @__PURE__ */ jsx(Form.Item, { children: /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
156
+ GridInput,
157
+ {
158
+ "aria-labelledby": METADATA_KEY_LABEL_ID,
159
+ ...field2,
160
+ disabled: isDisabled,
161
+ placeholder: "Key"
162
+ }
163
+ ) }) });
164
+ }
165
+ }
166
+ ),
167
+ /* @__PURE__ */ jsx(
168
+ Form.Field,
169
+ {
170
+ control: form.control,
171
+ name: `metadata.${index}.value`,
172
+ render: ({ field: { value, ...field2 } }) => {
173
+ return /* @__PURE__ */ jsx(Form.Item, { children: /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
174
+ GridInput,
175
+ {
176
+ "aria-labelledby": METADATA_VALUE_LABEL_ID,
177
+ ...field2,
178
+ value: isDisabled ? placeholder : value,
179
+ disabled: isDisabled,
180
+ placeholder: "Value"
181
+ }
182
+ ) }) });
183
+ }
184
+ }
185
+ )
186
+ ]
187
+ }
188
+ ),
189
+ /* @__PURE__ */ jsxs(
190
+ DropdownMenu,
191
+ {
192
+ dir: direction,
193
+ children: [
194
+ /* @__PURE__ */ jsx(
195
+ DropdownMenu.Trigger,
196
+ {
197
+ className: clx(
198
+ "invisible absolute inset-y-0 -end-2.5 my-auto group-hover/table:visible data-[state='open']:visible",
199
+ {
200
+ hidden: isDisabled
201
+ }
202
+ ),
203
+ disabled: isDisabled,
204
+ asChild: true,
205
+ children: /* @__PURE__ */ jsx(IconButton, { size: "2xsmall", children: /* @__PURE__ */ jsx(EllipsisVertical, {}) })
206
+ }
207
+ ),
208
+ /* @__PURE__ */ jsxs(DropdownMenu.Content, { children: [
209
+ /* @__PURE__ */ jsxs(
210
+ DropdownMenu.Item,
211
+ {
212
+ className: "gap-x-2",
213
+ onClick: () => insertRow(index, "above"),
214
+ children: [
215
+ /* @__PURE__ */ jsx(ArrowUpMini, { className: "text-ui-fg-subtle" }),
216
+ t("metadata.edit.actions.insertRowAbove")
217
+ ]
218
+ }
219
+ ),
220
+ /* @__PURE__ */ jsxs(
221
+ DropdownMenu.Item,
222
+ {
223
+ className: "gap-x-2",
224
+ onClick: () => insertRow(index, "below"),
225
+ children: [
226
+ /* @__PURE__ */ jsx(ArrowDownMini, { className: "text-ui-fg-subtle" }),
227
+ t("metadata.edit.actions.insertRowBelow")
228
+ ]
229
+ }
230
+ ),
231
+ /* @__PURE__ */ jsx(DropdownMenu.Separator, {}),
232
+ /* @__PURE__ */ jsxs(
233
+ DropdownMenu.Item,
234
+ {
235
+ className: "gap-x-2",
236
+ onClick: () => deleteRow(index),
237
+ children: [
238
+ /* @__PURE__ */ jsx(Trash, { className: "text-ui-fg-subtle" }),
239
+ t("metadata.edit.actions.deleteRow")
240
+ ]
241
+ }
242
+ )
243
+ ] })
244
+ ]
245
+ }
246
+ )
247
+ ] })
248
+ },
249
+ field.id
250
+ );
251
+ })
252
+ ] }),
253
+ hasUneditableRows && /* @__PURE__ */ jsx(
254
+ InlineTip,
255
+ {
256
+ variant: "warning",
257
+ label: t("metadata.edit.complexRow.label"),
258
+ children: t("metadata.edit.complexRow.description")
259
+ }
260
+ )
261
+ ] }),
262
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
263
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(
264
+ Button,
265
+ {
266
+ size: "small",
267
+ variant: "secondary",
268
+ type: "button",
269
+ disabled: isMutating,
270
+ children: t("actions.cancel")
271
+ }
272
+ ) }),
273
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isMutating, children: t("actions.save") })
274
+ ] }) })
275
+ ]
276
+ }
277
+ ) });
278
+ };
279
+ var GridInput = forwardRef(({ className, ...props }, ref) => {
280
+ return /* @__PURE__ */ jsx(
281
+ "input",
282
+ {
283
+ ref,
284
+ ...props,
285
+ autoComplete: "off",
286
+ className: clx(
287
+ "txt-compact-small text-ui-fg-base placeholder:text-ui-fg-muted disabled:text-ui-fg-disabled disabled:bg-ui-bg-base bg-transparent px-2 py-1.5 outline-none",
288
+ className
289
+ )
290
+ }
291
+ );
292
+ });
293
+ GridInput.displayName = "MetadataForm.GridInput";
294
+ var PlaceholderInner = () => {
295
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
296
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-[148ox] w-full rounded-lg" }) }),
297
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
298
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-12 rounded-md" }),
299
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-12 rounded-md" })
300
+ ] }) })
301
+ ] });
302
+ };
303
+ var EDITABLE_TYPES = ["string", "number", "boolean"];
304
+ function getDefaultValues(metadata) {
305
+ if (!metadata || !Object.keys(metadata).length) {
306
+ return [
307
+ {
308
+ key: "",
309
+ value: "",
310
+ disabled: false
311
+ }
312
+ ];
313
+ }
314
+ return Object.entries(metadata).map(([key, value]) => {
315
+ if (!EDITABLE_TYPES.includes(typeof value)) {
316
+ return {
317
+ key,
318
+ value,
319
+ disabled: true
320
+ };
321
+ }
322
+ let stringValue = value;
323
+ if (typeof value !== "string") {
324
+ stringValue = JSON.stringify(value);
325
+ }
326
+ return {
327
+ key,
328
+ value: stringValue,
329
+ original_key: key
330
+ };
331
+ });
332
+ }
333
+ function parseValues(values, original) {
334
+ const metadata = values.metadata;
335
+ const isEmpty = !metadata.length || metadata.length === 1 && !metadata[0].key && !metadata[0].value;
336
+ if (isEmpty) {
337
+ return null;
338
+ }
339
+ const update = {};
340
+ if (original) {
341
+ Object.keys(original).forEach((originalKey) => {
342
+ const exists = metadata.some((field) => field.key === originalKey);
343
+ if (!exists) {
344
+ update[originalKey] = "";
345
+ }
346
+ });
347
+ }
348
+ metadata.forEach((field) => {
349
+ let key = field.key;
350
+ let value = field.value;
351
+ const disabled = field.disabled;
352
+ if (!key) {
353
+ return;
354
+ }
355
+ if (disabled) {
356
+ update[key] = value;
357
+ return;
358
+ }
359
+ key = key.trim();
360
+ value = value?.trim() ?? "";
361
+ if (value === "true") {
362
+ update[key] = true;
363
+ } else if (value === "false") {
364
+ update[key] = false;
365
+ } else {
366
+ const isNumeric = /^-?\d*\.?\d+$/.test(value);
367
+ if (isNumeric) {
368
+ update[key] = parseFloat(value);
369
+ } else {
370
+ update[key] = value;
371
+ }
372
+ }
373
+ });
374
+ return update;
375
+ }
376
+ function getHasUneditableRows(metadata) {
377
+ if (!metadata) {
378
+ return false;
379
+ }
380
+ return Object.values(metadata).some(
381
+ (value) => !EDITABLE_TYPES.includes(typeof value)
382
+ );
383
+ }
384
+
385
+ export {
386
+ MetadataForm
387
+ };
@@ -0,0 +1,80 @@
1
+ import {
2
+ queryClient
3
+ } from "./chunk-FXYH54JP.mjs";
4
+ import {
5
+ queryKeysFactory
6
+ } from "./chunk-774WSTCC.mjs";
7
+ import {
8
+ sdk
9
+ } from "./chunk-DTY37DDZ.mjs";
10
+
11
+ // src/hooks/api/users.tsx
12
+ import {
13
+ useMutation,
14
+ useQuery
15
+ } from "@tanstack/react-query";
16
+ var USERS_QUERY_KEY = "users";
17
+ var usersQueryKeys = {
18
+ ...queryKeysFactory(USERS_QUERY_KEY),
19
+ me: () => [USERS_QUERY_KEY, "me"]
20
+ };
21
+ var useMe = (query, options) => {
22
+ const { data, ...rest } = useQuery({
23
+ queryFn: () => sdk.admin.user.me(query),
24
+ queryKey: usersQueryKeys.me(),
25
+ ...options
26
+ });
27
+ return {
28
+ ...data,
29
+ ...rest
30
+ };
31
+ };
32
+ var useUser = (id, query, options) => {
33
+ const { data, ...rest } = useQuery({
34
+ queryFn: () => sdk.admin.user.retrieve(id, query),
35
+ queryKey: usersQueryKeys.detail(id),
36
+ ...options
37
+ });
38
+ return { ...data, ...rest };
39
+ };
40
+ var useUsers = (query, options) => {
41
+ const { data, ...rest } = useQuery({
42
+ queryFn: () => sdk.admin.user.list(query),
43
+ queryKey: usersQueryKeys.list(query),
44
+ ...options
45
+ });
46
+ return { ...data, ...rest };
47
+ };
48
+ var useUpdateUser = (id, query, options) => {
49
+ return useMutation({
50
+ mutationFn: (payload) => sdk.admin.user.update(id, payload, query),
51
+ onSuccess: (data, variables, context) => {
52
+ queryClient.invalidateQueries({ queryKey: usersQueryKeys.detail(id) });
53
+ queryClient.invalidateQueries({ queryKey: usersQueryKeys.lists() });
54
+ queryClient.invalidateQueries({ queryKey: usersQueryKeys.me() });
55
+ options?.onSuccess?.(data, variables, context);
56
+ },
57
+ ...options
58
+ });
59
+ };
60
+ var useDeleteUser = (id, options) => {
61
+ return useMutation({
62
+ mutationFn: () => sdk.admin.user.delete(id),
63
+ onSuccess: (data, variables, context) => {
64
+ queryClient.invalidateQueries({ queryKey: usersQueryKeys.detail(id) });
65
+ queryClient.invalidateQueries({ queryKey: usersQueryKeys.lists() });
66
+ queryClient.invalidateQueries({ queryKey: usersQueryKeys.me() });
67
+ options?.onSuccess?.(data, variables, context);
68
+ },
69
+ ...options
70
+ });
71
+ };
72
+
73
+ export {
74
+ usersQueryKeys,
75
+ useMe,
76
+ useUser,
77
+ useUsers,
78
+ useUpdateUser,
79
+ useDeleteUser
80
+ };
@@ -1,14 +1,22 @@
1
- import {
2
- isFetchError,
3
- useAcceptInvite
4
- } from "./chunk-QYOO4QR6.mjs";
5
1
  import {
6
2
  AvatarBox
7
- } from "./chunk-JSJZMTQG.mjs";
3
+ } from "./chunk-RREPQMYC.mjs";
4
+ import "./chunk-G2VJOHHV.mjs";
8
5
  import {
9
- Form,
10
6
  useSignUpWithEmailPass
11
- } from "./chunk-4VYJHIB3.mjs";
7
+ } from "./chunk-GBFVWROS.mjs";
8
+ import {
9
+ isFetchError
10
+ } from "./chunk-TCNCAWYD.mjs";
11
+ import {
12
+ useAcceptInvite
13
+ } from "./chunk-XIM7X4FB.mjs";
14
+ import {
15
+ Form
16
+ } from "./chunk-ND3ODI36.mjs";
17
+ import "./chunk-FXYH54JP.mjs";
18
+ import "./chunk-774WSTCC.mjs";
19
+ import "./chunk-DTY37DDZ.mjs";
12
20
  import "./chunk-QZ7TP4HQ.mjs";
13
21
 
14
22
  // src/routes/invite/invite.tsx
@@ -1,21 +1,35 @@
1
+ import {
2
+ AvatarBox
3
+ } from "./chunk-RREPQMYC.mjs";
4
+ import "./chunk-G2VJOHHV.mjs";
1
5
  import {
2
6
  useCloudAuthEnabled,
3
7
  useCreateCloudAuthUser
4
- } from "./chunk-FBTP4AJM.mjs";
8
+ } from "./chunk-6SQCO25J.mjs";
9
+ import "./chunk-ULSPL3DR.mjs";
10
+ import {
11
+ useSignInWithEmailPass
12
+ } from "./chunk-GBFVWROS.mjs";
13
+ import "./chunk-VBT5YZ4K.mjs";
14
+ import "./chunk-LKWTBYYC.mjs";
15
+ import "./chunk-OHAFITSB.mjs";
5
16
  import {
6
17
  useExtension
7
18
  } from "./chunk-C5P5PL3E.mjs";
19
+ import "./chunk-DN3MIYQH.mjs";
20
+ import "./chunk-YRWSG3YM.mjs";
8
21
  import {
9
22
  isFetchError
10
- } from "./chunk-QYOO4QR6.mjs";
23
+ } from "./chunk-TCNCAWYD.mjs";
24
+ import "./chunk-XIM7X4FB.mjs";
11
25
  import {
12
- AvatarBox
13
- } from "./chunk-JSJZMTQG.mjs";
26
+ Form
27
+ } from "./chunk-ND3ODI36.mjs";
28
+ import "./chunk-FXYH54JP.mjs";
29
+ import "./chunk-774WSTCC.mjs";
14
30
  import {
15
- Form,
16
- sdk,
17
- useSignInWithEmailPass
18
- } from "./chunk-4VYJHIB3.mjs";
31
+ sdk
32
+ } from "./chunk-DTY37DDZ.mjs";
19
33
  import "./chunk-QZ7TP4HQ.mjs";
20
34
 
21
35
  // src/routes/login/login.tsx
@@ -151,7 +165,7 @@ var Login = () => {
151
165
  const location = useLocation();
152
166
  const navigate = useNavigate2();
153
167
  const { getWidgets } = useExtension();
154
- const from = location.state?.from?.pathname || "/orders";
168
+ const from = location.state?.from?.pathname || "/";
155
169
  const form = useForm({
156
170
  resolver: zodResolver(LoginSchema),
157
171
  defaultValues: {