@stoker-platform/node-client 0.3.0 → 0.3.2
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 +7 -7
- package/dist/bundle.js +266 -268
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -562,7 +562,7 @@ const su = async (n, e, t, s) => new Promise((r, i) => {
|
|
|
562
562
|
}, De = (n, e) => e.fields.filter((t) => t.name === n.name)[0], Kn = {
|
|
563
563
|
global: {},
|
|
564
564
|
collections: {}
|
|
565
|
-
},
|
|
565
|
+
}, qt = (n, e) => n && typeof n == "function" ? e ? n(...e) : n() : n, ie = async (n, e) => {
|
|
566
566
|
let t = n;
|
|
567
567
|
return n && (typeof n == "function" || typeof n.then == "function") && (e ? t = await n(...e) : t = await n()), t;
|
|
568
568
|
}, iu = async (n, e, t, s) => {
|
|
@@ -1204,7 +1204,7 @@ class ve {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
const Y = Object.freeze({
|
|
1206
1206
|
status: "aborted"
|
|
1207
|
-
}),
|
|
1207
|
+
}), Bt = (n) => ({ status: "dirty", value: n }), Ae = (n) => ({ status: "valid", value: n }), ar = (n) => n.status === "aborted", lr = (n) => n.status === "dirty", xt = (n) => n.status === "valid", Rn = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
1208
1208
|
var z;
|
|
1209
1209
|
(function(n) {
|
|
1210
1210
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
@@ -1218,7 +1218,7 @@ class je {
|
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
1220
|
const cr = (n, e) => {
|
|
1221
|
-
if (
|
|
1221
|
+
if (xt(e))
|
|
1222
1222
|
return { success: !0, data: e.value };
|
|
1223
1223
|
if (!n.common.issues.length)
|
|
1224
1224
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -1319,7 +1319,7 @@ class X {
|
|
|
1319
1319
|
if (!this["~standard"].async)
|
|
1320
1320
|
try {
|
|
1321
1321
|
const s = this._parseSync({ data: e, path: [], parent: t });
|
|
1322
|
-
return
|
|
1322
|
+
return xt(s) ? {
|
|
1323
1323
|
value: s.value
|
|
1324
1324
|
} : {
|
|
1325
1325
|
issues: t.common.issues
|
|
@@ -1330,7 +1330,7 @@ class X {
|
|
|
1330
1330
|
async: !0
|
|
1331
1331
|
};
|
|
1332
1332
|
}
|
|
1333
|
-
return this._parseAsync({ data: e, path: [], parent: t }).then((s) =>
|
|
1333
|
+
return this._parseAsync({ data: e, path: [], parent: t }).then((s) => xt(s) ? {
|
|
1334
1334
|
value: s.value
|
|
1335
1335
|
} : {
|
|
1336
1336
|
issues: t.common.issues
|
|
@@ -1371,7 +1371,7 @@ class X {
|
|
|
1371
1371
|
return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
|
|
1372
1372
|
}
|
|
1373
1373
|
_refinement(e) {
|
|
1374
|
-
return new
|
|
1374
|
+
return new At({
|
|
1375
1375
|
schema: this,
|
|
1376
1376
|
typeName: G.ZodEffects,
|
|
1377
1377
|
effect: { type: "refinement", refinement: e }
|
|
@@ -1391,7 +1391,7 @@ class X {
|
|
|
1391
1391
|
return nt.create(this, this._def);
|
|
1392
1392
|
}
|
|
1393
1393
|
nullable() {
|
|
1394
|
-
return
|
|
1394
|
+
return Ct.create(this, this._def);
|
|
1395
1395
|
}
|
|
1396
1396
|
nullish() {
|
|
1397
1397
|
return this.nullable().optional();
|
|
@@ -1409,7 +1409,7 @@ class X {
|
|
|
1409
1409
|
return Dn.create(this, e, this._def);
|
|
1410
1410
|
}
|
|
1411
1411
|
transform(e) {
|
|
1412
|
-
return new
|
|
1412
|
+
return new At({
|
|
1413
1413
|
...J(this._def),
|
|
1414
1414
|
schema: this,
|
|
1415
1415
|
typeName: G.ZodEffects,
|
|
@@ -1884,7 +1884,7 @@ function xa(n, e) {
|
|
|
1884
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(".", ""));
|
|
1885
1885
|
return i % o / 10 ** r;
|
|
1886
1886
|
}
|
|
1887
|
-
class
|
|
1887
|
+
class Dt extends X {
|
|
1888
1888
|
constructor() {
|
|
1889
1889
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1890
1890
|
}
|
|
@@ -1942,7 +1942,7 @@ class xt extends X {
|
|
|
1942
1942
|
return this.setLimit("max", e, !1, z.toString(t));
|
|
1943
1943
|
}
|
|
1944
1944
|
setLimit(e, t, s, r) {
|
|
1945
|
-
return new
|
|
1945
|
+
return new Dt({
|
|
1946
1946
|
...this._def,
|
|
1947
1947
|
checks: [
|
|
1948
1948
|
...this._def.checks,
|
|
@@ -1956,7 +1956,7 @@ class xt extends X {
|
|
|
1956
1956
|
});
|
|
1957
1957
|
}
|
|
1958
1958
|
_addCheck(e) {
|
|
1959
|
-
return new
|
|
1959
|
+
return new Dt({
|
|
1960
1960
|
...this._def,
|
|
1961
1961
|
checks: [...this._def.checks, e]
|
|
1962
1962
|
});
|
|
@@ -2050,13 +2050,13 @@ class xt extends X {
|
|
|
2050
2050
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
|
-
|
|
2053
|
+
Dt.create = (n) => new Dt({
|
|
2054
2054
|
checks: [],
|
|
2055
2055
|
typeName: G.ZodNumber,
|
|
2056
2056
|
coerce: n?.coerce || !1,
|
|
2057
2057
|
...J(n)
|
|
2058
2058
|
});
|
|
2059
|
-
class
|
|
2059
|
+
class en extends X {
|
|
2060
2060
|
constructor() {
|
|
2061
2061
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
2062
2062
|
}
|
|
@@ -2112,7 +2112,7 @@ class Xt extends X {
|
|
|
2112
2112
|
return this.setLimit("max", e, !1, z.toString(t));
|
|
2113
2113
|
}
|
|
2114
2114
|
setLimit(e, t, s, r) {
|
|
2115
|
-
return new
|
|
2115
|
+
return new en({
|
|
2116
2116
|
...this._def,
|
|
2117
2117
|
checks: [
|
|
2118
2118
|
...this._def.checks,
|
|
@@ -2126,7 +2126,7 @@ class Xt extends X {
|
|
|
2126
2126
|
});
|
|
2127
2127
|
}
|
|
2128
2128
|
_addCheck(e) {
|
|
2129
|
-
return new
|
|
2129
|
+
return new en({
|
|
2130
2130
|
...this._def,
|
|
2131
2131
|
checks: [...this._def.checks, e]
|
|
2132
2132
|
});
|
|
@@ -2183,7 +2183,7 @@ class Xt extends X {
|
|
|
2183
2183
|
return e;
|
|
2184
2184
|
}
|
|
2185
2185
|
}
|
|
2186
|
-
|
|
2186
|
+
en.create = (n) => new en({
|
|
2187
2187
|
checks: [],
|
|
2188
2188
|
typeName: G.ZodBigInt,
|
|
2189
2189
|
coerce: n?.coerce ?? !1,
|
|
@@ -2464,12 +2464,12 @@ Ue.create = (n, e) => new Ue({
|
|
|
2464
2464
|
typeName: G.ZodArray,
|
|
2465
2465
|
...J(e)
|
|
2466
2466
|
});
|
|
2467
|
-
function
|
|
2467
|
+
function bt(n) {
|
|
2468
2468
|
if (n instanceof fe) {
|
|
2469
2469
|
const e = {};
|
|
2470
2470
|
for (const t in n.shape) {
|
|
2471
2471
|
const s = n.shape[t];
|
|
2472
|
-
e[t] = nt.create(
|
|
2472
|
+
e[t] = nt.create(bt(s));
|
|
2473
2473
|
}
|
|
2474
2474
|
return new fe({
|
|
2475
2475
|
...n._def,
|
|
@@ -2477,8 +2477,8 @@ function kt(n) {
|
|
|
2477
2477
|
});
|
|
2478
2478
|
} else return n instanceof Ue ? new Ue({
|
|
2479
2479
|
...n._def,
|
|
2480
|
-
type:
|
|
2481
|
-
}) : n instanceof nt ? nt.create(
|
|
2480
|
+
type: bt(n.element)
|
|
2481
|
+
}) : n instanceof nt ? nt.create(bt(n.unwrap())) : n instanceof Ct ? Ct.create(bt(n.unwrap())) : n instanceof pt ? pt.create(n.items.map((e) => bt(e))) : n;
|
|
2482
2482
|
}
|
|
2483
2483
|
class fe extends X {
|
|
2484
2484
|
constructor() {
|
|
@@ -2713,7 +2713,7 @@ class fe extends X {
|
|
|
2713
2713
|
* @deprecated
|
|
2714
2714
|
*/
|
|
2715
2715
|
deepPartial() {
|
|
2716
|
-
return
|
|
2716
|
+
return bt(this);
|
|
2717
2717
|
}
|
|
2718
2718
|
partial(e) {
|
|
2719
2719
|
const t = {};
|
|
@@ -3043,7 +3043,7 @@ mr.create = (n, e, t) => new mr({
|
|
|
3043
3043
|
typeName: G.ZodMap,
|
|
3044
3044
|
...J(t)
|
|
3045
3045
|
});
|
|
3046
|
-
class
|
|
3046
|
+
class tn extends X {
|
|
3047
3047
|
_parse(e) {
|
|
3048
3048
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
3049
3049
|
if (s.parsedType !== U.set)
|
|
@@ -3082,13 +3082,13 @@ class en extends X {
|
|
|
3082
3082
|
return s.common.async ? Promise.all(a).then((l) => o(l)) : o(a);
|
|
3083
3083
|
}
|
|
3084
3084
|
min(e, t) {
|
|
3085
|
-
return new
|
|
3085
|
+
return new tn({
|
|
3086
3086
|
...this._def,
|
|
3087
3087
|
minSize: { value: e, message: z.toString(t) }
|
|
3088
3088
|
});
|
|
3089
3089
|
}
|
|
3090
3090
|
max(e, t) {
|
|
3091
|
-
return new
|
|
3091
|
+
return new tn({
|
|
3092
3092
|
...this._def,
|
|
3093
3093
|
maxSize: { value: e, message: z.toString(t) }
|
|
3094
3094
|
});
|
|
@@ -3100,7 +3100,7 @@ class en extends X {
|
|
|
3100
3100
|
return this.min(1, e);
|
|
3101
3101
|
}
|
|
3102
3102
|
}
|
|
3103
|
-
|
|
3103
|
+
tn.create = (n, e) => new tn({
|
|
3104
3104
|
valueType: n,
|
|
3105
3105
|
minSize: null,
|
|
3106
3106
|
maxSize: null,
|
|
@@ -3143,13 +3143,13 @@ Os.create = (n, e) => new Os({
|
|
|
3143
3143
|
...J(e)
|
|
3144
3144
|
});
|
|
3145
3145
|
function pi(n, e) {
|
|
3146
|
-
return new
|
|
3146
|
+
return new It({
|
|
3147
3147
|
values: n,
|
|
3148
3148
|
typeName: G.ZodEnum,
|
|
3149
3149
|
...J(e)
|
|
3150
3150
|
});
|
|
3151
3151
|
}
|
|
3152
|
-
class
|
|
3152
|
+
class It extends X {
|
|
3153
3153
|
_parse(e) {
|
|
3154
3154
|
if (typeof e.data != "string") {
|
|
3155
3155
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
@@ -3191,19 +3191,19 @@ class Dt extends X {
|
|
|
3191
3191
|
return e;
|
|
3192
3192
|
}
|
|
3193
3193
|
extract(e, t = this._def) {
|
|
3194
|
-
return
|
|
3194
|
+
return It.create(e, {
|
|
3195
3195
|
...this._def,
|
|
3196
3196
|
...t
|
|
3197
3197
|
});
|
|
3198
3198
|
}
|
|
3199
3199
|
exclude(e, t = this._def) {
|
|
3200
|
-
return
|
|
3200
|
+
return It.create(this.options.filter((s) => !e.includes(s)), {
|
|
3201
3201
|
...this._def,
|
|
3202
3202
|
...t
|
|
3203
3203
|
});
|
|
3204
3204
|
}
|
|
3205
3205
|
}
|
|
3206
|
-
|
|
3206
|
+
It.create = pi;
|
|
3207
3207
|
class yr extends X {
|
|
3208
3208
|
_parse(e) {
|
|
3209
3209
|
const t = te.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -3258,7 +3258,7 @@ An.create = (n, e) => new An({
|
|
|
3258
3258
|
typeName: G.ZodPromise,
|
|
3259
3259
|
...J(e)
|
|
3260
3260
|
});
|
|
3261
|
-
class
|
|
3261
|
+
class At extends X {
|
|
3262
3262
|
innerType() {
|
|
3263
3263
|
return this._def.schema;
|
|
3264
3264
|
}
|
|
@@ -3285,7 +3285,7 @@ class It extends X {
|
|
|
3285
3285
|
path: s.path,
|
|
3286
3286
|
parent: s
|
|
3287
3287
|
});
|
|
3288
|
-
return l.status === "aborted" ? Y : l.status === "dirty" || t.value === "dirty" ?
|
|
3288
|
+
return l.status === "aborted" ? Y : l.status === "dirty" || t.value === "dirty" ? Bt(l.value) : l;
|
|
3289
3289
|
});
|
|
3290
3290
|
{
|
|
3291
3291
|
if (t.value === "aborted")
|
|
@@ -3295,7 +3295,7 @@ class It extends X {
|
|
|
3295
3295
|
path: s.path,
|
|
3296
3296
|
parent: s
|
|
3297
3297
|
});
|
|
3298
|
-
return a.status === "aborted" ? Y : a.status === "dirty" || t.value === "dirty" ?
|
|
3298
|
+
return a.status === "aborted" ? Y : a.status === "dirty" || t.value === "dirty" ? Bt(a.value) : a;
|
|
3299
3299
|
}
|
|
3300
3300
|
}
|
|
3301
3301
|
if (r.type === "refinement") {
|
|
@@ -3324,27 +3324,27 @@ class It extends X {
|
|
|
3324
3324
|
path: s.path,
|
|
3325
3325
|
parent: s
|
|
3326
3326
|
});
|
|
3327
|
-
if (!
|
|
3327
|
+
if (!xt(o))
|
|
3328
3328
|
return Y;
|
|
3329
3329
|
const a = r.transform(o.value, i);
|
|
3330
3330
|
if (a instanceof Promise)
|
|
3331
3331
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3332
3332
|
return { status: t.value, value: a };
|
|
3333
3333
|
} else
|
|
3334
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) =>
|
|
3334
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => xt(o) ? Promise.resolve(r.transform(o.value, i)).then((a) => ({
|
|
3335
3335
|
status: t.value,
|
|
3336
3336
|
value: a
|
|
3337
3337
|
})) : Y);
|
|
3338
3338
|
te.assertNever(r);
|
|
3339
3339
|
}
|
|
3340
3340
|
}
|
|
3341
|
-
|
|
3341
|
+
At.create = (n, e, t) => new At({
|
|
3342
3342
|
schema: n,
|
|
3343
3343
|
typeName: G.ZodEffects,
|
|
3344
3344
|
effect: e,
|
|
3345
3345
|
...J(t)
|
|
3346
3346
|
});
|
|
3347
|
-
|
|
3347
|
+
At.createWithPreprocess = (n, e, t) => new At({
|
|
3348
3348
|
schema: e,
|
|
3349
3349
|
effect: { type: "preprocess", transform: n },
|
|
3350
3350
|
typeName: G.ZodEffects,
|
|
@@ -3363,7 +3363,7 @@ nt.create = (n, e) => new nt({
|
|
|
3363
3363
|
typeName: G.ZodOptional,
|
|
3364
3364
|
...J(e)
|
|
3365
3365
|
});
|
|
3366
|
-
class
|
|
3366
|
+
class Ct extends X {
|
|
3367
3367
|
_parse(e) {
|
|
3368
3368
|
return this._getType(e) === U.null ? Ae(null) : this._def.innerType._parse(e);
|
|
3369
3369
|
}
|
|
@@ -3371,7 +3371,7 @@ class At extends X {
|
|
|
3371
3371
|
return this._def.innerType;
|
|
3372
3372
|
}
|
|
3373
3373
|
}
|
|
3374
|
-
|
|
3374
|
+
Ct.create = (n, e) => new Ct({
|
|
3375
3375
|
innerType: n,
|
|
3376
3376
|
typeName: G.ZodNullable,
|
|
3377
3377
|
...J(e)
|
|
@@ -3479,7 +3479,7 @@ class Ws extends X {
|
|
|
3479
3479
|
path: s.path,
|
|
3480
3480
|
parent: s
|
|
3481
3481
|
});
|
|
3482
|
-
return i.status === "aborted" ? Y : i.status === "dirty" ? (t.dirty(),
|
|
3482
|
+
return i.status === "aborted" ? Y : i.status === "dirty" ? (t.dirty(), Bt(i.value)) : this._def.out._parseAsync({
|
|
3483
3483
|
data: i.value,
|
|
3484
3484
|
path: s.path,
|
|
3485
3485
|
parent: s
|
|
@@ -3511,7 +3511,7 @@ class Ws extends X {
|
|
|
3511
3511
|
}
|
|
3512
3512
|
class Ss extends X {
|
|
3513
3513
|
_parse(e) {
|
|
3514
|
-
const t = this._def.innerType._parse(e), s = (r) => (
|
|
3514
|
+
const t = this._def.innerType._parse(e), s = (r) => (xt(r) && (r.value = Object.freeze(r.value)), r);
|
|
3515
3515
|
return Rn(t) ? t.then((r) => s(r)) : s(t);
|
|
3516
3516
|
}
|
|
3517
3517
|
unwrap() {
|
|
@@ -3527,15 +3527,15 @@ var G;
|
|
|
3527
3527
|
(function(n) {
|
|
3528
3528
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
3529
3529
|
})(G || (G = {}));
|
|
3530
|
-
const be = qe.create, ft =
|
|
3530
|
+
const be = qe.create, ft = Dt.create, Kt = ws.create, ns = _s.create, ge = Es.create;
|
|
3531
3531
|
it.create;
|
|
3532
3532
|
const wt = Ue.create, We = fe.create, Oe = xn.create;
|
|
3533
3533
|
Dn.create;
|
|
3534
3534
|
pt.create;
|
|
3535
|
-
const
|
|
3535
|
+
const rn = In.create, ke = Os.create, Cn = It.create;
|
|
3536
3536
|
An.create;
|
|
3537
3537
|
nt.create;
|
|
3538
|
-
|
|
3538
|
+
Ct.create;
|
|
3539
3539
|
const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
|
|
3540
3540
|
message: "Value is not a valid timestamp"
|
|
3541
3541
|
}), wr = () => ge().refine((n) => n && (n._methodName === "serverTimestamp" || n.constructor.name === "ServerTimestampTransform"), {
|
|
@@ -3545,7 +3545,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3545
3545
|
if (n.includeFields) {
|
|
3546
3546
|
const s = e.collections[n.collection];
|
|
3547
3547
|
if (!s)
|
|
3548
|
-
return
|
|
3548
|
+
return rn(ge());
|
|
3549
3549
|
n.includeFields.forEach((r) => {
|
|
3550
3550
|
const i = s.fields.find((a) => a.name === r);
|
|
3551
3551
|
if (!i)
|
|
@@ -3558,7 +3558,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3558
3558
|
...t
|
|
3559
3559
|
});
|
|
3560
3560
|
}, Ia = (n, e) => {
|
|
3561
|
-
let t =
|
|
3561
|
+
let t = rn(yi(n, e));
|
|
3562
3562
|
return n.required || (t = t.optional()), t;
|
|
3563
3563
|
}, Aa = (n) => {
|
|
3564
3564
|
let e = wt(Oe([be().length(20), be().length(28)]));
|
|
@@ -3576,7 +3576,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3576
3576
|
i = Cn(e.values);
|
|
3577
3577
|
break;
|
|
3578
3578
|
case "Boolean":
|
|
3579
|
-
i =
|
|
3579
|
+
i = Kt();
|
|
3580
3580
|
break;
|
|
3581
3581
|
case "Number":
|
|
3582
3582
|
e.autoIncrement ? i = Oe([ke("Pending"), ft().int()]) : (i = ft(), e.min && (i = i.min(e.min)), e.max && (i = i.max(e.max)), e.decimal ? i = i.refine((o) => e.decimal ? (o.toString().split(".")[1]?.length || 0) <= e.decimal : !1, {
|
|
@@ -3603,7 +3603,7 @@ const wn = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds
|
|
|
3603
3603
|
}, { message: "Value is not an allowed value" }));
|
|
3604
3604
|
break;
|
|
3605
3605
|
case "Map":
|
|
3606
|
-
i =
|
|
3606
|
+
i = rn(ge()), e.required && (i = i.refine((o) => o && typeof o == "object" && Object.keys(o).length > 0, {
|
|
3607
3607
|
message: "Value must have at least one object property"
|
|
3608
3608
|
}));
|
|
3609
3609
|
break;
|
|
@@ -3658,7 +3658,7 @@ class Fa extends _t {
|
|
|
3658
3658
|
super(`Invalid Duration: ${e.toMessage()}`);
|
|
3659
3659
|
}
|
|
3660
3660
|
}
|
|
3661
|
-
class
|
|
3661
|
+
class St extends _t {
|
|
3662
3662
|
}
|
|
3663
3663
|
class gi extends _t {
|
|
3664
3664
|
constructor(e) {
|
|
@@ -3798,7 +3798,7 @@ const $ = "numeric", Pe = "short", Se = "long", Mn = {
|
|
|
3798
3798
|
second: $,
|
|
3799
3799
|
timeZoneName: Se
|
|
3800
3800
|
};
|
|
3801
|
-
class
|
|
3801
|
+
class on {
|
|
3802
3802
|
/**
|
|
3803
3803
|
* The type of zone
|
|
3804
3804
|
* @abstract
|
|
@@ -3883,7 +3883,7 @@ class rn {
|
|
|
3883
3883
|
}
|
|
3884
3884
|
}
|
|
3885
3885
|
let ss = null;
|
|
3886
|
-
class zn extends
|
|
3886
|
+
class zn extends on {
|
|
3887
3887
|
/**
|
|
3888
3888
|
* Get a singleton instance of the local zone
|
|
3889
3889
|
* @return {SystemZone}
|
|
@@ -3909,7 +3909,7 @@ class zn extends rn {
|
|
|
3909
3909
|
}
|
|
3910
3910
|
/** @override **/
|
|
3911
3911
|
formatOffset(e, t) {
|
|
3912
|
-
return
|
|
3912
|
+
return Xt(this.offset(e), t);
|
|
3913
3913
|
}
|
|
3914
3914
|
/** @override **/
|
|
3915
3915
|
offset(e) {
|
|
@@ -3961,7 +3961,7 @@ function ja(n, e) {
|
|
|
3961
3961
|
return s;
|
|
3962
3962
|
}
|
|
3963
3963
|
const rs = /* @__PURE__ */ new Map();
|
|
3964
|
-
class He extends
|
|
3964
|
+
class He extends on {
|
|
3965
3965
|
/**
|
|
3966
3966
|
* @param {string} name - Zone name
|
|
3967
3967
|
* @return {IANAZone}
|
|
@@ -4054,7 +4054,7 @@ class He extends rn {
|
|
|
4054
4054
|
* @return {string}
|
|
4055
4055
|
*/
|
|
4056
4056
|
formatOffset(e, t) {
|
|
4057
|
-
return
|
|
4057
|
+
return Xt(this.offset(e), t);
|
|
4058
4058
|
}
|
|
4059
4059
|
/**
|
|
4060
4060
|
* Return the offset in minutes for this zone at the specified timestamp.
|
|
@@ -4124,9 +4124,9 @@ function qa(n, e = {}) {
|
|
|
4124
4124
|
let i = Ds.get(r);
|
|
4125
4125
|
return i === void 0 && (i = new Intl.RelativeTimeFormat(n, e), Ds.set(r, i)), i;
|
|
4126
4126
|
}
|
|
4127
|
-
let
|
|
4127
|
+
let Ht = null;
|
|
4128
4128
|
function Ba() {
|
|
4129
|
-
return
|
|
4129
|
+
return Ht || (Ht = new Intl.DateTimeFormat().resolvedOptions().locale, Ht);
|
|
4130
4130
|
}
|
|
4131
4131
|
const Is = /* @__PURE__ */ new Map();
|
|
4132
4132
|
function Pi(n) {
|
|
@@ -4272,7 +4272,7 @@ class se {
|
|
|
4272
4272
|
return new se(a, l, c, u, o);
|
|
4273
4273
|
}
|
|
4274
4274
|
static resetCache() {
|
|
4275
|
-
|
|
4275
|
+
Ht = null, Rs.clear(), xs.clear(), Ds.clear(), Is.clear(), As.clear();
|
|
4276
4276
|
}
|
|
4277
4277
|
static fromObject({ locale: e, numberingSystem: t, outputCalendar: s, weekSettings: r } = {}) {
|
|
4278
4278
|
return se.create(e, t, s, r);
|
|
@@ -4386,7 +4386,7 @@ class se {
|
|
|
4386
4386
|
}
|
|
4387
4387
|
}
|
|
4388
4388
|
let is = null;
|
|
4389
|
-
class Ee extends
|
|
4389
|
+
class Ee extends on {
|
|
4390
4390
|
/**
|
|
4391
4391
|
* Get a singleton instance of UTC
|
|
4392
4392
|
* @return {FixedOffsetZone}
|
|
@@ -4436,7 +4436,7 @@ class Ee extends rn {
|
|
|
4436
4436
|
* @type {string}
|
|
4437
4437
|
*/
|
|
4438
4438
|
get name() {
|
|
4439
|
-
return this.fixed === 0 ? "UTC" : `UTC${
|
|
4439
|
+
return this.fixed === 0 ? "UTC" : `UTC${Xt(this.fixed, "narrow")}`;
|
|
4440
4440
|
}
|
|
4441
4441
|
/**
|
|
4442
4442
|
* The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`
|
|
@@ -4445,7 +4445,7 @@ class Ee extends rn {
|
|
|
4445
4445
|
* @type {string}
|
|
4446
4446
|
*/
|
|
4447
4447
|
get ianaName() {
|
|
4448
|
-
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${
|
|
4448
|
+
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${Xt(-this.fixed, "narrow")}`;
|
|
4449
4449
|
}
|
|
4450
4450
|
/**
|
|
4451
4451
|
* Returns the offset's common name at the specified timestamp.
|
|
@@ -4465,7 +4465,7 @@ class Ee extends rn {
|
|
|
4465
4465
|
* @return {string}
|
|
4466
4466
|
*/
|
|
4467
4467
|
formatOffset(e, t) {
|
|
4468
|
-
return
|
|
4468
|
+
return Xt(this.fixed, t);
|
|
4469
4469
|
}
|
|
4470
4470
|
/**
|
|
4471
4471
|
* Returns whether the offset is known to be fixed for the whole year:
|
|
@@ -4505,7 +4505,7 @@ class Ee extends rn {
|
|
|
4505
4505
|
return !0;
|
|
4506
4506
|
}
|
|
4507
4507
|
}
|
|
4508
|
-
class nl extends
|
|
4508
|
+
class nl extends on {
|
|
4509
4509
|
constructor(e) {
|
|
4510
4510
|
super(), this.zoneName = e;
|
|
4511
4511
|
}
|
|
@@ -4545,7 +4545,7 @@ class nl extends rn {
|
|
|
4545
4545
|
function et(n, e) {
|
|
4546
4546
|
if (H(n) || n === null)
|
|
4547
4547
|
return e;
|
|
4548
|
-
if (n instanceof
|
|
4548
|
+
if (n instanceof on)
|
|
4549
4549
|
return n;
|
|
4550
4550
|
if (ll(n)) {
|
|
4551
4551
|
const t = n.toLowerCase();
|
|
@@ -4786,10 +4786,10 @@ function Zs(n, e, t) {
|
|
|
4786
4786
|
return r === 0 ? 7 : r;
|
|
4787
4787
|
}
|
|
4788
4788
|
function Wi(n, e, t) {
|
|
4789
|
-
return t + (
|
|
4789
|
+
return t + (an(n) ? Ui : Vi)[e - 1];
|
|
4790
4790
|
}
|
|
4791
4791
|
function ji(n, e) {
|
|
4792
|
-
const t =
|
|
4792
|
+
const t = an(n) ? Ui : Vi, s = t.findIndex((i) => i < e), r = e - t[s];
|
|
4793
4793
|
return { month: s + 1, day: r };
|
|
4794
4794
|
}
|
|
4795
4795
|
function zs(n, e) {
|
|
@@ -4798,12 +4798,12 @@ function zs(n, e) {
|
|
|
4798
4798
|
function Fn(n, e = 4, t = 1) {
|
|
4799
4799
|
const { year: s, month: r, day: i } = n, o = Wi(s, r, i), a = zs(Zs(s, r, i), t);
|
|
4800
4800
|
let l = Math.floor((o - a + 14 - e) / 7), c;
|
|
4801
|
-
return l < 1 ? (c = s - 1, l =
|
|
4801
|
+
return l < 1 ? (c = s - 1, l = nn(c, e, t)) : l > nn(s, e, t) ? (c = s + 1, l = 1) : c = s, { weekYear: c, weekNumber: l, weekday: a, ...Gn(n) };
|
|
4802
4802
|
}
|
|
4803
4803
|
function xr(n, e = 4, t = 1) {
|
|
4804
|
-
const { weekYear: s, weekNumber: r, weekday: i } = n, o = zs(Zs(s, 1, e), t), a =
|
|
4804
|
+
const { weekYear: s, weekNumber: r, weekday: i } = n, o = zs(Zs(s, 1, e), t), a = Rt(s);
|
|
4805
4805
|
let l = r * 7 + i - o - 7 + e, c;
|
|
4806
|
-
l < 1 ? (c = s - 1, l +=
|
|
4806
|
+
l < 1 ? (c = s - 1, l += Rt(c)) : l > a ? (c = s + 1, l -= Rt(s)) : c = s;
|
|
4807
4807
|
const { month: u, day: h } = ji(c, l);
|
|
4808
4808
|
return { year: c, month: u, day: h, ...Gn(n) };
|
|
4809
4809
|
}
|
|
@@ -4818,7 +4818,7 @@ function Dr(n) {
|
|
|
4818
4818
|
function Ir(n, e) {
|
|
4819
4819
|
if (!H(n.localWeekday) || !H(n.localWeekNumber) || !H(n.localWeekYear)) {
|
|
4820
4820
|
if (!H(n.weekday) || !H(n.weekNumber) || !H(n.weekYear))
|
|
4821
|
-
throw new
|
|
4821
|
+
throw new St(
|
|
4822
4822
|
"Cannot mix locale-based week fields with ISO-based week fields"
|
|
4823
4823
|
);
|
|
4824
4824
|
return H(n.localWeekday) || (n.weekday = n.localWeekday), H(n.localWeekNumber) || (n.weekNumber = n.localWeekNumber), H(n.localWeekYear) || (n.weekYear = n.localWeekYear), delete n.localWeekday, delete n.localWeekNumber, delete n.localWeekYear, {
|
|
@@ -4832,12 +4832,12 @@ function ol(n, e = 4, t = 1) {
|
|
|
4832
4832
|
const s = qn(n.weekYear), r = xe(
|
|
4833
4833
|
n.weekNumber,
|
|
4834
4834
|
1,
|
|
4835
|
-
|
|
4835
|
+
nn(n.weekYear, e, t)
|
|
4836
4836
|
), i = xe(n.weekday, 1, 7);
|
|
4837
4837
|
return s ? r ? i ? !1 : Ne("weekday", n.weekday) : Ne("week", n.weekNumber) : Ne("weekYear", n.weekYear);
|
|
4838
4838
|
}
|
|
4839
4839
|
function al(n) {
|
|
4840
|
-
const e = qn(n.year), t = xe(n.ordinal, 1,
|
|
4840
|
+
const e = qn(n.year), t = xe(n.ordinal, 1, Rt(n.year));
|
|
4841
4841
|
return e ? t ? !1 : Ne("ordinal", n.ordinal) : Ne("year", n.year);
|
|
4842
4842
|
}
|
|
4843
4843
|
function Zi(n) {
|
|
@@ -4890,7 +4890,7 @@ function Ar(n, e, t) {
|
|
|
4890
4890
|
function dl(n, e) {
|
|
4891
4891
|
return e.reduce((t, s) => (t[s] = n[s], t), {});
|
|
4892
4892
|
}
|
|
4893
|
-
function
|
|
4893
|
+
function $t(n, e) {
|
|
4894
4894
|
return Object.prototype.hasOwnProperty.call(n, e);
|
|
4895
4895
|
}
|
|
4896
4896
|
function $s(n) {
|
|
@@ -4948,15 +4948,15 @@ function Bs(n, e, t = "round") {
|
|
|
4948
4948
|
throw new RangeError(`Value rounding ${t} is out of range`);
|
|
4949
4949
|
}
|
|
4950
4950
|
}
|
|
4951
|
-
function
|
|
4951
|
+
function an(n) {
|
|
4952
4952
|
return n % 4 === 0 && (n % 100 !== 0 || n % 400 === 0);
|
|
4953
4953
|
}
|
|
4954
|
-
function
|
|
4955
|
-
return
|
|
4954
|
+
function Rt(n) {
|
|
4955
|
+
return an(n) ? 366 : 365;
|
|
4956
4956
|
}
|
|
4957
4957
|
function Pn(n, e) {
|
|
4958
4958
|
const t = fl(e - 1, 12) + 1, s = n + (e - t) / 12;
|
|
4959
|
-
return t === 2 ?
|
|
4959
|
+
return t === 2 ? an(s) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t - 1];
|
|
4960
4960
|
}
|
|
4961
4961
|
function Bn(n) {
|
|
4962
4962
|
let e = Date.UTC(
|
|
@@ -4973,9 +4973,9 @@ function Bn(n) {
|
|
|
4973
4973
|
function Cr(n, e, t) {
|
|
4974
4974
|
return -zs(Zs(n, 1, e), t) + e - 1;
|
|
4975
4975
|
}
|
|
4976
|
-
function
|
|
4976
|
+
function nn(n, e = 4, t = 1) {
|
|
4977
4977
|
const s = Cr(n, e, t), r = Cr(n + 1, e, t);
|
|
4978
|
-
return (
|
|
4978
|
+
return (Rt(n) - s + r) / 7;
|
|
4979
4979
|
}
|
|
4980
4980
|
function Ms(n) {
|
|
4981
4981
|
return n > 99 ? n : n > ce.twoDigitCutoffYear ? 1900 + n : 2e3 + n;
|
|
@@ -5008,14 +5008,14 @@ function Gi(n) {
|
|
|
5008
5008
|
function Ln(n, e) {
|
|
5009
5009
|
const t = {};
|
|
5010
5010
|
for (const s in n)
|
|
5011
|
-
if (
|
|
5011
|
+
if ($t(n, s)) {
|
|
5012
5012
|
const r = n[s];
|
|
5013
5013
|
if (r == null) continue;
|
|
5014
5014
|
t[e(s)] = Gi(r);
|
|
5015
5015
|
}
|
|
5016
5016
|
return t;
|
|
5017
5017
|
}
|
|
5018
|
-
function
|
|
5018
|
+
function Xt(n, e) {
|
|
5019
5019
|
const t = Math.trunc(Math.abs(n / 60)), s = Math.trunc(Math.abs(n % 60)), r = n >= 0 ? "+" : "-";
|
|
5020
5020
|
switch (e) {
|
|
5021
5021
|
case "short":
|
|
@@ -5416,11 +5416,11 @@ class _e {
|
|
|
5416
5416
|
}
|
|
5417
5417
|
}
|
|
5418
5418
|
const no = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
5419
|
-
function
|
|
5419
|
+
function Ft(...n) {
|
|
5420
5420
|
const e = n.reduce((t, s) => t + s.source, "");
|
|
5421
5421
|
return RegExp(`^${e}$`);
|
|
5422
5422
|
}
|
|
5423
|
-
function
|
|
5423
|
+
function Pt(...n) {
|
|
5424
5424
|
return (e) => n.reduce(
|
|
5425
5425
|
([t, s, r], i) => {
|
|
5426
5426
|
const [o, a, l] = i(e, r);
|
|
@@ -5429,7 +5429,7 @@ function Ft(...n) {
|
|
|
5429
5429
|
[{}, null, 1]
|
|
5430
5430
|
).slice(0, 2);
|
|
5431
5431
|
}
|
|
5432
|
-
function
|
|
5432
|
+
function Lt(n, ...e) {
|
|
5433
5433
|
if (n == null)
|
|
5434
5434
|
return [null, null];
|
|
5435
5435
|
for (const [t, s] of e) {
|
|
@@ -5451,30 +5451,30 @@ function so(...n) {
|
|
|
5451
5451
|
const ro = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Sl = `(?:${ro.source}?(?:\\[(${no.source})\\])?)?`, Hs = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, io = RegExp(`${Hs.source}${Sl}`), Gs = RegExp(`(?:[Tt]${io.source})?`), Tl = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Rl = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Nl = /(\d{4})-?(\d{3})/, xl = so("weekYear", "weekNumber", "weekDay"), Dl = so("year", "ordinal"), Il = /(\d{4})-(\d\d)-(\d\d)/, oo = RegExp(
|
|
5452
5452
|
`${Hs.source} ?(?:${ro.source}|(${no.source}))?`
|
|
5453
5453
|
), Al = RegExp(`(?: ${oo.source})?`);
|
|
5454
|
-
function
|
|
5454
|
+
function Nt(n, e, t) {
|
|
5455
5455
|
const s = n[e];
|
|
5456
5456
|
return H(s) ? t : Xe(s);
|
|
5457
5457
|
}
|
|
5458
5458
|
function Cl(n, e) {
|
|
5459
5459
|
return [{
|
|
5460
|
-
year:
|
|
5461
|
-
month:
|
|
5462
|
-
day:
|
|
5460
|
+
year: Nt(n, e),
|
|
5461
|
+
month: Nt(n, e + 1, 1),
|
|
5462
|
+
day: Nt(n, e + 2, 1)
|
|
5463
5463
|
}, null, e + 3];
|
|
5464
5464
|
}
|
|
5465
|
-
function
|
|
5465
|
+
function Vt(n, e) {
|
|
5466
5466
|
return [{
|
|
5467
|
-
hours:
|
|
5468
|
-
minutes:
|
|
5469
|
-
seconds:
|
|
5467
|
+
hours: Nt(n, e, 0),
|
|
5468
|
+
minutes: Nt(n, e + 1, 0),
|
|
5469
|
+
seconds: Nt(n, e + 2, 0),
|
|
5470
5470
|
milliseconds: qs(n[e + 3])
|
|
5471
5471
|
}, null, e + 4];
|
|
5472
5472
|
}
|
|
5473
|
-
function
|
|
5473
|
+
function ln(n, e) {
|
|
5474
5474
|
const t = !n[e] && !n[e + 1], s = Hn(n[e + 1], n[e + 2]), r = t ? null : Ee.instance(s);
|
|
5475
5475
|
return [{}, r, e + 3];
|
|
5476
5476
|
}
|
|
5477
|
-
function
|
|
5477
|
+
function cn(n, e) {
|
|
5478
5478
|
const t = n[e] ? He.create(n[e]) : null;
|
|
5479
5479
|
return [{}, t, e + 1];
|
|
5480
5480
|
}
|
|
@@ -5546,28 +5546,28 @@ function zl(n) {
|
|
|
5546
5546
|
const [, e, t, s, r, i, o, a] = n;
|
|
5547
5547
|
return [Ys(e, a, t, s, r, i, o), Ee.utcInstance];
|
|
5548
5548
|
}
|
|
5549
|
-
const ql =
|
|
5549
|
+
const ql = Ft(Tl, Gs), Bl = Ft(Rl, Gs), Hl = Ft(Nl, Gs), Gl = Ft(io), ao = Pt(
|
|
5550
5550
|
Cl,
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
), Yl =
|
|
5551
|
+
Vt,
|
|
5552
|
+
ln,
|
|
5553
|
+
cn
|
|
5554
|
+
), Yl = Pt(
|
|
5555
5555
|
xl,
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
), Jl =
|
|
5556
|
+
Vt,
|
|
5557
|
+
ln,
|
|
5558
|
+
cn
|
|
5559
|
+
), Jl = Pt(
|
|
5560
5560
|
Dl,
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
), Ql =
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5561
|
+
Vt,
|
|
5562
|
+
ln,
|
|
5563
|
+
cn
|
|
5564
|
+
), Ql = Pt(
|
|
5565
|
+
Vt,
|
|
5566
|
+
ln,
|
|
5567
|
+
cn
|
|
5568
5568
|
);
|
|
5569
5569
|
function Kl(n) {
|
|
5570
|
-
return
|
|
5570
|
+
return Lt(
|
|
5571
5571
|
n,
|
|
5572
5572
|
[ql, ao],
|
|
5573
5573
|
[Bl, Yl],
|
|
@@ -5576,10 +5576,10 @@ function Kl(n) {
|
|
|
5576
5576
|
);
|
|
5577
5577
|
}
|
|
5578
5578
|
function Xl(n) {
|
|
5579
|
-
return
|
|
5579
|
+
return Lt(Ul(n), [Ll, Vl]);
|
|
5580
5580
|
}
|
|
5581
5581
|
function ec(n) {
|
|
5582
|
-
return
|
|
5582
|
+
return Lt(
|
|
5583
5583
|
n,
|
|
5584
5584
|
[Wl, Mr],
|
|
5585
5585
|
[jl, Mr],
|
|
@@ -5587,19 +5587,19 @@ function ec(n) {
|
|
|
5587
5587
|
);
|
|
5588
5588
|
}
|
|
5589
5589
|
function tc(n) {
|
|
5590
|
-
return
|
|
5590
|
+
return Lt(n, [Ml, Fl]);
|
|
5591
5591
|
}
|
|
5592
|
-
const nc =
|
|
5592
|
+
const nc = Pt(Vt);
|
|
5593
5593
|
function sc(n) {
|
|
5594
|
-
return
|
|
5594
|
+
return Lt(n, [$l, nc]);
|
|
5595
5595
|
}
|
|
5596
|
-
const rc =
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5596
|
+
const rc = Ft(Il, Al), ic = Ft(oo), oc = Pt(
|
|
5597
|
+
Vt,
|
|
5598
|
+
ln,
|
|
5599
|
+
cn
|
|
5600
5600
|
);
|
|
5601
5601
|
function ac(n) {
|
|
5602
|
-
return
|
|
5602
|
+
return Lt(
|
|
5603
5603
|
n,
|
|
5604
5604
|
[rc, ao],
|
|
5605
5605
|
[ic, oc]
|
|
@@ -5651,7 +5651,7 @@ const Fr = "Invalid Duration", lo = {
|
|
|
5651
5651
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
5652
5652
|
},
|
|
5653
5653
|
...lo
|
|
5654
|
-
}, Re = 146097 / 400,
|
|
5654
|
+
}, Re = 146097 / 400, vt = 146097 / 4800, cc = {
|
|
5655
5655
|
years: {
|
|
5656
5656
|
quarters: 4,
|
|
5657
5657
|
months: 12,
|
|
@@ -5672,12 +5672,12 @@ const Fr = "Invalid Duration", lo = {
|
|
|
5672
5672
|
milliseconds: Re * 24 * 60 * 60 * 1e3 / 4
|
|
5673
5673
|
},
|
|
5674
5674
|
months: {
|
|
5675
|
-
weeks:
|
|
5676
|
-
days:
|
|
5677
|
-
hours:
|
|
5678
|
-
minutes:
|
|
5679
|
-
seconds:
|
|
5680
|
-
milliseconds:
|
|
5675
|
+
weeks: vt / 7,
|
|
5676
|
+
days: vt,
|
|
5677
|
+
hours: vt * 24,
|
|
5678
|
+
minutes: vt * 24 * 60,
|
|
5679
|
+
seconds: vt * 24 * 60 * 60,
|
|
5680
|
+
milliseconds: vt * 24 * 60 * 60 * 1e3
|
|
5681
5681
|
},
|
|
5682
5682
|
...lo
|
|
5683
5683
|
}, ht = [
|
|
@@ -6060,7 +6060,7 @@ class ee {
|
|
|
6060
6060
|
if (!this.isValid) return this;
|
|
6061
6061
|
const t = ee.fromDurationLike(e), s = {};
|
|
6062
6062
|
for (const r of ht)
|
|
6063
|
-
(
|
|
6063
|
+
($t(t.values, r) || $t(this.values, r)) && (s[r] = t.get(r) + this.get(r));
|
|
6064
6064
|
return Ze(this, { values: s }, !0);
|
|
6065
6065
|
}
|
|
6066
6066
|
/**
|
|
@@ -6328,7 +6328,7 @@ class ee {
|
|
|
6328
6328
|
return !0;
|
|
6329
6329
|
}
|
|
6330
6330
|
}
|
|
6331
|
-
const
|
|
6331
|
+
const Ot = "Invalid Interval";
|
|
6332
6332
|
function dc(n, e) {
|
|
6333
6333
|
return !n || !n.isValid ? le.invalid("missing or invalid start") : !e || !e.isValid ? le.invalid("missing or invalid end") : e < n ? le.invalid(
|
|
6334
6334
|
"end before start",
|
|
@@ -6363,7 +6363,7 @@ class le {
|
|
|
6363
6363
|
* @return {Interval}
|
|
6364
6364
|
*/
|
|
6365
6365
|
static fromDateTimes(e, t) {
|
|
6366
|
-
const s =
|
|
6366
|
+
const s = zt(e), r = zt(t), i = dc(s, r);
|
|
6367
6367
|
return i ?? new le({
|
|
6368
6368
|
start: s,
|
|
6369
6369
|
end: r
|
|
@@ -6376,7 +6376,7 @@ class le {
|
|
|
6376
6376
|
* @return {Interval}
|
|
6377
6377
|
*/
|
|
6378
6378
|
static after(e, t) {
|
|
6379
|
-
const s = ee.fromDurationLike(t), r =
|
|
6379
|
+
const s = ee.fromDurationLike(t), r = zt(e);
|
|
6380
6380
|
return le.fromDateTimes(r, r.plus(s));
|
|
6381
6381
|
}
|
|
6382
6382
|
/**
|
|
@@ -6386,7 +6386,7 @@ class le {
|
|
|
6386
6386
|
* @return {Interval}
|
|
6387
6387
|
*/
|
|
6388
6388
|
static before(e, t) {
|
|
6389
|
-
const s = ee.fromDurationLike(t), r =
|
|
6389
|
+
const s = ee.fromDurationLike(t), r = zt(e);
|
|
6390
6390
|
return le.fromDateTimes(r.minus(s), r);
|
|
6391
6391
|
}
|
|
6392
6392
|
/**
|
|
@@ -6556,7 +6556,7 @@ class le {
|
|
|
6556
6556
|
*/
|
|
6557
6557
|
splitAt(...e) {
|
|
6558
6558
|
if (!this.isValid) return [];
|
|
6559
|
-
const t = e.map(
|
|
6559
|
+
const t = e.map(zt).filter((o) => this.contains(o)).sort((o, a) => o.toMillis() - a.toMillis()), s = [];
|
|
6560
6560
|
let { s: r } = this, i = 0;
|
|
6561
6561
|
for (; r < this.e; ) {
|
|
6562
6562
|
const o = t[i] || this.e, a = +o > +this.e ? this.e : o;
|
|
@@ -6697,7 +6697,7 @@ class le {
|
|
|
6697
6697
|
* @return {string}
|
|
6698
6698
|
*/
|
|
6699
6699
|
toString() {
|
|
6700
|
-
return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` :
|
|
6700
|
+
return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` : Ot;
|
|
6701
6701
|
}
|
|
6702
6702
|
/**
|
|
6703
6703
|
* Returns a string representation of this Interval appropriate for the REPL.
|
|
@@ -6725,7 +6725,7 @@ class le {
|
|
|
6725
6725
|
* @return {string}
|
|
6726
6726
|
*/
|
|
6727
6727
|
toLocaleString(e = Mn, t = {}) {
|
|
6728
|
-
return this.isValid ? _e.create(this.s.loc.clone(t), e).formatInterval(this) :
|
|
6728
|
+
return this.isValid ? _e.create(this.s.loc.clone(t), e).formatInterval(this) : Ot;
|
|
6729
6729
|
}
|
|
6730
6730
|
/**
|
|
6731
6731
|
* Returns an ISO 8601-compliant string representation of this Interval.
|
|
@@ -6734,7 +6734,7 @@ class le {
|
|
|
6734
6734
|
* @return {string}
|
|
6735
6735
|
*/
|
|
6736
6736
|
toISO(e) {
|
|
6737
|
-
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` :
|
|
6737
|
+
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` : Ot;
|
|
6738
6738
|
}
|
|
6739
6739
|
/**
|
|
6740
6740
|
* Returns an ISO 8601-compliant string representation of date of this Interval.
|
|
@@ -6743,7 +6743,7 @@ class le {
|
|
|
6743
6743
|
* @return {string}
|
|
6744
6744
|
*/
|
|
6745
6745
|
toISODate() {
|
|
6746
|
-
return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` :
|
|
6746
|
+
return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` : Ot;
|
|
6747
6747
|
}
|
|
6748
6748
|
/**
|
|
6749
6749
|
* Returns an ISO 8601-compliant string representation of time of this Interval.
|
|
@@ -6753,7 +6753,7 @@ class le {
|
|
|
6753
6753
|
* @return {string}
|
|
6754
6754
|
*/
|
|
6755
6755
|
toISOTime(e) {
|
|
6756
|
-
return this.isValid ? `${this.s.toISOTime(e)}/${this.e.toISOTime(e)}` :
|
|
6756
|
+
return this.isValid ? `${this.s.toISOTime(e)}/${this.e.toISOTime(e)}` : Ot;
|
|
6757
6757
|
}
|
|
6758
6758
|
/**
|
|
6759
6759
|
* Returns a string representation of this Interval formatted according to the specified format
|
|
@@ -6767,7 +6767,7 @@ class le {
|
|
|
6767
6767
|
* @return {string}
|
|
6768
6768
|
*/
|
|
6769
6769
|
toFormat(e, { separator: t = " – " } = {}) {
|
|
6770
|
-
return this.isValid ? `${this.s.toFormat(e)}${t}${this.e.toFormat(e)}` :
|
|
6770
|
+
return this.isValid ? `${this.s.toFormat(e)}${t}${this.e.toFormat(e)}` : Ot;
|
|
6771
6771
|
}
|
|
6772
6772
|
/**
|
|
6773
6773
|
* Return a Duration representing the time spanned by this interval.
|
|
@@ -7220,7 +7220,7 @@ function Oc(n, e, t) {
|
|
|
7220
7220
|
const r = {};
|
|
7221
7221
|
let i = 1;
|
|
7222
7222
|
for (const o in t)
|
|
7223
|
-
if (
|
|
7223
|
+
if ($t(t, o)) {
|
|
7224
7224
|
const a = t[o], l = a.groups ? a.groups + 1 : 1;
|
|
7225
7225
|
!a.literal && a.token && (r[a.token.val[0]] = a.deser(s.slice(i, i + l))), i += l;
|
|
7226
7226
|
}
|
|
@@ -7291,8 +7291,8 @@ class mo {
|
|
|
7291
7291
|
explainFromTokens(e) {
|
|
7292
7292
|
if (this.isValid) {
|
|
7293
7293
|
const [t, s] = Oc(e, this.regex, this.handlers), [r, i, o] = s ? kc(s) : [null, null, void 0];
|
|
7294
|
-
if (
|
|
7295
|
-
throw new
|
|
7294
|
+
if ($t(s, "a") && $t(s, "H"))
|
|
7295
|
+
throw new St(
|
|
7296
7296
|
"Can't include meridiem when specifying 24-hour format"
|
|
7297
7297
|
);
|
|
7298
7298
|
return {
|
|
@@ -7329,7 +7329,7 @@ function yo(n, e) {
|
|
|
7329
7329
|
return r.map((o) => Ec(o, n, i));
|
|
7330
7330
|
}
|
|
7331
7331
|
const ls = "Invalid DateTime", jr = 864e13;
|
|
7332
|
-
function
|
|
7332
|
+
function Gt(n) {
|
|
7333
7333
|
return new Fe("unsupported zone", `the zone "${n.name}" is not supported`);
|
|
7334
7334
|
}
|
|
7335
7335
|
function cs(n) {
|
|
@@ -7398,7 +7398,7 @@ function Zr(n, e) {
|
|
|
7398
7398
|
let [l, c] = go(a, t, n.zone);
|
|
7399
7399
|
return o !== 0 && (l += o, c = n.zone.offset(l)), { ts: l, o: c };
|
|
7400
7400
|
}
|
|
7401
|
-
function
|
|
7401
|
+
function kt(n, e, t, s, r, i) {
|
|
7402
7402
|
const { setZone: o, zone: a } = t;
|
|
7403
7403
|
if (n && Object.keys(n).length !== 0 || e) {
|
|
7404
7404
|
const l = e || a, c = V.fromObject(n, {
|
|
@@ -7524,16 +7524,16 @@ function qr(n) {
|
|
|
7524
7524
|
}
|
|
7525
7525
|
}
|
|
7526
7526
|
function Ic(n) {
|
|
7527
|
-
if (
|
|
7528
|
-
return n.offset(
|
|
7527
|
+
if (Yt === void 0 && (Yt = ce.now()), n.type !== "iana")
|
|
7528
|
+
return n.offset(Yt);
|
|
7529
7529
|
const e = n.name;
|
|
7530
7530
|
let t = Fs.get(e);
|
|
7531
|
-
return t === void 0 && (t = n.offset(
|
|
7531
|
+
return t === void 0 && (t = n.offset(Yt), Fs.set(e, t)), t;
|
|
7532
7532
|
}
|
|
7533
7533
|
function Br(n, e) {
|
|
7534
7534
|
const t = et(e.zone, ce.defaultZone);
|
|
7535
7535
|
if (!t.isValid)
|
|
7536
|
-
return V.invalid(
|
|
7536
|
+
return V.invalid(Gt(t));
|
|
7537
7537
|
const s = se.fromObject(e);
|
|
7538
7538
|
let r, i;
|
|
7539
7539
|
if (H(n.year))
|
|
@@ -7564,7 +7564,7 @@ function Gr(n) {
|
|
|
7564
7564
|
let e = {}, t;
|
|
7565
7565
|
return n.length > 0 && typeof n[n.length - 1] == "object" ? (e = n[n.length - 1], t = Array.from(n).slice(0, n.length - 1)) : t = Array.from(n), [e, t];
|
|
7566
7566
|
}
|
|
7567
|
-
let
|
|
7567
|
+
let Yt;
|
|
7568
7568
|
const Fs = /* @__PURE__ */ new Map();
|
|
7569
7569
|
class V {
|
|
7570
7570
|
/**
|
|
@@ -7572,7 +7572,7 @@ class V {
|
|
|
7572
7572
|
*/
|
|
7573
7573
|
constructor(e) {
|
|
7574
7574
|
const t = e.zone || ce.defaultZone;
|
|
7575
|
-
let s = e.invalid || (Number.isNaN(e.ts) ? new Fe("invalid input") : null) || (t.isValid ? null :
|
|
7575
|
+
let s = e.invalid || (Number.isNaN(e.ts) ? new Fe("invalid input") : null) || (t.isValid ? null : Gt(t));
|
|
7576
7576
|
this.ts = H(e.ts) ? ce.now() : e.ts;
|
|
7577
7577
|
let r = null, i = null;
|
|
7578
7578
|
if (!s)
|
|
@@ -7665,7 +7665,7 @@ class V {
|
|
|
7665
7665
|
ts: s,
|
|
7666
7666
|
zone: r,
|
|
7667
7667
|
loc: se.fromObject(t)
|
|
7668
|
-
}) : V.invalid(
|
|
7668
|
+
}) : V.invalid(Gt(r));
|
|
7669
7669
|
}
|
|
7670
7670
|
/**
|
|
7671
7671
|
* Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
|
|
@@ -7746,14 +7746,14 @@ class V {
|
|
|
7746
7746
|
e = e || {};
|
|
7747
7747
|
const s = et(t.zone, ce.defaultZone);
|
|
7748
7748
|
if (!s.isValid)
|
|
7749
|
-
return V.invalid(
|
|
7749
|
+
return V.invalid(Gt(s));
|
|
7750
7750
|
const r = se.fromObject(t), i = Ln(e, qr), { minDaysInFirstWeek: o, startOfWeek: a } = Ir(i, r), l = ce.now(), c = H(t.specificOffset) ? s.offset(l) : t.specificOffset, u = !H(i.ordinal), h = !H(i.year), f = !H(i.month) || !H(i.day), d = h || f, m = i.weekYear || i.weekNumber;
|
|
7751
7751
|
if ((d || u) && m)
|
|
7752
|
-
throw new
|
|
7752
|
+
throw new St(
|
|
7753
7753
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
7754
7754
|
);
|
|
7755
7755
|
if (f && u)
|
|
7756
|
-
throw new
|
|
7756
|
+
throw new St("Can't mix ordinal dates with month/day");
|
|
7757
7757
|
const O = m || i.weekday && !d;
|
|
7758
7758
|
let y, w, b = pn(l, c);
|
|
7759
7759
|
O ? (y = xc, w = Rc, b = Fn(b, o, a)) : u ? (y = Dc, w = Nc, b = os(b)) : (y = En, w = wo);
|
|
@@ -7795,7 +7795,7 @@ class V {
|
|
|
7795
7795
|
*/
|
|
7796
7796
|
static fromISO(e, t = {}) {
|
|
7797
7797
|
const [s, r] = Kl(e);
|
|
7798
|
-
return
|
|
7798
|
+
return kt(s, r, t, "ISO 8601", e);
|
|
7799
7799
|
}
|
|
7800
7800
|
/**
|
|
7801
7801
|
* Create a DateTime from an RFC 2822 string
|
|
@@ -7814,7 +7814,7 @@ class V {
|
|
|
7814
7814
|
*/
|
|
7815
7815
|
static fromRFC2822(e, t = {}) {
|
|
7816
7816
|
const [s, r] = Xl(e);
|
|
7817
|
-
return
|
|
7817
|
+
return kt(s, r, t, "RFC 2822", e);
|
|
7818
7818
|
}
|
|
7819
7819
|
/**
|
|
7820
7820
|
* Create a DateTime from an HTTP header date
|
|
@@ -7834,7 +7834,7 @@ class V {
|
|
|
7834
7834
|
*/
|
|
7835
7835
|
static fromHTTP(e, t = {}) {
|
|
7836
7836
|
const [s, r] = ec(e);
|
|
7837
|
-
return
|
|
7837
|
+
return kt(s, r, t, "HTTP", t);
|
|
7838
7838
|
}
|
|
7839
7839
|
/**
|
|
7840
7840
|
* Create a DateTime from an input string and format string.
|
|
@@ -7858,7 +7858,7 @@ class V {
|
|
|
7858
7858
|
numberingSystem: i,
|
|
7859
7859
|
defaultToEN: !0
|
|
7860
7860
|
}), [a, l, c, u] = Tc(o, e, t);
|
|
7861
|
-
return u ? V.invalid(u) :
|
|
7861
|
+
return u ? V.invalid(u) : kt(a, l, s, `format ${t}`, e, c);
|
|
7862
7862
|
}
|
|
7863
7863
|
/**
|
|
7864
7864
|
* @deprecated use fromFormat instead
|
|
@@ -7889,7 +7889,7 @@ class V {
|
|
|
7889
7889
|
*/
|
|
7890
7890
|
static fromSQL(e, t = {}) {
|
|
7891
7891
|
const [s, r] = ac(e);
|
|
7892
|
-
return
|
|
7892
|
+
return kt(s, r, t, "SQL", e);
|
|
7893
7893
|
}
|
|
7894
7894
|
/**
|
|
7895
7895
|
* Create an invalid DateTime.
|
|
@@ -7934,7 +7934,7 @@ class V {
|
|
|
7934
7934
|
return ho(_e.parseFormat(e), se.fromObject(t)).map((r) => r.val).join("");
|
|
7935
7935
|
}
|
|
7936
7936
|
static resetCache() {
|
|
7937
|
-
|
|
7937
|
+
Yt = void 0, Fs.clear();
|
|
7938
7938
|
}
|
|
7939
7939
|
// INFO
|
|
7940
7940
|
/**
|
|
@@ -8245,7 +8245,7 @@ class V {
|
|
|
8245
8245
|
* @type {boolean}
|
|
8246
8246
|
*/
|
|
8247
8247
|
get isInLeapYear() {
|
|
8248
|
-
return
|
|
8248
|
+
return an(this.year);
|
|
8249
8249
|
}
|
|
8250
8250
|
/**
|
|
8251
8251
|
* Returns the number of days in this DateTime's month
|
|
@@ -8263,7 +8263,7 @@ class V {
|
|
|
8263
8263
|
* @type {number}
|
|
8264
8264
|
*/
|
|
8265
8265
|
get daysInYear() {
|
|
8266
|
-
return this.isValid ?
|
|
8266
|
+
return this.isValid ? Rt(this.year) : NaN;
|
|
8267
8267
|
}
|
|
8268
8268
|
/**
|
|
8269
8269
|
* Returns the number of weeks in this DateTime's year
|
|
@@ -8273,7 +8273,7 @@ class V {
|
|
|
8273
8273
|
* @type {number}
|
|
8274
8274
|
*/
|
|
8275
8275
|
get weeksInWeekYear() {
|
|
8276
|
-
return this.isValid ?
|
|
8276
|
+
return this.isValid ? nn(this.weekYear) : NaN;
|
|
8277
8277
|
}
|
|
8278
8278
|
/**
|
|
8279
8279
|
* Returns the number of weeks in this DateTime's local week year
|
|
@@ -8282,7 +8282,7 @@ class V {
|
|
|
8282
8282
|
* @type {number}
|
|
8283
8283
|
*/
|
|
8284
8284
|
get weeksInLocalWeekYear() {
|
|
8285
|
-
return this.isValid ?
|
|
8285
|
+
return this.isValid ? nn(
|
|
8286
8286
|
this.localWeekYear,
|
|
8287
8287
|
this.loc.getMinDaysInFirstWeek(),
|
|
8288
8288
|
this.loc.getStartOfWeek()
|
|
@@ -8342,7 +8342,7 @@ class V {
|
|
|
8342
8342
|
}
|
|
8343
8343
|
return ut(this, { ts: r, zone: e });
|
|
8344
8344
|
} else
|
|
8345
|
-
return V.invalid(
|
|
8345
|
+
return V.invalid(Gt(e));
|
|
8346
8346
|
}
|
|
8347
8347
|
/**
|
|
8348
8348
|
* "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.
|
|
@@ -8380,11 +8380,11 @@ class V {
|
|
|
8380
8380
|
if (!this.isValid) return this;
|
|
8381
8381
|
const t = Ln(e, qr), { minDaysInFirstWeek: s, startOfWeek: r } = Ir(t, this.loc), i = !H(t.weekYear) || !H(t.weekNumber) || !H(t.weekday), o = !H(t.ordinal), a = !H(t.year), l = !H(t.month) || !H(t.day), c = a || l, u = t.weekYear || t.weekNumber;
|
|
8382
8382
|
if ((c || o) && u)
|
|
8383
|
-
throw new
|
|
8383
|
+
throw new St(
|
|
8384
8384
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
8385
8385
|
);
|
|
8386
8386
|
if (l && o)
|
|
8387
|
-
throw new
|
|
8387
|
+
throw new St("Can't mix ordinal dates with month/day");
|
|
8388
8388
|
let h;
|
|
8389
8389
|
i ? h = xr(
|
|
8390
8390
|
{ ...Fn(this.c, s, r), ...t },
|
|
@@ -8977,7 +8977,7 @@ class V {
|
|
|
8977
8977
|
`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`
|
|
8978
8978
|
);
|
|
8979
8979
|
const { result: a, zone: l, specificOffset: c, invalidReason: u } = t.explainFromTokens(e);
|
|
8980
|
-
return u ? V.invalid(u) :
|
|
8980
|
+
return u ? V.invalid(u) : kt(
|
|
8981
8981
|
a,
|
|
8982
8982
|
l,
|
|
8983
8983
|
s,
|
|
@@ -9142,7 +9142,7 @@ class V {
|
|
|
9142
9142
|
return Fi;
|
|
9143
9143
|
}
|
|
9144
9144
|
}
|
|
9145
|
-
function
|
|
9145
|
+
function zt(n) {
|
|
9146
9146
|
if (V.isDateTime(n))
|
|
9147
9147
|
return n;
|
|
9148
9148
|
if (n && n.valueOf && st(n.valueOf()))
|
|
@@ -9158,7 +9158,7 @@ const Ac = (n, e) => {
|
|
|
9158
9158
|
if (n.includeFields) {
|
|
9159
9159
|
const s = e.collections[n.collection];
|
|
9160
9160
|
if (!s)
|
|
9161
|
-
return
|
|
9161
|
+
return rn(ge());
|
|
9162
9162
|
n.includeFields.forEach((r) => {
|
|
9163
9163
|
const i = s.fields.find((o) => o.name === r);
|
|
9164
9164
|
i ? t[r] = _o(i)?.nullable() : t[r] = ge();
|
|
@@ -9172,20 +9172,20 @@ const Ac = (n, e) => {
|
|
|
9172
9172
|
let r = We({}).catchall(Ac(n, e)), i;
|
|
9173
9173
|
if (!s && t) {
|
|
9174
9174
|
const o = De(n, t);
|
|
9175
|
-
i =
|
|
9175
|
+
i = qt(o.admin?.skipFormRequiredValidation);
|
|
9176
9176
|
}
|
|
9177
9177
|
return (!n.required || i) && (r = r.optional()), r;
|
|
9178
9178
|
}, $c = () => ge().refine((n) => n && (n.seconds !== void 0 && n.nanoseconds !== void 0 || n._seconds !== void 0 && n._nanoseconds !== void 0), {
|
|
9179
9179
|
message: "Must be a valid date"
|
|
9180
9180
|
}), _o = (n, e, t) => {
|
|
9181
9181
|
let s;
|
|
9182
|
-
const r = `${
|
|
9182
|
+
const r = `${qt(n.description)}
|
|
9183
9183
|
|
|
9184
9184
|
` || "";
|
|
9185
9185
|
let i, o, a;
|
|
9186
9186
|
if (!t && e) {
|
|
9187
9187
|
const l = De(n, e);
|
|
9188
|
-
i = l.admin?.condition?.form !== void 0 && !
|
|
9188
|
+
i = l.admin?.condition?.form !== void 0 && !qt(l.admin.condition.form), o = qt(l.admin?.skipFormRequiredValidation), a = qt(l.admin?.image);
|
|
9189
9189
|
}
|
|
9190
9190
|
switch (n.type) {
|
|
9191
9191
|
case "String":
|
|
@@ -9199,7 +9199,7 @@ const Ac = (n, e) => {
|
|
|
9199
9199
|
])), r && (s = s.describe(r.trim()));
|
|
9200
9200
|
break;
|
|
9201
9201
|
case "Boolean":
|
|
9202
|
-
s =
|
|
9202
|
+
s = Kt(), r && (s = s.describe(r.trim()));
|
|
9203
9203
|
break;
|
|
9204
9204
|
case "Number":
|
|
9205
9205
|
n.autoIncrement ? s = Oe([ns(), ft().int()], {
|
|
@@ -9232,7 +9232,7 @@ const Ac = (n, e) => {
|
|
|
9232
9232
|
}, { message: `Must only contain the following values: ${n.values.join(", ")}` })), s = s.describe(`${r}Must only contain the following values: ${n.values.join(", ")}`)) : r && (s = s.describe(r.trim())), n.nullable && (s = s.nullable());
|
|
9233
9233
|
break;
|
|
9234
9234
|
case "Map":
|
|
9235
|
-
n.required && !i ? t ? s = We({}).catchall(ge()).describe(`${r}Must be an object. Must contain at least one object property.`) : s =
|
|
9235
|
+
n.required && !i ? t ? s = We({}).catchall(ge()).describe(`${r}Must be an object. Must contain at least one object property.`) : s = rn(ge()).refine((l) => l && typeof l == "object" && Object.keys(l).length > 0, {
|
|
9236
9236
|
message: "Must not be an empty value"
|
|
9237
9237
|
}) : s = We({}).catchall(ge()).describe(`${r}Must be an object`);
|
|
9238
9238
|
break;
|
|
@@ -9251,8 +9251,8 @@ const Ac = (n, e) => {
|
|
|
9251
9251
|
message: `Must contain at most ${c.max} item(s)`
|
|
9252
9252
|
})))) : a[c.name] = _o(c, t, s), r && (a[c.name] = a[c.name].optional()));
|
|
9253
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) => {
|
|
9254
|
-
a[`auth-${c.labels.collection}`] =
|
|
9255
|
-
a[`attribute-${c.labels.collection}-${u.type}`] =
|
|
9254
|
+
a[`auth-${c.labels.collection}`] = Kt().optional(), a[`operations-${c.labels.collection}`] = wt(Oe([ke("Read"), ke("Create"), ke("Update"), ke("Delete")])).optional(), a[`restrict-${c.labels.collection}`] = Kt().optional(), c.access.attributeRestrictions?.forEach((u) => {
|
|
9255
|
+
a[`attribute-${c.labels.collection}-${u.type}`] = Kt().optional();
|
|
9256
9256
|
}), c.access.entityRestrictions?.restrictions?.forEach((u) => {
|
|
9257
9257
|
if (u.type === "Individual" && (a[`accessible-${c.labels.collection}-${c.labels.collection}`] = We({}).catchall(ge()).optional()), u.type === "Parent" || u.type === "Parent_Property") {
|
|
9258
9258
|
const h = W(c.fields, u.collectionField);
|
|
@@ -9268,7 +9268,7 @@ const Ac = (n, e) => {
|
|
|
9268
9268
|
if (!t.valid)
|
|
9269
9269
|
throw new Error(`VALIDATION_ERROR: ${t.message}`);
|
|
9270
9270
|
}
|
|
9271
|
-
},
|
|
9271
|
+
}, sn = async (n, e, t, s, r, i) => {
|
|
9272
9272
|
await Yr(s.custom?.preValidate, r);
|
|
9273
9273
|
for (const a of s.fields)
|
|
9274
9274
|
await Yr(a.custom?.preValidate, r);
|
|
@@ -9471,8 +9471,8 @@ const Ac = (n, e) => {
|
|
|
9471
9471
|
);
|
|
9472
9472
|
return t;
|
|
9473
9473
|
};
|
|
9474
|
-
let hs, Eo, vo, Oo,
|
|
9475
|
-
const
|
|
9474
|
+
let hs, Eo, vo, Oo, Jt, ko, On, kn, ms = 0;
|
|
9475
|
+
const Tt = {
|
|
9476
9476
|
getTenant() {
|
|
9477
9477
|
return vo;
|
|
9478
9478
|
},
|
|
@@ -9483,12 +9483,12 @@ const St = {
|
|
|
9483
9483
|
return Oo;
|
|
9484
9484
|
},
|
|
9485
9485
|
getGlobalConfigModule() {
|
|
9486
|
-
return ye(
|
|
9486
|
+
return ye(Jt);
|
|
9487
9487
|
},
|
|
9488
9488
|
getCustomizationFile(n, e) {
|
|
9489
9489
|
if (!Object.keys(e.collections).includes(n))
|
|
9490
9490
|
throw new Error("PERMISSION_DENIED");
|
|
9491
|
-
const t = ea([n], ko, "node",
|
|
9491
|
+
const t = ea([n], ko, "node", Tt);
|
|
9492
9492
|
return ye(t?.[n]);
|
|
9493
9493
|
},
|
|
9494
9494
|
getVersionInfo() {
|
|
@@ -9499,7 +9499,7 @@ const St = {
|
|
|
9499
9499
|
}
|
|
9500
9500
|
}, au = async (n, e, t, s, r) => {
|
|
9501
9501
|
if (hs && !r)
|
|
9502
|
-
return
|
|
9502
|
+
return Tt;
|
|
9503
9503
|
if (!process.env.STOKER_FB_WEB_APP_CONFIG)
|
|
9504
9504
|
throw new Error("STOKER_FB_WEB_APP_CONFIG not set.");
|
|
9505
9505
|
const i = process.env.STOKER_FB_WEB_APP_CONFIG, o = JSON.parse(i);
|
|
@@ -9508,7 +9508,7 @@ const St = {
|
|
|
9508
9508
|
/* @vite-ignore */
|
|
9509
9509
|
t
|
|
9510
9510
|
)).default;
|
|
9511
|
-
|
|
9511
|
+
Jt = l("node", Tt), !r && n === "development" && (process.env.FIREBASE_AUTH_EMULATOR_HOST = "127.0.0.1:9099", process.env.FIREBASE_DATABASE_EMULATOR_HOST = "127.0.0.1:9000", process.env.FIRESTORE_EMULATOR_HOST = "127.0.0.1:8080", process.env.FIREBASE_STORAGE_EMULATOR_HOST = "127.0.0.1:9199");
|
|
9512
9512
|
try {
|
|
9513
9513
|
hs = ei();
|
|
9514
9514
|
} catch {
|
|
@@ -9520,21 +9520,21 @@ const St = {
|
|
|
9520
9520
|
});
|
|
9521
9521
|
}
|
|
9522
9522
|
const c = await Ge();
|
|
9523
|
-
return ko = await Fc(s, Object.keys(c.collections)), Oo = await ie(
|
|
9524
|
-
u.exists ? (kn = u.data(), ie(
|
|
9523
|
+
return ko = await Fc(s, Object.keys(c.collections)), Oo = await ie(Jt.timezone), ue().collection("system_deployment").doc("maintenance_mode").onSnapshot((u) => {
|
|
9524
|
+
u.exists ? (kn = u.data(), ie(Jt.onMaintenanceUpdate, ["node", kn.active ? "on" : "off"])) : console.error("Maintenance status not found");
|
|
9525
9525
|
}, (u) => {
|
|
9526
9526
|
console.error(u.message);
|
|
9527
9527
|
}), ue().collection("system_deployment").doc("latest_deploy").onSnapshot((u) => {
|
|
9528
|
-
u.exists ? (On = u.data(), ms++, ms > 1 && ie(
|
|
9528
|
+
u.exists ? (On = u.data(), ms++, ms > 1 && ie(Jt.onVersionUpdate, ["node", On, ms])) : console.error("Version info not found");
|
|
9529
9529
|
}, (u) => {
|
|
9530
9530
|
console.error(u.message);
|
|
9531
9531
|
}), await new Promise((u) => {
|
|
9532
9532
|
const h = () => {
|
|
9533
|
-
kn && On ? u(
|
|
9533
|
+
kn && On ? u(Tt) : setTimeout(h, 100);
|
|
9534
9534
|
};
|
|
9535
9535
|
h();
|
|
9536
|
-
}),
|
|
9537
|
-
}, { getTenant:
|
|
9536
|
+
}), Tt;
|
|
9537
|
+
}, { getTenant: Et, getMode: bo, getTimezone: So, getGlobalConfigModule: Ut, getCustomizationFile: Ye, getVersionInfo: lu, getMaintenanceInfo: cu } = Tt, Ge = async (n = !1) => {
|
|
9538
9538
|
const s = await si().ref("schema").orderByChild("published_time").limitToLast(1).get(), r = Object.values(s.val())[0];
|
|
9539
9539
|
if (n) {
|
|
9540
9540
|
for (const i of Object.values(r.collections))
|
|
@@ -9874,11 +9874,11 @@ const St = {
|
|
|
9874
9874
|
if (typeof c != "number" || !Number.isFinite(c) || !Number.isInteger(c) || c < 1)
|
|
9875
9875
|
throw new Error("INPUT_ERROR: Pagination number must be a positive finite integer");
|
|
9876
9876
|
}
|
|
9877
|
-
const s =
|
|
9877
|
+
const s = Et(), r = ue();
|
|
9878
9878
|
let i, o, a;
|
|
9879
9879
|
const l = async (c) => {
|
|
9880
9880
|
const [u, h, f] = await Promise.all([
|
|
9881
|
-
t?.user ? c.get(r.collection("system_user_permissions").doc(t.user)) : Promise.resolve(Promise.resolve({})),
|
|
9881
|
+
t?.user ? c.get(r.collection("tenants").doc(s).collection("system_user_permissions").doc(t.user)) : Promise.resolve(Promise.resolve({})),
|
|
9882
9882
|
c.get(r.collection("system_deployment").doc("maintenance_mode")),
|
|
9883
9883
|
Ge(!0)
|
|
9884
9884
|
]);
|
|
@@ -9888,7 +9888,7 @@ const St = {
|
|
|
9888
9888
|
throw new Error("MAINTENANCE_MODE");
|
|
9889
9889
|
const m = f;
|
|
9890
9890
|
let O;
|
|
9891
|
-
const y =
|
|
9891
|
+
const y = Ut(), w = n.at(-1);
|
|
9892
9892
|
if (!w)
|
|
9893
9893
|
throw new Error("EMPTY_PATH");
|
|
9894
9894
|
const b = Object.keys(m.collections).includes(w), N = y.disabledCollections?.includes(w);
|
|
@@ -10071,11 +10071,11 @@ const St = {
|
|
|
10071
10071
|
throw new Error("INPUT_ERROR: Subcollections depth cannot exceed 10");
|
|
10072
10072
|
if (t?.relations?.depth && t.relations.depth > 10)
|
|
10073
10073
|
throw new Error("INPUT_ERROR: Relations depth cannot exceed 10");
|
|
10074
|
-
const s =
|
|
10074
|
+
const s = Et(), r = ue();
|
|
10075
10075
|
let i;
|
|
10076
10076
|
const o = async (a) => {
|
|
10077
10077
|
const [l, c, u] = await Promise.all([
|
|
10078
|
-
t?.user ? a.get(r.collection("system_user_permissions").doc(t.user)) : Promise.resolve(Promise.resolve({})),
|
|
10078
|
+
t?.user ? a.get(r.collection("tenants").doc(s).collection("system_user_permissions").doc(t.user)) : Promise.resolve(Promise.resolve({})),
|
|
10079
10079
|
a.get(r.collection("system_deployment").doc("maintenance_mode")),
|
|
10080
10080
|
Ge(!0)
|
|
10081
10081
|
]);
|
|
@@ -10085,7 +10085,7 @@ const St = {
|
|
|
10085
10085
|
throw new Error("MAINTENANCE_MODE");
|
|
10086
10086
|
const f = u;
|
|
10087
10087
|
let d;
|
|
10088
|
-
const m =
|
|
10088
|
+
const m = Ut(), O = n.at(-1);
|
|
10089
10089
|
if (!O)
|
|
10090
10090
|
throw new Error("EMPTY_PATH");
|
|
10091
10091
|
const y = Object.keys(f.collections).includes(O), w = m.disabledCollections?.includes(O);
|
|
@@ -10169,8 +10169,8 @@ const St = {
|
|
|
10169
10169
|
}
|
|
10170
10170
|
})), f.length > 0)
|
|
10171
10171
|
throw new Error(f.join(", "));
|
|
10172
|
-
},
|
|
10173
|
-
const { labels: c } = o, u = ue(), h =
|
|
10172
|
+
}, Mt = async (n, e, t, s, r, i, o, a, l) => {
|
|
10173
|
+
const { labels: c } = o, u = ue(), h = Ut(), f = await ie(h.firebase?.writeLogTTL), d = {
|
|
10174
10174
|
operation: n,
|
|
10175
10175
|
collection: c.collection,
|
|
10176
10176
|
docId: i,
|
|
@@ -10193,28 +10193,28 @@ const St = {
|
|
|
10193
10193
|
const O = Ie(u, r, s), y = t.Last_Write_At;
|
|
10194
10194
|
await O.doc(i).collection("system_write_log").doc(`${t.Last_Write_By}-${y.valueOf()}`).set(d);
|
|
10195
10195
|
}, un = async (n) => {
|
|
10196
|
-
const e =
|
|
10196
|
+
const e = Et(), t = yt(), s = ue(), r = [];
|
|
10197
10197
|
if (await Promise.all([
|
|
10198
10198
|
(async () => {
|
|
10199
10199
|
try {
|
|
10200
|
-
await
|
|
10201
|
-
} catch (
|
|
10202
|
-
|
|
10203
|
-
${
|
|
10200
|
+
await s.collection("tenants").doc(e).collection("system_user_permissions").doc(n.User_ID).delete();
|
|
10201
|
+
} catch (i) {
|
|
10202
|
+
r.push(`Error deleting user permissions:
|
|
10203
|
+
${i}`);
|
|
10204
10204
|
}
|
|
10205
10205
|
})(),
|
|
10206
10206
|
(async () => {
|
|
10207
10207
|
try {
|
|
10208
|
-
await
|
|
10209
|
-
} catch (
|
|
10210
|
-
if (
|
|
10208
|
+
await t.deleteUser(n.User_ID);
|
|
10209
|
+
} catch (i) {
|
|
10210
|
+
if (i.code === "auth/user-not-found")
|
|
10211
10211
|
return;
|
|
10212
|
-
|
|
10213
|
-
${
|
|
10212
|
+
r.push(`Error deleting user:
|
|
10213
|
+
${i}`);
|
|
10214
10214
|
}
|
|
10215
10215
|
})()
|
|
10216
|
-
]),
|
|
10217
|
-
throw new Error(
|
|
10216
|
+
]), r.length > 0)
|
|
10217
|
+
throw new Error(r.join(", "));
|
|
10218
10218
|
}, Ao = async (n, e, t, s, r, i, o, a, l) => {
|
|
10219
10219
|
const c = ue(), u = bo(), h = process.env.ADMIN_EMAIL;
|
|
10220
10220
|
if (u === "development" || process.env.FIRESTORE_EMULATOR_HOST)
|
|
@@ -10267,13 +10267,12 @@ ${r}`);
|
|
|
10267
10267
|
throw await u(r, c), new Error(c);
|
|
10268
10268
|
}
|
|
10269
10269
|
try {
|
|
10270
|
-
await l.collection("system_user_permissions").doc(h.uid).set({
|
|
10270
|
+
await l.collection("tenants").doc(n).collection("system_user_permissions").doc(h.uid).set({
|
|
10271
10271
|
...i,
|
|
10272
10272
|
Role: r.Role,
|
|
10273
10273
|
Enabled: r.Enabled ?? !1,
|
|
10274
10274
|
Collection: s,
|
|
10275
|
-
Doc_ID: e
|
|
10276
|
-
Tenant_ID: n
|
|
10275
|
+
Doc_ID: e
|
|
10277
10276
|
});
|
|
10278
10277
|
} catch {
|
|
10279
10278
|
throw await u(r, c), new Error(c);
|
|
@@ -10514,7 +10513,7 @@ ${r}`);
|
|
|
10514
10513
|
}
|
|
10515
10514
|
}
|
|
10516
10515
|
try {
|
|
10517
|
-
await
|
|
10516
|
+
await sn("update", C, N, p, ["update", C, {}, void 0, C], o);
|
|
10518
10517
|
} catch (x) {
|
|
10519
10518
|
throw new Error(`VALIDATION_ERROR: Two way relation update would invalidate record ${T} in ${w}: ${x.message}`);
|
|
10520
10519
|
}
|
|
@@ -10626,7 +10625,7 @@ ${r}`);
|
|
|
10626
10625
|
}
|
|
10627
10626
|
}
|
|
10628
10627
|
}, fu = async (n, e, t, s, r, i, o) => {
|
|
10629
|
-
const a =
|
|
10628
|
+
const a = Et(), l = Ut();
|
|
10630
10629
|
let c = await Ge();
|
|
10631
10630
|
if (n.length === 0)
|
|
10632
10631
|
throw new Error("EMPTY_PATH");
|
|
@@ -10639,17 +10638,17 @@ ${r}`);
|
|
|
10639
10638
|
const x = Ie(p, n, a), g = o || x.doc().id;
|
|
10640
10639
|
i = i || {}, i.collection = m.collection, e.id = g, $o(e), er(e);
|
|
10641
10640
|
const k = Us("create", n, e, c, N, "Online", s || "System", at.now(), me.serverTimestamp()), _ = ye(k);
|
|
10642
|
-
w && (k[w.archivedField] = !1), Ve(e), y && await
|
|
10641
|
+
w && (k[w.archivedField] = !1), Ve(e), y && await Mt("create", "started", k, a, n, g, d), await ae("preOperation", l, b, ["create", k, g, i]), await ae("preWrite", l, b, ["create", k, g, i]), Sn(d, k, c), Tn(d, k), await ra(k, d, b, v), Ve(k);
|
|
10643
10642
|
try {
|
|
10644
10643
|
if (d.auth && t && !t.password)
|
|
10645
10644
|
throw new Error("Password is required");
|
|
10646
|
-
await Io("create", a, g, k, d, c), await
|
|
10645
|
+
await Io("create", a, g, k, d, c), await sn("create", k, d, b, ["create", k, i], c);
|
|
10647
10646
|
} catch (P) {
|
|
10648
10647
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
10649
10648
|
}
|
|
10650
10649
|
Ve(k), e.id = g, w && (k[w.archivedField] = !1), Sn(d, k, c), Tn(d, k);
|
|
10651
10650
|
try {
|
|
10652
|
-
Fo("create", k, _), Po("create", d, k), await
|
|
10651
|
+
Fo("create", k, _), Po("create", d, k), await sn("create", k, d, b, ["create", k, i], c);
|
|
10653
10652
|
} catch (P) {
|
|
10654
10653
|
throw new Error(`VALIDATION_ERROR: ${P.message}`);
|
|
10655
10654
|
}
|
|
@@ -10672,7 +10671,7 @@ ${r}`);
|
|
|
10672
10671
|
const [Q, S, q, B] = await Promise.all([
|
|
10673
10672
|
P.get(p.collection("system_deployment").doc("latest_deploy")),
|
|
10674
10673
|
P.get(p.collection("system_deployment").doc("maintenance_mode")),
|
|
10675
|
-
s ? P.get(p.collection("system_user_permissions").doc(s)) : Promise.resolve(Promise.resolve({})),
|
|
10674
|
+
s ? P.get(p.collection("tenants").doc(a).collection("system_user_permissions").doc(s)) : Promise.resolve(Promise.resolve({})),
|
|
10676
10675
|
Ge()
|
|
10677
10676
|
]);
|
|
10678
10677
|
if (j && (j.size += 3), !Q.exists)
|
|
@@ -10741,16 +10740,16 @@ ${r}`);
|
|
|
10741
10740
|
const Q = await ae("postWriteError", l, b, ["create", k, g, i, P]);
|
|
10742
10741
|
if (y && (await new Promise((S) => {
|
|
10743
10742
|
setTimeout(S, 250);
|
|
10744
|
-
}), await
|
|
10743
|
+
}), await Mt("create", Q?.resolved ? "success" : "failed", k, a, n, g, d, Q?.resolved ? void 0 : P)), !Q?.resolved)
|
|
10745
10744
|
throw d.auth && t && await un(k), P;
|
|
10746
10745
|
}
|
|
10747
10746
|
const R = ["create", k, g, i], F = [...R];
|
|
10748
10747
|
return await ae("postWrite", l, b, R), await ae("postOperation", l, b, F), { id: g, ...k };
|
|
10749
|
-
},
|
|
10750
|
-
const r =
|
|
10751
|
-
let
|
|
10748
|
+
}, Qt = async (n, e, t, s) => {
|
|
10749
|
+
const r = Et(), i = yt(), o = ue(), a = e.customClaims || {};
|
|
10750
|
+
let l = !1;
|
|
10752
10751
|
try {
|
|
10753
|
-
await
|
|
10752
|
+
await i.updateUser(n, {
|
|
10754
10753
|
email: e.email,
|
|
10755
10754
|
disabled: e.disabled,
|
|
10756
10755
|
displayName: e.displayName,
|
|
@@ -10758,27 +10757,27 @@ ${r}`);
|
|
|
10758
10757
|
emailVerified: !!e.emailVerified
|
|
10759
10758
|
});
|
|
10760
10759
|
} catch {
|
|
10761
|
-
|
|
10760
|
+
l = !0;
|
|
10762
10761
|
}
|
|
10763
10762
|
try {
|
|
10764
|
-
await
|
|
10765
|
-
...
|
|
10763
|
+
await i.setCustomUserClaims(n, {
|
|
10764
|
+
...a
|
|
10766
10765
|
});
|
|
10767
10766
|
} catch {
|
|
10768
|
-
|
|
10767
|
+
l = !0;
|
|
10769
10768
|
}
|
|
10770
10769
|
try {
|
|
10771
|
-
await
|
|
10770
|
+
await o.collection("tenants").doc(r).collection("system_user_permissions").doc(n).update({
|
|
10772
10771
|
...t,
|
|
10773
|
-
Collection:
|
|
10774
|
-
Doc_ID:
|
|
10775
|
-
Role:
|
|
10772
|
+
Collection: a.collection,
|
|
10773
|
+
Doc_ID: a.doc,
|
|
10774
|
+
Role: a.role,
|
|
10776
10775
|
Enabled: !e.disabled
|
|
10777
10776
|
});
|
|
10778
10777
|
} catch {
|
|
10779
|
-
|
|
10778
|
+
l = !0;
|
|
10780
10779
|
}
|
|
10781
|
-
if (
|
|
10780
|
+
if (l)
|
|
10782
10781
|
throw new Error(`ROLLBACK_FAILED: ${s}`);
|
|
10783
10782
|
}, jc = async (n, e, t, s, r, i, o, a, l, c, u) => {
|
|
10784
10783
|
const h = yt(), f = ue(), d = a?.customClaims || {}, m = "USER_ERROR";
|
|
@@ -10801,7 +10800,7 @@ ${r}`);
|
|
|
10801
10800
|
try {
|
|
10802
10801
|
await h.updateUser(o.User_ID, y), y.disabled === !0 && await h.revokeRefreshTokens(o.User_ID);
|
|
10803
10802
|
} catch {
|
|
10804
|
-
throw await
|
|
10803
|
+
throw await Qt(o.User_ID, a, c, m), new Error(m);
|
|
10805
10804
|
}
|
|
10806
10805
|
if (i.Role && i.Role !== o.Role)
|
|
10807
10806
|
try {
|
|
@@ -10810,19 +10809,18 @@ ${r}`);
|
|
|
10810
10809
|
role: i.Role
|
|
10811
10810
|
}), await h.revokeRefreshTokens(o.User_ID);
|
|
10812
10811
|
} catch {
|
|
10813
|
-
throw await
|
|
10812
|
+
throw await Qt(o.User_ID, a, c, m), new Error(m);
|
|
10814
10813
|
}
|
|
10815
10814
|
try {
|
|
10816
|
-
await f.collection("system_user_permissions").doc(o.User_ID).set({
|
|
10815
|
+
await f.collection("tenants").doc(e).collection("system_user_permissions").doc(o.User_ID).set({
|
|
10817
10816
|
...l || c,
|
|
10818
|
-
Tenant_ID: d.tenant,
|
|
10819
10817
|
Collection: d.collection,
|
|
10820
10818
|
Doc_ID: d.doc,
|
|
10821
10819
|
Role: i.Role,
|
|
10822
10820
|
Enabled: i.Enabled ?? o.Enabled ?? !1
|
|
10823
10821
|
});
|
|
10824
10822
|
} catch {
|
|
10825
|
-
throw await
|
|
10823
|
+
throw await Qt(o.User_ID, a, c, m), new Error(m);
|
|
10826
10824
|
}
|
|
10827
10825
|
if (o.Email !== i.Email) {
|
|
10828
10826
|
const w = s.auth.enableMultiFactorAuth;
|
|
@@ -10842,7 +10840,7 @@ ${r}`);
|
|
|
10842
10840
|
</br>
|
|
10843
10841
|
<a href="${N}">${N}</a>`);
|
|
10844
10842
|
} catch {
|
|
10845
|
-
throw await
|
|
10843
|
+
throw await Qt(o.User_ID, a, c, m), new Error(m);
|
|
10846
10844
|
}
|
|
10847
10845
|
}
|
|
10848
10846
|
}
|
|
@@ -10877,7 +10875,7 @@ ${r}`);
|
|
|
10877
10875
|
}
|
|
10878
10876
|
await r.commit();
|
|
10879
10877
|
}, zc = async (n, e, t, s, r, i, o) => {
|
|
10880
|
-
const a =
|
|
10878
|
+
const a = Et(), l = Ut();
|
|
10881
10879
|
let c = await Ge(!0);
|
|
10882
10880
|
if (n.length === 0)
|
|
10883
10881
|
throw new Error("EMPTY_PATH");
|
|
@@ -10916,7 +10914,7 @@ ${r}`);
|
|
|
10916
10914
|
const _ = Us("update", n, t, c, b, "Online", r || "System", at.now(), me.serverTimestamp()), A = ye(_);
|
|
10917
10915
|
for (const S of O)
|
|
10918
10916
|
!K(S) && Me(_[S.name]) && S.nullable && (_[S.name] = null);
|
|
10919
|
-
Ve(_), Ve(v), y && await
|
|
10917
|
+
Ve(_), Ve(v), y && await Mt("update", "started", _, a, n, e, d, void 0, v);
|
|
10920
10918
|
const E = [
|
|
10921
10919
|
"update",
|
|
10922
10920
|
_,
|
|
@@ -10932,7 +10930,7 @@ ${r}`);
|
|
|
10932
10930
|
if (Z && !s.password)
|
|
10933
10931
|
throw new Error("Password is required");
|
|
10934
10932
|
const S = { ...v, ..._ };
|
|
10935
|
-
await Io("update", a, e, S, d, c), tt(S), await
|
|
10933
|
+
await Io("update", a, e, S, d, c), tt(S), await sn("update", S, d, w, ["update", _, o, void 0, ye(v)], c);
|
|
10936
10934
|
} catch (S) {
|
|
10937
10935
|
throw new Error(`VALIDATION_ERROR: ${S.message}`);
|
|
10938
10936
|
}
|
|
@@ -10941,14 +10939,14 @@ ${r}`);
|
|
|
10941
10939
|
!K(S) && Me(_[S.name]) && S.nullable && (_[S.name] = null);
|
|
10942
10940
|
try {
|
|
10943
10941
|
const S = { ...v, ..._ };
|
|
10944
|
-
tt(S), Po("update", d, _, v), Fo("update", _, A), await
|
|
10942
|
+
tt(S), Po("update", d, _, v), Fo("update", _, A), await sn("update", S, d, w, ["update", _, o, void 0, v], c);
|
|
10945
10943
|
} catch (S) {
|
|
10946
10944
|
throw new Error(`VALIDATION_ERROR: ${S.message}`);
|
|
10947
10945
|
}
|
|
10948
10946
|
let R;
|
|
10949
10947
|
s && (s.permissions ||= {});
|
|
10950
10948
|
const F = async (S, q, B) => {
|
|
10951
|
-
const [re, Je,
|
|
10949
|
+
const [re, Je, Wt, pe, oe] = await Promise.all([
|
|
10952
10950
|
S.get(p.collection("system_deployment").doc("latest_deploy")),
|
|
10953
10951
|
S.get(p.collection("system_deployment").doc("maintenance_mode")),
|
|
10954
10952
|
ot(n, e, {
|
|
@@ -10956,7 +10954,7 @@ ${r}`);
|
|
|
10956
10954
|
providedTransaction: S,
|
|
10957
10955
|
noComputedFields: !0
|
|
10958
10956
|
}),
|
|
10959
|
-
r ? S.get(p.collection("system_user_permissions").doc(r)) : Promise.resolve(Promise.resolve({})),
|
|
10957
|
+
r ? S.get(p.collection("tenants").doc(a).collection("system_user_permissions").doc(r)) : Promise.resolve(Promise.resolve({})),
|
|
10960
10958
|
Ge()
|
|
10961
10959
|
]);
|
|
10962
10960
|
if (B && (B.size += 3), !re.exists)
|
|
@@ -10968,9 +10966,9 @@ ${r}`);
|
|
|
10968
10966
|
throw new Error("MAINTENANCE_MODE");
|
|
10969
10967
|
if (Je.data().active)
|
|
10970
10968
|
throw new Error("MAINTENANCE_MODE");
|
|
10971
|
-
if (!
|
|
10969
|
+
if (!Wt)
|
|
10972
10970
|
throw new Error("NOT_FOUND");
|
|
10973
|
-
if (v =
|
|
10971
|
+
if (v = Wt, c = oe, r) {
|
|
10974
10972
|
if (!pe?.exists)
|
|
10975
10973
|
throw new Error("PERMISSION_DENIED");
|
|
10976
10974
|
if (T = pe.data(), !T.Role)
|
|
@@ -10981,7 +10979,7 @@ ${r}`);
|
|
|
10981
10979
|
if (B && (B.size += To(a, n, e, c, T).length), Z && v.User_ID || x && !v.User_ID)
|
|
10982
10980
|
throw new Error("USER_ERROR");
|
|
10983
10981
|
if (k(v)) {
|
|
10984
|
-
const de = await S.get(p.collection("system_user_permissions").doc(v.User_ID));
|
|
10982
|
+
const de = await S.get(p.collection("tenants").doc(a).collection("system_user_permissions").doc(v.User_ID));
|
|
10985
10983
|
if (B && B.size++, !de?.exists)
|
|
10986
10984
|
throw new Error("PERMISSION_DENIED");
|
|
10987
10985
|
if (R = de.data(), s?.permissions) {
|
|
@@ -10995,17 +10993,17 @@ ${r}`);
|
|
|
10995
10993
|
if (!r || !de.access || de.access.includes(T.Role)) {
|
|
10996
10994
|
if (_[de.name] === void 0 || Me(_[de.name]))
|
|
10997
10995
|
return;
|
|
10998
|
-
const
|
|
10999
|
-
if (!(r &&
|
|
10996
|
+
const jt = De(de, w), nr = { ...v, ..._ };
|
|
10997
|
+
if (!(r && jt?.custom?.serverAccess?.read !== void 0 ? await ie(jt.custom.serverAccess.read, [
|
|
11000
10998
|
T?.Role,
|
|
11001
10999
|
nr
|
|
11002
11000
|
]) : !0))
|
|
11003
11001
|
throw new Error("PERMISSION_DENIED");
|
|
11004
|
-
const
|
|
11005
|
-
if (Qs(
|
|
11002
|
+
const Zt = _[de.name].toString().toLowerCase().replace(/\s/g, "---").replaceAll("/", "|||");
|
|
11003
|
+
if (Qs(Zt)) {
|
|
11006
11004
|
if (B && B.size++, B && B.size > 500)
|
|
11007
11005
|
throw new Error("VALIDATION_ERROR: The number of operations in the Firestore transaction has exceeded the limit of 500. This is likely due to a large number of unique field checks.");
|
|
11008
|
-
const Qn = await S.get(p.collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${de.name}`).doc(
|
|
11006
|
+
const Qn = await S.get(p.collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${de.name}`).doc(Zt));
|
|
11009
11007
|
if (Qn.exists && Qn.data().id !== e)
|
|
11010
11008
|
throw new Error(`VALIDATION_ERROR: ${de.name} "${_[de.name]}" already exists`);
|
|
11011
11009
|
} else
|
|
@@ -11013,14 +11011,14 @@ ${r}`);
|
|
|
11013
11011
|
}
|
|
11014
11012
|
});
|
|
11015
11013
|
if (await Promise.all(tr), r && T?.Role) {
|
|
11016
|
-
const de = T.Role,
|
|
11017
|
-
if (!(w.custom?.serverAccess?.update !== void 0 ? await ie(w.custom.serverAccess.update, [de,
|
|
11014
|
+
const de = T.Role, jt = { ...v, ..._ };
|
|
11015
|
+
if (!(w.custom?.serverAccess?.update !== void 0 ? await ie(w.custom.serverAccess.update, [de, jt, v]) : !0))
|
|
11018
11016
|
throw new Error("PERMISSION_DENIED");
|
|
11019
11017
|
for (const Jn of d.fields) {
|
|
11020
|
-
const
|
|
11021
|
-
if (Object.prototype.hasOwnProperty.call(_, Jn.name) &&
|
|
11018
|
+
const Zt = De(Jn, w);
|
|
11019
|
+
if (Object.prototype.hasOwnProperty.call(_, Jn.name) && Zt?.custom?.serverAccess?.update !== void 0 && !await ie(Zt.custom.serverAccess.update, [
|
|
11022
11020
|
de,
|
|
11023
|
-
|
|
11021
|
+
jt,
|
|
11024
11022
|
v
|
|
11025
11023
|
]))
|
|
11026
11024
|
throw new Error("PERMISSION_DENIED");
|
|
@@ -11052,8 +11050,8 @@ ${r}`);
|
|
|
11052
11050
|
await F(B, !1, q);
|
|
11053
11051
|
let Je;
|
|
11054
11052
|
i?.noTwoWay || (Je = await Mo("Update", a, e, re, _, d, c, B, q, r, T, v));
|
|
11055
|
-
const
|
|
11056
|
-
Js("update", B, n, e, _, c, d, i,
|
|
11053
|
+
const Wt = Vs(c);
|
|
11054
|
+
Js("update", B, n, e, _, c, d, i, Wt, me.arrayUnion, me.arrayRemove, me.delete, (pe) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${pe.name}`).doc(e), (pe, oe) => p.collection("tenants").doc(a).collection("system_unique").doc(m.collection).collection(`Unique-${m.collection}-${pe.name}`).doc(oe), (pe) => p.collection("tenants").doc(a).collection("system_fields").doc(m.collection).collection(`${m.collection}-${pe}`).doc(e), (pe, oe) => Ie(p, pe, a).doc(oe), (pe, oe, Le) => p.collection("tenants").doc(a).collection("system_fields").doc(pe.collection).collection(`${pe.collection}-${oe}`).doc(Le), (pe, oe, Le) => p.collection("tenants").doc(a).collection("system_fields").doc(pe.collection).collection(`${pe.collection}-${oe.replaceAll(" ", "-")}`).doc(Le), v, Je, q), B.update(C.doc(e), _);
|
|
11057
11055
|
}, { maxAttempts: 10 });
|
|
11058
11056
|
} catch (q) {
|
|
11059
11057
|
const B = [
|
|
@@ -11068,8 +11066,8 @@ ${r}`);
|
|
|
11068
11066
|
], re = await ae("postWriteError", l, w, B);
|
|
11069
11067
|
if (y && (await new Promise((Je) => {
|
|
11070
11068
|
setTimeout(Je, 250);
|
|
11071
|
-
}), await
|
|
11072
|
-
throw Z && await un(v), k(v) && await
|
|
11069
|
+
}), await Mt("update", re?.resolved ? "success" : "failed", _, a, n, e, d, re?.resolved ? void 0 : q, v)), !re?.resolved)
|
|
11070
|
+
throw Z && await un(v), k(v) && await Qt(v.User_ID, S, R, "USER_ERROR"), x && await p.collection(m.collection).doc(e).update({ User_ID: me.delete() }), q;
|
|
11073
11071
|
}
|
|
11074
11072
|
(Z || k(v) || x) && await Jr(Xr, [e, v.User_ID]).catch(() => {
|
|
11075
11073
|
throw new Error("USER_ERROR");
|
|
@@ -11084,7 +11082,7 @@ ${r}`);
|
|
|
11084
11082
|
const j = { ...v, ..._ };
|
|
11085
11083
|
return tt(j), { id: e, ...j };
|
|
11086
11084
|
}, hu = async (n, e, t, s, r) => {
|
|
11087
|
-
const i =
|
|
11085
|
+
const i = Et(), o = Ut();
|
|
11088
11086
|
let a = await Ge();
|
|
11089
11087
|
if (n.length === 0)
|
|
11090
11088
|
throw new Error("EMPTY_PATH");
|
|
@@ -11102,12 +11100,12 @@ ${r}`);
|
|
|
11102
11100
|
const T = await ot(n, e, { user: t });
|
|
11103
11101
|
let C = Us("delete", n, T, a, w, "Online", t || "System", at.now(), me.serverTimestamp());
|
|
11104
11102
|
const v = bn(C);
|
|
11105
|
-
Ve(C), m && await
|
|
11103
|
+
Ve(C), m && await Mt("delete", "started", C, i, n, e, h), await ae("preOperation", o, y, ["delete", C, e, r]), await ae("preWrite", o, y, ["delete", C, e, r]), Ve(C);
|
|
11106
11104
|
const g = async (E) => {
|
|
11107
11105
|
const [I, R, F, M] = await Promise.all([
|
|
11108
11106
|
E.get(b.collection("system_deployment").doc("maintenance_mode")),
|
|
11109
11107
|
ot([f.collection], e, { user: t, providedTransaction: E }),
|
|
11110
|
-
t ? E.get(b.collection("system_user_permissions").doc(t)) : Promise.resolve(Promise.resolve({})),
|
|
11108
|
+
t ? E.get(b.collection("tenants").doc(i).collection("system_user_permissions").doc(t)) : Promise.resolve(Promise.resolve({})),
|
|
11111
11109
|
Ge()
|
|
11112
11110
|
]);
|
|
11113
11111
|
if (!I.exists)
|
|
@@ -11144,7 +11142,7 @@ ${r}`);
|
|
|
11144
11142
|
const R = await ae("postWriteError", o, y, ["delete", C, e, r, E]);
|
|
11145
11143
|
if (m && (await new Promise((F) => {
|
|
11146
11144
|
setTimeout(F, 250);
|
|
11147
|
-
}), await
|
|
11145
|
+
}), await Mt("delete", R?.resolved ? "success" : "failed", C, i, n, e, h, R?.resolved ? void 0 : E)), !R?.resolved)
|
|
11148
11146
|
throw h.auth && C.User_ID && await b.collection(f.collection).doc(e).update({ User_ID: me.delete() }), E;
|
|
11149
11147
|
}
|
|
11150
11148
|
const k = ["delete", C, e, r], _ = [...k];
|
|
@@ -11218,5 +11216,5 @@ export {
|
|
|
11218
11216
|
jc as updateUser,
|
|
11219
11217
|
Mo as validateRelations,
|
|
11220
11218
|
Po as validateSoftDelete,
|
|
11221
|
-
|
|
11219
|
+
Mt as writeLog
|
|
11222
11220
|
};
|