@stoker-platform/node-client 0.5.97 → 0.5.98

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.js CHANGED
@@ -3575,25 +3575,25 @@ var Y;
3575
3575
  (function(t) {
3576
3576
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
3577
3577
  })(Y || (Y = {}));
3578
- const Ie = Ke.create, Et = Mt.create, rn = Rs.create, cs = Ts.create, Ee = Ss.create;
3578
+ const Ie = Ke.create, Et = Mt.create, rn = Rs.create, cs = Ts.create, ve = Ss.create;
3579
3579
  ft.create;
3580
- const Rt = ze.create, qe = fe.create, be = Vn.create;
3580
+ const Rt = ze.create, qe = fe.create, Oe = Vn.create;
3581
3581
  Un.create;
3582
3582
  Ot.create;
3583
- const hn = Wn.create, Oe = xs.create, Zn = Pt.create;
3583
+ const hn = Wn.create, Ee = xs.create, Zn = Pt.create;
3584
3584
  jn.create;
3585
3585
  ct.create;
3586
3586
  Vt.create;
3587
- const In = () => Ee().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds !== void 0 || t._seconds !== void 0 && t._nanoseconds !== void 0), {
3587
+ const In = () => ve().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds !== void 0 || t._seconds !== void 0 && t._nanoseconds !== void 0), {
3588
3588
  message: "Value is not a valid timestamp"
3589
- }), xr = () => Ee().refine((t) => t && (t._methodName === "serverTimestamp" || t.constructor.name === "ServerTimestampTransform"), {
3589
+ }), xr = () => ve().refine((t) => t && (t._methodName === "serverTimestamp" || t.constructor.name === "ServerTimestampTransform"), {
3590
3590
  message: "Value is not a valid server timestamp"
3591
3591
  }), Ii = (t, e, n) => {
3592
3592
  const s = {};
3593
3593
  if (t.includeFields) {
3594
3594
  const i = e.collections[t.collection];
3595
3595
  if (!i)
3596
- return hn(Ee());
3596
+ return hn(ve());
3597
3597
  t.includeFields.forEach((o) => {
3598
3598
  const a = i.fields.find((c) => c.name === o);
3599
3599
  if (!a)
@@ -3610,14 +3610,14 @@ 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(be([Ie().length(20), Ie().length(28)]));
3613
+ let e = Rt(Oe([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;
3617
3617
  let i;
3618
3618
  switch (e.type) {
3619
3619
  case "String":
3620
- if (i = Ie(), e.length && (i = i.length(e.length)), e.minlength && (i = i.min(e.minlength)), e.maxlength && (i = i.max(e.maxlength)), e.email && (i = i.email()), e.uuid && (i = i.uuid()), e.url && (i = i.url()), e.emoji && (i = i.emoji()), e.ip && (i = i.ip()), e.pattern && (i = i.regex(new RegExp(e.pattern))), n && (i = i.toLowerCase()), e.values)
3620
+ if (i = Ie(), e.length && (i = i.length(e.length)), e.minlength && (i = i.min(e.minlength)), e.maxlength && (i = i.max(e.maxlength)), e.email && (i = i.email()), e.uuid && (i = i.uuid()), e.url && (i = i.url()), e.emoji && (i = i.emoji()), e.ip && (i = i.ip()), n && (i = i.toLowerCase()), e.pattern && (i = Oe([i.regex(new RegExp(e.pattern)), Ee("")])), e.values)
3621
3621
  if (n) {
3622
3622
  const o = e.values.map((a) => a.toLowerCase());
3623
3623
  i = Zn(o);
@@ -3628,14 +3628,14 @@ 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 = 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, {
3631
+ e.autoIncrement ? i = Oe([Ee("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"
3635
3635
  })));
3636
3636
  break;
3637
3637
  case "Timestamp":
3638
- e.name === r ? i = Ee().refine((o) => o && (o._methodName === "serverTimestamp" || o.constructor.name === "ServerTimestampTransform" || o.seconds !== void 0 && o.nanoseconds !== void 0 || o._seconds !== void 0 && o._nanoseconds !== void 0), {
3638
+ e.name === r ? i = ve().refine((o) => o && (o._methodName === "serverTimestamp" || o.constructor.name === "ServerTimestampTransform" || o.seconds !== void 0 && o.nanoseconds !== void 0 || o._seconds !== void 0 && o._nanoseconds !== void 0), {
3639
3639
  message: "Value is not a valid timestamp"
3640
3640
  }) : (i = In(), e.min && (i = i.refine((o) => o.toMillis() >= e.min, {
3641
3641
  message: `Value is less than the minimum allowed value of ${e.min}`
@@ -3644,7 +3644,7 @@ const In = () => Ee().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
3644
3644
  })));
3645
3645
  break;
3646
3646
  case "Array":
3647
- i = Rt(Ee()), e.length && (i = i.length(e.length)), e.minlength ? i = i.min(e.minlength) : e.required && (i = i.nonempty()), e.maxlength && (i = i.max(e.maxlength)), e.values && (i = i.refine((o) => {
3647
+ i = Rt(ve()), e.length && (i = i.length(e.length)), e.minlength ? i = i.min(e.minlength) : e.required && (i = i.nonempty()), e.maxlength && (i = i.max(e.maxlength)), e.values && (i = i.refine((o) => {
3648
3648
  let a = !0;
3649
3649
  return o.forEach((l) => {
3650
3650
  e.values && !e.values.includes(l) && (a = !1);
@@ -3652,12 +3652,12 @@ const In = () => Ee().refine((t) => t && (t.seconds !== void 0 && t.nanoseconds
3652
3652
  }, { message: "Value is not an allowed value" }));
3653
3653
  break;
3654
3654
  case "Map":
3655
- i = hn(Ee()), e.required && (i = i.refine((o) => o && typeof o == "object" && Object.keys(o).length > 0, {
3655
+ i = hn(ve()), e.required && (i = i.refine((o) => o && typeof o == "object" && Object.keys(o).length > 0, {
3656
3656
  message: "Value must have at least one object property"
3657
3657
  }));
3658
3658
  break;
3659
3659
  case "Embedding":
3660
- i = Ee();
3660
+ i = ve();
3661
3661
  break;
3662
3662
  }
3663
3663
  return !X(e) && e.nullable && (i = i.nullable()), e.required || (i = i.optional()), i;
@@ -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: be([Ie().length(28), Oe("System")]),
3670
+ Last_Write_By: Oe([Ie().length(28), Ee("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: be([Ie().length(28), Oe("System")])
3675
+ Created_By: Oe([Ie().length(28), Ee("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);
@@ -3714,7 +3714,7 @@ class xi extends Tt {
3714
3714
  super(`Invalid unit ${e}`);
3715
3715
  }
3716
3716
  }
3717
- class ve extends Tt {
3717
+ class ke extends Tt {
3718
3718
  }
3719
3719
  class rt extends Tt {
3720
3720
  constructor() {
@@ -4946,9 +4946,9 @@ function Ws(t) {
4946
4946
  if (t == null)
4947
4947
  return null;
4948
4948
  if (typeof t != "object")
4949
- throw new ve("Week settings must be an object");
4949
+ throw new ke("Week settings must be an object");
4950
4950
  if (!$e(t.firstDay, 1, 7) || !$e(t.minimalDays, 1, 7) || !Array.isArray(t.weekend) || t.weekend.some((e) => !$e(e, 1, 7)))
4951
- throw new ve("Invalid week settings");
4951
+ throw new ke("Invalid week settings");
4952
4952
  return {
4953
4953
  firstDay: t.firstDay,
4954
4954
  minimalDays: t.minimalDays,
@@ -5051,7 +5051,7 @@ function ss(t, e) {
5051
5051
  function oo(t) {
5052
5052
  const e = Number(t);
5053
5053
  if (typeof t == "boolean" || t === "" || !Number.isFinite(e))
5054
- throw new ve(`Invalid unit value ${t}`);
5054
+ throw new ke(`Invalid unit value ${t}`);
5055
5055
  return e;
5056
5056
  }
5057
5057
  function Gn(t, e) {
@@ -5224,9 +5224,9 @@ const Wl = {
5224
5224
  FFF: Bi,
5225
5225
  FFFF: Gi
5226
5226
  };
5227
- class ke {
5227
+ class be {
5228
5228
  static create(e, n = {}) {
5229
- return new ke(e, n);
5229
+ return new be(e, n);
5230
5230
  }
5231
5231
  static parseFormat(e) {
5232
5232
  let n = null, s = "", r = !1;
@@ -5275,7 +5275,7 @@ class ke {
5275
5275
  g ? { weekday: f } : { weekday: f, month: "long", day: "numeric" },
5276
5276
  "weekday"
5277
5277
  ), d = (f) => {
5278
- const g = ke.macroTokenToFormatOpts(f);
5278
+ const g = be.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 ke {
5420
5420
  return d(f);
5421
5421
  }
5422
5422
  };
5423
- return qr(ke.parseFormat(n), u);
5423
+ return qr(be.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 ke {
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 = ke.parseFormat(n), a = o.reduce(
5455
+ }, o = be.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 = {
@@ -5824,7 +5824,7 @@ class ne {
5824
5824
  */
5825
5825
  static fromObject(e, n = {}) {
5826
5826
  if (e == null || typeof e != "object")
5827
- throw new ve(
5827
+ throw new ke(
5828
5828
  `Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
5829
5829
  );
5830
5830
  return new ne({
@@ -5851,7 +5851,7 @@ class ne {
5851
5851
  return e;
5852
5852
  if (typeof e == "object")
5853
5853
  return ne.fromObject(e);
5854
- throw new ve(
5854
+ throw new ke(
5855
5855
  `Unknown duration argument ${e} of type ${typeof e}`
5856
5856
  );
5857
5857
  }
@@ -5901,7 +5901,7 @@ class ne {
5901
5901
  */
5902
5902
  static invalid(e, n = null) {
5903
5903
  if (!e)
5904
- throw new ve("need to specify a reason the Duration is invalid");
5904
+ throw new ke("need to specify a reason the Duration is invalid");
5905
5905
  const s = e instanceof Ue ? e : new Ue(e, n);
5906
5906
  if (ue.throwOnInvalid)
5907
5907
  throw new Xa(s);
@@ -5988,7 +5988,7 @@ class ne {
5988
5988
  ...n,
5989
5989
  floor: n.round !== !1 && n.floor !== !1
5990
5990
  };
5991
- return this.isValid ? ke.create(this.loc, s).formatDurationFromString(this, e) : Hr;
5991
+ return this.isValid ? be.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.
@@ -6399,7 +6399,7 @@ class ce {
6399
6399
  */
6400
6400
  static invalid(e, n = null) {
6401
6401
  if (!e)
6402
- throw new ve("need to specify a reason the Interval is invalid");
6402
+ throw new ke("need to specify a reason the Interval is invalid");
6403
6403
  const s = e instanceof Ue ? e : new Ue(e, n);
6404
6404
  if (ue.throwOnInvalid)
6405
6405
  throw new Ka(s);
@@ -6774,7 +6774,7 @@ class ce {
6774
6774
  * @return {string}
6775
6775
  */
6776
6776
  toLocaleString(e = qn, n = {}) {
6777
- return this.isValid ? ke.create(this.s.loc.clone(n), e).formatInterval(this) : It;
6777
+ return this.isValid ? be.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.
@@ -7324,7 +7324,7 @@ function Wc() {
7324
7324
  function jc(t, e) {
7325
7325
  if (t.literal)
7326
7326
  return t;
7327
- const n = ke.macroTokenToFormatOpts(t.val), s = Io(n, e);
7327
+ const n = be.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(ke.parseFormat(n), e), this.units = this.tokens.map((s) => $c(s, e)), this.disqualifyingUnit = this.units.find((s) => s.invalidReason), !this.disqualifyingUnit) {
7335
+ if (this.locale = e, this.format = n, this.tokens = Ro(be.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 = ke.create(e, t).dtFormatter(Wc()), r = s.formatToParts(), i = s.resolvedOptions();
7377
+ const s = be.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 ? ke.create(ie.create("en-US"), {
7465
+ return t.isValid ? be.create(ie.create("en-US"), {
7466
7466
  allowZ: n,
7467
7467
  forceSimple: !0
7468
7468
  }).formatDateTimeFromString(t, e) : null;
@@ -7734,7 +7734,7 @@ class V {
7734
7734
  zone: at(n.zone, ue.defaultZone),
7735
7735
  loc: ie.fromObject(n)
7736
7736
  });
7737
- throw new ve(
7737
+ throw new ke(
7738
7738
  `fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`
7739
7739
  );
7740
7740
  }
@@ -7756,7 +7756,7 @@ class V {
7756
7756
  zone: at(n.zone, ue.defaultZone),
7757
7757
  loc: ie.fromObject(n)
7758
7758
  });
7759
- throw new ve("fromSeconds requires a numerical input");
7759
+ throw new ke("fromSeconds requires a numerical input");
7760
7760
  }
7761
7761
  /**
7762
7762
  * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
@@ -7901,7 +7901,7 @@ class V {
7901
7901
  */
7902
7902
  static fromFormat(e, n, s = {}) {
7903
7903
  if (G(e) || G(n))
7904
- throw new ve("fromFormat requires an input string and a format");
7904
+ throw new ke("fromFormat requires an input string and a format");
7905
7905
  const { locale: r = null, numberingSystem: i = null } = s, o = ie.fromOpts({
7906
7906
  locale: r,
7907
7907
  numberingSystem: i,
@@ -7948,7 +7948,7 @@ class V {
7948
7948
  */
7949
7949
  static invalid(e, n = null) {
7950
7950
  if (!e)
7951
- throw new ve("need to specify a reason the DateTime is invalid");
7951
+ throw new ke("need to specify a reason the DateTime is invalid");
7952
7952
  const s = e instanceof Ue ? e : new Ue(e, n);
7953
7953
  if (ue.throwOnInvalid)
7954
7954
  throw new Qa(s);
@@ -7980,7 +7980,7 @@ class V {
7980
7980
  * @returns {string}
7981
7981
  */
7982
7982
  static expandFormat(e, n = {}) {
7983
- return Ro(ke.parseFormat(e), ie.fromObject(n)).map((r) => r.val).join("");
7983
+ return Ro(be.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 } = ke.create(
8347
+ const { locale: n, numberingSystem: s, calendar: r } = be.create(
8348
8348
  this.loc.clone(e),
8349
8349
  e
8350
8350
  ).resolvedOptions(this);
@@ -8550,7 +8550,7 @@ class V {
8550
8550
  * @return {string}
8551
8551
  */
8552
8552
  toFormat(e, n = {}) {
8553
- return this.isValid ? ke.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this, e) : ps;
8553
+ return this.isValid ? be.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 ? ke.create(this.loc.clone(n), e).formatDateTime(this) : ps;
8575
+ return this.isValid ? be.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 ? ke.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
8591
+ return this.isValid ? be.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
8592
8592
  }
8593
8593
  /**
8594
8594
  * Returns an ISO 8601-compliant string representation of this DateTime
@@ -8946,7 +8946,7 @@ class V {
8946
8946
  */
8947
8947
  static min(...e) {
8948
8948
  if (!e.every(V.isDateTime))
8949
- throw new ve("min requires all arguments be DateTimes");
8949
+ throw new ke("min requires all arguments be DateTimes");
8950
8950
  return Zr(e, (n) => n.valueOf(), Math.min);
8951
8951
  }
8952
8952
  /**
@@ -8956,7 +8956,7 @@ class V {
8956
8956
  */
8957
8957
  static max(...e) {
8958
8958
  if (!e.every(V.isDateTime))
8959
- throw new ve("max requires all arguments be DateTimes");
8959
+ throw new ke("max requires all arguments be DateTimes");
8960
8960
  return Zr(e, (n) => n.valueOf(), Math.max);
8961
8961
  }
8962
8962
  // MISC
@@ -9013,7 +9013,7 @@ class V {
9013
9013
  */
9014
9014
  static fromFormatParser(e, n, s = {}) {
9015
9015
  if (G(e) || G(n))
9016
- throw new ve(
9016
+ throw new ke(
9017
9017
  "fromFormatParser requires an input string and a format parser"
9018
9018
  );
9019
9019
  const { locale: r = null, numberingSystem: i = null } = s, o = ie.fromOpts({
@@ -9022,7 +9022,7 @@ class V {
9022
9022
  defaultToEN: !0
9023
9023
  });
9024
9024
  if (!o.equals(n.locale))
9025
- throw new ve(
9025
+ throw new ke(
9026
9026
  `fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`
9027
9027
  );
9028
9028
  const { result: a, zone: l, specificOffset: c, invalidReason: d } = n.explainFromTokens(e);
@@ -9198,7 +9198,7 @@ function Yt(t) {
9198
9198
  return V.fromJSDate(t);
9199
9199
  if (t && typeof t == "object")
9200
9200
  return V.fromObject(t);
9201
- throw new ve(
9201
+ throw new ke(
9202
9202
  `Unknown datetime argument: ${t}, of type ${typeof t}`
9203
9203
  );
9204
9204
  }
@@ -9207,10 +9207,10 @@ const Yc = (t, e) => {
9207
9207
  if (t.includeFields) {
9208
9208
  const s = e.collections[t.collection];
9209
9209
  if (!s)
9210
- return hn(Ee());
9210
+ return hn(ve());
9211
9211
  t.includeFields.forEach((r) => {
9212
9212
  const i = s.fields.find((o) => o.name === r);
9213
- i ? n[r] = Ao(i)?.nullable() : n[r] = Ee();
9213
+ i ? n[r] = Ao(i)?.nullable() : n[r] = ve();
9214
9214
  });
9215
9215
  }
9216
9216
  return qe({
@@ -9224,7 +9224,7 @@ const Yc = (t, e) => {
9224
9224
  i = Jt(o.admin?.skipFormRequiredValidation);
9225
9225
  }
9226
9226
  return (!t.required || i) && (r = r.optional()), r;
9227
- }, Qc = () => Ee().refine((t) => t === null || t && (t.seconds !== void 0 && t.nanoseconds !== void 0 || t._seconds !== void 0 && t._nanoseconds !== void 0), {
9227
+ }, Qc = () => ve().refine((t) => t === null || t && (t.seconds !== void 0 && t.nanoseconds !== void 0 || t._seconds !== void 0 && t._nanoseconds !== void 0), {
9228
9228
  message: "Must be a valid date"
9229
9229
  }), Ao = (t, e, n) => {
9230
9230
  let s;
@@ -9238,17 +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 = 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(
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 = Oe([s.uuid("Must be a valid UUID"), Ee("")]) : t.url ? s = Oe([s.url("Must be a valid URL"), Ee("")]) : t.emoji ? s = Oe([s.emoji("Must be a valid emoji"), Ee("")]) : t.ip ? s = Oe([s.ip("Must be a valid IP address"), Ee("")]) : t.pattern && (!n && a ? s = Oe(
9242
9242
  // eslint-disable-next-line security/detect-non-literal-regexp
9243
- [s.regex(new RegExp(t.pattern)), s.regex(/^blob:/), Oe("")],
9243
+ [s.regex(new RegExp(t.pattern)), s.regex(/^blob:/), Ee("")],
9244
9244
  {
9245
9245
  message: "Must be a valid value"
9246
9246
  }
9247
- ) : s = be([
9247
+ ) : s = Oe([
9248
9248
  // eslint-disable-next-line security/detect-non-literal-regexp
9249
9249
  s.regex(new RegExp(t.pattern), "Must be a valid value"),
9250
- Oe("")
9251
- ])), t.values && (s = be([
9250
+ Ee("")
9251
+ ])), t.values && (s = Oe([
9252
9252
  Zn(t.values, {
9253
9253
  message: `Must be one of the following values: ${t.values.join(", ")}`
9254
9254
  }),
@@ -9259,13 +9259,13 @@ const Yc = (t, e) => {
9259
9259
  s = rn(), r && (s = s.describe(r.trim()));
9260
9260
  break;
9261
9261
  case "Number":
9262
- t.autoIncrement ? s = be([cs(), Et().int()], {
9262
+ t.autoIncrement ? s = Oe([cs(), Et().int()], {
9263
9263
  message: "Must be a valid number"
9264
9264
  }) : (s = Et({
9265
9265
  message: "Must be a valid number"
9266
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, {
9267
9267
  message: `Must have ${t.decimal} or fewer decimal places`
9268
- }) : s = s.int("Must not have decimal places"), t.values ? (n || (s = be([
9268
+ }) : s = s.int("Must not have decimal places"), t.values ? (n || (s = Oe([
9269
9269
  s.refine((l) => t.values?.includes(l), {
9270
9270
  message: `Must be one of the following values: ${t.values.join(", ")}`
9271
9271
  }),
@@ -9283,7 +9283,7 @@ const Yc = (t, e) => {
9283
9283
  })));
9284
9284
  break;
9285
9285
  case "Array":
9286
- s = Rt(Ee()), t.length && (s = s.length(t.length, `Must contain ${t.length} item(s)`)), t.minlength ? s = s.min(t.minlength, `Must contain at least ${t.minlength} item(s)`) : t.required && !i && (s = s.nonempty("Must contain at least one item")), t.maxlength && (s = s.max(t.maxlength, `Must contain at most ${t.maxlength} item(s)`)), t.values ? (n || (s = s.refine((l) => {
9286
+ s = Rt(ve()), t.length && (s = s.length(t.length, `Must contain ${t.length} item(s)`)), t.minlength ? s = s.min(t.minlength, `Must contain at least ${t.minlength} item(s)`) : t.required && !i && (s = s.nonempty("Must contain at least one item")), t.maxlength && (s = s.max(t.maxlength, `Must contain at most ${t.maxlength} item(s)`)), t.values ? (n || (s = s.refine((l) => {
9287
9287
  let c = !0;
9288
9288
  return l.forEach((d) => {
9289
9289
  t.values && !t.values.includes(d) && (c = !1);
@@ -9291,12 +9291,12 @@ const Yc = (t, e) => {
9291
9291
  }, { message: `Must only contain the following values: ${t.values.join(", ")}` })), s = s.describe(`${r}Must only contain the following values: ${t.values.join(", ")}`)) : r && (s = s.describe(r.trim())), t.nullable && (s = s.nullable());
9292
9292
  break;
9293
9293
  case "Map":
9294
- t.required && !i ? n ? s = qe({}).catchall(Ee()).describe(`${r}Must be an object. Must contain at least one object property.`) : s = hn(Ee()).refine((l) => l && typeof l == "object" && Object.keys(l).length > 0, {
9294
+ t.required && !i ? n ? s = qe({}).catchall(ve()).describe(`${r}Must be an object. Must contain at least one object property.`) : s = hn(ve()).refine((l) => l && typeof l == "object" && Object.keys(l).length > 0, {
9295
9295
  message: "Must not be an empty value"
9296
- }) : s = qe({}).catchall(Ee()).describe(`${r}Must be an object`);
9296
+ }) : s = qe({}).catchall(ve()).describe(`${r}Must be an object`);
9297
9297
  break;
9298
9298
  case "Computed":
9299
- s = Ee();
9299
+ s = ve();
9300
9300
  }
9301
9301
  return (!t.required || i || o) && (s = s.optional()), s;
9302
9302
  }, bu = (t, e, n, s, r) => {
@@ -9309,13 +9309,13 @@ const Yc = (t, e) => {
9309
9309
  })), c.max && (a[c.name] = a[c.name].refine((d) => c.max && (!d || Object.keys(d).length <= c.max), {
9310
9310
  message: `Must contain at most ${c.max} item(s)`
9311
9311
  })))) : a[c.name] = Ao(c, n, s), r && (a[c.name] = a[c.name].optional()));
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) => {
9312
+ }), !s && i && (a.operation = Oe([Ee("create"), Ee("update"), Ee("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(Oe([Ee("Read"), Ee("Create"), Ee("Update"), Ee("Delete")])).optional(), a[`restrict-${c.labels.collection}`] = rn().optional(), c.access.attributeRestrictions?.forEach((d) => {
9314
9314
  a[`attribute-${c.labels.collection}-${d.type}`] = rn().optional();
9315
9315
  }), c.access.entityRestrictions?.restrictions?.forEach((d) => {
9316
- if (d.type === "Individual" && (a[`accessible-${c.labels.collection}-${c.labels.collection}`] = qe({}).catchall(Ee()).optional()), d.type === "Parent" || d.type === "Parent_Property") {
9316
+ if (d.type === "Individual" && (a[`accessible-${c.labels.collection}-${c.labels.collection}`] = qe({}).catchall(ve()).optional()), d.type === "Parent" || d.type === "Parent_Property") {
9317
9317
  const p = L(c.fields, d.collectionField);
9318
- a[`accessible-${c.labels.collection}-${p.collection}`] = qe({}).catchall(Ee()).optional();
9318
+ a[`accessible-${c.labels.collection}-${p.collection}`] = qe({}).catchall(ve()).optional();
9319
9319
  }
9320
9320
  });
9321
9321
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/node-client",
3
- "version": "0.5.97",
3
+ "version": "0.5.98",
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.84",
28
+ "@stoker-platform/utils": "0.5.85",
29
29
  "@types/luxon": "^3.7.1",
30
30
  "cross-spawn": "^7.0.6",
31
31
  "firebase-admin": "^13.10.0",