@moonbase.sh/storefront 0.2.41 → 0.2.43
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/moonbase.js +107 -98
- package/dist/moonbase.umd.cjs +3 -3
- package/package.json +2 -2
package/dist/moonbase.js
CHANGED
|
@@ -479,13 +479,13 @@ class Ee {
|
|
|
479
479
|
return Bt.create(this, this._def);
|
|
480
480
|
}
|
|
481
481
|
promise() {
|
|
482
|
-
return
|
|
482
|
+
return Fr.create(this, this._def);
|
|
483
483
|
}
|
|
484
484
|
or(t) {
|
|
485
|
-
return
|
|
485
|
+
return No.create([this, t], this._def);
|
|
486
486
|
}
|
|
487
487
|
and(t) {
|
|
488
|
-
return
|
|
488
|
+
return So.create(this, t, this._def);
|
|
489
489
|
}
|
|
490
490
|
transform(t) {
|
|
491
491
|
return new Zt({
|
|
@@ -497,7 +497,7 @@ class Ee {
|
|
|
497
497
|
}
|
|
498
498
|
default(t) {
|
|
499
499
|
const n = typeof t == "function" ? t : () => t;
|
|
500
|
-
return new
|
|
500
|
+
return new Po({
|
|
501
501
|
...we(this._def),
|
|
502
502
|
innerType: this,
|
|
503
503
|
defaultValue: n,
|
|
@@ -513,7 +513,7 @@ class Ee {
|
|
|
513
513
|
}
|
|
514
514
|
catch(t) {
|
|
515
515
|
const n = typeof t == "function" ? t : () => t;
|
|
516
|
-
return new
|
|
516
|
+
return new Do({
|
|
517
517
|
...we(this._def),
|
|
518
518
|
innerType: this,
|
|
519
519
|
catchValue: n,
|
|
@@ -531,7 +531,7 @@ class Ee {
|
|
|
531
531
|
return Zo.create(this, t);
|
|
532
532
|
}
|
|
533
533
|
readonly() {
|
|
534
|
-
return
|
|
534
|
+
return $o.create(this);
|
|
535
535
|
}
|
|
536
536
|
isOptional() {
|
|
537
537
|
return this.safeParse(void 0).success;
|
|
@@ -1350,7 +1350,7 @@ Eo.create = (e) => new Eo({
|
|
|
1350
1350
|
typeName: me.ZodUndefined,
|
|
1351
1351
|
...we(e)
|
|
1352
1352
|
});
|
|
1353
|
-
class
|
|
1353
|
+
class Oo extends Ee {
|
|
1354
1354
|
_parse(t) {
|
|
1355
1355
|
if (this._getType(t) !== re.null) {
|
|
1356
1356
|
const r = this._getOrReturnCtx(t);
|
|
@@ -1363,11 +1363,11 @@ class Ur extends Ee {
|
|
|
1363
1363
|
return wt(t.data);
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
|
-
|
|
1366
|
+
Oo.create = (e) => new Oo({
|
|
1367
1367
|
typeName: me.ZodNull,
|
|
1368
1368
|
...we(e)
|
|
1369
1369
|
});
|
|
1370
|
-
class
|
|
1370
|
+
class Ur extends Ee {
|
|
1371
1371
|
constructor() {
|
|
1372
1372
|
super(...arguments), this._any = !0;
|
|
1373
1373
|
}
|
|
@@ -1375,7 +1375,7 @@ class Fr extends Ee {
|
|
|
1375
1375
|
return wt(t.data);
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
|
-
|
|
1378
|
+
Ur.create = (e) => new Ur({
|
|
1379
1379
|
typeName: me.ZodAny,
|
|
1380
1380
|
...we(e)
|
|
1381
1381
|
});
|
|
@@ -1798,7 +1798,7 @@ ze.lazycreate = (e, t) => new ze({
|
|
|
1798
1798
|
typeName: me.ZodObject,
|
|
1799
1799
|
...we(t)
|
|
1800
1800
|
});
|
|
1801
|
-
class
|
|
1801
|
+
class No extends Ee {
|
|
1802
1802
|
_parse(t) {
|
|
1803
1803
|
const { ctx: n } = this._processInputParams(t), r = this._def.options;
|
|
1804
1804
|
function o(s) {
|
|
@@ -1866,12 +1866,12 @@ class Oo extends Ee {
|
|
|
1866
1866
|
return this._def.options;
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
|
-
|
|
1869
|
+
No.create = (e, t) => new No({
|
|
1870
1870
|
options: e,
|
|
1871
1871
|
typeName: me.ZodUnion,
|
|
1872
1872
|
...we(t)
|
|
1873
1873
|
});
|
|
1874
|
-
const pn = (e) => e instanceof
|
|
1874
|
+
const pn = (e) => e instanceof ko ? pn(e.schema) : e instanceof Zt ? pn(e.innerType()) : e instanceof To ? [e.value] : e instanceof Zn ? e.options : e instanceof Co ? Ce.objectValues(e.enum) : e instanceof Po ? pn(e._def.innerType) : e instanceof Eo ? [void 0] : e instanceof Oo ? [null] : e instanceof en ? [void 0, ...pn(e.unwrap())] : e instanceof qn ? [null, ...pn(e.unwrap())] : e instanceof Ea || e instanceof $o ? pn(e.unwrap()) : e instanceof Do ? pn(e._def.innerType) : [];
|
|
1875
1875
|
class Ks extends Ee {
|
|
1876
1876
|
_parse(t) {
|
|
1877
1877
|
const { ctx: n } = this._processInputParams(t);
|
|
@@ -1960,7 +1960,7 @@ function Zi(e, t) {
|
|
|
1960
1960
|
return { valid: !0, data: o };
|
|
1961
1961
|
} else return n === re.date && r === re.date && +e == +t ? { valid: !0, data: e } : { valid: !1 };
|
|
1962
1962
|
}
|
|
1963
|
-
class
|
|
1963
|
+
class So extends Ee {
|
|
1964
1964
|
_parse(t) {
|
|
1965
1965
|
const { status: n, ctx: r } = this._processInputParams(t), o = (s, i) => {
|
|
1966
1966
|
if (Bi(s) || Bi(i))
|
|
@@ -1992,7 +1992,7 @@ class No extends Ee {
|
|
|
1992
1992
|
}));
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
|
-
|
|
1995
|
+
So.create = (e, t, n) => new So({
|
|
1996
1996
|
left: e,
|
|
1997
1997
|
right: t,
|
|
1998
1998
|
typeName: me.ZodIntersection,
|
|
@@ -2048,7 +2048,7 @@ an.create = (e, t) => {
|
|
|
2048
2048
|
...we(t)
|
|
2049
2049
|
});
|
|
2050
2050
|
};
|
|
2051
|
-
class
|
|
2051
|
+
class xo extends Ee {
|
|
2052
2052
|
get keySchema() {
|
|
2053
2053
|
return this._def.keyType;
|
|
2054
2054
|
}
|
|
@@ -2076,12 +2076,12 @@ class So extends Ee {
|
|
|
2076
2076
|
return this._def.valueType;
|
|
2077
2077
|
}
|
|
2078
2078
|
static create(t, n, r) {
|
|
2079
|
-
return n instanceof Ee ? new
|
|
2079
|
+
return n instanceof Ee ? new xo({
|
|
2080
2080
|
keyType: t,
|
|
2081
2081
|
valueType: n,
|
|
2082
2082
|
typeName: me.ZodRecord,
|
|
2083
2083
|
...we(r)
|
|
2084
|
-
}) : new
|
|
2084
|
+
}) : new xo({
|
|
2085
2085
|
keyType: Ft.create(),
|
|
2086
2086
|
valueType: t,
|
|
2087
2087
|
typeName: me.ZodRecord,
|
|
@@ -2246,7 +2246,7 @@ class Vr extends Ee {
|
|
|
2246
2246
|
});
|
|
2247
2247
|
}
|
|
2248
2248
|
const s = { errorMap: n.common.contextualErrorMap }, i = n.data;
|
|
2249
|
-
if (this._def.returns instanceof
|
|
2249
|
+
if (this._def.returns instanceof Fr) {
|
|
2250
2250
|
const a = this;
|
|
2251
2251
|
return wt(async function(...l) {
|
|
2252
2252
|
const u = new Dt([]), c = await a._def.args.parseAsync(l, s).catch((m) => {
|
|
@@ -2302,7 +2302,7 @@ class Vr extends Ee {
|
|
|
2302
2302
|
});
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
|
-
class
|
|
2305
|
+
class ko extends Ee {
|
|
2306
2306
|
get schema() {
|
|
2307
2307
|
return this._def.getter();
|
|
2308
2308
|
}
|
|
@@ -2311,12 +2311,12 @@ class xo extends Ee {
|
|
|
2311
2311
|
return this._def.getter()._parse({ data: n.data, path: n.path, parent: n });
|
|
2312
2312
|
}
|
|
2313
2313
|
}
|
|
2314
|
-
|
|
2314
|
+
ko.create = (e, t) => new ko({
|
|
2315
2315
|
getter: e,
|
|
2316
2316
|
typeName: me.ZodLazy,
|
|
2317
2317
|
...we(t)
|
|
2318
2318
|
});
|
|
2319
|
-
class
|
|
2319
|
+
class To extends Ee {
|
|
2320
2320
|
_parse(t) {
|
|
2321
2321
|
if (t.data !== this._def.value) {
|
|
2322
2322
|
const n = this._getOrReturnCtx(t);
|
|
@@ -2332,7 +2332,7 @@ class ko extends Ee {
|
|
|
2332
2332
|
return this._def.value;
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
2335
|
-
|
|
2335
|
+
To.create = (e, t) => new To({
|
|
2336
2336
|
value: e,
|
|
2337
2337
|
typeName: me.ZodLiteral,
|
|
2338
2338
|
...we(t)
|
|
@@ -2403,7 +2403,7 @@ class Zn extends Ee {
|
|
|
2403
2403
|
}
|
|
2404
2404
|
so = /* @__PURE__ */ new WeakMap();
|
|
2405
2405
|
Zn.create = Lu;
|
|
2406
|
-
class
|
|
2406
|
+
class Co extends Ee {
|
|
2407
2407
|
constructor() {
|
|
2408
2408
|
super(...arguments), io.set(this, void 0);
|
|
2409
2409
|
}
|
|
@@ -2432,12 +2432,12 @@ class To extends Ee {
|
|
|
2432
2432
|
}
|
|
2433
2433
|
}
|
|
2434
2434
|
io = /* @__PURE__ */ new WeakMap();
|
|
2435
|
-
|
|
2435
|
+
Co.create = (e, t) => new Co({
|
|
2436
2436
|
values: e,
|
|
2437
2437
|
typeName: me.ZodNativeEnum,
|
|
2438
2438
|
...we(t)
|
|
2439
2439
|
});
|
|
2440
|
-
class
|
|
2440
|
+
class Fr extends Ee {
|
|
2441
2441
|
unwrap() {
|
|
2442
2442
|
return this._def.type;
|
|
2443
2443
|
}
|
|
@@ -2456,7 +2456,7 @@ class Br extends Ee {
|
|
|
2456
2456
|
})));
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
|
-
|
|
2459
|
+
Fr.create = (e, t) => new Fr({
|
|
2460
2460
|
type: e,
|
|
2461
2461
|
typeName: me.ZodPromise,
|
|
2462
2462
|
...we(t)
|
|
@@ -2576,7 +2576,7 @@ qn.create = (e, t) => new qn({
|
|
|
2576
2576
|
typeName: me.ZodNullable,
|
|
2577
2577
|
...we(t)
|
|
2578
2578
|
});
|
|
2579
|
-
class
|
|
2579
|
+
class Po extends Ee {
|
|
2580
2580
|
_parse(t) {
|
|
2581
2581
|
const { ctx: n } = this._processInputParams(t);
|
|
2582
2582
|
let r = n.data;
|
|
@@ -2590,13 +2590,13 @@ class Co extends Ee {
|
|
|
2590
2590
|
return this._def.innerType;
|
|
2591
2591
|
}
|
|
2592
2592
|
}
|
|
2593
|
-
|
|
2593
|
+
Po.create = (e, t) => new Po({
|
|
2594
2594
|
innerType: e,
|
|
2595
2595
|
typeName: me.ZodDefault,
|
|
2596
2596
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2597
2597
|
...we(t)
|
|
2598
2598
|
});
|
|
2599
|
-
class
|
|
2599
|
+
class Do extends Ee {
|
|
2600
2600
|
_parse(t) {
|
|
2601
2601
|
const { ctx: n } = this._processInputParams(t), r = {
|
|
2602
2602
|
...n,
|
|
@@ -2633,7 +2633,7 @@ class Po extends Ee {
|
|
|
2633
2633
|
return this._def.innerType;
|
|
2634
2634
|
}
|
|
2635
2635
|
}
|
|
2636
|
-
|
|
2636
|
+
Do.create = (e, t) => new Do({
|
|
2637
2637
|
innerType: e,
|
|
2638
2638
|
typeName: me.ZodCatch,
|
|
2639
2639
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
@@ -2710,7 +2710,7 @@ class Zo extends Ee {
|
|
|
2710
2710
|
});
|
|
2711
2711
|
}
|
|
2712
2712
|
}
|
|
2713
|
-
class
|
|
2713
|
+
class $o extends Ee {
|
|
2714
2714
|
_parse(t) {
|
|
2715
2715
|
const n = this._def.innerType._parse(t), r = (o) => (bo(o) && (o.value = Object.freeze(o.value)), o);
|
|
2716
2716
|
return _o(n) ? n.then((o) => r(o)) : r(n);
|
|
@@ -2719,19 +2719,19 @@ class Do extends Ee {
|
|
|
2719
2719
|
return this._def.innerType;
|
|
2720
2720
|
}
|
|
2721
2721
|
}
|
|
2722
|
-
|
|
2722
|
+
$o.create = (e, t) => new $o({
|
|
2723
2723
|
innerType: e,
|
|
2724
2724
|
typeName: me.ZodReadonly,
|
|
2725
2725
|
...we(t)
|
|
2726
2726
|
});
|
|
2727
2727
|
function Mu(e, t = {}, n) {
|
|
2728
|
-
return e ?
|
|
2728
|
+
return e ? Ur.create().superRefine((r, o) => {
|
|
2729
2729
|
var s, i;
|
|
2730
2730
|
if (!e(r)) {
|
|
2731
2731
|
const a = typeof t == "function" ? t(r) : typeof t == "string" ? { message: t } : t, l = (i = (s = a.fatal) !== null && s !== void 0 ? s : n) !== null && i !== void 0 ? i : !0, u = typeof a == "string" ? { message: a } : a;
|
|
2732
2732
|
o.addIssue({ code: "custom", ...u, fatal: l });
|
|
2733
2733
|
}
|
|
2734
|
-
}) :
|
|
2734
|
+
}) : Ur.create();
|
|
2735
2735
|
}
|
|
2736
2736
|
const Xf = {
|
|
2737
2737
|
object: ze.lazycreate
|
|
@@ -2742,7 +2742,7 @@ var me;
|
|
|
2742
2742
|
})(me || (me = {}));
|
|
2743
2743
|
const Qf = (e, t = {
|
|
2744
2744
|
message: `Input not instance of ${e.name}`
|
|
2745
|
-
}) => Mu((n) => n instanceof e, t), Uu = Ft.create, Fu = Bn.create, ep = As.create, tp = Hn.create, Bu = wo.create, np = wr.create, rp = Ds.create, op = Eo.create, sp =
|
|
2745
|
+
}) => Mu((n) => n instanceof e, t), Uu = Ft.create, Fu = Bn.create, ep = As.create, tp = Hn.create, Bu = wo.create, np = wr.create, rp = Ds.create, op = Eo.create, sp = Oo.create, ip = Ur.create, ap = pr.create, lp = _n.create, up = $s.create, cp = Bt.create, dp = ze.create, fp = ze.strictCreate, pp = No.create, hp = Ks.create, mp = So.create, vp = an.create, gp = xo.create, yp = Is.create, bp = Er.create, _p = Vr.create, wp = ko.create, Ep = To.create, Op = Zn.create, Np = Co.create, Sp = Fr.create, wl = Zt.create, xp = en.create, kp = qn.create, Tp = Zt.createWithPreprocess, Cp = Zo.create, Pp = () => Uu().optional(), Dp = () => Fu().optional(), $p = () => Bu().optional(), Ip = {
|
|
2746
2746
|
string: (e) => Ft.create({ ...e, coerce: !0 }),
|
|
2747
2747
|
number: (e) => Bn.create({ ...e, coerce: !0 }),
|
|
2748
2748
|
boolean: (e) => wo.create({
|
|
@@ -2785,37 +2785,37 @@ var v = /* @__PURE__ */ Object.freeze({
|
|
|
2785
2785
|
ZodDate: wr,
|
|
2786
2786
|
ZodSymbol: Ds,
|
|
2787
2787
|
ZodUndefined: Eo,
|
|
2788
|
-
ZodNull:
|
|
2789
|
-
ZodAny:
|
|
2788
|
+
ZodNull: Oo,
|
|
2789
|
+
ZodAny: Ur,
|
|
2790
2790
|
ZodUnknown: pr,
|
|
2791
2791
|
ZodNever: _n,
|
|
2792
2792
|
ZodVoid: $s,
|
|
2793
2793
|
ZodArray: Bt,
|
|
2794
2794
|
ZodObject: ze,
|
|
2795
|
-
ZodUnion:
|
|
2795
|
+
ZodUnion: No,
|
|
2796
2796
|
ZodDiscriminatedUnion: Ks,
|
|
2797
|
-
ZodIntersection:
|
|
2797
|
+
ZodIntersection: So,
|
|
2798
2798
|
ZodTuple: an,
|
|
2799
|
-
ZodRecord:
|
|
2799
|
+
ZodRecord: xo,
|
|
2800
2800
|
ZodMap: Is,
|
|
2801
2801
|
ZodSet: Er,
|
|
2802
2802
|
ZodFunction: Vr,
|
|
2803
|
-
ZodLazy:
|
|
2804
|
-
ZodLiteral:
|
|
2803
|
+
ZodLazy: ko,
|
|
2804
|
+
ZodLiteral: To,
|
|
2805
2805
|
ZodEnum: Zn,
|
|
2806
|
-
ZodNativeEnum:
|
|
2807
|
-
ZodPromise:
|
|
2806
|
+
ZodNativeEnum: Co,
|
|
2807
|
+
ZodPromise: Fr,
|
|
2808
2808
|
ZodEffects: Zt,
|
|
2809
2809
|
ZodTransformer: Zt,
|
|
2810
2810
|
ZodOptional: en,
|
|
2811
2811
|
ZodNullable: qn,
|
|
2812
|
-
ZodDefault:
|
|
2813
|
-
ZodCatch:
|
|
2812
|
+
ZodDefault: Po,
|
|
2813
|
+
ZodCatch: Do,
|
|
2814
2814
|
ZodNaN: As,
|
|
2815
2815
|
BRAND: Yf,
|
|
2816
2816
|
ZodBranded: Ea,
|
|
2817
2817
|
ZodPipeline: Zo,
|
|
2818
|
-
ZodReadonly:
|
|
2818
|
+
ZodReadonly: $o,
|
|
2819
2819
|
custom: Mu,
|
|
2820
2820
|
Schema: Ee,
|
|
2821
2821
|
ZodSchema: Ee,
|
|
@@ -3190,27 +3190,27 @@ const Vs = /* @__PURE__ */ Vp(Rp);
|
|
|
3190
3190
|
var jp = Object.defineProperty, Hu = (e, t) => {
|
|
3191
3191
|
for (var n in t)
|
|
3192
3192
|
jp(e, n, { get: t[n], enumerable: !0 });
|
|
3193
|
-
},
|
|
3193
|
+
}, Br = v.record(v.number()), Lp = v.object({
|
|
3194
3194
|
type: v.literal("PercentageOffDiscount"),
|
|
3195
3195
|
name: v.string(),
|
|
3196
3196
|
description: v.string().optional(),
|
|
3197
3197
|
percentage: v.number(),
|
|
3198
|
-
total:
|
|
3198
|
+
total: Br.optional(),
|
|
3199
3199
|
isExclusive: v.boolean()
|
|
3200
3200
|
}), Mp = v.object({
|
|
3201
3201
|
type: v.literal("FlatAmountOffDiscount"),
|
|
3202
3202
|
name: v.string(),
|
|
3203
3203
|
description: v.string().optional(),
|
|
3204
|
-
total:
|
|
3204
|
+
total: Br.optional(),
|
|
3205
3205
|
isExclusive: v.boolean()
|
|
3206
3206
|
}), Oa = v.discriminatedUnion("type", [
|
|
3207
3207
|
Lp,
|
|
3208
3208
|
Mp
|
|
3209
|
-
]),
|
|
3209
|
+
]), Hr = v.object({
|
|
3210
3210
|
id: v.string(),
|
|
3211
3211
|
name: v.string(),
|
|
3212
|
-
originalPrice:
|
|
3213
|
-
price:
|
|
3212
|
+
originalPrice: Br,
|
|
3213
|
+
price: Br,
|
|
3214
3214
|
hasDiscount: v.boolean(),
|
|
3215
3215
|
discount: Oa.optional()
|
|
3216
3216
|
});
|
|
@@ -3258,8 +3258,8 @@ var Xt = /* @__PURE__ */ ((e) => (e.Universal = "Universal", e.Windows = "Window
|
|
|
3258
3258
|
owned: v.boolean(),
|
|
3259
3259
|
currentVersion: v.string().optional(),
|
|
3260
3260
|
downloads: Zu.array().optional(),
|
|
3261
|
-
defaultVariation:
|
|
3262
|
-
variations:
|
|
3261
|
+
defaultVariation: Hr.optional(),
|
|
3262
|
+
variations: Hr.array().optional(),
|
|
3263
3263
|
type: v.void().transform(() => "product").pipe(v.literal("product"))
|
|
3264
3264
|
}), qu = v.object({
|
|
3265
3265
|
id: v.string(),
|
|
@@ -3271,8 +3271,8 @@ var Xt = /* @__PURE__ */ ((e) => (e.Universal = "Universal", e.Windows = "Window
|
|
|
3271
3271
|
products: Gs.and(v.object({
|
|
3272
3272
|
included: v.boolean().optional()
|
|
3273
3273
|
})).array(),
|
|
3274
|
-
defaultVariation:
|
|
3275
|
-
variations:
|
|
3274
|
+
defaultVariation: Hr.optional(),
|
|
3275
|
+
variations: Hr.array().optional(),
|
|
3276
3276
|
type: v.void().transform(() => "bundle").pipe(v.literal("bundle"))
|
|
3277
3277
|
}), Up = v.object({
|
|
3278
3278
|
suggestedCurrency: v.string(),
|
|
@@ -3324,7 +3324,7 @@ var Xt = /* @__PURE__ */ ((e) => (e.Universal = "Universal", e.Windows = "Window
|
|
|
3324
3324
|
constructor(e) {
|
|
3325
3325
|
super(), this.name = "NotFoundError", this.message = e ?? "Not found";
|
|
3326
3326
|
}
|
|
3327
|
-
},
|
|
3327
|
+
}, Zr = class extends Error {
|
|
3328
3328
|
constructor(e, t, n, r) {
|
|
3329
3329
|
super(), this.title = e, this.detail = t, this.status = n, this.errors = r, this.name = "MoonbaseError", r && Object.values(r).length === 1 ? this.message = Object.values(r)[0] : this.message = t ?? e;
|
|
3330
3330
|
}
|
|
@@ -3355,7 +3355,7 @@ async function zi(e) {
|
|
|
3355
3355
|
} catch (n) {
|
|
3356
3356
|
throw console.warn("Could not handle response", { response: e, err: n, content: await e.text() }), new Error("An unknown problem occurred");
|
|
3357
3357
|
}
|
|
3358
|
-
throw new
|
|
3358
|
+
throw new Zr(
|
|
3359
3359
|
t.title,
|
|
3360
3360
|
t.detail,
|
|
3361
3361
|
t.status,
|
|
@@ -3412,7 +3412,7 @@ var Wu = v.object({
|
|
|
3412
3412
|
const r = await n.json(), o = Ki.parse(r);
|
|
3413
3413
|
return this.tokenStore.setUser(o), o;
|
|
3414
3414
|
} catch (r) {
|
|
3415
|
-
throw console.warn("Could not sign in user", { email: e, response: n, err: r }), new
|
|
3415
|
+
throw console.warn("Could not sign in user", { email: e, response: n, err: r }), new Zr("Bad response", "Could not sign in user", n.status);
|
|
3416
3416
|
}
|
|
3417
3417
|
}
|
|
3418
3418
|
async signUp(e, t, n, r, o, s, i) {
|
|
@@ -3431,7 +3431,7 @@ var Wu = v.object({
|
|
|
3431
3431
|
}
|
|
3432
3432
|
async update(e, t, n, r) {
|
|
3433
3433
|
return {
|
|
3434
|
-
needsEmailConfirmationToken: (await this.api.authenticatedFetch("/api/customer/identity",
|
|
3434
|
+
needsEmailConfirmationToken: (await this.api.authenticatedFetch("/api/customer/identity", null, {
|
|
3435
3435
|
method: "PATCH",
|
|
3436
3436
|
body: {
|
|
3437
3437
|
name: e,
|
|
@@ -3443,7 +3443,7 @@ var Wu = v.object({
|
|
|
3443
3443
|
};
|
|
3444
3444
|
}
|
|
3445
3445
|
async setPassword(e, t) {
|
|
3446
|
-
await this.api.authenticatedFetch("/api/customer/identity/set-password",
|
|
3446
|
+
await this.api.authenticatedFetch("/api/customer/identity/set-password", null, {
|
|
3447
3447
|
method: "POST",
|
|
3448
3448
|
body: {
|
|
3449
3449
|
currentPassword: e,
|
|
@@ -3452,7 +3452,7 @@ var Wu = v.object({
|
|
|
3452
3452
|
});
|
|
3453
3453
|
}
|
|
3454
3454
|
async forgotPassword(e) {
|
|
3455
|
-
await this.api.fetch(`/api/customer/identity/forgot-password?email=${encodeURIComponent(e)}`,
|
|
3455
|
+
await this.api.fetch(`/api/customer/identity/forgot-password?email=${encodeURIComponent(e)}`, null, { method: "POST" });
|
|
3456
3456
|
}
|
|
3457
3457
|
async resetPassword(e, t, n) {
|
|
3458
3458
|
const r = await Vs(`${this.api.baseUrl}/api/customer/identity/reset-password?email=${encodeURIComponent(e)}&code=${encodeURIComponent(n.replaceAll(" ", "+"))}`, {
|
|
@@ -3471,14 +3471,14 @@ var Wu = v.object({
|
|
|
3471
3471
|
try {
|
|
3472
3472
|
return Nl.parse(n.data);
|
|
3473
3473
|
} catch (r) {
|
|
3474
|
-
throw console.warn("Could not confirm user account", { email: e, code: t, response: n, err: r }), new
|
|
3474
|
+
throw console.warn("Could not confirm user account", { email: e, code: t, response: n, err: r }), new Zr("Bad response", "Could not confirm user account", n.status);
|
|
3475
3475
|
}
|
|
3476
3476
|
}
|
|
3477
3477
|
async confirmEmail(e, t) {
|
|
3478
|
-
await this.api.fetch(`/api/customer/identity/confirm-email?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ", "+"))}`,
|
|
3478
|
+
await this.api.fetch(`/api/customer/identity/confirm-email?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ", "+"))}`, null, { method: "POST" });
|
|
3479
3479
|
}
|
|
3480
3480
|
async confirmEmailChange(e, t) {
|
|
3481
|
-
await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ", "+"))}`,
|
|
3481
|
+
await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ", "+"))}`, null, { method: "POST" });
|
|
3482
3482
|
}
|
|
3483
3483
|
}, Ku = {};
|
|
3484
3484
|
Hu(Ku, {
|
|
@@ -3504,8 +3504,8 @@ var ao = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "Paymen
|
|
|
3504
3504
|
productId: v.string(),
|
|
3505
3505
|
quantity: v.number(),
|
|
3506
3506
|
variationId: v.string(),
|
|
3507
|
-
price:
|
|
3508
|
-
variation:
|
|
3507
|
+
price: Br.optional(),
|
|
3508
|
+
variation: Hr.optional(),
|
|
3509
3509
|
product: Ju.optional(),
|
|
3510
3510
|
appliedDiscount: Oa.optional()
|
|
3511
3511
|
}), zp = v.object({
|
|
@@ -3523,8 +3523,8 @@ var ao = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "Paymen
|
|
|
3523
3523
|
bundleId: v.string(),
|
|
3524
3524
|
quantity: v.number(),
|
|
3525
3525
|
variationId: v.string(),
|
|
3526
|
-
price:
|
|
3527
|
-
variation:
|
|
3526
|
+
price: Br.optional(),
|
|
3527
|
+
variation: Hr.optional(),
|
|
3528
3528
|
bundle: zp.optional(),
|
|
3529
3529
|
appliedDiscount: Oa.optional()
|
|
3530
3530
|
}), Sa = v.discriminatedUnion("type", [
|
|
@@ -3642,19 +3642,20 @@ var Yp = class {
|
|
|
3642
3642
|
i.status >= 400 && await zi(i);
|
|
3643
3643
|
let a;
|
|
3644
3644
|
try {
|
|
3645
|
-
return a = await i.json(), {
|
|
3646
|
-
data: t
|
|
3645
|
+
return a = t ? await i.json() : null, {
|
|
3646
|
+
data: t ? t.parse(a) : null,
|
|
3647
3647
|
headers: Object.fromEntries(i.headers.entries()),
|
|
3648
3648
|
status: i.status
|
|
3649
3649
|
};
|
|
3650
3650
|
} catch (l) {
|
|
3651
3651
|
throw console.warn("Could not parse response", {
|
|
3652
3652
|
status: i.status,
|
|
3653
|
+
path: e,
|
|
3653
3654
|
content: a || (i.bodyUsed ? "unknown" : await i.text()),
|
|
3654
3655
|
headers: Object.fromEntries(i.headers.entries()),
|
|
3655
3656
|
userAgent: window && window.navigator && window.navigator.userAgent,
|
|
3656
3657
|
err: l
|
|
3657
|
-
}), new
|
|
3658
|
+
}), new Zr("Bad response", "Could not parse server response", i.status);
|
|
3658
3659
|
}
|
|
3659
3660
|
}
|
|
3660
3661
|
}, nc = class lo {
|
|
@@ -3711,7 +3712,7 @@ var Yp = class {
|
|
|
3711
3712
|
if (t.status !== 200) {
|
|
3712
3713
|
if (t.status === 403 || t.status === 404)
|
|
3713
3714
|
return this.setUser(null), null;
|
|
3714
|
-
throw new
|
|
3715
|
+
throw new Zr("Unexpected result", `Could not refresh access token, status code ${t.status}`, t.status);
|
|
3715
3716
|
}
|
|
3716
3717
|
const n = Ki.parse(await t.json());
|
|
3717
3718
|
return this.setUser(n);
|
|
@@ -3794,7 +3795,7 @@ var Qp = nc, Sl = v.object({
|
|
|
3794
3795
|
)).data;
|
|
3795
3796
|
}
|
|
3796
3797
|
async revokeActivation(e, t) {
|
|
3797
|
-
await this.api.authenticatedFetch(`/api/customer/inventory/licenses/${e}/activations/${t}/revoke`,
|
|
3798
|
+
await this.api.authenticatedFetch(`/api/customer/inventory/licenses/${e}/activations/${t}/revoke`, null, { method: "POST" });
|
|
3798
3799
|
}
|
|
3799
3800
|
}, rh = class {
|
|
3800
3801
|
constructor(e) {
|
|
@@ -9791,27 +9792,35 @@ function pa(e) {
|
|
|
9791
9792
|
throw new Error("Added item does not have a default variation, and none have been specified");
|
|
9792
9793
|
const o = `${n.type === "bundle" ? "b" : "p"}/${n.id}/${r.id}`;
|
|
9793
9794
|
let s = t.currentOrder.value.items.find((i) => i.id === o);
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9795
|
+
if (s)
|
|
9796
|
+
s.quantity += 1;
|
|
9797
|
+
else if (n.type === "bundle")
|
|
9798
|
+
s = {
|
|
9799
|
+
id: o,
|
|
9800
|
+
type: "Bundle",
|
|
9801
|
+
bundleId: n.id,
|
|
9802
|
+
bundle: n,
|
|
9803
|
+
quantity: 1,
|
|
9804
|
+
variation: r,
|
|
9805
|
+
variationId: r.id,
|
|
9806
|
+
price: r.price,
|
|
9807
|
+
appliedDiscount: r.discount
|
|
9808
|
+
}, t.currentOrder.value.items.push(s);
|
|
9809
|
+
else if (n.type === "product")
|
|
9810
|
+
s = {
|
|
9811
|
+
id: o,
|
|
9812
|
+
type: "Product",
|
|
9813
|
+
productId: n.id,
|
|
9814
|
+
product: n,
|
|
9815
|
+
quantity: 1,
|
|
9816
|
+
variation: r,
|
|
9817
|
+
variationId: r.id,
|
|
9818
|
+
price: r.price,
|
|
9819
|
+
appliedDiscount: r.discount
|
|
9820
|
+
}, t.currentOrder.value.items.push(s);
|
|
9821
|
+
else
|
|
9822
|
+
throw new Zr("Invalid input", `Could not handle item of type '${n.type}'`);
|
|
9823
|
+
return t.pushOrderContent(), s;
|
|
9815
9824
|
},
|
|
9816
9825
|
setQuantity: (n, r) => {
|
|
9817
9826
|
const o = t.currentOrder.value.items.find((s) => s.id === n.id);
|
|
@@ -9821,7 +9830,7 @@ function pa(e) {
|
|
|
9821
9830
|
const s = t.currentOrder.value.items.findIndex((i) => i.id === o.id);
|
|
9822
9831
|
t.currentOrder.value.items.splice(s, 1);
|
|
9823
9832
|
}
|
|
9824
|
-
t.pushOrderContent();
|
|
9833
|
+
return t.pushOrderContent(), n;
|
|
9825
9834
|
},
|
|
9826
9835
|
removeFromCart: (n) => {
|
|
9827
9836
|
const r = t.currentOrder.value.items.findIndex((o) => o.id === n.id);
|