@instockng/storefront-ui 1.0.70 → 1.0.71
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/contexts/CartContext.d.ts.map +1 -1
- package/dist/index.mjs +65 -63
- package/dist/index100.mjs +2 -33
- package/dist/index101.mjs +34 -2
- package/dist/index102.mjs +43 -2
- package/dist/index106.mjs +2 -2
- package/dist/index107.mjs +2 -2
- package/dist/index140.mjs +1 -1
- package/dist/index142.mjs +2 -21
- package/dist/index143.mjs +19 -54
- package/dist/index144.mjs +55 -28
- package/dist/index145.mjs +28 -6
- package/dist/index146.mjs +6 -51
- package/dist/index147.mjs +51 -5
- package/dist/index148.mjs +6 -12
- package/dist/index149.mjs +12 -7
- package/dist/index15.mjs +1 -1
- package/dist/index150.mjs +6 -27
- package/dist/index151.mjs +28 -2
- package/dist/index152.mjs +2 -70
- package/dist/index153.mjs +67 -164
- package/dist/index154.mjs +167 -2
- package/dist/index158.mjs +1 -1
- package/dist/index159.mjs +1 -1
- package/dist/index160.mjs +1 -1
- package/dist/index161.mjs +1 -1
- package/dist/index162.mjs +1 -1
- package/dist/index164.mjs +3 -3
- package/dist/index165.mjs +1 -1
- package/dist/index167.mjs +2 -2
- package/dist/index168.mjs +1 -1
- package/dist/index173.mjs +2 -2
- package/dist/index175.mjs +1 -1
- package/dist/index177.mjs +2 -2
- package/dist/index178.mjs +5 -5
- package/dist/index181.mjs +1 -1
- package/dist/index184.mjs +1 -1
- package/dist/index187.mjs +1 -1
- package/dist/index188.mjs +1 -1
- package/dist/index192.mjs +1 -1
- package/dist/index194.mjs +1 -1
- package/dist/index198.mjs +1 -1
- package/dist/index2.mjs +1 -1
- package/dist/index200.mjs +1 -1
- package/dist/index209.mjs +2 -2
- package/dist/index211.mjs +1 -1
- package/dist/index212.mjs +1 -1
- package/dist/index213.mjs +2 -13
- package/dist/index214.mjs +2 -7
- package/dist/index215.mjs +2 -31
- package/dist/index216.mjs +2 -11
- package/dist/index217.mjs +2 -4
- package/dist/index218.mjs +2 -4
- package/dist/index219.mjs +2 -12
- package/dist/index22.mjs +10 -6
- package/dist/index220.mjs +2 -5
- package/dist/index221.mjs +37 -33
- package/dist/index222.mjs +2 -31
- package/dist/index223.mjs +2 -28
- package/dist/index224.mjs +2 -61
- package/dist/index225.mjs +2 -2
- package/dist/index226.mjs +2 -2
- package/dist/index227.mjs +244 -2
- package/dist/index228.mjs +2 -2
- package/dist/index229.mjs +28 -103
- package/dist/index23.mjs +13 -14
- package/dist/index230.mjs +65 -2
- package/dist/index231.mjs +25 -2
- package/dist/index232.mjs +2 -2
- package/dist/index233.mjs +2 -2
- package/dist/index234.mjs +2 -2
- package/dist/index235.mjs +108 -2
- package/dist/index236.mjs +2 -37
- package/dist/index238.mjs +2 -244
- package/dist/index239.mjs +4 -2
- package/dist/index240.mjs +30 -32
- package/dist/index241.mjs +10 -64
- package/dist/index242.mjs +3 -24
- package/dist/index243.mjs +4 -2
- package/dist/index244.mjs +13 -2
- package/dist/index245.mjs +7 -2
- package/dist/index246.mjs +2 -2
- package/dist/index247.mjs +2 -2
- package/dist/index248.mjs +12 -2
- package/dist/index249.mjs +5 -2
- package/dist/index250.mjs +33 -2
- package/dist/index251.mjs +31 -2
- package/dist/index252.mjs +28 -2
- package/dist/index253.mjs +61 -4
- package/dist/index254.mjs +2 -2
- package/dist/index256.mjs +2 -3
- package/dist/index257.mjs +18 -2
- package/dist/index258.mjs +47 -2
- package/dist/index259.mjs +2 -17
- package/dist/index260.mjs +2 -13
- package/dist/index261.mjs +2 -6
- package/dist/index262.mjs +2 -30
- package/dist/index263.mjs +91 -2
- package/dist/index264.mjs +2 -2
- package/dist/index265.mjs +2 -2
- package/dist/index266.mjs +3 -2
- package/dist/index267.mjs +2 -2
- package/dist/index268.mjs +2 -91
- package/dist/index269.mjs +17 -2
- package/dist/index27.mjs +17 -17
- package/dist/index270.mjs +12 -17
- package/dist/index271.mjs +6 -47
- package/dist/index272.mjs +30 -2
- package/dist/index273.mjs +2 -2
- package/dist/index275.mjs +2 -2
- package/dist/index28.mjs +58 -47
- package/dist/index29.mjs +11 -11
- package/dist/index3.mjs +141 -123
- package/dist/index30.mjs +4 -4
- package/dist/index31.mjs +5 -5
- package/dist/index33.mjs +21 -20
- package/dist/index35.mjs +36 -29
- package/dist/index36.mjs +8 -25
- package/dist/index37.mjs +1 -1
- package/dist/index38.mjs +26 -9
- package/dist/index39.mjs +9 -9
- package/dist/index4.mjs +58 -46
- package/dist/index40.mjs +2 -2
- package/dist/index42.mjs +2 -2
- package/dist/index45.mjs +3 -3
- package/dist/index46.mjs +1 -1
- package/dist/index49.mjs +1 -1
- package/dist/index54.mjs +17 -17
- package/dist/index55.mjs +2 -2
- package/dist/index56.mjs +1 -1
- package/dist/index57.mjs +1 -1
- package/dist/index58.mjs +1 -1
- package/dist/index59.mjs +1 -1
- package/dist/index60.mjs +1 -1
- package/dist/index61.mjs +1 -1
- package/dist/index62.mjs +1 -1
- package/dist/index63.mjs +1 -1
- package/dist/index64.mjs +1 -1
- package/dist/index65.mjs +1 -1
- package/dist/index66.mjs +1 -1
- package/dist/index67.mjs +1 -1
- package/dist/index68.mjs +23 -4
- package/dist/index69.mjs +149 -19
- package/dist/index7.mjs +1 -1
- package/dist/index70.mjs +2 -24
- package/dist/index71.mjs +19 -149
- package/dist/index72.mjs +75 -2
- package/dist/index73.mjs +14 -74
- package/dist/index74.mjs +62 -14
- package/dist/index75.mjs +4 -62
- package/dist/index76.mjs +2 -34
- package/dist/index77.mjs +5 -42
- package/dist/index78.mjs +1129 -230
- package/dist/index79.mjs +19 -5
- package/dist/index80.mjs +48 -127
- package/dist/index81.mjs +32 -67
- package/dist/index82.mjs +2 -87
- package/dist/index83.mjs +229 -23
- package/dist/index84.mjs +5 -8
- package/dist/index85.mjs +125 -66
- package/dist/index86.mjs +67 -3
- package/dist/index87.mjs +87 -2
- package/dist/index88.mjs +24 -78
- package/dist/index89.mjs +7 -52
- package/dist/index90.mjs +74 -5
- package/dist/index91.mjs +3 -4
- package/dist/index92.mjs +2 -179
- package/dist/index93.mjs +79 -49
- package/dist/index94.mjs +53 -68
- package/dist/index95.mjs +6 -2
- package/dist/index96.mjs +4 -5
- package/dist/index97.mjs +168 -1123
- package/dist/index98.mjs +53 -20
- package/dist/index99.mjs +69 -55
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/providers/MetaPixelProvider.d.ts +2 -1
- package/dist/providers/MetaPixelProvider.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/contexts/CartContext.tsx +50 -22
- package/src/lib/utils.ts +11 -0
- package/src/providers/MetaPixelProvider.tsx +16 -3
package/dist/index27.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { createRpcClients as
|
|
3
|
-
|
|
4
|
-
async function
|
|
5
|
-
const t = await
|
|
6
|
-
param: { brandId:
|
|
2
|
+
import { createRpcClients as s } from "./index26.mjs";
|
|
3
|
+
const c = "https://oms-api.instock.com.ng";
|
|
4
|
+
async function a(o) {
|
|
5
|
+
const t = await s(c).products[":brandId"].$get({
|
|
6
|
+
param: { brandId: o }
|
|
7
7
|
});
|
|
8
8
|
if (!t.ok)
|
|
9
9
|
throw new Error(`Failed to fetch products: ${t.statusText}`);
|
|
10
10
|
return t.json();
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
13
|
-
const t = await
|
|
14
|
-
param: { slug:
|
|
12
|
+
async function d(o) {
|
|
13
|
+
const t = await s(c).products.product[":slug"].$get({
|
|
14
|
+
param: { slug: o }
|
|
15
15
|
});
|
|
16
16
|
if (!t.ok)
|
|
17
17
|
throw new Error(`Failed to fetch product: ${t.statusText}`);
|
|
18
18
|
return t.json();
|
|
19
19
|
}
|
|
20
|
-
async function i(
|
|
21
|
-
const
|
|
22
|
-
param: { slug:
|
|
23
|
-
query:
|
|
20
|
+
async function i(o, n) {
|
|
21
|
+
const r = await s(c).productAddons[":slug"].$get({
|
|
22
|
+
param: { slug: o },
|
|
23
|
+
query: n !== void 0 ? { limit: String(n) } : {}
|
|
24
24
|
});
|
|
25
|
-
if (!
|
|
26
|
-
throw new Error(`Failed to fetch product add-ons: ${
|
|
27
|
-
return
|
|
25
|
+
if (!r.ok)
|
|
26
|
+
throw new Error(`Failed to fetch product add-ons: ${r.statusText}`);
|
|
27
|
+
return r.json();
|
|
28
28
|
}
|
|
29
29
|
export {
|
|
30
30
|
i as fetchProductAddons,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
d as fetchProductBySlug,
|
|
32
|
+
a as fetchProductsByBrand
|
|
33
33
|
};
|
package/dist/index270.mjs
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
function t(e) {
|
|
15
|
-
return e.startsWith("/") ? e : "/" + e;
|
|
16
|
-
}
|
|
17
|
-
}(r), r);
|
|
2
|
+
function h(r, a) {
|
|
3
|
+
let s = 0, u = 1e3 / a, e, t;
|
|
4
|
+
const n = (l, o = Date.now()) => {
|
|
5
|
+
s = o, e = null, t && (clearTimeout(t), t = null), r(...l);
|
|
6
|
+
};
|
|
7
|
+
return [(...l) => {
|
|
8
|
+
const o = Date.now(), i = o - s;
|
|
9
|
+
i >= u ? n(l, o) : (e = l, t || (t = setTimeout(() => {
|
|
10
|
+
t = null, n(e);
|
|
11
|
+
}, u - i)));
|
|
12
|
+
}, () => e && n(e)];
|
|
18
13
|
}
|
|
19
14
|
export {
|
|
20
|
-
|
|
15
|
+
h as default
|
|
21
16
|
};
|
package/dist/index271.mjs
CHANGED
|
@@ -1,50 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
value: !0
|
|
8
|
-
});
|
|
9
|
-
function a(e, n) {
|
|
10
|
-
for (var t in n) Object.defineProperty(e, t, {
|
|
11
|
-
enumerable: !0,
|
|
12
|
-
get: n[t]
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
a(i, {
|
|
16
|
-
DEFAULT_SEGMENT_KEY: function() {
|
|
17
|
-
return E;
|
|
18
|
-
},
|
|
19
|
-
PAGE_SEGMENT_KEY: function() {
|
|
20
|
-
return r;
|
|
21
|
-
},
|
|
22
|
-
addSearchParamsIfPageSegment: function() {
|
|
23
|
-
return s;
|
|
24
|
-
},
|
|
25
|
-
isGroupSegment: function() {
|
|
26
|
-
return c;
|
|
27
|
-
},
|
|
28
|
-
isParallelRouteSegment: function() {
|
|
29
|
-
return f;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
function c(e) {
|
|
33
|
-
return e[0] === "(" && e.endsWith(")");
|
|
34
|
-
}
|
|
35
|
-
function f(e) {
|
|
36
|
-
return e.startsWith("@") && e !== "@children";
|
|
37
|
-
}
|
|
38
|
-
function s(e, n) {
|
|
39
|
-
if (e.includes(r)) {
|
|
40
|
-
const o = JSON.stringify(n);
|
|
41
|
-
return o !== "{}" ? r + "?" + o : r;
|
|
42
|
-
}
|
|
43
|
-
return e;
|
|
44
|
-
}
|
|
45
|
-
const r = "__PAGE__", E = "__DEFAULT__";
|
|
46
|
-
}(u), u);
|
|
47
|
-
}
|
|
2
|
+
import o from "./index150.mjs";
|
|
3
|
+
const n = o.hasStandardBrowserEnv ? /* @__PURE__ */ ((r, e) => (t) => (t = new URL(t, o.origin), r.protocol === t.protocol && r.host === t.host && (e || r.port === t.port)))(
|
|
4
|
+
new URL(o.origin),
|
|
5
|
+
o.navigator && /(msie|trident)/i.test(o.navigator.userAgent)
|
|
6
|
+
) : () => !0;
|
|
48
7
|
export {
|
|
49
|
-
|
|
8
|
+
n as default
|
|
50
9
|
};
|
package/dist/index272.mjs
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
2
|
+
import r from "./index83.mjs";
|
|
3
|
+
import c from "./index150.mjs";
|
|
4
|
+
const p = c.hasStandardBrowserEnv ? (
|
|
5
|
+
// Standard browser envs support document.cookie
|
|
6
|
+
{
|
|
7
|
+
write(e, t, n, i, s, u) {
|
|
8
|
+
const o = [e + "=" + encodeURIComponent(t)];
|
|
9
|
+
r.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), r.isString(i) && o.push("path=" + i), r.isString(s) && o.push("domain=" + s), u === !0 && o.push("secure"), document.cookie = o.join("; ");
|
|
10
|
+
},
|
|
11
|
+
read(e) {
|
|
12
|
+
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
13
|
+
return t ? decodeURIComponent(t[3]) : null;
|
|
14
|
+
},
|
|
15
|
+
remove(e) {
|
|
16
|
+
this.write(e, "", Date.now() - 864e5);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
) : (
|
|
20
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
21
|
+
{
|
|
22
|
+
write() {
|
|
23
|
+
},
|
|
24
|
+
read() {
|
|
25
|
+
return null;
|
|
26
|
+
},
|
|
27
|
+
remove() {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
3
31
|
export {
|
|
4
|
-
|
|
32
|
+
p as default
|
|
5
33
|
};
|
package/dist/index273.mjs
CHANGED
package/dist/index275.mjs
CHANGED
package/dist/index28.mjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { createRpcClients as
|
|
3
|
-
|
|
4
|
-
async function
|
|
5
|
-
const s = await
|
|
6
|
-
param: { id:
|
|
2
|
+
import { createRpcClients as o } from "./index26.mjs";
|
|
3
|
+
const r = "https://oms-api.instock.com.ng";
|
|
4
|
+
async function m(n) {
|
|
5
|
+
const s = await o(r).carts[":id"].$get({
|
|
6
|
+
param: { id: n }
|
|
7
7
|
});
|
|
8
8
|
if (!s.ok)
|
|
9
9
|
throw new Error(`Failed to fetch cart: ${s.statusText}`);
|
|
10
10
|
return s.json();
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
13
|
-
const s = await
|
|
14
|
-
json: { brandSlug:
|
|
12
|
+
async function p(n) {
|
|
13
|
+
const s = await o(r).carts.index.$post({
|
|
14
|
+
json: { brandSlug: n }
|
|
15
15
|
});
|
|
16
16
|
if (!s.ok)
|
|
17
17
|
throw new Error(`Failed to create cart: ${s.statusText}`);
|
|
18
18
|
return s.json();
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
21
|
-
const t = await
|
|
22
|
-
param: { id:
|
|
20
|
+
async function w(n, e) {
|
|
21
|
+
const t = await o(r).carts[":id"].$patch({
|
|
22
|
+
param: { id: n },
|
|
23
23
|
// @ts-expect-error - Hono RPC type inference issue
|
|
24
|
-
json:
|
|
24
|
+
json: e
|
|
25
25
|
});
|
|
26
26
|
if (!t.ok)
|
|
27
27
|
throw new Error(`Failed to update cart: ${t.statusText}`);
|
|
28
28
|
return t.json();
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
31
|
-
const
|
|
32
|
-
param: { id:
|
|
30
|
+
async function f(n, e, s, t, a, c, d) {
|
|
31
|
+
const i = await o(r).carts[":id"].items.$post({
|
|
32
|
+
param: { id: n },
|
|
33
33
|
// @ts-expect-error - Hono RPC type inference issue
|
|
34
|
-
json: { sku:
|
|
34
|
+
json: { sku: e, quantity: s, fbc: t, fbp: a, ttp: c, ttclid: d }
|
|
35
35
|
});
|
|
36
|
-
if (!
|
|
37
|
-
throw new Error(`Failed to add item to cart: ${
|
|
38
|
-
return
|
|
36
|
+
if (!i.ok)
|
|
37
|
+
throw new Error(`Failed to add item to cart: ${i.statusText}`);
|
|
38
|
+
return i.json();
|
|
39
39
|
}
|
|
40
|
-
async function h(
|
|
41
|
-
const a = await
|
|
42
|
-
param: { id:
|
|
40
|
+
async function h(n, e, s) {
|
|
41
|
+
const a = await o(r).carts[":id"].items[":itemId"].$patch({
|
|
42
|
+
param: { id: n, itemId: e },
|
|
43
43
|
// @ts-expect-error - Hono RPC type inference issue
|
|
44
44
|
json: { quantity: s }
|
|
45
45
|
});
|
|
@@ -47,61 +47,72 @@ async function h(e, r, s) {
|
|
|
47
47
|
throw new Error(`Failed to update cart item: ${a.statusText}`);
|
|
48
48
|
return a.json();
|
|
49
49
|
}
|
|
50
|
-
async function
|
|
51
|
-
const t = await
|
|
52
|
-
param: { id:
|
|
50
|
+
async function $(n, e) {
|
|
51
|
+
const t = await o(r).carts[":id"].items[":itemId"].$delete({
|
|
52
|
+
param: { id: n, itemId: e }
|
|
53
53
|
});
|
|
54
54
|
if (!t.ok)
|
|
55
55
|
throw new Error(`Failed to remove cart item: ${t.statusText}`);
|
|
56
56
|
return t.json();
|
|
57
57
|
}
|
|
58
|
-
async function
|
|
59
|
-
const t = await
|
|
60
|
-
param: { id:
|
|
58
|
+
async function j(n, e) {
|
|
59
|
+
const t = await o(r).carts[":id"]["apply-discount"].$post({
|
|
60
|
+
param: { id: n },
|
|
61
61
|
// @ts-expect-error - Hono RPC type inference issue
|
|
62
|
-
json: { code:
|
|
62
|
+
json: { code: e }
|
|
63
63
|
});
|
|
64
64
|
if (!t.ok)
|
|
65
65
|
throw new Error(`Failed to apply discount: ${t.statusText}`);
|
|
66
66
|
return t.json();
|
|
67
67
|
}
|
|
68
|
-
async function k(
|
|
69
|
-
const s = await
|
|
70
|
-
param: { id:
|
|
68
|
+
async function k(n) {
|
|
69
|
+
const s = await o(r).carts[":id"]["remove-discount"].$post({
|
|
70
|
+
param: { id: n }
|
|
71
71
|
});
|
|
72
72
|
if (!s.ok)
|
|
73
73
|
throw new Error(`Failed to remove discount: ${s.statusText}`);
|
|
74
74
|
return s.json();
|
|
75
75
|
}
|
|
76
|
-
async function
|
|
77
|
-
const t = await
|
|
78
|
-
param: { id:
|
|
76
|
+
async function y(n, e) {
|
|
77
|
+
const t = await o(r).carts[":id"].checkout.$post({
|
|
78
|
+
param: { id: n },
|
|
79
79
|
// @ts-expect-error - Hono RPC type inference issue
|
|
80
|
-
json:
|
|
80
|
+
json: e
|
|
81
81
|
});
|
|
82
82
|
if (!t.ok)
|
|
83
83
|
throw new Error(`Failed to checkout cart: ${t.statusText}`);
|
|
84
84
|
return t.json();
|
|
85
85
|
}
|
|
86
|
-
async function
|
|
87
|
-
const t = await
|
|
88
|
-
param: { id:
|
|
86
|
+
async function x(n, e) {
|
|
87
|
+
const t = await o(r).carts[":id"]["initiate-checkout"].$post({
|
|
88
|
+
param: { id: n },
|
|
89
|
+
// @ts-expect-error - Hono RPC type inference issue
|
|
90
|
+
json: e
|
|
91
|
+
});
|
|
92
|
+
if (!t.ok)
|
|
93
|
+
throw new Error(`Failed to initiate checkout intent: ${t.statusText}`);
|
|
94
|
+
return t.json();
|
|
95
|
+
}
|
|
96
|
+
async function E(n, e) {
|
|
97
|
+
const t = await o(r).carts[":id"].recommendations.$get({
|
|
98
|
+
param: { id: n },
|
|
89
99
|
// @ts-ignore - Hono RPC type inference issue with query parameters
|
|
90
|
-
query: { limit:
|
|
100
|
+
query: { limit: e.toString() }
|
|
91
101
|
});
|
|
92
102
|
if (!t.ok)
|
|
93
103
|
throw new Error(`Failed to fetch cart recommendations: ${t.statusText}`);
|
|
94
104
|
return t.json();
|
|
95
105
|
}
|
|
96
106
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
f as addCartItem,
|
|
108
|
+
j as applyDiscount,
|
|
109
|
+
y as checkoutCart,
|
|
110
|
+
p as createCart,
|
|
111
|
+
m as fetchCart,
|
|
102
112
|
E as fetchCartRecommendations,
|
|
103
|
-
|
|
113
|
+
x as initiateCheckout,
|
|
114
|
+
$ as removeCartItem,
|
|
104
115
|
k as removeDiscount,
|
|
105
|
-
|
|
116
|
+
w as updateCart,
|
|
106
117
|
h as updateCartItem
|
|
107
118
|
};
|
package/dist/index29.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { createRpcClients as s } from "./index26.mjs";
|
|
3
|
-
|
|
4
|
-
async function
|
|
3
|
+
const i = "https://oms-api.instock.com.ng";
|
|
4
|
+
async function a(r, o) {
|
|
5
5
|
const t = await s(i).orders[":id"][":token"].$get({
|
|
6
|
-
param: { id: r, token:
|
|
6
|
+
param: { id: r, token: o }
|
|
7
7
|
});
|
|
8
8
|
if (!t.ok)
|
|
9
9
|
throw new Error(`Failed to fetch order: ${t.statusText}`);
|
|
10
10
|
return t.json();
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
12
|
+
async function d(r, o) {
|
|
13
13
|
const t = await s(i).orders.confirm.$post({
|
|
14
|
-
json: { orderId: r, token:
|
|
14
|
+
json: { orderId: r, token: o }
|
|
15
15
|
});
|
|
16
16
|
if (!t.ok)
|
|
17
17
|
throw new Error(`Failed to confirm order: ${t.statusText}`);
|
|
18
18
|
return t.json();
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
20
|
+
async function m(r, o, e = 4) {
|
|
21
21
|
const n = await s(i).orders[":id"][":token"].recommendations.$get({
|
|
22
|
-
param: { id: r, token:
|
|
22
|
+
param: { id: r, token: o },
|
|
23
23
|
// @ts-ignore - Hono RPC type inference issue with query parameters
|
|
24
|
-
query: { limit: String(
|
|
24
|
+
query: { limit: String(e) }
|
|
25
25
|
});
|
|
26
26
|
if (!n.ok)
|
|
27
27
|
throw new Error(`Failed to fetch order recommendations: ${n.statusText}`);
|
|
28
28
|
return n.json();
|
|
29
29
|
}
|
|
30
30
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
d as confirmOrder,
|
|
32
|
+
a as fetchOrder,
|
|
33
|
+
m as fetchOrderRecommendations
|
|
34
34
|
};
|