@stoker-platform/node-client 0.2.6 → 0.2.8
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/bundle.cjs +6 -6
- package/dist/bundle.js +336 -324
- package/package.json +4 -4
package/dist/bundle.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { spawn as
|
|
1
|
+
import { spawn as Po } from "node:child_process";
|
|
2
2
|
import { getApp as Kr, initializeApp as Xr, applicationDefault as ei } from "firebase-admin/app";
|
|
3
3
|
import ze from "lodash/isEqual.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import Lo from "lodash/merge.js";
|
|
5
|
+
import Vo from "lodash/set.js";
|
|
6
6
|
import pe from "lodash/cloneDeep.js";
|
|
7
7
|
import { getFirestore as ce, Timestamp as ot, FieldValue as he } from "firebase-admin/firestore";
|
|
8
8
|
import { getDatabase as ti } from "firebase-admin/database";
|
|
9
9
|
import { getAuth as pt } from "firebase-admin/auth";
|
|
10
10
|
const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
11
|
-
const o =
|
|
11
|
+
const o = Po(n, e, { cwd: t || process.cwd(), env: { ...process.env, ...s } });
|
|
12
12
|
let a = "";
|
|
13
13
|
const l = () => {
|
|
14
14
|
o.kill("SIGINT");
|
|
@@ -42,11 +42,11 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
42
42
|
}, Vn = (n) => !!n.auth, Re = (n, e) => {
|
|
43
43
|
if (e?.operations)
|
|
44
44
|
return e.operations.includes(n);
|
|
45
|
-
}, Un = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0,
|
|
45
|
+
}, Un = (n, e) => e ? e.Role ? n.access?.includes(e.Role) : !1 : !0, Uo = (n, e) => n.restrictCreate === !0 ? !1 : e && typeof n.restrictCreate == "object" ? e.Role ? n.restrictCreate?.includes(e.Role) : !1 : !0, ni = (n, e) => n.restrictUpdate === !0 ? !1 : e && typeof n.restrictUpdate == "object" ? e.Role ? n.restrictUpdate?.includes(e.Role) : !1 : !0, tr = (n, e, t) => {
|
|
46
46
|
const { labels: s } = n;
|
|
47
47
|
return t.collections && // eslint-disable-next-line security/detect-object-injection
|
|
48
48
|
Re("Update", t.collections[s.collection]) && (!e.access || Un(e, t)) && ni(e, t) && !(n.auth && !t.collections?.[s.collection].auth && ["Enabled", "Role", "Name", "Email", "Photo_URL"].includes(e.name));
|
|
49
|
-
}, W = (n, e) => n.filter((t) => t.name === e)[0],
|
|
49
|
+
}, W = (n, e) => n.filter((t) => t.name === e)[0], Q = (n) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(n.type), si = (n, e) => {
|
|
50
50
|
const t = {
|
|
51
51
|
Record_Owner: "recordOwner",
|
|
52
52
|
Record_User: "recordUser",
|
|
@@ -71,7 +71,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
71
71
|
if (!o.roles.some((f) => f.role === t.Role))
|
|
72
72
|
return;
|
|
73
73
|
const a = o.collectionField, l = W(n.fields, a);
|
|
74
|
-
if (!
|
|
74
|
+
if (!Q(l))
|
|
75
75
|
throw new Error("PERMISSION_DENIED");
|
|
76
76
|
const c = t.collections?.[l.collection], h = e.collections[l.collection].access.entityRestrictions;
|
|
77
77
|
if (!h)
|
|
@@ -88,12 +88,12 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
88
88
|
for (const o of s) {
|
|
89
89
|
const { fields: a } = o;
|
|
90
90
|
for (const l of a)
|
|
91
|
-
if (!(l.access && !Un(l, t)) && t.Role &&
|
|
91
|
+
if (!(l.access && !Un(l, t)) && t.Role && Q(l) && l.collection === r.collection && l.dependencyFields)
|
|
92
92
|
for (const c of l.dependencyFields)
|
|
93
93
|
!i.find((h) => h.field === c.field) && c.roles.includes(t.Role) && i.push(c);
|
|
94
94
|
}
|
|
95
95
|
return i;
|
|
96
|
-
},
|
|
96
|
+
}, Wo = (n, e, t, s, r, i) => {
|
|
97
97
|
const { fields: o } = e, a = r.collections?.[e.labels.collection];
|
|
98
98
|
let l = !0;
|
|
99
99
|
if (!a) {
|
|
@@ -186,13 +186,13 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
186
186
|
return l = !1, l;
|
|
187
187
|
Re(n, a) || (l = !1);
|
|
188
188
|
const d = Ms(e, r)?.filter((h) => h.type === "Individual").length > 0;
|
|
189
|
-
return n === "Create" && d && (l = !1),
|
|
189
|
+
return n === "Create" && d && (l = !1), Wo(n, e, t, s, r, i) || (l = !1), l;
|
|
190
190
|
}, oi = (n, e, t) => {
|
|
191
191
|
const { labels: s } = n, r = [];
|
|
192
192
|
for (const i of Object.values(e.collections))
|
|
193
193
|
;
|
|
194
194
|
return r;
|
|
195
|
-
},
|
|
195
|
+
}, jo = (n, e) => {
|
|
196
196
|
let t = !0, s = "";
|
|
197
197
|
return Object.keys(e).forEach((r) => {
|
|
198
198
|
if (!["Doc_ID", "Role", "Collection", "Enabled", "collections"].includes(r)) {
|
|
@@ -279,7 +279,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
281
|
}), s && console.error(`PERMISSION_DENIED: ${s}`)), t;
|
|
282
|
-
},
|
|
282
|
+
}, Zo = (n, e, t) => {
|
|
283
283
|
let s = !0, r = "";
|
|
284
284
|
Object.values(n.collections).filter((i) => i.auth).forEach((i) => {
|
|
285
285
|
if (e.collections?.[i.labels.collection]?.auth && !i.access.auth?.includes(e.Role)) {
|
|
@@ -339,7 +339,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
339
339
|
}
|
|
340
340
|
if (p.type === "Parent") {
|
|
341
341
|
const b = W(l, p.collectionField);
|
|
342
|
-
if (!
|
|
342
|
+
if (!Q(b)) {
|
|
343
343
|
s = !1;
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
@@ -350,7 +350,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
350
350
|
}
|
|
351
351
|
if (p.type === "Parent_Property") {
|
|
352
352
|
const b = W(l, p.collectionField);
|
|
353
|
-
if (!
|
|
353
|
+
if (!Q(b)) {
|
|
354
354
|
s = !1;
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
@@ -366,7 +366,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
return r && console.error(`PERMISSION_DENIED: ${r}`), s;
|
|
369
|
-
},
|
|
369
|
+
}, zo = (n, e, t, s, r, i, o, a, l) => {
|
|
370
370
|
const { access: c } = e, { permissionWriteRestrictions: d } = c;
|
|
371
371
|
let h = !0, u = "";
|
|
372
372
|
const f = d?.filter((w) => s === w.userRole);
|
|
@@ -410,7 +410,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
410
410
|
}
|
|
411
411
|
});
|
|
412
412
|
}), u && console.error(`PERMISSION_DENIED: ${u}`), h);
|
|
413
|
-
},
|
|
413
|
+
}, qo = (n, e, t, s) => {
|
|
414
414
|
let r = !0, i = "";
|
|
415
415
|
return Object.values(n.collections).forEach((o) => {
|
|
416
416
|
const a = t.collections?.[o.labels.collection], l = s?.collections?.[o.labels.collection], c = e?.collections?.[o.labels.collection];
|
|
@@ -452,7 +452,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
452
452
|
if (i) {
|
|
453
453
|
if (!o?.Role)
|
|
454
454
|
return f = "Current user does not have a role", u = !1, u;
|
|
455
|
-
if (!
|
|
455
|
+
if (!zo(n, s, r, o.Role, e.Role, a, c, c?.Role, l))
|
|
456
456
|
return u = !1, u;
|
|
457
457
|
if (n === "update" && d !== "delete" && c?.User_ID && e.User_ID !== c.User_ID)
|
|
458
458
|
return f = "User ID does not match original user ID", u = !1, u;
|
|
@@ -461,7 +461,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
461
461
|
if (n === "delete" && i === e.User_ID)
|
|
462
462
|
return f = "User cannot delete their own record", u = !1, u;
|
|
463
463
|
}
|
|
464
|
-
return n === "delete" || d === "delete" || !a ? u : a.Role ? (
|
|
464
|
+
return n === "delete" || d === "delete" || !a ? u : a.Role ? (jo(r, a) || (u = !1), a.Collection && a.Collection !== h.collection ? (f = "Permissions collection does not match record collection", u = !1, u) : a.Role !== e.Role ? (f = "Permissions role does not match record role", u = !1, u) : a.Enabled !== void 0 && !!a.Enabled != !!e.Enabled ? (f = "Permissions enabled state does not match record enabled state", u = !1, u) : a.Doc_ID && a.Doc_ID !== t ? (f = "Permissions doc ID does not match record doc ID", u = !1, u) : !Zo(r, a, a.Role) || i && o && l && !qo(r, o, a, l) ? (u = !1, u) : (f && console.error(`PERMISSION_DENIED: ${f}`), u)) : (f = "Permissions do not have a role", u = !1, u);
|
|
465
465
|
}, nr = (n, e, t, s, r, i, o) => {
|
|
466
466
|
const { labels: a, fields: l } = t, c = i?.collections?.[a.collection];
|
|
467
467
|
let d = !0;
|
|
@@ -471,7 +471,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
471
471
|
!st("Create", t, s, r, i, n) && (d = !1), t.auth && o && (r && !Vn(c) && (d = !1), Fs("create", n, e, t, s, r, i, o) || (d = !1));
|
|
472
472
|
for (const h of l) {
|
|
473
473
|
const u = n[h.name];
|
|
474
|
-
h.access && !Un(h, i) && u !== void 0 && (d = !1), u !== void 0 && !
|
|
474
|
+
h.access && !Un(h, i) && u !== void 0 && (d = !1), u !== void 0 && !Uo(h, i) && (d = !1);
|
|
475
475
|
}
|
|
476
476
|
if (!d)
|
|
477
477
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -493,14 +493,14 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
493
493
|
}
|
|
494
494
|
if (!w)
|
|
495
495
|
throw E && console.error(`PERMISSION_DENIED: ${E}`), new Error("PERMISSION_DENIED");
|
|
496
|
-
},
|
|
496
|
+
}, Bo = (n, e, t, s, r, i) => {
|
|
497
497
|
const { labels: o } = t, a = i.collections?.[o.collection];
|
|
498
498
|
let l = !0;
|
|
499
499
|
if (!a)
|
|
500
500
|
throw new Error("PERMISSION_DENIED");
|
|
501
501
|
if (Re("Delete", a) || (l = !1), st("Delete", t, s, r, i, n) || (l = !1), t.auth && n.User_ID && (Vn(a) || (l = !1), Fs("delete", n, e, t, s, r, i) || (l = !1)), !l)
|
|
502
502
|
throw new Error("PERMISSION_DENIED");
|
|
503
|
-
},
|
|
503
|
+
}, Ho = async (n, e, t, s, r) => {
|
|
504
504
|
const { labels: i } = e, o = r.collections?.[i.collection];
|
|
505
505
|
let a = !0;
|
|
506
506
|
if (!o) {
|
|
@@ -509,7 +509,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
509
509
|
}
|
|
510
510
|
if (Re("Read", o) || (a = !1), st("Read", e, t, s, r, n) || (a = !1), !a)
|
|
511
511
|
throw new Error("PERMISSION_DENIED");
|
|
512
|
-
},
|
|
512
|
+
}, Go = async (n, e, t, s, r) => {
|
|
513
513
|
const { labels: i } = e, o = r.collections?.[i.collection];
|
|
514
514
|
let a = !0;
|
|
515
515
|
if (!o) {
|
|
@@ -520,11 +520,11 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
520
520
|
st("Read", e, t, s, r, l) || (a = !1);
|
|
521
521
|
}), !a)
|
|
522
522
|
throw new Error("PERMISSION_DENIED");
|
|
523
|
-
},
|
|
523
|
+
}, Yo = (n, e, t) => {
|
|
524
524
|
const { access: s } = n;
|
|
525
525
|
return s.operations.assignable === !0 || typeof s.operations.assignable == "object" && s.operations.assignable.includes(e) || // eslint-disable-next-line security/detect-object-injection
|
|
526
526
|
s.operations[t]?.includes(e);
|
|
527
|
-
},
|
|
527
|
+
}, Jo = (n, e, t) => {
|
|
528
528
|
const { access: s } = e, { entityRestrictions: r } = s;
|
|
529
529
|
if (r?.restrictions) {
|
|
530
530
|
for (const i of r.restrictions)
|
|
@@ -536,7 +536,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
536
536
|
if (!i.roles.some((c) => c.role === n))
|
|
537
537
|
continue;
|
|
538
538
|
const o = W(e.fields, i.collectionField);
|
|
539
|
-
if (!
|
|
539
|
+
if (!Q(o))
|
|
540
540
|
throw new Error("PERMISSION_DENIED");
|
|
541
541
|
const l = t.collections[o.collection].access.entityRestrictions?.restrictions?.find((c) => c.type === i.type && c.roles.some((d) => d.role === n));
|
|
542
542
|
if (!l)
|
|
@@ -547,7 +547,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
547
547
|
return `${i.type} parent filter`;
|
|
548
548
|
}
|
|
549
549
|
return !0;
|
|
550
|
-
},
|
|
550
|
+
}, Qo = (n, e, t, s, r) => {
|
|
551
551
|
const i = {};
|
|
552
552
|
for (const o of n) {
|
|
553
553
|
const l = e[o].default(t, s, r);
|
|
@@ -597,10 +597,10 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
597
597
|
if (f !== void 0) {
|
|
598
598
|
if (f === "__proto__" || f === "constructor" || f === "prototype")
|
|
599
599
|
throw new Error("Invalid config path: prototype pollution keys are not allowed");
|
|
600
|
-
u === e.length - 1 ?
|
|
600
|
+
u === e.length - 1 ? Vo(h, e.join("."), c) : (d[f] ||= {}, d = d[f]);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
|
|
603
|
+
Lo(Jn, h);
|
|
604
604
|
}
|
|
605
605
|
return c;
|
|
606
606
|
}, at = (n, e, t) => {
|
|
@@ -609,17 +609,17 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
609
609
|
for (const o of s) {
|
|
610
610
|
const { fields: a } = o;
|
|
611
611
|
for (const l of a)
|
|
612
|
-
if (
|
|
612
|
+
if (Q(l) && l.collection === r.collection && l.dependencyFields)
|
|
613
613
|
for (const c of l.dependencyFields)
|
|
614
614
|
c.field == n.name && (i = !0);
|
|
615
615
|
}
|
|
616
616
|
return i;
|
|
617
|
-
},
|
|
617
|
+
}, ai = (n, e) => {
|
|
618
618
|
const t = Object.values(e.collections), { labels: s } = n, r = {};
|
|
619
619
|
return t.forEach((i) => {
|
|
620
620
|
const { labels: o, fields: a } = i;
|
|
621
621
|
a.forEach((l) => {
|
|
622
|
-
|
|
622
|
+
Q(l) && l.collection === s.collection && l.dependencyFields && l.dependencyFields.forEach((c) => {
|
|
623
623
|
r[c.field] ||= {}, r[c.field][o.collection] ||= [], r[c.field][o.collection] = r[c.field][o.collection].concat(c.roles), r[c.field][o.collection] = [
|
|
624
624
|
...new Set(r[c.field][o.collection])
|
|
625
625
|
];
|
|
@@ -681,7 +681,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
681
681
|
required: !0
|
|
682
682
|
};
|
|
683
683
|
return t && (s.values = t), s;
|
|
684
|
-
}),
|
|
684
|
+
}), li = (n, e) => {
|
|
685
685
|
const t = [], { access: s, fields: r } = n, { attributeRestrictions: i, entityRestrictions: o } = s, a = Wn();
|
|
686
686
|
return i && i.forEach((l) => {
|
|
687
687
|
if (l.roles.some((c) => c.role === e))
|
|
@@ -738,7 +738,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
738
738
|
}), o?.forEach((c) => {
|
|
739
739
|
const d = W(s.concat(a), c.field);
|
|
740
740
|
(!c.roles || c.roles.includes(e)) && d && (!d.access || d.access?.includes(e)) && ht.includes(c.field) && t.push(W(a, c.field));
|
|
741
|
-
}),
|
|
741
|
+
}), li(n, e).forEach((c) => {
|
|
742
742
|
ht.includes(c.name) && t.push(W(a, c.name));
|
|
743
743
|
}), [...new Set(t)];
|
|
744
744
|
}, Xo = (n, e, t) => {
|
|
@@ -746,7 +746,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
746
746
|
i?.range && i.range.fields.forEach((c) => {
|
|
747
747
|
ht.includes(c) ? s.push(W(o, c)) : s.push(W(r, c));
|
|
748
748
|
});
|
|
749
|
-
const a = /* @__PURE__ */ new Set(), l =
|
|
749
|
+
const a = /* @__PURE__ */ new Set(), l = ai(e, t);
|
|
750
750
|
return Object.entries(l).map(([c, d]) => {
|
|
751
751
|
n.name === c && Object.values(d).forEach((h) => {
|
|
752
752
|
h.forEach((u) => {
|
|
@@ -754,11 +754,11 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
754
754
|
});
|
|
755
755
|
});
|
|
756
756
|
}), a.forEach((c) => {
|
|
757
|
-
s.push(...
|
|
757
|
+
s.push(...li(e, c));
|
|
758
758
|
}), [...new Set(s)];
|
|
759
759
|
}, cn = (n, e, t) => {
|
|
760
760
|
const s = [], { fields: r, softDelete: i } = e;
|
|
761
|
-
|
|
761
|
+
s.push({
|
|
762
762
|
name: "Collection_Path",
|
|
763
763
|
type: "Array",
|
|
764
764
|
required: !0
|
|
@@ -766,15 +766,27 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
766
766
|
name: "id",
|
|
767
767
|
type: "String",
|
|
768
768
|
required: !0
|
|
769
|
+
});
|
|
770
|
+
const o = [], a = ai(e, t);
|
|
771
|
+
if (Object.values(a).forEach((l) => {
|
|
772
|
+
Object.keys(l).forEach((c) => {
|
|
773
|
+
t.collections[c].fields.forEach((h) => {
|
|
774
|
+
Q(h) && h.collection === e.labels.collection && h.dependencyFields?.some((u) => u.field === n.name) && h.constraints && h.constraints.forEach((u) => {
|
|
775
|
+
o.push(u[0]);
|
|
776
|
+
});
|
|
777
|
+
});
|
|
778
|
+
});
|
|
779
|
+
}), o.forEach((l) => {
|
|
780
|
+
s.push(W(r, l));
|
|
769
781
|
}), i) {
|
|
770
|
-
const
|
|
771
|
-
|
|
782
|
+
const l = W(r, i.archivedField);
|
|
783
|
+
l && s.push(l);
|
|
772
784
|
}
|
|
773
785
|
return s.push(...Xo(n, e, t)), [...new Set(s)];
|
|
774
|
-
},
|
|
786
|
+
}, ci = (n, e) => {
|
|
775
787
|
const { preloadCache: t } = n, s = /* @__PURE__ */ new Set();
|
|
776
788
|
for (const r of e.config.roles) {
|
|
777
|
-
if (!
|
|
789
|
+
if (!Yo(n, r, "read"))
|
|
778
790
|
continue;
|
|
779
791
|
const i = Ko(n, r);
|
|
780
792
|
let o = !1;
|
|
@@ -786,8 +798,8 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
786
798
|
o || s.add({ key: (s.size + 1).toString(), roles: [r], fields: i });
|
|
787
799
|
}
|
|
788
800
|
return s;
|
|
789
|
-
},
|
|
790
|
-
const s =
|
|
801
|
+
}, ui = (n, e, t) => {
|
|
802
|
+
const s = ci(e, t);
|
|
791
803
|
for (const r of s.values())
|
|
792
804
|
if (r.roles.includes(n))
|
|
793
805
|
return r;
|
|
@@ -799,7 +811,7 @@ const eu = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
799
811
|
}, Ps = (n, e, t) => {
|
|
800
812
|
const s = {};
|
|
801
813
|
return Object.values(n.collections).forEach((r) => {
|
|
802
|
-
const i =
|
|
814
|
+
const i = ci(r, n), o = Array.from(i);
|
|
803
815
|
o.map((a) => (a.fields.forEach((l) => {
|
|
804
816
|
}), a)), s[r.labels.collection] = new Set(o);
|
|
805
817
|
}), s;
|
|
@@ -830,10 +842,10 @@ const Ls = (n, e, t, s, r, i, o, a, l, c) => (n == "create" && (t.Collection_Pat
|
|
|
830
842
|
if (s)
|
|
831
843
|
for (const o of s) {
|
|
832
844
|
const a = W(e, o.field);
|
|
833
|
-
e.find((l) => l.name === o.field) &&
|
|
845
|
+
e.find((l) => l.name === o.field) && Q(a) && ["OneToOne", "OneToMany"].includes(a.type) && i.add(a);
|
|
834
846
|
}
|
|
835
847
|
return e.forEach((o) => {
|
|
836
|
-
|
|
848
|
+
Q(o) && ["OneToOne", "OneToMany"].includes(o.type) && o.sorting && (typeof o.sorting == "boolean" || !o.sorting.roles?.every((a) => r?.includes(a))) && i.add(o);
|
|
837
849
|
}), i;
|
|
838
850
|
}, yt = (n, e) => {
|
|
839
851
|
const { access: t, recordTitleField: s } = n, { serverReadOnly: r } = t, i = /* @__PURE__ */ new Set();
|
|
@@ -843,7 +855,7 @@ const Ls = (n, e, t, s, r, i, o, a, l, c) => (n == "create" && (t.Collection_Pat
|
|
|
843
855
|
}, kn = (n, e, t) => {
|
|
844
856
|
const { fields: s } = n;
|
|
845
857
|
s.forEach((i) => {
|
|
846
|
-
if (
|
|
858
|
+
if (Q(i))
|
|
847
859
|
if (e[i.name]) {
|
|
848
860
|
if (Me(e[i.name]))
|
|
849
861
|
e[`${i.name}_Array`] = e[i.name];
|
|
@@ -879,7 +891,7 @@ const Ls = (n, e, t, s, r, i, o, a, l, c) => (n == "create" && (t.Collection_Pat
|
|
|
879
891
|
i.custom?.initialValue && !(s && o.access && !o.access.includes(s)) && (n[i.name] = await re(i.custom.initialValue, [n]), yt(e, [o]).size === 1 && (n[`${i.name}_Lowercase`] = n[i.name].toLowerCase()));
|
|
880
892
|
}
|
|
881
893
|
for (const i of r)
|
|
882
|
-
s && i.access && !i.access.includes(s) || ("autoIncrement" in i && i.autoIncrement && !n[i.name] && (n[i.name] = "Pending"), !
|
|
894
|
+
s && i.access && !i.access.includes(s) || ("autoIncrement" in i && i.autoIncrement && !n[i.name] && (n[i.name] = "Pending"), !Q(i) && i.nullable && n[i.name] === void 0 && (n[i.name] = null));
|
|
883
895
|
};
|
|
884
896
|
var ee;
|
|
885
897
|
(function(n) {
|
|
@@ -1231,7 +1243,7 @@ function Y(n) {
|
|
|
1231
1243
|
return o.code === "invalid_enum_value" ? { message: l ?? a.defaultError } : typeof a.data > "u" ? { message: l ?? s ?? a.defaultError } : o.code !== "invalid_type" ? { message: a.defaultError } : { message: l ?? t ?? a.defaultError };
|
|
1232
1244
|
}, description: r };
|
|
1233
1245
|
}
|
|
1234
|
-
class
|
|
1246
|
+
class K {
|
|
1235
1247
|
get description() {
|
|
1236
1248
|
return this._def.description;
|
|
1237
1249
|
}
|
|
@@ -1451,18 +1463,18 @@ class Q {
|
|
|
1451
1463
|
}
|
|
1452
1464
|
const ia = /^c[^\s-]{8,}$/i, oa = /^[0-9a-z]+$/, aa = /^[0-9A-HJKMNP-TV-Z]{26}$/i, la = /^[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, ca = /^[a-z0-9_-]{21}$/i, ua = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, da = /^[-+]?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)?)??$/, fa = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ha = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1453
1465
|
let Xn;
|
|
1454
|
-
const ma = /^(?:(?: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])$/, pa = /^(?:(?: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])$/, ya = /^(([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]))$/, ga = /^(([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])$/, wa = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, _a = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
1455
|
-
function
|
|
1466
|
+
const ma = /^(?:(?: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])$/, pa = /^(?:(?: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])$/, ya = /^(([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]))$/, ga = /^(([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])$/, wa = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, _a = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, di = "((\\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])))", Ea = new RegExp(`^${di}$`);
|
|
1467
|
+
function fi(n) {
|
|
1456
1468
|
let e = "[0-5]\\d";
|
|
1457
1469
|
n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
1458
1470
|
const t = n.precision ? "+" : "?";
|
|
1459
1471
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
1460
1472
|
}
|
|
1461
1473
|
function va(n) {
|
|
1462
|
-
return new RegExp(`^${
|
|
1474
|
+
return new RegExp(`^${fi(n)}$`);
|
|
1463
1475
|
}
|
|
1464
1476
|
function Oa(n) {
|
|
1465
|
-
let e = `${
|
|
1477
|
+
let e = `${di}T${fi(n)}`;
|
|
1466
1478
|
const t = [];
|
|
1467
1479
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
1468
1480
|
}
|
|
@@ -1485,7 +1497,7 @@ function ba(n, e) {
|
|
|
1485
1497
|
function Sa(n, e) {
|
|
1486
1498
|
return !!((e === "v4" || !e) && pa.test(n) || (e === "v6" || !e) && ga.test(n));
|
|
1487
1499
|
}
|
|
1488
|
-
class qe extends
|
|
1500
|
+
class qe extends K {
|
|
1489
1501
|
_parse(e) {
|
|
1490
1502
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== U.string) {
|
|
1491
1503
|
const i = this._getOrReturnCtx(e);
|
|
@@ -1872,7 +1884,7 @@ function Ra(n, e) {
|
|
|
1872
1884
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, i = Number.parseInt(n.toFixed(r).replace(".", "")), o = Number.parseInt(e.toFixed(r).replace(".", ""));
|
|
1873
1885
|
return i % o / 10 ** r;
|
|
1874
1886
|
}
|
|
1875
|
-
class Nt extends
|
|
1887
|
+
class Nt extends K {
|
|
1876
1888
|
constructor() {
|
|
1877
1889
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1878
1890
|
}
|
|
@@ -2044,7 +2056,7 @@ Nt.create = (n) => new Nt({
|
|
|
2044
2056
|
coerce: n?.coerce || !1,
|
|
2045
2057
|
...Y(n)
|
|
2046
2058
|
});
|
|
2047
|
-
class Kt extends
|
|
2059
|
+
class Kt extends K {
|
|
2048
2060
|
constructor() {
|
|
2049
2061
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
2050
2062
|
}
|
|
@@ -2177,7 +2189,7 @@ Kt.create = (n) => new Kt({
|
|
|
2177
2189
|
coerce: n?.coerce ?? !1,
|
|
2178
2190
|
...Y(n)
|
|
2179
2191
|
});
|
|
2180
|
-
class ys extends
|
|
2192
|
+
class ys extends K {
|
|
2181
2193
|
_parse(e) {
|
|
2182
2194
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== U.boolean) {
|
|
2183
2195
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2195,7 +2207,7 @@ ys.create = (n) => new ys({
|
|
|
2195
2207
|
coerce: n?.coerce || !1,
|
|
2196
2208
|
...Y(n)
|
|
2197
2209
|
});
|
|
2198
|
-
class Rn extends
|
|
2210
|
+
class Rn extends K {
|
|
2199
2211
|
_parse(e) {
|
|
2200
2212
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== U.date) {
|
|
2201
2213
|
const i = this._getOrReturnCtx(e);
|
|
@@ -2273,7 +2285,7 @@ Rn.create = (n) => new Rn({
|
|
|
2273
2285
|
typeName: H.ZodDate,
|
|
2274
2286
|
...Y(n)
|
|
2275
2287
|
});
|
|
2276
|
-
class lr extends
|
|
2288
|
+
class lr extends K {
|
|
2277
2289
|
_parse(e) {
|
|
2278
2290
|
if (this._getType(e) !== U.symbol) {
|
|
2279
2291
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2290,7 +2302,7 @@ lr.create = (n) => new lr({
|
|
|
2290
2302
|
typeName: H.ZodSymbol,
|
|
2291
2303
|
...Y(n)
|
|
2292
2304
|
});
|
|
2293
|
-
class gs extends
|
|
2305
|
+
class gs extends K {
|
|
2294
2306
|
_parse(e) {
|
|
2295
2307
|
if (this._getType(e) !== U.undefined) {
|
|
2296
2308
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2307,7 +2319,7 @@ gs.create = (n) => new gs({
|
|
|
2307
2319
|
typeName: H.ZodUndefined,
|
|
2308
2320
|
...Y(n)
|
|
2309
2321
|
});
|
|
2310
|
-
class cr extends
|
|
2322
|
+
class cr extends K {
|
|
2311
2323
|
_parse(e) {
|
|
2312
2324
|
if (this._getType(e) !== U.null) {
|
|
2313
2325
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2324,7 +2336,7 @@ cr.create = (n) => new cr({
|
|
|
2324
2336
|
typeName: H.ZodNull,
|
|
2325
2337
|
...Y(n)
|
|
2326
2338
|
});
|
|
2327
|
-
class ws extends
|
|
2339
|
+
class ws extends K {
|
|
2328
2340
|
constructor() {
|
|
2329
2341
|
super(...arguments), this._any = !0;
|
|
2330
2342
|
}
|
|
@@ -2336,7 +2348,7 @@ ws.create = (n) => new ws({
|
|
|
2336
2348
|
typeName: H.ZodAny,
|
|
2337
2349
|
...Y(n)
|
|
2338
2350
|
});
|
|
2339
|
-
class ur extends
|
|
2351
|
+
class ur extends K {
|
|
2340
2352
|
constructor() {
|
|
2341
2353
|
super(...arguments), this._unknown = !0;
|
|
2342
2354
|
}
|
|
@@ -2348,7 +2360,7 @@ ur.create = (n) => new ur({
|
|
|
2348
2360
|
typeName: H.ZodUnknown,
|
|
2349
2361
|
...Y(n)
|
|
2350
2362
|
});
|
|
2351
|
-
class rt extends
|
|
2363
|
+
class rt extends K {
|
|
2352
2364
|
_parse(e) {
|
|
2353
2365
|
const t = this._getOrReturnCtx(e);
|
|
2354
2366
|
return M(t, {
|
|
@@ -2362,7 +2374,7 @@ rt.create = (n) => new rt({
|
|
|
2362
2374
|
typeName: H.ZodNever,
|
|
2363
2375
|
...Y(n)
|
|
2364
2376
|
});
|
|
2365
|
-
class dr extends
|
|
2377
|
+
class dr extends K {
|
|
2366
2378
|
_parse(e) {
|
|
2367
2379
|
if (this._getType(e) !== U.undefined) {
|
|
2368
2380
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2379,7 +2391,7 @@ dr.create = (n) => new dr({
|
|
|
2379
2391
|
typeName: H.ZodVoid,
|
|
2380
2392
|
...Y(n)
|
|
2381
2393
|
});
|
|
2382
|
-
class Ue extends
|
|
2394
|
+
class Ue extends K {
|
|
2383
2395
|
_parse(e) {
|
|
2384
2396
|
const { ctx: t, status: s } = this._processInputParams(e), r = this._def;
|
|
2385
2397
|
if (t.parsedType !== U.array)
|
|
@@ -2468,7 +2480,7 @@ function Ot(n) {
|
|
|
2468
2480
|
type: Ot(n.element)
|
|
2469
2481
|
}) : n instanceof tt ? tt.create(Ot(n.unwrap())) : n instanceof Dt ? Dt.create(Ot(n.unwrap())) : n instanceof mt ? mt.create(n.items.map((e) => Ot(e))) : n;
|
|
2470
2482
|
}
|
|
2471
|
-
class de extends
|
|
2483
|
+
class de extends K {
|
|
2472
2484
|
constructor() {
|
|
2473
2485
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2474
2486
|
}
|
|
@@ -2731,7 +2743,7 @@ class de extends Q {
|
|
|
2731
2743
|
});
|
|
2732
2744
|
}
|
|
2733
2745
|
keyof() {
|
|
2734
|
-
return
|
|
2746
|
+
return hi(ee.objectKeys(this.shape));
|
|
2735
2747
|
}
|
|
2736
2748
|
}
|
|
2737
2749
|
de.create = (n, e) => new de({
|
|
@@ -2755,7 +2767,7 @@ de.lazycreate = (n, e) => new de({
|
|
|
2755
2767
|
typeName: H.ZodObject,
|
|
2756
2768
|
...Y(e)
|
|
2757
2769
|
});
|
|
2758
|
-
class Tn extends
|
|
2770
|
+
class Tn extends K {
|
|
2759
2771
|
_parse(e) {
|
|
2760
2772
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
2761
2773
|
function r(i) {
|
|
@@ -2854,7 +2866,7 @@ function _s(n, e) {
|
|
|
2854
2866
|
return { valid: !0, data: r };
|
|
2855
2867
|
} else return t === U.date && s === U.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
2856
2868
|
}
|
|
2857
|
-
class Nn extends
|
|
2869
|
+
class Nn extends K {
|
|
2858
2870
|
_parse(e) {
|
|
2859
2871
|
const { status: t, ctx: s } = this._processInputParams(e), r = (i, o) => {
|
|
2860
2872
|
if (ir(i) || ir(o))
|
|
@@ -2892,7 +2904,7 @@ Nn.create = (n, e, t) => new Nn({
|
|
|
2892
2904
|
typeName: H.ZodIntersection,
|
|
2893
2905
|
...Y(t)
|
|
2894
2906
|
});
|
|
2895
|
-
class mt extends
|
|
2907
|
+
class mt extends K {
|
|
2896
2908
|
_parse(e) {
|
|
2897
2909
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2898
2910
|
if (s.parsedType !== U.array)
|
|
@@ -2942,7 +2954,7 @@ mt.create = (n, e) => {
|
|
|
2942
2954
|
...Y(e)
|
|
2943
2955
|
});
|
|
2944
2956
|
};
|
|
2945
|
-
class xn extends
|
|
2957
|
+
class xn extends K {
|
|
2946
2958
|
get keySchema() {
|
|
2947
2959
|
return this._def.keyType;
|
|
2948
2960
|
}
|
|
@@ -2970,7 +2982,7 @@ class xn extends Q {
|
|
|
2970
2982
|
return this._def.valueType;
|
|
2971
2983
|
}
|
|
2972
2984
|
static create(e, t, s) {
|
|
2973
|
-
return t instanceof
|
|
2985
|
+
return t instanceof K ? new xn({
|
|
2974
2986
|
keyType: e,
|
|
2975
2987
|
valueType: t,
|
|
2976
2988
|
typeName: H.ZodRecord,
|
|
@@ -2983,7 +2995,7 @@ class xn extends Q {
|
|
|
2983
2995
|
});
|
|
2984
2996
|
}
|
|
2985
2997
|
}
|
|
2986
|
-
class fr extends
|
|
2998
|
+
class fr extends K {
|
|
2987
2999
|
get keySchema() {
|
|
2988
3000
|
return this._def.keyType;
|
|
2989
3001
|
}
|
|
@@ -3031,7 +3043,7 @@ fr.create = (n, e, t) => new fr({
|
|
|
3031
3043
|
typeName: H.ZodMap,
|
|
3032
3044
|
...Y(t)
|
|
3033
3045
|
});
|
|
3034
|
-
class Xt extends
|
|
3046
|
+
class Xt extends K {
|
|
3035
3047
|
_parse(e) {
|
|
3036
3048
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
3037
3049
|
if (s.parsedType !== U.set)
|
|
@@ -3095,7 +3107,7 @@ Xt.create = (n, e) => new Xt({
|
|
|
3095
3107
|
typeName: H.ZodSet,
|
|
3096
3108
|
...Y(e)
|
|
3097
3109
|
});
|
|
3098
|
-
class hr extends
|
|
3110
|
+
class hr extends K {
|
|
3099
3111
|
get schema() {
|
|
3100
3112
|
return this._def.getter();
|
|
3101
3113
|
}
|
|
@@ -3109,7 +3121,7 @@ hr.create = (n, e) => new hr({
|
|
|
3109
3121
|
typeName: H.ZodLazy,
|
|
3110
3122
|
...Y(e)
|
|
3111
3123
|
});
|
|
3112
|
-
class Es extends
|
|
3124
|
+
class Es extends K {
|
|
3113
3125
|
_parse(e) {
|
|
3114
3126
|
if (e.data !== this._def.value) {
|
|
3115
3127
|
const t = this._getOrReturnCtx(e);
|
|
@@ -3130,14 +3142,14 @@ Es.create = (n, e) => new Es({
|
|
|
3130
3142
|
typeName: H.ZodLiteral,
|
|
3131
3143
|
...Y(e)
|
|
3132
3144
|
});
|
|
3133
|
-
function
|
|
3145
|
+
function hi(n, e) {
|
|
3134
3146
|
return new xt({
|
|
3135
3147
|
values: n,
|
|
3136
3148
|
typeName: H.ZodEnum,
|
|
3137
3149
|
...Y(e)
|
|
3138
3150
|
});
|
|
3139
3151
|
}
|
|
3140
|
-
class xt extends
|
|
3152
|
+
class xt extends K {
|
|
3141
3153
|
_parse(e) {
|
|
3142
3154
|
if (typeof e.data != "string") {
|
|
3143
3155
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
@@ -3191,8 +3203,8 @@ class xt extends Q {
|
|
|
3191
3203
|
});
|
|
3192
3204
|
}
|
|
3193
3205
|
}
|
|
3194
|
-
xt.create =
|
|
3195
|
-
class mr extends
|
|
3206
|
+
xt.create = hi;
|
|
3207
|
+
class mr extends K {
|
|
3196
3208
|
_parse(e) {
|
|
3197
3209
|
const t = ee.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
3198
3210
|
if (s.parsedType !== U.string && s.parsedType !== U.number) {
|
|
@@ -3222,7 +3234,7 @@ mr.create = (n, e) => new mr({
|
|
|
3222
3234
|
typeName: H.ZodNativeEnum,
|
|
3223
3235
|
...Y(e)
|
|
3224
3236
|
});
|
|
3225
|
-
class In extends
|
|
3237
|
+
class In extends K {
|
|
3226
3238
|
unwrap() {
|
|
3227
3239
|
return this._def.type;
|
|
3228
3240
|
}
|
|
@@ -3246,7 +3258,7 @@ In.create = (n, e) => new In({
|
|
|
3246
3258
|
typeName: H.ZodPromise,
|
|
3247
3259
|
...Y(e)
|
|
3248
3260
|
});
|
|
3249
|
-
class It extends
|
|
3261
|
+
class It extends K {
|
|
3250
3262
|
innerType() {
|
|
3251
3263
|
return this._def.schema;
|
|
3252
3264
|
}
|
|
@@ -3338,7 +3350,7 @@ It.createWithPreprocess = (n, e, t) => new It({
|
|
|
3338
3350
|
typeName: H.ZodEffects,
|
|
3339
3351
|
...Y(t)
|
|
3340
3352
|
});
|
|
3341
|
-
class tt extends
|
|
3353
|
+
class tt extends K {
|
|
3342
3354
|
_parse(e) {
|
|
3343
3355
|
return this._getType(e) === U.undefined ? Ae(void 0) : this._def.innerType._parse(e);
|
|
3344
3356
|
}
|
|
@@ -3351,7 +3363,7 @@ tt.create = (n, e) => new tt({
|
|
|
3351
3363
|
typeName: H.ZodOptional,
|
|
3352
3364
|
...Y(e)
|
|
3353
3365
|
});
|
|
3354
|
-
class Dt extends
|
|
3366
|
+
class Dt extends K {
|
|
3355
3367
|
_parse(e) {
|
|
3356
3368
|
return this._getType(e) === U.null ? Ae(null) : this._def.innerType._parse(e);
|
|
3357
3369
|
}
|
|
@@ -3364,7 +3376,7 @@ Dt.create = (n, e) => new Dt({
|
|
|
3364
3376
|
typeName: H.ZodNullable,
|
|
3365
3377
|
...Y(e)
|
|
3366
3378
|
});
|
|
3367
|
-
class vs extends
|
|
3379
|
+
class vs extends K {
|
|
3368
3380
|
_parse(e) {
|
|
3369
3381
|
const { ctx: t } = this._processInputParams(e);
|
|
3370
3382
|
let s = t.data;
|
|
@@ -3384,7 +3396,7 @@ vs.create = (n, e) => new vs({
|
|
|
3384
3396
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
3385
3397
|
...Y(e)
|
|
3386
3398
|
});
|
|
3387
|
-
class Os extends
|
|
3399
|
+
class Os extends K {
|
|
3388
3400
|
_parse(e) {
|
|
3389
3401
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
3390
3402
|
...t,
|
|
@@ -3427,7 +3439,7 @@ Os.create = (n, e) => new Os({
|
|
|
3427
3439
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
3428
3440
|
...Y(e)
|
|
3429
3441
|
});
|
|
3430
|
-
class pr extends
|
|
3442
|
+
class pr extends K {
|
|
3431
3443
|
_parse(e) {
|
|
3432
3444
|
if (this._getType(e) !== U.nan) {
|
|
3433
3445
|
const s = this._getOrReturnCtx(e);
|
|
@@ -3444,7 +3456,7 @@ pr.create = (n) => new pr({
|
|
|
3444
3456
|
typeName: H.ZodNaN,
|
|
3445
3457
|
...Y(n)
|
|
3446
3458
|
});
|
|
3447
|
-
class Ta extends
|
|
3459
|
+
class Ta extends K {
|
|
3448
3460
|
_parse(e) {
|
|
3449
3461
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
3450
3462
|
return this._def.type._parse({
|
|
@@ -3457,7 +3469,7 @@ class Ta extends Q {
|
|
|
3457
3469
|
return this._def.type;
|
|
3458
3470
|
}
|
|
3459
3471
|
}
|
|
3460
|
-
class Vs extends
|
|
3472
|
+
class Vs extends K {
|
|
3461
3473
|
_parse(e) {
|
|
3462
3474
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
3463
3475
|
if (s.common.async)
|
|
@@ -3497,7 +3509,7 @@ class Vs extends Q {
|
|
|
3497
3509
|
});
|
|
3498
3510
|
}
|
|
3499
3511
|
}
|
|
3500
|
-
class ks extends
|
|
3512
|
+
class ks extends K {
|
|
3501
3513
|
_parse(e) {
|
|
3502
3514
|
const t = this._def.innerType._parse(e), s = (r) => (Tt(r) && (r.value = Object.freeze(r.value)), r);
|
|
3503
3515
|
return Sn(t) ? t.then((r) => s(r)) : s(t);
|
|
@@ -3528,7 +3540,7 @@ const yn = () => ye().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3528
3540
|
message: "Value is not a valid timestamp"
|
|
3529
3541
|
}), yr = () => ye().refine((n) => n && (n._methodName === "serverTimestamp" || n.constructor.name === "ServerTimestampTransform"), {
|
|
3530
3542
|
message: "Value is not a valid server timestamp"
|
|
3531
|
-
}),
|
|
3543
|
+
}), mi = (n, e) => {
|
|
3532
3544
|
const t = {};
|
|
3533
3545
|
if (n.includeFields) {
|
|
3534
3546
|
const s = e.collections[n.collection];
|
|
@@ -3546,7 +3558,7 @@ const yn = () => ye().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3546
3558
|
...t
|
|
3547
3559
|
});
|
|
3548
3560
|
}, Na = (n, e) => {
|
|
3549
|
-
let t = nn(
|
|
3561
|
+
let t = nn(mi(n, e));
|
|
3550
3562
|
return n.required || (t = t.optional()), t;
|
|
3551
3563
|
}, xa = (n) => {
|
|
3552
3564
|
let e = gt(Oe([be().length(20), be().length(28)]));
|
|
@@ -3599,7 +3611,7 @@ const yn = () => ye().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3599
3611
|
i = ye();
|
|
3600
3612
|
break;
|
|
3601
3613
|
}
|
|
3602
|
-
return !
|
|
3614
|
+
return !Q(e) && e.nullable && (i = i.nullable()), e.required || (i = i.optional()), i;
|
|
3603
3615
|
}, Ia = (n, e, t) => {
|
|
3604
3616
|
const s = {
|
|
3605
3617
|
Collection_Path: gt(be()),
|
|
@@ -3616,7 +3628,7 @@ const yn = () => ye().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3616
3628
|
n === "create" && (s.Saved_At = yr()), n === "update" && (s.Saved_At = yn(), s.Collection_Path = s.Collection_Path.optional(), s.id = s.id.optional(), s.Created_At = s.Created_At.optional(), s.Saved_At = s.Saved_At.optional(), s.Created_By = s.Created_By.optional());
|
|
3617
3629
|
const r = ut(e, e.fields), i = Array.from(r).map((l) => l.name);
|
|
3618
3630
|
e.fields.forEach((l) => {
|
|
3619
|
-
|
|
3631
|
+
Q(l) ? (s[l.name] = Na(l, t), s[`${l.name}_Array`] = xa(l), i.includes(l.name) && (s[`${l.name}_Single`] = mi(l, t), l.required || (s[`${l.name}_Single`] = s[`${l.name}_Single`].optional())), l.length && (s[l.name] = s[l.name].refine((c) => l.length && c && Object.keys(c).length === l.length, {
|
|
3620
3632
|
message: `Value must contain ${l.length} item(s)`
|
|
3621
3633
|
})), l.min && (s[l.name] = s[l.name].refine((c) => l.min && c && Object.keys(c).length >= l.min, {
|
|
3622
3634
|
message: `Value must contain at least ${l.min} item(s)`
|
|
@@ -3648,7 +3660,7 @@ class Ca extends wt {
|
|
|
3648
3660
|
}
|
|
3649
3661
|
class kt extends wt {
|
|
3650
3662
|
}
|
|
3651
|
-
class
|
|
3663
|
+
class pi extends wt {
|
|
3652
3664
|
constructor(e) {
|
|
3653
3665
|
super(`Invalid unit ${e}`);
|
|
3654
3666
|
}
|
|
@@ -3664,7 +3676,7 @@ const $ = "numeric", Pe = "short", Se = "long", Cn = {
|
|
|
3664
3676
|
year: $,
|
|
3665
3677
|
month: $,
|
|
3666
3678
|
day: $
|
|
3667
|
-
},
|
|
3679
|
+
}, yi = {
|
|
3668
3680
|
year: $,
|
|
3669
3681
|
month: Pe,
|
|
3670
3682
|
day: $
|
|
@@ -3673,73 +3685,73 @@ const $ = "numeric", Pe = "short", Se = "long", Cn = {
|
|
|
3673
3685
|
month: Pe,
|
|
3674
3686
|
day: $,
|
|
3675
3687
|
weekday: Pe
|
|
3676
|
-
},
|
|
3688
|
+
}, gi = {
|
|
3677
3689
|
year: $,
|
|
3678
3690
|
month: Se,
|
|
3679
3691
|
day: $
|
|
3680
|
-
},
|
|
3692
|
+
}, wi = {
|
|
3681
3693
|
year: $,
|
|
3682
3694
|
month: Se,
|
|
3683
3695
|
day: $,
|
|
3684
3696
|
weekday: Se
|
|
3685
|
-
},
|
|
3697
|
+
}, _i = {
|
|
3686
3698
|
hour: $,
|
|
3687
3699
|
minute: $
|
|
3688
|
-
},
|
|
3700
|
+
}, Ei = {
|
|
3689
3701
|
hour: $,
|
|
3690
3702
|
minute: $,
|
|
3691
3703
|
second: $
|
|
3692
|
-
},
|
|
3704
|
+
}, vi = {
|
|
3693
3705
|
hour: $,
|
|
3694
3706
|
minute: $,
|
|
3695
3707
|
second: $,
|
|
3696
3708
|
timeZoneName: Pe
|
|
3697
|
-
},
|
|
3709
|
+
}, Oi = {
|
|
3698
3710
|
hour: $,
|
|
3699
3711
|
minute: $,
|
|
3700
3712
|
second: $,
|
|
3701
3713
|
timeZoneName: Se
|
|
3702
|
-
},
|
|
3714
|
+
}, ki = {
|
|
3703
3715
|
hour: $,
|
|
3704
3716
|
minute: $,
|
|
3705
3717
|
hourCycle: "h23"
|
|
3706
|
-
},
|
|
3718
|
+
}, bi = {
|
|
3707
3719
|
hour: $,
|
|
3708
3720
|
minute: $,
|
|
3709
3721
|
second: $,
|
|
3710
3722
|
hourCycle: "h23"
|
|
3711
|
-
},
|
|
3723
|
+
}, Si = {
|
|
3712
3724
|
hour: $,
|
|
3713
3725
|
minute: $,
|
|
3714
3726
|
second: $,
|
|
3715
3727
|
hourCycle: "h23",
|
|
3716
3728
|
timeZoneName: Pe
|
|
3717
|
-
},
|
|
3729
|
+
}, Ri = {
|
|
3718
3730
|
hour: $,
|
|
3719
3731
|
minute: $,
|
|
3720
3732
|
second: $,
|
|
3721
3733
|
hourCycle: "h23",
|
|
3722
3734
|
timeZoneName: Se
|
|
3723
|
-
},
|
|
3735
|
+
}, Ti = {
|
|
3724
3736
|
year: $,
|
|
3725
3737
|
month: $,
|
|
3726
3738
|
day: $,
|
|
3727
3739
|
hour: $,
|
|
3728
3740
|
minute: $
|
|
3729
|
-
},
|
|
3741
|
+
}, Ni = {
|
|
3730
3742
|
year: $,
|
|
3731
3743
|
month: $,
|
|
3732
3744
|
day: $,
|
|
3733
3745
|
hour: $,
|
|
3734
3746
|
minute: $,
|
|
3735
3747
|
second: $
|
|
3736
|
-
},
|
|
3748
|
+
}, xi = {
|
|
3737
3749
|
year: $,
|
|
3738
3750
|
month: Pe,
|
|
3739
3751
|
day: $,
|
|
3740
3752
|
hour: $,
|
|
3741
3753
|
minute: $
|
|
3742
|
-
},
|
|
3754
|
+
}, Ii = {
|
|
3743
3755
|
year: $,
|
|
3744
3756
|
month: Pe,
|
|
3745
3757
|
day: $,
|
|
@@ -3753,14 +3765,14 @@ const $ = "numeric", Pe = "short", Se = "long", Cn = {
|
|
|
3753
3765
|
weekday: Pe,
|
|
3754
3766
|
hour: $,
|
|
3755
3767
|
minute: $
|
|
3756
|
-
},
|
|
3768
|
+
}, Di = {
|
|
3757
3769
|
year: $,
|
|
3758
3770
|
month: Se,
|
|
3759
3771
|
day: $,
|
|
3760
3772
|
hour: $,
|
|
3761
3773
|
minute: $,
|
|
3762
3774
|
timeZoneName: Pe
|
|
3763
|
-
},
|
|
3775
|
+
}, Ai = {
|
|
3764
3776
|
year: $,
|
|
3765
3777
|
month: Se,
|
|
3766
3778
|
day: $,
|
|
@@ -3768,7 +3780,7 @@ const $ = "numeric", Pe = "short", Se = "long", Cn = {
|
|
|
3768
3780
|
minute: $,
|
|
3769
3781
|
second: $,
|
|
3770
3782
|
timeZoneName: Pe
|
|
3771
|
-
},
|
|
3783
|
+
}, Ci = {
|
|
3772
3784
|
year: $,
|
|
3773
3785
|
month: Se,
|
|
3774
3786
|
day: $,
|
|
@@ -3776,7 +3788,7 @@ const $ = "numeric", Pe = "short", Se = "long", Cn = {
|
|
|
3776
3788
|
hour: $,
|
|
3777
3789
|
minute: $,
|
|
3778
3790
|
timeZoneName: Se
|
|
3779
|
-
},
|
|
3791
|
+
}, $i = {
|
|
3780
3792
|
year: $,
|
|
3781
3793
|
month: Se,
|
|
3782
3794
|
day: $,
|
|
@@ -3893,7 +3905,7 @@ class jn extends sn {
|
|
|
3893
3905
|
}
|
|
3894
3906
|
/** @override **/
|
|
3895
3907
|
offsetName(e, { format: t, locale: s }) {
|
|
3896
|
-
return
|
|
3908
|
+
return qi(e, t, s);
|
|
3897
3909
|
}
|
|
3898
3910
|
/** @override **/
|
|
3899
3911
|
formatOffset(e, t) {
|
|
@@ -4031,7 +4043,7 @@ class He extends sn {
|
|
|
4031
4043
|
* @return {string}
|
|
4032
4044
|
*/
|
|
4033
4045
|
offsetName(e, { format: t, locale: s }) {
|
|
4034
|
-
return
|
|
4046
|
+
return qi(e, t, s, this.name);
|
|
4035
4047
|
}
|
|
4036
4048
|
/**
|
|
4037
4049
|
* Returns the offset's value as a string
|
|
@@ -4117,7 +4129,7 @@ function Za() {
|
|
|
4117
4129
|
return qt || (qt = new Intl.DateTimeFormat().resolvedOptions().locale, qt);
|
|
4118
4130
|
}
|
|
4119
4131
|
const xs = /* @__PURE__ */ new Map();
|
|
4120
|
-
function
|
|
4132
|
+
function Mi(n) {
|
|
4121
4133
|
let e = xs.get(n);
|
|
4122
4134
|
return e === void 0 && (e = new Intl.DateTimeFormat(n).resolvedOptions(), xs.set(n, e)), e;
|
|
4123
4135
|
}
|
|
@@ -4126,7 +4138,7 @@ function za(n) {
|
|
|
4126
4138
|
let e = Is.get(n);
|
|
4127
4139
|
if (!e) {
|
|
4128
4140
|
const t = new Intl.Locale(n);
|
|
4129
|
-
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...
|
|
4141
|
+
e = "getWeekInfo" in t ? t.getWeekInfo() : t.weekInfo, "minimalDays" in e || (e = { ...Fi, ...e }), Is.set(n, e);
|
|
4130
4142
|
}
|
|
4131
4143
|
return e;
|
|
4132
4144
|
}
|
|
@@ -4172,7 +4184,7 @@ function un(n, e, t, s) {
|
|
|
4172
4184
|
return r === "error" ? null : r === "en" ? t(e) : s(e);
|
|
4173
4185
|
}
|
|
4174
4186
|
function Ya(n) {
|
|
4175
|
-
return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") ||
|
|
4187
|
+
return n.numberingSystem && n.numberingSystem !== "latn" ? !1 : n.numberingSystem === "latn" || !n.locale || n.locale.startsWith("en") || Mi(n.locale).numberingSystem === "latn";
|
|
4176
4188
|
}
|
|
4177
4189
|
class Ja {
|
|
4178
4190
|
constructor(e, t, s) {
|
|
@@ -4231,7 +4243,7 @@ class Qa {
|
|
|
4231
4243
|
}
|
|
4232
4244
|
class Ka {
|
|
4233
4245
|
constructor(e, t, s) {
|
|
4234
|
-
this.opts = { style: "long", ...s }, !t &&
|
|
4246
|
+
this.opts = { style: "long", ...s }, !t && Zi() && (this.rtf = ja(e, s));
|
|
4235
4247
|
}
|
|
4236
4248
|
format(e, t) {
|
|
4237
4249
|
return this.rtf ? this.rtf.format(e, t) : El(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
@@ -4240,7 +4252,7 @@ class Ka {
|
|
|
4240
4252
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
4241
4253
|
}
|
|
4242
4254
|
}
|
|
4243
|
-
const
|
|
4255
|
+
const Fi = {
|
|
4244
4256
|
firstDay: 1,
|
|
4245
4257
|
minimalDays: 4,
|
|
4246
4258
|
weekend: [6, 7]
|
|
@@ -4292,7 +4304,7 @@ class ne {
|
|
|
4292
4304
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
4293
4305
|
}
|
|
4294
4306
|
months(e, t = !1) {
|
|
4295
|
-
return un(this, e,
|
|
4307
|
+
return un(this, e, Gi, () => {
|
|
4296
4308
|
const s = this.intl === "ja" || this.intl.startsWith("ja-");
|
|
4297
4309
|
t &= !s;
|
|
4298
4310
|
const r = t ? { month: e, day: "numeric" } : { month: e }, i = t ? "format" : "standalone";
|
|
@@ -4304,7 +4316,7 @@ class ne {
|
|
|
4304
4316
|
});
|
|
4305
4317
|
}
|
|
4306
4318
|
weekdays(e, t = !1) {
|
|
4307
|
-
return un(this, e,
|
|
4319
|
+
return un(this, e, Qi, () => {
|
|
4308
4320
|
const s = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, r = t ? "format" : "standalone";
|
|
4309
4321
|
return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = Ga(
|
|
4310
4322
|
(i) => this.extract(i, s, "weekday")
|
|
@@ -4315,7 +4327,7 @@ class ne {
|
|
|
4315
4327
|
return un(
|
|
4316
4328
|
this,
|
|
4317
4329
|
void 0,
|
|
4318
|
-
() =>
|
|
4330
|
+
() => Ki,
|
|
4319
4331
|
() => {
|
|
4320
4332
|
if (!this.meridiemCache) {
|
|
4321
4333
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -4328,7 +4340,7 @@ class ne {
|
|
|
4328
4340
|
);
|
|
4329
4341
|
}
|
|
4330
4342
|
eras(e) {
|
|
4331
|
-
return un(this, e,
|
|
4343
|
+
return un(this, e, Xi, () => {
|
|
4332
4344
|
const t = { era: e };
|
|
4333
4345
|
return this.eraCache[e] || (this.eraCache[e] = [L.utc(-40, 1, 1), L.utc(2017, 1, 1)].map(
|
|
4334
4346
|
(s) => this.extract(s, t, "era")
|
|
@@ -4352,10 +4364,10 @@ class ne {
|
|
|
4352
4364
|
return Ua(this.intl, e);
|
|
4353
4365
|
}
|
|
4354
4366
|
isEnglish() {
|
|
4355
|
-
return this.locale === "en" || this.locale.toLowerCase() === "en-us" ||
|
|
4367
|
+
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || Mi(this.intl).locale.startsWith("en-us");
|
|
4356
4368
|
}
|
|
4357
4369
|
getWeekSettings() {
|
|
4358
|
-
return this.weekSettings ? this.weekSettings :
|
|
4370
|
+
return this.weekSettings ? this.weekSettings : zi() ? za(this.locale) : Fi;
|
|
4359
4371
|
}
|
|
4360
4372
|
getStartOfWeek() {
|
|
4361
4373
|
return this.getWeekSettings().firstDay;
|
|
@@ -4760,7 +4772,7 @@ class Fe {
|
|
|
4760
4772
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
4761
4773
|
}
|
|
4762
4774
|
}
|
|
4763
|
-
const
|
|
4775
|
+
const Pi = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Li = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
4764
4776
|
function Ne(n, e) {
|
|
4765
4777
|
return new Fe(
|
|
4766
4778
|
"unit out of range",
|
|
@@ -4773,18 +4785,18 @@ function Ws(n, e, t) {
|
|
|
4773
4785
|
const r = s.getUTCDay();
|
|
4774
4786
|
return r === 0 ? 7 : r;
|
|
4775
4787
|
}
|
|
4776
|
-
function
|
|
4777
|
-
return t + (rn(n) ?
|
|
4788
|
+
function Vi(n, e, t) {
|
|
4789
|
+
return t + (rn(n) ? Li : Pi)[e - 1];
|
|
4778
4790
|
}
|
|
4779
|
-
function
|
|
4780
|
-
const t = rn(n) ?
|
|
4791
|
+
function Ui(n, e) {
|
|
4792
|
+
const t = rn(n) ? Li : Pi, s = t.findIndex((i) => i < e), r = e - t[s];
|
|
4781
4793
|
return { month: s + 1, day: r };
|
|
4782
4794
|
}
|
|
4783
4795
|
function js(n, e) {
|
|
4784
4796
|
return (n - e + 7) % 7 + 1;
|
|
4785
4797
|
}
|
|
4786
4798
|
function $n(n, e = 4, t = 1) {
|
|
4787
|
-
const { year: s, month: r, day: i } = n, o =
|
|
4799
|
+
const { year: s, month: r, day: i } = n, o = Vi(s, r, i), a = js(Ws(s, r, i), t);
|
|
4788
4800
|
let l = Math.floor((o - a + 14 - e) / 7), c;
|
|
4789
4801
|
return l < 1 ? (c = s - 1, l = en(c, e, t)) : l > en(s, e, t) ? (c = s + 1, l = 1) : c = s, { weekYear: c, weekNumber: l, weekday: a, ...Bn(n) };
|
|
4790
4802
|
}
|
|
@@ -4792,15 +4804,15 @@ function Tr(n, e = 4, t = 1) {
|
|
|
4792
4804
|
const { weekYear: s, weekNumber: r, weekday: i } = n, o = js(Ws(s, 1, e), t), a = St(s);
|
|
4793
4805
|
let l = r * 7 + i - o - 7 + e, c;
|
|
4794
4806
|
l < 1 ? (c = s - 1, l += St(c)) : l > a ? (c = s + 1, l -= St(s)) : c = s;
|
|
4795
|
-
const { month: d, day: h } =
|
|
4807
|
+
const { month: d, day: h } = Ui(c, l);
|
|
4796
4808
|
return { year: c, month: d, day: h, ...Bn(n) };
|
|
4797
4809
|
}
|
|
4798
4810
|
function rs(n) {
|
|
4799
|
-
const { year: e, month: t, day: s } = n, r =
|
|
4811
|
+
const { year: e, month: t, day: s } = n, r = Vi(e, t, s);
|
|
4800
4812
|
return { year: e, ordinal: r, ...Bn(n) };
|
|
4801
4813
|
}
|
|
4802
4814
|
function Nr(n) {
|
|
4803
|
-
const { year: e, ordinal: t } = n, { month: s, day: r } =
|
|
4815
|
+
const { year: e, ordinal: t } = n, { month: s, day: r } = Ui(e, t);
|
|
4804
4816
|
return { year: e, month: s, day: r, ...Bn(n) };
|
|
4805
4817
|
}
|
|
4806
4818
|
function xr(n, e) {
|
|
@@ -4828,11 +4840,11 @@ function rl(n) {
|
|
|
4828
4840
|
const e = Zn(n.year), t = xe(n.ordinal, 1, St(n.year));
|
|
4829
4841
|
return e ? t ? !1 : Ne("ordinal", n.ordinal) : Ne("year", n.year);
|
|
4830
4842
|
}
|
|
4831
|
-
function
|
|
4843
|
+
function Wi(n) {
|
|
4832
4844
|
const e = Zn(n.year), t = xe(n.month, 1, 12), s = xe(n.day, 1, Mn(n.year, n.month));
|
|
4833
4845
|
return e ? t ? s ? !1 : Ne("day", n.day) : Ne("month", n.month) : Ne("year", n.year);
|
|
4834
4846
|
}
|
|
4835
|
-
function
|
|
4847
|
+
function ji(n) {
|
|
4836
4848
|
const { hour: e, minute: t, second: s, millisecond: r } = n, i = xe(e, 0, 23) || e === 24 && t === 0 && s === 0 && r === 0, o = xe(t, 0, 59), a = xe(s, 0, 59), l = xe(r, 0, 999);
|
|
4837
4849
|
return i ? o ? a ? l ? !1 : Ne("millisecond", r) : Ne("second", s) : Ne("minute", t) : Ne("hour", e);
|
|
4838
4850
|
}
|
|
@@ -4851,14 +4863,14 @@ function il(n) {
|
|
|
4851
4863
|
function ol(n) {
|
|
4852
4864
|
return Object.prototype.toString.call(n) === "[object Date]";
|
|
4853
4865
|
}
|
|
4854
|
-
function
|
|
4866
|
+
function Zi() {
|
|
4855
4867
|
try {
|
|
4856
4868
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
4857
4869
|
} catch {
|
|
4858
4870
|
return !1;
|
|
4859
4871
|
}
|
|
4860
4872
|
}
|
|
4861
|
-
function
|
|
4873
|
+
function zi() {
|
|
4862
4874
|
try {
|
|
4863
4875
|
return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
|
|
4864
4876
|
} catch {
|
|
@@ -4968,7 +4980,7 @@ function en(n, e = 4, t = 1) {
|
|
|
4968
4980
|
function Cs(n) {
|
|
4969
4981
|
return n > 99 ? n : n > le.twoDigitCutoffYear ? 1900 + n : 2e3 + n;
|
|
4970
4982
|
}
|
|
4971
|
-
function
|
|
4983
|
+
function qi(n, e, t, s = null) {
|
|
4972
4984
|
const r = new Date(n), i = {
|
|
4973
4985
|
hourCycle: "h23",
|
|
4974
4986
|
year: "numeric",
|
|
@@ -4987,7 +4999,7 @@ function qn(n, e) {
|
|
|
4987
4999
|
const s = parseInt(e, 10) || 0, r = t < 0 || Object.is(t, -0) ? -s : s;
|
|
4988
5000
|
return t * 60 + r;
|
|
4989
5001
|
}
|
|
4990
|
-
function
|
|
5002
|
+
function Bi(n) {
|
|
4991
5003
|
const e = Number(n);
|
|
4992
5004
|
if (typeof n == "boolean" || n === "" || !Number.isFinite(e))
|
|
4993
5005
|
throw new ge(`Invalid unit value ${n}`);
|
|
@@ -4999,7 +5011,7 @@ function Fn(n, e) {
|
|
|
4999
5011
|
if (At(n, s)) {
|
|
5000
5012
|
const r = n[s];
|
|
5001
5013
|
if (r == null) continue;
|
|
5002
|
-
t[e(s)] =
|
|
5014
|
+
t[e(s)] = Bi(r);
|
|
5003
5015
|
}
|
|
5004
5016
|
return t;
|
|
5005
5017
|
}
|
|
@@ -5032,7 +5044,7 @@ const ul = [
|
|
|
5032
5044
|
"October",
|
|
5033
5045
|
"November",
|
|
5034
5046
|
"December"
|
|
5035
|
-
],
|
|
5047
|
+
], Hi = [
|
|
5036
5048
|
"Jan",
|
|
5037
5049
|
"Feb",
|
|
5038
5050
|
"Mar",
|
|
@@ -5046,12 +5058,12 @@ const ul = [
|
|
|
5046
5058
|
"Nov",
|
|
5047
5059
|
"Dec"
|
|
5048
5060
|
], dl = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
5049
|
-
function
|
|
5061
|
+
function Gi(n) {
|
|
5050
5062
|
switch (n) {
|
|
5051
5063
|
case "narrow":
|
|
5052
5064
|
return [...dl];
|
|
5053
5065
|
case "short":
|
|
5054
|
-
return [...
|
|
5066
|
+
return [...Hi];
|
|
5055
5067
|
case "long":
|
|
5056
5068
|
return [...ul];
|
|
5057
5069
|
case "numeric":
|
|
@@ -5062,7 +5074,7 @@ function Hi(n) {
|
|
|
5062
5074
|
return null;
|
|
5063
5075
|
}
|
|
5064
5076
|
}
|
|
5065
|
-
const
|
|
5077
|
+
const Yi = [
|
|
5066
5078
|
"Monday",
|
|
5067
5079
|
"Tuesday",
|
|
5068
5080
|
"Wednesday",
|
|
@@ -5070,23 +5082,23 @@ const Gi = [
|
|
|
5070
5082
|
"Friday",
|
|
5071
5083
|
"Saturday",
|
|
5072
5084
|
"Sunday"
|
|
5073
|
-
],
|
|
5074
|
-
function
|
|
5085
|
+
], Ji = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], fl = ["M", "T", "W", "T", "F", "S", "S"];
|
|
5086
|
+
function Qi(n) {
|
|
5075
5087
|
switch (n) {
|
|
5076
5088
|
case "narrow":
|
|
5077
5089
|
return [...fl];
|
|
5078
5090
|
case "short":
|
|
5079
|
-
return [...
|
|
5091
|
+
return [...Ji];
|
|
5080
5092
|
case "long":
|
|
5081
|
-
return [...
|
|
5093
|
+
return [...Yi];
|
|
5082
5094
|
case "numeric":
|
|
5083
5095
|
return ["1", "2", "3", "4", "5", "6", "7"];
|
|
5084
5096
|
default:
|
|
5085
5097
|
return null;
|
|
5086
5098
|
}
|
|
5087
5099
|
}
|
|
5088
|
-
const
|
|
5089
|
-
function
|
|
5100
|
+
const Ki = ["AM", "PM"], hl = ["Before Christ", "Anno Domini"], ml = ["BC", "AD"], pl = ["B", "A"];
|
|
5101
|
+
function Xi(n) {
|
|
5090
5102
|
switch (n) {
|
|
5091
5103
|
case "narrow":
|
|
5092
5104
|
return [...pl];
|
|
@@ -5099,16 +5111,16 @@ function Ki(n) {
|
|
|
5099
5111
|
}
|
|
5100
5112
|
}
|
|
5101
5113
|
function yl(n) {
|
|
5102
|
-
return
|
|
5114
|
+
return Ki[n.hour < 12 ? 0 : 1];
|
|
5103
5115
|
}
|
|
5104
5116
|
function gl(n, e) {
|
|
5105
|
-
return
|
|
5117
|
+
return Qi(e)[n.weekday - 1];
|
|
5106
5118
|
}
|
|
5107
5119
|
function wl(n, e) {
|
|
5108
|
-
return
|
|
5120
|
+
return Gi(e)[n.month - 1];
|
|
5109
5121
|
}
|
|
5110
5122
|
function _l(n, e) {
|
|
5111
|
-
return
|
|
5123
|
+
return Xi(e)[n.year < 0 ? 0 : 1];
|
|
5112
5124
|
}
|
|
5113
5125
|
function El(n, e, t = "always", s = !1) {
|
|
5114
5126
|
const r = {
|
|
@@ -5143,25 +5155,25 @@ function Ar(n, e) {
|
|
|
5143
5155
|
}
|
|
5144
5156
|
const vl = {
|
|
5145
5157
|
D: Cn,
|
|
5146
|
-
DD:
|
|
5147
|
-
DDD:
|
|
5148
|
-
DDDD:
|
|
5149
|
-
t:
|
|
5150
|
-
tt:
|
|
5151
|
-
ttt:
|
|
5152
|
-
tttt:
|
|
5153
|
-
T:
|
|
5154
|
-
TT:
|
|
5155
|
-
TTT:
|
|
5156
|
-
TTTT:
|
|
5157
|
-
f:
|
|
5158
|
-
ff:
|
|
5159
|
-
fff:
|
|
5160
|
-
ffff:
|
|
5161
|
-
F:
|
|
5162
|
-
FF:
|
|
5163
|
-
FFF:
|
|
5164
|
-
FFFF:
|
|
5158
|
+
DD: yi,
|
|
5159
|
+
DDD: gi,
|
|
5160
|
+
DDDD: wi,
|
|
5161
|
+
t: _i,
|
|
5162
|
+
tt: Ei,
|
|
5163
|
+
ttt: vi,
|
|
5164
|
+
tttt: Oi,
|
|
5165
|
+
T: ki,
|
|
5166
|
+
TT: bi,
|
|
5167
|
+
TTT: Si,
|
|
5168
|
+
TTTT: Ri,
|
|
5169
|
+
f: Ti,
|
|
5170
|
+
ff: xi,
|
|
5171
|
+
fff: Di,
|
|
5172
|
+
ffff: Ci,
|
|
5173
|
+
F: Ni,
|
|
5174
|
+
FF: Ii,
|
|
5175
|
+
FFF: Ai,
|
|
5176
|
+
FFFF: $i
|
|
5165
5177
|
};
|
|
5166
5178
|
class we {
|
|
5167
5179
|
static create(e, t = {}) {
|
|
@@ -5403,7 +5415,7 @@ class we {
|
|
|
5403
5415
|
return Ar(o, i(l, c));
|
|
5404
5416
|
}
|
|
5405
5417
|
}
|
|
5406
|
-
const
|
|
5418
|
+
const eo = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
5407
5419
|
function $t(...n) {
|
|
5408
5420
|
const e = n.reduce((t, s) => t + s.source, "");
|
|
5409
5421
|
return RegExp(`^${e}$`);
|
|
@@ -5427,7 +5439,7 @@ function Ft(n, ...e) {
|
|
|
5427
5439
|
}
|
|
5428
5440
|
return [null, null];
|
|
5429
5441
|
}
|
|
5430
|
-
function
|
|
5442
|
+
function to(...n) {
|
|
5431
5443
|
return (e, t) => {
|
|
5432
5444
|
const s = {};
|
|
5433
5445
|
let r;
|
|
@@ -5436,9 +5448,9 @@ function eo(...n) {
|
|
|
5436
5448
|
return [s, null, t + r];
|
|
5437
5449
|
};
|
|
5438
5450
|
}
|
|
5439
|
-
const
|
|
5440
|
-
`${qs.source} ?(?:${
|
|
5441
|
-
), xl = RegExp(`(?: ${
|
|
5451
|
+
const no = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Ol = `(?:${no.source}?(?:\\[(${eo.source})\\])?)?`, qs = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, so = RegExp(`${qs.source}${Ol}`), Bs = RegExp(`(?:[Tt]${so.source})?`), kl = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, bl = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Sl = /(\d{4})-?(\d{3})/, Rl = to("weekYear", "weekNumber", "weekDay"), Tl = to("year", "ordinal"), Nl = /(\d{4})-(\d\d)-(\d\d)/, ro = RegExp(
|
|
5452
|
+
`${qs.source} ?(?:${no.source}|(${eo.source}))?`
|
|
5453
|
+
), xl = RegExp(`(?: ${ro.source})?`);
|
|
5442
5454
|
function Rt(n, e, t) {
|
|
5443
5455
|
const s = n[e];
|
|
5444
5456
|
return B(s) ? t : Ke(s);
|
|
@@ -5496,12 +5508,12 @@ const $l = {
|
|
|
5496
5508
|
function Hs(n, e, t, s, r, i, o) {
|
|
5497
5509
|
const a = {
|
|
5498
5510
|
year: e.length === 2 ? Cs(Ke(e)) : Ke(e),
|
|
5499
|
-
month:
|
|
5511
|
+
month: Hi.indexOf(t) + 1,
|
|
5500
5512
|
day: Ke(s),
|
|
5501
5513
|
hour: Ke(r),
|
|
5502
5514
|
minute: Ke(i)
|
|
5503
5515
|
};
|
|
5504
|
-
return o && (a.second = Ke(o)), n && (a.weekday = n.length > 3 ?
|
|
5516
|
+
return o && (a.second = Ke(o)), n && (a.weekday = n.length > 3 ? Yi.indexOf(n) + 1 : Ji.indexOf(n) + 1), a;
|
|
5505
5517
|
}
|
|
5506
5518
|
const Ml = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
|
|
5507
5519
|
function Fl(n) {
|
|
@@ -5534,7 +5546,7 @@ function Wl(n) {
|
|
|
5534
5546
|
const [, e, t, s, r, i, o, a] = n;
|
|
5535
5547
|
return [Hs(e, a, t, s, r, i, o), _e.utcInstance];
|
|
5536
5548
|
}
|
|
5537
|
-
const jl = $t(kl, Bs), Zl = $t(bl, Bs), zl = $t(Sl, Bs), ql = $t(
|
|
5549
|
+
const jl = $t(kl, Bs), Zl = $t(bl, Bs), zl = $t(Sl, Bs), ql = $t(so), io = Mt(
|
|
5538
5550
|
Il,
|
|
5539
5551
|
Pt,
|
|
5540
5552
|
on,
|
|
@@ -5557,7 +5569,7 @@ const jl = $t(kl, Bs), Zl = $t(bl, Bs), zl = $t(Sl, Bs), ql = $t(no), ro = Mt(
|
|
|
5557
5569
|
function Yl(n) {
|
|
5558
5570
|
return Ft(
|
|
5559
5571
|
n,
|
|
5560
|
-
[jl,
|
|
5572
|
+
[jl, io],
|
|
5561
5573
|
[Zl, Bl],
|
|
5562
5574
|
[zl, Hl],
|
|
5563
5575
|
[ql, Gl]
|
|
@@ -5581,7 +5593,7 @@ const Xl = Mt(Pt);
|
|
|
5581
5593
|
function ec(n) {
|
|
5582
5594
|
return Ft(n, [Dl, Xl]);
|
|
5583
5595
|
}
|
|
5584
|
-
const tc = $t(Nl, xl), nc = $t(
|
|
5596
|
+
const tc = $t(Nl, xl), nc = $t(ro), sc = Mt(
|
|
5585
5597
|
Pt,
|
|
5586
5598
|
on,
|
|
5587
5599
|
an
|
|
@@ -5589,11 +5601,11 @@ const tc = $t(Nl, xl), nc = $t(so), sc = Mt(
|
|
|
5589
5601
|
function rc(n) {
|
|
5590
5602
|
return Ft(
|
|
5591
5603
|
n,
|
|
5592
|
-
[tc,
|
|
5604
|
+
[tc, io],
|
|
5593
5605
|
[nc, sc]
|
|
5594
5606
|
);
|
|
5595
5607
|
}
|
|
5596
|
-
const $r = "Invalid Duration",
|
|
5608
|
+
const $r = "Invalid Duration", oo = {
|
|
5597
5609
|
weeks: {
|
|
5598
5610
|
days: 7,
|
|
5599
5611
|
hours: 168,
|
|
@@ -5638,7 +5650,7 @@ const $r = "Invalid Duration", io = {
|
|
|
5638
5650
|
seconds: 720 * 60 * 60,
|
|
5639
5651
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
5640
5652
|
},
|
|
5641
|
-
...
|
|
5653
|
+
...oo
|
|
5642
5654
|
}, Te = 146097 / 400, _t = 146097 / 4800, oc = {
|
|
5643
5655
|
years: {
|
|
5644
5656
|
quarters: 4,
|
|
@@ -5667,7 +5679,7 @@ const $r = "Invalid Duration", io = {
|
|
|
5667
5679
|
seconds: _t * 24 * 60 * 60,
|
|
5668
5680
|
milliseconds: _t * 24 * 60 * 60 * 1e3
|
|
5669
5681
|
},
|
|
5670
|
-
...
|
|
5682
|
+
...oo
|
|
5671
5683
|
}, ft = [
|
|
5672
5684
|
"years",
|
|
5673
5685
|
"quarters",
|
|
@@ -5688,14 +5700,14 @@ function Ze(n, e, t = !1) {
|
|
|
5688
5700
|
};
|
|
5689
5701
|
return new X(s);
|
|
5690
5702
|
}
|
|
5691
|
-
function
|
|
5703
|
+
function ao(n, e) {
|
|
5692
5704
|
let t = e.milliseconds ?? 0;
|
|
5693
5705
|
for (const s of ac.slice(1))
|
|
5694
5706
|
e[s] && (t += e[s] * n[s].milliseconds);
|
|
5695
5707
|
return t;
|
|
5696
5708
|
}
|
|
5697
5709
|
function Mr(n, e) {
|
|
5698
|
-
const t =
|
|
5710
|
+
const t = ao(n, e) < 0 ? -1 : 1;
|
|
5699
5711
|
ft.reduceRight((s, r) => {
|
|
5700
5712
|
if (B(e[r]))
|
|
5701
5713
|
return s;
|
|
@@ -5870,7 +5882,7 @@ class X {
|
|
|
5870
5882
|
millisecond: "milliseconds",
|
|
5871
5883
|
milliseconds: "milliseconds"
|
|
5872
5884
|
}[e && e.toLowerCase()];
|
|
5873
|
-
if (!t) throw new
|
|
5885
|
+
if (!t) throw new pi(e);
|
|
5874
5886
|
return t;
|
|
5875
5887
|
}
|
|
5876
5888
|
/**
|
|
@@ -6030,7 +6042,7 @@ class X {
|
|
|
6030
6042
|
* @return {number}
|
|
6031
6043
|
*/
|
|
6032
6044
|
toMillis() {
|
|
6033
|
-
return this.isValid ?
|
|
6045
|
+
return this.isValid ? ao(this.matrix, this.values) : NaN;
|
|
6034
6046
|
}
|
|
6035
6047
|
/**
|
|
6036
6048
|
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
@@ -6072,7 +6084,7 @@ class X {
|
|
|
6072
6084
|
if (!this.isValid) return this;
|
|
6073
6085
|
const t = {};
|
|
6074
6086
|
for (const s of Object.keys(this.values))
|
|
6075
|
-
t[s] =
|
|
6087
|
+
t[s] = Bi(e(this.values[s], s));
|
|
6076
6088
|
return Ze(this, { values: t }, !0);
|
|
6077
6089
|
}
|
|
6078
6090
|
/**
|
|
@@ -6951,7 +6963,7 @@ class dn {
|
|
|
6951
6963
|
* @return {Object}
|
|
6952
6964
|
*/
|
|
6953
6965
|
static features() {
|
|
6954
|
-
return { relative:
|
|
6966
|
+
return { relative: Zi(), localeWeek: zi() };
|
|
6955
6967
|
}
|
|
6956
6968
|
}
|
|
6957
6969
|
function Pr(n, e) {
|
|
@@ -6990,12 +7002,12 @@ const dc = "missing Intl.DateTimeFormat.formatToParts support";
|
|
|
6990
7002
|
function te(n, e = (t) => t) {
|
|
6991
7003
|
return { regex: n, deser: ([t]) => e(tl(t)) };
|
|
6992
7004
|
}
|
|
6993
|
-
const fc = " ",
|
|
7005
|
+
const fc = " ", lo = `[ ${fc}]`, co = new RegExp(lo, "g");
|
|
6994
7006
|
function hc(n) {
|
|
6995
|
-
return n.replace(/\./g, "\\.?").replace(
|
|
7007
|
+
return n.replace(/\./g, "\\.?").replace(co, lo);
|
|
6996
7008
|
}
|
|
6997
7009
|
function Lr(n) {
|
|
6998
|
-
return n.replace(/\./g, "").replace(
|
|
7010
|
+
return n.replace(/\./g, "").replace(co, " ").toLowerCase();
|
|
6999
7011
|
}
|
|
7000
7012
|
function $e(n, e) {
|
|
7001
7013
|
return n === null ? null : {
|
|
@@ -7263,15 +7275,15 @@ function vc() {
|
|
|
7263
7275
|
function Oc(n, e) {
|
|
7264
7276
|
if (n.literal)
|
|
7265
7277
|
return n;
|
|
7266
|
-
const t = we.macroTokenToFormatOpts(n.val), s =
|
|
7278
|
+
const t = we.macroTokenToFormatOpts(n.val), s = mo(t, e);
|
|
7267
7279
|
return s == null || s.includes(void 0) ? n : s;
|
|
7268
7280
|
}
|
|
7269
|
-
function
|
|
7281
|
+
function uo(n, e) {
|
|
7270
7282
|
return Array.prototype.concat(...n.map((t) => Oc(t, e)));
|
|
7271
7283
|
}
|
|
7272
|
-
class
|
|
7284
|
+
class fo {
|
|
7273
7285
|
constructor(e, t) {
|
|
7274
|
-
if (this.locale = e, this.format = t, this.tokens =
|
|
7286
|
+
if (this.locale = e, this.format = t, this.tokens = uo(we.parseFormat(t), e), this.units = this.tokens.map((s) => pc(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
|
|
7275
7287
|
const [s, r] = wc(this.units);
|
|
7276
7288
|
this.regex = RegExp(s, "i"), this.handlers = r;
|
|
7277
7289
|
}
|
|
@@ -7303,14 +7315,14 @@ class uo {
|
|
|
7303
7315
|
return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
|
|
7304
7316
|
}
|
|
7305
7317
|
}
|
|
7306
|
-
function
|
|
7307
|
-
return new
|
|
7318
|
+
function ho(n, e, t) {
|
|
7319
|
+
return new fo(n, t).explainFromTokens(e);
|
|
7308
7320
|
}
|
|
7309
7321
|
function kc(n, e, t) {
|
|
7310
|
-
const { result: s, zone: r, specificOffset: i, invalidReason: o } =
|
|
7322
|
+
const { result: s, zone: r, specificOffset: i, invalidReason: o } = ho(n, e, t);
|
|
7311
7323
|
return [s, r, i, o];
|
|
7312
7324
|
}
|
|
7313
|
-
function
|
|
7325
|
+
function mo(n, e) {
|
|
7314
7326
|
if (!n)
|
|
7315
7327
|
return null;
|
|
7316
7328
|
const s = we.create(e, n).dtFormatter(vc()), r = s.formatToParts(), i = s.resolvedOptions();
|
|
@@ -7341,7 +7353,7 @@ function ct(n, e) {
|
|
|
7341
7353
|
};
|
|
7342
7354
|
return new L({ ...t, ...e, old: t });
|
|
7343
7355
|
}
|
|
7344
|
-
function
|
|
7356
|
+
function po(n, e, t) {
|
|
7345
7357
|
let s = n - e * 60 * 1e3;
|
|
7346
7358
|
const r = t.offset(s);
|
|
7347
7359
|
if (e === r)
|
|
@@ -7364,7 +7376,7 @@ function hn(n, e) {
|
|
|
7364
7376
|
};
|
|
7365
7377
|
}
|
|
7366
7378
|
function gn(n, e, t) {
|
|
7367
|
-
return
|
|
7379
|
+
return po(zn(n), e, t);
|
|
7368
7380
|
}
|
|
7369
7381
|
function Wr(n, e) {
|
|
7370
7382
|
const t = n.o, s = n.c.year + Math.trunc(e.years), r = n.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
|
|
@@ -7383,7 +7395,7 @@ function Wr(n, e) {
|
|
|
7383
7395
|
seconds: e.seconds,
|
|
7384
7396
|
milliseconds: e.milliseconds
|
|
7385
7397
|
}).as("milliseconds"), a = zn(i);
|
|
7386
|
-
let [l, c] =
|
|
7398
|
+
let [l, c] = po(a, t, n.zone);
|
|
7387
7399
|
return o !== 0 && (l += o, c = n.zone.offset(l)), { ts: l, o: c };
|
|
7388
7400
|
}
|
|
7389
7401
|
function vt(n, e, t, s, r, i) {
|
|
@@ -7437,7 +7449,7 @@ function jr(n, e, t, s, r, i, o) {
|
|
|
7437
7449
|
}
|
|
7438
7450
|
return r && (n.isOffsetFixed && n.offset === 0 && !i ? l += "Z" : n.o < 0 ? (l += "-", l += fe(Math.trunc(-n.o / 60)), l += ":", l += fe(Math.trunc(-n.o % 60))) : (l += "+", l += fe(Math.trunc(n.o / 60)), l += ":", l += fe(Math.trunc(n.o % 60)))), i && (l += "[" + n.zone.ianaName + "]"), l;
|
|
7439
7451
|
}
|
|
7440
|
-
const
|
|
7452
|
+
const yo = {
|
|
7441
7453
|
month: 1,
|
|
7442
7454
|
day: 1,
|
|
7443
7455
|
hour: 0,
|
|
@@ -7493,7 +7505,7 @@ function _n(n) {
|
|
|
7493
7505
|
weekyears: "weekYear",
|
|
7494
7506
|
ordinal: "ordinal"
|
|
7495
7507
|
}[n.toLowerCase()];
|
|
7496
|
-
if (!e) throw new
|
|
7508
|
+
if (!e) throw new pi(n);
|
|
7497
7509
|
return e;
|
|
7498
7510
|
}
|
|
7499
7511
|
function Zr(n) {
|
|
@@ -7528,8 +7540,8 @@ function zr(n, e) {
|
|
|
7528
7540
|
r = le.now();
|
|
7529
7541
|
else {
|
|
7530
7542
|
for (const l of wn)
|
|
7531
|
-
B(n[l]) && (n[l] =
|
|
7532
|
-
const o =
|
|
7543
|
+
B(n[l]) && (n[l] = yo[l]);
|
|
7544
|
+
const o = Wi(n) || ji(n);
|
|
7533
7545
|
if (o)
|
|
7534
7546
|
return L.invalid(o);
|
|
7535
7547
|
const a = Nc(t);
|
|
@@ -7744,13 +7756,13 @@ class L {
|
|
|
7744
7756
|
throw new kt("Can't mix ordinal dates with month/day");
|
|
7745
7757
|
const E = w || i.weekday && !f;
|
|
7746
7758
|
let p, k, b = hn(l, c);
|
|
7747
|
-
E ? (p = Rc, k = bc, b = $n(b, o, a)) : d ? (p = Tc, k = Sc, b = rs(b)) : (p = wn, k =
|
|
7759
|
+
E ? (p = Rc, k = bc, b = $n(b, o, a)) : d ? (p = Tc, k = Sc, b = rs(b)) : (p = wn, k = yo);
|
|
7748
7760
|
let T = !1;
|
|
7749
7761
|
for (const m of p) {
|
|
7750
7762
|
const S = i[m];
|
|
7751
7763
|
B(S) ? T ? i[m] = k[m] : i[m] = b[m] : T = !0;
|
|
7752
7764
|
}
|
|
7753
|
-
const g = E ? sl(i, o, a) : d ? rl(i) :
|
|
7765
|
+
const g = E ? sl(i, o, a) : d ? rl(i) : Wi(i), R = g || ji(i);
|
|
7754
7766
|
if (R)
|
|
7755
7767
|
return L.invalid(R);
|
|
7756
7768
|
const _ = E ? Tr(i, o, a) : d ? Nr(i) : i, [P, x] = gn(_, c, s), F = new L({
|
|
@@ -7908,7 +7920,7 @@ class L {
|
|
|
7908
7920
|
* @returns {string}
|
|
7909
7921
|
*/
|
|
7910
7922
|
static parseFormatForOpts(e, t = {}) {
|
|
7911
|
-
const s =
|
|
7923
|
+
const s = mo(e, ne.fromObject(t));
|
|
7912
7924
|
return s ? s.map((r) => r ? r.val : null).join("") : null;
|
|
7913
7925
|
}
|
|
7914
7926
|
/**
|
|
@@ -7919,7 +7931,7 @@ class L {
|
|
|
7919
7931
|
* @returns {string}
|
|
7920
7932
|
*/
|
|
7921
7933
|
static expandFormat(e, t = {}) {
|
|
7922
|
-
return
|
|
7934
|
+
return uo(we.parseFormat(e), ne.fromObject(t)).map((r) => r.val).join("");
|
|
7923
7935
|
}
|
|
7924
7936
|
static resetCache() {
|
|
7925
7937
|
Ht = void 0, $s.clear();
|
|
@@ -8912,7 +8924,7 @@ class L {
|
|
|
8912
8924
|
numberingSystem: i,
|
|
8913
8925
|
defaultToEN: !0
|
|
8914
8926
|
});
|
|
8915
|
-
return
|
|
8927
|
+
return ho(o, e, t);
|
|
8916
8928
|
}
|
|
8917
8929
|
/**
|
|
8918
8930
|
* @deprecated use fromFormatExplain instead
|
|
@@ -8938,7 +8950,7 @@ class L {
|
|
|
8938
8950
|
numberingSystem: r,
|
|
8939
8951
|
defaultToEN: !0
|
|
8940
8952
|
});
|
|
8941
|
-
return new
|
|
8953
|
+
return new fo(i, e);
|
|
8942
8954
|
}
|
|
8943
8955
|
/**
|
|
8944
8956
|
* Create a DateTime from an input string and format parser.
|
|
@@ -8987,7 +8999,7 @@ class L {
|
|
|
8987
8999
|
* @type {Object}
|
|
8988
9000
|
*/
|
|
8989
9001
|
static get DATE_MED() {
|
|
8990
|
-
return
|
|
9002
|
+
return yi;
|
|
8991
9003
|
}
|
|
8992
9004
|
/**
|
|
8993
9005
|
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
@@ -9001,98 +9013,98 @@ class L {
|
|
|
9001
9013
|
* @type {Object}
|
|
9002
9014
|
*/
|
|
9003
9015
|
static get DATE_FULL() {
|
|
9004
|
-
return
|
|
9016
|
+
return gi;
|
|
9005
9017
|
}
|
|
9006
9018
|
/**
|
|
9007
9019
|
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
9008
9020
|
* @type {Object}
|
|
9009
9021
|
*/
|
|
9010
9022
|
static get DATE_HUGE() {
|
|
9011
|
-
return
|
|
9023
|
+
return wi;
|
|
9012
9024
|
}
|
|
9013
9025
|
/**
|
|
9014
9026
|
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
|
|
9015
9027
|
* @type {Object}
|
|
9016
9028
|
*/
|
|
9017
9029
|
static get TIME_SIMPLE() {
|
|
9018
|
-
return
|
|
9030
|
+
return _i;
|
|
9019
9031
|
}
|
|
9020
9032
|
/**
|
|
9021
9033
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
|
|
9022
9034
|
* @type {Object}
|
|
9023
9035
|
*/
|
|
9024
9036
|
static get TIME_WITH_SECONDS() {
|
|
9025
|
-
return
|
|
9037
|
+
return Ei;
|
|
9026
9038
|
}
|
|
9027
9039
|
/**
|
|
9028
9040
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
|
|
9029
9041
|
* @type {Object}
|
|
9030
9042
|
*/
|
|
9031
9043
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
9032
|
-
return
|
|
9044
|
+
return vi;
|
|
9033
9045
|
}
|
|
9034
9046
|
/**
|
|
9035
9047
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9036
9048
|
* @type {Object}
|
|
9037
9049
|
*/
|
|
9038
9050
|
static get TIME_WITH_LONG_OFFSET() {
|
|
9039
|
-
return
|
|
9051
|
+
return Oi;
|
|
9040
9052
|
}
|
|
9041
9053
|
/**
|
|
9042
9054
|
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
9043
9055
|
* @type {Object}
|
|
9044
9056
|
*/
|
|
9045
9057
|
static get TIME_24_SIMPLE() {
|
|
9046
|
-
return
|
|
9058
|
+
return ki;
|
|
9047
9059
|
}
|
|
9048
9060
|
/**
|
|
9049
9061
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
9050
9062
|
* @type {Object}
|
|
9051
9063
|
*/
|
|
9052
9064
|
static get TIME_24_WITH_SECONDS() {
|
|
9053
|
-
return
|
|
9065
|
+
return bi;
|
|
9054
9066
|
}
|
|
9055
9067
|
/**
|
|
9056
9068
|
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
9057
9069
|
* @type {Object}
|
|
9058
9070
|
*/
|
|
9059
9071
|
static get TIME_24_WITH_SHORT_OFFSET() {
|
|
9060
|
-
return
|
|
9072
|
+
return Si;
|
|
9061
9073
|
}
|
|
9062
9074
|
/**
|
|
9063
9075
|
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
|
|
9064
9076
|
* @type {Object}
|
|
9065
9077
|
*/
|
|
9066
9078
|
static get TIME_24_WITH_LONG_OFFSET() {
|
|
9067
|
-
return
|
|
9079
|
+
return Ri;
|
|
9068
9080
|
}
|
|
9069
9081
|
/**
|
|
9070
9082
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
9071
9083
|
* @type {Object}
|
|
9072
9084
|
*/
|
|
9073
9085
|
static get DATETIME_SHORT() {
|
|
9074
|
-
return
|
|
9086
|
+
return Ti;
|
|
9075
9087
|
}
|
|
9076
9088
|
/**
|
|
9077
9089
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
9078
9090
|
* @type {Object}
|
|
9079
9091
|
*/
|
|
9080
9092
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
9081
|
-
return
|
|
9093
|
+
return Ni;
|
|
9082
9094
|
}
|
|
9083
9095
|
/**
|
|
9084
9096
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
9085
9097
|
* @type {Object}
|
|
9086
9098
|
*/
|
|
9087
9099
|
static get DATETIME_MED() {
|
|
9088
|
-
return
|
|
9100
|
+
return xi;
|
|
9089
9101
|
}
|
|
9090
9102
|
/**
|
|
9091
9103
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
9092
9104
|
* @type {Object}
|
|
9093
9105
|
*/
|
|
9094
9106
|
static get DATETIME_MED_WITH_SECONDS() {
|
|
9095
|
-
return
|
|
9107
|
+
return Ii;
|
|
9096
9108
|
}
|
|
9097
9109
|
/**
|
|
9098
9110
|
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
@@ -9106,28 +9118,28 @@ class L {
|
|
|
9106
9118
|
* @type {Object}
|
|
9107
9119
|
*/
|
|
9108
9120
|
static get DATETIME_FULL() {
|
|
9109
|
-
return
|
|
9121
|
+
return Di;
|
|
9110
9122
|
}
|
|
9111
9123
|
/**
|
|
9112
9124
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
|
|
9113
9125
|
* @type {Object}
|
|
9114
9126
|
*/
|
|
9115
9127
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
9116
|
-
return
|
|
9128
|
+
return Ai;
|
|
9117
9129
|
}
|
|
9118
9130
|
/**
|
|
9119
9131
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9120
9132
|
* @type {Object}
|
|
9121
9133
|
*/
|
|
9122
9134
|
static get DATETIME_HUGE() {
|
|
9123
|
-
return
|
|
9135
|
+
return Ci;
|
|
9124
9136
|
}
|
|
9125
9137
|
/**
|
|
9126
9138
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
9127
9139
|
* @type {Object}
|
|
9128
9140
|
*/
|
|
9129
9141
|
static get DATETIME_HUGE_WITH_SECONDS() {
|
|
9130
|
-
return
|
|
9142
|
+
return $i;
|
|
9131
9143
|
}
|
|
9132
9144
|
}
|
|
9133
9145
|
function jt(n) {
|
|
@@ -9149,7 +9161,7 @@ const xc = (n, e) => {
|
|
|
9149
9161
|
return nn(ye());
|
|
9150
9162
|
n.includeFields.forEach((r) => {
|
|
9151
9163
|
const i = s.fields.find((o) => o.name === r);
|
|
9152
|
-
i ? t[r] =
|
|
9164
|
+
i ? t[r] = go(i)?.nullable() : t[r] = ye();
|
|
9153
9165
|
});
|
|
9154
9166
|
}
|
|
9155
9167
|
return We({
|
|
@@ -9165,7 +9177,7 @@ const xc = (n, e) => {
|
|
|
9165
9177
|
return (!n.required || i) && (r = r.optional()), r;
|
|
9166
9178
|
}, Dc = () => ye().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
|
|
9167
9179
|
message: "Must be a valid date"
|
|
9168
|
-
}),
|
|
9180
|
+
}), go = (n, e, t) => {
|
|
9169
9181
|
let s;
|
|
9170
9182
|
const r = `${Zt(n.description)}
|
|
9171
9183
|
|
|
@@ -9231,13 +9243,13 @@ const xc = (n, e) => {
|
|
|
9231
9243
|
}, su = (n, e, t, s, r) => {
|
|
9232
9244
|
const { auth: i, softDelete: o } = n, a = {};
|
|
9233
9245
|
n.fields.forEach((c) => {
|
|
9234
|
-
c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (
|
|
9246
|
+
c.type === "Embedding" || s && c.type === "Computed" || s && (c.name === o?.archivedField || c.name === o?.timestampField) || (Q(c) ? (a[c.name] = Ic(c, e, t, s), s ? (c.length && (a[c.name] = a[c.name].describe(`Must contain ${c.length} item(s)`)), c.min && (a[c.name] = a[c.name].describe(`Must contain at least ${c.min} item(s)`)), c.max && (a[c.name] = a[c.name].describe(`Must contain at most ${c.max} item(s)`))) : (c.length && (a[c.name] = a[c.name].refine((d) => c.length && d && Object.keys(d).length === c.length, {
|
|
9235
9247
|
message: `Must contain ${c.length} item(s)`
|
|
9236
9248
|
})), c.min && (a[c.name] = a[c.name].refine((d) => c.min && d && Object.keys(d).length >= c.min, {
|
|
9237
9249
|
message: `Must contain at least ${c.min} item(s)`
|
|
9238
9250
|
})), c.max && (a[c.name] = a[c.name].refine((d) => c.max && (!d || Object.keys(d).length <= c.max), {
|
|
9239
9251
|
message: `Must contain at most ${c.max} item(s)`
|
|
9240
|
-
})))) : a[c.name] =
|
|
9252
|
+
})))) : a[c.name] = go(c, t, s), r && (a[c.name] = a[c.name].optional()));
|
|
9241
9253
|
}), !s && i && (a.operation = Oe([ke("create"), ke("update"), ke("delete")]).optional(), a.password = be().optional(), a.passwordConfirm = be().optional(), Object.values(e.collections).forEach((c) => {
|
|
9242
9254
|
a[`auth-${c.labels.collection}`] = Jt().optional(), a[`operations-${c.labels.collection}`] = gt(Oe([ke("Read"), ke("Create"), ke("Update"), ke("Delete")])).optional(), a[`restrict-${c.labels.collection}`] = Jt().optional(), c.access.attributeRestrictions?.forEach((d) => {
|
|
9243
9255
|
a[`attribute-${c.labels.collection}-${d.type}`] = Jt().optional();
|
|
@@ -9271,8 +9283,8 @@ const xc = (n, e) => {
|
|
|
9271
9283
|
}), R.forEach((m) => {
|
|
9272
9284
|
if (at(m, o, i)) {
|
|
9273
9285
|
const S = cn(m, o, i), v = {};
|
|
9274
|
-
r[m.name] !== void 0 && (v[m.name] = r[m.name],
|
|
9275
|
-
r[y.name] !== void 0 && (
|
|
9286
|
+
r[m.name] !== void 0 && (v[m.name] = r[m.name], Q(m) && (v[`${m.name}_Array`] = r[`${m.name}_Array`])), S.forEach((y) => {
|
|
9287
|
+
r[y.name] !== void 0 && (Q(y) ? v[`${y.name}_Array`] = r[`${y.name}_Array`] : v[y.name] = r[y.name]);
|
|
9276
9288
|
}), Object.keys(v).length > 0 && (n === "create" && (v.Collection_Path = t, v.Collection_Path_String = t.join("/"), e.set(u(m), v)), n === "update" && e.update(u(m), v), n === "delete" && e.delete(u(m)), g && g.size++);
|
|
9277
9289
|
}
|
|
9278
9290
|
});
|
|
@@ -9290,7 +9302,7 @@ const xc = (n, e) => {
|
|
|
9290
9302
|
});
|
|
9291
9303
|
const y = l[m.labels.collection];
|
|
9292
9304
|
for (const D of y)
|
|
9293
|
-
D.fields.some((O) => O.name === S.name) &&
|
|
9305
|
+
D.fields.some((O) => O.name === S.name) && Q(S) && v++;
|
|
9294
9306
|
return v;
|
|
9295
9307
|
}, x = (m, S, v, y, D) => {
|
|
9296
9308
|
const O = {};
|
|
@@ -9304,11 +9316,11 @@ const xc = (n, e) => {
|
|
|
9304
9316
|
});
|
|
9305
9317
|
const V = l[S.labels.collection];
|
|
9306
9318
|
for (const A of V)
|
|
9307
|
-
A.fields.some((C) => C.name === v.name) &&
|
|
9319
|
+
A.fields.some((C) => C.name === v.name) && Q(v) && e.update(k(m, A.key, y), O);
|
|
9308
9320
|
};
|
|
9309
9321
|
if (n === "delete")
|
|
9310
9322
|
return;
|
|
9311
|
-
const F = R.filter((m) =>
|
|
9323
|
+
const F = R.filter((m) => Q(m) && m.twoWay);
|
|
9312
9324
|
if (!a?.noTwoWay) {
|
|
9313
9325
|
for (const m of F) {
|
|
9314
9326
|
if (!g)
|
|
@@ -9316,7 +9328,7 @@ const xc = (n, e) => {
|
|
|
9316
9328
|
const S = i.collections[m.collection], v = W(S.fields, m.twoWay), y = ut(S, S.fields), D = Array.from(y).map((O) => O.name);
|
|
9317
9329
|
if (!v)
|
|
9318
9330
|
throw new Error(`SCHEMA_ERROR: Field ${m.twoWay} not found in collection ${m.collection}`);
|
|
9319
|
-
if (
|
|
9331
|
+
if (Q(v)) {
|
|
9320
9332
|
if (r[`${m.name}_Array`])
|
|
9321
9333
|
for (const [O, V] of Object.entries(r[m.name])) {
|
|
9322
9334
|
if (n === "update" && b && b[`${m.name}_Array`]?.includes(O))
|
|
@@ -9380,7 +9392,7 @@ const xc = (n, e) => {
|
|
|
9380
9392
|
const S = i.collections[m.collection], v = W(S.fields, m.twoWay);
|
|
9381
9393
|
if (!v)
|
|
9382
9394
|
throw new Error(`SCHEMA_ERROR: Field ${m.twoWay} not found in collection ${m.collection}`);
|
|
9383
|
-
if (
|
|
9395
|
+
if (Q(v)) {
|
|
9384
9396
|
if (n === "update" && b && !(r[m.name] && Me(r[m.name])) && r[`${m.name}_Array`] && b[`${m.name}_Array`]?.length > 0)
|
|
9385
9397
|
for (const [y, D] of Object.entries(b[m.name]))
|
|
9386
9398
|
!r[`${m.name}_Array`].includes(y) && !T?.get(m.name)?.includes(y) && (g.size += P(S, v), g.size <= 500 && x(m, S, v, y, D.Collection_Path));
|
|
@@ -9393,7 +9405,7 @@ const xc = (n, e) => {
|
|
|
9393
9405
|
const S = i.collections[m.collection], v = W(S.fields, m.twoWay);
|
|
9394
9406
|
if (!v)
|
|
9395
9407
|
throw new Error(`SCHEMA_ERROR: Field ${m.twoWay} not found in collection ${m.collection}`);
|
|
9396
|
-
if (
|
|
9408
|
+
if (Q(v)) {
|
|
9397
9409
|
if (n === "update" && b && r[m.name] && Me(r[m.name]) && b[`${m.name}_Array`]?.length > 0)
|
|
9398
9410
|
for (const [y, D] of Object.entries(b[m.name]))
|
|
9399
9411
|
T?.get(m.name)?.includes(y) || (g.size += P(S, v), g.size <= 500 && x(m, S, v, y, D.Collection_Path));
|
|
@@ -9459,13 +9471,13 @@ const xc = (n, e) => {
|
|
|
9459
9471
|
);
|
|
9460
9472
|
return t;
|
|
9461
9473
|
};
|
|
9462
|
-
let ds,
|
|
9474
|
+
let ds, wo, _o, Gt, Eo, En, vn, fs = 0;
|
|
9463
9475
|
const bt = {
|
|
9464
9476
|
getMode() {
|
|
9465
|
-
return
|
|
9477
|
+
return wo;
|
|
9466
9478
|
},
|
|
9467
9479
|
getTimezone() {
|
|
9468
|
-
return
|
|
9480
|
+
return _o;
|
|
9469
9481
|
},
|
|
9470
9482
|
getGlobalConfigModule() {
|
|
9471
9483
|
return pe(Gt);
|
|
@@ -9473,7 +9485,7 @@ const bt = {
|
|
|
9473
9485
|
getCustomizationFile(n, e) {
|
|
9474
9486
|
if (!Object.keys(e.collections).includes(n))
|
|
9475
9487
|
throw new Error("PERMISSION_DENIED");
|
|
9476
|
-
const t =
|
|
9488
|
+
const t = Qo([n], Eo, "node", bt);
|
|
9477
9489
|
return pe(t?.[n]);
|
|
9478
9490
|
},
|
|
9479
9491
|
getVersionInfo() {
|
|
@@ -9488,7 +9500,7 @@ const bt = {
|
|
|
9488
9500
|
if (!process.env.STOKER_FB_WEB_APP_CONFIG)
|
|
9489
9501
|
throw new Error("STOKER_FB_WEB_APP_CONFIG not set.");
|
|
9490
9502
|
const r = process.env.STOKER_FB_WEB_APP_CONFIG, i = JSON.parse(r);
|
|
9491
|
-
|
|
9503
|
+
wo = n;
|
|
9492
9504
|
const a = (await import(
|
|
9493
9505
|
/* @vite-ignore */
|
|
9494
9506
|
e
|
|
@@ -9505,7 +9517,7 @@ const bt = {
|
|
|
9505
9517
|
});
|
|
9506
9518
|
}
|
|
9507
9519
|
const l = await Ge();
|
|
9508
|
-
return
|
|
9520
|
+
return Eo = await Cc(t, Object.keys(l.collections)), _o = await re(Gt.timezone), ce().collection("system_deployment").doc("maintenance_mode").onSnapshot((c) => {
|
|
9509
9521
|
c.exists ? (vn = c.data(), re(Gt.onMaintenanceUpdate, ["node", vn.active ? "on" : "off"])) : console.error("Maintenance status not found");
|
|
9510
9522
|
}, (c) => {
|
|
9511
9523
|
console.error(c.message);
|
|
@@ -9519,7 +9531,7 @@ const bt = {
|
|
|
9519
9531
|
};
|
|
9520
9532
|
d();
|
|
9521
9533
|
}), bt;
|
|
9522
|
-
}, { getMode:
|
|
9534
|
+
}, { getMode: vo, getTimezone: Oo, getGlobalConfigModule: Lt, getCustomizationFile: Ye, getVersionInfo: iu, getMaintenanceInfo: ou } = bt, Ge = async (n = !1) => {
|
|
9523
9535
|
const s = await ti().ref("schema").orderByChild("published_time").limitToLast(1).get(), r = Object.values(s.val())[0];
|
|
9524
9536
|
if (n) {
|
|
9525
9537
|
for (const i of Object.values(r.collections))
|
|
@@ -9552,7 +9564,7 @@ const bt = {
|
|
|
9552
9564
|
if (!s.Role)
|
|
9553
9565
|
throw new Error("PERMISSION_DENIED");
|
|
9554
9566
|
const f = u && Re("Read", u), w = ii(o, e, s), E = si(o, s), p = Ms(o, s), k = ri(o, e, s), b = (y = []) => {
|
|
9555
|
-
const D = [], O =
|
|
9567
|
+
const D = [], O = ui(s.Role, o, e);
|
|
9556
9568
|
if (!O)
|
|
9557
9569
|
throw new Error("PERMISSION_DENIED");
|
|
9558
9570
|
if (f) {
|
|
@@ -9766,7 +9778,7 @@ const bt = {
|
|
|
9766
9778
|
} else
|
|
9767
9779
|
throw new Error("PERMISSION_DENIED");
|
|
9768
9780
|
else return [h];
|
|
9769
|
-
},
|
|
9781
|
+
}, ko = (n, e, t, s) => {
|
|
9770
9782
|
const r = ce(), i = n.at(-1);
|
|
9771
9783
|
if (!i)
|
|
9772
9784
|
throw new Error("EMPTY_PATH");
|
|
@@ -9775,7 +9787,7 @@ const bt = {
|
|
|
9775
9787
|
const c = s.collections?.[a.collection];
|
|
9776
9788
|
if (!s.Role)
|
|
9777
9789
|
throw new Error("PERMISSION_DENIED");
|
|
9778
|
-
const d = c && Re("Read", c), h = ii(o, t, s), u = [], f =
|
|
9790
|
+
const d = c && Re("Read", c), h = ii(o, t, s), u = [], f = ui(s.Role, o, t);
|
|
9779
9791
|
if (!f)
|
|
9780
9792
|
throw new Error("PERMISSION_DENIED");
|
|
9781
9793
|
if (d)
|
|
@@ -9786,14 +9798,14 @@ const bt = {
|
|
|
9786
9798
|
return u;
|
|
9787
9799
|
} else
|
|
9788
9800
|
return [l.doc(e)];
|
|
9789
|
-
},
|
|
9801
|
+
}, bo = async (n, e, t, s, r, i, o, a, l) => {
|
|
9790
9802
|
const c = e.at(-2), d = oi(s.collections[c], s).map((f) => f.labels.collection);
|
|
9791
9803
|
t.collections ? t.collections.forEach((f) => {
|
|
9792
9804
|
if (!d.includes(f))
|
|
9793
9805
|
throw new Error(`SCHEMA_ERROR: Collection ${f} not found in subcollections of ${c}`);
|
|
9794
9806
|
}) : t.collections = d;
|
|
9795
9807
|
const h = t.depth - 1, u = t.collections.map(async (f) => {
|
|
9796
|
-
const w = await
|
|
9808
|
+
const w = await So([...e, f], t.constraints, {
|
|
9797
9809
|
user: o,
|
|
9798
9810
|
pagination: t.limit,
|
|
9799
9811
|
providedTransaction: a,
|
|
@@ -9806,13 +9818,13 @@ const bt = {
|
|
|
9806
9818
|
n[f].map((E) => Js(E, [...e, f, E.id], r, s, void 0, o, a, l))
|
|
9807
9819
|
), h > 0 && await Promise.all(
|
|
9808
9820
|
// eslint-disable-next-line security/detect-object-injection
|
|
9809
|
-
n[f].map((E) =>
|
|
9821
|
+
n[f].map((E) => bo(E, [...e, f, E.id], { depth: h }, s, r, i, o, a, l))
|
|
9810
9822
|
);
|
|
9811
9823
|
});
|
|
9812
9824
|
await Promise.all(u);
|
|
9813
9825
|
}, Js = async (n, e, t, s, r, i, o, a) => {
|
|
9814
9826
|
const l = e.at(-2);
|
|
9815
|
-
t.fields ||= s.collections[l].fields.filter((h) =>
|
|
9827
|
+
t.fields ||= s.collections[l].fields.filter((h) => Q(h));
|
|
9816
9828
|
const c = t.depth - 1, d = [];
|
|
9817
9829
|
for (const h of t.fields)
|
|
9818
9830
|
if ("collection" in h) {
|
|
@@ -9848,7 +9860,7 @@ const bt = {
|
|
|
9848
9860
|
}
|
|
9849
9861
|
}
|
|
9850
9862
|
await Promise.all(d);
|
|
9851
|
-
},
|
|
9863
|
+
}, So = async (n, e, t) => {
|
|
9852
9864
|
if (t?.subcollections?.depth && t.subcollections.depth > 10)
|
|
9853
9865
|
throw new Error("INPUT_ERROR: Subcollections depth cannot exceed 10");
|
|
9854
9866
|
if (t?.relations?.depth && t.relations.depth > 10)
|
|
@@ -9900,7 +9912,7 @@ const bt = {
|
|
|
9900
9912
|
throw new Error("INPUT_ERROR: startAfter and endBefore cannot be provided together");
|
|
9901
9913
|
const v = t.pagination.startAfter || t.pagination.endBefore;
|
|
9902
9914
|
if (t?.user) {
|
|
9903
|
-
const y =
|
|
9915
|
+
const y = Jo(w.Role, T, f);
|
|
9904
9916
|
if (v && y !== !0)
|
|
9905
9917
|
throw new Error("INPUT_ERROR: Pagination is not allowed when using " + y);
|
|
9906
9918
|
}
|
|
@@ -9927,7 +9939,7 @@ const bt = {
|
|
|
9927
9939
|
}
|
|
9928
9940
|
for (const v of o.values()) {
|
|
9929
9941
|
const y = [], D = [...v.Collection_Path, v.id];
|
|
9930
|
-
t?.subcollections && y.push(
|
|
9942
|
+
t?.subcollections && y.push(bo(
|
|
9931
9943
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9932
9944
|
o.get(v.id),
|
|
9933
9945
|
D,
|
|
@@ -9975,25 +9987,25 @@ const bt = {
|
|
|
9975
9987
|
}
|
|
9976
9988
|
for (const j of T.fields) {
|
|
9977
9989
|
const J = !j.access || j.access.includes(A), N = Ie(j, R), z = N?.custom?.serverAccess?.read !== void 0 ? await re(N.custom.serverAccess.read, [A, v]) : !0;
|
|
9978
|
-
(!J || !z) && (
|
|
9990
|
+
(!J || !z) && (Q(j) ? (delete o.get(v.id)[j.name], delete o.get(v.id)[`${j.name}_Array`], delete o.get(v.id)[`${j.name}_Single`]) : delete o.get(v.id)[j.name]);
|
|
9979
9991
|
}
|
|
9980
9992
|
}
|
|
9981
9993
|
const O = ["read", v, v.id, P];
|
|
9982
9994
|
await oe("postOperation", E, R, O), await oe("postRead", E, R, [P, _, v, !1]);
|
|
9983
9995
|
}
|
|
9984
|
-
t?.user && await
|
|
9996
|
+
t?.user && await Go(Array.from(o.values()), T, f, t.user, w);
|
|
9985
9997
|
};
|
|
9986
9998
|
return t?.providedTransaction ? await a(t.providedTransaction) : await s.runTransaction(async (l) => {
|
|
9987
9999
|
await a(l);
|
|
9988
10000
|
}, { readOnly: !0 }), { cursor: i, pages: r, docs: Array.from(o.values()) };
|
|
9989
|
-
},
|
|
10001
|
+
}, Ro = async (n, e, t, s, r, i, o) => {
|
|
9990
10002
|
const a = t.at(-2), l = oi(r.collections[a], r).map((h) => h.labels.collection);
|
|
9991
10003
|
s.collections ? s.collections.forEach((h) => {
|
|
9992
10004
|
if (!l.includes(h))
|
|
9993
10005
|
throw new Error(`SCHEMA_ERROR: Collection ${h} not found in subcollections of ${a}`);
|
|
9994
10006
|
}) : s.collections = l;
|
|
9995
10007
|
const c = s.depth - 1, d = s.collections.map(async (h) => {
|
|
9996
|
-
const u = await
|
|
10008
|
+
const u = await So([...t, h], s.constraints || [], {
|
|
9997
10009
|
user: o,
|
|
9998
10010
|
relations: i,
|
|
9999
10011
|
pagination: s.limit,
|
|
@@ -10004,14 +10016,14 @@ const bt = {
|
|
|
10004
10016
|
e[h] = u.docs, c > 0 && await Promise.all(
|
|
10005
10017
|
// eslint-disable-next-line security/detect-object-injection
|
|
10006
10018
|
e[h].map(async (f) => {
|
|
10007
|
-
await
|
|
10019
|
+
await Ro(n, f, [...t, h, f.id], { depth: c }, r, i, o);
|
|
10008
10020
|
})
|
|
10009
10021
|
);
|
|
10010
10022
|
});
|
|
10011
10023
|
await Promise.all(d);
|
|
10012
|
-
},
|
|
10024
|
+
}, To = async (n, e, t, s, r, i, o, a) => {
|
|
10013
10025
|
const l = t.at(-2);
|
|
10014
|
-
r.fields ||= s.collections[l].fields.filter((h) =>
|
|
10026
|
+
r.fields ||= s.collections[l].fields.filter((h) => Q(h));
|
|
10015
10027
|
const c = r.depth - 1, d = [];
|
|
10016
10028
|
for (const h of r.fields)
|
|
10017
10029
|
if ("collection" in h) {
|
|
@@ -10026,7 +10038,7 @@ const bt = {
|
|
|
10026
10038
|
noEmbeddingFields: a
|
|
10027
10039
|
}).then((p) => {
|
|
10028
10040
|
if (u[f] = p, c > 0)
|
|
10029
|
-
return
|
|
10041
|
+
return To(
|
|
10030
10042
|
n,
|
|
10031
10043
|
// eslint-disable-next-line security/detect-object-injection
|
|
10032
10044
|
u[f],
|
|
@@ -10086,7 +10098,7 @@ const bt = {
|
|
|
10086
10098
|
}
|
|
10087
10099
|
if (t?.user && (!g || !Re("Read", g)))
|
|
10088
10100
|
throw new Error("PERMISSION_DENIED");
|
|
10089
|
-
const R =
|
|
10101
|
+
const R = ko(n, e, h, u);
|
|
10090
10102
|
if (R.length === 0)
|
|
10091
10103
|
throw new Error("PERMISSION_DENIED");
|
|
10092
10104
|
const _ = {};
|
|
@@ -10099,7 +10111,7 @@ const bt = {
|
|
|
10099
10111
|
} else
|
|
10100
10112
|
throw new Error(`NOT_FOUND: Document with ID ${e} does not exist at location ${n?.join("/") || b.collection}`);
|
|
10101
10113
|
const S = [], v = n ? [...n, e] : [b.collection, e];
|
|
10102
|
-
if (t?.subcollections && S.push(
|
|
10114
|
+
if (t?.subcollections && S.push(Ro(o, r, v, t.subcollections, h, void 0, t.user)), t?.relations && (t.relations.fields && (t.relations.fields = t.relations.fields.map((O) => {
|
|
10103
10115
|
if (typeof O == "string") {
|
|
10104
10116
|
const V = k.fields.find((A) => A.name === O);
|
|
10105
10117
|
if (V)
|
|
@@ -10107,7 +10119,7 @@ const bt = {
|
|
|
10107
10119
|
throw new Error(`SCHEMA_ERROR: Field ${O} not found in collection ${w}`);
|
|
10108
10120
|
}
|
|
10109
10121
|
return O;
|
|
10110
|
-
})), S.push(
|
|
10122
|
+
})), S.push(To(o, r, v, h, t.relations, t.user, t.noComputedFields, t.noEmbeddingFields))), await Promise.all(S), !t?.noComputedFields) {
|
|
10111
10123
|
for (const O of k.fields)
|
|
10112
10124
|
if (O.type === "Computed") {
|
|
10113
10125
|
const V = Ie(O, T);
|
|
@@ -10125,15 +10137,15 @@ const bt = {
|
|
|
10125
10137
|
throw new Error("PERMISSION_DENIED");
|
|
10126
10138
|
for (const A of k.fields) {
|
|
10127
10139
|
const C = !A.access || A.access.includes(O), j = Ie(A, T), J = j?.custom?.serverAccess?.read !== void 0 ? await re(j.custom.serverAccess.read, [O, r]) : !0;
|
|
10128
|
-
(!C || !J) && (
|
|
10140
|
+
(!C || !J) && (Q(A) ? (delete r[A.name], delete r[`${A.name}_Array`], delete r[`${A.name}_Single`]) : delete r[A.name]);
|
|
10129
10141
|
}
|
|
10130
10142
|
}
|
|
10131
|
-
await oe("postOperation", f, T, ["read", r, e, _]), await oe("postRead", f, T, [_, R, r, !1]), t?.user && await
|
|
10143
|
+
await oe("postOperation", f, T, ["read", r, e, _]), await oe("postRead", f, T, [_, R, r, !1]), t?.user && await Ho(r, k, h, t.user, u);
|
|
10132
10144
|
};
|
|
10133
10145
|
return t?.providedTransaction ? await i(t.providedTransaction) : await s.runTransaction(async (o) => {
|
|
10134
10146
|
await i(o);
|
|
10135
10147
|
}, { readOnly: !0 }), r;
|
|
10136
|
-
},
|
|
10148
|
+
}, No = async (n, e, t, s, r, i, o) => {
|
|
10137
10149
|
const a = ce(), l = Ye(s.labels.collection, r), c = s.labels.collection, d = s.fields.filter((u) => "unique" in u && u.unique), h = [];
|
|
10138
10150
|
if (await Promise.all(d.map(async (u) => {
|
|
10139
10151
|
{
|
|
@@ -10196,8 +10208,8 @@ ${r}`);
|
|
|
10196
10208
|
})()
|
|
10197
10209
|
]), s.length > 0)
|
|
10198
10210
|
throw new Error(s.join(", "));
|
|
10199
|
-
},
|
|
10200
|
-
const c = ce(), d =
|
|
10211
|
+
}, xo = async (n, e, t, s, r, i, o, a, l) => {
|
|
10212
|
+
const c = ce(), d = vo(), h = process.env.ADMIN_EMAIL;
|
|
10201
10213
|
if (d === "development" || process.env.FIRESTORE_EMULATOR_HOST)
|
|
10202
10214
|
if (h)
|
|
10203
10215
|
n = h;
|
|
@@ -10216,7 +10228,7 @@ ${r}`);
|
|
|
10216
10228
|
_.length > 0 && _[0] && (R.bcc = k);
|
|
10217
10229
|
}
|
|
10218
10230
|
b && (R.replyTo = b), a && (R.message.attachments = a), T && (R.from = T), await c.collection("system_mail").add(R);
|
|
10219
|
-
},
|
|
10231
|
+
}, Io = async (n, e, t, s, r, i) => {
|
|
10220
10232
|
const o = pt(), a = ce(), l = "USER_ERROR", c = async (u, f) => {
|
|
10221
10233
|
try {
|
|
10222
10234
|
await ln(u);
|
|
@@ -10272,7 +10284,7 @@ ${r}`);
|
|
|
10272
10284
|
if (u) {
|
|
10273
10285
|
const f = `https://${o.app.options.projectId}.firebaseapp.com/__/auth/action${u}`, w = await re(e.appName), E = e?.mail?.emailVerification && e.mail.emailVerification(f, w);
|
|
10274
10286
|
try {
|
|
10275
|
-
await
|
|
10287
|
+
await xo(s.Email, E?.subject || "Please verify your email address", void 0, E?.html || `Please verify your email address by clicking the link:
|
|
10276
10288
|
</br>
|
|
10277
10289
|
</br>
|
|
10278
10290
|
<a href="${f}">${f}</a>`);
|
|
@@ -10302,7 +10314,7 @@ ${r}`);
|
|
|
10302
10314
|
});
|
|
10303
10315
|
};
|
|
10304
10316
|
e(n);
|
|
10305
|
-
},
|
|
10317
|
+
}, Do = (n) => {
|
|
10306
10318
|
const e = (t) => {
|
|
10307
10319
|
Object.entries(t).forEach(([s, r]) => {
|
|
10308
10320
|
Ln(r) && Object.keys(r).length === 2 && typeof r._seconds == "number" && typeof r._nanoseconds == "number" ? t[s] = new ot(r._seconds, r._nanoseconds) : Ln(r) && e(r);
|
|
@@ -10314,7 +10326,7 @@ ${r}`);
|
|
|
10314
10326
|
for (const e in n)
|
|
10315
10327
|
Object.prototype.hasOwnProperty.call(n, e) && (n[e] === "_DELETE_FIELD" ? n[e] = he.delete() : Ks(n[e]));
|
|
10316
10328
|
}, Mc = (n, e, t) => {
|
|
10317
|
-
if (
|
|
10329
|
+
if (Q(t) && t.includeFields) {
|
|
10318
10330
|
const s = {};
|
|
10319
10331
|
return t.includeFields.forEach((r) => {
|
|
10320
10332
|
if (e[r] !== void 0) {
|
|
@@ -10326,7 +10338,7 @@ ${r}`);
|
|
|
10326
10338
|
}
|
|
10327
10339
|
return {};
|
|
10328
10340
|
}, Jr = async (n, e, t, s, r, i) => {
|
|
10329
|
-
if (!
|
|
10341
|
+
if (!Q(e) || !e.enforceHierarchy)
|
|
10330
10342
|
return;
|
|
10331
10343
|
const { fields: o } = n, a = ce(), l = Object.entries(t[e.name]);
|
|
10332
10344
|
if (!l.length)
|
|
@@ -10350,14 +10362,14 @@ ${r}`);
|
|
|
10350
10362
|
}, Fc = (n, e, t, s, r, i) => {
|
|
10351
10363
|
const o = [], a = [];
|
|
10352
10364
|
for (const l of s.fields)
|
|
10353
|
-
|
|
10365
|
+
Q(l) && l.twoWay && l.collection === t && ((n === "Create" || !i?.[l.name]?.[e]) && r[l.name]?.[e] && o.push(l), n === "Update" && i?.[l.name]?.[e] && !r[l.name]?.[e] && a.push(l));
|
|
10354
10366
|
return { addedFields: o, removedFields: a };
|
|
10355
|
-
},
|
|
10367
|
+
}, Ao = async (n, e, t, s, r, i, o, a, l, c, d) => {
|
|
10356
10368
|
const { fields: h } = r, u = ce(), f = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
|
|
10357
10369
|
for (const p of h)
|
|
10358
|
-
|
|
10370
|
+
Q(p) && ["OneToOne", "OneToMany"].includes(p.type) && p.enforceHierarchy && t[p.name] && (n === "Create" || n === "Update" && !ze(d?.[p.name], t[p.name])) && await Jr(r, p, t, o, a);
|
|
10359
10371
|
for (const p of h)
|
|
10360
|
-
if (
|
|
10372
|
+
if (Q(p) && p.twoWay) {
|
|
10361
10373
|
const k = i.collections[p.collection], b = W(k.fields, p.twoWay), T = ut(k, [b]);
|
|
10362
10374
|
if (t[p.name]) {
|
|
10363
10375
|
const g = Object.entries(t[p.name]);
|
|
@@ -10499,12 +10511,12 @@ ${r}`);
|
|
|
10499
10511
|
}
|
|
10500
10512
|
for (const x of _) {
|
|
10501
10513
|
const F = W(b.fields, x.twoWay);
|
|
10502
|
-
["OneToOne", "OneToMany"].includes(F.type) &&
|
|
10514
|
+
["OneToOne", "OneToMany"].includes(F.type) && Q(F) && F.enforceHierarchy && await Jr(b, F, R, o, a, !0);
|
|
10503
10515
|
}
|
|
10504
10516
|
}
|
|
10505
10517
|
}
|
|
10506
10518
|
return f;
|
|
10507
|
-
},
|
|
10519
|
+
}, Co = (n, e, t) => {
|
|
10508
10520
|
n === "create" && ht.forEach((s) => {
|
|
10509
10521
|
if (!ze(e[s], t[s]))
|
|
10510
10522
|
throw new Error(`Updating system fields in hooks is not allowed: ${s}`);
|
|
@@ -10515,7 +10527,7 @@ ${r}`);
|
|
|
10515
10527
|
if (!["id", "Collection_Path", "Created_At", "Saved_At", "Created_By"].includes(s) && !ze(e[s], t[s]))
|
|
10516
10528
|
throw new Error(`Updating system fields in hooks is not allowed: ${s}`);
|
|
10517
10529
|
}));
|
|
10518
|
-
},
|
|
10530
|
+
}, $o = (n, e, t, s) => {
|
|
10519
10531
|
const { softDelete: r } = e;
|
|
10520
10532
|
if (!r)
|
|
10521
10533
|
return;
|
|
@@ -10552,7 +10564,7 @@ ${r}`);
|
|
|
10552
10564
|
}
|
|
10553
10565
|
};
|
|
10554
10566
|
await Promise.all(Array.from({ length: t }, r));
|
|
10555
|
-
},
|
|
10567
|
+
}, Mo = async (n, e, t, s, r, i, o) => {
|
|
10556
10568
|
for (const [a, l] of Object.entries(e?.collections || {})) {
|
|
10557
10569
|
if (!r.collections[a])
|
|
10558
10570
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -10616,19 +10628,19 @@ ${r}`);
|
|
|
10616
10628
|
let P;
|
|
10617
10629
|
s && await Qs(n, u);
|
|
10618
10630
|
const x = De(T, n), F = o || x.doc().id;
|
|
10619
|
-
i = i || {}, i.collection = f.collection, e.id = F,
|
|
10631
|
+
i = i || {}, i.collection = f.collection, e.id = F, Do(e), Ks(e);
|
|
10620
10632
|
const m = Ls("create", n, e, l, b, "Online", s || "System", ot.now(), he.serverTimestamp()), S = pe(m);
|
|
10621
10633
|
p && (m[p.archivedField] = !1), Ve(e), E && await Ct("create", "started", m, n, F, u), await oe("preOperation", a, k, ["create", m, F, i]), await oe("preWrite", a, k, ["create", m, F, i]), kn(u, m, l), bn(u, m), await ta(m, u, k, _), Ve(m);
|
|
10622
10634
|
try {
|
|
10623
10635
|
if (u.auth && t && !t.password)
|
|
10624
10636
|
throw new Error("Password is required");
|
|
10625
|
-
await
|
|
10637
|
+
await No("create", F, m, u, l), await tn("create", m, u, k, ["create", m, i], l);
|
|
10626
10638
|
} catch (C) {
|
|
10627
10639
|
throw new Error(`VALIDATION_ERROR: ${C.message}`);
|
|
10628
10640
|
}
|
|
10629
10641
|
Ve(m), e.id = F, p && (m[p.archivedField] = !1), kn(u, m, l), bn(u, m);
|
|
10630
10642
|
try {
|
|
10631
|
-
|
|
10643
|
+
Co("create", m, S), $o("create", u, m), await tn("create", m, u, k, ["create", m, i], l);
|
|
10632
10644
|
} catch (C) {
|
|
10633
10645
|
throw new Error(`VALIDATION_ERROR: ${C.message}`);
|
|
10634
10646
|
}
|
|
@@ -10691,13 +10703,13 @@ ${r}`);
|
|
|
10691
10703
|
throw new Error(`VALIDATION_ERROR: ${ie.name} "${m[ie.name]}" is invalid`);
|
|
10692
10704
|
}
|
|
10693
10705
|
});
|
|
10694
|
-
await Promise.all(me), nr(m, F, u, l, s, P, t?.permissions), t?.permissions && s && P && await
|
|
10706
|
+
await Promise.all(me), nr(m, F, u, l, s, P, t?.permissions), t?.permissions && s && P && await Mo(C, t.permissions, s, P, l), nr(m, F, u, l, s, P, t?.permissions);
|
|
10695
10707
|
};
|
|
10696
10708
|
if (u.auth && t) {
|
|
10697
10709
|
await T.runTransaction(async (j) => {
|
|
10698
10710
|
await D(j);
|
|
10699
10711
|
}, { maxAttempts: 10 });
|
|
10700
|
-
const C = await
|
|
10712
|
+
const C = await Io(
|
|
10701
10713
|
F,
|
|
10702
10714
|
a,
|
|
10703
10715
|
f.collection,
|
|
@@ -10711,7 +10723,7 @@ ${r}`);
|
|
|
10711
10723
|
try {
|
|
10712
10724
|
const C = { size: 1 };
|
|
10713
10725
|
await T.runTransaction(async (j) => {
|
|
10714
|
-
await D(j, C), r?.noTwoWay || await
|
|
10726
|
+
await D(j, C), r?.noTwoWay || await Ao("Create", F, m, m, u, l, j, C, s, P);
|
|
10715
10727
|
const J = Ps(l);
|
|
10716
10728
|
Gs("create", j, n, F, m, l, u, r, J, he.arrayUnion, he.arrayRemove, he.delete, (N) => T.collection("system_fields").doc(f.collection).collection(`${f.collection}-${N.name}`).doc(F), (N, z) => T.collection("system_unique").doc(f.collection).collection(`Unique-${f.collection}-${N.name}`).doc(z), (N) => T.collection("system_fields").doc(f.collection).collection(`${f.collection}-${N}`).doc(F), (N, z) => De(T, N).doc(z), (N, z, q) => T.collection("system_fields").doc(N.collection).collection(`${N.collection}-${z}`).doc(q), (N, z, q) => T.collection("system_fields").doc(N.collection).collection(`${N.collection}-${z.replaceAll(" ", "-")}`).doc(q), void 0, void 0, C), j.set(x.doc(F), m);
|
|
10717
10729
|
}, { maxAttempts: 10 });
|
|
@@ -10767,7 +10779,7 @@ ${r}`);
|
|
|
10767
10779
|
if (!a)
|
|
10768
10780
|
throw new Error("VALIDATION_ERROR: Permissions are required");
|
|
10769
10781
|
try {
|
|
10770
|
-
w = await
|
|
10782
|
+
w = await Io(e, t, s, r, a, c);
|
|
10771
10783
|
} catch (E) {
|
|
10772
10784
|
throw new Error(E.message);
|
|
10773
10785
|
}
|
|
@@ -10814,7 +10826,7 @@ ${r}`);
|
|
|
10814
10826
|
if (k) {
|
|
10815
10827
|
const b = `https://${d.app.options.projectId}.firebaseapp.com/__/auth/action${k}`, T = await re(t.appName), g = t?.mail?.emailVerification && t.mail.emailVerification(b, T);
|
|
10816
10828
|
try {
|
|
10817
|
-
await
|
|
10829
|
+
await xo(r.Email, g?.subject || "Please verify your email address", void 0, g?.html || `Please verify your email address by clicking the link:
|
|
10818
10830
|
</br>
|
|
10819
10831
|
</br>
|
|
10820
10832
|
<a href="${b}">${b}</a>`);
|
|
@@ -10889,10 +10901,10 @@ ${r}`);
|
|
|
10889
10901
|
if (s?.operation === "delete" && s.permissions)
|
|
10890
10902
|
throw new Error("VALIDATION_ERROR: Permissions are not allowed for delete operations");
|
|
10891
10903
|
const P = u.auth && s?.operation === "create", x = u.auth && s?.operation === "delete", F = u.auth && !P && !x && (s?.operation === "update" || t.Role || t.Enabled !== void 0 || t.Name || t.Email || t.Photo_URL), m = (N) => N.User_ID && (u.auth && !P && !x && s?.operation === "update" || t.Role && t.Role !== N.Role || t.Enabled !== void 0 && t.Enabled !== N.Enabled || t.Name && t.Name !== N.Name || t.Email && t.Email !== N.Email || t.Photo_URL && t.Photo_URL !== N.Photo_URL);
|
|
10892
|
-
delete t.id,
|
|
10904
|
+
delete t.id, Do(t), Ks(t);
|
|
10893
10905
|
const S = Ls("update", n, t, l, k, "Online", r || "System", ot.now(), he.serverTimestamp()), v = pe(S);
|
|
10894
10906
|
for (const N of w)
|
|
10895
|
-
!
|
|
10907
|
+
!Q(N) && Me(S[N.name]) && N.nullable && (S[N.name] = null);
|
|
10896
10908
|
Ve(S), Ve(_), E && await Ct("update", "started", S, n, e, u, void 0, _);
|
|
10897
10909
|
const y = [
|
|
10898
10910
|
"update",
|
|
@@ -10909,16 +10921,16 @@ ${r}`);
|
|
|
10909
10921
|
if (P && !s.password)
|
|
10910
10922
|
throw new Error("Password is required");
|
|
10911
10923
|
const N = { ..._, ...S };
|
|
10912
|
-
await
|
|
10924
|
+
await No("update", e, N, u, l), et(N), await tn("update", N, u, p, ["update", S, o, void 0, pe(_)], l);
|
|
10913
10925
|
} catch (N) {
|
|
10914
10926
|
throw new Error(`VALIDATION_ERROR: ${N.message}`);
|
|
10915
10927
|
}
|
|
10916
10928
|
Ve(S), delete t.id, kn(u, S, l), bn(u, S);
|
|
10917
10929
|
for (const N of w)
|
|
10918
|
-
!
|
|
10930
|
+
!Q(N) && Me(S[N.name]) && N.nullable && (S[N.name] = null);
|
|
10919
10931
|
try {
|
|
10920
10932
|
const N = { ..._, ...S };
|
|
10921
|
-
et(N),
|
|
10933
|
+
et(N), $o("update", u, S, _), Co("update", S, v), await tn("update", N, u, p, ["update", S, o, void 0, _], l);
|
|
10922
10934
|
} catch (N) {
|
|
10923
10935
|
throw new Error(`VALIDATION_ERROR: ${N.message}`);
|
|
10924
10936
|
}
|
|
@@ -10955,7 +10967,7 @@ ${r}`);
|
|
|
10955
10967
|
if (!g.Enabled)
|
|
10956
10968
|
throw new Error("PERMISSION_DENIED");
|
|
10957
10969
|
}
|
|
10958
|
-
if (q && (q.size +=
|
|
10970
|
+
if (q && (q.size += ko(n, e, l, g).length), P && _.User_ID || x && !_.User_ID)
|
|
10959
10971
|
throw new Error("USER_ERROR");
|
|
10960
10972
|
if (m(_)) {
|
|
10961
10973
|
const ue = await N.get(T.collection("system_user_permissions").doc(_.User_ID));
|
|
@@ -11003,7 +11015,7 @@ ${r}`);
|
|
|
11003
11015
|
throw new Error("PERMISSION_DENIED");
|
|
11004
11016
|
}
|
|
11005
11017
|
}
|
|
11006
|
-
sr(S, _, e, u, l, r, g, s?.operation ? s.operation : F ? "update" : void 0, s?.permissions, O), s?.permissions && r && g && await
|
|
11018
|
+
sr(S, _, e, u, l, r, g, s?.operation ? s.operation : F ? "update" : void 0, s?.permissions, O), s?.permissions && r && g && await Mo(N, s.permissions, r, g, l, O, q), sr(S, _, e, u, l, r, g, s?.operation ? s.operation : F ? "update" : void 0, s?.permissions, O), z && (P || m(_) || x) && await Uc(N, e, _.User_ID);
|
|
11007
11019
|
};
|
|
11008
11020
|
(P || F || x) && await T.runTransaction(async (N) => {
|
|
11009
11021
|
await V(N, !0);
|
|
@@ -11028,7 +11040,7 @@ ${r}`);
|
|
|
11028
11040
|
const se = { ..._, ...S };
|
|
11029
11041
|
await V(q, !1, z);
|
|
11030
11042
|
let ve;
|
|
11031
|
-
i?.noTwoWay || (ve = await
|
|
11043
|
+
i?.noTwoWay || (ve = await Ao("Update", e, se, S, u, l, q, z, r, g, _));
|
|
11032
11044
|
const Vt = Ps(l);
|
|
11033
11045
|
Gs("update", q, n, e, S, l, u, i, Vt, he.arrayUnion, he.arrayRemove, he.delete, (me) => T.collection("system_fields").doc(f.collection).collection(`${f.collection}-${me.name}`).doc(e), (me, ie) => T.collection("system_unique").doc(f.collection).collection(`Unique-${f.collection}-${me.name}`).doc(ie), (me) => T.collection("system_fields").doc(f.collection).collection(`${f.collection}-${me}`).doc(e), (me, ie) => De(T, me).doc(ie), (me, ie, Le) => T.collection("system_fields").doc(me.collection).collection(`${me.collection}-${ie}`).doc(Le), (me, ie, Le) => T.collection("system_fields").doc(me.collection).collection(`${me.collection}-${ie.replaceAll(" ", "-")}`).doc(Le), _, ve, z), q.update(R.doc(e), S);
|
|
11034
11046
|
}, { maxAttempts: 10 });
|
|
@@ -11100,7 +11112,7 @@ ${r}`);
|
|
|
11100
11112
|
throw new Error("USER_ERROR");
|
|
11101
11113
|
if (!b.Enabled)
|
|
11102
11114
|
throw new Error("PERMISSION_DENIED");
|
|
11103
|
-
|
|
11115
|
+
Bo(R, e, d, o, t, b);
|
|
11104
11116
|
}
|
|
11105
11117
|
if (t && b?.Role) {
|
|
11106
11118
|
const j = b.Role;
|
|
@@ -11127,7 +11139,7 @@ ${r}`);
|
|
|
11127
11139
|
const m = ["delete", R, e, r], S = [...m];
|
|
11128
11140
|
return await oe("postWrite", i, E, m), await oe("postOperation", i, E, S), { id: e, ...R };
|
|
11129
11141
|
}, du = async (n, e) => {
|
|
11130
|
-
const t = ce(), s =
|
|
11142
|
+
const t = ce(), s = vo(), r = process.env.ADMIN_SMS;
|
|
11131
11143
|
if (s === "development")
|
|
11132
11144
|
if (r)
|
|
11133
11145
|
n = r;
|
|
@@ -11146,10 +11158,10 @@ ${r}`);
|
|
|
11146
11158
|
};
|
|
11147
11159
|
e(n);
|
|
11148
11160
|
}, hu = async (n) => await pt().getUser(n), mu = (n) => {
|
|
11149
|
-
const e =
|
|
11161
|
+
const e = Oo();
|
|
11150
11162
|
return L.fromJSDate(n).setZone(e);
|
|
11151
11163
|
}, Zc = (n) => {
|
|
11152
|
-
const e =
|
|
11164
|
+
const e = Oo();
|
|
11153
11165
|
return L.fromJSDate(n.toDate()).setZone(e);
|
|
11154
11166
|
}, pu = (n, e) => {
|
|
11155
11167
|
const s = L.fromJSDate(n, { zone: e }).offset, i = L.fromJSDate(n).offset, o = s - i;
|
|
@@ -11160,13 +11172,13 @@ ${r}`);
|
|
|
11160
11172
|
}, gu = (n) => "seconds" in n && "nanoseconds" in n ? Zc(new ot(n.seconds, n.nanoseconds)).toFormat("MMMM d, yyyy '@' h:mm a") : "";
|
|
11161
11173
|
export {
|
|
11162
11174
|
cu as addRecord,
|
|
11163
|
-
|
|
11175
|
+
Io as addUser,
|
|
11164
11176
|
mu as convertDateToTimezone,
|
|
11165
11177
|
Zc as convertTimestampToTimezone,
|
|
11166
11178
|
uu as deleteRecord,
|
|
11167
11179
|
ln as deleteUser,
|
|
11168
11180
|
Ks as deserializeDeleteSentinels,
|
|
11169
|
-
|
|
11181
|
+
Do as deserializeTimestamps,
|
|
11170
11182
|
lu as deserializeTimestampsWithoutUnderscores,
|
|
11171
11183
|
gu as displayDate,
|
|
11172
11184
|
Ge as fetchCurrentSchema,
|
|
@@ -11174,11 +11186,11 @@ export {
|
|
|
11174
11186
|
nu as getCachedConfigValue,
|
|
11175
11187
|
$c as getCollectionRefs,
|
|
11176
11188
|
Cc as getCustomizationFiles,
|
|
11177
|
-
|
|
11189
|
+
ko as getDocumentRefs,
|
|
11178
11190
|
De as getFirestorePathRef,
|
|
11179
11191
|
su as getInputSchema,
|
|
11180
11192
|
it as getOne,
|
|
11181
|
-
|
|
11193
|
+
So as getSome,
|
|
11182
11194
|
hu as getUser,
|
|
11183
11195
|
Ia as getZodSchema,
|
|
11184
11196
|
tu as initializeFirebase,
|
|
@@ -11187,13 +11199,13 @@ export {
|
|
|
11187
11199
|
pu as keepTimezone,
|
|
11188
11200
|
yu as removeTimezone,
|
|
11189
11201
|
eu as runChildProcess,
|
|
11190
|
-
|
|
11202
|
+
xo as sendMail,
|
|
11191
11203
|
du as sendMessage,
|
|
11192
11204
|
fu as serializeTimestamps,
|
|
11193
11205
|
re as tryPromise,
|
|
11194
11206
|
Wc as updateRecord,
|
|
11195
11207
|
Vc as updateUser,
|
|
11196
|
-
|
|
11197
|
-
|
|
11208
|
+
Ao as validateRelations,
|
|
11209
|
+
$o as validateSoftDelete,
|
|
11198
11210
|
Ct as writeLog
|
|
11199
11211
|
};
|