@jsdev_ninja/core 0.8.51 → 0.8.53
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 +128 -131
- 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/firebase-api/index.d.ts +2 -10
- package/dist/firebase-api/index.d.ts.map +1 -1
- package/dist/firebase-api/index.js +0 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/lib/firebase-api/index.ts +16 -7
- package/lib/index.tsx +1 -1
- package/package.json +1 -1
package/dist/core.es.js
CHANGED
|
@@ -101,7 +101,7 @@ const h = b.arrayToEnum([
|
|
|
101
101
|
"invalid_intersection_types",
|
|
102
102
|
"not_multiple_of",
|
|
103
103
|
"not_finite"
|
|
104
|
-
]),
|
|
104
|
+
]), Qe = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
105
105
|
class I extends Error {
|
|
106
106
|
get errors() {
|
|
107
107
|
return this.issues;
|
|
@@ -219,7 +219,7 @@ const J = (r, e) => {
|
|
|
219
219
|
return { message: t };
|
|
220
220
|
};
|
|
221
221
|
let Le = J;
|
|
222
|
-
function
|
|
222
|
+
function Ke(r) {
|
|
223
223
|
Le = r;
|
|
224
224
|
}
|
|
225
225
|
function ye() {
|
|
@@ -245,7 +245,7 @@ const ve = (r) => {
|
|
|
245
245
|
path: a,
|
|
246
246
|
message: c
|
|
247
247
|
};
|
|
248
|
-
},
|
|
248
|
+
}, Xe = [];
|
|
249
249
|
function l(r, e) {
|
|
250
250
|
const t = ye(), n = ve({
|
|
251
251
|
issueData: e,
|
|
@@ -576,14 +576,14 @@ class _ {
|
|
|
576
576
|
return this.safeParse(null).success;
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
const
|
|
579
|
+
const et = /^c[^\s-]{8,}$/i, tt = /^[0-9a-z]+$/, rt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, nt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, st = /^[a-z0-9_-]{21}$/i, at = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, it = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ot = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ct = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
580
580
|
let Ie;
|
|
581
|
-
const
|
|
581
|
+
const dt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ut = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, lt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, ft = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ht = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, mt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ue = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", pt = new RegExp(`^${Ue}$`);
|
|
582
582
|
function Fe(r) {
|
|
583
583
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
584
584
|
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function gt(r) {
|
|
587
587
|
return new RegExp(`^${Fe(r)}$`);
|
|
588
588
|
}
|
|
589
589
|
function Be(r) {
|
|
@@ -591,11 +591,11 @@ function Be(r) {
|
|
|
591
591
|
const t = [];
|
|
592
592
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
593
593
|
}
|
|
594
|
-
function
|
|
595
|
-
return !!((e === "v4" || !e) &&
|
|
594
|
+
function yt(r, e) {
|
|
595
|
+
return !!((e === "v4" || !e) && dt.test(r) || (e === "v6" || !e) && lt.test(r));
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
if (!
|
|
597
|
+
function vt(r, e) {
|
|
598
|
+
if (!at.test(r))
|
|
599
599
|
return !1;
|
|
600
600
|
try {
|
|
601
601
|
const [t] = r.split("."), n = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
@@ -604,8 +604,8 @@ function _t(r, e) {
|
|
|
604
604
|
return !1;
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
return !!((e === "v4" || !e) &&
|
|
607
|
+
function _t(r, e) {
|
|
608
|
+
return !!((e === "v4" || !e) && ut.test(r) || (e === "v6" || !e) && ft.test(r));
|
|
609
609
|
}
|
|
610
610
|
class Z extends _ {
|
|
611
611
|
_parse(e) {
|
|
@@ -656,43 +656,43 @@ class Z extends _ {
|
|
|
656
656
|
message: a.message
|
|
657
657
|
}), n.dirty());
|
|
658
658
|
} else if (a.kind === "email")
|
|
659
|
-
|
|
659
|
+
ot.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
660
660
|
validation: "email",
|
|
661
661
|
code: d.invalid_string,
|
|
662
662
|
message: a.message
|
|
663
663
|
}), n.dirty());
|
|
664
664
|
else if (a.kind === "emoji")
|
|
665
|
-
Ie || (Ie = new RegExp(
|
|
665
|
+
Ie || (Ie = new RegExp(ct, "u")), Ie.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
666
666
|
validation: "emoji",
|
|
667
667
|
code: d.invalid_string,
|
|
668
668
|
message: a.message
|
|
669
669
|
}), n.dirty());
|
|
670
670
|
else if (a.kind === "uuid")
|
|
671
|
-
|
|
671
|
+
nt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
672
672
|
validation: "uuid",
|
|
673
673
|
code: d.invalid_string,
|
|
674
674
|
message: a.message
|
|
675
675
|
}), n.dirty());
|
|
676
676
|
else if (a.kind === "nanoid")
|
|
677
|
-
|
|
677
|
+
st.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
678
678
|
validation: "nanoid",
|
|
679
679
|
code: d.invalid_string,
|
|
680
680
|
message: a.message
|
|
681
681
|
}), n.dirty());
|
|
682
682
|
else if (a.kind === "cuid")
|
|
683
|
-
|
|
683
|
+
et.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
684
684
|
validation: "cuid",
|
|
685
685
|
code: d.invalid_string,
|
|
686
686
|
message: a.message
|
|
687
687
|
}), n.dirty());
|
|
688
688
|
else if (a.kind === "cuid2")
|
|
689
|
-
|
|
689
|
+
tt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
690
690
|
validation: "cuid2",
|
|
691
691
|
code: d.invalid_string,
|
|
692
692
|
message: a.message
|
|
693
693
|
}), n.dirty());
|
|
694
694
|
else if (a.kind === "ulid")
|
|
695
|
-
|
|
695
|
+
rt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
696
696
|
validation: "ulid",
|
|
697
697
|
code: d.invalid_string,
|
|
698
698
|
message: a.message
|
|
@@ -727,35 +727,35 @@ class Z extends _ {
|
|
|
727
727
|
code: d.invalid_string,
|
|
728
728
|
validation: "datetime",
|
|
729
729
|
message: a.message
|
|
730
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
730
|
+
}), n.dirty()) : a.kind === "date" ? pt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
731
731
|
code: d.invalid_string,
|
|
732
732
|
validation: "date",
|
|
733
733
|
message: a.message
|
|
734
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
734
|
+
}), n.dirty()) : a.kind === "time" ? gt(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
735
735
|
code: d.invalid_string,
|
|
736
736
|
validation: "time",
|
|
737
737
|
message: a.message
|
|
738
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
738
|
+
}), n.dirty()) : a.kind === "duration" ? it.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
739
739
|
validation: "duration",
|
|
740
740
|
code: d.invalid_string,
|
|
741
741
|
message: a.message
|
|
742
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
742
|
+
}), n.dirty()) : a.kind === "ip" ? yt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
743
743
|
validation: "ip",
|
|
744
744
|
code: d.invalid_string,
|
|
745
745
|
message: a.message
|
|
746
|
-
}), n.dirty()) : a.kind === "jwt" ?
|
|
746
|
+
}), n.dirty()) : a.kind === "jwt" ? vt(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
747
747
|
validation: "jwt",
|
|
748
748
|
code: d.invalid_string,
|
|
749
749
|
message: a.message
|
|
750
|
-
}), n.dirty()) : a.kind === "cidr" ?
|
|
750
|
+
}), n.dirty()) : a.kind === "cidr" ? _t(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
751
751
|
validation: "cidr",
|
|
752
752
|
code: d.invalid_string,
|
|
753
753
|
message: a.message
|
|
754
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
754
|
+
}), n.dirty()) : a.kind === "base64" ? ht.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
755
755
|
validation: "base64",
|
|
756
756
|
code: d.invalid_string,
|
|
757
757
|
message: a.message
|
|
758
|
-
}), n.dirty()) : a.kind === "base64url" ?
|
|
758
|
+
}), n.dirty()) : a.kind === "base64url" ? mt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
759
759
|
validation: "base64url",
|
|
760
760
|
code: d.invalid_string,
|
|
761
761
|
message: a.message
|
|
@@ -994,7 +994,7 @@ Z.create = (r) => {
|
|
|
994
994
|
...v(r)
|
|
995
995
|
});
|
|
996
996
|
};
|
|
997
|
-
function
|
|
997
|
+
function bt(r, e) {
|
|
998
998
|
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), o = parseInt(e.toFixed(s).replace(".", ""));
|
|
999
999
|
return a % o / Math.pow(10, s);
|
|
1000
1000
|
}
|
|
@@ -1033,7 +1033,7 @@ class D extends _ {
|
|
|
1033
1033
|
inclusive: a.inclusive,
|
|
1034
1034
|
exact: !1,
|
|
1035
1035
|
message: a.message
|
|
1036
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
1036
|
+
}), s.dirty()) : a.kind === "multipleOf" ? bt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
1037
1037
|
code: d.not_multiple_of,
|
|
1038
1038
|
multipleOf: a.value,
|
|
1039
1039
|
message: a.message
|
|
@@ -2742,7 +2742,7 @@ we.create = (r) => new we({
|
|
|
2742
2742
|
typeName: g.ZodNaN,
|
|
2743
2743
|
...v(r)
|
|
2744
2744
|
});
|
|
2745
|
-
const
|
|
2745
|
+
const xt = Symbol("zod_brand");
|
|
2746
2746
|
class Re extends _ {
|
|
2747
2747
|
_parse(e) {
|
|
2748
2748
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
@@ -2832,16 +2832,16 @@ function Ye(r, e = {}, t) {
|
|
|
2832
2832
|
}
|
|
2833
2833
|
}) : G.create();
|
|
2834
2834
|
}
|
|
2835
|
-
const
|
|
2835
|
+
const kt = {
|
|
2836
2836
|
object: k.lazycreate
|
|
2837
2837
|
};
|
|
2838
2838
|
var g;
|
|
2839
2839
|
(function(r) {
|
|
2840
2840
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
2841
2841
|
})(g || (g = {}));
|
|
2842
|
-
const
|
|
2842
|
+
const wt = (r, e = {
|
|
2843
2843
|
message: `Input not instance of ${r.name}`
|
|
2844
|
-
}) => Ye((t) => t instanceof r, e), qe = Z.create, He = D.create,
|
|
2844
|
+
}) => Ye((t) => t instanceof r, e), qe = Z.create, He = D.create, Tt = we.create, St = V.create, Je = re.create, Ct = B.create, It = be.create, Zt = ne.create, Nt = se.create, At = G.create, jt = U.create, Ot = M.create, Et = xe.create, Rt = N.create, Pt = k.create, $t = k.strictCreate, Mt = ae.create, Dt = Te.create, Vt = ie.create, Lt = R.create, zt = oe.create, Ut = ke.create, Ft = W.create, Bt = H.create, Wt = ce.create, Yt = de.create, qt = L.create, Ht = ue.create, Jt = Q.create, Ve = A.create, Gt = O.create, Qt = z.create, Kt = A.createWithPreprocess, Xt = me.create, er = () => qe().optional(), tr = () => He().optional(), rr = () => Je().optional(), nr = {
|
|
2845
2845
|
string: (r) => Z.create({ ...r, coerce: !0 }),
|
|
2846
2846
|
number: (r) => D.create({ ...r, coerce: !0 }),
|
|
2847
2847
|
boolean: (r) => re.create({
|
|
@@ -2850,14 +2850,14 @@ const Tt = (r, e = {
|
|
|
2850
2850
|
}),
|
|
2851
2851
|
bigint: (r) => V.create({ ...r, coerce: !0 }),
|
|
2852
2852
|
date: (r) => B.create({ ...r, coerce: !0 })
|
|
2853
|
-
},
|
|
2853
|
+
}, sr = y;
|
|
2854
2854
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2855
2855
|
__proto__: null,
|
|
2856
2856
|
defaultErrorMap: J,
|
|
2857
|
-
setErrorMap:
|
|
2857
|
+
setErrorMap: Ke,
|
|
2858
2858
|
getErrorMap: ye,
|
|
2859
2859
|
makeIssue: ve,
|
|
2860
|
-
EMPTY_PATH:
|
|
2860
|
+
EMPTY_PATH: Xe,
|
|
2861
2861
|
addIssueToContext: l,
|
|
2862
2862
|
ParseStatus: w,
|
|
2863
2863
|
INVALID: y,
|
|
@@ -2911,63 +2911,63 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2911
2911
|
ZodDefault: le,
|
|
2912
2912
|
ZodCatch: fe,
|
|
2913
2913
|
ZodNaN: we,
|
|
2914
|
-
BRAND:
|
|
2914
|
+
BRAND: xt,
|
|
2915
2915
|
ZodBranded: Re,
|
|
2916
2916
|
ZodPipeline: me,
|
|
2917
2917
|
ZodReadonly: he,
|
|
2918
2918
|
custom: Ye,
|
|
2919
2919
|
Schema: _,
|
|
2920
2920
|
ZodSchema: _,
|
|
2921
|
-
late:
|
|
2921
|
+
late: kt,
|
|
2922
2922
|
get ZodFirstPartyTypeKind() {
|
|
2923
2923
|
return g;
|
|
2924
2924
|
},
|
|
2925
|
-
coerce:
|
|
2926
|
-
any:
|
|
2927
|
-
array:
|
|
2928
|
-
bigint:
|
|
2925
|
+
coerce: nr,
|
|
2926
|
+
any: At,
|
|
2927
|
+
array: Rt,
|
|
2928
|
+
bigint: St,
|
|
2929
2929
|
boolean: Je,
|
|
2930
|
-
date:
|
|
2931
|
-
discriminatedUnion:
|
|
2930
|
+
date: Ct,
|
|
2931
|
+
discriminatedUnion: Dt,
|
|
2932
2932
|
effect: Ve,
|
|
2933
|
-
enum:
|
|
2934
|
-
function:
|
|
2935
|
-
instanceof:
|
|
2936
|
-
intersection:
|
|
2937
|
-
lazy:
|
|
2938
|
-
literal:
|
|
2939
|
-
map:
|
|
2940
|
-
nan:
|
|
2941
|
-
nativeEnum:
|
|
2942
|
-
never:
|
|
2943
|
-
null:
|
|
2944
|
-
nullable:
|
|
2933
|
+
enum: qt,
|
|
2934
|
+
function: Bt,
|
|
2935
|
+
instanceof: wt,
|
|
2936
|
+
intersection: Vt,
|
|
2937
|
+
lazy: Wt,
|
|
2938
|
+
literal: Yt,
|
|
2939
|
+
map: Ut,
|
|
2940
|
+
nan: Tt,
|
|
2941
|
+
nativeEnum: Ht,
|
|
2942
|
+
never: Ot,
|
|
2943
|
+
null: Nt,
|
|
2944
|
+
nullable: Qt,
|
|
2945
2945
|
number: He,
|
|
2946
|
-
object:
|
|
2947
|
-
oboolean:
|
|
2948
|
-
onumber:
|
|
2949
|
-
optional:
|
|
2950
|
-
ostring:
|
|
2951
|
-
pipeline:
|
|
2952
|
-
preprocess:
|
|
2953
|
-
promise:
|
|
2954
|
-
record:
|
|
2955
|
-
set:
|
|
2956
|
-
strictObject:
|
|
2946
|
+
object: Pt,
|
|
2947
|
+
oboolean: rr,
|
|
2948
|
+
onumber: tr,
|
|
2949
|
+
optional: Gt,
|
|
2950
|
+
ostring: er,
|
|
2951
|
+
pipeline: Xt,
|
|
2952
|
+
preprocess: Kt,
|
|
2953
|
+
promise: Jt,
|
|
2954
|
+
record: zt,
|
|
2955
|
+
set: Ft,
|
|
2956
|
+
strictObject: $t,
|
|
2957
2957
|
string: qe,
|
|
2958
|
-
symbol:
|
|
2958
|
+
symbol: It,
|
|
2959
2959
|
transformer: Ve,
|
|
2960
|
-
tuple:
|
|
2961
|
-
undefined:
|
|
2962
|
-
union:
|
|
2963
|
-
unknown:
|
|
2964
|
-
void:
|
|
2965
|
-
NEVER:
|
|
2960
|
+
tuple: Lt,
|
|
2961
|
+
undefined: Zt,
|
|
2962
|
+
union: Mt,
|
|
2963
|
+
unknown: jt,
|
|
2964
|
+
void: Et,
|
|
2965
|
+
NEVER: sr,
|
|
2966
2966
|
ZodIssueCode: d,
|
|
2967
|
-
quotelessJson:
|
|
2967
|
+
quotelessJson: Qe,
|
|
2968
2968
|
ZodError: I
|
|
2969
2969
|
});
|
|
2970
|
-
const
|
|
2970
|
+
const ar = i.object({
|
|
2971
2971
|
country: i.string(),
|
|
2972
2972
|
city: i.string(),
|
|
2973
2973
|
street: i.string(),
|
|
@@ -2975,10 +2975,10 @@ const ir = i.object({
|
|
|
2975
2975
|
floor: i.string(),
|
|
2976
2976
|
apartmentEnterNumber: i.string(),
|
|
2977
2977
|
apartmentNumber: i.string()
|
|
2978
|
-
}), C = i.enum(["True", "False"]),
|
|
2978
|
+
}), C = i.enum(["True", "False"]), ur = i.string().min(1), lr = i.string().regex(/^\d+$/, "Must be a numeric string"), ee = i.object({
|
|
2979
2979
|
lang: i.enum(["he"]),
|
|
2980
2980
|
value: i.string().min(1)
|
|
2981
|
-
}),
|
|
2981
|
+
}), fr = i.array(ee), Ge = i.object({
|
|
2982
2982
|
id: i.string().min(1),
|
|
2983
2983
|
companyId: i.string().min(1),
|
|
2984
2984
|
storeId: i.string().min(1),
|
|
@@ -2988,7 +2988,7 @@ const ir = i.object({
|
|
|
2988
2988
|
depth: i.number()
|
|
2989
2989
|
}), Pe = Ge.extend({
|
|
2990
2990
|
children: i.lazy(() => Pe.array())
|
|
2991
|
-
}),
|
|
2991
|
+
}), hr = Ge.extend({
|
|
2992
2992
|
index: i.number(),
|
|
2993
2993
|
depth: i.number(),
|
|
2994
2994
|
collapsed: i.boolean().optional(),
|
|
@@ -3042,15 +3042,15 @@ const ir = i.object({
|
|
|
3042
3042
|
lvl4: i.array(i.string())
|
|
3043
3043
|
}),
|
|
3044
3044
|
categoryNames: i.array(i.string())
|
|
3045
|
-
}),
|
|
3045
|
+
}), mr = Se.omit({
|
|
3046
3046
|
id: !0,
|
|
3047
3047
|
categories: !0,
|
|
3048
3048
|
images: !0
|
|
3049
3049
|
}).extend({
|
|
3050
3050
|
image: i.instanceof(File).optional()
|
|
3051
|
-
}),
|
|
3051
|
+
}), pr = Se.extend({
|
|
3052
3052
|
image: i.instanceof(File).optional()
|
|
3053
|
-
}),
|
|
3053
|
+
}), gr = i.object({
|
|
3054
3054
|
type: i.literal("Cart"),
|
|
3055
3055
|
id: i.string().uuid(),
|
|
3056
3056
|
companyId: i.string().uuid(),
|
|
@@ -3063,7 +3063,7 @@ const ir = i.object({
|
|
|
3063
3063
|
amount: i.number().int().positive({ message: "Quantity must be a positive integer." })
|
|
3064
3064
|
})
|
|
3065
3065
|
)
|
|
3066
|
-
}),
|
|
3066
|
+
}), yr = i.object({
|
|
3067
3067
|
id: i.string(),
|
|
3068
3068
|
name: i.string(),
|
|
3069
3069
|
websiteDomains: i.array(i.string()),
|
|
@@ -3073,14 +3073,14 @@ const ir = i.object({
|
|
|
3073
3073
|
mainEmail: i.string()
|
|
3074
3074
|
})
|
|
3075
3075
|
})
|
|
3076
|
-
}),
|
|
3076
|
+
}), vr = i.object({
|
|
3077
3077
|
type: i.literal("FavoriteProduct"),
|
|
3078
3078
|
id: i.string().uuid(),
|
|
3079
3079
|
companyId: i.string().uuid(),
|
|
3080
3080
|
storeId: i.string().uuid(),
|
|
3081
3081
|
userId: i.string().uuid(),
|
|
3082
3082
|
productId: i.string().uuid()
|
|
3083
|
-
}),
|
|
3083
|
+
}), ir = i.object({
|
|
3084
3084
|
type: i.literal("Profile"),
|
|
3085
3085
|
id: i.string(),
|
|
3086
3086
|
companyId: i.string(),
|
|
@@ -3093,12 +3093,12 @@ const ir = i.object({
|
|
|
3093
3093
|
code: i.string(),
|
|
3094
3094
|
number: i.string()
|
|
3095
3095
|
}),
|
|
3096
|
-
address:
|
|
3096
|
+
address: ar,
|
|
3097
3097
|
isAnonymous: i.boolean(),
|
|
3098
3098
|
createdDate: i.number(),
|
|
3099
3099
|
lastActivityDate: i.number()
|
|
3100
3100
|
});
|
|
3101
|
-
function
|
|
3101
|
+
function _r() {
|
|
3102
3102
|
return {
|
|
3103
3103
|
type: "Profile",
|
|
3104
3104
|
id: "",
|
|
@@ -3123,7 +3123,7 @@ function br() {
|
|
|
3123
3123
|
isAnonymous: !0
|
|
3124
3124
|
};
|
|
3125
3125
|
}
|
|
3126
|
-
const
|
|
3126
|
+
const br = i.object({
|
|
3127
3127
|
type: i.literal("Order"),
|
|
3128
3128
|
id: i.string(),
|
|
3129
3129
|
companyId: i.string(),
|
|
@@ -3153,7 +3153,7 @@ const xr = i.object({
|
|
|
3153
3153
|
// what store charge
|
|
3154
3154
|
date: i.number(),
|
|
3155
3155
|
deliveryDate: i.number().optional(),
|
|
3156
|
-
client:
|
|
3156
|
+
client: ir
|
|
3157
3157
|
}), x = i.string().min(1), j = i.string().regex(/^\d+$/, "Must be a numeric string"), $e = i.object({
|
|
3158
3158
|
Masof: x,
|
|
3159
3159
|
// store masof number
|
|
@@ -3175,7 +3175,7 @@ const xr = i.object({
|
|
|
3175
3175
|
MoreData: C.optional(),
|
|
3176
3176
|
// extra data in response
|
|
3177
3177
|
J5: C.optional()
|
|
3178
|
-
}),
|
|
3178
|
+
}), xr = $e.extend({
|
|
3179
3179
|
action: i.literal("soft"),
|
|
3180
3180
|
Info: x,
|
|
3181
3181
|
// text that will be displayed in transaction, report and the management system.
|
|
@@ -3198,7 +3198,7 @@ const xr = i.object({
|
|
|
3198
3198
|
Token: i.literal("True")
|
|
3199
3199
|
// CC2
|
|
3200
3200
|
// Coin
|
|
3201
|
-
}),
|
|
3201
|
+
}), kr = i.object({
|
|
3202
3202
|
action: i.literal("getToken"),
|
|
3203
3203
|
allowFalse: i.literal("True"),
|
|
3204
3204
|
Masof: x,
|
|
@@ -3207,14 +3207,14 @@ const xr = i.object({
|
|
|
3207
3207
|
// store masof password,
|
|
3208
3208
|
TransId: j
|
|
3209
3209
|
//todo api key is not required???
|
|
3210
|
-
}),
|
|
3210
|
+
}), wr = i.object({
|
|
3211
3211
|
Id: j,
|
|
3212
3212
|
Token: j,
|
|
3213
3213
|
Tokef: j,
|
|
3214
3214
|
// credit card validity date in the format YYMM
|
|
3215
3215
|
CCode: j
|
|
3216
3216
|
//0 code is valid
|
|
3217
|
-
}),
|
|
3217
|
+
}), Tr = $e.extend({
|
|
3218
3218
|
Id: x,
|
|
3219
3219
|
// transaction Id in Hypay
|
|
3220
3220
|
ACode: j,
|
|
@@ -3253,7 +3253,7 @@ const xr = i.object({
|
|
|
3253
3253
|
// UID unique value receive from response after successful transaction from request with action pay/soft
|
|
3254
3254
|
spType: i.string().optional(),
|
|
3255
3255
|
bincard: i.string().optional()
|
|
3256
|
-
}),
|
|
3256
|
+
}), Sr = $e.extend({
|
|
3257
3257
|
Masof: x,
|
|
3258
3258
|
// store masof number
|
|
3259
3259
|
PassP: x,
|
|
@@ -3310,36 +3310,25 @@ i.object({
|
|
|
3310
3310
|
// api key
|
|
3311
3311
|
})
|
|
3312
3312
|
});
|
|
3313
|
-
const
|
|
3313
|
+
const Cr = i.object({
|
|
3314
3314
|
storeEmail: i.string().email()
|
|
3315
|
-
}),
|
|
3316
|
-
products: "products"
|
|
3317
|
-
}, Qe = {
|
|
3318
|
-
getPath: ({
|
|
3319
|
-
companyId: r,
|
|
3320
|
-
storeId: e,
|
|
3321
|
-
collectionName: t
|
|
3322
|
-
}) => `${r}/${e}/${t}`,
|
|
3323
|
-
getProductsPath: ({ companyId: r, storeId: e }) => Qe.getPath({ companyId: r, storeId: e, collectionName: cr.products })
|
|
3324
|
-
}, Zr = {
|
|
3325
|
-
firestore: Qe
|
|
3326
|
-
}, ge = "https://pay.hyp.co.il/p/";
|
|
3315
|
+
}), ge = "https://pay.hyp.co.il/p/";
|
|
3327
3316
|
function Ne(r) {
|
|
3328
3317
|
return Object.keys(r).map((e) => `${encodeURIComponent(e)}=${encodeURIComponent(r[e])}`).join("&");
|
|
3329
3318
|
}
|
|
3330
|
-
function
|
|
3319
|
+
function or(r) {
|
|
3331
3320
|
if (!/^\d{4}$/.test(r))
|
|
3332
3321
|
throw new Error("Invalid YYMM format. Expected 4-digit string (YYMM).");
|
|
3333
3322
|
const e = r.slice(0, 2), t = r.slice(2, 4), n = (/* @__PURE__ */ new Date()).getFullYear(), a = Math.floor(n / 100) * 100 + parseInt(e, 10), o = n % 100, c = parseInt(e, 10) > o ? a - 100 : a;
|
|
3334
3323
|
return { month: t, year: c.toString() };
|
|
3335
3324
|
}
|
|
3336
|
-
function
|
|
3325
|
+
function cr(r) {
|
|
3337
3326
|
return r.split("&").reduce((e, t) => {
|
|
3338
3327
|
const [n, s] = t.split("=");
|
|
3339
3328
|
return n && s && (e[n] = decodeURIComponent(s)), e;
|
|
3340
3329
|
}, {});
|
|
3341
3330
|
}
|
|
3342
|
-
const
|
|
3331
|
+
const Ir = {
|
|
3343
3332
|
async chargeJ5Transaction(r) {
|
|
3344
3333
|
try {
|
|
3345
3334
|
const e = Ne({
|
|
@@ -3348,7 +3337,7 @@ const Nr = {
|
|
|
3348
3337
|
Masof: r.masof,
|
|
3349
3338
|
PassP: r.masofPassword,
|
|
3350
3339
|
TransId: r.transactionId
|
|
3351
|
-
}), n = await (await fetch(`${ge}?${e}`)).text(), s =
|
|
3340
|
+
}), n = await (await fetch(`${ge}?${e}`)).text(), s = cr(n), a = or(s.Tokef);
|
|
3352
3341
|
let o = Number(r.originalAmount) * 100;
|
|
3353
3342
|
const c = Ne({
|
|
3354
3343
|
action: "soft",
|
|
@@ -3389,34 +3378,42 @@ const Nr = {
|
|
|
3389
3378
|
return console.log(e), { success: !1, errMessage: e.message };
|
|
3390
3379
|
}
|
|
3391
3380
|
}
|
|
3381
|
+
}, dr = {
|
|
3382
|
+
getPath: ({
|
|
3383
|
+
companyId: r,
|
|
3384
|
+
storeId: e,
|
|
3385
|
+
collectionName: t
|
|
3386
|
+
}) => `${r}/${e}/${t}`
|
|
3387
|
+
}, Zr = {
|
|
3388
|
+
firestore: dr
|
|
3392
3389
|
};
|
|
3393
3390
|
export {
|
|
3394
|
-
|
|
3391
|
+
ar as AddressSchema,
|
|
3395
3392
|
Ge as BaseCategorySchema,
|
|
3396
|
-
|
|
3393
|
+
gr as CartSchema,
|
|
3397
3394
|
Pe as CategorySchema,
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3395
|
+
yr as CompanySchema,
|
|
3396
|
+
pr as EditProductSchema,
|
|
3397
|
+
vr as FavoriteProductSchema,
|
|
3401
3398
|
Zr as FirebaseAPI,
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3399
|
+
Sr as HypPaymentLinkRequestSchema,
|
|
3400
|
+
xr as HypSoftTransactionRequestSchema,
|
|
3401
|
+
kr as HypTokenRequestSchema,
|
|
3402
|
+
wr as HypTokenResponseSchema,
|
|
3406
3403
|
ee as LocaleSchema,
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3404
|
+
fr as LocaleValueSchema,
|
|
3405
|
+
mr as NewProductSchema,
|
|
3406
|
+
br as OrderSchema,
|
|
3410
3407
|
$e as PayProtocolGeneralSchema,
|
|
3411
|
-
|
|
3408
|
+
Tr as PayProtocolResponseSchema,
|
|
3412
3409
|
Se as ProductSchema,
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3410
|
+
ir as ProfileSchema,
|
|
3411
|
+
Cr as StorePrivateSchema,
|
|
3412
|
+
hr as TFlattenCategorySchema,
|
|
3413
|
+
_r as createEmptyProfile,
|
|
3417
3414
|
C as hypBooleanSchema,
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3415
|
+
Ir as hypPaymentService,
|
|
3416
|
+
ur as notEmptyTextSchema,
|
|
3417
|
+
lr as numericTextSchema
|
|
3421
3418
|
};
|
|
3422
3419
|
//# sourceMappingURL=core.es.js.map
|