@stoker-platform/node-client 0.5.96 → 0.5.97
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 +5 -5
- package/dist/bundle.js +79 -71
- package/package.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -479,9 +479,9 @@ const Qn = (t) => !!t && !Array.isArray(t), an = (t, e) => t.access ? Qn(t.acces
|
|
|
479
479
|
}
|
|
480
480
|
if (!p)
|
|
481
481
|
throw new Error("PERMISSION_DENIED");
|
|
482
|
-
},
|
|
482
|
+
}, Re = (t) => t && (t._methodName === "deleteField" || t.constructor.name === "DeleteTransform"), Qe = (t) => {
|
|
483
483
|
for (const e in t)
|
|
484
|
-
Object.prototype.hasOwnProperty.call(t, e) && (
|
|
484
|
+
Object.prototype.hasOwnProperty.call(t, e) && (Re(t[e]) ? delete t[e] : typeof t[e] == "object" && t[e] !== null && Qe(t[e]));
|
|
485
485
|
}, yr = (t, e, n, s, r, i, o, a, l, c, d) => {
|
|
486
486
|
const { labels: p, fields: u } = s, f = o?.collections?.[p.collection], g = { ...e, ...t };
|
|
487
487
|
Qe(g);
|
|
@@ -902,7 +902,7 @@ const Js = (t, e, n, s, r, i, o, a, l, c) => (t === "create" && (n.Collection_Pa
|
|
|
902
902
|
s.forEach((i) => {
|
|
903
903
|
if (X(i))
|
|
904
904
|
if (e[i.name]) {
|
|
905
|
-
if (
|
|
905
|
+
if (Re(e[i.name]))
|
|
906
906
|
e[`${i.name}_Array`] = e[i.name];
|
|
907
907
|
else if (Object.keys(e[i.name]).forEach((o) => {
|
|
908
908
|
const a = e[i.name][o];
|
|
@@ -918,7 +918,7 @@ const Js = (t, e, n, s, r, i, o, a, l, c) => (t === "create" && (n.Collection_Pa
|
|
|
918
918
|
delete e[`${i.name}_Array`], delete e[`${i.name}_Single`];
|
|
919
919
|
}), wt(t, s).forEach((i) => {
|
|
920
920
|
if (e[i.name])
|
|
921
|
-
if (
|
|
921
|
+
if (Re(e[i.name]))
|
|
922
922
|
e[`${i.name}_Single`] = e[i.name];
|
|
923
923
|
else {
|
|
924
924
|
const o = e[`${i.name}_Array`]?.[0];
|
|
@@ -1209,7 +1209,7 @@ function P(t, e) {
|
|
|
1209
1209
|
});
|
|
1210
1210
|
t.common.issues.push(s);
|
|
1211
1211
|
}
|
|
1212
|
-
class
|
|
1212
|
+
class Se {
|
|
1213
1213
|
constructor() {
|
|
1214
1214
|
this.value = "valid";
|
|
1215
1215
|
}
|
|
@@ -1237,7 +1237,7 @@ class Re {
|
|
|
1237
1237
|
value: o
|
|
1238
1238
|
});
|
|
1239
1239
|
}
|
|
1240
|
-
return
|
|
1240
|
+
return Se.mergeObjectSync(e, s);
|
|
1241
1241
|
}
|
|
1242
1242
|
static mergeObjectSync(e, n) {
|
|
1243
1243
|
const s = {};
|
|
@@ -1310,7 +1310,7 @@ class te {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
_processInputParams(e) {
|
|
1312
1312
|
return {
|
|
1313
|
-
status: new
|
|
1313
|
+
status: new Se(),
|
|
1314
1314
|
ctx: {
|
|
1315
1315
|
common: e.parent.common,
|
|
1316
1316
|
data: e.data,
|
|
@@ -1555,7 +1555,7 @@ class Ke extends te {
|
|
|
1555
1555
|
received: i.parsedType
|
|
1556
1556
|
}), J;
|
|
1557
1557
|
}
|
|
1558
|
-
const s = new
|
|
1558
|
+
const s = new Se();
|
|
1559
1559
|
let r;
|
|
1560
1560
|
for (const i of this._def.checks)
|
|
1561
1561
|
if (i.kind === "min")
|
|
@@ -1946,7 +1946,7 @@ class Mt extends te {
|
|
|
1946
1946
|
}), J;
|
|
1947
1947
|
}
|
|
1948
1948
|
let s;
|
|
1949
|
-
const r = new
|
|
1949
|
+
const r = new Se();
|
|
1950
1950
|
for (const i of this._def.checks)
|
|
1951
1951
|
i.kind === "int" ? se.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), P(s, {
|
|
1952
1952
|
code: A.invalid_type,
|
|
@@ -2118,7 +2118,7 @@ class ln extends te {
|
|
|
2118
2118
|
if (this._getType(e) !== W.bigint)
|
|
2119
2119
|
return this._getInvalidInput(e);
|
|
2120
2120
|
let s;
|
|
2121
|
-
const r = new
|
|
2121
|
+
const r = new Se();
|
|
2122
2122
|
for (const i of this._def.checks)
|
|
2123
2123
|
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (s = this._getOrReturnCtx(e, s), P(s, {
|
|
2124
2124
|
code: A.too_small,
|
|
@@ -2271,7 +2271,7 @@ class Ln extends te {
|
|
|
2271
2271
|
code: A.invalid_date
|
|
2272
2272
|
}), J;
|
|
2273
2273
|
}
|
|
2274
|
-
const s = new
|
|
2274
|
+
const s = new Se();
|
|
2275
2275
|
let r;
|
|
2276
2276
|
for (const i of this._def.checks)
|
|
2277
2277
|
i.kind === "min" ? e.data.getTime() < i.value && (r = this._getOrReturnCtx(e, r), P(r, {
|
|
@@ -2475,9 +2475,9 @@ class ze extends te {
|
|
|
2475
2475
|
exact: !1,
|
|
2476
2476
|
message: r.maxLength.message
|
|
2477
2477
|
}), s.dirty()), n.common.async)
|
|
2478
|
-
return Promise.all([...n.data].map((o, a) => r.type._parseAsync(new He(n, o, n.path, a)))).then((o) =>
|
|
2478
|
+
return Promise.all([...n.data].map((o, a) => r.type._parseAsync(new He(n, o, n.path, a)))).then((o) => Se.mergeArray(s, o));
|
|
2479
2479
|
const i = [...n.data].map((o, a) => r.type._parseSync(new He(n, o, n.path, a)));
|
|
2480
|
-
return
|
|
2480
|
+
return Se.mergeArray(s, i);
|
|
2481
2481
|
}
|
|
2482
2482
|
get element() {
|
|
2483
2483
|
return this._def.type;
|
|
@@ -2599,7 +2599,7 @@ class fe extends te {
|
|
|
2599
2599
|
});
|
|
2600
2600
|
}
|
|
2601
2601
|
return c;
|
|
2602
|
-
}).then((c) =>
|
|
2602
|
+
}).then((c) => Se.mergeObjectSync(s, c)) : Se.mergeObjectSync(s, l);
|
|
2603
2603
|
}
|
|
2604
2604
|
get shape() {
|
|
2605
2605
|
return this._def.shape();
|
|
@@ -2980,7 +2980,7 @@ class Ot extends te {
|
|
|
2980
2980
|
const l = this._def.items[a] || this._def.rest;
|
|
2981
2981
|
return l ? l._parse(new He(s, o, s.path, a)) : null;
|
|
2982
2982
|
}).filter((o) => !!o);
|
|
2983
|
-
return s.common.async ? Promise.all(i).then((o) =>
|
|
2983
|
+
return s.common.async ? Promise.all(i).then((o) => Se.mergeArray(n, o)) : Se.mergeArray(n, i);
|
|
2984
2984
|
}
|
|
2985
2985
|
get items() {
|
|
2986
2986
|
return this._def.items;
|
|
@@ -3024,7 +3024,7 @@ class Wn extends te {
|
|
|
3024
3024
|
value: o._parse(new He(s, s.data[a], s.path, a)),
|
|
3025
3025
|
alwaysSet: a in s.data
|
|
3026
3026
|
});
|
|
3027
|
-
return s.common.async ?
|
|
3027
|
+
return s.common.async ? Se.mergeObjectAsync(n, r) : Se.mergeObjectSync(n, r);
|
|
3028
3028
|
}
|
|
3029
3029
|
get element() {
|
|
3030
3030
|
return this._def.valueType;
|
|
@@ -3577,10 +3577,10 @@ var Y;
|
|
|
3577
3577
|
})(Y || (Y = {}));
|
|
3578
3578
|
const Ie = Ke.create, Et = Mt.create, rn = Rs.create, cs = Ts.create, Ee = Ss.create;
|
|
3579
3579
|
ft.create;
|
|
3580
|
-
const Rt = ze.create, qe = fe.create,
|
|
3580
|
+
const Rt = ze.create, qe = fe.create, be = Vn.create;
|
|
3581
3581
|
Un.create;
|
|
3582
3582
|
Ot.create;
|
|
3583
|
-
const hn = Wn.create,
|
|
3583
|
+
const hn = Wn.create, Oe = xs.create, Zn = Pt.create;
|
|
3584
3584
|
jn.create;
|
|
3585
3585
|
ct.create;
|
|
3586
3586
|
Vt.create;
|
|
@@ -3610,7 +3610,7 @@ const In = () => Ee().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
|
|
|
3610
3610
|
let n = hn(Ii(t, e));
|
|
3611
3611
|
return t.required || (n = n.optional()), n;
|
|
3612
3612
|
}, Ya = (t) => {
|
|
3613
|
-
let e = Rt(
|
|
3613
|
+
let e = Rt(be([Ie().length(20), Ie().length(28)]));
|
|
3614
3614
|
return ["OneToOne", "OneToMany"].includes(t.type) ? e = e.max(1) : (t.min && (e = e.min(t.min)), t.max && (e = e.max(t.max)), t.length && (e = e.length(t.length))), t.required ? e = e.nonempty() : e = e.optional(), e;
|
|
3615
3615
|
}, zn = (t, e, n) => {
|
|
3616
3616
|
const { softDelete: s } = t, r = s?.timestampField;
|
|
@@ -3628,7 +3628,7 @@ const In = () => Ee().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
|
|
|
3628
3628
|
i = rn();
|
|
3629
3629
|
break;
|
|
3630
3630
|
case "Number":
|
|
3631
|
-
e.autoIncrement ? i =
|
|
3631
|
+
e.autoIncrement ? i = be([Oe("Pending"), Et().int()]) : (i = Et(), 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, {
|
|
3632
3632
|
message: `Value must have ${e.decimal} or fewer decimal places`
|
|
3633
3633
|
}) : i = i.int(), e.values && (i = i.refine((o) => e.values?.includes(o), {
|
|
3634
3634
|
message: "Value is not an allowed value"
|
|
@@ -3667,12 +3667,12 @@ const In = () => Ee().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
|
|
|
3667
3667
|
Last_Write_App: Ie(),
|
|
3668
3668
|
Last_Write_At: In(),
|
|
3669
3669
|
Last_Save_At: xr(),
|
|
3670
|
-
Last_Write_By:
|
|
3670
|
+
Last_Write_By: be([Ie().length(28), Oe("System")]),
|
|
3671
3671
|
Last_Write_Connection_Status: Zn(["Online", "Offline"]),
|
|
3672
3672
|
Last_Write_Version: Et().int(),
|
|
3673
3673
|
id: Ie().regex(new RegExp("^[a-zA-Z0-9]+$")).length(20),
|
|
3674
3674
|
Created_At: In(),
|
|
3675
|
-
Created_By:
|
|
3675
|
+
Created_By: be([Ie().length(28), Oe("System")])
|
|
3676
3676
|
};
|
|
3677
3677
|
t === "create" && (s.Saved_At = xr()), t === "update" && (s.Saved_At = In(), 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());
|
|
3678
3678
|
const r = wt(e, e.fields), i = Array.from(r).map((l) => l.name);
|
|
@@ -4435,13 +4435,13 @@ class ie {
|
|
|
4435
4435
|
}
|
|
4436
4436
|
}
|
|
4437
4437
|
let fs = null;
|
|
4438
|
-
class
|
|
4438
|
+
class Te extends mn {
|
|
4439
4439
|
/**
|
|
4440
4440
|
* Get a singleton instance of UTC
|
|
4441
4441
|
* @return {FixedOffsetZone}
|
|
4442
4442
|
*/
|
|
4443
4443
|
static get utcInstance() {
|
|
4444
|
-
return fs === null && (fs = new
|
|
4444
|
+
return fs === null && (fs = new Te(0)), fs;
|
|
4445
4445
|
}
|
|
4446
4446
|
/**
|
|
4447
4447
|
* Get an instance with a specified offset
|
|
@@ -4449,7 +4449,7 @@ class be extends mn {
|
|
|
4449
4449
|
* @return {FixedOffsetZone}
|
|
4450
4450
|
*/
|
|
4451
4451
|
static instance(e) {
|
|
4452
|
-
return e === 0 ?
|
|
4452
|
+
return e === 0 ? Te.utcInstance : new Te(e);
|
|
4453
4453
|
}
|
|
4454
4454
|
/**
|
|
4455
4455
|
* Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6"
|
|
@@ -4463,7 +4463,7 @@ class be extends mn {
|
|
|
4463
4463
|
if (e) {
|
|
4464
4464
|
const n = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
|
|
4465
4465
|
if (n)
|
|
4466
|
-
return new
|
|
4466
|
+
return new Te(ss(n[1], n[2]));
|
|
4467
4467
|
}
|
|
4468
4468
|
return null;
|
|
4469
4469
|
}
|
|
@@ -4598,8 +4598,8 @@ function at(t, e) {
|
|
|
4598
4598
|
return t;
|
|
4599
4599
|
if (Rl(t)) {
|
|
4600
4600
|
const n = t.toLowerCase();
|
|
4601
|
-
return n === "default" ? e : n === "local" || n === "system" ? es.instance : n === "utc" || n === "gmt" ?
|
|
4602
|
-
} else return ut(t) ?
|
|
4601
|
+
return n === "default" ? e : n === "local" || n === "system" ? es.instance : n === "utc" || n === "gmt" ? Te.utcInstance : Te.parseSpecifier(n) || tt.create(t);
|
|
4602
|
+
} else return ut(t) ? Te.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new _l(t);
|
|
4603
4603
|
}
|
|
4604
4604
|
const Ks = {
|
|
4605
4605
|
arab: "[٠-٩]",
|
|
@@ -5224,9 +5224,9 @@ const Wl = {
|
|
|
5224
5224
|
FFF: Bi,
|
|
5225
5225
|
FFFF: Gi
|
|
5226
5226
|
};
|
|
5227
|
-
class
|
|
5227
|
+
class ke {
|
|
5228
5228
|
static create(e, n = {}) {
|
|
5229
|
-
return new
|
|
5229
|
+
return new ke(e, n);
|
|
5230
5230
|
}
|
|
5231
5231
|
static parseFormat(e) {
|
|
5232
5232
|
let n = null, s = "", r = !1;
|
|
@@ -5275,7 +5275,7 @@ class Oe {
|
|
|
5275
5275
|
g ? { weekday: f } : { weekday: f, month: "long", day: "numeric" },
|
|
5276
5276
|
"weekday"
|
|
5277
5277
|
), d = (f) => {
|
|
5278
|
-
const g =
|
|
5278
|
+
const g = ke.macroTokenToFormatOpts(f);
|
|
5279
5279
|
return g ? this.formatWithSystemDefault(e, g) : f;
|
|
5280
5280
|
}, p = (f) => s ? Vl(e, f) : i({ era: f }, "era"), u = (f) => {
|
|
5281
5281
|
switch (f) {
|
|
@@ -5420,7 +5420,7 @@ class Oe {
|
|
|
5420
5420
|
return d(f);
|
|
5421
5421
|
}
|
|
5422
5422
|
};
|
|
5423
|
-
return qr(
|
|
5423
|
+
return qr(ke.parseFormat(n), u);
|
|
5424
5424
|
}
|
|
5425
5425
|
formatDurationFromString(e, n) {
|
|
5426
5426
|
const s = this.opts.signMode === "negativeLargestOnly" ? -1 : 1, r = (d) => {
|
|
@@ -5452,7 +5452,7 @@ class Oe {
|
|
|
5452
5452
|
return this.opts.signMode === "negativeLargestOnly" && f !== p.largestUnit ? k = "never" : this.opts.signMode === "all" ? k = "always" : k = "auto", this.num(d.get(f) * g, u.length, k);
|
|
5453
5453
|
} else
|
|
5454
5454
|
return u;
|
|
5455
|
-
}, o =
|
|
5455
|
+
}, o = ke.parseFormat(n), a = o.reduce(
|
|
5456
5456
|
(d, { literal: p, val: u }) => p ? d : d.concat(u),
|
|
5457
5457
|
[]
|
|
5458
5458
|
), l = e.shiftTo(...a.map(r).filter((d) => d)), c = {
|
|
@@ -5520,7 +5520,7 @@ function qt(t, e) {
|
|
|
5520
5520
|
}, null, e + 4];
|
|
5521
5521
|
}
|
|
5522
5522
|
function yn(t, e) {
|
|
5523
|
-
const n = !t[e] && !t[e + 1], s = ss(t[e + 1], t[e + 2]), r = n ? null :
|
|
5523
|
+
const n = !t[e] && !t[e + 1], s = ss(t[e + 1], t[e + 2]), r = n ? null : Te.instance(s);
|
|
5524
5524
|
return [{}, r, e + 3];
|
|
5525
5525
|
}
|
|
5526
5526
|
function gn(t, e) {
|
|
@@ -5581,7 +5581,7 @@ function nc(t) {
|
|
|
5581
5581
|
p
|
|
5582
5582
|
] = t, u = ir(e, r, s, n, i, o, a);
|
|
5583
5583
|
let f;
|
|
5584
|
-
return l ? f = ec[l] : c ? f = 0 : f = ss(d, p), [u, new
|
|
5584
|
+
return l ? f = ec[l] : c ? f = 0 : f = ss(d, p), [u, new Te(f)];
|
|
5585
5585
|
}
|
|
5586
5586
|
function sc(t) {
|
|
5587
5587
|
return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
@@ -5589,11 +5589,11 @@ function sc(t) {
|
|
|
5589
5589
|
const rc = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, ic = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, oc = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
5590
5590
|
function Br(t) {
|
|
5591
5591
|
const [, e, n, s, r, i, o, a] = t;
|
|
5592
|
-
return [ir(e, r, s, n, i, o, a),
|
|
5592
|
+
return [ir(e, r, s, n, i, o, a), Te.utcInstance];
|
|
5593
5593
|
}
|
|
5594
5594
|
function ac(t) {
|
|
5595
5595
|
const [, e, n, s, r, i, o, a] = t;
|
|
5596
|
-
return [ir(e, a, n, s, r, i, o),
|
|
5596
|
+
return [ir(e, a, n, s, r, i, o), Te.utcInstance];
|
|
5597
5597
|
}
|
|
5598
5598
|
const lc = jt(Zl, rr), cc = jt(zl, rr), uc = jt(ql, rr), dc = jt(wo), Eo = Zt(
|
|
5599
5599
|
Jl,
|
|
@@ -5988,7 +5988,7 @@ class ne {
|
|
|
5988
5988
|
...n,
|
|
5989
5989
|
floor: n.round !== !1 && n.floor !== !1
|
|
5990
5990
|
};
|
|
5991
|
-
return this.isValid ?
|
|
5991
|
+
return this.isValid ? ke.create(this.loc, s).formatDurationFromString(this, e) : Hr;
|
|
5992
5992
|
}
|
|
5993
5993
|
/**
|
|
5994
5994
|
* Returns a string representation of a Duration with all units included.
|
|
@@ -6774,7 +6774,7 @@ class ce {
|
|
|
6774
6774
|
* @return {string}
|
|
6775
6775
|
*/
|
|
6776
6776
|
toLocaleString(e = qn, n = {}) {
|
|
6777
|
-
return this.isValid ?
|
|
6777
|
+
return this.isValid ? ke.create(this.s.loc.clone(n), e).formatInterval(this) : It;
|
|
6778
6778
|
}
|
|
6779
6779
|
/**
|
|
6780
6780
|
* Returns an ISO 8601-compliant string representation of this Interval.
|
|
@@ -7312,7 +7312,7 @@ function Uc(t) {
|
|
|
7312
7312
|
}
|
|
7313
7313
|
};
|
|
7314
7314
|
let n = null, s;
|
|
7315
|
-
return G(t.z) || (n = tt.create(t.z)), G(t.Z) || (n || (n = new
|
|
7315
|
+
return G(t.z) || (n = tt.create(t.z)), G(t.Z) || (n || (n = new Te(t.Z)), s = t.Z), G(t.q) || (t.M = (t.q - 1) * 3 + 1), G(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), G(t.u) || (t.S = tr(t.u)), [Object.keys(t).reduce((i, o) => {
|
|
7316
7316
|
const a = e(o);
|
|
7317
7317
|
return a && (i[a] = t[o]), i;
|
|
7318
7318
|
}, {}), n, s];
|
|
@@ -7324,7 +7324,7 @@ function Wc() {
|
|
|
7324
7324
|
function jc(t, e) {
|
|
7325
7325
|
if (t.literal)
|
|
7326
7326
|
return t;
|
|
7327
|
-
const n =
|
|
7327
|
+
const n = ke.macroTokenToFormatOpts(t.val), s = Io(n, e);
|
|
7328
7328
|
return s == null || s.includes(void 0) ? t : s;
|
|
7329
7329
|
}
|
|
7330
7330
|
function Ro(t, e) {
|
|
@@ -7332,7 +7332,7 @@ function Ro(t, e) {
|
|
|
7332
7332
|
}
|
|
7333
7333
|
class To {
|
|
7334
7334
|
constructor(e, n) {
|
|
7335
|
-
if (this.locale = e, this.format = n, this.tokens = Ro(
|
|
7335
|
+
if (this.locale = e, this.format = n, this.tokens = Ro(ke.parseFormat(n), e), this.units = this.tokens.map((s) => $c(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
|
|
7336
7336
|
const [s, r] = Lc(this.units);
|
|
7337
7337
|
this.regex = RegExp(s, "i"), this.handlers = r;
|
|
7338
7338
|
}
|
|
@@ -7374,7 +7374,7 @@ function Zc(t, e, n) {
|
|
|
7374
7374
|
function Io(t, e) {
|
|
7375
7375
|
if (!t)
|
|
7376
7376
|
return null;
|
|
7377
|
-
const s =
|
|
7377
|
+
const s = ke.create(e, t).dtFormatter(Wc()), r = s.formatToParts(), i = s.resolvedOptions();
|
|
7378
7378
|
return r.map((o) => Pc(o, t, i));
|
|
7379
7379
|
}
|
|
7380
7380
|
const ps = "Invalid DateTime", Xr = 864e13;
|
|
@@ -7462,7 +7462,7 @@ function xt(t, e, n, s, r, i) {
|
|
|
7462
7462
|
);
|
|
7463
7463
|
}
|
|
7464
7464
|
function Tn(t, e, n = !0) {
|
|
7465
|
-
return t.isValid ?
|
|
7465
|
+
return t.isValid ? ke.create(ie.create("en-US"), {
|
|
7466
7466
|
allowZ: n,
|
|
7467
7467
|
forceSimple: !0
|
|
7468
7468
|
}).formatDateTimeFromString(t, e) : null;
|
|
@@ -7696,7 +7696,7 @@ class V {
|
|
|
7696
7696
|
*/
|
|
7697
7697
|
static utc() {
|
|
7698
7698
|
const [e, n] = ii(arguments), [s, r, i, o, a, l, c] = n;
|
|
7699
|
-
return e.zone =
|
|
7699
|
+
return e.zone = Te.utcInstance, si({ year: s, month: r, day: i, hour: o, minute: a, second: l, millisecond: c }, e);
|
|
7700
7700
|
}
|
|
7701
7701
|
/**
|
|
7702
7702
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -7980,7 +7980,7 @@ class V {
|
|
|
7980
7980
|
* @returns {string}
|
|
7981
7981
|
*/
|
|
7982
7982
|
static expandFormat(e, n = {}) {
|
|
7983
|
-
return Ro(
|
|
7983
|
+
return Ro(ke.parseFormat(e), ie.fromObject(n)).map((r) => r.val).join("");
|
|
7984
7984
|
}
|
|
7985
7985
|
static resetCache() {
|
|
7986
7986
|
en = void 0, Zs.clear();
|
|
@@ -8344,7 +8344,7 @@ class V {
|
|
|
8344
8344
|
* @return {Object}
|
|
8345
8345
|
*/
|
|
8346
8346
|
resolvedLocaleOptions(e = {}) {
|
|
8347
|
-
const { locale: n, numberingSystem: s, calendar: r } =
|
|
8347
|
+
const { locale: n, numberingSystem: s, calendar: r } = ke.create(
|
|
8348
8348
|
this.loc.clone(e),
|
|
8349
8349
|
e
|
|
8350
8350
|
).resolvedOptions(this);
|
|
@@ -8360,7 +8360,7 @@ class V {
|
|
|
8360
8360
|
* @return {DateTime}
|
|
8361
8361
|
*/
|
|
8362
8362
|
toUTC(e = 0, n = {}) {
|
|
8363
|
-
return this.setZone(
|
|
8363
|
+
return this.setZone(Te.instance(e), n);
|
|
8364
8364
|
}
|
|
8365
8365
|
/**
|
|
8366
8366
|
* "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.
|
|
@@ -8550,7 +8550,7 @@ class V {
|
|
|
8550
8550
|
* @return {string}
|
|
8551
8551
|
*/
|
|
8552
8552
|
toFormat(e, n = {}) {
|
|
8553
|
-
return this.isValid ?
|
|
8553
|
+
return this.isValid ? ke.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this, e) : ps;
|
|
8554
8554
|
}
|
|
8555
8555
|
/**
|
|
8556
8556
|
* Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
|
|
@@ -8572,7 +8572,7 @@ class V {
|
|
|
8572
8572
|
* @return {string}
|
|
8573
8573
|
*/
|
|
8574
8574
|
toLocaleString(e = qn, n = {}) {
|
|
8575
|
-
return this.isValid ?
|
|
8575
|
+
return this.isValid ? ke.create(this.loc.clone(n), e).formatDateTime(this) : ps;
|
|
8576
8576
|
}
|
|
8577
8577
|
/**
|
|
8578
8578
|
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
|
|
@@ -8588,7 +8588,7 @@ class V {
|
|
|
8588
8588
|
* //=> ]
|
|
8589
8589
|
*/
|
|
8590
8590
|
toLocaleParts(e = {}) {
|
|
8591
|
-
return this.isValid ?
|
|
8591
|
+
return this.isValid ? ke.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
|
|
8592
8592
|
}
|
|
8593
8593
|
/**
|
|
8594
8594
|
* Returns an ISO 8601-compliant string representation of this DateTime
|
|
@@ -9238,9 +9238,17 @@ const Yc = (t, e) => {
|
|
|
9238
9238
|
}
|
|
9239
9239
|
switch (t.type) {
|
|
9240
9240
|
case "String":
|
|
9241
|
-
s = Ie(), t.length && (s = s.length(t.length, `Must be ${t.length} character(s) long`)), t.minlength && (s = s.min(t.minlength, `Must contain at least ${t.minlength} character(s)`)), t.maxlength && (s = s.max(t.maxlength, `Must contain at most ${t.maxlength} character(s)`)), t.email ? s = s.email("Must be a valid email address") : t.uuid ? s =
|
|
9242
|
-
|
|
9243
|
-
|
|
9241
|
+
s = Ie(), t.length && (s = s.length(t.length, `Must be ${t.length} character(s) long`)), t.minlength && (s = s.min(t.minlength, `Must contain at least ${t.minlength} character(s)`)), t.maxlength && (s = s.max(t.maxlength, `Must contain at most ${t.maxlength} character(s)`)), t.email ? s = s.email("Must be a valid email address") : t.uuid ? s = be([s.uuid("Must be a valid UUID"), Oe("")]) : t.url ? s = be([s.url("Must be a valid URL"), Oe("")]) : t.emoji ? s = be([s.emoji("Must be a valid emoji"), Oe("")]) : t.ip ? s = be([s.ip("Must be a valid IP address"), Oe("")]) : t.pattern && (!n && a ? s = be(
|
|
9242
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
9243
|
+
[s.regex(new RegExp(t.pattern)), s.regex(/^blob:/), Oe("")],
|
|
9244
|
+
{
|
|
9245
|
+
message: "Must be a valid value"
|
|
9246
|
+
}
|
|
9247
|
+
) : s = be([
|
|
9248
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
9249
|
+
s.regex(new RegExp(t.pattern), "Must be a valid value"),
|
|
9250
|
+
Oe("")
|
|
9251
|
+
])), t.values && (s = be([
|
|
9244
9252
|
Zn(t.values, {
|
|
9245
9253
|
message: `Must be one of the following values: ${t.values.join(", ")}`
|
|
9246
9254
|
}),
|
|
@@ -9251,13 +9259,13 @@ const Yc = (t, e) => {
|
|
|
9251
9259
|
s = rn(), r && (s = s.describe(r.trim()));
|
|
9252
9260
|
break;
|
|
9253
9261
|
case "Number":
|
|
9254
|
-
t.autoIncrement ? s =
|
|
9262
|
+
t.autoIncrement ? s = be([cs(), Et().int()], {
|
|
9255
9263
|
message: "Must be a valid number"
|
|
9256
9264
|
}) : (s = Et({
|
|
9257
9265
|
message: "Must be a valid number"
|
|
9258
9266
|
}), t.min && (s = s.min(t.min, `Must be greater than or equal to ${t.min}`)), t.max && (s = s.max(t.max, `Must be less than or equal to ${t.max}`)), t.decimal ? n ? s = s.describe(`${r}Must have ${t.decimal} decimal places`) : s = s.refine((l) => t.decimal ? (l.toString().split(".")[1]?.length || 0) <= t.decimal : !1, {
|
|
9259
9267
|
message: `Must have ${t.decimal} or fewer decimal places`
|
|
9260
|
-
}) : s = s.int("Must not have decimal places"), t.values ? (n || (s =
|
|
9268
|
+
}) : s = s.int("Must not have decimal places"), t.values ? (n || (s = be([
|
|
9261
9269
|
s.refine((l) => t.values?.includes(l), {
|
|
9262
9270
|
message: `Must be one of the following values: ${t.values.join(", ")}`
|
|
9263
9271
|
}),
|
|
@@ -9301,8 +9309,8 @@ const Yc = (t, e) => {
|
|
|
9301
9309
|
})), c.max && (a[c.name] = a[c.name].refine((d) => c.max && (!d || Object.keys(d).length <= c.max), {
|
|
9302
9310
|
message: `Must contain at most ${c.max} item(s)`
|
|
9303
9311
|
})))) : a[c.name] = Ao(c, n, s), r && (a[c.name] = a[c.name].optional()));
|
|
9304
|
-
}), !s && i && (a.operation =
|
|
9305
|
-
a[`auth-${c.labels.collection}`] = rn().optional(), a[`operations-${c.labels.collection}`] = Rt(
|
|
9312
|
+
}), !s && i && (a.operation = be([Oe("create"), Oe("update"), Oe("delete")]).optional(), a.password = Ie().optional(), a.passwordConfirm = Ie().optional(), Object.values(e.collections).forEach((c) => {
|
|
9313
|
+
a[`auth-${c.labels.collection}`] = rn().optional(), a[`operations-${c.labels.collection}`] = Rt(be([Oe("Read"), Oe("Create"), Oe("Update"), Oe("Delete")])).optional(), a[`restrict-${c.labels.collection}`] = rn().optional(), c.access.attributeRestrictions?.forEach((d) => {
|
|
9306
9314
|
a[`attribute-${c.labels.collection}-${d.type}`] = rn().optional();
|
|
9307
9315
|
}), c.access.entityRestrictions?.restrictions?.forEach((d) => {
|
|
9308
9316
|
if (d.type === "Individual" && (a[`accessible-${c.labels.collection}-${c.labels.collection}`] = qe({}).catchall(Ee()).optional()), d.type === "Parent" || d.type === "Parent_Property") {
|
|
@@ -9480,7 +9488,7 @@ const Yc = (t, e) => {
|
|
|
9480
9488
|
if (!R)
|
|
9481
9489
|
throw new Error(`SCHEMA_ERROR: Field ${h.twoWay} not found in collection ${h.collection}`);
|
|
9482
9490
|
if (X(R)) {
|
|
9483
|
-
if (t === "update" && w && !(r[h.name] &&
|
|
9491
|
+
if (t === "update" && w && !(r[h.name] && Re(r[h.name])) && r[`${h.name}_Array`] && w[`${h.name}_Array`]?.length > 0)
|
|
9484
9492
|
for (const [q, Z] of Object.entries(w[h.name]))
|
|
9485
9493
|
!r[`${h.name}_Array`].includes(q) && !N?.get(h.name)?.includes(q) && (O.size += j(x, R), O.size <= 500 && v(h, x, R, q, Z.Collection_Path));
|
|
9486
9494
|
} else
|
|
@@ -9493,7 +9501,7 @@ const Yc = (t, e) => {
|
|
|
9493
9501
|
if (!R)
|
|
9494
9502
|
throw new Error(`SCHEMA_ERROR: Field ${h.twoWay} not found in collection ${h.collection}`);
|
|
9495
9503
|
if (X(R)) {
|
|
9496
|
-
if (t === "update" && w && r[h.name] &&
|
|
9504
|
+
if (t === "update" && w && r[h.name] && Re(r[h.name]) && w[`${h.name}_Array`]?.length > 0)
|
|
9497
9505
|
for (const [q, Z] of Object.entries(w[h.name]))
|
|
9498
9506
|
N?.get(h.name)?.includes(q) || (O.size += j(x, R), O.size <= 500 && v(h, x, R, q, Z.Collection_Path));
|
|
9499
9507
|
} else
|
|
@@ -10415,11 +10423,11 @@ function su(t) {
|
|
|
10415
10423
|
}
|
|
10416
10424
|
const qo = async (t, e, n, s, r, i, o) => {
|
|
10417
10425
|
const a = kt(), l = de(), { labels: c, fields: d } = s;
|
|
10418
|
-
if (
|
|
10426
|
+
if (Re(r.Email) || !r.Email)
|
|
10419
10427
|
throw new Error("VALIDATION_ERROR: Email field is required");
|
|
10420
|
-
if (
|
|
10428
|
+
if (Re(r.Role) || !r.Role)
|
|
10421
10429
|
throw new Error("VALIDATION_ERROR: Role field is required");
|
|
10422
|
-
if (r.Enabled === void 0 || r.Enabled === null ||
|
|
10430
|
+
if (r.Enabled === void 0 || r.Enabled === null || Re(r.Enabled))
|
|
10423
10431
|
throw new Error("VALIDATION_ERROR: Enabled field is required");
|
|
10424
10432
|
const p = "USER_ERROR", u = async (y, E) => {
|
|
10425
10433
|
try {
|
|
@@ -10443,7 +10451,7 @@ const qo = async (t, e, n, s, r, i, o) => {
|
|
|
10443
10451
|
}
|
|
10444
10452
|
const g = {};
|
|
10445
10453
|
for (const y of d)
|
|
10446
|
-
y.saveToAuthToken && !lr(y.name) && r[y.name] !== void 0 && y.type !== "Timestamp" && y.type !== "Computed" && y.type !== "Embedding" && (
|
|
10454
|
+
y.saveToAuthToken && !lr(y.name) && r[y.name] !== void 0 && y.type !== "Timestamp" && y.type !== "Computed" && y.type !== "Embedding" && (Re(r[y.name]) ? g[y.name] = null : g[y.name] = r[y.name]);
|
|
10447
10455
|
try {
|
|
10448
10456
|
await a.setCustomUserClaims(f.uid, {
|
|
10449
10457
|
...g,
|
|
@@ -11016,7 +11024,7 @@ const qo = async (t, e, n, s, r, i, o) => {
|
|
|
11016
11024
|
}, lu = async (t, e, n, s, r, i, o, a, l, c, d) => {
|
|
11017
11025
|
const p = kt(), u = de(), f = {};
|
|
11018
11026
|
for (const y of r.fields)
|
|
11019
|
-
y.saveToAuthToken && !lr(y.name) && i[y.name] !== void 0 && y.type !== "Timestamp" && y.type !== "Computed" && y.type !== "Embedding" && (
|
|
11027
|
+
y.saveToAuthToken && !lr(y.name) && i[y.name] !== void 0 && y.type !== "Timestamp" && y.type !== "Computed" && y.type !== "Embedding" && (Re(i[y.name]) ? f[y.name] = null : f[y.name] = i[y.name]);
|
|
11020
11028
|
const g = "USER_ERROR";
|
|
11021
11029
|
let k = "";
|
|
11022
11030
|
if (t === "create") {
|
|
@@ -11173,7 +11181,7 @@ const qo = async (t, e, n, s, r, i, o) => {
|
|
|
11173
11181
|
delete n.id, Bo(n), ur(n);
|
|
11174
11182
|
const m = Js("update", t, n, c, w, "Online", r || "System", ht.now(), pe.serverTimestamp()), T = me(m);
|
|
11175
11183
|
for (const S of k)
|
|
11176
|
-
!X(S) &&
|
|
11184
|
+
!X(S) && Re(m[S.name]) && S.nullable && (m[S.name] = null);
|
|
11177
11185
|
Ze(m), Ze(v), _t(f, m, c), _t(f, v, c), y && !s?.providedTransaction && await Wt("update", "started", m, a, t, e, f, void 0, v);
|
|
11178
11186
|
const b = {
|
|
11179
11187
|
operation: "update",
|
|
@@ -11203,7 +11211,7 @@ const qo = async (t, e, n, s, r, i, o) => {
|
|
|
11203
11211
|
}
|
|
11204
11212
|
Ze(m), delete n.id, _t(f, m, c), Mn(f, m);
|
|
11205
11213
|
for (const S of k)
|
|
11206
|
-
!X(S) &&
|
|
11214
|
+
!X(S) && Re(m[S.name]) && S.nullable && (m[S.name] = null);
|
|
11207
11215
|
try {
|
|
11208
11216
|
const S = { ...U, ...m };
|
|
11209
11217
|
Qe(S), Yo("update", f, m, v), Go("update", m, T), await dn("update", S, f, E, { operation: "update", data: m, context: o, originalRecord: me(v) }, c);
|
|
@@ -11256,9 +11264,9 @@ const qo = async (t, e, n, s, r, i, o) => {
|
|
|
11256
11264
|
D = we.data();
|
|
11257
11265
|
const Ht = i?.permissions && Object.keys(i.permissions).length > 0 ? i.permissions : void 0;
|
|
11258
11266
|
if (m.Role && m.Role !== v.Role && !Ht && (i ||= { operation: "update", permissions: {} }, i.permissions = me(D), i.permissions.Role = m.Role), i?.permissions) {
|
|
11259
|
-
if (i.permissions.Role ||= m.Role || v.Role, i.permissions.Enabled ??= m.Enabled ?? v.Enabled,
|
|
11267
|
+
if (i.permissions.Role ||= m.Role || v.Role, i.permissions.Enabled ??= m.Enabled ?? v.Enabled, Re(i.permissions.Role) || !i.permissions.Role)
|
|
11260
11268
|
throw new Error("VALIDATION_ERROR: Role field is required");
|
|
11261
|
-
if (
|
|
11269
|
+
if (Re(i.permissions.Enabled) || i.permissions.Enabled === void 0 || i.permissions.Enabled === null)
|
|
11262
11270
|
throw new Error("VALIDATION_ERROR: Enabled field is required");
|
|
11263
11271
|
}
|
|
11264
11272
|
}
|
|
@@ -11275,7 +11283,7 @@ const qo = async (t, e, n, s, r, i, o) => {
|
|
|
11275
11283
|
if (!s?.providedTransaction) {
|
|
11276
11284
|
const Ht = k.filter((_e) => "unique" in _e && _e.unique).map(async (_e) => {
|
|
11277
11285
|
if (!r || !_e.access || Be(_e, _, f, I)) {
|
|
11278
|
-
if (m[_e.name] === void 0 ||
|
|
11286
|
+
if (m[_e.name] === void 0 || Re(m[_e.name]))
|
|
11279
11287
|
return;
|
|
11280
11288
|
const Gt = We(_e, E), dr = { ...v, ...m };
|
|
11281
11289
|
if (!(r && _ && De && Gt?.custom?.serverAccess?.read !== void 0 ? await oe(Gt.custom.serverAccess.read, [
|
|
@@ -11535,7 +11543,7 @@ export {
|
|
|
11535
11543
|
Ja as getZodSchema,
|
|
11536
11544
|
Nu as initializeFirebase,
|
|
11537
11545
|
Ru as initializeStoker,
|
|
11538
|
-
|
|
11546
|
+
Re as isDeleteSentinel,
|
|
11539
11547
|
Lu as keepTimezone,
|
|
11540
11548
|
Vu as removeTimezone,
|
|
11541
11549
|
xu as runChildProcess,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/node-client",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.97",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"files": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@google-cloud/storage": "^7.19.0",
|
|
27
27
|
"@stoker-platform/types": "0.5.68",
|
|
28
|
-
"@stoker-platform/utils": "0.5.
|
|
28
|
+
"@stoker-platform/utils": "0.5.84",
|
|
29
29
|
"@types/luxon": "^3.7.1",
|
|
30
30
|
"cross-spawn": "^7.0.6",
|
|
31
31
|
"firebase-admin": "^13.10.0",
|