@instockng/storefront-ui 1.0.90 → 1.0.91

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 (282) hide show
  1. package/dist/components/DeliveryConfirmation.d.ts +18 -0
  2. package/dist/components/DeliveryConfirmation.d.ts.map +1 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.mjs +127 -121
  6. package/dist/index10.mjs +74 -190
  7. package/dist/index100.mjs +3 -5
  8. package/dist/index101.mjs +2 -5
  9. package/dist/index102.mjs +73 -169
  10. package/dist/index103.mjs +51 -50
  11. package/dist/index104.mjs +6 -69
  12. package/dist/index105.mjs +5 -34
  13. package/dist/index106.mjs +177 -41
  14. package/dist/index107.mjs +53 -2
  15. package/dist/index108.mjs +69 -28
  16. package/dist/index109.mjs +2 -18
  17. package/dist/index11.mjs +172 -107
  18. package/dist/index110.mjs +26 -213
  19. package/dist/index111.mjs +13 -175
  20. package/dist/index112.mjs +210 -17
  21. package/dist/index113.mjs +174 -17
  22. package/dist/index114.mjs +14 -25
  23. package/dist/index115.mjs +17 -150
  24. package/dist/index116.mjs +26 -13
  25. package/dist/index117.mjs +149 -24
  26. package/dist/index118.mjs +13 -77
  27. package/dist/index119.mjs +20 -27
  28. package/dist/index12.mjs +127 -90
  29. package/dist/index120.mjs +76 -137
  30. package/dist/index121.mjs +33 -50
  31. package/dist/index122.mjs +141 -19
  32. package/dist/index123.mjs +50 -22
  33. package/dist/index124.mjs +14 -14
  34. package/dist/index125.mjs +20 -18
  35. package/dist/index126.mjs +16 -14
  36. package/dist/index127.mjs +17 -14
  37. package/dist/index128.mjs +12 -12
  38. package/dist/index129.mjs +15 -58
  39. package/dist/index13.mjs +86 -90
  40. package/dist/index130.mjs +14 -11
  41. package/dist/index131.mjs +56 -30
  42. package/dist/index132.mjs +9 -15
  43. package/dist/index133.mjs +31 -26
  44. package/dist/index134.mjs +13 -16
  45. package/dist/index135.mjs +26 -11
  46. package/dist/index136.mjs +17 -11
  47. package/dist/index137.mjs +12 -40
  48. package/dist/index138.mjs +14 -16
  49. package/dist/index139.mjs +42 -263
  50. package/dist/index14.mjs +84 -149
  51. package/dist/index140.mjs +15 -62
  52. package/dist/index141.mjs +267 -7
  53. package/dist/index142.mjs +70 -2
  54. package/dist/index143.mjs +8 -2
  55. package/dist/index144.mjs +2 -33
  56. package/dist/index145.mjs +2 -2
  57. package/dist/index146.mjs +33 -2
  58. package/dist/index147.mjs +2 -2
  59. package/dist/index148.mjs +2 -2
  60. package/dist/index149.mjs +2 -2
  61. package/dist/index15.mjs +157 -216
  62. package/dist/index150.mjs +2 -18
  63. package/dist/index151.mjs +2 -32
  64. package/dist/index152.mjs +14 -34
  65. package/dist/index153.mjs +25 -11
  66. package/dist/index154.mjs +34 -14
  67. package/dist/index155.mjs +18 -2
  68. package/dist/index156.mjs +11 -13
  69. package/dist/index157.mjs +2 -46
  70. package/dist/index158.mjs +20 -2
  71. package/dist/index159.mjs +41 -25
  72. package/dist/index16.mjs +211 -107
  73. package/dist/index160.mjs +2 -18
  74. package/dist/index161.mjs +30 -2
  75. package/dist/index162.mjs +18 -2
  76. package/dist/index163.mjs +2 -2
  77. package/dist/index164.mjs +2 -2
  78. package/dist/index165.mjs +2 -72
  79. package/dist/index166.mjs +2 -2
  80. package/dist/index167.mjs +59 -40
  81. package/dist/index169.mjs +48 -31
  82. package/dist/index17.mjs +106 -86
  83. package/dist/index170.mjs +2 -152
  84. package/dist/index171.mjs +36 -2
  85. package/dist/index172.mjs +152 -2
  86. package/dist/index173.mjs +2 -19
  87. package/dist/index174.mjs +2 -2
  88. package/dist/index175.mjs +19 -2
  89. package/dist/index176.mjs +2 -26
  90. package/dist/index177.mjs +2 -2
  91. package/dist/index178.mjs +26 -2
  92. package/dist/index179.mjs +2 -24
  93. package/dist/index18.mjs +82 -733
  94. package/dist/index180.mjs +2 -23
  95. package/dist/index181.mjs +24 -2
  96. package/dist/index182.mjs +23 -2
  97. package/dist/index183.mjs +2 -2
  98. package/dist/index184.mjs +2 -23
  99. package/dist/index186.mjs +16 -16
  100. package/dist/index187.mjs +2 -2
  101. package/dist/index188.mjs +23 -2
  102. package/dist/index189.mjs +2 -2
  103. package/dist/index19.mjs +742 -53
  104. package/dist/index190.mjs +2 -23
  105. package/dist/index191.mjs +2 -2
  106. package/dist/index192.mjs +15 -15
  107. package/dist/index194.mjs +23 -2
  108. package/dist/index195.mjs +2 -2
  109. package/dist/index196.mjs +2 -2
  110. package/dist/index197.mjs +2 -2
  111. package/dist/index199.mjs +2 -2
  112. package/dist/index2.mjs +2 -2
  113. package/dist/index20.mjs +58 -60
  114. package/dist/index201.mjs +2 -127
  115. package/dist/index202.mjs +2 -2
  116. package/dist/index203.mjs +123 -70
  117. package/dist/index204.mjs +2 -74
  118. package/dist/index205.mjs +72 -19
  119. package/dist/index206.mjs +73 -55
  120. package/dist/index207.mjs +18 -26
  121. package/dist/index208.mjs +55 -6
  122. package/dist/index209.mjs +28 -51
  123. package/dist/index21.mjs +60 -22
  124. package/dist/index210.mjs +7 -6
  125. package/dist/index211.mjs +51 -11
  126. package/dist/index212.mjs +5 -6
  127. package/dist/index213.mjs +12 -28
  128. package/dist/index214.mjs +7 -2
  129. package/dist/index215.mjs +27 -69
  130. package/dist/index216.mjs +2 -167
  131. package/dist/index217.mjs +70 -2
  132. package/dist/index218.mjs +161 -102
  133. package/dist/index219.mjs +2 -2
  134. package/dist/index22.mjs +22 -107
  135. package/dist/index220.mjs +108 -2
  136. package/dist/index221.mjs +2 -2
  137. package/dist/index222.mjs +2 -2
  138. package/dist/index223.mjs +2 -2
  139. package/dist/index224.mjs +2 -2
  140. package/dist/index225.mjs +2 -37
  141. package/dist/index226.mjs +2 -2
  142. package/dist/index227.mjs +2 -2
  143. package/dist/index228.mjs +2 -2
  144. package/dist/index229.mjs +2 -2
  145. package/dist/index23.mjs +105 -38
  146. package/dist/index231.mjs +37 -2
  147. package/dist/index232.mjs +2 -2
  148. package/dist/index233.mjs +2 -2
  149. package/dist/index234.mjs +2 -2
  150. package/dist/index236.mjs +2 -2
  151. package/dist/index237.mjs +244 -2
  152. package/dist/index238.mjs +2 -2
  153. package/dist/index239.mjs +33 -2
  154. package/dist/index24.mjs +37 -37
  155. package/dist/index240.mjs +65 -2
  156. package/dist/index241.mjs +25 -4
  157. package/dist/index243.mjs +2 -244
  158. package/dist/index244.mjs +2 -2
  159. package/dist/index245.mjs +2 -33
  160. package/dist/index246.mjs +2 -65
  161. package/dist/index247.mjs +4 -25
  162. package/dist/index248.mjs +2 -13
  163. package/dist/index249.mjs +2 -7
  164. package/dist/index25.mjs +42 -89
  165. package/dist/index250.mjs +12 -30
  166. package/dist/index251.mjs +7 -11
  167. package/dist/index252.mjs +30 -3
  168. package/dist/index253.mjs +10 -3
  169. package/dist/index254.mjs +3 -11
  170. package/dist/index255.mjs +3 -4
  171. package/dist/index256.mjs +12 -33
  172. package/dist/index257.mjs +5 -31
  173. package/dist/index258.mjs +32 -27
  174. package/dist/index259.mjs +28 -58
  175. package/dist/index26.mjs +86 -29
  176. package/dist/index260.mjs +28 -2
  177. package/dist/index261.mjs +61 -2
  178. package/dist/index262.mjs +2 -18
  179. package/dist/index263.mjs +2 -47
  180. package/dist/index264.mjs +18 -2
  181. package/dist/index265.mjs +47 -2
  182. package/dist/index266.mjs +2 -2
  183. package/dist/index267.mjs +2 -2
  184. package/dist/index268.mjs +2 -2
  185. package/dist/index269.mjs +2 -91
  186. package/dist/index27.mjs +29 -6
  187. package/dist/index270.mjs +91 -3
  188. package/dist/index271.mjs +2 -2
  189. package/dist/index272.mjs +3 -2
  190. package/dist/index273.mjs +2 -17
  191. package/dist/index274.mjs +2 -13
  192. package/dist/index275.mjs +17 -6
  193. package/dist/index276.mjs +13 -30
  194. package/dist/index277.mjs +6 -2
  195. package/dist/index278.mjs +30 -2
  196. package/dist/index279.mjs +2 -2
  197. package/dist/index28.mjs +8 -21
  198. package/dist/index280.mjs +5 -0
  199. package/dist/index281.mjs +5 -0
  200. package/dist/index29.mjs +19 -34
  201. package/dist/index3.mjs +5 -5
  202. package/dist/index30.mjs +35 -37
  203. package/dist/index31.mjs +28 -103
  204. package/dist/index32.mjs +104 -20
  205. package/dist/index33.mjs +47 -9
  206. package/dist/index34.mjs +9 -9
  207. package/dist/index35.mjs +11 -116
  208. package/dist/index36.mjs +121 -25
  209. package/dist/index37.mjs +27 -81
  210. package/dist/index38.mjs +90 -112
  211. package/dist/index39.mjs +109 -8
  212. package/dist/index4.mjs +1 -1
  213. package/dist/index40.mjs +9 -33
  214. package/dist/index41.mjs +27 -20
  215. package/dist/index42.mjs +42 -7
  216. package/dist/index43.mjs +10 -122
  217. package/dist/index44.mjs +114 -380
  218. package/dist/index45.mjs +384 -20
  219. package/dist/index46.mjs +24 -31
  220. package/dist/index47.mjs +32 -7
  221. package/dist/index48.mjs +6 -1432
  222. package/dist/index49.mjs +1432 -69
  223. package/dist/index5.mjs +1 -1
  224. package/dist/index50.mjs +70 -2
  225. package/dist/index51.mjs +2 -60
  226. package/dist/index52.mjs +57 -48
  227. package/dist/index53.mjs +51 -33
  228. package/dist/index54.mjs +33 -15
  229. package/dist/index55.mjs +12 -2260
  230. package/dist/index56.mjs +2263 -36
  231. package/dist/index57.mjs +36 -44
  232. package/dist/index58.mjs +44 -99
  233. package/dist/index59.mjs +99 -81
  234. package/dist/index6.mjs +1 -1
  235. package/dist/index60.mjs +75 -13
  236. package/dist/index61.mjs +15 -125
  237. package/dist/index62.mjs +93 -89
  238. package/dist/index63.mjs +102 -56
  239. package/dist/index64.mjs +55 -89
  240. package/dist/index65.mjs +124 -70
  241. package/dist/index66.mjs +100 -13
  242. package/dist/index67.mjs +30 -89
  243. package/dist/index68.mjs +70 -56
  244. package/dist/index69.mjs +62 -44
  245. package/dist/index7.mjs +73 -73
  246. package/dist/index70.mjs +47 -46
  247. package/dist/index71.mjs +48 -121
  248. package/dist/index72.mjs +133 -22
  249. package/dist/index73.mjs +70 -2
  250. package/dist/index74.mjs +21 -20
  251. package/dist/index75.mjs +2 -153
  252. package/dist/index76.mjs +149 -71
  253. package/dist/index77.mjs +74 -14
  254. package/dist/index78.mjs +14 -62
  255. package/dist/index79.mjs +62 -4
  256. package/dist/index8.mjs +240 -99
  257. package/dist/index80.mjs +23 -2
  258. package/dist/index81.mjs +4 -5
  259. package/dist/index82.mjs +2 -1134
  260. package/dist/index83.mjs +5 -19
  261. package/dist/index84.mjs +1119 -40
  262. package/dist/index85.mjs +14 -27
  263. package/dist/index86.mjs +55 -2
  264. package/dist/index87.mjs +33 -2
  265. package/dist/index88.mjs +2 -235
  266. package/dist/index89.mjs +2 -6
  267. package/dist/index9.mjs +103 -73
  268. package/dist/index90.mjs +30 -130
  269. package/dist/index91.mjs +39 -64
  270. package/dist/index92.mjs +228 -80
  271. package/dist/index93.mjs +5 -28
  272. package/dist/index94.mjs +132 -7
  273. package/dist/index95.mjs +62 -69
  274. package/dist/index96.mjs +86 -3
  275. package/dist/index97.mjs +29 -2
  276. package/dist/index98.mjs +7 -81
  277. package/dist/index99.mjs +72 -51
  278. package/dist/styles.css +1 -1
  279. package/package.json +2 -2
  280. package/src/components/DeliveryConfirmation.tsx +357 -0
  281. package/src/components/OrderConfirmation.tsx +24 -24
  282. package/src/index.ts +3 -0
package/dist/index68.mjs CHANGED
@@ -1,84 +1,98 @@
1
1
  'use client';
2
- import { useQueryClient as y, useMutation as d } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as m } from "./index79.mjs";
4
- import { createAdminRpcClients as c, authHeaders as l } from "./index29.mjs";
5
- import { queryKeys as u } from "./index35.mjs";
6
- import { useApiConfig as w } from "./index27.mjs";
7
- function T(e) {
8
- const { baseURL: s, getAuthToken: n } = w();
9
- return m({
10
- queryKey: u.admin.warehouses.list(),
2
+ import { useQueryClient as m, useMutation as w } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as p } from "./index81.mjs";
4
+ import { createAdminRpcClients as c, authHeaders as d } from "./index30.mjs";
5
+ import { queryKeys as o } from "./index36.mjs";
6
+ import { useApiConfig as l } from "./index28.mjs";
7
+ function T(e, a) {
8
+ const { baseURL: r, getAuthToken: s } = l();
9
+ return p({
10
+ queryKey: o.admin.variants.search(e),
11
11
  queryFn: async () => {
12
- const o = await n(), t = await c(s).warehouses.index.$get({}, l(o));
12
+ const n = await s(), t = await c(r).variants.index.$get({ query: e }, d(n));
13
13
  if (!t.ok)
14
- throw new Error(`Failed to fetch warehouses: ${t.statusText}`);
14
+ throw new Error(`Failed to search variants: ${t.statusText}`);
15
15
  return t.json();
16
16
  },
17
- ...e
17
+ ...a
18
18
  });
19
19
  }
20
- function $(e) {
21
- const { baseURL: s, getAuthToken: n } = w(), o = y();
22
- return d({
23
- mutationFn: async (r) => {
24
- const t = await n(), a = await c(s).warehouses.index.$post({ json: r }, l(t));
25
- if (!a.ok)
26
- throw new Error(`Failed to create warehouse: ${a.statusText}`);
27
- return a.json();
20
+ function $(e, a) {
21
+ const { baseURL: r, getAuthToken: s } = l();
22
+ return p({
23
+ queryKey: o.admin.variants.byProduct(e),
24
+ queryFn: async () => {
25
+ const n = await s(), t = await c(r).variants.products[":productId"].variants.$get({ param: { productId: e } }, d(n));
26
+ if (!t.ok)
27
+ throw new Error(`Failed to fetch product variants: ${t.statusText}`);
28
+ return t.json();
29
+ },
30
+ ...a
31
+ });
32
+ }
33
+ function g(e, a) {
34
+ const { baseURL: r, getAuthToken: s } = l(), n = m();
35
+ return w({
36
+ mutationFn: async (i) => {
37
+ const t = await s(), y = await c(r).variants.products[":productId"].variants.$post({ json: i, param: { productId: e } }, d(t));
38
+ if (!y.ok)
39
+ throw new Error(`Failed to create variant: ${y.statusText}`);
40
+ return y.json();
28
41
  },
29
42
  onSuccess: () => {
30
- o.invalidateQueries({ queryKey: u.admin.warehouses.all });
43
+ n.invalidateQueries({ queryKey: o.admin.variants.all }), n.invalidateQueries({ queryKey: o.admin.products.detail(e) });
31
44
  },
32
- ...e
45
+ ...a
33
46
  });
34
47
  }
35
- function g(e, s) {
36
- const { baseURL: n, getAuthToken: o } = w(), r = y();
37
- return d({
38
- mutationFn: async (t) => {
39
- const i = await o(), h = await c(n).warehouses[":id"].$patch({ json: t, param: { id: e } }, l(i));
40
- if (!h.ok)
41
- throw new Error(`Failed to update warehouse: ${h.statusText}`);
42
- return h.json();
48
+ function K(e, a) {
49
+ const { baseURL: r, getAuthToken: s } = l(), n = m();
50
+ return w({
51
+ mutationFn: async ({ variantId: i, ...t }) => {
52
+ const u = await s(), v = await c(r).variants.products[":productId"].variants[":variantId"].$patch({ json: t, param: { productId: e, variantId: i } }, d(u));
53
+ if (!v.ok)
54
+ throw new Error(`Failed to update variant: ${v.statusText}`);
55
+ return v.json();
43
56
  },
44
- onSuccess: () => {
45
- r.invalidateQueries({ queryKey: u.admin.warehouses.detail(e) }), r.invalidateQueries({ queryKey: u.admin.warehouses.all });
57
+ onSuccess: (i, t) => {
58
+ n.invalidateQueries({ queryKey: o.admin.variants.detail(t.variantId) }), n.invalidateQueries({ queryKey: o.admin.variants.all }), n.invalidateQueries({ queryKey: o.admin.products.detail(e) });
46
59
  },
47
- ...s
60
+ ...a
48
61
  });
49
62
  }
50
- function v(e, s) {
51
- const { baseURL: n, getAuthToken: o } = w();
52
- return m({
53
- queryKey: u.admin.warehouses.inventory(e),
63
+ function j(e, a) {
64
+ const { baseURL: r, getAuthToken: s } = l();
65
+ return p({
66
+ queryKey: o.admin.variants.inventory(e),
54
67
  queryFn: async () => {
55
- const r = await o(), i = await c(n).warehouses[":id"].inventory.$get({ param: { id: e } }, l(r));
56
- if (!i.ok)
57
- throw new Error(`Failed to fetch warehouse inventory: ${i.statusText}`);
58
- return i.json();
68
+ const n = await s(), t = await c(r).variants[":id"].inventory.$get({ param: { id: e } }, d(n));
69
+ if (!t.ok)
70
+ throw new Error(`Failed to fetch variant inventory: ${t.statusText}`);
71
+ return t.json();
59
72
  },
60
- ...s
73
+ ...a
61
74
  });
62
75
  }
63
- function x(e, s) {
64
- const { baseURL: n, getAuthToken: o } = w(), r = y();
65
- return d({
76
+ function x(e, a) {
77
+ const { baseURL: r, getAuthToken: s } = l(), n = m();
78
+ return w({
66
79
  mutationFn: async () => {
67
- const t = await o(), a = await c(n).warehouses[":id"].$delete({ param: { id: e } }, l(t));
68
- if (!a.ok)
69
- throw new Error(`Failed to delete warehouse: ${a.statusText}`);
70
- return a.json();
80
+ const i = await s(), u = await c(r).variants[":id"].$delete({ param: { id: e } }, d(i));
81
+ if (!u.ok)
82
+ throw new Error(`Failed to delete variant: ${u.statusText}`);
83
+ return u.json();
71
84
  },
72
85
  onSuccess: () => {
73
- r.invalidateQueries({ queryKey: u.admin.warehouses.all });
86
+ n.invalidateQueries({ queryKey: o.admin.variants.all });
74
87
  },
75
- ...s
88
+ ...a
76
89
  });
77
90
  }
78
91
  export {
79
- $ as useCreateWarehouse,
80
- x as useDeleteWarehouse,
81
- v as useGetWarehouseInventory,
82
- T as useListWarehouses,
83
- g as useUpdateWarehouse
92
+ g as useCreateVariant,
93
+ x as useDeleteVariant,
94
+ j as useGetVariantInventory,
95
+ $ as useListProductVariants,
96
+ T as useSearchVariants,
97
+ K as useUpdateVariant
84
98
  };
package/dist/index69.mjs CHANGED
@@ -1,66 +1,84 @@
1
1
  'use client';
2
- import { useQueryClient as y, useMutation as b } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as l } from "./index79.mjs";
4
- import { createAdminRpcClients as r, authHeaders as i } from "./index29.mjs";
5
- import { queryKeys as u } from "./index35.mjs";
6
- import { useApiConfig as d } from "./index27.mjs";
7
- function m(e, n) {
8
- const { baseURL: a, getAuthToken: o } = d();
9
- return l({
10
- queryKey: u.admin.abandonedCarts.list(e),
2
+ import { useQueryClient as y, useMutation as d } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as m } from "./index81.mjs";
4
+ import { createAdminRpcClients as c, authHeaders as l } from "./index30.mjs";
5
+ import { queryKeys as u } from "./index36.mjs";
6
+ import { useApiConfig as w } from "./index28.mjs";
7
+ function T(e) {
8
+ const { baseURL: s, getAuthToken: n } = w();
9
+ return m({
10
+ queryKey: u.admin.warehouses.list(),
11
11
  queryFn: async () => {
12
- const s = await o(), t = await r(a).abandonedCarts.index.$get({ query: e }, i(s));
12
+ const o = await n(), t = await c(s).warehouses.index.$get({}, l(o));
13
13
  if (!t.ok)
14
- throw new Error(`Failed to fetch abandoned carts: ${t.statusText}`);
14
+ throw new Error(`Failed to fetch warehouses: ${t.statusText}`);
15
15
  return t.json();
16
16
  },
17
- ...n
17
+ ...e
18
18
  });
19
19
  }
20
- function p(e, n) {
21
- const { baseURL: a, getAuthToken: o } = d();
22
- return l({
23
- queryKey: u.admin.abandonedCarts.stats(e == null ? void 0 : e.brandId),
24
- queryFn: async () => {
25
- const s = await o(), t = await r(a).abandonedCarts.stats.$get({ query: e }, i(s));
26
- if (!t.ok)
27
- throw new Error(`Failed to fetch abandoned cart stats: ${t.statusText}`);
28
- return t.json();
20
+ function $(e) {
21
+ const { baseURL: s, getAuthToken: n } = w(), o = y();
22
+ return d({
23
+ mutationFn: async (r) => {
24
+ const t = await n(), a = await c(s).warehouses.index.$post({ json: r }, l(t));
25
+ if (!a.ok)
26
+ throw new Error(`Failed to create warehouse: ${a.statusText}`);
27
+ return a.json();
29
28
  },
30
- ...n
29
+ onSuccess: () => {
30
+ o.invalidateQueries({ queryKey: u.admin.warehouses.all });
31
+ },
32
+ ...e
31
33
  });
32
34
  }
33
- function q(e, n) {
34
- const { baseURL: a, getAuthToken: o } = d();
35
- return l({
36
- queryKey: u.admin.abandonedCarts.detail(e),
35
+ function g(e, s) {
36
+ const { baseURL: n, getAuthToken: o } = w(), r = y();
37
+ return d({
38
+ mutationFn: async (t) => {
39
+ const i = await o(), h = await c(n).warehouses[":id"].$patch({ json: t, param: { id: e } }, l(i));
40
+ if (!h.ok)
41
+ throw new Error(`Failed to update warehouse: ${h.statusText}`);
42
+ return h.json();
43
+ },
44
+ onSuccess: () => {
45
+ r.invalidateQueries({ queryKey: u.admin.warehouses.detail(e) }), r.invalidateQueries({ queryKey: u.admin.warehouses.all });
46
+ },
47
+ ...s
48
+ });
49
+ }
50
+ function v(e, s) {
51
+ const { baseURL: n, getAuthToken: o } = w();
52
+ return m({
53
+ queryKey: u.admin.warehouses.inventory(e),
37
54
  queryFn: async () => {
38
- const s = await o(), t = await r(a).abandonedCarts[":id"].$get({ param: { id: e } }, i(s));
39
- if (!t.ok)
40
- throw new Error(`Failed to fetch abandoned cart: ${t.statusText}`);
41
- return t.json();
55
+ const r = await o(), i = await c(n).warehouses[":id"].inventory.$get({ param: { id: e } }, l(r));
56
+ if (!i.ok)
57
+ throw new Error(`Failed to fetch warehouse inventory: ${i.statusText}`);
58
+ return i.json();
42
59
  },
43
- ...n
60
+ ...s
44
61
  });
45
62
  }
46
- function A(e) {
47
- const { baseURL: n, getAuthToken: a } = d(), o = y();
48
- return b({
63
+ function x(e, s) {
64
+ const { baseURL: n, getAuthToken: o } = w(), r = y();
65
+ return d({
49
66
  mutationFn: async () => {
50
- const s = await a(), t = await r(n).abandonedCarts.cleanup.$post({}, i(s));
51
- if (!t.ok)
52
- throw new Error(`Failed to cleanup expired carts: ${t.statusText}`);
53
- return t.json();
67
+ const t = await o(), a = await c(n).warehouses[":id"].$delete({ param: { id: e } }, l(t));
68
+ if (!a.ok)
69
+ throw new Error(`Failed to delete warehouse: ${a.statusText}`);
70
+ return a.json();
54
71
  },
55
72
  onSuccess: () => {
56
- o.invalidateQueries({ queryKey: u.admin.abandonedCarts.all });
73
+ r.invalidateQueries({ queryKey: u.admin.warehouses.all });
57
74
  },
58
- ...e
75
+ ...s
59
76
  });
60
77
  }
61
78
  export {
62
- A as useCleanupExpiredCarts,
63
- q as useGetAbandonedCart,
64
- p as useGetAbandonedCartStats,
65
- m as useListAbandonedCarts
79
+ $ as useCreateWarehouse,
80
+ x as useDeleteWarehouse,
81
+ v as useGetWarehouseInventory,
82
+ T as useListWarehouses,
83
+ g as useUpdateWarehouse
66
84
  };
package/dist/index7.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  'use client';
2
2
  import { jsx as e, jsxs as r, Fragment as T } from "react/jsx-runtime";
3
3
  import { useState as E } from "react";
4
- import "./index26.mjs";
4
+ import "./index27.mjs";
5
5
  import "@tanstack/react-query";
6
- import { useGetOrder as U, useConfirmOrder as M } from "./index41.mjs";
7
- import { Card as s, CardHeader as m, CardTitle as o, CardContent as i } from "./index20.mjs";
8
- import { Button as S } from "./index19.mjs";
9
- import { Badge as y } from "./index21.mjs";
10
- import { Loader2 as v, XCircle as _, Package as H, CheckCircle as L } from "lucide-react";
11
- import { cn as l, formatDateTime as k, formatCurrency as c } from "./index25.mjs";
12
- const b = "2348125648668", x = "0" + b.slice(3), W = `${x.slice(0, 4)} ${x.slice(4, 7)} ${x.slice(7)}`, $ = `https://wa.me/${b}`;
6
+ import { useGetOrder as U, useConfirmOrder as M } from "./index42.mjs";
7
+ import { Card as s, CardHeader as m, CardTitle as o, CardContent as i } from "./index21.mjs";
8
+ import { Button as S } from "./index20.mjs";
9
+ import { Badge as v } from "./index22.mjs";
10
+ import { Loader2 as b, XCircle as _, Package as H, CheckCircle as L } from "lucide-react";
11
+ import { cn as c, formatDateTime as k, formatCurrency as l } from "./index26.mjs";
12
+ const g = "2348125648668", f = "0" + g.slice(3), W = `${f.slice(0, 4)} ${f.slice(4, 7)} ${f.slice(7)}`, $ = `https://wa.me/${g}`;
13
13
  function X({
14
14
  orderId: N,
15
- token: f,
15
+ token: x,
16
16
  className: h,
17
17
  headerClassName: w,
18
18
  buttonClassName: P,
@@ -20,64 +20,64 @@ function X({
20
20
  whatsappHelpLink: A = $,
21
21
  whatsappHelpNumber: C = W
22
22
  }) {
23
- var g;
24
- const [p, j] = E(!1), { data: u, isLoading: D, error: O } = U(N, f, {
23
+ var y;
24
+ const [p, j] = E(!1), { data: u, isLoading: D, error: O } = U(N, x, {
25
25
  retry: !1
26
26
  }), d = M({
27
- onSuccess: (t) => {
27
+ onSuccess: (a) => {
28
28
  j(!0);
29
29
  },
30
- onError: (t) => {
30
+ onError: (a) => {
31
31
  }
32
32
  });
33
33
  if (D)
34
- return /* @__PURE__ */ e("div", { className: l("min-h-screen bg-gray-50 flex items-center justify-center", h), children: /* @__PURE__ */ r("div", { className: "text-center", children: [
35
- /* @__PURE__ */ e(v, { className: "h-12 w-12 animate-spin text-blue-500 mx-auto mb-4" }),
36
- /* @__PURE__ */ e("p", { className: "text-gray-600", children: "Loading order details..." })
34
+ return /* @__PURE__ */ e("div", { className: c("min-h-screen flex items-center justify-center", h), children: /* @__PURE__ */ r("div", { className: "text-center", children: [
35
+ /* @__PURE__ */ e(b, { className: "h-12 w-12 animate-spin text-blue-500 mx-auto mb-4" }),
36
+ /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "Loading order details..." })
37
37
  ] }) });
38
38
  if (O || !u || "error" in u)
39
- return /* @__PURE__ */ e("div", { className: l("min-h-screen bg-gray-50 flex items-center justify-center p-4", h), children: /* @__PURE__ */ r(s, { className: l("max-w-md w-full", n), children: [
39
+ return /* @__PURE__ */ e("div", { className: c("min-h-screen flex items-center justify-center p-4", h), children: /* @__PURE__ */ r(s, { className: c("max-w-md w-full", n), children: [
40
40
  /* @__PURE__ */ e(m, { children: /* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
41
41
  /* @__PURE__ */ e(_, { className: "h-6 w-6 text-red-500" }),
42
42
  /* @__PURE__ */ e(o, { children: "Order Not Found" })
43
43
  ] }) }),
44
- /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e("p", { className: "text-gray-600", children: "We couldn't find this order. The link may be invalid or expired. Please contact support if you need assistance." }) })
44
+ /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: "We couldn't find this order. The link may be invalid or expired. Please contact support if you need assistance." }) })
45
45
  ] }) });
46
- const a = u;
47
- return /* @__PURE__ */ e("div", { className: l("min-h-screen bg-gray-50 py-8 px-4", h), children: /* @__PURE__ */ r("div", { className: "max-w-3xl mx-auto space-y-6", children: [
48
- /* @__PURE__ */ r("div", { className: l("text-center", w), children: [
49
- a.brand.logoUrl ? /* @__PURE__ */ e("div", { className: "inline-flex items-center justify-center w-24 h-16 mb-4", children: /* @__PURE__ */ e(
46
+ const t = u;
47
+ return /* @__PURE__ */ e("div", { className: c("min-h-screen py-8 px-4", h), children: /* @__PURE__ */ r("div", { className: "max-w-3xl mx-auto space-y-6", children: [
48
+ /* @__PURE__ */ r("div", { className: c("text-center", w), children: [
49
+ t.brand.logoUrl ? /* @__PURE__ */ e("div", { className: "inline-flex items-center justify-center w-24 h-16 mb-4", children: /* @__PURE__ */ e(
50
50
  "img",
51
51
  {
52
- src: a.brand.logoUrl,
53
- alt: `${a.brand.name} logo`,
52
+ src: t.brand.logoUrl,
53
+ alt: `${t.brand.name} logo`,
54
54
  className: "max-w-full max-h-full object-contain"
55
55
  }
56
56
  ) }) : /* @__PURE__ */ e("div", { className: "inline-flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full mb-4", children: /* @__PURE__ */ e(H, { className: "h-8 w-8 text-blue-600" }) }),
57
- /* @__PURE__ */ r("h1", { className: "text-3xl font-bold text-gray-900", children: [
57
+ /* @__PURE__ */ r("h1", { className: "text-3xl font-bold", children: [
58
58
  "Order #",
59
- a.orderNumber
59
+ t.orderNumber
60
60
  ] }),
61
- /* @__PURE__ */ e("p", { className: "text-gray-600 mt-2", children: a.brand.name })
61
+ /* @__PURE__ */ e("p", { className: "text-muted-foreground mt-2", children: t.brand.name })
62
62
  ] }),
63
- p && /* @__PURE__ */ e(s, { className: l("border-green-200 bg-green-50", n), children: /* @__PURE__ */ e(i, { className: "pt-6", children: /* @__PURE__ */ r("div", { className: "flex items-start space-x-3", children: [
63
+ p && /* @__PURE__ */ e(s, { className: c("border-green-200 bg-green-50", n), children: /* @__PURE__ */ e(i, { className: "pt-6", children: /* @__PURE__ */ r("div", { className: "flex items-start space-x-3", children: [
64
64
  /* @__PURE__ */ e(L, { className: "h-6 w-6 text-green-600 mt-0.5" }),
65
65
  /* @__PURE__ */ r("div", { children: [
66
66
  /* @__PURE__ */ e("h3", { className: "font-semibold text-green-900", children: "Order Confirmed!" }),
67
67
  /* @__PURE__ */ e("p", { className: "text-green-700 mt-1", children: "Thank you for confirming your order. We will contact you soon to arrange delivery." })
68
68
  ] })
69
69
  ] }) }) }),
70
- !p && a.confirmationMessage && /* @__PURE__ */ e(s, { className: l(a.canConfirm ? "border-orange-200 bg-orange-50" : "", n), children: /* @__PURE__ */ e(i, { className: "pt-6", children: /* @__PURE__ */ e("p", { className: a.canConfirm ? "text-orange-900" : "text-gray-700", children: a.confirmationMessage }) }) }),
71
- a.canConfirm && !p && /* @__PURE__ */ e(s, { className: n, children: /* @__PURE__ */ r(i, { className: "pt-6", children: [
70
+ !p && t.confirmationMessage && /* @__PURE__ */ e(s, { className: c(n), children: /* @__PURE__ */ e(i, { className: "pt-6", children: /* @__PURE__ */ e("p", { children: t.confirmationMessage }) }) }),
71
+ t.canConfirm && !p && /* @__PURE__ */ e(s, { className: n, children: /* @__PURE__ */ r(i, { className: "pt-6", children: [
72
72
  /* @__PURE__ */ e(
73
73
  S,
74
74
  {
75
- onClick: () => d.mutate({ orderId: N, token: f }),
75
+ onClick: () => d.mutate({ orderId: N, token: x }),
76
76
  disabled: d.isPending,
77
- className: l("w-full", P),
77
+ className: c("w-full", P),
78
78
  size: "lg",
79
79
  children: d.isPending ? /* @__PURE__ */ r(T, { children: [
80
- /* @__PURE__ */ e(v, { className: "mr-2 h-5 w-5 animate-spin" }),
80
+ /* @__PURE__ */ e(b, { className: "mr-2 h-5 w-5 animate-spin" }),
81
81
  "Confirming..."
82
82
  ] }) : "Confirm Order"
83
83
  }
@@ -88,20 +88,20 @@ function X({
88
88
  /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(o, { children: "Order Details" }) }),
89
89
  /* @__PURE__ */ e(i, { className: "space-y-4", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: [
90
90
  /* @__PURE__ */ r("div", { children: [
91
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Status" }),
92
- /* @__PURE__ */ e(y, { className: "mt-1", children: a.status })
91
+ /* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: "Status" }),
92
+ /* @__PURE__ */ e(v, { className: "mt-1", children: t.status })
93
93
  ] }),
94
94
  /* @__PURE__ */ r("div", { children: [
95
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Order Date" }),
96
- /* @__PURE__ */ e("p", { className: "font-medium", children: a.createdAt ? k(a.createdAt) : "N/A" })
95
+ /* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: "Order Date" }),
96
+ /* @__PURE__ */ e("p", { className: "font-medium", children: t.createdAt ? k(t.createdAt) : "N/A" })
97
97
  ] }),
98
98
  /* @__PURE__ */ r("div", { children: [
99
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Payment Method" }),
100
- /* @__PURE__ */ e("p", { className: "font-medium", children: a.paymentMethod === "cod" ? "Cash on Delivery" : "Online Payment" })
99
+ /* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: "Payment Method" }),
100
+ /* @__PURE__ */ e("p", { className: "font-medium", children: t.paymentMethod === "cod" ? "Cash on Delivery" : "Online Payment" })
101
101
  ] }),
102
102
  /* @__PURE__ */ r("div", { children: [
103
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Estimated Delivery" }),
104
- /* @__PURE__ */ e("p", { className: "font-medium", children: a.estimatedDays ? `${a.estimatedDays} days` : "TBD" })
103
+ /* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: "Estimated Delivery" }),
104
+ /* @__PURE__ */ e("p", { className: "font-medium", children: t.estimatedDays ? `${t.estimatedDays} days` : "TBD" })
105
105
  ] })
106
106
  ] }) })
107
107
  ] }),
@@ -109,84 +109,84 @@ function X({
109
109
  /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(o, { children: "Delivery Information" }) }),
110
110
  /* @__PURE__ */ r(i, { className: "space-y-3", children: [
111
111
  /* @__PURE__ */ r("div", { children: [
112
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Customer" }),
112
+ /* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: "Customer" }),
113
113
  /* @__PURE__ */ r("p", { className: "font-medium", children: [
114
- a.firstName,
114
+ t.firstName,
115
115
  " ",
116
- a.lastName
116
+ t.lastName
117
117
  ] }),
118
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: a.phone })
118
+ /* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: t.phone })
119
119
  ] }),
120
120
  /* @__PURE__ */ r("div", { children: [
121
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: "Address" }),
122
- /* @__PURE__ */ e("p", { className: "font-medium", children: a.address }),
123
- /* @__PURE__ */ r("p", { className: "text-sm text-gray-600", children: [
124
- a.city,
121
+ /* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: "Address" }),
122
+ /* @__PURE__ */ e("p", { className: "font-medium", children: t.address }),
123
+ /* @__PURE__ */ r("p", { className: "text-sm opacity-70", children: [
124
+ t.city,
125
125
  ", ",
126
- a.deliveryZone.state.name
126
+ t.deliveryZone.state.name
127
127
  ] }),
128
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-600", children: a.deliveryZone.name })
128
+ /* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: t.deliveryZone.name })
129
129
  ] })
130
130
  ] })
131
131
  ] }),
132
132
  /* @__PURE__ */ r(s, { className: n, children: [
133
133
  /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(o, { children: "Items" }) }),
134
134
  /* @__PURE__ */ r(i, { children: [
135
- /* @__PURE__ */ e("div", { className: "space-y-4", children: (g = a.items) == null ? void 0 : g.map((t) => /* @__PURE__ */ r("div", { className: "flex items-start justify-between border-b pb-4 last:border-0", children: [
135
+ /* @__PURE__ */ e("div", { className: "space-y-4", children: (y = t.items) == null ? void 0 : y.map((a) => /* @__PURE__ */ r("div", { className: "flex items-start justify-between border-b pb-4 last:border-0", children: [
136
136
  /* @__PURE__ */ r("div", { className: "flex items-start space-x-4 flex-1", children: [
137
- (t.variant.thumbnailUrl || t.variant.product.thumbnailUrl) && /* @__PURE__ */ e(
137
+ (a.variant.thumbnailUrl || a.variant.product.thumbnailUrl) && /* @__PURE__ */ e(
138
138
  "img",
139
139
  {
140
- src: t.variant.thumbnailUrl || t.variant.product.thumbnailUrl || void 0,
141
- alt: t.variant.product.name,
140
+ src: a.variant.thumbnailUrl || a.variant.product.thumbnailUrl || void 0,
141
+ alt: a.variant.product.name,
142
142
  className: "w-16 h-16 object-cover rounded"
143
143
  }
144
144
  ),
145
145
  /* @__PURE__ */ r("div", { className: "flex-1", children: [
146
- /* @__PURE__ */ e("p", { className: "font-medium", children: t.variant.product.name }),
147
- t.variant.name && /* @__PURE__ */ e(y, { variant: "outline", className: "mt-1", children: t.variant.name }),
148
- /* @__PURE__ */ r("p", { className: "text-sm text-gray-600 mt-1", children: [
146
+ /* @__PURE__ */ e("p", { className: "font-medium", children: a.variant.product.name }),
147
+ a.variant.name && /* @__PURE__ */ e(v, { variant: "outline", className: "mt-1", children: a.variant.name }),
148
+ /* @__PURE__ */ r("p", { className: "text-sm opacity-70 mt-1", children: [
149
149
  "Quantity: ",
150
- t.quantity
150
+ a.quantity
151
151
  ] }),
152
- /* @__PURE__ */ r("p", { className: "text-sm text-gray-600", children: [
152
+ /* @__PURE__ */ r("p", { className: "text-sm opacity-70", children: [
153
153
  "SKU: ",
154
- t.variant.sku
154
+ a.variant.sku
155
155
  ] })
156
156
  ] })
157
157
  ] }),
158
158
  /* @__PURE__ */ r("div", { className: "text-right", children: [
159
- /* @__PURE__ */ e("p", { className: "font-medium", children: c(t.priceAtPurchase * t.quantity) }),
160
- /* @__PURE__ */ r("p", { className: "text-sm text-gray-600", children: [
161
- c(t.priceAtPurchase),
159
+ /* @__PURE__ */ e("p", { className: "font-medium", children: l(a.priceAtPurchase * a.quantity) }),
160
+ /* @__PURE__ */ r("p", { className: "text-sm opacity-70", children: [
161
+ l(a.priceAtPurchase),
162
162
  " each"
163
163
  ] })
164
164
  ] })
165
- ] }, t.id)) }),
165
+ ] }, a.id)) }),
166
166
  /* @__PURE__ */ r("div", { className: "mt-6 border-t pt-4 space-y-2", children: [
167
167
  /* @__PURE__ */ r("div", { className: "flex justify-between text-sm", children: [
168
- /* @__PURE__ */ e("span", { className: "text-gray-600", children: "Subtotal" }),
169
- /* @__PURE__ */ e("span", { className: "font-medium", children: c(a.subtotal) })
168
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Subtotal" }),
169
+ /* @__PURE__ */ e("span", { className: "font-medium", children: l(t.subtotal) })
170
170
  ] }),
171
- a.discountAmount && a.discountAmount > 0 && /* @__PURE__ */ r("div", { className: "flex justify-between text-sm text-green-600", children: [
171
+ t.discountAmount && t.discountAmount > 0 && /* @__PURE__ */ r("div", { className: "flex justify-between text-sm text-green-600", children: [
172
172
  /* @__PURE__ */ e("span", { children: "Discount" }),
173
173
  /* @__PURE__ */ r("span", { children: [
174
174
  "-",
175
- c(a.discountAmount)
175
+ l(t.discountAmount)
176
176
  ] })
177
177
  ] }),
178
178
  /* @__PURE__ */ r("div", { className: "flex justify-between text-sm", children: [
179
- /* @__PURE__ */ e("span", { className: "text-gray-600", children: "Delivery Charge" }),
180
- /* @__PURE__ */ e("span", { className: "font-medium", children: c(a.deliveryCharge) })
179
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Delivery Charge" }),
180
+ /* @__PURE__ */ e("span", { className: "font-medium", children: l(t.deliveryCharge) })
181
181
  ] }),
182
182
  /* @__PURE__ */ r("div", { className: "flex justify-between text-lg font-bold border-t pt-2", children: [
183
183
  /* @__PURE__ */ e("span", { children: "Total" }),
184
- /* @__PURE__ */ e("span", { children: c(a.totalPrice) })
184
+ /* @__PURE__ */ e("span", { children: l(t.totalPrice) })
185
185
  ] })
186
186
  ] })
187
187
  ] })
188
188
  ] }),
189
- /* @__PURE__ */ e(s, { className: n, children: /* @__PURE__ */ e(i, { className: "pt-6", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-600 text-center", children: [
189
+ /* @__PURE__ */ e(s, { className: n, children: /* @__PURE__ */ e(i, { className: "pt-6", children: /* @__PURE__ */ r("p", { className: "text-sm opacity-70 text-center", children: [
190
190
  "Need help with your order? Call us on ",
191
191
  C,
192
192
  " or contact us on",