@instockng/storefront-ui 1.0.49 → 1.0.51
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/Checkout.d.ts.map +1 -1
- package/dist/components/PostPurchaseUpsell.d.ts +14 -0
- package/dist/components/PostPurchaseUpsell.d.ts.map +1 -0
- package/dist/index.mjs +56 -54
- package/dist/index100.mjs +16 -26
- package/dist/index101.mjs +210 -13
- package/dist/index102.mjs +159 -194
- package/dist/index103.mjs +17 -175
- package/dist/index104.mjs +15 -14
- package/dist/index105.mjs +25 -15
- package/dist/index106.mjs +150 -27
- package/dist/index107.mjs +15 -151
- package/dist/index108.mjs +24 -13
- package/dist/index109.mjs +75 -22
- package/dist/index11.mjs +41 -45
- package/dist/index110.mjs +30 -76
- package/dist/index111.mjs +139 -32
- package/dist/index112.mjs +45 -135
- package/dist/index113.mjs +19 -51
- package/dist/index114.mjs +19 -15
- package/dist/index115.mjs +17 -21
- package/dist/index116.mjs +18 -16
- package/dist/index117.mjs +13 -17
- package/dist/index118.mjs +14 -13
- package/dist/index119.mjs +12 -13
- package/dist/index120.mjs +58 -14
- package/dist/index121.mjs +10 -57
- package/dist/index122.mjs +32 -11
- package/dist/index123.mjs +17 -32
- package/dist/index124.mjs +27 -17
- package/dist/index125.mjs +19 -26
- package/dist/index126.mjs +12 -20
- package/dist/index127.mjs +14 -12
- package/dist/index128.mjs +40 -14
- package/dist/index129.mjs +16 -40
- package/dist/index13.mjs +148 -141
- package/dist/index130.mjs +261 -16
- package/dist/index131.mjs +64 -262
- package/dist/index132.mjs +7 -69
- package/dist/index133.mjs +2 -8
- package/dist/index134.mjs +2 -2
- package/dist/index135.mjs +33 -2
- package/dist/index136.mjs +2 -33
- package/dist/index137.mjs +34 -2
- package/dist/index138.mjs +40 -18
- package/dist/index139.mjs +2 -56
- package/dist/index14.mjs +2 -2
- package/dist/index140.mjs +2 -29
- package/dist/index141.mjs +2 -7
- package/dist/index142.mjs +16 -50
- package/dist/index143.mjs +32 -6
- package/dist/index144.mjs +37 -11
- package/dist/index145.mjs +18 -7
- package/dist/index146.mjs +18 -28
- package/dist/index147.mjs +2 -2
- package/dist/index148.mjs +20 -70
- package/dist/index149.mjs +42 -163
- package/dist/index150.mjs +2 -2
- package/dist/index151.mjs +30 -2
- package/dist/index152.mjs +18 -2
- package/dist/index153.mjs +2 -18
- package/dist/index154.mjs +2 -32
- package/dist/index155.mjs +2 -38
- package/dist/index156.mjs +2 -18
- package/dist/index157.mjs +67 -13
- package/dist/index158.mjs +2 -2
- package/dist/index159.mjs +48 -15
- package/dist/index16.mjs +1 -1
- package/dist/index160.mjs +2 -46
- package/dist/index161.mjs +36 -2
- package/dist/index162.mjs +142 -20
- package/dist/index163.mjs +2 -18
- package/dist/index164.mjs +2 -2
- package/dist/index165.mjs +19 -2
- package/dist/index167.mjs +2 -2
- package/dist/index168.mjs +18 -64
- package/dist/index169.mjs +2 -2
- package/dist/index17.mjs +7 -7
- package/dist/index170.mjs +2 -53
- package/dist/index171.mjs +24 -2
- package/dist/index172.mjs +15 -28
- package/dist/index173.mjs +2 -152
- package/dist/index174.mjs +2 -2
- package/dist/index175.mjs +2 -2
- package/dist/index176.mjs +14 -10
- package/dist/index177.mjs +2 -2
- package/dist/index178.mjs +23 -2
- package/dist/index179.mjs +2 -26
- package/dist/index180.mjs +2 -2
- package/dist/index181.mjs +2 -2
- package/dist/index182.mjs +16 -17
- package/dist/index183.mjs +2 -23
- package/dist/index184.mjs +23 -2
- package/dist/index185.mjs +2 -2
- package/dist/index186.mjs +2 -2
- package/dist/index187.mjs +2 -23
- package/dist/index188.mjs +2 -2
- package/dist/index189.mjs +2 -23
- package/dist/index190.mjs +2 -2
- package/dist/index191.mjs +2 -2
- package/dist/index192.mjs +2 -2
- package/dist/index193.mjs +124 -20
- package/dist/index194.mjs +2 -2
- package/dist/index195.mjs +71 -20
- package/dist/index196.mjs +74 -2
- package/dist/index197.mjs +2 -2
- package/dist/index198.mjs +21 -2
- package/dist/index199.mjs +56 -2
- package/dist/index20.mjs +2 -2
- package/dist/index200.mjs +29 -2
- package/dist/index201.mjs +7 -2
- package/dist/index202.mjs +52 -2
- package/dist/index203.mjs +6 -2
- package/dist/index204.mjs +11 -126
- package/dist/index205.mjs +7 -2
- package/dist/index206.mjs +28 -74
- package/dist/index207.mjs +2 -74
- package/dist/index208.mjs +70 -2
- package/dist/index209.mjs +164 -28
- package/dist/index210.mjs +2 -11
- package/dist/index211.mjs +2 -4
- package/dist/index212.mjs +2 -4
- package/dist/index213.mjs +2 -13
- package/dist/index214.mjs +2 -7
- package/dist/index215.mjs +2 -12
- package/dist/index216.mjs +107 -4
- package/dist/index217.mjs +2 -33
- package/dist/index218.mjs +2 -31
- package/dist/index219.mjs +2 -28
- package/dist/index220.mjs +2 -61
- package/dist/index221.mjs +2 -2
- package/dist/index222.mjs +37 -2
- package/dist/index223.mjs +2 -2
- package/dist/index224.mjs +244 -2
- package/dist/index226.mjs +33 -2
- package/dist/index227.mjs +65 -2
- package/dist/index228.mjs +25 -2
- package/dist/index229.mjs +2 -108
- package/dist/index23.mjs +2 -2
- package/dist/index230.mjs +2 -2
- package/dist/index231.mjs +2 -2
- package/dist/index232.mjs +2 -37
- package/dist/index233.mjs +2 -2
- package/dist/index234.mjs +2 -2
- package/dist/index236.mjs +2 -2
- package/dist/index237.mjs +2 -2
- package/dist/index238.mjs +4 -2
- package/dist/index239.mjs +2 -244
- package/dist/index24.mjs +1 -1
- package/dist/index241.mjs +13 -33
- package/dist/index242.mjs +7 -65
- package/dist/index243.mjs +11 -24
- package/dist/index244.mjs +5 -2
- package/dist/index245.mjs +33 -2
- package/dist/index246.mjs +31 -2
- package/dist/index247.mjs +28 -2
- package/dist/index248.mjs +61 -2
- package/dist/index249.mjs +31 -4
- package/dist/index250.mjs +11 -2
- package/dist/index251.mjs +4 -2
- package/dist/index252.mjs +4 -2
- package/dist/index253.mjs +2 -2
- package/dist/index254.mjs +2 -18
- package/dist/index255.mjs +13 -42
- package/dist/index256.mjs +47 -2
- package/dist/index257.mjs +2 -2
- package/dist/index258.mjs +2 -2
- package/dist/index259.mjs +2 -2
- package/dist/index260.mjs +2 -91
- package/dist/index261.mjs +91 -2
- package/dist/index262.mjs +1 -2
- package/dist/index263.mjs +3 -2
- package/dist/index264.mjs +2 -2
- package/dist/index265.mjs +2 -17
- package/dist/index266.mjs +15 -11
- package/dist/index267.mjs +13 -6
- package/dist/index268.mjs +6 -30
- package/dist/index269.mjs +30 -2
- package/dist/index27.mjs +21 -10
- package/dist/index271.mjs +2 -2
- package/dist/index272.mjs +5 -0
- package/dist/index30.mjs +4 -3
- package/dist/index31.mjs +11 -10
- package/dist/index32.mjs +11 -11
- package/dist/index33.mjs +1 -1
- package/dist/index34.mjs +21 -12
- package/dist/index35.mjs +1 -1
- package/dist/index36.mjs +1 -1
- package/dist/index37.mjs +1 -1
- package/dist/index38.mjs +2 -2
- package/dist/index40.mjs +1 -1
- package/dist/index44.mjs +70 -2
- package/dist/index45.mjs +2 -60
- package/dist/index46.mjs +57 -48
- package/dist/index47.mjs +51 -33
- package/dist/index48.mjs +33 -15
- package/dist/index49.mjs +12 -2260
- package/dist/index50.mjs +2263 -36
- package/dist/index51.mjs +36 -44
- package/dist/index52.mjs +44 -99
- package/dist/index53.mjs +99 -113
- package/dist/index54.mjs +82 -50
- package/dist/index55.mjs +55 -51
- package/dist/index56.mjs +46 -64
- package/dist/index57.mjs +71 -57
- package/dist/index58.mjs +57 -55
- package/dist/index59.mjs +75 -15
- package/dist/index60.mjs +13 -14
- package/dist/index61.mjs +16 -59
- package/dist/index62.mjs +43 -105
- package/dist/index63.mjs +89 -93
- package/dist/index64.mjs +128 -23
- package/dist/index65.mjs +24 -2
- package/dist/index66.mjs +7 -7
- package/dist/index67.mjs +22 -4
- package/dist/index68.mjs +2 -23
- package/dist/index71.mjs +2 -2
- package/dist/index72.mjs +5 -2
- package/dist/index73.mjs +2 -6
- package/dist/index74.mjs +5 -1133
- package/dist/index75.mjs +1130 -16
- package/dist/index76.mjs +16 -51
- package/dist/index77.mjs +49 -27
- package/dist/index78.mjs +33 -2
- package/dist/index79.mjs +2 -235
- package/dist/index80.mjs +233 -4
- package/dist/index81.mjs +5 -133
- package/dist/index82.mjs +129 -63
- package/dist/index83.mjs +67 -86
- package/dist/index84.mjs +85 -27
- package/dist/index85.mjs +28 -8
- package/dist/index86.mjs +8 -74
- package/dist/index87.mjs +74 -3
- package/dist/index88.mjs +4 -2
- package/dist/index89.mjs +2 -83
- package/dist/index90.mjs +81 -52
- package/dist/index91.mjs +53 -5
- package/dist/index92.mjs +5 -4
- package/dist/index93.mjs +4 -178
- package/dist/index94.mjs +174 -48
- package/dist/index95.mjs +51 -67
- package/dist/index96.mjs +69 -34
- package/dist/index97.mjs +2 -43
- package/dist/index98.mjs +2 -2
- package/dist/index99.mjs +28 -2
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/src/components/Checkout.stories.tsx +84 -0
- package/src/components/Checkout.tsx +26 -34
- package/src/components/PostPurchaseUpsell.stories.tsx +201 -0
- package/src/components/PostPurchaseUpsell.tsx +154 -0
- package/src/components/ShoppingCart.tsx +3 -3
- package/src/components/ui/modal.tsx +3 -3
package/dist/index51.mjs
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
|
|
22
|
-
return n(i(o, s));
|
|
23
|
-
}, e;
|
|
24
|
-
}
|
|
25
|
-
const r = n(f);
|
|
26
|
-
r.Axios = m;
|
|
27
|
-
r.CanceledError = c;
|
|
28
|
-
r.CancelToken = d;
|
|
29
|
-
r.isCancel = u;
|
|
30
|
-
r.VERSION = x;
|
|
31
|
-
r.toFormData = C;
|
|
32
|
-
r.AxiosError = A;
|
|
33
|
-
r.Cancel = r.CanceledError;
|
|
34
|
-
r.all = function(t) {
|
|
35
|
-
return Promise.all(t);
|
|
36
|
-
};
|
|
37
|
-
r.spread = E;
|
|
38
|
-
r.isAxiosError = O;
|
|
39
|
-
r.mergeConfig = i;
|
|
40
|
-
r.AxiosHeaders = S;
|
|
41
|
-
r.formToJSON = (o) => l(a.isHTMLForm(o) ? new FormData(o) : o);
|
|
42
|
-
r.getAdapter = H.getAdapter;
|
|
43
|
-
r.HttpStatusCode = T;
|
|
44
|
-
r.default = r;
|
|
2
|
+
import o from "./index52.mjs";
|
|
3
|
+
const {
|
|
4
|
+
Axios: e,
|
|
5
|
+
AxiosError: a,
|
|
6
|
+
CanceledError: s,
|
|
7
|
+
isCancel: t,
|
|
8
|
+
CancelToken: i,
|
|
9
|
+
VERSION: l,
|
|
10
|
+
all: n,
|
|
11
|
+
Cancel: d,
|
|
12
|
+
isAxiosError: x,
|
|
13
|
+
spread: C,
|
|
14
|
+
toFormData: c,
|
|
15
|
+
AxiosHeaders: m,
|
|
16
|
+
HttpStatusCode: p,
|
|
17
|
+
formToJSON: A,
|
|
18
|
+
getAdapter: f,
|
|
19
|
+
mergeConfig: E
|
|
20
|
+
} = o;
|
|
45
21
|
export {
|
|
46
|
-
|
|
22
|
+
e as Axios,
|
|
23
|
+
a as AxiosError,
|
|
24
|
+
m as AxiosHeaders,
|
|
25
|
+
d as Cancel,
|
|
26
|
+
i as CancelToken,
|
|
27
|
+
s as CanceledError,
|
|
28
|
+
p as HttpStatusCode,
|
|
29
|
+
l as VERSION,
|
|
30
|
+
n as all,
|
|
31
|
+
o as default,
|
|
32
|
+
A as formToJSON,
|
|
33
|
+
f as getAdapter,
|
|
34
|
+
x as isAxiosError,
|
|
35
|
+
t as isCancel,
|
|
36
|
+
E as mergeConfig,
|
|
37
|
+
C as spread,
|
|
38
|
+
c as toFormData
|
|
47
39
|
};
|
package/dist/index52.mjs
CHANGED
|
@@ -1,102 +1,47 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
if (r != null && r.cookie) {
|
|
47
|
-
const o = [];
|
|
48
|
-
for (const [c, f] of Object.entries(r.cookie))
|
|
49
|
-
o.push(j(c, f, { path: "/" }));
|
|
50
|
-
t.Cookie = o.join(",");
|
|
51
|
-
}
|
|
52
|
-
this.cType && (t["Content-Type"] = this.cType);
|
|
53
|
-
const s = new Headers(t ?? void 0);
|
|
54
|
-
let a = this.url;
|
|
55
|
-
a = w(a), a = P(a, this.pathParams), this.queryParams && (a = a + "?" + this.queryParams.toString()), i = this.method.toUpperCase();
|
|
56
|
-
const u = !(i === "GET" || i === "HEAD");
|
|
57
|
-
return ((e == null ? void 0 : e.fetch) || fetch)(a, {
|
|
58
|
-
body: u ? this.rBody : void 0,
|
|
59
|
-
method: i,
|
|
60
|
-
headers: s,
|
|
61
|
-
...e == null ? void 0 : e.init
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
this.url = r, this.method = e;
|
|
65
|
-
}
|
|
66
|
-
}, E = (r, e) => v(function i(t) {
|
|
67
|
-
var l;
|
|
68
|
-
const s = [...t.path], a = s.slice(-3).reverse();
|
|
69
|
-
if (a[0] === "toString")
|
|
70
|
-
return a[1] === "name" ? a[2] || "" : i.toString();
|
|
71
|
-
if (a[0] === "valueOf")
|
|
72
|
-
return a[1] === "name" ? a[2] || "" : i;
|
|
73
|
-
let u = "";
|
|
74
|
-
if (/^\$/.test(a[0])) {
|
|
75
|
-
const n = s.pop();
|
|
76
|
-
n && (u = n.replace(/^\$/, ""));
|
|
77
|
-
}
|
|
78
|
-
const o = s.join("/"), c = U(r, o);
|
|
79
|
-
if (u === "url") {
|
|
80
|
-
let n = c;
|
|
81
|
-
return t.args[0] && (t.args[0].param && (n = P(c, t.args[0].param)), t.args[0].query && (n = n + "?" + S(t.args[0].query).toString())), n = w(n), new URL(n);
|
|
82
|
-
}
|
|
83
|
-
if (u === "ws") {
|
|
84
|
-
const n = x(
|
|
85
|
-
t.args[0] && t.args[0].param ? P(c, t.args[0].param) : c,
|
|
86
|
-
"ws"
|
|
87
|
-
), y = new URL(n), b = (l = t.args[0]) == null ? void 0 : l.query;
|
|
88
|
-
return b && Object.entries(b).forEach(([m, d]) => {
|
|
89
|
-
Array.isArray(d) ? d.forEach((q) => y.searchParams.append(m, q)) : y.searchParams.set(m, d);
|
|
90
|
-
}), ((...m) => (e == null ? void 0 : e.webSocket) !== void 0 && typeof e.webSocket == "function" ? e.webSocket(...m) : new WebSocket(...m))(y.toString());
|
|
91
|
-
}
|
|
92
|
-
const f = new T(c, u);
|
|
93
|
-
if (u) {
|
|
94
|
-
e ?? (e = {});
|
|
95
|
-
const n = C(e, { ...t.args[1] });
|
|
96
|
-
return f.fetch(t.args[0], n);
|
|
97
|
-
}
|
|
98
|
-
return f;
|
|
99
|
-
}, []);
|
|
2
|
+
import a from "./index80.mjs";
|
|
3
|
+
import p from "./index81.mjs";
|
|
4
|
+
import m from "./index82.mjs";
|
|
5
|
+
import i from "./index83.mjs";
|
|
6
|
+
import f from "./index84.mjs";
|
|
7
|
+
import l from "./index85.mjs";
|
|
8
|
+
import c from "./index86.mjs";
|
|
9
|
+
import d from "./index87.mjs";
|
|
10
|
+
import u from "./index88.mjs";
|
|
11
|
+
import { VERSION as x } from "./index89.mjs";
|
|
12
|
+
import C from "./index90.mjs";
|
|
13
|
+
import A from "./index91.mjs";
|
|
14
|
+
import E from "./index92.mjs";
|
|
15
|
+
import O from "./index93.mjs";
|
|
16
|
+
import S from "./index94.mjs";
|
|
17
|
+
import H from "./index95.mjs";
|
|
18
|
+
import T from "./index96.mjs";
|
|
19
|
+
function n(o) {
|
|
20
|
+
const t = new m(o), e = p(m.prototype.request, t);
|
|
21
|
+
return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
|
|
22
|
+
return n(i(o, s));
|
|
23
|
+
}, e;
|
|
24
|
+
}
|
|
25
|
+
const r = n(f);
|
|
26
|
+
r.Axios = m;
|
|
27
|
+
r.CanceledError = c;
|
|
28
|
+
r.CancelToken = d;
|
|
29
|
+
r.isCancel = u;
|
|
30
|
+
r.VERSION = x;
|
|
31
|
+
r.toFormData = C;
|
|
32
|
+
r.AxiosError = A;
|
|
33
|
+
r.Cancel = r.CanceledError;
|
|
34
|
+
r.all = function(t) {
|
|
35
|
+
return Promise.all(t);
|
|
36
|
+
};
|
|
37
|
+
r.spread = E;
|
|
38
|
+
r.isAxiosError = O;
|
|
39
|
+
r.mergeConfig = i;
|
|
40
|
+
r.AxiosHeaders = S;
|
|
41
|
+
r.formToJSON = (o) => l(a.isHTMLForm(o) ? new FormData(o) : o);
|
|
42
|
+
r.getAdapter = H.getAdapter;
|
|
43
|
+
r.HttpStatusCode = T;
|
|
44
|
+
r.default = r;
|
|
100
45
|
export {
|
|
101
|
-
|
|
46
|
+
r as default
|
|
102
47
|
};
|
package/dist/index53.mjs
CHANGED
|
@@ -1,116 +1,102 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
...
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return u.json();
|
|
101
|
-
},
|
|
102
|
-
onSuccess: () => {
|
|
103
|
-
t.invalidateQueries({ queryKey: c.admin.orders.detail(e) });
|
|
104
|
-
},
|
|
105
|
-
...r
|
|
106
|
-
});
|
|
107
|
-
}
|
|
2
|
+
var p = Object.defineProperty;
|
|
3
|
+
var k = (r, e, i) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
|
|
4
|
+
var h = (r, e, i) => k(r, typeof e != "symbol" ? e + "" : e, i);
|
|
5
|
+
import { serialize as j } from "./index137.mjs";
|
|
6
|
+
import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index138.mjs";
|
|
7
|
+
var v = (r, e) => new Proxy(() => {
|
|
8
|
+
}, {
|
|
9
|
+
get(t, s) {
|
|
10
|
+
if (!(typeof s != "string" || s === "then"))
|
|
11
|
+
return v(r, [...e, s]);
|
|
12
|
+
},
|
|
13
|
+
apply(t, s, a) {
|
|
14
|
+
return r({
|
|
15
|
+
path: e,
|
|
16
|
+
args: a
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}), T = class {
|
|
20
|
+
constructor(r, e) {
|
|
21
|
+
h(this, "url");
|
|
22
|
+
h(this, "method");
|
|
23
|
+
h(this, "queryParams");
|
|
24
|
+
h(this, "pathParams", {});
|
|
25
|
+
h(this, "rBody");
|
|
26
|
+
h(this, "cType");
|
|
27
|
+
h(this, "fetch", async (r, e) => {
|
|
28
|
+
if (r) {
|
|
29
|
+
if (r.query && (this.queryParams = S(r.query)), r.form) {
|
|
30
|
+
const o = new FormData();
|
|
31
|
+
for (const [c, f] of Object.entries(r.form))
|
|
32
|
+
if (Array.isArray(f))
|
|
33
|
+
for (const l of f)
|
|
34
|
+
o.append(c, l);
|
|
35
|
+
else
|
|
36
|
+
o.append(c, f);
|
|
37
|
+
this.rBody = o;
|
|
38
|
+
}
|
|
39
|
+
r.json && (this.rBody = JSON.stringify(r.json), this.cType = "application/json"), r.param && (this.pathParams = r.param);
|
|
40
|
+
}
|
|
41
|
+
let i = this.method.toUpperCase();
|
|
42
|
+
const t = {
|
|
43
|
+
...r == null ? void 0 : r.header,
|
|
44
|
+
...typeof (e == null ? void 0 : e.headers) == "function" ? await e.headers() : e == null ? void 0 : e.headers
|
|
45
|
+
};
|
|
46
|
+
if (r != null && r.cookie) {
|
|
47
|
+
const o = [];
|
|
48
|
+
for (const [c, f] of Object.entries(r.cookie))
|
|
49
|
+
o.push(j(c, f, { path: "/" }));
|
|
50
|
+
t.Cookie = o.join(",");
|
|
51
|
+
}
|
|
52
|
+
this.cType && (t["Content-Type"] = this.cType);
|
|
53
|
+
const s = new Headers(t ?? void 0);
|
|
54
|
+
let a = this.url;
|
|
55
|
+
a = w(a), a = P(a, this.pathParams), this.queryParams && (a = a + "?" + this.queryParams.toString()), i = this.method.toUpperCase();
|
|
56
|
+
const u = !(i === "GET" || i === "HEAD");
|
|
57
|
+
return ((e == null ? void 0 : e.fetch) || fetch)(a, {
|
|
58
|
+
body: u ? this.rBody : void 0,
|
|
59
|
+
method: i,
|
|
60
|
+
headers: s,
|
|
61
|
+
...e == null ? void 0 : e.init
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
this.url = r, this.method = e;
|
|
65
|
+
}
|
|
66
|
+
}, E = (r, e) => v(function i(t) {
|
|
67
|
+
var l;
|
|
68
|
+
const s = [...t.path], a = s.slice(-3).reverse();
|
|
69
|
+
if (a[0] === "toString")
|
|
70
|
+
return a[1] === "name" ? a[2] || "" : i.toString();
|
|
71
|
+
if (a[0] === "valueOf")
|
|
72
|
+
return a[1] === "name" ? a[2] || "" : i;
|
|
73
|
+
let u = "";
|
|
74
|
+
if (/^\$/.test(a[0])) {
|
|
75
|
+
const n = s.pop();
|
|
76
|
+
n && (u = n.replace(/^\$/, ""));
|
|
77
|
+
}
|
|
78
|
+
const o = s.join("/"), c = U(r, o);
|
|
79
|
+
if (u === "url") {
|
|
80
|
+
let n = c;
|
|
81
|
+
return t.args[0] && (t.args[0].param && (n = P(c, t.args[0].param)), t.args[0].query && (n = n + "?" + S(t.args[0].query).toString())), n = w(n), new URL(n);
|
|
82
|
+
}
|
|
83
|
+
if (u === "ws") {
|
|
84
|
+
const n = x(
|
|
85
|
+
t.args[0] && t.args[0].param ? P(c, t.args[0].param) : c,
|
|
86
|
+
"ws"
|
|
87
|
+
), y = new URL(n), b = (l = t.args[0]) == null ? void 0 : l.query;
|
|
88
|
+
return b && Object.entries(b).forEach(([m, d]) => {
|
|
89
|
+
Array.isArray(d) ? d.forEach((q) => y.searchParams.append(m, q)) : y.searchParams.set(m, d);
|
|
90
|
+
}), ((...m) => (e == null ? void 0 : e.webSocket) !== void 0 && typeof e.webSocket == "function" ? e.webSocket(...m) : new WebSocket(...m))(y.toString());
|
|
91
|
+
}
|
|
92
|
+
const f = new T(c, u);
|
|
93
|
+
if (u) {
|
|
94
|
+
e ?? (e = {});
|
|
95
|
+
const n = C(e, { ...t.args[1] });
|
|
96
|
+
return f.fetch(t.args[0], n);
|
|
97
|
+
}
|
|
98
|
+
return f;
|
|
99
|
+
}, []);
|
|
108
100
|
export {
|
|
109
|
-
|
|
110
|
-
g as useCreateOrder,
|
|
111
|
-
K as useDeleteOrder,
|
|
112
|
-
j as useGetOrder,
|
|
113
|
-
$ as useListOrders,
|
|
114
|
-
x as useUpdateOrder,
|
|
115
|
-
A as useUpdateOrderStatus
|
|
101
|
+
E as hc
|
|
116
102
|
};
|
package/dist/index54.mjs
CHANGED
|
@@ -1,84 +1,116 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQueryClient as m, useMutation as w } 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 f } from "./index72.mjs";
|
|
4
|
+
import { createAdminRpcClients as d, authHeaders as l } from "./index24.mjs";
|
|
5
|
+
import { queryKeys as c } from "./index30.mjs";
|
|
6
|
+
import { useApiConfig as y } from "./index22.mjs";
|
|
7
|
+
function $(e, r) {
|
|
8
|
+
const { baseURL: s, getAuthToken: o } = y();
|
|
9
|
+
return f({
|
|
10
|
+
queryKey: c.admin.orders.list(e),
|
|
11
11
|
queryFn: async () => {
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
throw new Error(`Failed to fetch
|
|
15
|
-
return
|
|
12
|
+
const t = await o(), a = d(s), i = e ? Object.fromEntries(Object.entries(e).filter(([u, p]) => p !== void 0)) : void 0, n = await a.orders.index.$get({ query: i }, l(t));
|
|
13
|
+
if (!n.ok)
|
|
14
|
+
throw new Error(`Failed to fetch orders: ${n.statusText}`);
|
|
15
|
+
return n.json();
|
|
16
16
|
},
|
|
17
|
-
...
|
|
17
|
+
...r
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const { baseURL: s, getAuthToken:
|
|
22
|
-
return
|
|
23
|
-
queryKey:
|
|
20
|
+
function j(e, r) {
|
|
21
|
+
const { baseURL: s, getAuthToken: o } = y();
|
|
22
|
+
return f({
|
|
23
|
+
queryKey: c.admin.orders.detail(e),
|
|
24
24
|
queryFn: async () => {
|
|
25
|
-
const
|
|
25
|
+
const t = await o(), i = await d(s).orders[":id"].$get({ param: { id: e } }, l(t));
|
|
26
26
|
if (!i.ok)
|
|
27
|
-
throw new Error(`Failed to fetch
|
|
27
|
+
throw new Error(`Failed to fetch order: ${i.statusText}`);
|
|
28
28
|
return i.json();
|
|
29
29
|
},
|
|
30
|
-
...
|
|
30
|
+
...r
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const { baseURL:
|
|
33
|
+
function g(e) {
|
|
34
|
+
const { baseURL: r, getAuthToken: s } = y(), o = m();
|
|
35
|
+
return w({
|
|
36
|
+
mutationFn: async (t) => {
|
|
37
|
+
const a = await s(), n = await d(r).orders.index.$post({ json: t }, l(a));
|
|
38
|
+
if (!n.ok)
|
|
39
|
+
throw new Error(`Failed to create order: ${n.statusText}`);
|
|
40
|
+
return n.json();
|
|
41
|
+
},
|
|
42
|
+
onSuccess: () => {
|
|
43
|
+
o.invalidateQueries({ queryKey: c.admin.orders.all });
|
|
44
|
+
},
|
|
45
|
+
...e
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function x(e, r) {
|
|
49
|
+
const { baseURL: s, getAuthToken: o } = y(), t = m();
|
|
35
50
|
return w({
|
|
36
51
|
mutationFn: async (a) => {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
throw new Error(`Failed to
|
|
40
|
-
return
|
|
52
|
+
const i = await o(), u = await d(s).orders[":id"].$patch({ param: { id: e }, json: a }, l(i));
|
|
53
|
+
if (!u.ok)
|
|
54
|
+
throw new Error(`Failed to update order: ${u.statusText}`);
|
|
55
|
+
return u.json();
|
|
41
56
|
},
|
|
42
57
|
onSuccess: () => {
|
|
43
|
-
|
|
58
|
+
t.invalidateQueries({ queryKey: c.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: c.admin.orders.all });
|
|
44
59
|
},
|
|
45
|
-
...
|
|
60
|
+
...r
|
|
46
61
|
});
|
|
47
62
|
}
|
|
48
|
-
function
|
|
49
|
-
const { baseURL: s, getAuthToken:
|
|
63
|
+
function A(e, r) {
|
|
64
|
+
const { baseURL: s, getAuthToken: o } = y(), t = m();
|
|
50
65
|
return w({
|
|
51
|
-
mutationFn: async (
|
|
52
|
-
const i = await
|
|
53
|
-
if (!
|
|
54
|
-
throw new Error(`Failed to update
|
|
55
|
-
return
|
|
66
|
+
mutationFn: async (a) => {
|
|
67
|
+
const i = await o(), u = await d(s).orders[":id"].status.$patch({ param: { id: e }, json: a }, l(i));
|
|
68
|
+
if (!u.ok)
|
|
69
|
+
throw new Error(`Failed to update order status: ${u.statusText}`);
|
|
70
|
+
return u.json();
|
|
56
71
|
},
|
|
57
72
|
onSuccess: () => {
|
|
58
|
-
|
|
73
|
+
t.invalidateQueries({ queryKey: c.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: c.admin.orders.all });
|
|
59
74
|
},
|
|
60
|
-
...
|
|
75
|
+
...r
|
|
61
76
|
});
|
|
62
77
|
}
|
|
63
|
-
function
|
|
64
|
-
const { baseURL: s, getAuthToken:
|
|
78
|
+
function K(e, r) {
|
|
79
|
+
const { baseURL: s, getAuthToken: o } = y(), t = m();
|
|
65
80
|
return w({
|
|
66
81
|
mutationFn: async () => {
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
throw new Error(`Failed to delete
|
|
70
|
-
return
|
|
82
|
+
const a = await o(), n = await d(s).orders[":id"].$delete({ param: { id: e } }, l(a));
|
|
83
|
+
if (!n.ok)
|
|
84
|
+
throw new Error(`Failed to delete order: ${n.statusText}`);
|
|
85
|
+
return n.json();
|
|
86
|
+
},
|
|
87
|
+
onSuccess: () => {
|
|
88
|
+
t.invalidateQueries({ queryKey: c.admin.orders.all });
|
|
89
|
+
},
|
|
90
|
+
...r
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function U(e, r) {
|
|
94
|
+
const { baseURL: s, getAuthToken: o } = y(), t = m();
|
|
95
|
+
return w({
|
|
96
|
+
mutationFn: async (a) => {
|
|
97
|
+
const i = await o(), u = await d(s).orders[":id"].notes.$post({ param: { id: e }, json: a }, l(i));
|
|
98
|
+
if (!u.ok)
|
|
99
|
+
throw new Error(`Failed to add order note: ${u.statusText}`);
|
|
100
|
+
return u.json();
|
|
71
101
|
},
|
|
72
102
|
onSuccess: () => {
|
|
73
|
-
|
|
103
|
+
t.invalidateQueries({ queryKey: c.admin.orders.detail(e) });
|
|
74
104
|
},
|
|
75
|
-
...
|
|
105
|
+
...r
|
|
76
106
|
});
|
|
77
107
|
}
|
|
78
108
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
109
|
+
U as useAddOrderNote,
|
|
110
|
+
g as useCreateOrder,
|
|
111
|
+
K as useDeleteOrder,
|
|
112
|
+
j as useGetOrder,
|
|
113
|
+
$ as useListOrders,
|
|
114
|
+
x as useUpdateOrder,
|
|
115
|
+
A as useUpdateOrderStatus
|
|
84
116
|
};
|