@instockng/storefront-ui 1.0.16 → 1.0.18
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/ui/button.d.ts +1 -1
- package/dist/index100.mjs +1 -1
- package/dist/index101.mjs +3 -3
- package/dist/index102.mjs +3 -3
- package/dist/index110.mjs +1 -1
- 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 +3 -3
- package/dist/index36.mjs +1 -1
- package/dist/index40.mjs +36 -23
- 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/index55.mjs +21 -73
- package/dist/index56.mjs +74 -14
- package/dist/index57.mjs +14 -62
- package/dist/index58.mjs +62 -4
- package/dist/index59.mjs +34 -4
- package/dist/index60.mjs +43 -2
- package/dist/index61.mjs +231 -30
- package/dist/index62.mjs +5 -42
- package/dist/index63.mjs +127 -228
- package/dist/index64.mjs +66 -4
- package/dist/index65.mjs +77 -124
- package/dist/index66.mjs +26 -65
- package/dist/index67.mjs +6 -84
- package/dist/index68.mjs +72 -26
- package/dist/index69.mjs +3 -8
- package/dist/index70.mjs +2 -75
- package/dist/index71.mjs +82 -3
- package/dist/index72.mjs +54 -2
- package/dist/index73.mjs +5 -82
- package/dist/index74.mjs +4 -53
- package/dist/index75.mjs +178 -5
- package/dist/index76.mjs +53 -5
- package/dist/index77.mjs +68 -178
- package/dist/index78.mjs +4 -53
- package/dist/index79.mjs +2 -69
- package/dist/index80.mjs +1 -1
- package/dist/index81.mjs +1 -1
- package/dist/index82.mjs +5 -5
- package/dist/index84.mjs +2 -2
- package/dist/index86.mjs +2 -2
- package/dist/index88.mjs +1 -1
- package/dist/index90.mjs +4 -4
- package/dist/index91.mjs +3 -3
- package/dist/index92.mjs +1 -1
- package/dist/index93.mjs +3 -3
- package/dist/index98.mjs +1 -1
- package/dist/styles.css +1 -1
- package/package.json +15 -10
- package/dist/test-utils/MockCartProvider.d.ts +0 -21
- package/dist/test-utils/MockCartProvider.d.ts.map +0 -1
package/dist/index52.mjs
CHANGED
|
@@ -1,65 +1,128 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as l, useMutation as y } from "@tanstack/react-query";
|
|
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:
|
|
3
|
+
import { useQueryUnwrapped as C } from "./index54.mjs";
|
|
4
|
+
import { createAdminRpcClients as c, authHeaders as a } from "./index21.mjs";
|
|
5
|
+
import { queryKeys as r } from "./index26.mjs";
|
|
6
|
+
import { useApiConfig as d } from "./index19.mjs";
|
|
7
|
+
function p(e, n) {
|
|
8
|
+
const { baseURL: s, authToken: i } = d();
|
|
9
|
+
return C({
|
|
10
|
+
queryKey: r.admin.discountCodes.list(e),
|
|
11
11
|
queryFn: async () => {
|
|
12
|
-
const t = await s
|
|
13
|
-
if (!t.ok)
|
|
12
|
+
const t = await c(s).discountCodes.index.$get({ query: e }, a(i));
|
|
13
|
+
if (!t.ok)
|
|
14
|
+
throw new Error(`Failed to fetch discount codes: ${t.statusText}`);
|
|
14
15
|
return t.json();
|
|
15
16
|
},
|
|
16
17
|
...n
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const { baseURL:
|
|
21
|
-
return
|
|
22
|
-
queryKey:
|
|
20
|
+
function F(e, n) {
|
|
21
|
+
const { baseURL: s, authToken: i } = d();
|
|
22
|
+
return C({
|
|
23
|
+
queryKey: r.admin.discountCodes.detail(e),
|
|
23
24
|
queryFn: async () => {
|
|
24
|
-
const t = await s
|
|
25
|
-
if (!t.ok)
|
|
25
|
+
const t = await c(s).discountCodes[":id"].$get({ param: { id: e } }, a(i));
|
|
26
|
+
if (!t.ok)
|
|
27
|
+
throw new Error(`Failed to fetch discount code: ${t.statusText}`);
|
|
26
28
|
return t.json();
|
|
27
29
|
},
|
|
28
30
|
...n
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
const { baseURL:
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
function T(e) {
|
|
34
|
+
const { baseURL: n, authToken: s } = d(), i = l();
|
|
35
|
+
return y({
|
|
36
|
+
mutationFn: async (o) => {
|
|
37
|
+
const u = await c(n).discountCodes.index.$post({ json: o }, a(s));
|
|
38
|
+
if (!u.ok)
|
|
39
|
+
throw new Error(`Failed to create discount code: ${u.statusText}`);
|
|
40
|
+
return u.json();
|
|
41
|
+
},
|
|
42
|
+
onSuccess: () => {
|
|
43
|
+
i.invalidateQueries({ queryKey: r.admin.discountCodes.all });
|
|
44
|
+
},
|
|
45
|
+
...e
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function $(e, n) {
|
|
49
|
+
const { baseURL: s, authToken: i } = d(), o = l();
|
|
50
|
+
return y({
|
|
51
|
+
mutationFn: async (t) => {
|
|
52
|
+
const w = await c(s).discountCodes[":id"].$patch({ json: t, param: { id: e } }, a(i));
|
|
53
|
+
if (!w.ok)
|
|
54
|
+
throw new Error(`Failed to update discount code: ${w.statusText}`);
|
|
55
|
+
return w.json();
|
|
56
|
+
},
|
|
57
|
+
onSuccess: () => {
|
|
58
|
+
o.invalidateQueries({ queryKey: r.admin.discountCodes.detail(e) }), o.invalidateQueries({ queryKey: r.admin.discountCodes.all });
|
|
42
59
|
},
|
|
43
60
|
...n
|
|
44
61
|
});
|
|
45
62
|
}
|
|
46
|
-
function
|
|
47
|
-
const { baseURL:
|
|
63
|
+
function v(e, n) {
|
|
64
|
+
const { baseURL: s, authToken: i } = d(), o = l();
|
|
48
65
|
return y({
|
|
49
66
|
mutationFn: async () => {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
67
|
+
const u = await c(s).discountCodes[":id"].$delete({ param: { id: e } }, a(i));
|
|
68
|
+
if (!u.ok)
|
|
69
|
+
throw new Error(`Failed to delete discount code: ${u.statusText}`);
|
|
70
|
+
return u.json();
|
|
71
|
+
},
|
|
72
|
+
onSuccess: () => {
|
|
73
|
+
o.invalidateQueries({ queryKey: r.admin.discountCodes.all });
|
|
74
|
+
},
|
|
75
|
+
...n
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function j(e, n) {
|
|
79
|
+
const { baseURL: s, authToken: i } = d();
|
|
80
|
+
return C({
|
|
81
|
+
queryKey: r.admin.discountCodes.analytics(e),
|
|
82
|
+
queryFn: async () => {
|
|
83
|
+
const t = await c(s).discountCodes[":id"].analytics.$get({ param: { id: e } }, a(i));
|
|
84
|
+
if (!t.ok)
|
|
85
|
+
throw new Error(`Failed to fetch discount code analytics: ${t.statusText}`);
|
|
52
86
|
return t.json();
|
|
53
87
|
},
|
|
88
|
+
...n
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function x(e) {
|
|
92
|
+
const { baseURL: n, authToken: s } = d(), i = l();
|
|
93
|
+
return y({
|
|
94
|
+
mutationFn: async (o) => {
|
|
95
|
+
const u = await c(n).discountCodes["bulk-generate"].$post({ json: o }, a(s));
|
|
96
|
+
if (!u.ok)
|
|
97
|
+
throw new Error(`Failed to bulk generate discount codes: ${u.statusText}`);
|
|
98
|
+
return u.json();
|
|
99
|
+
},
|
|
54
100
|
onSuccess: () => {
|
|
55
|
-
|
|
101
|
+
i.invalidateQueries({ queryKey: r.admin.discountCodes.all });
|
|
102
|
+
},
|
|
103
|
+
...e
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function b(e) {
|
|
107
|
+
const { baseURL: n, authToken: s } = d();
|
|
108
|
+
return C({
|
|
109
|
+
queryKey: r.admin.discountCodes.overviewStats(),
|
|
110
|
+
queryFn: async () => {
|
|
111
|
+
const o = await c(n).discountCodes.stats.overview.$get({}, a(s));
|
|
112
|
+
if (!o.ok)
|
|
113
|
+
throw new Error(`Failed to fetch discount code overview stats: ${o.statusText}`);
|
|
114
|
+
return o.json();
|
|
56
115
|
},
|
|
57
116
|
...e
|
|
58
117
|
});
|
|
59
118
|
}
|
|
60
119
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
120
|
+
x as useBulkGenerateDiscountCodes,
|
|
121
|
+
T as useCreateDiscountCode,
|
|
122
|
+
v as useDeleteDiscountCode,
|
|
123
|
+
F as useGetDiscountCode,
|
|
124
|
+
j as useGetDiscountCodeAnalytics,
|
|
125
|
+
b as useGetDiscountCodeOverviewStats,
|
|
126
|
+
p as useListDiscountCodes,
|
|
127
|
+
$ as useUpdateDiscountCode
|
|
65
128
|
};
|
package/dist/index53.mjs
CHANGED
|
@@ -1,132 +1,132 @@
|
|
|
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 p(
|
|
8
|
-
const { baseURL: s, authToken: i } =
|
|
9
|
-
return
|
|
10
|
-
queryKey:
|
|
2
|
+
import { useQueryClient as y, useMutation as v } from "@tanstack/react-query";
|
|
3
|
+
import { useQueryUnwrapped as m } from "./index54.mjs";
|
|
4
|
+
import { createAdminRpcClients as u, authHeaders as l } from "./index21.mjs";
|
|
5
|
+
import { queryKeys as o } from "./index26.mjs";
|
|
6
|
+
import { useApiConfig as c } from "./index19.mjs";
|
|
7
|
+
function p(t) {
|
|
8
|
+
const { baseURL: s, authToken: i } = c();
|
|
9
|
+
return m({
|
|
10
|
+
queryKey: o.admin.deliveryZones.states.list(),
|
|
11
11
|
queryFn: async () => {
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
|
|
12
|
+
const e = await u(s).deliveryZones.states.$get({}, l(i));
|
|
13
|
+
if (!e.ok)
|
|
14
|
+
throw new Error(`Failed to fetch states: ${e.statusText}`);
|
|
15
|
+
return e.json();
|
|
15
16
|
},
|
|
16
|
-
...
|
|
17
|
+
...t
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const { baseURL: s, authToken: i } =
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
);
|
|
28
|
-
if (!t.ok) throw new Error(`Failed to fetch discount code: ${t.statusText}`);
|
|
29
|
-
return t.json();
|
|
30
|
-
},
|
|
31
|
-
...n
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function T(e) {
|
|
35
|
-
const { baseURL: n, authToken: s } = d(), i = l();
|
|
36
|
-
return y({
|
|
37
|
-
mutationFn: async (o) => {
|
|
38
|
-
const u = await c(n).discountCodes.index.$post({ json: o }, a(s));
|
|
39
|
-
if (!u.ok) throw new Error(`Failed to create discount code: ${u.statusText}`);
|
|
40
|
-
return u.json();
|
|
20
|
+
function k(t) {
|
|
21
|
+
const { baseURL: s, authToken: i } = c(), r = y();
|
|
22
|
+
return v({
|
|
23
|
+
mutationFn: async (e) => {
|
|
24
|
+
const n = await u(s).deliveryZones.states.$post({ json: e }, l(i));
|
|
25
|
+
if (!n.ok)
|
|
26
|
+
throw new Error(`Failed to create state: ${n.statusText}`);
|
|
27
|
+
return n.json();
|
|
41
28
|
},
|
|
42
29
|
onSuccess: () => {
|
|
43
|
-
|
|
30
|
+
r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
|
|
44
31
|
},
|
|
45
|
-
...
|
|
32
|
+
...t
|
|
46
33
|
});
|
|
47
34
|
}
|
|
48
|
-
function
|
|
49
|
-
const { baseURL:
|
|
50
|
-
return
|
|
51
|
-
mutationFn: async (
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
);
|
|
56
|
-
if (!w.ok) throw new Error(`Failed to update discount code: ${w.statusText}`);
|
|
57
|
-
return w.json();
|
|
35
|
+
function F(t, s) {
|
|
36
|
+
const { baseURL: i, authToken: r } = c(), e = y();
|
|
37
|
+
return v({
|
|
38
|
+
mutationFn: async (a) => {
|
|
39
|
+
const d = await u(i).deliveryZones.states[":id"].$patch({ json: a, param: { id: t } }, l(r));
|
|
40
|
+
if (!d.ok)
|
|
41
|
+
throw new Error(`Failed to update state: ${d.statusText}`);
|
|
42
|
+
return d.json();
|
|
58
43
|
},
|
|
59
44
|
onSuccess: () => {
|
|
60
|
-
|
|
45
|
+
e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
|
|
61
46
|
},
|
|
62
|
-
...
|
|
47
|
+
...s
|
|
63
48
|
});
|
|
64
49
|
}
|
|
65
|
-
function
|
|
66
|
-
const { baseURL:
|
|
67
|
-
return
|
|
50
|
+
function T(t, s) {
|
|
51
|
+
const { baseURL: i, authToken: r } = c(), e = y();
|
|
52
|
+
return v({
|
|
68
53
|
mutationFn: async () => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
-
if (!u.ok) throw new Error(`Failed to delete discount code: ${u.statusText}`);
|
|
74
|
-
return u.json();
|
|
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();
|
|
75
58
|
},
|
|
76
59
|
onSuccess: () => {
|
|
77
|
-
o.invalidateQueries({ queryKey:
|
|
60
|
+
e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
|
|
78
61
|
},
|
|
79
|
-
...
|
|
62
|
+
...s
|
|
80
63
|
});
|
|
81
64
|
}
|
|
82
|
-
function
|
|
83
|
-
const { baseURL:
|
|
84
|
-
return
|
|
85
|
-
queryKey:
|
|
65
|
+
function $(t, s) {
|
|
66
|
+
const { baseURL: i, authToken: r } = c();
|
|
67
|
+
return m({
|
|
68
|
+
queryKey: o.admin.deliveryZones.zones.list(t),
|
|
86
69
|
queryFn: async () => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
a
|
|
90
|
-
);
|
|
91
|
-
if (!t.ok) throw new Error(`Failed to fetch discount code analytics: ${t.statusText}`);
|
|
92
|
-
return t.json();
|
|
70
|
+
const a = await u(i).deliveryZones.zones.$get({ query: t }, l(r));
|
|
71
|
+
if (!a.ok)
|
|
72
|
+
throw new Error(`Failed to fetch delivery zones: ${a.statusText}`);
|
|
73
|
+
return a.json();
|
|
93
74
|
},
|
|
94
|
-
...
|
|
75
|
+
...s
|
|
95
76
|
});
|
|
96
77
|
}
|
|
97
|
-
function
|
|
98
|
-
const { baseURL:
|
|
99
|
-
return
|
|
100
|
-
mutationFn: async (
|
|
101
|
-
const
|
|
102
|
-
if (!
|
|
103
|
-
|
|
78
|
+
function z(t) {
|
|
79
|
+
const { baseURL: s, authToken: i } = c(), r = y();
|
|
80
|
+
return v({
|
|
81
|
+
mutationFn: async (e) => {
|
|
82
|
+
const n = await u(s).deliveryZones.zones.$post({ json: e }, l(i));
|
|
83
|
+
if (!n.ok)
|
|
84
|
+
throw new Error(`Failed to create delivery zone: ${n.statusText}`);
|
|
85
|
+
return n.json();
|
|
104
86
|
},
|
|
105
87
|
onSuccess: () => {
|
|
106
|
-
|
|
88
|
+
r.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all }), r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
|
|
107
89
|
},
|
|
108
|
-
...
|
|
90
|
+
...t
|
|
109
91
|
});
|
|
110
92
|
}
|
|
111
|
-
function
|
|
112
|
-
const { baseURL:
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return
|
|
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({
|
|
111
|
+
mutationFn: async () => {
|
|
112
|
+
const n = await u(i).deliveryZones.zones[":id"].$delete({ param: { id: t } }, l(r));
|
|
113
|
+
if (!n.ok)
|
|
114
|
+
throw new Error(`Failed to delete delivery zone: ${n.statusText}`);
|
|
115
|
+
return n.json();
|
|
116
|
+
},
|
|
117
|
+
onSuccess: () => {
|
|
118
|
+
e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
|
|
119
119
|
},
|
|
120
|
-
...
|
|
120
|
+
...s
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
z as useCreateDeliveryZone,
|
|
125
|
+
k as useCreateState,
|
|
126
|
+
j as useDeleteDeliveryZone,
|
|
127
|
+
T as useDeleteState,
|
|
128
|
+
$ as useListDeliveryZones,
|
|
129
|
+
p as useListStates,
|
|
130
|
+
K as useUpdateDeliveryZone,
|
|
131
|
+
F as useUpdateState
|
|
132
132
|
};
|
package/dist/index54.mjs
CHANGED
|
@@ -1,136 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { queryKeys as o } from "./index26.mjs";
|
|
6
|
-
import { useApiConfig as c } from "./index19.mjs";
|
|
7
|
-
function p(t) {
|
|
8
|
-
const { baseURL: s, authToken: i } = c();
|
|
9
|
-
return m({
|
|
10
|
-
queryKey: o.admin.deliveryZones.states.list(),
|
|
11
|
-
queryFn: async () => {
|
|
12
|
-
const e = await u(s).deliveryZones.states.$get({}, l(i));
|
|
13
|
-
if (!e.ok) throw new Error(`Failed to fetch states: ${e.statusText}`);
|
|
14
|
-
return e.json();
|
|
15
|
-
},
|
|
16
|
-
...t
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function k(t) {
|
|
20
|
-
const { baseURL: s, authToken: i } = c(), r = y();
|
|
21
|
-
return v({
|
|
22
|
-
mutationFn: async (e) => {
|
|
23
|
-
const n = await u(s).deliveryZones.states.$post({ json: e }, l(i));
|
|
24
|
-
if (!n.ok) throw new Error(`Failed to create state: ${n.statusText}`);
|
|
25
|
-
return n.json();
|
|
26
|
-
},
|
|
27
|
-
onSuccess: () => {
|
|
28
|
-
r.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
|
|
29
|
-
},
|
|
30
|
-
...t
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function F(t, s) {
|
|
34
|
-
const { baseURL: i, authToken: r } = c(), e = y();
|
|
35
|
-
return v({
|
|
36
|
-
mutationFn: async (a) => {
|
|
37
|
-
const d = await u(i).deliveryZones.states[":id"].$patch(
|
|
38
|
-
{ json: a, param: { id: t } },
|
|
39
|
-
l(r)
|
|
40
|
-
);
|
|
41
|
-
if (!d.ok) throw new Error(`Failed to update state: ${d.statusText}`);
|
|
42
|
-
return d.json();
|
|
43
|
-
},
|
|
44
|
-
onSuccess: () => {
|
|
45
|
-
e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all });
|
|
46
|
-
},
|
|
47
|
-
...s
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function T(t, s) {
|
|
51
|
-
const { baseURL: i, authToken: r } = c(), e = y();
|
|
52
|
-
return v({
|
|
53
|
-
mutationFn: async () => {
|
|
54
|
-
const n = await u(i).deliveryZones.states[":id"].$delete(
|
|
55
|
-
{ param: { id: t } },
|
|
56
|
-
l(r)
|
|
57
|
-
);
|
|
58
|
-
if (!n.ok) throw new Error(`Failed to delete state: ${n.statusText}`);
|
|
59
|
-
return n.json();
|
|
60
|
-
},
|
|
61
|
-
onSuccess: () => {
|
|
62
|
-
e.invalidateQueries({ queryKey: o.admin.deliveryZones.states.all }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
|
|
63
|
-
},
|
|
64
|
-
...s
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function $(t, s) {
|
|
68
|
-
const { baseURL: i, authToken: r } = c();
|
|
69
|
-
return m({
|
|
70
|
-
queryKey: o.admin.deliveryZones.zones.list(t),
|
|
71
|
-
queryFn: async () => {
|
|
72
|
-
const a = await u(i).deliveryZones.zones.$get({ query: t }, l(r));
|
|
73
|
-
if (!a.ok) throw new Error(`Failed to fetch delivery zones: ${a.statusText}`);
|
|
74
|
-
return a.json();
|
|
75
|
-
},
|
|
76
|
-
...s
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function z(t) {
|
|
80
|
-
const { baseURL: s, authToken: i } = c(), r = y();
|
|
81
|
-
return v({
|
|
82
|
-
mutationFn: async (e) => {
|
|
83
|
-
const n = await u(s).deliveryZones.zones.$post({ json: e }, l(i));
|
|
84
|
-
if (!n.ok) 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(
|
|
98
|
-
{ json: a, param: { id: t } },
|
|
99
|
-
l(r)
|
|
100
|
-
);
|
|
101
|
-
if (!d.ok) throw new Error(`Failed to update delivery zone: ${d.statusText}`);
|
|
102
|
-
return d.json();
|
|
103
|
-
},
|
|
104
|
-
onSuccess: () => {
|
|
105
|
-
e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.detail(t) }), e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
|
|
106
|
-
},
|
|
107
|
-
...s
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
function j(t, s) {
|
|
111
|
-
const { baseURL: i, authToken: r } = c(), e = y();
|
|
112
|
-
return v({
|
|
113
|
-
mutationFn: async () => {
|
|
114
|
-
const n = await u(i).deliveryZones.zones[":id"].$delete(
|
|
115
|
-
{ param: { id: t } },
|
|
116
|
-
l(r)
|
|
117
|
-
);
|
|
118
|
-
if (!n.ok) throw new Error(`Failed to delete delivery zone: ${n.statusText}`);
|
|
119
|
-
return n.json();
|
|
120
|
-
},
|
|
121
|
-
onSuccess: () => {
|
|
122
|
-
e.invalidateQueries({ queryKey: o.admin.deliveryZones.zones.all });
|
|
123
|
-
},
|
|
124
|
-
...s
|
|
125
|
-
});
|
|
2
|
+
import { useQuery as e } from "@tanstack/react-query";
|
|
3
|
+
function n(r) {
|
|
4
|
+
return e(r);
|
|
126
5
|
}
|
|
127
6
|
export {
|
|
128
|
-
|
|
129
|
-
k as useCreateState,
|
|
130
|
-
j as useDeleteDeliveryZone,
|
|
131
|
-
T as useDeleteState,
|
|
132
|
-
$ as useListDeliveryZones,
|
|
133
|
-
p as useListStates,
|
|
134
|
-
K as useUpdateDeliveryZone,
|
|
135
|
-
F as useUpdateState
|
|
7
|
+
n as useQueryUnwrapped
|
|
136
8
|
};
|
package/dist/index55.mjs
CHANGED
|
@@ -1,78 +1,26 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
c
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var d = /[^.^\]^[]+|(?=\[\]|\.\.)/g, C = /^\d+$/, m = /^\d/, A = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, x = /^\s*(['"]?)(.*?)(\1)\s*$/, h = 512, E = new c(h), v = new c(h), g = new c(h), I = {
|
|
15
|
-
Cache: c,
|
|
16
|
-
split: l,
|
|
17
|
-
normalizePath: f,
|
|
18
|
-
setter: function(e) {
|
|
19
|
-
var t = f(e);
|
|
20
|
-
return v.get(e) || v.set(e, function(s, n) {
|
|
21
|
-
for (var r = 0, o = t.length, u = s; r < o - 1; ) {
|
|
22
|
-
var a = t[r];
|
|
23
|
-
if (a === "__proto__" || a === "constructor" || a === "prototype")
|
|
24
|
-
return s;
|
|
25
|
-
u = u[t[r++]];
|
|
26
|
-
}
|
|
27
|
-
u[t[r]] = n;
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
getter: function(e, t) {
|
|
31
|
-
var i = f(e);
|
|
32
|
-
return g.get(e) || g.set(e, function(n) {
|
|
33
|
-
for (var r = 0, o = i.length; r < o; )
|
|
34
|
-
if (n != null || !t) n = n[i[r++]];
|
|
35
|
-
else return;
|
|
36
|
-
return n;
|
|
2
|
+
import "react";
|
|
3
|
+
function i(n, o) {
|
|
4
|
+
if (typeof n == "function")
|
|
5
|
+
return n(o);
|
|
6
|
+
n != null && (n.current = o);
|
|
7
|
+
}
|
|
8
|
+
function f(...n) {
|
|
9
|
+
return (o) => {
|
|
10
|
+
let u = !1;
|
|
11
|
+
const c = n.map((t) => {
|
|
12
|
+
const e = i(t, o);
|
|
13
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
37
14
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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));
|
|
15
|
+
if (u)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let t = 0; t < c.length; t++) {
|
|
18
|
+
const e = c[t];
|
|
19
|
+
typeof e == "function" ? e() : i(n[t], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
75
23
|
}
|
|
76
24
|
export {
|
|
77
|
-
|
|
25
|
+
f as composeRefs
|
|
78
26
|
};
|