@instockng/storefront-ui 1.0.90 → 1.0.92
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/DeliveryConfirmation.d.ts +18 -0
- package/dist/components/DeliveryConfirmation.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +127 -121
- package/dist/index10.mjs +74 -190
- package/dist/index100.mjs +3 -5
- package/dist/index101.mjs +2 -5
- package/dist/index102.mjs +73 -169
- package/dist/index103.mjs +51 -50
- package/dist/index104.mjs +6 -69
- package/dist/index105.mjs +5 -34
- package/dist/index106.mjs +177 -41
- package/dist/index107.mjs +53 -2
- package/dist/index108.mjs +69 -28
- package/dist/index109.mjs +2 -18
- package/dist/index11.mjs +172 -107
- package/dist/index110.mjs +26 -213
- package/dist/index111.mjs +13 -175
- package/dist/index112.mjs +210 -17
- package/dist/index113.mjs +174 -17
- package/dist/index114.mjs +14 -25
- package/dist/index115.mjs +17 -150
- package/dist/index116.mjs +26 -13
- package/dist/index117.mjs +149 -24
- package/dist/index118.mjs +13 -77
- package/dist/index119.mjs +20 -27
- package/dist/index12.mjs +127 -90
- package/dist/index120.mjs +76 -137
- package/dist/index121.mjs +33 -50
- package/dist/index122.mjs +141 -19
- package/dist/index123.mjs +50 -22
- package/dist/index124.mjs +14 -14
- package/dist/index125.mjs +20 -18
- package/dist/index126.mjs +16 -14
- package/dist/index127.mjs +17 -14
- package/dist/index128.mjs +12 -12
- package/dist/index129.mjs +15 -58
- package/dist/index13.mjs +86 -90
- package/dist/index130.mjs +14 -11
- package/dist/index131.mjs +56 -30
- package/dist/index132.mjs +9 -15
- package/dist/index133.mjs +31 -26
- package/dist/index134.mjs +13 -16
- package/dist/index135.mjs +26 -11
- package/dist/index136.mjs +18 -12
- package/dist/index137.mjs +12 -40
- package/dist/index138.mjs +14 -16
- package/dist/index139.mjs +42 -263
- package/dist/index14.mjs +84 -149
- package/dist/index140.mjs +15 -62
- package/dist/index141.mjs +267 -7
- package/dist/index142.mjs +70 -2
- package/dist/index143.mjs +8 -2
- package/dist/index144.mjs +2 -33
- package/dist/index145.mjs +2 -2
- package/dist/index146.mjs +33 -2
- package/dist/index147.mjs +2 -2
- package/dist/index148.mjs +21 -2
- package/dist/index149.mjs +56 -2
- package/dist/index15.mjs +157 -216
- package/dist/index150.mjs +28 -17
- package/dist/index151.mjs +6 -31
- package/dist/index152.mjs +50 -36
- package/dist/index153.mjs +6 -18
- package/dist/index154.mjs +11 -17
- package/dist/index155.mjs +7 -2
- package/dist/index156.mjs +28 -20
- package/dist/index157.mjs +2 -46
- package/dist/index158.mjs +70 -2
- package/dist/index159.mjs +164 -27
- package/dist/index16.mjs +211 -107
- package/dist/index160.mjs +2 -18
- package/dist/index161.mjs +2 -2
- package/dist/index162.mjs +2 -2
- package/dist/index163.mjs +18 -2
- package/dist/index164.mjs +32 -2
- package/dist/index165.mjs +28 -62
- package/dist/index166.mjs +18 -2
- package/dist/index167.mjs +13 -48
- package/dist/index168.mjs +2 -2
- package/dist/index169.mjs +14 -30
- package/dist/index17.mjs +106 -86
- package/dist/index170.mjs +39 -145
- package/dist/index171.mjs +2 -2
- package/dist/index172.mjs +30 -2
- package/dist/index173.mjs +11 -12
- package/dist/index174.mjs +2 -2
- package/dist/index175.mjs +2 -2
- package/dist/index176.mjs +2 -26
- package/dist/index178.mjs +72 -2
- package/dist/index179.mjs +2 -24
- package/dist/index18.mjs +82 -733
- package/dist/index180.mjs +48 -18
- package/dist/index181.mjs +2 -2
- package/dist/index182.mjs +36 -2
- package/dist/index183.mjs +152 -2
- package/dist/index184.mjs +2 -23
- package/dist/index185.mjs +2 -2
- package/dist/index186.mjs +11 -15
- package/dist/index187.mjs +2 -2
- package/dist/index188.mjs +2 -2
- package/dist/index189.mjs +26 -2
- package/dist/index19.mjs +742 -53
- package/dist/index190.mjs +2 -23
- package/dist/index191.mjs +2 -2
- package/dist/index192.mjs +18 -17
- package/dist/index193.mjs +23 -2
- package/dist/index194.mjs +2 -2
- package/dist/index195.mjs +2 -2
- package/dist/index196.mjs +2 -2
- package/dist/index197.mjs +23 -2
- package/dist/index198.mjs +2 -2
- package/dist/index199.mjs +23 -2
- package/dist/index2.mjs +2 -2
- package/dist/index20.mjs +58 -60
- package/dist/index200.mjs +2 -2
- package/dist/index201.mjs +2 -127
- package/dist/index202.mjs +2 -2
- package/dist/index203.mjs +20 -71
- package/dist/index204.mjs +2 -74
- package/dist/index205.mjs +22 -20
- package/dist/index206.mjs +2 -56
- package/dist/index207.mjs +2 -29
- package/dist/index208.mjs +2 -7
- package/dist/index209.mjs +2 -52
- package/dist/index21.mjs +60 -22
- package/dist/index210.mjs +2 -6
- package/dist/index211.mjs +2 -12
- package/dist/index212.mjs +2 -7
- package/dist/index213.mjs +2 -28
- package/dist/index214.mjs +127 -2
- package/dist/index215.mjs +2 -70
- package/dist/index216.mjs +72 -165
- package/dist/index217.mjs +74 -2
- package/dist/index218.mjs +2 -108
- package/dist/index219.mjs +2 -2
- package/dist/index22.mjs +22 -107
- package/dist/index220.mjs +108 -2
- package/dist/index221.mjs +2 -2
- package/dist/index222.mjs +2 -2
- package/dist/index223.mjs +2 -2
- package/dist/index224.mjs +2 -2
- package/dist/index225.mjs +2 -37
- package/dist/index226.mjs +37 -2
- package/dist/index227.mjs +2 -2
- package/dist/index228.mjs +244 -2
- package/dist/index23.mjs +105 -38
- package/dist/index230.mjs +33 -2
- package/dist/index231.mjs +65 -2
- package/dist/index232.mjs +25 -2
- package/dist/index233.mjs +2 -2
- package/dist/index234.mjs +2 -2
- package/dist/index235.mjs +2 -2
- package/dist/index236.mjs +2 -2
- package/dist/index238.mjs +2 -2
- package/dist/index24.mjs +37 -37
- package/dist/index240.mjs +2 -2
- package/dist/index241.mjs +2 -4
- package/dist/index242.mjs +2 -2
- package/dist/index243.mjs +2 -244
- package/dist/index245.mjs +2 -33
- package/dist/index246.mjs +2 -65
- package/dist/index247.mjs +2 -25
- package/dist/index248.mjs +4 -13
- package/dist/index249.mjs +2 -7
- package/dist/index25.mjs +42 -89
- package/dist/index250.mjs +1 -1
- package/dist/index251.mjs +3 -3
- package/dist/index254.mjs +13 -12
- package/dist/index255.mjs +7 -5
- package/dist/index256.mjs +12 -33
- package/dist/index257.mjs +5 -31
- package/dist/index258.mjs +32 -27
- package/dist/index259.mjs +28 -58
- package/dist/index26.mjs +86 -29
- package/dist/index260.mjs +28 -2
- package/dist/index261.mjs +61 -2
- package/dist/index262.mjs +2 -18
- package/dist/index263.mjs +2 -47
- package/dist/index264.mjs +2 -2
- package/dist/index265.mjs +18 -2
- package/dist/index266.mjs +47 -2
- package/dist/index267.mjs +2 -2
- package/dist/index268.mjs +2 -2
- package/dist/index269.mjs +2 -91
- package/dist/index27.mjs +29 -6
- package/dist/index270.mjs +91 -3
- package/dist/index271.mjs +2 -2
- package/dist/index272.mjs +3 -2
- package/dist/index273.mjs +2 -17
- package/dist/index274.mjs +2 -13
- package/dist/index275.mjs +17 -6
- package/dist/index276.mjs +13 -30
- package/dist/index277.mjs +6 -2
- package/dist/index278.mjs +30 -2
- package/dist/index279.mjs +2 -2
- package/dist/index28.mjs +8 -21
- package/dist/index280.mjs +5 -0
- package/dist/index281.mjs +5 -0
- package/dist/index29.mjs +19 -34
- package/dist/index3.mjs +5 -5
- package/dist/index30.mjs +35 -37
- package/dist/index31.mjs +28 -103
- package/dist/index32.mjs +104 -20
- package/dist/index33.mjs +47 -9
- package/dist/index34.mjs +9 -9
- package/dist/index35.mjs +11 -116
- package/dist/index36.mjs +121 -25
- package/dist/index37.mjs +27 -81
- package/dist/index38.mjs +90 -112
- package/dist/index39.mjs +109 -8
- package/dist/index4.mjs +1 -1
- package/dist/index40.mjs +9 -33
- package/dist/index41.mjs +27 -20
- package/dist/index42.mjs +42 -7
- package/dist/index43.mjs +10 -122
- package/dist/index44.mjs +114 -380
- package/dist/index45.mjs +384 -20
- package/dist/index46.mjs +24 -31
- package/dist/index47.mjs +32 -7
- package/dist/index48.mjs +6 -1432
- package/dist/index49.mjs +1432 -69
- package/dist/index5.mjs +1 -1
- package/dist/index50.mjs +70 -2
- package/dist/index51.mjs +2 -60
- package/dist/index52.mjs +57 -48
- package/dist/index53.mjs +51 -33
- package/dist/index54.mjs +33 -15
- package/dist/index55.mjs +12 -2260
- package/dist/index56.mjs +2263 -36
- package/dist/index57.mjs +36 -44
- package/dist/index58.mjs +44 -99
- package/dist/index59.mjs +99 -81
- package/dist/index6.mjs +1 -1
- package/dist/index60.mjs +75 -13
- package/dist/index61.mjs +15 -125
- package/dist/index62.mjs +93 -89
- package/dist/index63.mjs +102 -56
- package/dist/index64.mjs +55 -89
- package/dist/index65.mjs +124 -70
- package/dist/index66.mjs +100 -13
- package/dist/index67.mjs +30 -89
- package/dist/index68.mjs +70 -56
- package/dist/index69.mjs +62 -44
- package/dist/index7.mjs +73 -73
- package/dist/index70.mjs +47 -46
- package/dist/index71.mjs +48 -121
- package/dist/index72.mjs +133 -22
- package/dist/index73.mjs +70 -2
- package/dist/index74.mjs +21 -20
- package/dist/index75.mjs +2 -153
- package/dist/index76.mjs +21 -73
- package/dist/index77.mjs +153 -15
- package/dist/index78.mjs +68 -56
- package/dist/index79.mjs +15 -5
- package/dist/index8.mjs +240 -99
- package/dist/index80.mjs +63 -2
- package/dist/index81.mjs +4 -5
- package/dist/index82.mjs +2 -1134
- package/dist/index83.mjs +5 -19
- package/dist/index84.mjs +1119 -40
- package/dist/index85.mjs +14 -27
- package/dist/index86.mjs +55 -2
- package/dist/index87.mjs +33 -2
- package/dist/index88.mjs +2 -235
- package/dist/index89.mjs +34 -6
- package/dist/index9.mjs +103 -73
- package/dist/index90.mjs +39 -130
- package/dist/index91.mjs +2 -68
- package/dist/index92.mjs +228 -80
- package/dist/index93.mjs +5 -28
- package/dist/index94.mjs +132 -7
- package/dist/index95.mjs +62 -69
- package/dist/index96.mjs +86 -3
- package/dist/index97.mjs +29 -2
- package/dist/index98.mjs +7 -81
- package/dist/index99.mjs +72 -51
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/src/components/DeliveryConfirmation.tsx +357 -0
- package/src/components/OrderConfirmation.tsx +24 -24
- package/src/index.ts +3 -0
package/dist/index68.mjs
CHANGED
|
@@ -1,84 +1,98 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useQueryUnwrapped as
|
|
4
|
-
import { createAdminRpcClients as c, authHeaders as
|
|
5
|
-
import { queryKeys as
|
|
6
|
-
import { useApiConfig as
|
|
7
|
-
function T(e) {
|
|
8
|
-
const { baseURL:
|
|
9
|
-
return
|
|
10
|
-
queryKey:
|
|
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
|
|
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
|
|
14
|
+
throw new Error(`Failed to search variants: ${t.statusText}`);
|
|
15
15
|
return t.json();
|
|
16
16
|
},
|
|
17
|
-
...
|
|
17
|
+
...a
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function $(e) {
|
|
21
|
-
const { baseURL:
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
43
|
+
n.invalidateQueries({ queryKey: o.admin.variants.all }), n.invalidateQueries({ queryKey: o.admin.products.detail(e) });
|
|
31
44
|
},
|
|
32
|
-
...
|
|
45
|
+
...a
|
|
33
46
|
});
|
|
34
47
|
}
|
|
35
|
-
function
|
|
36
|
-
const { baseURL:
|
|
37
|
-
return
|
|
38
|
-
mutationFn: async (t) => {
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
41
|
-
throw new Error(`Failed to update
|
|
42
|
-
return
|
|
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
|
-
|
|
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
|
-
...
|
|
60
|
+
...a
|
|
48
61
|
});
|
|
49
62
|
}
|
|
50
|
-
function
|
|
51
|
-
const { baseURL:
|
|
52
|
-
return
|
|
53
|
-
queryKey:
|
|
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
|
|
56
|
-
if (!
|
|
57
|
-
throw new Error(`Failed to fetch
|
|
58
|
-
return
|
|
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
|
-
...
|
|
73
|
+
...a
|
|
61
74
|
});
|
|
62
75
|
}
|
|
63
|
-
function x(e,
|
|
64
|
-
const { baseURL:
|
|
65
|
-
return
|
|
76
|
+
function x(e, a) {
|
|
77
|
+
const { baseURL: r, getAuthToken: s } = l(), n = m();
|
|
78
|
+
return w({
|
|
66
79
|
mutationFn: async () => {
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
throw new Error(`Failed to delete
|
|
70
|
-
return
|
|
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
|
-
|
|
86
|
+
n.invalidateQueries({ queryKey: o.admin.variants.all });
|
|
74
87
|
},
|
|
75
|
-
...
|
|
88
|
+
...a
|
|
76
89
|
});
|
|
77
90
|
}
|
|
78
91
|
export {
|
|
79
|
-
|
|
80
|
-
x as
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
|
3
|
-
import { useQueryUnwrapped as
|
|
4
|
-
import { createAdminRpcClients as
|
|
5
|
-
import { queryKeys as u } from "./
|
|
6
|
-
import { useApiConfig as
|
|
7
|
-
function
|
|
8
|
-
const { baseURL:
|
|
9
|
-
return
|
|
10
|
-
queryKey: u.admin.
|
|
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
|
|
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
|
|
14
|
+
throw new Error(`Failed to fetch warehouses: ${t.statusText}`);
|
|
15
15
|
return t.json();
|
|
16
16
|
},
|
|
17
|
-
...
|
|
17
|
+
...e
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const { baseURL:
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
29
|
+
onSuccess: () => {
|
|
30
|
+
o.invalidateQueries({ queryKey: u.admin.warehouses.all });
|
|
31
|
+
},
|
|
32
|
+
...e
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
const { baseURL:
|
|
35
|
-
return
|
|
36
|
-
|
|
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
|
|
39
|
-
if (!
|
|
40
|
-
throw new Error(`Failed to fetch
|
|
41
|
-
return
|
|
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
|
-
...
|
|
60
|
+
...s
|
|
44
61
|
});
|
|
45
62
|
}
|
|
46
|
-
function
|
|
47
|
-
const { baseURL: n, getAuthToken:
|
|
48
|
-
return
|
|
63
|
+
function x(e, s) {
|
|
64
|
+
const { baseURL: n, getAuthToken: o } = w(), r = y();
|
|
65
|
+
return d({
|
|
49
66
|
mutationFn: async () => {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
throw new Error(`Failed to
|
|
53
|
-
return
|
|
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
|
-
|
|
73
|
+
r.invalidateQueries({ queryKey: u.admin.warehouses.all });
|
|
57
74
|
},
|
|
58
|
-
...
|
|
75
|
+
...s
|
|
59
76
|
});
|
|
60
77
|
}
|
|
61
78
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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 "./
|
|
4
|
+
import "./index27.mjs";
|
|
5
5
|
import "@tanstack/react-query";
|
|
6
|
-
import { useGetOrder as U, useConfirmOrder as M } from "./
|
|
7
|
-
import { Card as s, CardHeader as m, CardTitle as o, CardContent as i } from "./
|
|
8
|
-
import { Button as S } from "./
|
|
9
|
-
import { Badge as
|
|
10
|
-
import { Loader2 as
|
|
11
|
-
import { cn as
|
|
12
|
-
const
|
|
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:
|
|
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
|
|
24
|
-
const [p, j] = E(!1), { data: u, isLoading: D, error: O } = U(N,
|
|
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: (
|
|
27
|
+
onSuccess: (a) => {
|
|
28
28
|
j(!0);
|
|
29
29
|
},
|
|
30
|
-
onError: (
|
|
30
|
+
onError: (a) => {
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
if (D)
|
|
34
|
-
return /* @__PURE__ */ e("div", { className:
|
|
35
|
-
/* @__PURE__ */ e(
|
|
36
|
-
/* @__PURE__ */ e("p", { className: "text-
|
|
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:
|
|
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-
|
|
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
|
|
47
|
-
return /* @__PURE__ */ e("div", { className:
|
|
48
|
-
/* @__PURE__ */ r("div", { className:
|
|
49
|
-
|
|
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:
|
|
53
|
-
alt: `${
|
|
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
|
|
57
|
+
/* @__PURE__ */ r("h1", { className: "text-3xl font-bold", children: [
|
|
58
58
|
"Order #",
|
|
59
|
-
|
|
59
|
+
t.orderNumber
|
|
60
60
|
] }),
|
|
61
|
-
/* @__PURE__ */ e("p", { className: "text-
|
|
61
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground mt-2", children: t.brand.name })
|
|
62
62
|
] }),
|
|
63
|
-
p && /* @__PURE__ */ e(s, { className:
|
|
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 &&
|
|
71
|
-
|
|
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:
|
|
75
|
+
onClick: () => d.mutate({ orderId: N, token: x }),
|
|
76
76
|
disabled: d.isPending,
|
|
77
|
-
className:
|
|
77
|
+
className: c("w-full", P),
|
|
78
78
|
size: "lg",
|
|
79
79
|
children: d.isPending ? /* @__PURE__ */ r(T, { children: [
|
|
80
|
-
/* @__PURE__ */ e(
|
|
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
|
|
92
|
-
/* @__PURE__ */ e(
|
|
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
|
|
96
|
-
/* @__PURE__ */ e("p", { className: "font-medium", children:
|
|
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
|
|
100
|
-
/* @__PURE__ */ e("p", { className: "font-medium", children:
|
|
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
|
|
104
|
-
/* @__PURE__ */ e("p", { className: "font-medium", children:
|
|
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
|
|
112
|
+
/* @__PURE__ */ e("p", { className: "text-sm opacity-70", children: "Customer" }),
|
|
113
113
|
/* @__PURE__ */ r("p", { className: "font-medium", children: [
|
|
114
|
-
|
|
114
|
+
t.firstName,
|
|
115
115
|
" ",
|
|
116
|
-
|
|
116
|
+
t.lastName
|
|
117
117
|
] }),
|
|
118
|
-
/* @__PURE__ */ e("p", { className: "text-sm
|
|
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
|
|
122
|
-
/* @__PURE__ */ e("p", { className: "font-medium", children:
|
|
123
|
-
/* @__PURE__ */ r("p", { className: "text-sm
|
|
124
|
-
|
|
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
|
-
|
|
126
|
+
t.deliveryZone.state.name
|
|
127
127
|
] }),
|
|
128
|
-
/* @__PURE__ */ e("p", { className: "text-sm
|
|
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: (
|
|
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
|
-
(
|
|
137
|
+
(a.variant.thumbnailUrl || a.variant.product.thumbnailUrl) && /* @__PURE__ */ e(
|
|
138
138
|
"img",
|
|
139
139
|
{
|
|
140
|
-
src:
|
|
141
|
-
alt:
|
|
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:
|
|
147
|
-
|
|
148
|
-
/* @__PURE__ */ r("p", { className: "text-sm
|
|
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
|
-
|
|
150
|
+
a.quantity
|
|
151
151
|
] }),
|
|
152
|
-
/* @__PURE__ */ r("p", { className: "text-sm
|
|
152
|
+
/* @__PURE__ */ r("p", { className: "text-sm opacity-70", children: [
|
|
153
153
|
"SKU: ",
|
|
154
|
-
|
|
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:
|
|
160
|
-
/* @__PURE__ */ r("p", { className: "text-sm
|
|
161
|
-
|
|
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
|
-
] },
|
|
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-
|
|
169
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
168
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Subtotal" }),
|
|
169
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: l(t.subtotal) })
|
|
170
170
|
] }),
|
|
171
|
-
|
|
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
|
-
|
|
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-
|
|
180
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
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:
|
|
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
|
|
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",
|