@instockng/storefront-ui 1.0.18 → 1.0.20

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 (292) hide show
  1. package/dist/components/OrderConfirmation.d.ts +1 -1
  2. package/dist/components/OrderConfirmation.d.ts.map +1 -1
  3. package/dist/components/ShoppingCart.d.ts.map +1 -1
  4. package/dist/contexts/CartContext.d.ts +2 -2
  5. package/dist/contexts/CartContext.d.ts.map +1 -1
  6. package/dist/fetchers.d.ts +19 -0
  7. package/dist/fetchers.d.ts.map +1 -0
  8. package/dist/hooks/usePageTracking.d.ts +40 -0
  9. package/dist/hooks/usePageTracking.d.ts.map +1 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.mjs +101 -92
  13. package/dist/index10.mjs +149 -624
  14. package/dist/index100.mjs +22 -33
  15. package/dist/index101.mjs +22 -30
  16. package/dist/index102.mjs +32 -27
  17. package/dist/index103.mjs +152 -57
  18. package/dist/index104.mjs +20 -3
  19. package/dist/index105.mjs +31 -2
  20. package/dist/index106.mjs +84 -2
  21. package/dist/index107.mjs +37 -16
  22. package/dist/index108.mjs +144 -12
  23. package/dist/index109.mjs +55 -6
  24. package/dist/index11.mjs +94 -56
  25. package/dist/index110.mjs +23 -30
  26. package/dist/index111.mjs +30 -0
  27. package/dist/index112.mjs +26 -0
  28. package/dist/index113.mjs +28 -0
  29. package/dist/index114.mjs +24 -0
  30. package/dist/index115.mjs +25 -0
  31. package/dist/index116.mjs +24 -0
  32. package/dist/index117.mjs +68 -0
  33. package/dist/index118.mjs +21 -0
  34. package/dist/index119.mjs +42 -0
  35. package/dist/index12.mjs +645 -62
  36. package/dist/index120.mjs +27 -0
  37. package/dist/index121.mjs +37 -0
  38. package/dist/index122.mjs +30 -0
  39. package/dist/index123.mjs +22 -0
  40. package/dist/index124.mjs +24 -0
  41. package/dist/index125.mjs +50 -0
  42. package/dist/index126.mjs +26 -0
  43. package/dist/index127.mjs +271 -0
  44. package/dist/index128.mjs +73 -0
  45. package/dist/index129.mjs +11 -0
  46. package/dist/index13.mjs +50 -14
  47. package/dist/index130.mjs +5 -0
  48. package/dist/index131.mjs +5 -0
  49. package/dist/index132.mjs +36 -0
  50. package/dist/index133.mjs +5 -0
  51. package/dist/index134.mjs +24 -0
  52. package/dist/index135.mjs +59 -0
  53. package/dist/index136.mjs +32 -0
  54. package/dist/index137.mjs +10 -0
  55. package/dist/index138.mjs +55 -0
  56. package/dist/index139.mjs +9 -0
  57. package/dist/index14.mjs +62 -115
  58. package/dist/index140.mjs +15 -0
  59. package/dist/index141.mjs +10 -0
  60. package/dist/index142.mjs +31 -0
  61. package/dist/index143.mjs +5 -0
  62. package/dist/index144.mjs +73 -0
  63. package/dist/index145.mjs +170 -0
  64. package/dist/index146.mjs +5 -0
  65. package/dist/index147.mjs +5 -0
  66. package/dist/index148.mjs +5 -0
  67. package/dist/index149.mjs +5 -0
  68. package/dist/index15.mjs +23 -41
  69. package/dist/index150.mjs +21 -0
  70. package/dist/index151.mjs +35 -0
  71. package/dist/index152.mjs +41 -0
  72. package/dist/index153.mjs +21 -0
  73. package/dist/index154.mjs +21 -0
  74. package/dist/index155.mjs +5 -0
  75. package/dist/index156.mjs +23 -0
  76. package/dist/index157.mjs +49 -0
  77. package/dist/index158.mjs +5 -0
  78. package/dist/index159.mjs +33 -0
  79. package/dist/index16.mjs +115 -42
  80. package/dist/index160.mjs +21 -0
  81. package/dist/index161.mjs +5 -0
  82. package/dist/index162.mjs +5 -0
  83. package/dist/index163.mjs +5 -0
  84. package/dist/index164.mjs +5 -0
  85. package/dist/index165.mjs +75 -0
  86. package/dist/index166.mjs +5 -0
  87. package/dist/index167.mjs +56 -0
  88. package/dist/index168.mjs +5 -0
  89. package/dist/index169.mjs +39 -0
  90. package/dist/index17.mjs +42 -42
  91. package/dist/index170.mjs +155 -0
  92. package/dist/index171.mjs +5 -0
  93. package/dist/index172.mjs +5 -0
  94. package/dist/index173.mjs +22 -0
  95. package/dist/index174.mjs +5 -0
  96. package/dist/index175.mjs +5 -0
  97. package/dist/index176.mjs +29 -0
  98. package/dist/index177.mjs +5 -0
  99. package/dist/index178.mjs +5 -0
  100. package/dist/index179.mjs +27 -0
  101. package/dist/index18.mjs +41 -31
  102. package/dist/index180.mjs +26 -0
  103. package/dist/index181.mjs +5 -0
  104. package/dist/index182.mjs +5 -0
  105. package/dist/index183.mjs +5 -0
  106. package/dist/index184.mjs +26 -0
  107. package/dist/index185.mjs +5 -0
  108. package/dist/index186.mjs +26 -0
  109. package/dist/index187.mjs +5 -0
  110. package/dist/index188.mjs +5 -0
  111. package/dist/index189.mjs +5 -0
  112. package/dist/index19.mjs +40 -7
  113. package/dist/index190.mjs +26 -0
  114. package/dist/index191.mjs +5 -0
  115. package/dist/index192.mjs +26 -0
  116. package/dist/index193.mjs +5 -0
  117. package/dist/index194.mjs +5 -0
  118. package/dist/index195.mjs +5 -0
  119. package/dist/index196.mjs +5 -0
  120. package/dist/index197.mjs +5 -0
  121. package/dist/index198.mjs +5 -0
  122. package/dist/index199.mjs +5 -0
  123. package/dist/index2.mjs +31 -12
  124. package/dist/index20.mjs +27 -17
  125. package/dist/index200.mjs +5 -0
  126. package/dist/index201.mjs +130 -0
  127. package/dist/index202.mjs +5 -0
  128. package/dist/index203.mjs +77 -0
  129. package/dist/index204.mjs +77 -0
  130. package/dist/index205.mjs +5 -0
  131. package/dist/index206.mjs +111 -0
  132. package/dist/index207.mjs +5 -0
  133. package/dist/index208.mjs +5 -0
  134. package/dist/index209.mjs +5 -0
  135. package/dist/index21.mjs +6 -29
  136. package/dist/index210.mjs +5 -0
  137. package/dist/index211.mjs +5 -0
  138. package/dist/index212.mjs +5 -0
  139. package/dist/index213.mjs +5 -0
  140. package/dist/index214.mjs +5 -0
  141. package/dist/index215.mjs +5 -0
  142. package/dist/index216.mjs +40 -0
  143. package/dist/index217.mjs +5 -0
  144. package/dist/index218.mjs +5 -0
  145. package/dist/index219.mjs +247 -0
  146. package/dist/index22.mjs +20 -18
  147. package/dist/index220.mjs +5 -0
  148. package/dist/index221.mjs +36 -0
  149. package/dist/index222.mjs +68 -0
  150. package/dist/index223.mjs +28 -0
  151. package/dist/index224.mjs +5 -0
  152. package/dist/index225.mjs +5 -0
  153. package/dist/index226.mjs +5 -0
  154. package/dist/index227.mjs +5 -0
  155. package/dist/index228.mjs +5 -0
  156. package/dist/index229.mjs +5 -0
  157. package/dist/index23.mjs +32 -87
  158. package/dist/index230.mjs +5 -0
  159. package/dist/index231.mjs +5 -0
  160. package/dist/index232.mjs +5 -0
  161. package/dist/index233.mjs +7 -0
  162. package/dist/index234.mjs +34 -0
  163. package/dist/index235.mjs +14 -0
  164. package/dist/index236.mjs +7 -0
  165. package/dist/index237.mjs +7 -0
  166. package/dist/index238.mjs +16 -0
  167. package/dist/index239.mjs +10 -0
  168. package/dist/index24.mjs +12 -12
  169. package/dist/index240.mjs +15 -0
  170. package/dist/index241.mjs +8 -0
  171. package/dist/index242.mjs +36 -0
  172. package/dist/index243.mjs +34 -0
  173. package/dist/index244.mjs +31 -0
  174. package/dist/index245.mjs +64 -0
  175. package/dist/index246.mjs +5 -0
  176. package/dist/index247.mjs +5 -0
  177. package/dist/index248.mjs +5 -0
  178. package/dist/index249.mjs +5 -0
  179. package/dist/index25.mjs +85 -8
  180. package/dist/index250.mjs +21 -0
  181. package/dist/index251.mjs +50 -0
  182. package/dist/index252.mjs +5 -0
  183. package/dist/index253.mjs +5 -0
  184. package/dist/index254.mjs +5 -0
  185. package/dist/index255.mjs +5 -0
  186. package/dist/index256.mjs +94 -0
  187. package/dist/index257.mjs +5 -0
  188. package/dist/index258.mjs +6 -0
  189. package/dist/index259.mjs +5 -0
  190. package/dist/index26.mjs +20 -97
  191. package/dist/index260.mjs +5 -0
  192. package/dist/index261.mjs +20 -0
  193. package/dist/index262.mjs +16 -0
  194. package/dist/index263.mjs +9 -0
  195. package/dist/index264.mjs +33 -0
  196. package/dist/index265.mjs +5 -0
  197. package/dist/index266.mjs +5 -0
  198. package/dist/index267.mjs +5 -0
  199. package/dist/index27.mjs +11 -18
  200. package/dist/index28.mjs +11 -65
  201. package/dist/index29.mjs +94 -89
  202. package/dist/index3.mjs +117 -97
  203. package/dist/index30.mjs +20 -19
  204. package/dist/index31.mjs +65 -19
  205. package/dist/index32.mjs +93 -8
  206. package/dist/index33.mjs +18 -1432
  207. package/dist/index34.mjs +19 -2
  208. package/dist/index35.mjs +10 -56
  209. package/dist/index36.mjs +9 -49
  210. package/dist/index37.mjs +103 -33
  211. package/dist/index38.mjs +24 -14
  212. package/dist/index39.mjs +1411 -2241
  213. package/dist/index4.mjs +83 -197
  214. package/dist/index40.mjs +2 -36
  215. package/dist/index41.mjs +56 -43
  216. package/dist/index42.mjs +50 -98
  217. package/dist/index43.mjs +33 -97
  218. package/dist/index44.mjs +13 -79
  219. package/dist/index45.mjs +2255 -69
  220. package/dist/index46.mjs +36 -95
  221. package/dist/index47.mjs +43 -80
  222. package/dist/index48.mjs +99 -79
  223. package/dist/index49.mjs +93 -15
  224. package/dist/index5.mjs +15 -108
  225. package/dist/index50.mjs +77 -14
  226. package/dist/index51.mjs +58 -44
  227. package/dist/index52.mjs +63 -93
  228. package/dist/index53.mjs +51 -99
  229. package/dist/index54.mjs +78 -4
  230. package/dist/index55.mjs +18 -22
  231. package/dist/index56.mjs +17 -74
  232. package/dist/index57.mjs +63 -15
  233. package/dist/index58.mjs +121 -59
  234. package/dist/index59.mjs +129 -34
  235. package/dist/index6.mjs +190 -73
  236. package/dist/index60.mjs +22 -41
  237. package/dist/index61.mjs +2 -235
  238. package/dist/index62.mjs +152 -5
  239. package/dist/index63.mjs +21 -132
  240. package/dist/index64.mjs +73 -66
  241. package/dist/index65.mjs +14 -86
  242. package/dist/index66.mjs +59 -25
  243. package/dist/index67.mjs +4 -8
  244. package/dist/index68.mjs +2 -75
  245. package/dist/index69.mjs +5 -3
  246. package/dist/index7.mjs +97 -85
  247. package/dist/index70.mjs +1134 -2
  248. package/dist/index71.mjs +19 -82
  249. package/dist/index72.mjs +54 -53
  250. package/dist/index73.mjs +32 -5
  251. package/dist/index74.mjs +2 -5
  252. package/dist/index75.mjs +223 -167
  253. package/dist/index76.mjs +6 -53
  254. package/dist/index77.mjs +133 -68
  255. package/dist/index78.mjs +67 -3
  256. package/dist/index79.mjs +87 -2
  257. package/dist/index8.mjs +78 -162
  258. package/dist/index80.mjs +25 -17
  259. package/dist/index81.mjs +8 -55
  260. package/dist/index82.mjs +74 -28
  261. package/dist/index83.mjs +3 -6
  262. package/dist/index84.mjs +2 -52
  263. package/dist/index85.mjs +83 -6
  264. package/dist/index86.mjs +53 -11
  265. package/dist/index87.mjs +6 -7
  266. package/dist/index88.mjs +5 -28
  267. package/dist/index89.mjs +179 -2
  268. package/dist/index9.mjs +90 -90
  269. package/dist/index90.mjs +49 -66
  270. package/dist/index91.mjs +68 -166
  271. package/dist/index92.mjs +34 -31
  272. package/dist/index93.mjs +42 -10
  273. package/dist/index94.mjs +2 -4
  274. package/dist/index95.mjs +2 -4
  275. package/dist/index96.mjs +28 -13
  276. package/dist/index97.mjs +18 -7
  277. package/dist/index98.mjs +214 -11
  278. package/dist/index99.mjs +179 -4
  279. package/dist/providers/MetaPixelProvider.d.ts +98 -0
  280. package/dist/providers/MetaPixelProvider.d.ts.map +1 -0
  281. package/dist/providers/StorefrontProvider.d.ts +1 -0
  282. package/dist/providers/StorefrontProvider.d.ts.map +1 -1
  283. package/dist/styles.css +1 -1
  284. package/package.json +5 -4
  285. package/src/components/OrderConfirmation.tsx +0 -2
  286. package/src/components/ShoppingCart.tsx +12 -1
  287. package/src/contexts/CartContext.tsx +30 -5
  288. package/src/fetchers.ts +33 -0
  289. package/src/hooks/usePageTracking.ts +72 -0
  290. package/src/index.ts +5 -0
  291. package/src/providers/MetaPixelProvider.tsx +239 -0
  292. package/src/providers/StorefrontProvider.tsx +29 -3
package/dist/index53.mjs CHANGED
@@ -1,132 +1,84 @@
1
1
  'use client';
2
- import { useQueryClient as y, useMutation as v } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as m } from "./index54.mjs";
4
- import { createAdminRpcClients as u, authHeaders as l } from "./index21.mjs";
5
- import { queryKeys as o } from "./index26.mjs";
6
- import { useApiConfig as c } from "./index19.mjs";
7
- function p(t) {
8
- const { baseURL: s, authToken: i } = c();
9
- return m({
10
- queryKey: o.admin.deliveryZones.states.list(),
2
+ import { useQueryClient as w, useMutation as y } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as d } from "./index67.mjs";
4
+ import { createAdminRpcClients as i, authHeaders as c } from "./index23.mjs";
5
+ import { queryKeys as u } from "./index29.mjs";
6
+ import { useApiConfig as l } from "./index21.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(s).deliveryZones.states.$get({}, l(i));
13
- if (!e.ok)
14
- throw new Error(`Failed to fetch states: ${e.statusText}`);
15
- 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();
16
16
  },
17
- ...t
17
+ ...e
18
18
  });
19
19
  }
20
- function k(t) {
21
- const { baseURL: s, authToken: i } = c(), r = y();
22
- return v({
23
- mutationFn: async (e) => {
24
- const n = await u(s).deliveryZones.states.$post({ json: e }, l(i));
25
- if (!n.ok)
26
- throw new Error(`Failed to create state: ${n.statusText}`);
27
- return n.json();
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}`);
27
+ return o.json();
28
28
  },
29
29
  onSuccess: () => {
30
- r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
30
+ r.invalidateQueries({ queryKey: u.admin.warehouses.all });
31
31
  },
32
- ...t
32
+ ...e
33
33
  });
34
34
  }
35
- function F(t, s) {
36
- const { baseURL: i, authToken: r } = c(), e = y();
37
- return v({
35
+ function $(e, s) {
36
+ const { baseURL: n, authToken: r } = l(), t = w();
37
+ return y({
38
38
  mutationFn: async (a) => {
39
- const d = await u(i).deliveryZones.states[":id"].$patch({ json: a, param: { id: t } }, l(r));
40
- if (!d.ok)
41
- throw new Error(`Failed to update state: ${d.statusText}`);
42
- return d.json();
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();
43
43
  },
44
44
  onSuccess: () => {
45
- e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
45
+ t.invalidateQueries({ queryKey: u.admin.warehouses.detail(e) }), t.invalidateQueries({ queryKey: u.admin.warehouses.all });
46
46
  },
47
47
  ...s
48
48
  });
49
49
  }
50
- function T(t, s) {
51
- const { baseURL: i, authToken: r } = c(), e = y();
52
- return v({
53
- mutationFn: async () => {
54
- const n = await u(i).deliveryZones.states[":id"].$delete({ param: { id: t } }, l(r));
55
- if (!n.ok)
56
- throw new Error(`Failed to delete state: ${n.statusText}`);
57
- return n.json();
58
- },
59
- onSuccess: () => {
60
- e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
61
- },
62
- ...s
63
- });
64
- }
65
- function $(t, s) {
66
- const { baseURL: i, authToken: r } = c();
67
- return m({
68
- queryKey: o.admin.deliveryZones.zones.list(t),
50
+ function v(e, s) {
51
+ const { baseURL: n, authToken: r } = l();
52
+ return d({
53
+ queryKey: u.admin.warehouses.inventory(e),
69
54
  queryFn: async () => {
70
- const a = await u(i).deliveryZones.zones.$get({ query: t }, l(r));
55
+ const a = await i(n).warehouses[":id"].inventory.$get({ param: { id: e } }, c(r));
71
56
  if (!a.ok)
72
- throw new Error(`Failed to fetch delivery zones: ${a.statusText}`);
57
+ throw new Error(`Failed to fetch warehouse inventory: ${a.statusText}`);
73
58
  return a.json();
74
59
  },
75
60
  ...s
76
61
  });
77
62
  }
78
- function z(t) {
79
- const { baseURL: s, authToken: i } = c(), r = y();
80
- return v({
81
- mutationFn: async (e) => {
82
- const n = await u(s).deliveryZones.zones.$post({ json: e }, l(i));
83
- if (!n.ok)
84
- throw new Error(`Failed to create delivery zone: ${n.statusText}`);
85
- return n.json();
86
- },
87
- onSuccess: () => {
88
- r.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all }), r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
89
- },
90
- ...t
91
- });
92
- }
93
- function K(t, s) {
94
- const { baseURL: i, authToken: r } = c(), e = y();
95
- return v({
96
- mutationFn: async (a) => {
97
- const d = await u(i).deliveryZones.zones[":id"].$patch({ json: a, param: { id: t } }, l(r));
98
- if (!d.ok)
99
- throw new Error(`Failed to update delivery zone: ${d.statusText}`);
100
- return d.json();
101
- },
102
- onSuccess: () => {
103
- e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
104
- },
105
- ...s
106
- });
107
- }
108
- function j(t, s) {
109
- const { baseURL: i, authToken: r } = c(), e = y();
110
- return v({
63
+ function x(e, s) {
64
+ const { baseURL: n, authToken: r } = l(), t = w();
65
+ return y({
111
66
  mutationFn: async () => {
112
- const n = await u(i).deliveryZones.zones[":id"].$delete({ param: { id: t } }, l(r));
113
- if (!n.ok)
114
- throw new Error(`Failed to delete delivery zone: ${n.statusText}`);
115
- return n.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();
116
71
  },
117
72
  onSuccess: () => {
118
- e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
73
+ t.invalidateQueries({ queryKey: u.admin.warehouses.all });
119
74
  },
120
75
  ...s
121
76
  });
122
77
  }
123
78
  export {
124
- z as useCreateDeliveryZone,
125
- k as useCreateState,
126
- j as useDeleteDeliveryZone,
127
- T as useDeleteState,
128
- $ as useListDeliveryZones,
129
- p as useListStates,
130
- K as useUpdateDeliveryZone,
131
- F as useUpdateState
79
+ T as useCreateWarehouse,
80
+ x as useDeleteWarehouse,
81
+ v as useGetWarehouseInventory,
82
+ F as useListWarehouses,
83
+ $ as useUpdateWarehouse
132
84
  };
package/dist/index54.mjs CHANGED
@@ -1,8 +1,82 @@
1
1
  'use client';
2
- import { useQuery as e } from "@tanstack/react-query";
3
- function n(r) {
4
- return e(r);
2
+ import { useQueryClient as d, useMutation as v } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as l } from "./index67.mjs";
4
+ import { createAdminRpcClients as u, authHeaders as c } from "./index23.mjs";
5
+ import { queryKeys as s } from "./index29.mjs";
6
+ import { useApiConfig as y } from "./index21.mjs";
7
+ function m(n, r) {
8
+ const { baseURL: o, authToken: t } = y();
9
+ return l({
10
+ queryKey: s.admin.inventory.list(n),
11
+ queryFn: async () => {
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();
16
+ },
17
+ ...r
18
+ });
19
+ }
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();
28
+ },
29
+ onSuccess: () => {
30
+ t.invalidateQueries({ queryKey: s.admin.inventory.all }), t.invalidateQueries({ queryKey: s.admin.variants.all }), t.invalidateQueries({ queryKey: s.admin.warehouses.all });
31
+ },
32
+ ...n
33
+ });
34
+ }
35
+ function j(n) {
36
+ const { baseURL: r, authToken: o } = y(), t = d();
37
+ return v({
38
+ mutationFn: async (a) => {
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
+ },
44
+ onSuccess: () => {
45
+ t.invalidateQueries({ queryKey: s.admin.inventory.all }), t.invalidateQueries({ queryKey: s.admin.warehouses.all });
46
+ },
47
+ ...n
48
+ });
49
+ }
50
+ function F(n, r) {
51
+ const { baseURL: o, authToken: t } = y();
52
+ return l({
53
+ queryKey: s.admin.inventory.transactions(n),
54
+ queryFn: async () => {
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();
59
+ },
60
+ ...r
61
+ });
62
+ }
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();
72
+ },
73
+ ...r
74
+ });
5
75
  }
6
76
  export {
7
- n as useQueryUnwrapped
77
+ T as useAdjustInventory,
78
+ F as useGetInventoryTransactions,
79
+ $ as useGetLowStockVariants,
80
+ m as useListInventory,
81
+ j as useTransferInventory
8
82
  };
package/dist/index55.mjs CHANGED
@@ -1,26 +1,22 @@
1
1
  'use client';
2
- import "react";
3
- function i(n, o) {
4
- if (typeof n == "function")
5
- return n(o);
6
- n != null && (n.current = o);
7
- }
8
- function f(...n) {
9
- return (o) => {
10
- let u = !1;
11
- const c = n.map((t) => {
12
- const e = i(t, o);
13
- return !u && typeof e == "function" && (u = !0), e;
14
- });
15
- if (u)
16
- return () => {
17
- for (let t = 0; t < c.length; t++) {
18
- const e = c[t];
19
- typeof e == "function" ? e() : i(n[t], null);
20
- }
21
- };
22
- };
2
+ import { useQueryUnwrapped as i } from "./index67.mjs";
3
+ import { createAdminRpcClients as n, authHeaders as u } from "./index23.mjs";
4
+ import { queryKeys as m } from "./index29.mjs";
5
+ import { useApiConfig as a } from "./index21.mjs";
6
+ function h(e, t) {
7
+ const { baseURL: s, authToken: o } = a();
8
+ return i({
9
+ queryKey: m.admin.customers.history(e),
10
+ queryFn: async () => {
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
+ },
16
+ enabled: !!e,
17
+ ...t
18
+ });
23
19
  }
24
20
  export {
25
- f as composeRefs
21
+ h as useGetCustomerHistory
26
22
  };
package/dist/index56.mjs CHANGED
@@ -1,78 +1,21 @@
1
1
  'use client';
2
- function c(e) {
3
- this._maxSize = e, this.clear();
4
- }
5
- c.prototype.clear = function() {
6
- this._size = 0, this._values = /* @__PURE__ */ Object.create(null);
7
- };
8
- c.prototype.get = function(e) {
9
- return this._values[e];
10
- };
11
- c.prototype.set = function(e, t) {
12
- return this._size >= this._maxSize && this.clear(), e in this._values || this._size++, this._values[e] = t;
13
- };
14
- var d = /[^.^\]^[]+|(?=\[\]|\.\.)/g, C = /^\d+$/, m = /^\d/, A = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, x = /^\s*(['"]?)(.*?)(\1)\s*$/, h = 512, E = new c(h), v = new c(h), g = new c(h), I = {
15
- Cache: c,
16
- split: l,
17
- normalizePath: f,
18
- setter: function(e) {
19
- var t = f(e);
20
- return v.get(e) || v.set(e, function(s, n) {
21
- for (var r = 0, o = t.length, u = s; r < o - 1; ) {
22
- var a = t[r];
23
- if (a === "__proto__" || a === "constructor" || a === "prototype")
24
- return s;
25
- u = u[t[r++]];
26
- }
27
- u[t[r]] = n;
28
- });
29
- },
30
- getter: function(e, t) {
31
- var i = f(e);
32
- return g.get(e) || g.set(e, function(n) {
33
- for (var r = 0, o = i.length; r < o; )
34
- if (n != null || !t) n = n[i[r++]];
35
- else return;
36
- return n;
37
- });
38
- },
39
- join: function(e) {
40
- return e.reduce(function(t, i) {
41
- return t + (_(i) || C.test(i) ? "[" + i + "]" : (t ? "." : "") + i);
42
- }, "");
43
- },
44
- forEach: function(e, t, i) {
45
- y(Array.isArray(e) ? e : l(e), t, i);
46
- }
47
- };
48
- function f(e) {
49
- return E.get(e) || E.set(
50
- e,
51
- l(e).map(function(t) {
52
- return t.replace(x, "$2");
53
- })
54
- );
55
- }
56
- function l(e) {
57
- return e.match(d) || [""];
58
- }
59
- function y(e, t, i) {
60
- var s = e.length, n, r, o, u;
61
- for (r = 0; r < s; r++)
62
- n = e[r], n && (S(n) && (n = '"' + n + '"'), u = _(n), o = !u && /^\d+$/.test(n), t.call(i, n, u, o, r, e));
63
- }
64
- function _(e) {
65
- return typeof e == "string" && e && ["'", '"'].indexOf(e.charAt(0)) !== -1;
66
- }
67
- function z(e) {
68
- return e.match(m) && !e.match(C);
69
- }
70
- function G(e) {
71
- return A.test(e);
72
- }
73
- function S(e) {
74
- return !_(e) && (z(e) || G(e));
2
+ import { useQueryUnwrapped as s } from "./index67.mjs";
3
+ import { createAdminRpcClients as i, authHeaders as u } from "./index23.mjs";
4
+ import { queryKeys as c } from "./index29.mjs";
5
+ import { useApiConfig as d } from "./index21.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
+ queryFn: async () => {
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();
15
+ },
16
+ ...r
17
+ });
75
18
  }
76
19
  export {
77
- I as p
20
+ h as useGetStats
78
21
  };
package/dist/index57.mjs CHANGED
@@ -1,18 +1,66 @@
1
1
  'use client';
2
- const c = /[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g, x = (u) => u.match(c) || [], d = (u) => u[0].toUpperCase() + u.slice(1), a = (u, f) => x(u).join(f).toLowerCase(), b = (u) => x(u).reduce(
3
- (f, e) => `${f}${f ? e[0].toUpperCase() + e.slice(1).toLowerCase() : e.toLowerCase()}`,
4
- ""
5
- ), s = (u) => d(b(u)), t = (u) => a(u, "_"), o = (u) => a(u, "-"), n = (u) => d(a(u, " ")), r = (u) => x(u).map(d).join(" ");
6
- var C = {
7
- words: x,
8
- upperFirst: d,
9
- camelCase: b,
10
- pascalCase: s,
11
- snakeCase: t,
12
- kebabCase: o,
13
- sentenceCase: n,
14
- titleCase: r
15
- };
2
+ import { useQueryClient as l, useMutation as y } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as c } from "./index67.mjs";
4
+ import { createAdminRpcClients as s, authHeaders as o } from "./index23.mjs";
5
+ import { queryKeys as i } from "./index29.mjs";
6
+ import { useApiConfig as u } from "./index21.mjs";
7
+ function m(e, n) {
8
+ const { baseURL: a, authToken: r } = u();
9
+ return c({
10
+ queryKey: i.admin.abandonedCarts.list(e),
11
+ queryFn: async () => {
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();
16
+ },
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
59
+ });
60
+ }
16
61
  export {
17
- C as t
62
+ k as useCleanupExpiredCarts,
63
+ q as useGetAbandonedCart,
64
+ p as useGetAbandonedCartStats,
65
+ m as useListAbandonedCarts
18
66
  };