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