@jsdev_ninja/core 0.13.55 → 0.13.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.es.js CHANGED
@@ -165,7 +165,7 @@ class N extends Error {
165
165
  }
166
166
  }
167
167
  N.create = (n) => new N(n);
168
- const J = (n, e) => {
168
+ const G = (n, e) => {
169
169
  let t;
170
170
  switch (n.code) {
171
171
  case d.invalid_type:
@@ -221,7 +221,7 @@ const J = (n, e) => {
221
221
  }
222
222
  return { message: t };
223
223
  };
224
- let Ue = J;
224
+ let Ue = G;
225
225
  function dt(n) {
226
226
  Ue = n;
227
227
  }
@@ -261,7 +261,7 @@ function m(n, e) {
261
261
  // then schema-bound map if available
262
262
  t,
263
263
  // then global override map
264
- t === J ? void 0 : J
264
+ t === G ? void 0 : G
265
265
  // then global default map
266
266
  ].filter((s) => !!s)
267
267
  });
@@ -1456,7 +1456,7 @@ oe.create = (n) => new oe({
1456
1456
  typeName: g.ZodNull,
1457
1457
  ...v(n)
1458
1458
  });
1459
- class G extends _ {
1459
+ class J extends _ {
1460
1460
  constructor() {
1461
1461
  super(...arguments), this._any = !0;
1462
1462
  }
@@ -1464,7 +1464,7 @@ class G extends _ {
1464
1464
  return S(e.data);
1465
1465
  }
1466
1466
  }
1467
- G.create = (n) => new G({
1467
+ J.create = (n) => new J({
1468
1468
  typeName: g.ZodAny,
1469
1469
  ...v(n)
1470
1470
  });
@@ -2310,7 +2310,7 @@ class X extends _ {
2310
2310
  t.common.contextualErrorMap,
2311
2311
  t.schemaErrorMap,
2312
2312
  ve(),
2313
- J
2313
+ G
2314
2314
  ].filter((u) => !!u),
2315
2315
  issueData: {
2316
2316
  code: d.invalid_arguments,
@@ -2326,7 +2326,7 @@ class X extends _ {
2326
2326
  t.common.contextualErrorMap,
2327
2327
  t.schemaErrorMap,
2328
2328
  ve(),
2329
- J
2329
+ G
2330
2330
  ].filter((u) => !!u),
2331
2331
  issueData: {
2332
2332
  code: d.invalid_return_type,
@@ -2818,7 +2818,7 @@ function Ve(n, e) {
2818
2818
  return typeof t == "string" ? { message: t } : t;
2819
2819
  }
2820
2820
  function Ye(n, e = {}, t) {
2821
- return n ? G.create().superRefine((r, s) => {
2821
+ return n ? J.create().superRefine((r, s) => {
2822
2822
  var i, o;
2823
2823
  const c = n(r);
2824
2824
  if (c instanceof Promise)
@@ -2833,7 +2833,7 @@ function Ye(n, e = {}, t) {
2833
2833
  const l = Ve(e, r), u = (o = (i = l.fatal) !== null && i !== void 0 ? i : t) !== null && o !== void 0 ? o : !0;
2834
2834
  s.addIssue({ code: "custom", ...l, fatal: u });
2835
2835
  }
2836
- }) : G.create();
2836
+ }) : J.create();
2837
2837
  }
2838
2838
  const Pt = {
2839
2839
  object: k.lazycreate
@@ -2844,7 +2844,7 @@ var g;
2844
2844
  })(g || (g = {}));
2845
2845
  const Et = (n, e = {
2846
2846
  message: `Input not instance of ${n.name}`
2847
- }) => Ye((t) => t instanceof n, e), Xe = A.create, Je = V.create, Rt = Te.create, Mt = z.create, Ge = ae.create, $t = B.create, Vt = xe.create, zt = ie.create, Ft = oe.create, Ut = G.create, Lt = L.create, qt = $.create, Bt = ke.create, Wt = C.create, Qt = k.create, Yt = k.strictCreate, Xt = ce.create, Jt = Se.create, Gt = ue.create, Ht = P.create, Kt = de.create, en = we.create, tn = W.create, nn = X.create, rn = le.create, sn = me.create, an = F.create, on = pe.create, cn = H.create, ze = Z.create, un = D.create, dn = U.create, ln = Z.createWithPreprocess, mn = ye.create, pn = () => Xe().optional(), fn = () => Je().optional(), hn = () => Ge().optional(), gn = {
2847
+ }) => Ye((t) => t instanceof n, e), Xe = A.create, Ge = V.create, Rt = Te.create, Mt = z.create, Je = ae.create, $t = B.create, Vt = xe.create, zt = ie.create, Ft = oe.create, Ut = J.create, Lt = L.create, qt = $.create, Bt = ke.create, Wt = C.create, Qt = k.create, Yt = k.strictCreate, Xt = ce.create, Gt = Se.create, Jt = ue.create, Ht = P.create, Kt = de.create, en = we.create, tn = W.create, nn = X.create, rn = le.create, sn = me.create, an = F.create, on = pe.create, cn = H.create, ze = Z.create, un = D.create, dn = U.create, ln = Z.createWithPreprocess, mn = ye.create, pn = () => Xe().optional(), fn = () => Ge().optional(), hn = () => Je().optional(), gn = {
2848
2848
  string: (n) => A.create({ ...n, coerce: !0 }),
2849
2849
  number: (n) => V.create({ ...n, coerce: !0 }),
2850
2850
  boolean: (n) => ae.create({
@@ -2856,7 +2856,7 @@ const Et = (n, e = {
2856
2856
  }, yn = y;
2857
2857
  var a = /* @__PURE__ */ Object.freeze({
2858
2858
  __proto__: null,
2859
- defaultErrorMap: J,
2859
+ defaultErrorMap: G,
2860
2860
  setErrorMap: dt,
2861
2861
  getErrorMap: ve,
2862
2862
  makeIssue: _e,
@@ -2888,7 +2888,7 @@ var a = /* @__PURE__ */ Object.freeze({
2888
2888
  ZodSymbol: xe,
2889
2889
  ZodUndefined: ie,
2890
2890
  ZodNull: oe,
2891
- ZodAny: G,
2891
+ ZodAny: J,
2892
2892
  ZodUnknown: L,
2893
2893
  ZodNever: $,
2894
2894
  ZodVoid: ke,
@@ -2929,14 +2929,14 @@ var a = /* @__PURE__ */ Object.freeze({
2929
2929
  any: Ut,
2930
2930
  array: Wt,
2931
2931
  bigint: Mt,
2932
- boolean: Ge,
2932
+ boolean: Je,
2933
2933
  date: $t,
2934
- discriminatedUnion: Jt,
2934
+ discriminatedUnion: Gt,
2935
2935
  effect: ze,
2936
2936
  enum: an,
2937
2937
  function: nn,
2938
2938
  instanceof: Et,
2939
- intersection: Gt,
2939
+ intersection: Jt,
2940
2940
  lazy: rn,
2941
2941
  literal: sn,
2942
2942
  map: en,
@@ -2945,7 +2945,7 @@ var a = /* @__PURE__ */ Object.freeze({
2945
2945
  never: qt,
2946
2946
  null: Ft,
2947
2947
  nullable: dn,
2948
- number: Je,
2948
+ number: Ge,
2949
2949
  object: Qt,
2950
2950
  oboolean: hn,
2951
2951
  onumber: fn,
@@ -3440,10 +3440,10 @@ class An {
3440
3440
  function st(n) {
3441
3441
  return Number(n.toFixed(2));
3442
3442
  }
3443
- function Jn(n) {
3443
+ function Gn(n) {
3444
3444
  return n.toFixed(2);
3445
3445
  }
3446
- function Gn(n) {
3446
+ function Jn(n) {
3447
3447
  return Math.max(0, st(n));
3448
3448
  }
3449
3449
  function Hn(n, e) {
@@ -3497,7 +3497,10 @@ const Cn = a.object({
3497
3497
  oldProfitPercentage: a.number(),
3498
3498
  newProfitPercentage: a.number()
3499
3499
  })
3500
- )
3500
+ ),
3501
+ total: a.number().optional(),
3502
+ totalBeforeVat: a.number().optional(),
3503
+ vat: a.number().optional()
3501
3504
  }), tr = Zn.omit({ id: !0 }), Fe = {
3502
3505
  VAT: 18
3503
3506
  };
@@ -3577,14 +3580,11 @@ const On = {
3577
3580
  settings: "settings",
3578
3581
  discounts: "discounts",
3579
3582
  organizations: "organizations",
3580
- organizationGroups: "organization-groups",
3581
- // todo remove
3582
- "organization-groups": "organization-groups",
3583
+ organizationGroups: "organizationGroups",
3583
3584
  // todo remove
3584
3585
  invoices: "invoices",
3585
3586
  suppliers: "suppliers",
3586
- supplierInvoices: "supplier-invoices",
3587
- "supplier-invoices": "supplier-invoices"
3587
+ supplierInvoices: "supplierInvoices"
3588
3588
  }, En = {
3589
3589
  systemCollections: On,
3590
3590
  storeCollections: Pn,
@@ -3639,9 +3639,9 @@ export {
3639
3639
  Fn as TFlattenCategorySchema,
3640
3640
  Hn as calculatePercentageDiscount,
3641
3641
  Tn as clientTypesSchema,
3642
- Gn as ensureNonNegative,
3642
+ Jn as ensureNonNegative,
3643
3643
  st as formatCurrency,
3644
- Jn as formatCurrencyString,
3644
+ Gn as formatCurrencyString,
3645
3645
  nr as getCartCost,
3646
3646
  Vn as isFile,
3647
3647
  M as notEmptyTextSchema,