@instockng/storefront-ui 1.0.18 → 1.0.19
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.
- package/dist/components/OrderConfirmation.d.ts +1 -1
- package/dist/components/OrderConfirmation.d.ts.map +1 -1
- package/dist/components/ShoppingCart.d.ts.map +1 -1
- package/dist/contexts/CartContext.d.ts +2 -2
- package/dist/contexts/CartContext.d.ts.map +1 -1
- package/dist/fetchers.d.ts +19 -0
- package/dist/fetchers.d.ts.map +1 -0
- package/dist/hooks/usePageTracking.d.ts +40 -0
- package/dist/hooks/usePageTracking.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +101 -92
- package/dist/index10.mjs +149 -624
- package/dist/index100.mjs +22 -33
- package/dist/index101.mjs +22 -30
- package/dist/index102.mjs +32 -27
- package/dist/index103.mjs +152 -57
- package/dist/index104.mjs +20 -3
- package/dist/index105.mjs +31 -2
- package/dist/index106.mjs +84 -2
- package/dist/index107.mjs +37 -16
- package/dist/index108.mjs +144 -12
- package/dist/index109.mjs +55 -6
- package/dist/index11.mjs +94 -56
- package/dist/index110.mjs +23 -30
- package/dist/index111.mjs +30 -0
- package/dist/index112.mjs +26 -0
- package/dist/index113.mjs +28 -0
- package/dist/index114.mjs +24 -0
- package/dist/index115.mjs +25 -0
- package/dist/index116.mjs +24 -0
- package/dist/index117.mjs +68 -0
- package/dist/index118.mjs +21 -0
- package/dist/index119.mjs +42 -0
- package/dist/index12.mjs +645 -62
- package/dist/index120.mjs +27 -0
- package/dist/index121.mjs +37 -0
- package/dist/index122.mjs +30 -0
- package/dist/index123.mjs +22 -0
- package/dist/index124.mjs +24 -0
- package/dist/index125.mjs +50 -0
- package/dist/index126.mjs +26 -0
- package/dist/index127.mjs +271 -0
- package/dist/index128.mjs +73 -0
- package/dist/index129.mjs +11 -0
- package/dist/index13.mjs +50 -14
- package/dist/index130.mjs +5 -0
- package/dist/index131.mjs +5 -0
- package/dist/index132.mjs +36 -0
- package/dist/index133.mjs +5 -0
- package/dist/index134.mjs +24 -0
- package/dist/index135.mjs +59 -0
- package/dist/index136.mjs +32 -0
- package/dist/index137.mjs +10 -0
- package/dist/index138.mjs +55 -0
- package/dist/index139.mjs +9 -0
- package/dist/index14.mjs +62 -115
- package/dist/index140.mjs +15 -0
- package/dist/index141.mjs +10 -0
- package/dist/index142.mjs +31 -0
- package/dist/index143.mjs +5 -0
- package/dist/index144.mjs +73 -0
- package/dist/index145.mjs +170 -0
- package/dist/index146.mjs +5 -0
- package/dist/index147.mjs +5 -0
- package/dist/index148.mjs +5 -0
- package/dist/index149.mjs +21 -0
- package/dist/index15.mjs +23 -41
- package/dist/index150.mjs +35 -0
- package/dist/index151.mjs +41 -0
- package/dist/index152.mjs +21 -0
- package/dist/index153.mjs +21 -0
- package/dist/index154.mjs +5 -0
- package/dist/index155.mjs +23 -0
- package/dist/index156.mjs +49 -0
- package/dist/index157.mjs +5 -0
- package/dist/index158.mjs +33 -0
- package/dist/index159.mjs +21 -0
- package/dist/index16.mjs +115 -42
- package/dist/index160.mjs +5 -0
- package/dist/index161.mjs +5 -0
- package/dist/index162.mjs +5 -0
- package/dist/index163.mjs +5 -0
- package/dist/index164.mjs +75 -0
- package/dist/index165.mjs +5 -0
- package/dist/index166.mjs +56 -0
- package/dist/index167.mjs +5 -0
- package/dist/index168.mjs +39 -0
- package/dist/index169.mjs +155 -0
- package/dist/index17.mjs +42 -42
- package/dist/index170.mjs +5 -0
- package/dist/index171.mjs +5 -0
- package/dist/index172.mjs +22 -0
- package/dist/index173.mjs +5 -0
- package/dist/index174.mjs +5 -0
- package/dist/index175.mjs +29 -0
- package/dist/index176.mjs +5 -0
- package/dist/index177.mjs +5 -0
- package/dist/index178.mjs +27 -0
- package/dist/index179.mjs +26 -0
- package/dist/index18.mjs +41 -31
- package/dist/index180.mjs +5 -0
- package/dist/index181.mjs +5 -0
- package/dist/index182.mjs +5 -0
- package/dist/index183.mjs +26 -0
- package/dist/index184.mjs +5 -0
- package/dist/index185.mjs +26 -0
- package/dist/index186.mjs +5 -0
- package/dist/index187.mjs +5 -0
- package/dist/index188.mjs +5 -0
- package/dist/index189.mjs +26 -0
- package/dist/index19.mjs +40 -7
- package/dist/index190.mjs +5 -0
- package/dist/index191.mjs +26 -0
- package/dist/index192.mjs +5 -0
- package/dist/index193.mjs +5 -0
- package/dist/index194.mjs +5 -0
- package/dist/index195.mjs +5 -0
- package/dist/index196.mjs +5 -0
- package/dist/index197.mjs +5 -0
- package/dist/index198.mjs +5 -0
- package/dist/index199.mjs +5 -0
- package/dist/index2.mjs +31 -12
- package/dist/index20.mjs +27 -17
- package/dist/index200.mjs +130 -0
- package/dist/index201.mjs +5 -0
- package/dist/index202.mjs +77 -0
- package/dist/index203.mjs +77 -0
- package/dist/index204.mjs +5 -0
- package/dist/index205.mjs +5 -0
- package/dist/index206.mjs +111 -0
- package/dist/index207.mjs +5 -0
- package/dist/index208.mjs +5 -0
- package/dist/index209.mjs +5 -0
- package/dist/index21.mjs +6 -29
- package/dist/index210.mjs +5 -0
- package/dist/index211.mjs +5 -0
- package/dist/index212.mjs +5 -0
- package/dist/index213.mjs +5 -0
- package/dist/index214.mjs +5 -0
- package/dist/index215.mjs +5 -0
- package/dist/index216.mjs +40 -0
- package/dist/index217.mjs +5 -0
- package/dist/index218.mjs +5 -0
- package/dist/index219.mjs +5 -0
- package/dist/index22.mjs +20 -18
- package/dist/index220.mjs +247 -0
- package/dist/index221.mjs +5 -0
- package/dist/index222.mjs +36 -0
- package/dist/index223.mjs +68 -0
- package/dist/index224.mjs +28 -0
- package/dist/index225.mjs +5 -0
- package/dist/index226.mjs +5 -0
- package/dist/index227.mjs +5 -0
- package/dist/index228.mjs +5 -0
- package/dist/index229.mjs +5 -0
- package/dist/index23.mjs +32 -87
- package/dist/index230.mjs +5 -0
- package/dist/index231.mjs +5 -0
- package/dist/index232.mjs +5 -0
- package/dist/index233.mjs +7 -0
- package/dist/index234.mjs +5 -0
- package/dist/index235.mjs +5 -0
- package/dist/index236.mjs +34 -0
- package/dist/index237.mjs +14 -0
- package/dist/index238.mjs +7 -0
- package/dist/index239.mjs +7 -0
- package/dist/index24.mjs +12 -12
- package/dist/index240.mjs +16 -0
- package/dist/index241.mjs +10 -0
- package/dist/index242.mjs +15 -0
- package/dist/index243.mjs +8 -0
- package/dist/index244.mjs +36 -0
- package/dist/index245.mjs +34 -0
- package/dist/index246.mjs +31 -0
- package/dist/index247.mjs +64 -0
- package/dist/index248.mjs +5 -0
- package/dist/index249.mjs +5 -0
- package/dist/index25.mjs +85 -8
- package/dist/index250.mjs +21 -0
- package/dist/index251.mjs +50 -0
- package/dist/index252.mjs +5 -0
- package/dist/index253.mjs +5 -0
- package/dist/index254.mjs +5 -0
- package/dist/index255.mjs +5 -0
- package/dist/index256.mjs +94 -0
- package/dist/index257.mjs +5 -0
- package/dist/index258.mjs +6 -0
- package/dist/index259.mjs +5 -0
- package/dist/index26.mjs +20 -97
- package/dist/index260.mjs +5 -0
- package/dist/index261.mjs +20 -0
- package/dist/index262.mjs +16 -0
- package/dist/index263.mjs +9 -0
- package/dist/index264.mjs +33 -0
- package/dist/index265.mjs +5 -0
- package/dist/index266.mjs +5 -0
- package/dist/index267.mjs +5 -0
- package/dist/index27.mjs +11 -18
- package/dist/index28.mjs +11 -65
- package/dist/index29.mjs +94 -89
- package/dist/index3.mjs +117 -97
- package/dist/index30.mjs +20 -19
- package/dist/index31.mjs +65 -19
- package/dist/index32.mjs +93 -8
- package/dist/index33.mjs +18 -1432
- package/dist/index34.mjs +19 -2
- package/dist/index35.mjs +10 -56
- package/dist/index36.mjs +9 -49
- package/dist/index37.mjs +103 -33
- package/dist/index38.mjs +24 -14
- package/dist/index39.mjs +1411 -2241
- package/dist/index4.mjs +82 -197
- package/dist/index40.mjs +2 -36
- package/dist/index41.mjs +56 -43
- package/dist/index42.mjs +50 -98
- package/dist/index43.mjs +33 -97
- package/dist/index44.mjs +13 -79
- package/dist/index45.mjs +2255 -69
- package/dist/index46.mjs +36 -95
- package/dist/index47.mjs +43 -80
- package/dist/index48.mjs +99 -79
- package/dist/index49.mjs +93 -15
- package/dist/index5.mjs +15 -108
- package/dist/index50.mjs +77 -14
- package/dist/index51.mjs +58 -44
- package/dist/index52.mjs +63 -93
- package/dist/index53.mjs +51 -99
- package/dist/index54.mjs +78 -4
- package/dist/index55.mjs +18 -22
- package/dist/index56.mjs +17 -74
- package/dist/index57.mjs +63 -15
- package/dist/index58.mjs +121 -59
- package/dist/index59.mjs +129 -34
- package/dist/index6.mjs +190 -73
- package/dist/index60.mjs +22 -41
- package/dist/index61.mjs +148 -230
- package/dist/index62.mjs +2 -6
- package/dist/index63.mjs +21 -132
- package/dist/index64.mjs +73 -66
- package/dist/index65.mjs +14 -86
- package/dist/index66.mjs +59 -25
- package/dist/index67.mjs +4 -8
- package/dist/index68.mjs +2 -75
- package/dist/index69.mjs +5 -3
- package/dist/index7.mjs +97 -85
- package/dist/index70.mjs +1134 -2
- package/dist/index71.mjs +19 -82
- package/dist/index72.mjs +54 -53
- package/dist/index73.mjs +32 -5
- package/dist/index74.mjs +2 -5
- package/dist/index75.mjs +2 -179
- package/dist/index76.mjs +230 -48
- package/dist/index77.mjs +6 -69
- package/dist/index78.mjs +133 -3
- package/dist/index79.mjs +68 -2
- package/dist/index8.mjs +78 -162
- package/dist/index80.mjs +85 -19
- package/dist/index81.mjs +26 -53
- package/dist/index82.mjs +8 -28
- package/dist/index83.mjs +74 -6
- package/dist/index84.mjs +3 -51
- package/dist/index85.mjs +2 -6
- package/dist/index86.mjs +81 -10
- package/dist/index87.mjs +53 -6
- package/dist/index88.mjs +5 -27
- package/dist/index89.mjs +5 -2
- package/dist/index9.mjs +90 -90
- package/dist/index90.mjs +175 -66
- package/dist/index91.mjs +49 -163
- package/dist/index92.mjs +68 -30
- package/dist/index93.mjs +34 -11
- package/dist/index94.mjs +42 -3
- package/dist/index95.mjs +2 -4
- package/dist/index96.mjs +28 -13
- package/dist/index97.mjs +18 -7
- package/dist/index98.mjs +214 -11
- package/dist/index99.mjs +179 -4
- package/dist/providers/MetaPixelProvider.d.ts +98 -0
- package/dist/providers/MetaPixelProvider.d.ts.map +1 -0
- package/dist/providers/StorefrontProvider.d.ts +1 -0
- package/dist/providers/StorefrontProvider.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -4
- package/src/components/OrderConfirmation.tsx +0 -2
- package/src/components/ShoppingCart.tsx +12 -1
- package/src/contexts/CartContext.tsx +30 -5
- package/src/fetchers.ts +33 -0
- package/src/hooks/usePageTracking.ts +72 -0
- package/src/index.ts +5 -0
- package/src/providers/MetaPixelProvider.tsx +236 -0
- package/src/providers/StorefrontProvider.tsx +29 -3
package/dist/index53.mjs
CHANGED
|
@@ -1,132 +1,84 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useQueryUnwrapped as
|
|
4
|
-
import { createAdminRpcClients as
|
|
5
|
-
import { queryKeys as
|
|
6
|
-
import { useApiConfig as
|
|
7
|
-
function
|
|
8
|
-
const { baseURL: s, authToken:
|
|
9
|
-
return
|
|
10
|
-
queryKey:
|
|
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
|
|
13
|
-
if (!
|
|
14
|
-
throw new Error(`Failed to fetch
|
|
15
|
-
return
|
|
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
|
-
...
|
|
17
|
+
...e
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const { baseURL: s, authToken:
|
|
22
|
-
return
|
|
23
|
-
mutationFn: async (
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
throw new Error(`Failed to create
|
|
27
|
-
return
|
|
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:
|
|
30
|
+
r.invalidateQueries({ queryKey: u.admin.warehouses.all });
|
|
31
31
|
},
|
|
32
|
-
...
|
|
32
|
+
...e
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const { baseURL:
|
|
37
|
-
return
|
|
35
|
+
function $(e, s) {
|
|
36
|
+
const { baseURL: n, authToken: r } = l(), t = w();
|
|
37
|
+
return y({
|
|
38
38
|
mutationFn: async (a) => {
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
41
|
-
throw new Error(`Failed to update
|
|
42
|
-
return
|
|
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
|
-
|
|
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
|
|
51
|
-
const { baseURL:
|
|
52
|
-
return
|
|
53
|
-
|
|
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
|
|
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
|
|
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
|
|
79
|
-
const { baseURL:
|
|
80
|
-
return
|
|
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
|
|
113
|
-
if (!
|
|
114
|
-
throw new Error(`Failed to delete
|
|
115
|
-
return
|
|
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
|
-
|
|
73
|
+
t.invalidateQueries({ queryKey: u.admin.warehouses.all });
|
|
119
74
|
},
|
|
120
75
|
...s
|
|
121
76
|
});
|
|
122
77
|
}
|
|
123
78
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
$ as
|
|
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 {
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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 "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
21
|
+
h as useGetCustomerHistory
|
|
26
22
|
};
|
package/dist/index56.mjs
CHANGED
|
@@ -1,78 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
20
|
+
h as useGetStats
|
|
78
21
|
};
|
package/dist/index57.mjs
CHANGED
|
@@ -1,18 +1,66 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
62
|
+
k as useCleanupExpiredCarts,
|
|
63
|
+
q as useGetAbandonedCart,
|
|
64
|
+
p as useGetAbandonedCartStats,
|
|
65
|
+
m as useListAbandonedCarts
|
|
18
66
|
};
|