@instockng/storefront-ui 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/OrderConfirmation.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/index10.mjs +3 -3
- package/dist/index100.mjs +33 -5
- package/dist/index101.mjs +31 -33
- package/dist/index102.mjs +26 -29
- package/dist/index103.mjs +59 -26
- package/dist/index104.mjs +3 -61
- package/dist/index105.mjs +2 -3
- package/dist/index106.mjs +2 -2
- package/dist/index107.mjs +17 -2
- package/dist/index108.mjs +11 -15
- package/dist/index109.mjs +6 -13
- package/dist/index11.mjs +2 -2
- package/dist/index110.mjs +30 -6
- package/dist/index13.mjs +1 -1
- package/dist/index17.mjs +2 -2
- package/dist/index18.mjs +12 -21
- package/dist/index20.mjs +4 -9
- package/dist/index21.mjs +1 -1
- package/dist/index28.mjs +11 -11
- package/dist/index29.mjs +1 -1
- package/dist/index30.mjs +1 -1
- package/dist/index31.mjs +1 -1
- package/dist/index32.mjs +1 -1
- package/dist/index33.mjs +1433 -4
- package/dist/index34.mjs +2 -1433
- package/dist/index35.mjs +57 -2
- package/dist/index36.mjs +48 -54
- package/dist/index37.mjs +33 -51
- package/dist/index38.mjs +15 -33
- package/dist/index39.mjs +2260 -12
- package/dist/index4.mjs +37 -37
- package/dist/index40.mjs +36 -2263
- package/dist/index41.mjs +44 -36
- package/dist/index42.mjs +99 -44
- package/dist/index43.mjs +97 -99
- package/dist/index44.mjs +47 -78
- package/dist/index45.mjs +54 -53
- package/dist/index46.mjs +63 -55
- package/dist/index47.mjs +56 -79
- package/dist/index48.mjs +57 -63
- package/dist/index49.mjs +15 -70
- package/dist/index50.mjs +14 -14
- package/dist/index51.mjs +59 -13
- package/dist/index52.mjs +99 -36
- package/dist/index53.mjs +97 -97
- package/dist/index54.mjs +4 -132
- package/dist/index58.mjs +2 -2
- package/dist/index59.mjs +234 -3
- package/dist/index60.mjs +6 -2
- package/dist/index61.mjs +133 -4
- package/dist/index62.mjs +64 -30
- package/dist/index63.mjs +84 -40
- package/dist/index64.mjs +23 -229
- package/dist/index65.mjs +8 -5
- package/dist/index66.mjs +66 -125
- package/dist/index67.mjs +3 -67
- package/dist/index68.mjs +2 -87
- package/dist/index69.mjs +78 -24
- package/dist/index70.mjs +52 -7
- package/dist/index71.mjs +5 -74
- package/dist/index72.mjs +4 -3
- package/dist/index73.mjs +179 -2
- package/dist/index74.mjs +49 -79
- package/dist/index75.mjs +68 -53
- package/dist/index76.mjs +34 -6
- package/dist/index77.mjs +42 -4
- package/dist/index78.mjs +3 -178
- package/dist/index79.mjs +2 -53
- package/dist/index80.mjs +21 -69
- package/dist/index81.mjs +54 -19
- package/dist/index82.mjs +28 -55
- package/dist/index83.mjs +5 -27
- package/dist/index84.mjs +51 -6
- package/dist/index85.mjs +5 -51
- package/dist/index86.mjs +12 -6
- package/dist/index87.mjs +7 -12
- package/dist/index88.mjs +27 -6
- package/dist/index89.mjs +2 -28
- package/dist/index90.mjs +70 -2
- package/dist/index91.mjs +164 -67
- package/dist/index92.mjs +28 -164
- package/dist/index93.mjs +10 -30
- package/dist/index94.mjs +3 -10
- package/dist/index95.mjs +3 -3
- package/dist/index96.mjs +13 -4
- package/dist/index97.mjs +7 -13
- package/dist/index98.mjs +12 -7
- package/dist/index99.mjs +4 -11
- package/dist/styles.css +1 -1
- package/package.json +11 -11
- package/src/components/OrderConfirmation.tsx +6 -1
- package/dist/index111.mjs +0 -33
- package/dist/test-utils/MockCartProvider.d.ts +0 -21
- package/dist/test-utils/MockCartProvider.d.ts.map +0 -1
package/dist/index45.mjs
CHANGED
|
@@ -1,79 +1,80 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useQueryUnwrapped as
|
|
4
|
-
import { createAdminRpcClients as
|
|
5
|
-
import { queryKeys as
|
|
2
|
+
import { useQueryClient as p, useMutation as y } from "@tanstack/react-query";
|
|
3
|
+
import { useQueryUnwrapped as m } from "./index54.mjs";
|
|
4
|
+
import { createAdminRpcClients as a, authHeaders as c } from "./index21.mjs";
|
|
5
|
+
import { queryKeys as i } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as d } from "./index19.mjs";
|
|
7
|
-
function
|
|
8
|
-
const { baseURL:
|
|
9
|
-
return
|
|
10
|
-
queryKey:
|
|
7
|
+
function F(t, n) {
|
|
8
|
+
const { baseURL: r, authToken: s } = d();
|
|
9
|
+
return m({
|
|
10
|
+
queryKey: i.admin.products.list(t),
|
|
11
11
|
queryFn: async () => {
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
|
|
12
|
+
const e = await a(r).products.index.$get(t ? { query: { brandId: t } } : {}, c(s));
|
|
13
|
+
if (!e.ok)
|
|
14
|
+
throw new Error(`Failed to fetch products: ${e.statusText}`);
|
|
15
|
+
return e.json();
|
|
15
16
|
},
|
|
16
|
-
...
|
|
17
|
+
...n
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function T(t, n) {
|
|
20
21
|
const { baseURL: r, authToken: s } = d();
|
|
21
|
-
return
|
|
22
|
-
queryKey:
|
|
22
|
+
return m({
|
|
23
|
+
queryKey: i.admin.products.detail(t),
|
|
23
24
|
queryFn: async () => {
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
|
|
25
|
+
const e = await a(r).products[":id"].$get({ param: { id: t } }, c(s));
|
|
26
|
+
if (!e.ok)
|
|
27
|
+
throw new Error(`Failed to fetch product: ${e.statusText}`);
|
|
28
|
+
return e.json();
|
|
27
29
|
},
|
|
28
|
-
...
|
|
30
|
+
...n
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
const { baseURL:
|
|
33
|
-
return
|
|
34
|
-
mutationFn: async (
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onSuccess: () => {
|
|
40
|
-
s.invalidateQueries({ queryKey: o.admin.brands.all });
|
|
33
|
+
function $(t) {
|
|
34
|
+
const { baseURL: n, authToken: r } = d(), s = p();
|
|
35
|
+
return y({
|
|
36
|
+
mutationFn: async (o) => {
|
|
37
|
+
const u = await a(n).products.index.$post({ json: o }, c(r));
|
|
38
|
+
if (!u.ok)
|
|
39
|
+
throw new Error(`Failed to create product: ${u.statusText}`);
|
|
40
|
+
return u.json();
|
|
41
41
|
},
|
|
42
|
-
|
|
42
|
+
onSuccess: () => s.invalidateQueries({ queryKey: i.admin.products.all }),
|
|
43
|
+
...t
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
const { baseURL: r, authToken: s } = d(),
|
|
47
|
-
return
|
|
48
|
-
mutationFn: async (
|
|
49
|
-
const l = await
|
|
50
|
-
if (!l.ok)
|
|
46
|
+
function x(t, n) {
|
|
47
|
+
const { baseURL: r, authToken: s } = d(), o = p();
|
|
48
|
+
return y({
|
|
49
|
+
mutationFn: async (e) => {
|
|
50
|
+
const l = await a(r).products[":id"].$patch({ param: { id: t }, json: e }, c(s));
|
|
51
|
+
if (!l.ok)
|
|
52
|
+
throw new Error(`Failed to update product: ${l.statusText}`);
|
|
51
53
|
return l.json();
|
|
52
54
|
},
|
|
53
55
|
onSuccess: () => {
|
|
54
|
-
|
|
56
|
+
o.invalidateQueries({ queryKey: i.admin.products.detail(t) }), o.invalidateQueries({ queryKey: i.admin.products.all });
|
|
55
57
|
},
|
|
56
|
-
...
|
|
58
|
+
...n
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
|
-
function
|
|
60
|
-
const { baseURL: r, authToken: s } = d(),
|
|
61
|
-
return
|
|
61
|
+
function j(t, n) {
|
|
62
|
+
const { baseURL: r, authToken: s } = d(), o = p();
|
|
63
|
+
return y({
|
|
62
64
|
mutationFn: async () => {
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
65
|
-
|
|
65
|
+
const u = await a(r).products[":id"].$delete({ param: { id: t } }, c(s));
|
|
66
|
+
if (!u.ok)
|
|
67
|
+
throw new Error(`Failed to delete product: ${u.statusText}`);
|
|
68
|
+
return u.json();
|
|
66
69
|
},
|
|
67
|
-
onSuccess: () => {
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
...t
|
|
70
|
+
onSuccess: () => o.invalidateQueries({ queryKey: i.admin.products.all }),
|
|
71
|
+
...n
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
$ as useCreateProduct,
|
|
76
|
+
j as useDeleteProduct,
|
|
77
|
+
T as useGetProduct,
|
|
78
|
+
F as useListProducts,
|
|
79
|
+
x as useUpdateProduct
|
|
79
80
|
};
|
package/dist/index46.mjs
CHANGED
|
@@ -1,90 +1,98 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useQueryUnwrapped as m } from "./
|
|
4
|
-
import { createAdminRpcClients as
|
|
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 c } from "./index21.mjs";
|
|
5
5
|
import { queryKeys as i } from "./index26.mjs";
|
|
6
6
|
import { useApiConfig as d } from "./index19.mjs";
|
|
7
|
-
function
|
|
8
|
-
const { baseURL:
|
|
7
|
+
function k(t, n) {
|
|
8
|
+
const { baseURL: a, authToken: r } = d();
|
|
9
9
|
return m({
|
|
10
|
-
queryKey: i.admin.
|
|
10
|
+
queryKey: i.admin.variants.search(t),
|
|
11
11
|
queryFn: async () => {
|
|
12
|
-
const e = await a
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
16
|
-
if (!e.ok) throw new Error(`Failed to fetch products: ${e.statusText}`);
|
|
12
|
+
const e = await u(a).variants.index.$get({ query: t }, c(r));
|
|
13
|
+
if (!e.ok)
|
|
14
|
+
throw new Error(`Failed to search variants: ${e.statusText}`);
|
|
17
15
|
return e.json();
|
|
18
16
|
},
|
|
19
17
|
...n
|
|
20
18
|
});
|
|
21
19
|
}
|
|
22
|
-
function
|
|
23
|
-
const { baseURL:
|
|
20
|
+
function F(t, n) {
|
|
21
|
+
const { baseURL: a, authToken: r } = d();
|
|
24
22
|
return m({
|
|
25
|
-
queryKey: i.admin.
|
|
23
|
+
queryKey: i.admin.variants.byProduct(t),
|
|
26
24
|
queryFn: async () => {
|
|
27
|
-
const e = await a
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
31
|
-
if (!e.ok) throw new Error(`Failed to fetch product: ${e.statusText}`);
|
|
25
|
+
const e = await u(a).variants.products[":productId"].variants.$get({ param: { productId: t } }, c(r));
|
|
26
|
+
if (!e.ok)
|
|
27
|
+
throw new Error(`Failed to fetch product variants: ${e.statusText}`);
|
|
32
28
|
return e.json();
|
|
33
29
|
},
|
|
34
30
|
...n
|
|
35
31
|
});
|
|
36
32
|
}
|
|
37
|
-
function
|
|
38
|
-
const { baseURL:
|
|
39
|
-
return
|
|
40
|
-
mutationFn: async (
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
);
|
|
45
|
-
if (!u.ok) throw new Error(`Failed to create product: ${u.statusText}`);
|
|
46
|
-
return u.json();
|
|
33
|
+
function T(t, n) {
|
|
34
|
+
const { baseURL: a, authToken: r } = d(), s = y();
|
|
35
|
+
return v({
|
|
36
|
+
mutationFn: async (e) => {
|
|
37
|
+
const o = await u(a).variants.products[":productId"].variants.$post({ json: e, param: { productId: t } }, c(r));
|
|
38
|
+
if (!o.ok)
|
|
39
|
+
throw new Error(`Failed to create variant: ${o.statusText}`);
|
|
40
|
+
return o.json();
|
|
47
41
|
},
|
|
48
|
-
onSuccess: () =>
|
|
49
|
-
|
|
42
|
+
onSuccess: () => {
|
|
43
|
+
s.invalidateQueries({ queryKey: i.admin.variants.all }), s.invalidateQueries({ queryKey: i.admin.products.detail(t) });
|
|
44
|
+
},
|
|
45
|
+
...n
|
|
50
46
|
});
|
|
51
47
|
}
|
|
52
|
-
function
|
|
53
|
-
const { baseURL:
|
|
54
|
-
return
|
|
48
|
+
function $(t, n) {
|
|
49
|
+
const { baseURL: a, authToken: r } = d(), s = y();
|
|
50
|
+
return v({
|
|
55
51
|
mutationFn: async (e) => {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
);
|
|
60
|
-
if (!l.ok) throw new Error(`Failed to update product: ${l.statusText}`);
|
|
61
|
-
return l.json();
|
|
52
|
+
const o = await u(a).variants[":id"].$patch({ json: e, param: { id: t } }, c(r));
|
|
53
|
+
if (!o.ok)
|
|
54
|
+
throw new Error(`Failed to update variant: ${o.statusText}`);
|
|
55
|
+
return o.json();
|
|
62
56
|
},
|
|
63
57
|
onSuccess: () => {
|
|
64
|
-
|
|
58
|
+
s.invalidateQueries({ queryKey: i.admin.variants.detail(t) }), s.invalidateQueries({ queryKey: i.admin.variants.all });
|
|
59
|
+
},
|
|
60
|
+
...n
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function K(t, n) {
|
|
64
|
+
const { baseURL: a, authToken: r } = d();
|
|
65
|
+
return m({
|
|
66
|
+
queryKey: i.admin.variants.inventory(t),
|
|
67
|
+
queryFn: async () => {
|
|
68
|
+
const e = await u(a).variants[":id"].inventory.$get({ param: { id: t } }, c(r));
|
|
69
|
+
if (!e.ok)
|
|
70
|
+
throw new Error(`Failed to fetch variant inventory: ${e.statusText}`);
|
|
71
|
+
return e.json();
|
|
65
72
|
},
|
|
66
73
|
...n
|
|
67
74
|
});
|
|
68
75
|
}
|
|
69
76
|
function j(t, n) {
|
|
70
|
-
const { baseURL:
|
|
71
|
-
return
|
|
77
|
+
const { baseURL: a, authToken: r } = d(), s = y();
|
|
78
|
+
return v({
|
|
72
79
|
mutationFn: async () => {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
const l = await u(a).variants[":id"].$delete({ param: { id: t } }, c(r));
|
|
81
|
+
if (!l.ok)
|
|
82
|
+
throw new Error(`Failed to delete variant: ${l.statusText}`);
|
|
83
|
+
return l.json();
|
|
84
|
+
},
|
|
85
|
+
onSuccess: () => {
|
|
86
|
+
s.invalidateQueries({ queryKey: i.admin.variants.all });
|
|
79
87
|
},
|
|
80
|
-
onSuccess: () => o.invalidateQueries({ queryKey: i.admin.products.all }),
|
|
81
88
|
...n
|
|
82
89
|
});
|
|
83
90
|
}
|
|
84
91
|
export {
|
|
85
|
-
|
|
86
|
-
j as
|
|
87
|
-
|
|
88
|
-
F as
|
|
89
|
-
|
|
92
|
+
T as useCreateVariant,
|
|
93
|
+
j as useDeleteVariant,
|
|
94
|
+
K as useGetVariantInventory,
|
|
95
|
+
F as useListProductVariants,
|
|
96
|
+
k as useSearchVariants,
|
|
97
|
+
$ as useUpdateVariant
|
|
90
98
|
};
|
package/dist/index47.mjs
CHANGED
|
@@ -1,107 +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:
|
|
9
|
-
return
|
|
10
|
-
queryKey:
|
|
2
|
+
import { useQueryClient as w, useMutation as y } from "@tanstack/react-query";
|
|
3
|
+
import { useQueryUnwrapped as d } from "./index54.mjs";
|
|
4
|
+
import { createAdminRpcClients as i, authHeaders as c } from "./index21.mjs";
|
|
5
|
+
import { queryKeys as u } from "./index26.mjs";
|
|
6
|
+
import { useApiConfig as l } from "./index19.mjs";
|
|
7
|
+
function F(e) {
|
|
8
|
+
const { baseURL: s, authToken: n } = l();
|
|
9
|
+
return d({
|
|
10
|
+
queryKey: u.admin.warehouses.list(),
|
|
11
11
|
queryFn: async () => {
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
|
|
12
|
+
const t = await i(s).warehouses.index.$get({}, c(n));
|
|
13
|
+
if (!t.ok)
|
|
14
|
+
throw new Error(`Failed to fetch warehouses: ${t.statusText}`);
|
|
15
|
+
return t.json();
|
|
15
16
|
},
|
|
16
|
-
...
|
|
17
|
+
...e
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const { baseURL:
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
c(r)
|
|
27
|
-
);
|
|
28
|
-
if (!e.ok) throw new Error(`Failed to fetch product variants: ${e.statusText}`);
|
|
29
|
-
return e.json();
|
|
30
|
-
},
|
|
31
|
-
...n
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function T(t, n) {
|
|
35
|
-
const { baseURL: a, authToken: r } = d(), s = y();
|
|
36
|
-
return v({
|
|
37
|
-
mutationFn: async (e) => {
|
|
38
|
-
const o = await u(a).variants.products[":productId"].variants.$post(
|
|
39
|
-
{ json: e, param: { productId: t } },
|
|
40
|
-
c(r)
|
|
41
|
-
);
|
|
42
|
-
if (!o.ok) throw new Error(`Failed to create variant: ${o.statusText}`);
|
|
20
|
+
function T(e) {
|
|
21
|
+
const { baseURL: s, authToken: n } = l(), r = w();
|
|
22
|
+
return y({
|
|
23
|
+
mutationFn: async (t) => {
|
|
24
|
+
const o = await i(s).warehouses.index.$post({ json: t }, c(n));
|
|
25
|
+
if (!o.ok)
|
|
26
|
+
throw new Error(`Failed to create warehouse: ${o.statusText}`);
|
|
43
27
|
return o.json();
|
|
44
28
|
},
|
|
45
29
|
onSuccess: () => {
|
|
46
|
-
|
|
30
|
+
r.invalidateQueries({ queryKey: u.admin.warehouses.all });
|
|
47
31
|
},
|
|
48
|
-
...
|
|
32
|
+
...e
|
|
49
33
|
});
|
|
50
34
|
}
|
|
51
|
-
function $(
|
|
52
|
-
const { baseURL:
|
|
53
|
-
return
|
|
54
|
-
mutationFn: async (
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
59
|
-
if (!o.ok) throw new Error(`Failed to update variant: ${o.statusText}`);
|
|
60
|
-
return o.json();
|
|
35
|
+
function $(e, s) {
|
|
36
|
+
const { baseURL: n, authToken: r } = l(), t = w();
|
|
37
|
+
return y({
|
|
38
|
+
mutationFn: async (a) => {
|
|
39
|
+
const h = await i(n).warehouses[":id"].$patch({ json: a, param: { id: e } }, c(r));
|
|
40
|
+
if (!h.ok)
|
|
41
|
+
throw new Error(`Failed to update warehouse: ${h.statusText}`);
|
|
42
|
+
return h.json();
|
|
61
43
|
},
|
|
62
44
|
onSuccess: () => {
|
|
63
|
-
|
|
45
|
+
t.invalidateQueries({ queryKey: u.admin.warehouses.detail(e) }), t.invalidateQueries({ queryKey: u.admin.warehouses.all });
|
|
64
46
|
},
|
|
65
|
-
...
|
|
47
|
+
...s
|
|
66
48
|
});
|
|
67
49
|
}
|
|
68
|
-
function
|
|
69
|
-
const { baseURL:
|
|
70
|
-
return
|
|
71
|
-
queryKey:
|
|
50
|
+
function v(e, s) {
|
|
51
|
+
const { baseURL: n, authToken: r } = l();
|
|
52
|
+
return d({
|
|
53
|
+
queryKey: u.admin.warehouses.inventory(e),
|
|
72
54
|
queryFn: async () => {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
);
|
|
77
|
-
if (!e.ok) throw new Error(`Failed to fetch variant inventory: ${e.statusText}`);
|
|
78
|
-
return e.json();
|
|
55
|
+
const a = await i(n).warehouses[":id"].inventory.$get({ param: { id: e } }, c(r));
|
|
56
|
+
if (!a.ok)
|
|
57
|
+
throw new Error(`Failed to fetch warehouse inventory: ${a.statusText}`);
|
|
58
|
+
return a.json();
|
|
79
59
|
},
|
|
80
|
-
...
|
|
60
|
+
...s
|
|
81
61
|
});
|
|
82
62
|
}
|
|
83
|
-
function
|
|
84
|
-
const { baseURL:
|
|
85
|
-
return
|
|
63
|
+
function x(e, s) {
|
|
64
|
+
const { baseURL: n, authToken: r } = l(), t = w();
|
|
65
|
+
return y({
|
|
86
66
|
mutationFn: async () => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
);
|
|
91
|
-
if (!l.ok) throw new Error(`Failed to delete variant: ${l.statusText}`);
|
|
92
|
-
return l.json();
|
|
67
|
+
const o = await i(n).warehouses[":id"].$delete({ param: { id: e } }, c(r));
|
|
68
|
+
if (!o.ok)
|
|
69
|
+
throw new Error(`Failed to delete warehouse: ${o.statusText}`);
|
|
70
|
+
return o.json();
|
|
93
71
|
},
|
|
94
72
|
onSuccess: () => {
|
|
95
|
-
|
|
73
|
+
t.invalidateQueries({ queryKey: u.admin.warehouses.all });
|
|
96
74
|
},
|
|
97
|
-
...
|
|
75
|
+
...s
|
|
98
76
|
});
|
|
99
77
|
}
|
|
100
78
|
export {
|
|
101
|
-
T as
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
F as
|
|
105
|
-
|
|
106
|
-
$ as useUpdateVariant
|
|
79
|
+
T as useCreateWarehouse,
|
|
80
|
+
x as useDeleteWarehouse,
|
|
81
|
+
v as useGetWarehouseInventory,
|
|
82
|
+
F as useListWarehouses,
|
|
83
|
+
$ as useUpdateWarehouse
|
|
107
84
|
};
|
package/dist/index48.mjs
CHANGED
|
@@ -1,88 +1,82 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { useQueryUnwrapped as
|
|
4
|
-
import { createAdminRpcClients as
|
|
5
|
-
import { queryKeys as
|
|
6
|
-
import { useApiConfig as
|
|
7
|
-
function
|
|
8
|
-
const { baseURL:
|
|
9
|
-
return
|
|
10
|
-
queryKey:
|
|
2
|
+
import { useQueryClient as d, useMutation as v } from "@tanstack/react-query";
|
|
3
|
+
import { useQueryUnwrapped as l } from "./index54.mjs";
|
|
4
|
+
import { createAdminRpcClients as u, authHeaders as c } from "./index21.mjs";
|
|
5
|
+
import { queryKeys as s } from "./index26.mjs";
|
|
6
|
+
import { useApiConfig as y } from "./index19.mjs";
|
|
7
|
+
function m(n, r) {
|
|
8
|
+
const { baseURL: o, authToken: t } = y();
|
|
9
|
+
return l({
|
|
10
|
+
queryKey: s.admin.inventory.list(n),
|
|
11
11
|
queryFn: async () => {
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
|
|
12
|
+
const e = await u(o).inventory.index.$get({ query: n }, c(t));
|
|
13
|
+
if (!e.ok)
|
|
14
|
+
throw new Error(`Failed to fetch inventory: ${e.statusText}`);
|
|
15
|
+
return e.json();
|
|
15
16
|
},
|
|
16
|
-
...
|
|
17
|
+
...r
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
function T(
|
|
20
|
-
const { baseURL:
|
|
21
|
-
return
|
|
22
|
-
mutationFn: async (
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
|
|
20
|
+
function T(n) {
|
|
21
|
+
const { baseURL: r, authToken: o } = y(), t = d();
|
|
22
|
+
return v({
|
|
23
|
+
mutationFn: async (a) => {
|
|
24
|
+
const i = await u(r).inventory.adjust.$post({ json: a }, c(o));
|
|
25
|
+
if (!i.ok)
|
|
26
|
+
throw new Error(`Failed to adjust inventory: ${i.statusText}`);
|
|
27
|
+
return i.json();
|
|
26
28
|
},
|
|
27
29
|
onSuccess: () => {
|
|
28
|
-
|
|
30
|
+
t.invalidateQueries({ queryKey: s.admin.inventory.all }), t.invalidateQueries({ queryKey: s.admin.variants.all }), t.invalidateQueries({ queryKey: s.admin.warehouses.all });
|
|
29
31
|
},
|
|
30
|
-
...
|
|
32
|
+
...n
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
const { baseURL:
|
|
35
|
-
return
|
|
35
|
+
function j(n) {
|
|
36
|
+
const { baseURL: r, authToken: o } = y(), t = d();
|
|
37
|
+
return v({
|
|
36
38
|
mutationFn: async (a) => {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
);
|
|
41
|
-
if (!h.ok) throw new Error(`Failed to update warehouse: ${h.statusText}`);
|
|
42
|
-
return h.json();
|
|
39
|
+
const i = await u(r).inventory.transfer.$post({ json: a }, c(o));
|
|
40
|
+
if (!i.ok)
|
|
41
|
+
throw new Error(`Failed to transfer inventory: ${i.statusText}`);
|
|
42
|
+
return i.json();
|
|
43
43
|
},
|
|
44
44
|
onSuccess: () => {
|
|
45
|
-
t.invalidateQueries({ queryKey:
|
|
45
|
+
t.invalidateQueries({ queryKey: s.admin.inventory.all }), t.invalidateQueries({ queryKey: s.admin.warehouses.all });
|
|
46
46
|
},
|
|
47
|
-
...
|
|
47
|
+
...n
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const { baseURL:
|
|
52
|
-
return
|
|
53
|
-
queryKey:
|
|
50
|
+
function F(n, r) {
|
|
51
|
+
const { baseURL: o, authToken: t } = y();
|
|
52
|
+
return l({
|
|
53
|
+
queryKey: s.admin.inventory.transactions(n),
|
|
54
54
|
queryFn: async () => {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
59
|
-
if (!a.ok) throw new Error(`Failed to fetch warehouse inventory: ${a.statusText}`);
|
|
60
|
-
return a.json();
|
|
55
|
+
const e = await u(o).inventory.transactions.$get({ query: n }, c(t));
|
|
56
|
+
if (!e.ok)
|
|
57
|
+
throw new Error(`Failed to fetch inventory transactions: ${e.statusText}`);
|
|
58
|
+
return e.json();
|
|
61
59
|
},
|
|
62
|
-
...
|
|
60
|
+
...r
|
|
63
61
|
});
|
|
64
62
|
}
|
|
65
|
-
function
|
|
66
|
-
const { baseURL:
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return o.json();
|
|
75
|
-
},
|
|
76
|
-
onSuccess: () => {
|
|
77
|
-
t.invalidateQueries({ queryKey: u.admin.warehouses.all });
|
|
63
|
+
function $(n, r) {
|
|
64
|
+
const { baseURL: o, authToken: t } = y();
|
|
65
|
+
return l({
|
|
66
|
+
queryKey: s.admin.inventory.lowStock(n == null ? void 0 : n.brandId),
|
|
67
|
+
queryFn: async () => {
|
|
68
|
+
const e = await u(o).inventory["low-stock"].$get({ query: n }, c(t));
|
|
69
|
+
if (!e.ok)
|
|
70
|
+
throw new Error(`Failed to fetch low stock alerts: ${e.statusText}`);
|
|
71
|
+
return e.json();
|
|
78
72
|
},
|
|
79
|
-
...
|
|
73
|
+
...r
|
|
80
74
|
});
|
|
81
75
|
}
|
|
82
76
|
export {
|
|
83
|
-
T as
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
T as useAdjustInventory,
|
|
78
|
+
F as useGetInventoryTransactions,
|
|
79
|
+
$ as useGetLowStockVariants,
|
|
80
|
+
m as useListInventory,
|
|
81
|
+
j as useTransferInventory
|
|
88
82
|
};
|