@jsdev_ninja/core 0.9.1 → 0.10.1
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/core.cjs.js +1 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.es.js +48 -44
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/entities/Cart.d.ts +7 -0
- package/dist/entities/Cart.d.ts.map +1 -1
- package/dist/entities/Order.d.ts +9 -0
- package/dist/entities/Order.d.ts.map +1 -1
- package/dist/entities/Product.d.ts +6 -0
- package/dist/entities/Product.d.ts.map +1 -1
- package/dist/entities/Product.js +4 -1
- package/dist/entities/Store.d.ts +3 -0
- package/dist/entities/Store.d.ts.map +1 -1
- package/dist/entities/Store.js +1 -0
- package/lib/entities/Product.ts +4 -1
- package/lib/entities/Store.ts +1 -0
- package/package.json +1 -1
package/dist/core.es.js
CHANGED
|
@@ -329,7 +329,7 @@ class O {
|
|
|
329
329
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
const
|
|
332
|
+
const je = (r, e) => {
|
|
333
333
|
if (z(e))
|
|
334
334
|
return { success: !0, data: e.value };
|
|
335
335
|
if (!r.common.issues.length)
|
|
@@ -416,7 +416,7 @@ class _ {
|
|
|
416
416
|
data: e,
|
|
417
417
|
parsedType: R(e)
|
|
418
418
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
419
|
-
return
|
|
419
|
+
return je(s, a);
|
|
420
420
|
}
|
|
421
421
|
"~validate"(e) {
|
|
422
422
|
var t, n;
|
|
@@ -470,7 +470,7 @@ class _ {
|
|
|
470
470
|
data: e,
|
|
471
471
|
parsedType: R(e)
|
|
472
472
|
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (ee(s) ? s : Promise.resolve(s));
|
|
473
|
-
return
|
|
473
|
+
return je(n, a);
|
|
474
474
|
}
|
|
475
475
|
refine(e, t) {
|
|
476
476
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
@@ -486,7 +486,7 @@ class _ {
|
|
|
486
486
|
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
|
|
487
487
|
}
|
|
488
488
|
_refinement(e) {
|
|
489
|
-
return new
|
|
489
|
+
return new I({
|
|
490
490
|
schema: this,
|
|
491
491
|
typeName: y.ZodEffects,
|
|
492
492
|
effect: { type: "refinement", refinement: e }
|
|
@@ -503,7 +503,7 @@ class _ {
|
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
505
|
optional() {
|
|
506
|
-
return
|
|
506
|
+
return N.create(this, this._def);
|
|
507
507
|
}
|
|
508
508
|
nullable() {
|
|
509
509
|
return D.create(this, this._def);
|
|
@@ -524,7 +524,7 @@ class _ {
|
|
|
524
524
|
return ae.create(this, e, this._def);
|
|
525
525
|
}
|
|
526
526
|
transform(e) {
|
|
527
|
-
return new
|
|
527
|
+
return new I({
|
|
528
528
|
...v(this._def),
|
|
529
529
|
schema: this,
|
|
530
530
|
typeName: y.ZodEffects,
|
|
@@ -541,7 +541,7 @@ class _ {
|
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
brand() {
|
|
544
|
-
return new
|
|
544
|
+
return new Ie({
|
|
545
545
|
typeName: y.ZodBranded,
|
|
546
546
|
type: this,
|
|
547
547
|
...v(this._def)
|
|
@@ -1586,7 +1586,7 @@ function B(r) {
|
|
|
1586
1586
|
const e = {};
|
|
1587
1587
|
for (const t in r.shape) {
|
|
1588
1588
|
const n = r.shape[t];
|
|
1589
|
-
e[t] =
|
|
1589
|
+
e[t] = N.create(B(n));
|
|
1590
1590
|
}
|
|
1591
1591
|
return new x({
|
|
1592
1592
|
...r._def,
|
|
@@ -1595,7 +1595,7 @@ function B(r) {
|
|
|
1595
1595
|
} else return r instanceof A ? new A({
|
|
1596
1596
|
...r._def,
|
|
1597
1597
|
type: B(r.element)
|
|
1598
|
-
}) : r instanceof
|
|
1598
|
+
}) : r instanceof N ? N.create(B(r.unwrap())) : r instanceof D ? D.create(B(r.unwrap())) : r instanceof j ? j.create(r.items.map((e) => B(e))) : r;
|
|
1599
1599
|
}
|
|
1600
1600
|
class x extends _ {
|
|
1601
1601
|
constructor() {
|
|
@@ -1850,7 +1850,7 @@ class x extends _ {
|
|
|
1850
1850
|
t[n] = this.shape[n];
|
|
1851
1851
|
else {
|
|
1852
1852
|
let a = this.shape[n];
|
|
1853
|
-
for (; a instanceof
|
|
1853
|
+
for (; a instanceof N; )
|
|
1854
1854
|
a = a._def.innerType;
|
|
1855
1855
|
t[n] = a;
|
|
1856
1856
|
}
|
|
@@ -1957,7 +1957,7 @@ se.create = (r, e) => new se({
|
|
|
1957
1957
|
typeName: y.ZodUnion,
|
|
1958
1958
|
...v(e)
|
|
1959
1959
|
});
|
|
1960
|
-
const
|
|
1960
|
+
const E = (r) => r instanceof oe ? E(r.schema) : r instanceof I ? E(r.innerType()) : r instanceof de ? [r.value] : r instanceof V ? r.options : r instanceof ce ? b.objectValues(r.enum) : r instanceof ue ? E(r._def.innerType) : r instanceof re ? [void 0] : r instanceof ne ? [null] : r instanceof N ? [void 0, ...E(r.unwrap())] : r instanceof D ? [null, ...E(r.unwrap())] : r instanceof Ie || r instanceof fe ? E(r.unwrap()) : r instanceof le ? E(r._def.innerType) : [];
|
|
1961
1961
|
class ke extends _ {
|
|
1962
1962
|
_parse(e) {
|
|
1963
1963
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2002,7 +2002,7 @@ class ke extends _ {
|
|
|
2002
2002
|
static create(e, t, n) {
|
|
2003
2003
|
const s = /* @__PURE__ */ new Map();
|
|
2004
2004
|
for (const a of t) {
|
|
2005
|
-
const i =
|
|
2005
|
+
const i = E(a.shape[e]);
|
|
2006
2006
|
if (!i.length)
|
|
2007
2007
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2008
2008
|
for (const o of i) {
|
|
@@ -2084,7 +2084,7 @@ ae.create = (r, e, t) => new ae({
|
|
|
2084
2084
|
typeName: y.ZodIntersection,
|
|
2085
2085
|
...v(t)
|
|
2086
2086
|
});
|
|
2087
|
-
class
|
|
2087
|
+
class j extends _ {
|
|
2088
2088
|
_parse(e) {
|
|
2089
2089
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2090
2090
|
if (n.parsedType !== h.array)
|
|
@@ -2118,16 +2118,16 @@ class E extends _ {
|
|
|
2118
2118
|
return this._def.items;
|
|
2119
2119
|
}
|
|
2120
2120
|
rest(e) {
|
|
2121
|
-
return new
|
|
2121
|
+
return new j({
|
|
2122
2122
|
...this._def,
|
|
2123
2123
|
rest: e
|
|
2124
2124
|
});
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
|
-
|
|
2127
|
+
j.create = (r, e) => {
|
|
2128
2128
|
if (!Array.isArray(r))
|
|
2129
2129
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2130
|
-
return new
|
|
2130
|
+
return new j({
|
|
2131
2131
|
items: r,
|
|
2132
2132
|
typeName: y.ZodTuple,
|
|
2133
2133
|
rest: null,
|
|
@@ -2364,7 +2364,7 @@ class q extends _ {
|
|
|
2364
2364
|
args(...e) {
|
|
2365
2365
|
return new q({
|
|
2366
2366
|
...this._def,
|
|
2367
|
-
args:
|
|
2367
|
+
args: j.create(e).rest(L.create())
|
|
2368
2368
|
});
|
|
2369
2369
|
}
|
|
2370
2370
|
returns(e) {
|
|
@@ -2381,7 +2381,7 @@ class q extends _ {
|
|
|
2381
2381
|
}
|
|
2382
2382
|
static create(e, t, n) {
|
|
2383
2383
|
return new q({
|
|
2384
|
-
args: e ||
|
|
2384
|
+
args: e || j.create([]).rest(L.create()),
|
|
2385
2385
|
returns: t || L.create(),
|
|
2386
2386
|
typeName: y.ZodFunction,
|
|
2387
2387
|
...v(n)
|
|
@@ -2547,7 +2547,7 @@ H.create = (r, e) => new H({
|
|
|
2547
2547
|
typeName: y.ZodPromise,
|
|
2548
2548
|
...v(e)
|
|
2549
2549
|
});
|
|
2550
|
-
class
|
|
2550
|
+
class I extends _ {
|
|
2551
2551
|
innerType() {
|
|
2552
2552
|
return this._def.schema;
|
|
2553
2553
|
}
|
|
@@ -2624,19 +2624,19 @@ class N extends _ {
|
|
|
2624
2624
|
b.assertNever(s);
|
|
2625
2625
|
}
|
|
2626
2626
|
}
|
|
2627
|
-
|
|
2627
|
+
I.create = (r, e, t) => new I({
|
|
2628
2628
|
schema: r,
|
|
2629
2629
|
typeName: y.ZodEffects,
|
|
2630
2630
|
effect: e,
|
|
2631
2631
|
...v(t)
|
|
2632
2632
|
});
|
|
2633
|
-
|
|
2633
|
+
I.createWithPreprocess = (r, e, t) => new I({
|
|
2634
2634
|
schema: e,
|
|
2635
2635
|
effect: { type: "preprocess", transform: r },
|
|
2636
2636
|
typeName: y.ZodEffects,
|
|
2637
2637
|
...v(t)
|
|
2638
2638
|
});
|
|
2639
|
-
class
|
|
2639
|
+
class N extends _ {
|
|
2640
2640
|
_parse(e) {
|
|
2641
2641
|
return this._getType(e) === h.undefined ? Z(void 0) : this._def.innerType._parse(e);
|
|
2642
2642
|
}
|
|
@@ -2644,7 +2644,7 @@ class I extends _ {
|
|
|
2644
2644
|
return this._def.innerType;
|
|
2645
2645
|
}
|
|
2646
2646
|
}
|
|
2647
|
-
|
|
2647
|
+
N.create = (r, e) => new N({
|
|
2648
2648
|
innerType: r,
|
|
2649
2649
|
typeName: y.ZodOptional,
|
|
2650
2650
|
...v(e)
|
|
@@ -2743,7 +2743,7 @@ xe.create = (r) => new xe({
|
|
|
2743
2743
|
...v(r)
|
|
2744
2744
|
});
|
|
2745
2745
|
const yt = Symbol("zod_brand");
|
|
2746
|
-
class
|
|
2746
|
+
class Ie extends _ {
|
|
2747
2747
|
_parse(e) {
|
|
2748
2748
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2749
2749
|
return this._def.type._parse({
|
|
@@ -2810,7 +2810,7 @@ fe.create = (r, e) => new fe({
|
|
|
2810
2810
|
typeName: y.ZodReadonly,
|
|
2811
2811
|
...v(e)
|
|
2812
2812
|
});
|
|
2813
|
-
function
|
|
2813
|
+
function Ee(r, e) {
|
|
2814
2814
|
const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
|
|
2815
2815
|
return typeof t == "string" ? { message: t } : t;
|
|
2816
2816
|
}
|
|
@@ -2822,12 +2822,12 @@ function ze(r, e = {}, t) {
|
|
|
2822
2822
|
return o.then((f) => {
|
|
2823
2823
|
var u, p;
|
|
2824
2824
|
if (!f) {
|
|
2825
|
-
const T =
|
|
2825
|
+
const T = Ee(e, n), me = (p = (u = T.fatal) !== null && u !== void 0 ? u : t) !== null && p !== void 0 ? p : !0;
|
|
2826
2826
|
s.addIssue({ code: "custom", ...T, fatal: me });
|
|
2827
2827
|
}
|
|
2828
2828
|
});
|
|
2829
2829
|
if (!o) {
|
|
2830
|
-
const f =
|
|
2830
|
+
const f = Ee(e, n), u = (i = (a = f.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0;
|
|
2831
2831
|
s.addIssue({ code: "custom", ...f, fatal: u });
|
|
2832
2832
|
}
|
|
2833
2833
|
}) : Y.create();
|
|
@@ -2841,7 +2841,7 @@ var y;
|
|
|
2841
2841
|
})(y || (y = {}));
|
|
2842
2842
|
const vt = (r, e = {
|
|
2843
2843
|
message: `Input not instance of ${r.name}`
|
|
2844
|
-
}) => ze((t) => t instanceof r, e), Ue = C.create, Fe = $.create, _t = xe.create, bt = M.create, Be = te.create, xt = U.create, kt = ve.create, wt = re.create, Tt = ne.create, Zt = Y.create, St = L.create, Ct = P.create, At = _e.create,
|
|
2844
|
+
}) => ze((t) => t instanceof r, e), Ue = C.create, Fe = $.create, _t = xe.create, bt = M.create, Be = te.create, xt = U.create, kt = ve.create, wt = re.create, Tt = ne.create, Zt = Y.create, St = L.create, Ct = P.create, At = _e.create, It = A.create, Nt = x.create, Ot = x.strictCreate, jt = se.create, Et = ke.create, Rt = ae.create, Pt = j.create, $t = ie.create, Mt = be.create, Vt = F.create, Dt = q.create, Lt = oe.create, zt = de.create, Ut = V.create, Ft = ce.create, Bt = H.create, Re = I.create, Wt = N.create, qt = D.create, Jt = I.createWithPreprocess, Yt = he.create, Ht = () => Ue().optional(), Gt = () => Fe().optional(), Qt = () => Be().optional(), Xt = {
|
|
2845
2845
|
string: (r) => C.create({ ...r, coerce: !0 }),
|
|
2846
2846
|
number: (r) => $.create({ ...r, coerce: !0 }),
|
|
2847
2847
|
boolean: (r) => te.create({
|
|
@@ -2894,7 +2894,7 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
2894
2894
|
ZodUnion: se,
|
|
2895
2895
|
ZodDiscriminatedUnion: ke,
|
|
2896
2896
|
ZodIntersection: ae,
|
|
2897
|
-
ZodTuple:
|
|
2897
|
+
ZodTuple: j,
|
|
2898
2898
|
ZodRecord: ie,
|
|
2899
2899
|
ZodMap: be,
|
|
2900
2900
|
ZodSet: F,
|
|
@@ -2904,15 +2904,15 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
2904
2904
|
ZodEnum: V,
|
|
2905
2905
|
ZodNativeEnum: ce,
|
|
2906
2906
|
ZodPromise: H,
|
|
2907
|
-
ZodEffects:
|
|
2908
|
-
ZodTransformer:
|
|
2909
|
-
ZodOptional:
|
|
2907
|
+
ZodEffects: I,
|
|
2908
|
+
ZodTransformer: I,
|
|
2909
|
+
ZodOptional: N,
|
|
2910
2910
|
ZodNullable: D,
|
|
2911
2911
|
ZodDefault: ue,
|
|
2912
2912
|
ZodCatch: le,
|
|
2913
2913
|
ZodNaN: xe,
|
|
2914
2914
|
BRAND: yt,
|
|
2915
|
-
ZodBranded:
|
|
2915
|
+
ZodBranded: Ie,
|
|
2916
2916
|
ZodPipeline: he,
|
|
2917
2917
|
ZodReadonly: fe,
|
|
2918
2918
|
custom: ze,
|
|
@@ -2924,11 +2924,11 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
2924
2924
|
},
|
|
2925
2925
|
coerce: Xt,
|
|
2926
2926
|
any: Zt,
|
|
2927
|
-
array:
|
|
2927
|
+
array: It,
|
|
2928
2928
|
bigint: bt,
|
|
2929
2929
|
boolean: Be,
|
|
2930
2930
|
date: xt,
|
|
2931
|
-
discriminatedUnion:
|
|
2931
|
+
discriminatedUnion: Et,
|
|
2932
2932
|
effect: Re,
|
|
2933
2933
|
enum: Ut,
|
|
2934
2934
|
function: Dt,
|
|
@@ -2943,7 +2943,7 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
2943
2943
|
null: Tt,
|
|
2944
2944
|
nullable: qt,
|
|
2945
2945
|
number: Fe,
|
|
2946
|
-
object:
|
|
2946
|
+
object: Nt,
|
|
2947
2947
|
oboolean: Qt,
|
|
2948
2948
|
onumber: Gt,
|
|
2949
2949
|
optional: Wt,
|
|
@@ -2959,7 +2959,7 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
2959
2959
|
transformer: Re,
|
|
2960
2960
|
tuple: Pt,
|
|
2961
2961
|
undefined: wt,
|
|
2962
|
-
union:
|
|
2962
|
+
union: jt,
|
|
2963
2963
|
unknown: St,
|
|
2964
2964
|
void: At,
|
|
2965
2965
|
NEVER: Kt,
|
|
@@ -2986,13 +2986,13 @@ const k = d.string().min(1, { message: "שדה חובה" }), ar = d.string().reg
|
|
|
2986
2986
|
tag: d.string().min(1),
|
|
2987
2987
|
locales: d.array(K),
|
|
2988
2988
|
depth: d.number()
|
|
2989
|
-
}),
|
|
2990
|
-
children: d.lazy(() =>
|
|
2989
|
+
}), Ne = We.extend({
|
|
2990
|
+
children: d.lazy(() => Ne.array())
|
|
2991
2991
|
}), or = We.extend({
|
|
2992
2992
|
index: d.number(),
|
|
2993
2993
|
depth: d.number(),
|
|
2994
2994
|
collapsed: d.boolean().optional(),
|
|
2995
|
-
children: d.array(
|
|
2995
|
+
children: d.array(Ne)
|
|
2996
2996
|
}), G = d.string().min(1), Oe = d.object({
|
|
2997
2997
|
type: d.literal("Product"),
|
|
2998
2998
|
storeId: G,
|
|
@@ -3032,8 +3032,10 @@ const k = d.string().min(1, { message: "שדה חובה" }), ar = d.string().reg
|
|
|
3032
3032
|
ingredients: d.array(K),
|
|
3033
3033
|
created_at: d.number(),
|
|
3034
3034
|
updated_at: d.number(),
|
|
3035
|
-
|
|
3036
|
-
//
|
|
3035
|
+
categoryIds: d.array(d.string().nonempty()),
|
|
3036
|
+
// @deprecated
|
|
3037
|
+
categoryList: d.array(Ne),
|
|
3038
|
+
// @deprecated
|
|
3037
3039
|
categories: d.object({
|
|
3038
3040
|
lvl0: d.array(d.string()),
|
|
3039
3041
|
lvl1: d.array(d.string()),
|
|
@@ -3041,6 +3043,7 @@ const k = d.string().min(1, { message: "שדה חובה" }), ar = d.string().reg
|
|
|
3041
3043
|
lvl3: d.array(d.string()),
|
|
3042
3044
|
lvl4: d.array(d.string())
|
|
3043
3045
|
}),
|
|
3046
|
+
// @deprecated
|
|
3044
3047
|
categoryNames: d.array(d.string())
|
|
3045
3048
|
}), dr = Oe.extend({
|
|
3046
3049
|
image: d.instanceof(File).optional()
|
|
@@ -3152,8 +3155,9 @@ d.object({
|
|
|
3152
3155
|
name: d.string(),
|
|
3153
3156
|
urls: d.array(d.string()),
|
|
3154
3157
|
logoUrl: d.string(),
|
|
3155
|
-
tenantId: d.string()
|
|
3158
|
+
tenantId: d.string(),
|
|
3156
3159
|
// firebase auth tenantId
|
|
3160
|
+
paymentType: d.enum(["external", "j5"])
|
|
3157
3161
|
});
|
|
3158
3162
|
const rr = {
|
|
3159
3163
|
stores: "STORES",
|
|
@@ -3187,7 +3191,7 @@ export {
|
|
|
3187
3191
|
er as AddressSchema,
|
|
3188
3192
|
We as BaseCategorySchema,
|
|
3189
3193
|
cr as CartSchema,
|
|
3190
|
-
|
|
3194
|
+
Ne as CategorySchema,
|
|
3191
3195
|
ur as CompanySchema,
|
|
3192
3196
|
lr as FavoriteProductSchema,
|
|
3193
3197
|
mr as FirebaseAPI,
|