@instockng/storefront-ui 1.0.16 → 1.0.17

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 (70) hide show
  1. package/dist/components/ui/button.d.ts +1 -1
  2. package/dist/index100.mjs +1 -1
  3. package/dist/index101.mjs +3 -3
  4. package/dist/index102.mjs +3 -3
  5. package/dist/index110.mjs +1 -1
  6. package/dist/index18.mjs +12 -21
  7. package/dist/index20.mjs +4 -9
  8. package/dist/index21.mjs +1 -1
  9. package/dist/index28.mjs +11 -11
  10. package/dist/index29.mjs +1 -1
  11. package/dist/index30.mjs +1 -1
  12. package/dist/index31.mjs +1 -1
  13. package/dist/index32.mjs +1 -1
  14. package/dist/index33.mjs +3 -3
  15. package/dist/index36.mjs +1 -1
  16. package/dist/index40.mjs +36 -23
  17. package/dist/index41.mjs +44 -36
  18. package/dist/index42.mjs +99 -44
  19. package/dist/index43.mjs +97 -99
  20. package/dist/index44.mjs +47 -78
  21. package/dist/index45.mjs +54 -53
  22. package/dist/index46.mjs +63 -55
  23. package/dist/index47.mjs +56 -79
  24. package/dist/index48.mjs +57 -63
  25. package/dist/index49.mjs +15 -70
  26. package/dist/index50.mjs +14 -14
  27. package/dist/index51.mjs +59 -13
  28. package/dist/index52.mjs +99 -36
  29. package/dist/index53.mjs +97 -97
  30. package/dist/index54.mjs +4 -132
  31. package/dist/index55.mjs +21 -73
  32. package/dist/index56.mjs +74 -14
  33. package/dist/index57.mjs +14 -62
  34. package/dist/index58.mjs +62 -4
  35. package/dist/index59.mjs +234 -3
  36. package/dist/index60.mjs +6 -2
  37. package/dist/index61.mjs +130 -30
  38. package/dist/index62.mjs +64 -39
  39. package/dist/index63.mjs +80 -228
  40. package/dist/index64.mjs +28 -5
  41. package/dist/index65.mjs +7 -132
  42. package/dist/index66.mjs +69 -62
  43. package/dist/index67.mjs +3 -86
  44. package/dist/index68.mjs +2 -29
  45. package/dist/index69.mjs +81 -7
  46. package/dist/index70.mjs +51 -72
  47. package/dist/index71.mjs +5 -3
  48. package/dist/index72.mjs +5 -2
  49. package/dist/index73.mjs +169 -73
  50. package/dist/index74.mjs +50 -51
  51. package/dist/index75.mjs +69 -6
  52. package/dist/index76.mjs +34 -5
  53. package/dist/index77.mjs +41 -177
  54. package/dist/index78.mjs +4 -53
  55. package/dist/index79.mjs +2 -69
  56. package/dist/index80.mjs +1 -1
  57. package/dist/index81.mjs +1 -1
  58. package/dist/index82.mjs +5 -5
  59. package/dist/index84.mjs +2 -2
  60. package/dist/index86.mjs +2 -2
  61. package/dist/index88.mjs +1 -1
  62. package/dist/index90.mjs +4 -4
  63. package/dist/index91.mjs +3 -3
  64. package/dist/index92.mjs +1 -1
  65. package/dist/index93.mjs +3 -3
  66. package/dist/index98.mjs +1 -1
  67. package/dist/styles.css +1 -1
  68. package/package.json +10 -9
  69. package/dist/test-utils/MockCartProvider.d.ts +0 -21
  70. package/dist/test-utils/MockCartProvider.d.ts.map +0 -1
package/dist/index47.mjs CHANGED
@@ -1,107 +1,84 @@
1
1
  'use client';
2
- import { useQueryClient as y, useMutation as v } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as m } from "./index58.mjs";
4
- import { createAdminRpcClients as u, authHeaders as c } from "./index21.mjs";
5
- import { queryKeys as i } from "./index26.mjs";
6
- import { useApiConfig as d } from "./index19.mjs";
7
- function k(t, n) {
8
- const { baseURL: a, authToken: r } = d();
9
- return m({
10
- queryKey: i.admin.variants.search(t),
2
+ import { useQueryClient as w, useMutation as y } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as d } from "./index54.mjs";
4
+ import { createAdminRpcClients as i, authHeaders as c } from "./index21.mjs";
5
+ import { queryKeys as u } from "./index26.mjs";
6
+ import { useApiConfig as l } from "./index19.mjs";
7
+ function F(e) {
8
+ const { baseURL: s, authToken: n } = l();
9
+ return d({
10
+ queryKey: u.admin.warehouses.list(),
11
11
  queryFn: async () => {
12
- const e = await u(a).variants.index.$get({ query: t }, c(r));
13
- if (!e.ok) throw new Error(`Failed to search variants: ${e.statusText}`);
14
- return e.json();
12
+ const t = await i(s).warehouses.index.$get({}, c(n));
13
+ if (!t.ok)
14
+ throw new Error(`Failed to fetch warehouses: ${t.statusText}`);
15
+ return t.json();
15
16
  },
16
- ...n
17
+ ...e
17
18
  });
18
19
  }
19
- function F(t, n) {
20
- const { baseURL: a, authToken: r } = d();
21
- return m({
22
- queryKey: i.admin.variants.byProduct(t),
23
- queryFn: async () => {
24
- const e = await u(a).variants.products[":productId"].variants.$get(
25
- { param: { productId: t } },
26
- c(r)
27
- );
28
- if (!e.ok) throw new Error(`Failed to fetch product variants: ${e.statusText}`);
29
- return e.json();
30
- },
31
- ...n
32
- });
33
- }
34
- function T(t, n) {
35
- const { baseURL: a, authToken: r } = d(), s = y();
36
- return v({
37
- mutationFn: async (e) => {
38
- const o = await u(a).variants.products[":productId"].variants.$post(
39
- { json: e, param: { productId: t } },
40
- c(r)
41
- );
42
- if (!o.ok) throw new Error(`Failed to create variant: ${o.statusText}`);
20
+ function T(e) {
21
+ const { baseURL: s, authToken: n } = l(), r = w();
22
+ return y({
23
+ mutationFn: async (t) => {
24
+ const o = await i(s).warehouses.index.$post({ json: t }, c(n));
25
+ if (!o.ok)
26
+ throw new Error(`Failed to create warehouse: ${o.statusText}`);
43
27
  return o.json();
44
28
  },
45
29
  onSuccess: () => {
46
- s.invalidateQueries({ queryKey: i.admin.variants.all }), s.invalidateQueries({ queryKey: i.admin.products.detail(t) });
30
+ r.invalidateQueries({ queryKey: u.admin.warehouses.all });
47
31
  },
48
- ...n
32
+ ...e
49
33
  });
50
34
  }
51
- function $(t, n) {
52
- const { baseURL: a, authToken: r } = d(), s = y();
53
- return v({
54
- mutationFn: async (e) => {
55
- const o = await u(a).variants[":id"].$patch(
56
- { json: e, param: { id: t } },
57
- c(r)
58
- );
59
- if (!o.ok) throw new Error(`Failed to update variant: ${o.statusText}`);
60
- return o.json();
35
+ function $(e, s) {
36
+ const { baseURL: n, authToken: r } = l(), t = w();
37
+ return y({
38
+ mutationFn: async (a) => {
39
+ const h = await i(n).warehouses[":id"].$patch({ json: a, param: { id: e } }, c(r));
40
+ if (!h.ok)
41
+ throw new Error(`Failed to update warehouse: ${h.statusText}`);
42
+ return h.json();
61
43
  },
62
44
  onSuccess: () => {
63
- s.invalidateQueries({ queryKey: i.admin.variants.detail(t) }), s.invalidateQueries({ queryKey: i.admin.variants.all });
45
+ t.invalidateQueries({ queryKey: u.admin.warehouses.detail(e) }), t.invalidateQueries({ queryKey: u.admin.warehouses.all });
64
46
  },
65
- ...n
47
+ ...s
66
48
  });
67
49
  }
68
- function K(t, n) {
69
- const { baseURL: a, authToken: r } = d();
70
- return m({
71
- queryKey: i.admin.variants.inventory(t),
50
+ function v(e, s) {
51
+ const { baseURL: n, authToken: r } = l();
52
+ return d({
53
+ queryKey: u.admin.warehouses.inventory(e),
72
54
  queryFn: async () => {
73
- const e = await u(a).variants[":id"].inventory.$get(
74
- { param: { id: t } },
75
- c(r)
76
- );
77
- if (!e.ok) throw new Error(`Failed to fetch variant inventory: ${e.statusText}`);
78
- return e.json();
55
+ const a = await i(n).warehouses[":id"].inventory.$get({ param: { id: e } }, c(r));
56
+ if (!a.ok)
57
+ throw new Error(`Failed to fetch warehouse inventory: ${a.statusText}`);
58
+ return a.json();
79
59
  },
80
- ...n
60
+ ...s
81
61
  });
82
62
  }
83
- function j(t, n) {
84
- const { baseURL: a, authToken: r } = d(), s = y();
85
- return v({
63
+ function x(e, s) {
64
+ const { baseURL: n, authToken: r } = l(), t = w();
65
+ return y({
86
66
  mutationFn: async () => {
87
- const l = await u(a).variants[":id"].$delete(
88
- { param: { id: t } },
89
- c(r)
90
- );
91
- if (!l.ok) throw new Error(`Failed to delete variant: ${l.statusText}`);
92
- return l.json();
67
+ const o = await i(n).warehouses[":id"].$delete({ param: { id: e } }, c(r));
68
+ if (!o.ok)
69
+ throw new Error(`Failed to delete warehouse: ${o.statusText}`);
70
+ return o.json();
93
71
  },
94
72
  onSuccess: () => {
95
- s.invalidateQueries({ queryKey: i.admin.variants.all });
73
+ t.invalidateQueries({ queryKey: u.admin.warehouses.all });
96
74
  },
97
- ...n
75
+ ...s
98
76
  });
99
77
  }
100
78
  export {
101
- T as useCreateVariant,
102
- j as useDeleteVariant,
103
- K as useGetVariantInventory,
104
- F as useListProductVariants,
105
- k as useSearchVariants,
106
- $ as useUpdateVariant
79
+ T as useCreateWarehouse,
80
+ x as useDeleteWarehouse,
81
+ v as useGetWarehouseInventory,
82
+ F as useListWarehouses,
83
+ $ as useUpdateWarehouse
107
84
  };
package/dist/index48.mjs CHANGED
@@ -1,88 +1,82 @@
1
1
  'use client';
2
- import { useQueryClient as w, useMutation as y } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as d } from "./index58.mjs";
4
- import { createAdminRpcClients as i, authHeaders as c } from "./index21.mjs";
5
- import { queryKeys as u } from "./index26.mjs";
6
- import { useApiConfig as l } from "./index19.mjs";
7
- function F(e) {
8
- const { baseURL: s, authToken: n } = l();
9
- return d({
10
- queryKey: u.admin.warehouses.list(),
2
+ import { useQueryClient as d, useMutation as v } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as l } from "./index54.mjs";
4
+ import { createAdminRpcClients as u, authHeaders as c } from "./index21.mjs";
5
+ import { queryKeys as s } from "./index26.mjs";
6
+ import { useApiConfig as y } from "./index19.mjs";
7
+ function m(n, r) {
8
+ const { baseURL: o, authToken: t } = y();
9
+ return l({
10
+ queryKey: s.admin.inventory.list(n),
11
11
  queryFn: async () => {
12
- const t = await i(s).warehouses.index.$get({}, c(n));
13
- if (!t.ok) throw new Error(`Failed to fetch warehouses: ${t.statusText}`);
14
- return t.json();
12
+ const e = await u(o).inventory.index.$get({ query: n }, c(t));
13
+ if (!e.ok)
14
+ throw new Error(`Failed to fetch inventory: ${e.statusText}`);
15
+ return e.json();
15
16
  },
16
- ...e
17
+ ...r
17
18
  });
18
19
  }
19
- function T(e) {
20
- const { baseURL: s, authToken: n } = l(), r = w();
21
- return y({
22
- mutationFn: async (t) => {
23
- const o = await i(s).warehouses.index.$post({ json: t }, c(n));
24
- if (!o.ok) throw new Error(`Failed to create warehouse: ${o.statusText}`);
25
- return o.json();
20
+ function T(n) {
21
+ const { baseURL: r, authToken: o } = y(), t = d();
22
+ return v({
23
+ mutationFn: async (a) => {
24
+ const i = await u(r).inventory.adjust.$post({ json: a }, c(o));
25
+ if (!i.ok)
26
+ throw new Error(`Failed to adjust inventory: ${i.statusText}`);
27
+ return i.json();
26
28
  },
27
29
  onSuccess: () => {
28
- r.invalidateQueries({ queryKey: u.admin.warehouses.all });
30
+ t.invalidateQueries({ queryKey: s.admin.inventory.all }), t.invalidateQueries({ queryKey: s.admin.variants.all }), t.invalidateQueries({ queryKey: s.admin.warehouses.all });
29
31
  },
30
- ...e
32
+ ...n
31
33
  });
32
34
  }
33
- function $(e, s) {
34
- const { baseURL: n, authToken: r } = l(), t = w();
35
- return y({
35
+ function j(n) {
36
+ const { baseURL: r, authToken: o } = y(), t = d();
37
+ return v({
36
38
  mutationFn: async (a) => {
37
- const h = await i(n).warehouses[":id"].$patch(
38
- { json: a, param: { id: e } },
39
- c(r)
40
- );
41
- if (!h.ok) throw new Error(`Failed to update warehouse: ${h.statusText}`);
42
- return h.json();
39
+ const i = await u(r).inventory.transfer.$post({ json: a }, c(o));
40
+ if (!i.ok)
41
+ throw new Error(`Failed to transfer inventory: ${i.statusText}`);
42
+ return i.json();
43
43
  },
44
44
  onSuccess: () => {
45
- t.invalidateQueries({ queryKey: u.admin.warehouses.detail(e) }), t.invalidateQueries({ queryKey: u.admin.warehouses.all });
45
+ t.invalidateQueries({ queryKey: s.admin.inventory.all }), t.invalidateQueries({ queryKey: s.admin.warehouses.all });
46
46
  },
47
- ...s
47
+ ...n
48
48
  });
49
49
  }
50
- function v(e, s) {
51
- const { baseURL: n, authToken: r } = l();
52
- return d({
53
- queryKey: u.admin.warehouses.inventory(e),
50
+ function F(n, r) {
51
+ const { baseURL: o, authToken: t } = y();
52
+ return l({
53
+ queryKey: s.admin.inventory.transactions(n),
54
54
  queryFn: async () => {
55
- const a = await i(n).warehouses[":id"].inventory.$get(
56
- { param: { id: e } },
57
- c(r)
58
- );
59
- if (!a.ok) throw new Error(`Failed to fetch warehouse inventory: ${a.statusText}`);
60
- return a.json();
55
+ const e = await u(o).inventory.transactions.$get({ query: n }, c(t));
56
+ if (!e.ok)
57
+ throw new Error(`Failed to fetch inventory transactions: ${e.statusText}`);
58
+ return e.json();
61
59
  },
62
- ...s
60
+ ...r
63
61
  });
64
62
  }
65
- function x(e, s) {
66
- const { baseURL: n, authToken: r } = l(), t = w();
67
- return y({
68
- mutationFn: async () => {
69
- const o = await i(n).warehouses[":id"].$delete(
70
- { param: { id: e } },
71
- c(r)
72
- );
73
- if (!o.ok) throw new Error(`Failed to delete warehouse: ${o.statusText}`);
74
- return o.json();
75
- },
76
- onSuccess: () => {
77
- t.invalidateQueries({ queryKey: u.admin.warehouses.all });
63
+ function $(n, r) {
64
+ const { baseURL: o, authToken: t } = y();
65
+ return l({
66
+ queryKey: s.admin.inventory.lowStock(n == null ? void 0 : n.brandId),
67
+ queryFn: async () => {
68
+ const e = await u(o).inventory["low-stock"].$get({ query: n }, c(t));
69
+ if (!e.ok)
70
+ throw new Error(`Failed to fetch low stock alerts: ${e.statusText}`);
71
+ return e.json();
78
72
  },
79
- ...s
73
+ ...r
80
74
  });
81
75
  }
82
76
  export {
83
- T as useCreateWarehouse,
84
- x as useDeleteWarehouse,
85
- v as useGetWarehouseInventory,
86
- F as useListWarehouses,
87
- $ as useUpdateWarehouse
77
+ T as useAdjustInventory,
78
+ F as useGetInventoryTransactions,
79
+ $ as useGetLowStockVariants,
80
+ m as useListInventory,
81
+ j as useTransferInventory
88
82
  };
package/dist/index49.mjs CHANGED
@@ -1,77 +1,22 @@
1
1
  'use client';
2
- import { useQueryClient as d, useMutation as v } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as l } from "./index58.mjs";
4
- import { createAdminRpcClients as u, authHeaders as c } from "./index21.mjs";
5
- import { queryKeys as s } from "./index26.mjs";
6
- import { useApiConfig as y } from "./index19.mjs";
7
- function m(n, r) {
8
- const { baseURL: o, authToken: t } = y();
9
- return l({
10
- queryKey: s.admin.inventory.list(n),
2
+ import { useQueryUnwrapped as i } from "./index54.mjs";
3
+ import { createAdminRpcClients as n, authHeaders as u } from "./index21.mjs";
4
+ import { queryKeys as m } from "./index26.mjs";
5
+ import { useApiConfig as a } from "./index19.mjs";
6
+ function h(e, t) {
7
+ const { baseURL: s, authToken: o } = a();
8
+ return i({
9
+ queryKey: m.admin.customers.history(e),
11
10
  queryFn: async () => {
12
- const e = await u(o).inventory.index.$get({ query: n }, c(t));
13
- if (!e.ok) throw new Error(`Failed to fetch inventory: ${e.statusText}`);
14
- return e.json();
11
+ const r = await n(s).customers.history.$get({ query: { phone: e } }, u(o));
12
+ if (!r.ok)
13
+ throw new Error(`Failed to fetch customer history: ${r.statusText}`);
14
+ return r.json();
15
15
  },
16
- ...r
17
- });
18
- }
19
- function T(n) {
20
- const { baseURL: r, authToken: o } = y(), t = d();
21
- return v({
22
- mutationFn: async (a) => {
23
- const i = await u(r).inventory.adjust.$post({ json: a }, c(o));
24
- if (!i.ok) throw new Error(`Failed to adjust inventory: ${i.statusText}`);
25
- return i.json();
26
- },
27
- onSuccess: () => {
28
- t.invalidateQueries({ queryKey: s.admin.inventory.all }), t.invalidateQueries({ queryKey: s.admin.variants.all }), t.invalidateQueries({ queryKey: s.admin.warehouses.all });
29
- },
30
- ...n
31
- });
32
- }
33
- function j(n) {
34
- const { baseURL: r, authToken: o } = y(), t = d();
35
- return v({
36
- mutationFn: async (a) => {
37
- const i = await u(r).inventory.transfer.$post({ json: a }, c(o));
38
- if (!i.ok) throw new Error(`Failed to transfer inventory: ${i.statusText}`);
39
- return i.json();
40
- },
41
- onSuccess: () => {
42
- t.invalidateQueries({ queryKey: s.admin.inventory.all }), t.invalidateQueries({ queryKey: s.admin.warehouses.all });
43
- },
44
- ...n
45
- });
46
- }
47
- function F(n, r) {
48
- const { baseURL: o, authToken: t } = y();
49
- return l({
50
- queryKey: s.admin.inventory.transactions(n),
51
- queryFn: async () => {
52
- const e = await u(o).inventory.transactions.$get({ query: n }, c(t));
53
- if (!e.ok) throw new Error(`Failed to fetch inventory transactions: ${e.statusText}`);
54
- return e.json();
55
- },
56
- ...r
57
- });
58
- }
59
- function $(n, r) {
60
- const { baseURL: o, authToken: t } = y();
61
- return l({
62
- queryKey: s.admin.inventory.lowStock(n == null ? void 0 : n.brandId),
63
- queryFn: async () => {
64
- const e = await u(o).inventory["low-stock"].$get({ query: n }, c(t));
65
- if (!e.ok) throw new Error(`Failed to fetch low stock alerts: ${e.statusText}`);
66
- return e.json();
67
- },
68
- ...r
16
+ enabled: !!e,
17
+ ...t
69
18
  });
70
19
  }
71
20
  export {
72
- T as useAdjustInventory,
73
- F as useGetInventoryTransactions,
74
- $ as useGetLowStockVariants,
75
- m as useListInventory,
76
- j as useTransferInventory
21
+ h as useGetCustomerHistory
77
22
  };
package/dist/index50.mjs CHANGED
@@ -1,21 +1,21 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as i } from "./index58.mjs";
3
- import { createAdminRpcClients as n, authHeaders as u } from "./index21.mjs";
4
- import { queryKeys as m } from "./index26.mjs";
5
- import { useApiConfig as a } from "./index19.mjs";
6
- function h(e, t) {
7
- const { baseURL: s, authToken: o } = a();
8
- return i({
9
- queryKey: m.admin.customers.history(e),
2
+ import { useQueryUnwrapped as s } from "./index54.mjs";
3
+ import { createAdminRpcClients as i, authHeaders as u } from "./index21.mjs";
4
+ import { queryKeys as c } from "./index26.mjs";
5
+ import { useApiConfig as d } from "./index19.mjs";
6
+ function h(t, r) {
7
+ const { baseURL: n, authToken: o } = d();
8
+ return s({
9
+ queryKey: c.admin.stats.overview(t == null ? void 0 : t.brandId),
10
10
  queryFn: async () => {
11
- const r = await n(s).customers.history.$get({ query: { phone: e } }, u(o));
12
- if (!r.ok) throw new Error(`Failed to fetch customer history: ${r.statusText}`);
13
- return r.json();
11
+ const e = await i(n).stats.index.$get({ query: t }, u(o));
12
+ if (!e.ok)
13
+ throw new Error(`Failed to fetch statistics: ${e.statusText}`);
14
+ return e.json();
14
15
  },
15
- enabled: !!e,
16
- ...t
16
+ ...r
17
17
  });
18
18
  }
19
19
  export {
20
- h as useGetCustomerHistory
20
+ h as useGetStats
21
21
  };
package/dist/index51.mjs CHANGED
@@ -1,20 +1,66 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as s } from "./index58.mjs";
3
- import { createAdminRpcClients as i, authHeaders as u } from "./index21.mjs";
4
- import { queryKeys as c } from "./index26.mjs";
5
- import { useApiConfig as d } from "./index19.mjs";
6
- function h(t, r) {
7
- const { baseURL: n, authToken: o } = d();
8
- return s({
9
- queryKey: c.admin.stats.overview(t == null ? void 0 : t.brandId),
2
+ import { useQueryClient as l, useMutation as y } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as c } from "./index54.mjs";
4
+ import { createAdminRpcClients as s, authHeaders as o } from "./index21.mjs";
5
+ import { queryKeys as i } from "./index26.mjs";
6
+ import { useApiConfig as u } from "./index19.mjs";
7
+ function m(e, n) {
8
+ const { baseURL: a, authToken: r } = u();
9
+ return c({
10
+ queryKey: i.admin.abandonedCarts.list(e),
10
11
  queryFn: async () => {
11
- const e = await i(n).stats.index.$get({ query: t }, u(o));
12
- if (!e.ok) throw new Error(`Failed to fetch statistics: ${e.statusText}`);
13
- return e.json();
12
+ const t = await s(a).abandonedCarts.index.$get({ query: e }, o(r));
13
+ if (!t.ok)
14
+ throw new Error(`Failed to fetch abandoned carts: ${t.statusText}`);
15
+ return t.json();
14
16
  },
15
- ...r
17
+ ...n
18
+ });
19
+ }
20
+ function p(e, n) {
21
+ const { baseURL: a, authToken: r } = u();
22
+ return c({
23
+ queryKey: i.admin.abandonedCarts.stats(e == null ? void 0 : e.brandId),
24
+ queryFn: async () => {
25
+ const t = await s(a).abandonedCarts.stats.$get({ query: e }, o(r));
26
+ if (!t.ok)
27
+ throw new Error(`Failed to fetch abandoned cart stats: ${t.statusText}`);
28
+ return t.json();
29
+ },
30
+ ...n
31
+ });
32
+ }
33
+ function q(e, n) {
34
+ const { baseURL: a, authToken: r } = u();
35
+ return c({
36
+ queryKey: i.admin.abandonedCarts.detail(e),
37
+ queryFn: async () => {
38
+ const t = await s(a).abandonedCarts[":id"].$get({ param: { id: e } }, o(r));
39
+ if (!t.ok)
40
+ throw new Error(`Failed to fetch abandoned cart: ${t.statusText}`);
41
+ return t.json();
42
+ },
43
+ ...n
44
+ });
45
+ }
46
+ function k(e) {
47
+ const { baseURL: n, authToken: a } = u(), r = l();
48
+ return y({
49
+ mutationFn: async () => {
50
+ const t = await s(n).abandonedCarts.cleanup.$post({}, o(a));
51
+ if (!t.ok)
52
+ throw new Error(`Failed to cleanup expired carts: ${t.statusText}`);
53
+ return t.json();
54
+ },
55
+ onSuccess: () => {
56
+ r.invalidateQueries({ queryKey: i.admin.abandonedCarts.all });
57
+ },
58
+ ...e
16
59
  });
17
60
  }
18
61
  export {
19
- h as useGetStats
62
+ k as useCleanupExpiredCarts,
63
+ q as useGetAbandonedCart,
64
+ p as useGetAbandonedCartStats,
65
+ m as useListAbandonedCarts
20
66
  };