@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,175 @@
1
+ import {
2
+ getTransactionState,
3
+ getTransactionStateColor
4
+ } from "./chunk-RPAL6FHW.mjs";
5
+ import {
6
+ StatusCell
7
+ } from "./chunk-WILMJYUB.mjs";
8
+ import {
9
+ useWorkflowExecutions
10
+ } from "./chunk-LKWTBYYC.mjs";
11
+ import {
12
+ SingleColumnPage
13
+ } from "./chunk-22YYMH6M.mjs";
14
+ import {
15
+ useExtension
16
+ } from "./chunk-C5P5PL3E.mjs";
17
+ import {
18
+ _DataTable,
19
+ useDataTable
20
+ } from "./chunk-7ZHDHEUH.mjs";
21
+ import "./chunk-ITNQKZQQ.mjs";
22
+ import {
23
+ useQueryParams
24
+ } from "./chunk-C76H5USB.mjs";
25
+ import "./chunk-DFFLVEZ5.mjs";
26
+ import "./chunk-535OVBXR.mjs";
27
+ import "./chunk-S4DMV3ZT.mjs";
28
+ import "./chunk-774WSTCC.mjs";
29
+ import "./chunk-DTY37DDZ.mjs";
30
+ import "./chunk-QZ7TP4HQ.mjs";
31
+
32
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx
33
+ import { Container, Heading, Text } from "@acmekit/ui";
34
+ import { keepPreviousData } from "@tanstack/react-query";
35
+ import { useTranslation as useTranslation2 } from "react-i18next";
36
+
37
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx
38
+ import { Badge } from "@acmekit/ui";
39
+ import { createColumnHelper } from "@tanstack/react-table";
40
+ import { useMemo } from "react";
41
+ import { useTranslation } from "react-i18next";
42
+ import { jsx } from "react/jsx-runtime";
43
+ var columnHelper = createColumnHelper();
44
+ var useWorkflowExecutionTableColumns = () => {
45
+ const { t } = useTranslation();
46
+ return useMemo(
47
+ () => [
48
+ columnHelper.accessor("transaction_id", {
49
+ header: t("workflowExecutions.transactionIdLabel"),
50
+ cell: ({ getValue }) => /* @__PURE__ */ jsx(Badge, { size: "2xsmall", children: getValue() })
51
+ }),
52
+ columnHelper.accessor("state", {
53
+ header: t("fields.state"),
54
+ cell: ({ getValue }) => {
55
+ const state = getValue();
56
+ const color = getTransactionStateColor(state);
57
+ const translatedState = getTransactionState(t, state);
58
+ return /* @__PURE__ */ jsx(StatusCell, { color, children: /* @__PURE__ */ jsx("span", { className: "capitalize", children: translatedState }) });
59
+ }
60
+ }),
61
+ columnHelper.accessor("execution", {
62
+ header: t("workflowExecutions.progressLabel"),
63
+ cell: ({ getValue }) => {
64
+ const steps = getValue()?.steps;
65
+ if (!steps) {
66
+ return "0 of 0 steps";
67
+ }
68
+ const actionableSteps = Object.values(steps).filter(
69
+ (step) => step.id !== ROOT_PREFIX
70
+ );
71
+ const completedSteps = actionableSteps.filter(
72
+ (step) => step.invoke.state === "done" /* DONE */
73
+ );
74
+ return t("workflowExecutions.stepsCompletedLabel", {
75
+ completed: completedSteps.length,
76
+ count: actionableSteps.length
77
+ });
78
+ }
79
+ })
80
+ ],
81
+ [t]
82
+ );
83
+ };
84
+ var ROOT_PREFIX = "_root";
85
+
86
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-query.tsx
87
+ var useWorkflowExecutionTableQuery = ({
88
+ pageSize = 20,
89
+ prefix
90
+ }) => {
91
+ const raw = useQueryParams(["q", "offset"], prefix);
92
+ const { offset, ...rest } = raw;
93
+ const searchParams = {
94
+ limit: pageSize,
95
+ offset: offset ? parseInt(offset) : 0,
96
+ ...rest
97
+ };
98
+ return {
99
+ searchParams,
100
+ raw
101
+ };
102
+ };
103
+
104
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx
105
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
106
+ var PAGE_SIZE = 20;
107
+ var WorkflowExecutionListTable = () => {
108
+ const { t } = useTranslation2();
109
+ const { searchParams, raw } = useWorkflowExecutionTableQuery({
110
+ pageSize: PAGE_SIZE
111
+ });
112
+ const { workflow_executions, count, isLoading, isError, error } = useWorkflowExecutions(
113
+ {
114
+ ...searchParams
115
+ },
116
+ {
117
+ placeholderData: keepPreviousData
118
+ }
119
+ );
120
+ const columns = useWorkflowExecutionTableColumns();
121
+ const { table } = useDataTable({
122
+ data: workflow_executions || [],
123
+ columns,
124
+ count,
125
+ pageSize: PAGE_SIZE,
126
+ enablePagination: true,
127
+ getRowId: (row) => row.id
128
+ });
129
+ if (isError) {
130
+ throw error;
131
+ }
132
+ return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
133
+ /* @__PURE__ */ jsx2("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsxs("div", { children: [
134
+ /* @__PURE__ */ jsx2(Heading, { children: t("workflowExecutions.domain") }),
135
+ /* @__PURE__ */ jsx2(Text, { className: "text-ui-fg-subtle", size: "small", children: t(`workflowExecutions.subtitle`) })
136
+ ] }) }),
137
+ /* @__PURE__ */ jsx2(
138
+ _DataTable,
139
+ {
140
+ table,
141
+ columns,
142
+ count,
143
+ isLoading,
144
+ pageSize: PAGE_SIZE,
145
+ navigateTo: (row) => `${row.id}`,
146
+ search: true,
147
+ pagination: true,
148
+ queryObject: raw,
149
+ noRecords: {
150
+ message: t("workflowExecutions.list.noRecordsMessage")
151
+ }
152
+ }
153
+ )
154
+ ] });
155
+ };
156
+
157
+ // src/routes/workflow-executions/workflow-execution-list/workflow-execution-list.tsx
158
+ import { jsx as jsx3 } from "react/jsx-runtime";
159
+ var WorkflowExcecutionList = () => {
160
+ const { getWidgets } = useExtension();
161
+ return /* @__PURE__ */ jsx3(
162
+ SingleColumnPage,
163
+ {
164
+ widgets: {
165
+ after: getWidgets("workflow.list.after"),
166
+ before: getWidgets("workflow.list.before")
167
+ },
168
+ hasOutlet: false,
169
+ children: /* @__PURE__ */ jsx3(WorkflowExecutionListTable, {})
170
+ }
171
+ );
172
+ };
173
+ export {
174
+ WorkflowExcecutionList as Component
175
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acmekit/dashboard",
3
- "version": "2.13.7",
3
+ "version": "2.13.8",
4
4
  "scripts": {
5
5
  "generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
6
6
  "dev": "../../../node_modules/.bin/vite",
@@ -39,10 +39,10 @@
39
39
  "dist"
40
40
  ],
41
41
  "dependencies": {
42
- "@acmekit/admin-shared": "2.13.7",
43
- "@acmekit/icons": "2.13.7",
44
- "@acmekit/js-sdk": "2.13.7",
45
- "@acmekit/ui": "4.1.7",
42
+ "@acmekit/admin-shared": "2.13.8",
43
+ "@acmekit/icons": "2.13.8",
44
+ "@acmekit/js-sdk": "2.13.8",
45
+ "@acmekit/ui": "4.1.8",
46
46
  "@ariakit/react": "^0.4.15",
47
47
  "@babel/runtime": "^7.26.10",
48
48
  "@dnd-kit/core": "^6.1.0",
@@ -80,10 +80,10 @@
80
80
  "zod": "3.25.76"
81
81
  },
82
82
  "devDependencies": {
83
- "@acmekit/admin-shared": "2.13.7",
84
- "@acmekit/admin-vite-plugin": "2.13.7",
85
- "@acmekit/types": "2.13.7",
86
- "@acmekit/ui-preset": "2.13.7"
83
+ "@acmekit/admin-shared": "2.13.8",
84
+ "@acmekit/admin-vite-plugin": "2.13.8",
85
+ "@acmekit/types": "2.13.8",
86
+ "@acmekit/ui-preset": "2.13.8"
87
87
  },
88
88
  "packageManager": "yarn@3.2.1"
89
89
  }
@@ -39,8 +39,14 @@ const useDeveloperRoutes = (): INavItem[] => {
39
39
  const { t } = useTranslation()
40
40
  return useMemo(
41
41
  () => [
42
- { label: t("apiKeyManagement.domain.publishable"), to: "/settings/publishable-api-keys" },
43
- { label: t("apiKeyManagement.domain.secret"), to: "/settings/secret-api-keys" },
42
+ {
43
+ label: t("apiKeyManagement.domain.publishable"),
44
+ to: "/settings/publishable-api-keys",
45
+ },
46
+ {
47
+ label: t("apiKeyManagement.domain.secret"),
48
+ to: "/settings/secret-api-keys",
49
+ },
44
50
  { label: t("workflowExecutions.domain"), to: "/settings/workflows" },
45
51
  ],
46
52
  [t]
@@ -1,221 +0,0 @@
1
- import {
2
- queryKeysFactory
3
- } from "./chunk-QYOO4QR6.mjs";
4
- import {
5
- sdk
6
- } from "./chunk-4VYJHIB3.mjs";
7
-
8
- // src/hooks/api/api-keys.tsx
9
- import {
10
- useMutation as useMutation4,
11
- useQuery as useQuery4
12
- } from "@tanstack/react-query";
13
-
14
- // src/hooks/api/sales-channels.tsx
15
- import {
16
- useMutation as useMutation3,
17
- useQuery as useQuery3
18
- } from "@tanstack/react-query";
19
-
20
- // src/hooks/api/products.tsx
21
- import {
22
- useMutation as useMutation2,
23
- useQuery as useQuery2
24
- } from "@tanstack/react-query";
25
-
26
- // src/hooks/api/inventory.tsx
27
- import {
28
- useMutation,
29
- useQuery
30
- } from "@tanstack/react-query";
31
- var INVENTORY_ITEMS_QUERY_KEY = "inventory_items";
32
- var inventoryItemsQueryKeys = queryKeysFactory(
33
- INVENTORY_ITEMS_QUERY_KEY
34
- );
35
- var INVENTORY_ITEM_LEVELS_QUERY_KEY = "inventory_item_levels";
36
- var inventoryItemLevelsQueryKeys = queryKeysFactory(
37
- INVENTORY_ITEM_LEVELS_QUERY_KEY
38
- );
39
-
40
- // src/hooks/use-infinite-list.tsx
41
- import {
42
- useInfiniteQuery
43
- } from "@tanstack/react-query";
44
-
45
- // src/hooks/api/products.tsx
46
- var PRODUCTS_QUERY_KEY = "products";
47
- var productsQueryKeys = queryKeysFactory(PRODUCTS_QUERY_KEY);
48
- var VARIANTS_QUERY_KEY = "product_variants";
49
- var variantsQueryKeys = queryKeysFactory(VARIANTS_QUERY_KEY);
50
- var OPTIONS_QUERY_KEY = "product_options";
51
- var optionsQueryKeys = queryKeysFactory(OPTIONS_QUERY_KEY);
52
-
53
- // src/hooks/api/sales-channels.tsx
54
- var SALES_CHANNELS_QUERY_KEY = "sales-channels";
55
- var salesChannelsQueryKeys = queryKeysFactory(SALES_CHANNELS_QUERY_KEY);
56
-
57
- // src/hooks/api/api-keys.tsx
58
- var API_KEYS_QUERY_KEY = "api_keys";
59
- var apiKeysQueryKeys = queryKeysFactory(API_KEYS_QUERY_KEY);
60
-
61
- // src/hooks/api/cloud.tsx
62
- import {
63
- useMutation as useMutation5,
64
- useQuery as useQuery5
65
- } from "@tanstack/react-query";
66
- var cloudQueryKeys = {
67
- all: ["cloud"],
68
- auth: () => [...cloudQueryKeys.all, "auth"]
69
- };
70
- var useCloudAuthEnabled = (options) => {
71
- return useQuery5({
72
- queryKey: cloudQueryKeys.auth(),
73
- queryFn: async () => {
74
- return await sdk.client.fetch("/cloud/auth");
75
- },
76
- ...options
77
- });
78
- };
79
- var useCreateCloudAuthUser = (options) => {
80
- return useMutation5({
81
- mutationFn: async () => {
82
- await sdk.client.fetch("/cloud/auth/users", {
83
- method: "POST"
84
- });
85
- },
86
- ...options
87
- });
88
- };
89
-
90
- // src/hooks/api/feature-flags.tsx
91
- import { useQuery as useQuery6 } from "@tanstack/react-query";
92
- var useFeatureFlags = () => {
93
- return useQuery6({
94
- queryKey: ["admin", "feature-flags"],
95
- queryFn: async () => {
96
- const response = await sdk.client.fetch(
97
- "/admin/feature-flags",
98
- {
99
- method: "GET"
100
- }
101
- );
102
- return response.feature_flags;
103
- },
104
- staleTime: 5 * 60 * 1e3,
105
- // Cache for 5 minutes
106
- cacheTime: 10 * 60 * 1e3
107
- // Keep in cache for 10 minutes
108
- });
109
- };
110
-
111
- // src/hooks/api/locales.tsx
112
- import { useQuery as useQuery7 } from "@tanstack/react-query";
113
- var LOCALES_QUERY_KEY = "locales";
114
- var localesQueryKeys = queryKeysFactory(LOCALES_QUERY_KEY);
115
-
116
- // src/hooks/api/notification.tsx
117
- import { useQuery as useQuery8 } from "@tanstack/react-query";
118
- var NOTIFICATION_QUERY_KEY = "notification";
119
- var notificationQueryKeys = queryKeysFactory(NOTIFICATION_QUERY_KEY);
120
- var useNotifications = (query, options) => {
121
- const { data, ...rest } = useQuery8({
122
- queryFn: () => sdk.admin.notification.list(query),
123
- queryKey: notificationQueryKeys.list(query),
124
- ...options
125
- });
126
- return { ...data, ...rest };
127
- };
128
-
129
- // src/hooks/api/plugins.tsx
130
- import { useQuery as useQuery9 } from "@tanstack/react-query";
131
- var PLUGINS_QUERY_KEY = "plugins";
132
- var pluginsQueryKeys = queryKeysFactory(PLUGINS_QUERY_KEY);
133
-
134
- // src/hooks/api/store.tsx
135
- import {
136
- useMutation as useMutation6,
137
- useQuery as useQuery10
138
- } from "@tanstack/react-query";
139
- import { FetchError } from "@acmekit/js-sdk";
140
- var STORE_QUERY_KEY = "store";
141
- var storeQueryKeys = queryKeysFactory(STORE_QUERY_KEY);
142
-
143
- // src/hooks/api/translations.tsx
144
- import {
145
- useInfiniteQuery as useInfiniteQuery2,
146
- useMutation as useMutation7,
147
- useQuery as useQuery11
148
- } from "@tanstack/react-query";
149
- var TRANSLATIONS_QUERY_KEY = "translations";
150
- var translationsQueryKeys = queryKeysFactory(TRANSLATIONS_QUERY_KEY);
151
- var TRANSLATION_SETTINGS_QUERY_KEY = "translation_settings";
152
- var translationSettingsQueryKeys = queryKeysFactory(
153
- TRANSLATION_SETTINGS_QUERY_KEY
154
- );
155
- var TRANSLATION_STATISTICS_QUERY_KEY = "translation_statistics";
156
- var translationStatisticsQueryKeys = queryKeysFactory(
157
- TRANSLATION_STATISTICS_QUERY_KEY
158
- );
159
- var TRANSLATION_ENTITIES_QUERY_KEY = "translation_entities";
160
- var translationEntitiesQueryKeys = queryKeysFactory(
161
- TRANSLATION_ENTITIES_QUERY_KEY
162
- );
163
-
164
- // src/hooks/api/users.tsx
165
- import {
166
- useMutation as useMutation8,
167
- useQuery as useQuery12
168
- } from "@tanstack/react-query";
169
- var USERS_QUERY_KEY = "users";
170
- var usersQueryKeys = {
171
- ...queryKeysFactory(USERS_QUERY_KEY),
172
- me: () => [USERS_QUERY_KEY, "me"]
173
- };
174
- var useMe = (query, options) => {
175
- const { data, ...rest } = useQuery12({
176
- queryFn: () => sdk.admin.user.me(query),
177
- queryKey: usersQueryKeys.me(),
178
- ...options
179
- });
180
- return {
181
- ...data,
182
- ...rest
183
- };
184
- };
185
-
186
- // src/hooks/api/views.tsx
187
- import {
188
- useMutation as useMutation9,
189
- useQuery as useQuery13
190
- } from "@tanstack/react-query";
191
- var VIEWS_QUERY_KEY = "views";
192
- var _viewsKeys = queryKeysFactory(VIEWS_QUERY_KEY);
193
- _viewsKeys.columns = function(entity) {
194
- return [this.all, "columns", entity];
195
- };
196
- _viewsKeys.active = function(entity) {
197
- return [this.detail(entity), "active"];
198
- };
199
- _viewsKeys.configurations = function(entity, query) {
200
- const key = [this.all, "configurations", entity];
201
- if (query !== void 0) {
202
- key.push(query);
203
- }
204
- return key;
205
- };
206
-
207
- // src/hooks/api/workflow-executions.tsx
208
- import { useQuery as useQuery14 } from "@tanstack/react-query";
209
- var WORKFLOW_EXECUTIONS_QUERY_KEY = "workflow_executions";
210
- var workflowExecutionsQueryKeys = queryKeysFactory(
211
- WORKFLOW_EXECUTIONS_QUERY_KEY
212
- );
213
-
214
- export {
215
- useFeatureFlags,
216
- useMe,
217
- useCloudAuthEnabled,
218
- useCreateCloudAuthUser,
219
- notificationQueryKeys,
220
- useNotifications
221
- };
@@ -1,73 +0,0 @@
1
- import {
2
- sdk
3
- } from "./chunk-4VYJHIB3.mjs";
4
-
5
- // src/hooks/api/invites.tsx
6
- import {
7
- useMutation,
8
- useQuery
9
- } from "@tanstack/react-query";
10
-
11
- // src/lib/query-client.ts
12
- import { QueryClient } from "@tanstack/react-query";
13
- var MEDUSA_BACKEND_URL = __BACKEND_URL__ ?? "/";
14
- var queryClient = new QueryClient({
15
- defaultOptions: {
16
- queries: {
17
- refetchOnWindowFocus: false,
18
- staleTime: 9e4,
19
- retry: 1
20
- }
21
- }
22
- });
23
-
24
- // src/lib/query-key-factory.ts
25
- var queryKeysFactory = (globalKey) => {
26
- const queryKeyFactory = {
27
- all: [globalKey],
28
- lists: () => [...queryKeyFactory.all, "list"],
29
- list: (query) => [...queryKeyFactory.lists(), query ? { query } : void 0].filter(
30
- (k) => !!k
31
- ),
32
- details: () => [...queryKeyFactory.all, "detail"],
33
- detail: (id, query) => [...queryKeyFactory.details(), id, query ? { query } : void 0].filter(
34
- (k) => !!k
35
- )
36
- };
37
- return queryKeyFactory;
38
- };
39
-
40
- // src/hooks/api/invites.tsx
41
- var INVITES_QUERY_KEY = "invites";
42
- var invitesQueryKeys = queryKeysFactory(INVITES_QUERY_KEY);
43
- var useAcceptInvite = (inviteToken, options) => {
44
- return useMutation({
45
- mutationFn: (payload) => {
46
- const { auth_token, ...rest } = payload;
47
- return sdk.admin.invite.accept(
48
- { invite_token: inviteToken, ...rest },
49
- {},
50
- {
51
- Authorization: `Bearer ${auth_token}`
52
- }
53
- );
54
- },
55
- onSuccess: (data, variables, context) => {
56
- options?.onSuccess?.(data, variables, context);
57
- },
58
- ...options
59
- });
60
- };
61
-
62
- // src/lib/is-fetch-error.ts
63
- import { FetchError } from "@acmekit/js-sdk";
64
- var isFetchError = (error) => {
65
- return error instanceof FetchError;
66
- };
67
-
68
- export {
69
- queryClient,
70
- queryKeysFactory,
71
- useAcceptInvite,
72
- isFetchError
73
- };