@jsdev_ninja/core 0.23.0 → 0.24.0
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.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.es.js +667 -634
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/lib/entities/CreditNote.d.ts +75 -0
- package/dist/lib/entities/CreditNote.d.ts.map +1 -0
- package/dist/lib/entities/CreditNote.js +40 -0
- package/dist/lib/entities/OrganizationBalance.d.ts +8 -8
- package/dist/lib/entities/OrganizationBalance.js +2 -2
- package/dist/lib/entities/index.d.ts +1 -0
- package/dist/lib/entities/index.d.ts.map +1 -1
- package/dist/lib/entities/index.js +1 -0
- package/dist/lib/firebase-api/index.d.ts +3 -0
- package/dist/lib/firebase-api/index.d.ts.map +1 -1
- package/dist/lib/firebase-api/index.js +1 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/core.es.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
var ut = Object.defineProperty;
|
|
2
|
-
var dt = (
|
|
3
|
-
var ze = (
|
|
2
|
+
var dt = (r, e, t) => e in r ? ut(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var ze = (r, e, t) => dt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
var b;
|
|
5
|
-
(function(
|
|
6
|
-
|
|
5
|
+
(function(r) {
|
|
6
|
+
r.assertEqual = (a) => a;
|
|
7
7
|
function e(a) {
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
r.assertIs = e;
|
|
10
10
|
function t(a) {
|
|
11
11
|
throw new Error();
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
r.assertNever = t, r.arrayToEnum = (a) => {
|
|
14
14
|
const s = {};
|
|
15
15
|
for (const o of a)
|
|
16
16
|
s[o] = o;
|
|
17
17
|
return s;
|
|
18
|
-
},
|
|
19
|
-
const s =
|
|
18
|
+
}, r.getValidEnumValues = (a) => {
|
|
19
|
+
const s = r.objectKeys(a).filter((c) => typeof a[a[c]] != "number"), o = {};
|
|
20
20
|
for (const c of s)
|
|
21
21
|
o[c] = a[c];
|
|
22
|
-
return
|
|
23
|
-
},
|
|
22
|
+
return r.objectValues(o);
|
|
23
|
+
}, r.objectValues = (a) => r.objectKeys(a).map(function(s) {
|
|
24
24
|
return a[s];
|
|
25
|
-
}),
|
|
25
|
+
}), r.objectKeys = typeof Object.keys == "function" ? (a) => Object.keys(a) : (a) => {
|
|
26
26
|
const s = [];
|
|
27
27
|
for (const o in a)
|
|
28
28
|
Object.prototype.hasOwnProperty.call(a, o) && s.push(o);
|
|
29
29
|
return s;
|
|
30
|
-
},
|
|
30
|
+
}, r.find = (a, s) => {
|
|
31
31
|
for (const o of a)
|
|
32
32
|
if (s(o))
|
|
33
33
|
return o;
|
|
34
|
-
},
|
|
34
|
+
}, r.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && isFinite(a) && Math.floor(a) === a;
|
|
35
35
|
function i(a, s = " | ") {
|
|
36
36
|
return a.map((o) => typeof o == "string" ? `'${o}'` : o).join(s);
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
r.joinValues = i, r.jsonStringifyReplacer = (a, s) => typeof s == "bigint" ? s.toString() : s;
|
|
39
39
|
})(b || (b = {}));
|
|
40
40
|
var Ze;
|
|
41
|
-
(function(
|
|
42
|
-
|
|
41
|
+
(function(r) {
|
|
42
|
+
r.mergeShapes = (e, t) => ({
|
|
43
43
|
...e,
|
|
44
44
|
...t
|
|
45
45
|
// second overwrites first
|
|
@@ -66,14 +66,14 @@ const p = b.arrayToEnum([
|
|
|
66
66
|
"never",
|
|
67
67
|
"map",
|
|
68
68
|
"set"
|
|
69
|
-
]), R = (
|
|
70
|
-
switch (typeof
|
|
69
|
+
]), R = (r) => {
|
|
70
|
+
switch (typeof r) {
|
|
71
71
|
case "undefined":
|
|
72
72
|
return p.undefined;
|
|
73
73
|
case "string":
|
|
74
74
|
return p.string;
|
|
75
75
|
case "number":
|
|
76
|
-
return isNaN(
|
|
76
|
+
return isNaN(r) ? p.nan : p.number;
|
|
77
77
|
case "boolean":
|
|
78
78
|
return p.boolean;
|
|
79
79
|
case "function":
|
|
@@ -83,7 +83,7 @@ const p = b.arrayToEnum([
|
|
|
83
83
|
case "symbol":
|
|
84
84
|
return p.symbol;
|
|
85
85
|
case "object":
|
|
86
|
-
return Array.isArray(
|
|
86
|
+
return Array.isArray(r) ? p.array : r === null ? p.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? p.promise : typeof Map < "u" && r instanceof Map ? p.map : typeof Set < "u" && r instanceof Set ? p.set : typeof Date < "u" && r instanceof Date ? p.date : p.object;
|
|
87
87
|
default:
|
|
88
88
|
return p.unknown;
|
|
89
89
|
}
|
|
@@ -104,7 +104,7 @@ const p = b.arrayToEnum([
|
|
|
104
104
|
"invalid_intersection_types",
|
|
105
105
|
"not_multiple_of",
|
|
106
106
|
"not_finite"
|
|
107
|
-
]), lt = (
|
|
107
|
+
]), lt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
108
108
|
class A extends Error {
|
|
109
109
|
get errors() {
|
|
110
110
|
return this.issues;
|
|
@@ -164,27 +164,27 @@ class A extends Error {
|
|
|
164
164
|
return this.flatten();
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
A.create = (
|
|
168
|
-
const G = (
|
|
167
|
+
A.create = (r) => new A(r);
|
|
168
|
+
const G = (r, e) => {
|
|
169
169
|
let t;
|
|
170
|
-
switch (
|
|
170
|
+
switch (r.code) {
|
|
171
171
|
case d.invalid_type:
|
|
172
|
-
|
|
172
|
+
r.received === p.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
173
173
|
break;
|
|
174
174
|
case d.invalid_literal:
|
|
175
|
-
t = `Invalid literal value, expected ${JSON.stringify(
|
|
175
|
+
t = `Invalid literal value, expected ${JSON.stringify(r.expected, b.jsonStringifyReplacer)}`;
|
|
176
176
|
break;
|
|
177
177
|
case d.unrecognized_keys:
|
|
178
|
-
t = `Unrecognized key(s) in object: ${b.joinValues(
|
|
178
|
+
t = `Unrecognized key(s) in object: ${b.joinValues(r.keys, ", ")}`;
|
|
179
179
|
break;
|
|
180
180
|
case d.invalid_union:
|
|
181
181
|
t = "Invalid input";
|
|
182
182
|
break;
|
|
183
183
|
case d.invalid_union_discriminator:
|
|
184
|
-
t = `Invalid discriminator value. Expected ${b.joinValues(
|
|
184
|
+
t = `Invalid discriminator value. Expected ${b.joinValues(r.options)}`;
|
|
185
185
|
break;
|
|
186
186
|
case d.invalid_enum_value:
|
|
187
|
-
t = `Invalid enum value. Expected ${b.joinValues(
|
|
187
|
+
t = `Invalid enum value. Expected ${b.joinValues(r.options)}, received '${r.received}'`;
|
|
188
188
|
break;
|
|
189
189
|
case d.invalid_arguments:
|
|
190
190
|
t = "Invalid function arguments";
|
|
@@ -196,13 +196,13 @@ const G = (n, e) => {
|
|
|
196
196
|
t = "Invalid date";
|
|
197
197
|
break;
|
|
198
198
|
case d.invalid_string:
|
|
199
|
-
typeof
|
|
199
|
+
typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : b.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
|
|
200
200
|
break;
|
|
201
201
|
case d.too_small:
|
|
202
|
-
|
|
202
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
|
|
203
203
|
break;
|
|
204
204
|
case d.too_big:
|
|
205
|
-
|
|
205
|
+
r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
|
|
206
206
|
break;
|
|
207
207
|
case d.custom:
|
|
208
208
|
t = "Invalid input";
|
|
@@ -211,25 +211,25 @@ const G = (n, e) => {
|
|
|
211
211
|
t = "Intersection results could not be merged";
|
|
212
212
|
break;
|
|
213
213
|
case d.not_multiple_of:
|
|
214
|
-
t = `Number must be a multiple of ${
|
|
214
|
+
t = `Number must be a multiple of ${r.multipleOf}`;
|
|
215
215
|
break;
|
|
216
216
|
case d.not_finite:
|
|
217
217
|
t = "Number must be finite";
|
|
218
218
|
break;
|
|
219
219
|
default:
|
|
220
|
-
t = e.defaultError, b.assertNever(
|
|
220
|
+
t = e.defaultError, b.assertNever(r);
|
|
221
221
|
}
|
|
222
222
|
return { message: t };
|
|
223
223
|
};
|
|
224
224
|
let Be = G;
|
|
225
|
-
function mt(
|
|
226
|
-
Be =
|
|
225
|
+
function mt(r) {
|
|
226
|
+
Be = r;
|
|
227
227
|
}
|
|
228
228
|
function ve() {
|
|
229
229
|
return Be;
|
|
230
230
|
}
|
|
231
|
-
const _e = (
|
|
232
|
-
const { data: e, path: t, errorMaps: i, issueData: a } =
|
|
231
|
+
const _e = (r) => {
|
|
232
|
+
const { data: e, path: t, errorMaps: i, issueData: a } = r, s = [...t, ...a.path || []], o = {
|
|
233
233
|
...a,
|
|
234
234
|
path: s
|
|
235
235
|
};
|
|
@@ -249,15 +249,15 @@ const _e = (n) => {
|
|
|
249
249
|
message: c
|
|
250
250
|
};
|
|
251
251
|
}, pt = [];
|
|
252
|
-
function m(
|
|
252
|
+
function m(r, e) {
|
|
253
253
|
const t = ve(), i = _e({
|
|
254
254
|
issueData: e,
|
|
255
|
-
data:
|
|
256
|
-
path:
|
|
255
|
+
data: r.data,
|
|
256
|
+
path: r.path,
|
|
257
257
|
errorMaps: [
|
|
258
|
-
|
|
258
|
+
r.common.contextualErrorMap,
|
|
259
259
|
// contextual error map is first priority
|
|
260
|
-
|
|
260
|
+
r.schemaErrorMap,
|
|
261
261
|
// then schema-bound map if available
|
|
262
262
|
t,
|
|
263
263
|
// then global override map
|
|
@@ -265,7 +265,7 @@ function m(n, e) {
|
|
|
265
265
|
// then global default map
|
|
266
266
|
].filter((a) => !!a)
|
|
267
267
|
});
|
|
268
|
-
|
|
268
|
+
r.common.issues.push(i);
|
|
269
269
|
}
|
|
270
270
|
class T {
|
|
271
271
|
constructor() {
|
|
@@ -310,21 +310,21 @@ class T {
|
|
|
310
310
|
}
|
|
311
311
|
const y = Object.freeze({
|
|
312
312
|
status: "aborted"
|
|
313
|
-
}), Y = (
|
|
314
|
-
function be(
|
|
315
|
-
if (typeof e == "function" ?
|
|
316
|
-
return e.get(
|
|
313
|
+
}), Y = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Oe = (r) => r.status === "aborted", De = (r) => r.status === "dirty", q = (r) => r.status === "valid", re = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
314
|
+
function be(r, e, t, i) {
|
|
315
|
+
if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
316
|
+
return e.get(r);
|
|
317
317
|
}
|
|
318
|
-
function We(
|
|
319
|
-
if (typeof e == "function" ?
|
|
320
|
-
return e.set(
|
|
318
|
+
function We(r, e, t, i, a) {
|
|
319
|
+
if (typeof e == "function" ? r !== e || !0 : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
320
|
+
return e.set(r, t), t;
|
|
321
321
|
}
|
|
322
322
|
var h;
|
|
323
|
-
(function(
|
|
324
|
-
|
|
323
|
+
(function(r) {
|
|
324
|
+
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
325
325
|
})(h || (h = {}));
|
|
326
326
|
var te, ne;
|
|
327
|
-
class
|
|
327
|
+
class D {
|
|
328
328
|
constructor(e, t, i, a) {
|
|
329
329
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = i, this._key = a;
|
|
330
330
|
}
|
|
@@ -332,30 +332,30 @@ class P {
|
|
|
332
332
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
const Ve = (
|
|
335
|
+
const Ve = (r, e) => {
|
|
336
336
|
if (q(e))
|
|
337
337
|
return { success: !0, data: e.value };
|
|
338
|
-
if (!
|
|
338
|
+
if (!r.common.issues.length)
|
|
339
339
|
throw new Error("Validation failed but no issues detected.");
|
|
340
340
|
return {
|
|
341
341
|
success: !1,
|
|
342
342
|
get error() {
|
|
343
343
|
if (this._error)
|
|
344
344
|
return this._error;
|
|
345
|
-
const t = new A(
|
|
345
|
+
const t = new A(r.common.issues);
|
|
346
346
|
return this._error = t, this._error;
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
349
|
};
|
|
350
|
-
function v(
|
|
351
|
-
if (!
|
|
350
|
+
function v(r) {
|
|
351
|
+
if (!r)
|
|
352
352
|
return {};
|
|
353
|
-
const { errorMap: e, invalid_type_error: t, required_error: i, description: a } =
|
|
353
|
+
const { errorMap: e, invalid_type_error: t, required_error: i, description: a } = r;
|
|
354
354
|
if (e && (t || i))
|
|
355
355
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
356
356
|
return e ? { errorMap: e, description: a } : { errorMap: (o, c) => {
|
|
357
357
|
var l, u;
|
|
358
|
-
const { message: f } =
|
|
358
|
+
const { message: f } = r;
|
|
359
359
|
return o.code === "invalid_enum_value" ? { message: f ?? c.defaultError } : typeof c.data > "u" ? { message: (l = f ?? i) !== null && l !== void 0 ? l : c.defaultError } : o.code !== "invalid_type" ? { message: c.defaultError } : { message: (u = f ?? t) !== null && u !== void 0 ? u : c.defaultError };
|
|
360
360
|
}, description: a };
|
|
361
361
|
}
|
|
@@ -582,33 +582,33 @@ class _ {
|
|
|
582
582
|
const ft = /^c[^\s-]{8,}$/i, ht = /^[0-9a-z]+$/, gt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, yt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, vt = /^[a-z0-9_-]{21}$/i, _t = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, bt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, xt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, kt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
583
583
|
let je;
|
|
584
584
|
const wt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Tt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, St = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, It = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, At = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Nt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Qe = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ct = new RegExp(`^${Qe}$`);
|
|
585
|
-
function Ye(
|
|
585
|
+
function Ye(r) {
|
|
586
586
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
587
|
-
return
|
|
587
|
+
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
588
588
|
}
|
|
589
|
-
function jt(
|
|
590
|
-
return new RegExp(`^${Ye(
|
|
589
|
+
function jt(r) {
|
|
590
|
+
return new RegExp(`^${Ye(r)}$`);
|
|
591
591
|
}
|
|
592
|
-
function Xe(
|
|
593
|
-
let e = `${Qe}T${Ye(
|
|
592
|
+
function Xe(r) {
|
|
593
|
+
let e = `${Qe}T${Ye(r)}`;
|
|
594
594
|
const t = [];
|
|
595
|
-
return t.push(
|
|
595
|
+
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
596
596
|
}
|
|
597
|
-
function Zt(
|
|
598
|
-
return !!((e === "v4" || !e) && wt.test(
|
|
597
|
+
function Zt(r, e) {
|
|
598
|
+
return !!((e === "v4" || !e) && wt.test(r) || (e === "v6" || !e) && St.test(r));
|
|
599
599
|
}
|
|
600
|
-
function Ot(
|
|
601
|
-
if (!_t.test(
|
|
600
|
+
function Ot(r, e) {
|
|
601
|
+
if (!_t.test(r))
|
|
602
602
|
return !1;
|
|
603
603
|
try {
|
|
604
|
-
const [t] =
|
|
604
|
+
const [t] = r.split("."), i = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), a = JSON.parse(atob(i));
|
|
605
605
|
return !(typeof a != "object" || a === null || !a.typ || !a.alg || e && a.alg !== e);
|
|
606
606
|
} catch {
|
|
607
607
|
return !1;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
return !!((e === "v4" || !e) && Tt.test(
|
|
610
|
+
function Dt(r, e) {
|
|
611
|
+
return !!((e === "v4" || !e) && Tt.test(r) || (e === "v6" || !e) && It.test(r));
|
|
612
612
|
}
|
|
613
613
|
class N extends _ {
|
|
614
614
|
_parse(e) {
|
|
@@ -750,7 +750,7 @@ class N extends _ {
|
|
|
750
750
|
validation: "jwt",
|
|
751
751
|
code: d.invalid_string,
|
|
752
752
|
message: s.message
|
|
753
|
-
}), i.dirty()) : s.kind === "cidr" ?
|
|
753
|
+
}), i.dirty()) : s.kind === "cidr" ? Dt(e.data, s.version) || (a = this._getOrReturnCtx(e, a), m(a, {
|
|
754
754
|
validation: "cidr",
|
|
755
755
|
code: d.invalid_string,
|
|
756
756
|
message: s.message
|
|
@@ -988,17 +988,17 @@ class N extends _ {
|
|
|
988
988
|
return e;
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
|
-
N.create = (
|
|
991
|
+
N.create = (r) => {
|
|
992
992
|
var e;
|
|
993
993
|
return new N({
|
|
994
994
|
checks: [],
|
|
995
995
|
typeName: g.ZodString,
|
|
996
|
-
coerce: (e =
|
|
997
|
-
...v(
|
|
996
|
+
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
997
|
+
...v(r)
|
|
998
998
|
});
|
|
999
999
|
};
|
|
1000
|
-
function
|
|
1001
|
-
const t = (
|
|
1000
|
+
function Pt(r, e) {
|
|
1001
|
+
const t = (r.toString().split(".")[1] || "").length, i = (e.toString().split(".")[1] || "").length, a = t > i ? t : i, s = parseInt(r.toFixed(a).replace(".", "")), o = parseInt(e.toFixed(a).replace(".", ""));
|
|
1002
1002
|
return s % o / Math.pow(10, a);
|
|
1003
1003
|
}
|
|
1004
1004
|
class z extends _ {
|
|
@@ -1036,7 +1036,7 @@ class z extends _ {
|
|
|
1036
1036
|
inclusive: s.inclusive,
|
|
1037
1037
|
exact: !1,
|
|
1038
1038
|
message: s.message
|
|
1039
|
-
}), a.dirty()) : s.kind === "multipleOf" ?
|
|
1039
|
+
}), a.dirty()) : s.kind === "multipleOf" ? Pt(e.data, s.value) !== 0 && (i = this._getOrReturnCtx(e, i), m(i, {
|
|
1040
1040
|
code: d.not_multiple_of,
|
|
1041
1041
|
multipleOf: s.value,
|
|
1042
1042
|
message: s.message
|
|
@@ -1167,11 +1167,11 @@ class z extends _ {
|
|
|
1167
1167
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
-
z.create = (
|
|
1170
|
+
z.create = (r) => new z({
|
|
1171
1171
|
checks: [],
|
|
1172
1172
|
typeName: g.ZodNumber,
|
|
1173
|
-
coerce: (
|
|
1174
|
-
...v(
|
|
1173
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1174
|
+
...v(r)
|
|
1175
1175
|
});
|
|
1176
1176
|
class V extends _ {
|
|
1177
1177
|
constructor() {
|
|
@@ -1300,13 +1300,13 @@ class V extends _ {
|
|
|
1300
1300
|
return e;
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
|
-
V.create = (
|
|
1303
|
+
V.create = (r) => {
|
|
1304
1304
|
var e;
|
|
1305
1305
|
return new V({
|
|
1306
1306
|
checks: [],
|
|
1307
1307
|
typeName: g.ZodBigInt,
|
|
1308
|
-
coerce: (e =
|
|
1309
|
-
...v(
|
|
1308
|
+
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
1309
|
+
...v(r)
|
|
1310
1310
|
});
|
|
1311
1311
|
};
|
|
1312
1312
|
class ie extends _ {
|
|
@@ -1322,10 +1322,10 @@ class ie extends _ {
|
|
|
1322
1322
|
return S(e.data);
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
ie.create = (
|
|
1325
|
+
ie.create = (r) => new ie({
|
|
1326
1326
|
typeName: g.ZodBoolean,
|
|
1327
|
-
coerce: (
|
|
1328
|
-
...v(
|
|
1327
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1328
|
+
...v(r)
|
|
1329
1329
|
});
|
|
1330
1330
|
class B extends _ {
|
|
1331
1331
|
_parse(e) {
|
|
@@ -1399,11 +1399,11 @@ class B extends _ {
|
|
|
1399
1399
|
return e != null ? new Date(e) : null;
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
|
-
B.create = (
|
|
1402
|
+
B.create = (r) => new B({
|
|
1403
1403
|
checks: [],
|
|
1404
|
-
coerce: (
|
|
1404
|
+
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1405
1405
|
typeName: g.ZodDate,
|
|
1406
|
-
...v(
|
|
1406
|
+
...v(r)
|
|
1407
1407
|
});
|
|
1408
1408
|
class xe extends _ {
|
|
1409
1409
|
_parse(e) {
|
|
@@ -1418,9 +1418,9 @@ class xe extends _ {
|
|
|
1418
1418
|
return S(e.data);
|
|
1419
1419
|
}
|
|
1420
1420
|
}
|
|
1421
|
-
xe.create = (
|
|
1421
|
+
xe.create = (r) => new xe({
|
|
1422
1422
|
typeName: g.ZodSymbol,
|
|
1423
|
-
...v(
|
|
1423
|
+
...v(r)
|
|
1424
1424
|
});
|
|
1425
1425
|
class ae extends _ {
|
|
1426
1426
|
_parse(e) {
|
|
@@ -1435,9 +1435,9 @@ class ae extends _ {
|
|
|
1435
1435
|
return S(e.data);
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
|
-
ae.create = (
|
|
1438
|
+
ae.create = (r) => new ae({
|
|
1439
1439
|
typeName: g.ZodUndefined,
|
|
1440
|
-
...v(
|
|
1440
|
+
...v(r)
|
|
1441
1441
|
});
|
|
1442
1442
|
class se extends _ {
|
|
1443
1443
|
_parse(e) {
|
|
@@ -1452,9 +1452,9 @@ class se extends _ {
|
|
|
1452
1452
|
return S(e.data);
|
|
1453
1453
|
}
|
|
1454
1454
|
}
|
|
1455
|
-
se.create = (
|
|
1455
|
+
se.create = (r) => new se({
|
|
1456
1456
|
typeName: g.ZodNull,
|
|
1457
|
-
...v(
|
|
1457
|
+
...v(r)
|
|
1458
1458
|
});
|
|
1459
1459
|
class J extends _ {
|
|
1460
1460
|
constructor() {
|
|
@@ -1464,9 +1464,9 @@ class J extends _ {
|
|
|
1464
1464
|
return S(e.data);
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
|
-
J.create = (
|
|
1467
|
+
J.create = (r) => new J({
|
|
1468
1468
|
typeName: g.ZodAny,
|
|
1469
|
-
...v(
|
|
1469
|
+
...v(r)
|
|
1470
1470
|
});
|
|
1471
1471
|
class U extends _ {
|
|
1472
1472
|
constructor() {
|
|
@@ -1476,9 +1476,9 @@ class U extends _ {
|
|
|
1476
1476
|
return S(e.data);
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
|
-
U.create = (
|
|
1479
|
+
U.create = (r) => new U({
|
|
1480
1480
|
typeName: g.ZodUnknown,
|
|
1481
|
-
...v(
|
|
1481
|
+
...v(r)
|
|
1482
1482
|
});
|
|
1483
1483
|
class M extends _ {
|
|
1484
1484
|
_parse(e) {
|
|
@@ -1490,9 +1490,9 @@ class M extends _ {
|
|
|
1490
1490
|
}), y;
|
|
1491
1491
|
}
|
|
1492
1492
|
}
|
|
1493
|
-
M.create = (
|
|
1493
|
+
M.create = (r) => new M({
|
|
1494
1494
|
typeName: g.ZodNever,
|
|
1495
|
-
...v(
|
|
1495
|
+
...v(r)
|
|
1496
1496
|
});
|
|
1497
1497
|
class ke extends _ {
|
|
1498
1498
|
_parse(e) {
|
|
@@ -1507,9 +1507,9 @@ class ke extends _ {
|
|
|
1507
1507
|
return S(e.data);
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
|
-
ke.create = (
|
|
1510
|
+
ke.create = (r) => new ke({
|
|
1511
1511
|
typeName: g.ZodVoid,
|
|
1512
|
-
...v(
|
|
1512
|
+
...v(r)
|
|
1513
1513
|
});
|
|
1514
1514
|
class C extends _ {
|
|
1515
1515
|
_parse(e) {
|
|
@@ -1547,8 +1547,8 @@ class C extends _ {
|
|
|
1547
1547
|
exact: !1,
|
|
1548
1548
|
message: a.maxLength.message
|
|
1549
1549
|
}), i.dirty()), t.common.async)
|
|
1550
|
-
return Promise.all([...t.data].map((o, c) => a.type._parseAsync(new
|
|
1551
|
-
const s = [...t.data].map((o, c) => a.type._parseSync(new
|
|
1550
|
+
return Promise.all([...t.data].map((o, c) => a.type._parseAsync(new D(t, o, t.path, c)))).then((o) => T.mergeArray(i, o));
|
|
1551
|
+
const s = [...t.data].map((o, c) => a.type._parseSync(new D(t, o, t.path, c)));
|
|
1552
1552
|
return T.mergeArray(i, s);
|
|
1553
1553
|
}
|
|
1554
1554
|
get element() {
|
|
@@ -1576,29 +1576,29 @@ class C extends _ {
|
|
|
1576
1576
|
return this.min(1, e);
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
C.create = (
|
|
1580
|
-
type:
|
|
1579
|
+
C.create = (r, e) => new C({
|
|
1580
|
+
type: r,
|
|
1581
1581
|
minLength: null,
|
|
1582
1582
|
maxLength: null,
|
|
1583
1583
|
exactLength: null,
|
|
1584
1584
|
typeName: g.ZodArray,
|
|
1585
1585
|
...v(e)
|
|
1586
1586
|
});
|
|
1587
|
-
function Q(
|
|
1588
|
-
if (
|
|
1587
|
+
function Q(r) {
|
|
1588
|
+
if (r instanceof k) {
|
|
1589
1589
|
const e = {};
|
|
1590
|
-
for (const t in
|
|
1591
|
-
const i =
|
|
1590
|
+
for (const t in r.shape) {
|
|
1591
|
+
const i = r.shape[t];
|
|
1592
1592
|
e[t] = O.create(Q(i));
|
|
1593
1593
|
}
|
|
1594
1594
|
return new k({
|
|
1595
|
-
...
|
|
1595
|
+
...r._def,
|
|
1596
1596
|
shape: () => e
|
|
1597
1597
|
});
|
|
1598
|
-
} else return
|
|
1599
|
-
...
|
|
1600
|
-
type: Q(
|
|
1601
|
-
}) :
|
|
1598
|
+
} else return r instanceof C ? new C({
|
|
1599
|
+
...r._def,
|
|
1600
|
+
type: Q(r.element)
|
|
1601
|
+
}) : r instanceof O ? O.create(Q(r.unwrap())) : r instanceof F ? F.create(Q(r.unwrap())) : r instanceof P ? P.create(r.items.map((e) => Q(e))) : r;
|
|
1602
1602
|
}
|
|
1603
1603
|
class k extends _ {
|
|
1604
1604
|
constructor() {
|
|
@@ -1628,7 +1628,7 @@ class k extends _ {
|
|
|
1628
1628
|
const f = s[u], x = a.data[u];
|
|
1629
1629
|
l.push({
|
|
1630
1630
|
key: { status: "valid", value: u },
|
|
1631
|
-
value: f._parse(new
|
|
1631
|
+
value: f._parse(new D(a, x, a.path, u)),
|
|
1632
1632
|
alwaysSet: u in a.data
|
|
1633
1633
|
});
|
|
1634
1634
|
}
|
|
@@ -1653,7 +1653,7 @@ class k extends _ {
|
|
|
1653
1653
|
l.push({
|
|
1654
1654
|
key: { status: "valid", value: f },
|
|
1655
1655
|
value: u._parse(
|
|
1656
|
-
new
|
|
1656
|
+
new D(a, x, a.path, f)
|
|
1657
1657
|
//, ctx.child(key), value, getParsedType(value)
|
|
1658
1658
|
),
|
|
1659
1659
|
alwaysSet: f in a.data
|
|
@@ -1866,22 +1866,22 @@ class k extends _ {
|
|
|
1866
1866
|
return Ge(b.objectKeys(this.shape));
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
|
-
k.create = (
|
|
1870
|
-
shape: () =>
|
|
1869
|
+
k.create = (r, e) => new k({
|
|
1870
|
+
shape: () => r,
|
|
1871
1871
|
unknownKeys: "strip",
|
|
1872
1872
|
catchall: M.create(),
|
|
1873
1873
|
typeName: g.ZodObject,
|
|
1874
1874
|
...v(e)
|
|
1875
1875
|
});
|
|
1876
|
-
k.strictCreate = (
|
|
1877
|
-
shape: () =>
|
|
1876
|
+
k.strictCreate = (r, e) => new k({
|
|
1877
|
+
shape: () => r,
|
|
1878
1878
|
unknownKeys: "strict",
|
|
1879
1879
|
catchall: M.create(),
|
|
1880
1880
|
typeName: g.ZodObject,
|
|
1881
1881
|
...v(e)
|
|
1882
1882
|
});
|
|
1883
|
-
k.lazycreate = (
|
|
1884
|
-
shape:
|
|
1883
|
+
k.lazycreate = (r, e) => new k({
|
|
1884
|
+
shape: r,
|
|
1885
1885
|
unknownKeys: "strip",
|
|
1886
1886
|
catchall: M.create(),
|
|
1887
1887
|
typeName: g.ZodObject,
|
|
@@ -1955,12 +1955,12 @@ class oe extends _ {
|
|
|
1955
1955
|
return this._def.options;
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
|
-
oe.create = (
|
|
1959
|
-
options:
|
|
1958
|
+
oe.create = (r, e) => new oe({
|
|
1959
|
+
options: r,
|
|
1960
1960
|
typeName: g.ZodUnion,
|
|
1961
1961
|
...v(e)
|
|
1962
1962
|
});
|
|
1963
|
-
const E = (
|
|
1963
|
+
const E = (r) => r instanceof de ? E(r.schema) : r instanceof j ? E(r.innerType()) : r instanceof le ? [r.value] : r instanceof L ? r.options : r instanceof me ? b.objectValues(r.enum) : r instanceof pe ? E(r._def.innerType) : r instanceof ae ? [void 0] : r instanceof se ? [null] : r instanceof O ? [void 0, ...E(r.unwrap())] : r instanceof F ? [null, ...E(r.unwrap())] : r instanceof Re || r instanceof he ? E(r.unwrap()) : r instanceof fe ? E(r._def.innerType) : [];
|
|
1964
1964
|
class Se extends _ {
|
|
1965
1965
|
_parse(e) {
|
|
1966
1966
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2023,39 +2023,39 @@ class Se extends _ {
|
|
|
2023
2023
|
});
|
|
2024
2024
|
}
|
|
2025
2025
|
}
|
|
2026
|
-
function
|
|
2027
|
-
const t = R(
|
|
2028
|
-
if (
|
|
2029
|
-
return { valid: !0, data:
|
|
2026
|
+
function Pe(r, e) {
|
|
2027
|
+
const t = R(r), i = R(e);
|
|
2028
|
+
if (r === e)
|
|
2029
|
+
return { valid: !0, data: r };
|
|
2030
2030
|
if (t === p.object && i === p.object) {
|
|
2031
|
-
const a = b.objectKeys(e), s = b.objectKeys(
|
|
2031
|
+
const a = b.objectKeys(e), s = b.objectKeys(r).filter((c) => a.indexOf(c) !== -1), o = { ...r, ...e };
|
|
2032
2032
|
for (const c of s) {
|
|
2033
|
-
const l =
|
|
2033
|
+
const l = Pe(r[c], e[c]);
|
|
2034
2034
|
if (!l.valid)
|
|
2035
2035
|
return { valid: !1 };
|
|
2036
2036
|
o[c] = l.data;
|
|
2037
2037
|
}
|
|
2038
2038
|
return { valid: !0, data: o };
|
|
2039
2039
|
} else if (t === p.array && i === p.array) {
|
|
2040
|
-
if (
|
|
2040
|
+
if (r.length !== e.length)
|
|
2041
2041
|
return { valid: !1 };
|
|
2042
2042
|
const a = [];
|
|
2043
|
-
for (let s = 0; s <
|
|
2044
|
-
const o =
|
|
2043
|
+
for (let s = 0; s < r.length; s++) {
|
|
2044
|
+
const o = r[s], c = e[s], l = Pe(o, c);
|
|
2045
2045
|
if (!l.valid)
|
|
2046
2046
|
return { valid: !1 };
|
|
2047
2047
|
a.push(l.data);
|
|
2048
2048
|
}
|
|
2049
2049
|
return { valid: !0, data: a };
|
|
2050
|
-
} else return t === p.date && i === p.date && +
|
|
2050
|
+
} else return t === p.date && i === p.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
2051
2051
|
}
|
|
2052
2052
|
class ce extends _ {
|
|
2053
2053
|
_parse(e) {
|
|
2054
2054
|
const { status: t, ctx: i } = this._processInputParams(e), a = (s, o) => {
|
|
2055
2055
|
if (Oe(s) || Oe(o))
|
|
2056
2056
|
return y;
|
|
2057
|
-
const c =
|
|
2058
|
-
return c.valid ? ((
|
|
2057
|
+
const c = Pe(s.value, o.value);
|
|
2058
|
+
return c.valid ? ((De(s) || De(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(i, {
|
|
2059
2059
|
code: d.invalid_intersection_types
|
|
2060
2060
|
}), y);
|
|
2061
2061
|
};
|
|
@@ -2081,13 +2081,13 @@ class ce extends _ {
|
|
|
2081
2081
|
}));
|
|
2082
2082
|
}
|
|
2083
2083
|
}
|
|
2084
|
-
ce.create = (
|
|
2085
|
-
left:
|
|
2084
|
+
ce.create = (r, e, t) => new ce({
|
|
2085
|
+
left: r,
|
|
2086
2086
|
right: e,
|
|
2087
2087
|
typeName: g.ZodIntersection,
|
|
2088
2088
|
...v(t)
|
|
2089
2089
|
});
|
|
2090
|
-
class
|
|
2090
|
+
class P extends _ {
|
|
2091
2091
|
_parse(e) {
|
|
2092
2092
|
const { status: t, ctx: i } = this._processInputParams(e);
|
|
2093
2093
|
if (i.parsedType !== p.array)
|
|
@@ -2113,7 +2113,7 @@ class D extends _ {
|
|
|
2113
2113
|
}), t.dirty());
|
|
2114
2114
|
const s = [...i.data].map((o, c) => {
|
|
2115
2115
|
const l = this._def.items[c] || this._def.rest;
|
|
2116
|
-
return l ? l._parse(new
|
|
2116
|
+
return l ? l._parse(new D(i, o, i.path, c)) : null;
|
|
2117
2117
|
}).filter((o) => !!o);
|
|
2118
2118
|
return i.common.async ? Promise.all(s).then((o) => T.mergeArray(t, o)) : T.mergeArray(t, s);
|
|
2119
2119
|
}
|
|
@@ -2121,17 +2121,17 @@ class D extends _ {
|
|
|
2121
2121
|
return this._def.items;
|
|
2122
2122
|
}
|
|
2123
2123
|
rest(e) {
|
|
2124
|
-
return new
|
|
2124
|
+
return new P({
|
|
2125
2125
|
...this._def,
|
|
2126
2126
|
rest: e
|
|
2127
2127
|
});
|
|
2128
2128
|
}
|
|
2129
2129
|
}
|
|
2130
|
-
|
|
2131
|
-
if (!Array.isArray(
|
|
2130
|
+
P.create = (r, e) => {
|
|
2131
|
+
if (!Array.isArray(r))
|
|
2132
2132
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2133
|
-
return new
|
|
2134
|
-
items:
|
|
2133
|
+
return new P({
|
|
2134
|
+
items: r,
|
|
2135
2135
|
typeName: g.ZodTuple,
|
|
2136
2136
|
rest: null,
|
|
2137
2137
|
...v(e)
|
|
@@ -2155,8 +2155,8 @@ class ue extends _ {
|
|
|
2155
2155
|
const a = [], s = this._def.keyType, o = this._def.valueType;
|
|
2156
2156
|
for (const c in i.data)
|
|
2157
2157
|
a.push({
|
|
2158
|
-
key: s._parse(new
|
|
2159
|
-
value: o._parse(new
|
|
2158
|
+
key: s._parse(new D(i, c, i.path, c)),
|
|
2159
|
+
value: o._parse(new D(i, i.data[c], i.path, c)),
|
|
2160
2160
|
alwaysSet: c in i.data
|
|
2161
2161
|
});
|
|
2162
2162
|
return i.common.async ? T.mergeObjectAsync(t, a) : T.mergeObjectSync(t, a);
|
|
@@ -2194,8 +2194,8 @@ class we extends _ {
|
|
|
2194
2194
|
received: i.parsedType
|
|
2195
2195
|
}), y;
|
|
2196
2196
|
const a = this._def.keyType, s = this._def.valueType, o = [...i.data.entries()].map(([c, l], u) => ({
|
|
2197
|
-
key: a._parse(new
|
|
2198
|
-
value: s._parse(new
|
|
2197
|
+
key: a._parse(new D(i, c, i.path, [u, "key"])),
|
|
2198
|
+
value: s._parse(new D(i, l, i.path, [u, "value"]))
|
|
2199
2199
|
}));
|
|
2200
2200
|
if (i.common.async) {
|
|
2201
2201
|
const c = /* @__PURE__ */ new Map();
|
|
@@ -2220,9 +2220,9 @@ class we extends _ {
|
|
|
2220
2220
|
}
|
|
2221
2221
|
}
|
|
2222
2222
|
}
|
|
2223
|
-
we.create = (
|
|
2223
|
+
we.create = (r, e, t) => new we({
|
|
2224
2224
|
valueType: e,
|
|
2225
|
-
keyType:
|
|
2225
|
+
keyType: r,
|
|
2226
2226
|
typeName: g.ZodMap,
|
|
2227
2227
|
...v(t)
|
|
2228
2228
|
});
|
|
@@ -2261,7 +2261,7 @@ class W extends _ {
|
|
|
2261
2261
|
}
|
|
2262
2262
|
return { status: t.value, value: u };
|
|
2263
2263
|
}
|
|
2264
|
-
const c = [...i.data.values()].map((l, u) => s._parse(new
|
|
2264
|
+
const c = [...i.data.values()].map((l, u) => s._parse(new D(i, l, i.path, u)));
|
|
2265
2265
|
return i.common.async ? Promise.all(c).then((l) => o(l)) : o(c);
|
|
2266
2266
|
}
|
|
2267
2267
|
min(e, t) {
|
|
@@ -2283,8 +2283,8 @@ class W extends _ {
|
|
|
2283
2283
|
return this.min(1, e);
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
2286
|
-
W.create = (
|
|
2287
|
-
valueType:
|
|
2286
|
+
W.create = (r, e) => new W({
|
|
2287
|
+
valueType: r,
|
|
2288
2288
|
minSize: null,
|
|
2289
2289
|
maxSize: null,
|
|
2290
2290
|
typeName: g.ZodSet,
|
|
@@ -2367,7 +2367,7 @@ class X extends _ {
|
|
|
2367
2367
|
args(...e) {
|
|
2368
2368
|
return new X({
|
|
2369
2369
|
...this._def,
|
|
2370
|
-
args:
|
|
2370
|
+
args: P.create(e).rest(U.create())
|
|
2371
2371
|
});
|
|
2372
2372
|
}
|
|
2373
2373
|
returns(e) {
|
|
@@ -2384,7 +2384,7 @@ class X extends _ {
|
|
|
2384
2384
|
}
|
|
2385
2385
|
static create(e, t, i) {
|
|
2386
2386
|
return new X({
|
|
2387
|
-
args: e ||
|
|
2387
|
+
args: e || P.create([]).rest(U.create()),
|
|
2388
2388
|
returns: t || U.create(),
|
|
2389
2389
|
typeName: g.ZodFunction,
|
|
2390
2390
|
...v(i)
|
|
@@ -2400,8 +2400,8 @@ class de extends _ {
|
|
|
2400
2400
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2401
2401
|
}
|
|
2402
2402
|
}
|
|
2403
|
-
de.create = (
|
|
2404
|
-
getter:
|
|
2403
|
+
de.create = (r, e) => new de({
|
|
2404
|
+
getter: r,
|
|
2405
2405
|
typeName: g.ZodLazy,
|
|
2406
2406
|
...v(e)
|
|
2407
2407
|
});
|
|
@@ -2421,14 +2421,14 @@ class le extends _ {
|
|
|
2421
2421
|
return this._def.value;
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
|
-
le.create = (
|
|
2425
|
-
value:
|
|
2424
|
+
le.create = (r, e) => new le({
|
|
2425
|
+
value: r,
|
|
2426
2426
|
typeName: g.ZodLiteral,
|
|
2427
2427
|
...v(e)
|
|
2428
2428
|
});
|
|
2429
|
-
function Ge(
|
|
2429
|
+
function Ge(r, e) {
|
|
2430
2430
|
return new L({
|
|
2431
|
-
values:
|
|
2431
|
+
values: r,
|
|
2432
2432
|
typeName: g.ZodEnum,
|
|
2433
2433
|
...v(e)
|
|
2434
2434
|
});
|
|
@@ -2521,8 +2521,8 @@ class me extends _ {
|
|
|
2521
2521
|
}
|
|
2522
2522
|
}
|
|
2523
2523
|
ne = /* @__PURE__ */ new WeakMap();
|
|
2524
|
-
me.create = (
|
|
2525
|
-
values:
|
|
2524
|
+
me.create = (r, e) => new me({
|
|
2525
|
+
values: r,
|
|
2526
2526
|
typeName: g.ZodNativeEnum,
|
|
2527
2527
|
...v(e)
|
|
2528
2528
|
});
|
|
@@ -2545,8 +2545,8 @@ class H extends _ {
|
|
|
2545
2545
|
})));
|
|
2546
2546
|
}
|
|
2547
2547
|
}
|
|
2548
|
-
H.create = (
|
|
2549
|
-
type:
|
|
2548
|
+
H.create = (r, e) => new H({
|
|
2549
|
+
type: r,
|
|
2550
2550
|
typeName: g.ZodPromise,
|
|
2551
2551
|
...v(e)
|
|
2552
2552
|
});
|
|
@@ -2627,15 +2627,15 @@ class j extends _ {
|
|
|
2627
2627
|
b.assertNever(a);
|
|
2628
2628
|
}
|
|
2629
2629
|
}
|
|
2630
|
-
j.create = (
|
|
2631
|
-
schema:
|
|
2630
|
+
j.create = (r, e, t) => new j({
|
|
2631
|
+
schema: r,
|
|
2632
2632
|
typeName: g.ZodEffects,
|
|
2633
2633
|
effect: e,
|
|
2634
2634
|
...v(t)
|
|
2635
2635
|
});
|
|
2636
|
-
j.createWithPreprocess = (
|
|
2636
|
+
j.createWithPreprocess = (r, e, t) => new j({
|
|
2637
2637
|
schema: e,
|
|
2638
|
-
effect: { type: "preprocess", transform:
|
|
2638
|
+
effect: { type: "preprocess", transform: r },
|
|
2639
2639
|
typeName: g.ZodEffects,
|
|
2640
2640
|
...v(t)
|
|
2641
2641
|
});
|
|
@@ -2647,8 +2647,8 @@ class O extends _ {
|
|
|
2647
2647
|
return this._def.innerType;
|
|
2648
2648
|
}
|
|
2649
2649
|
}
|
|
2650
|
-
O.create = (
|
|
2651
|
-
innerType:
|
|
2650
|
+
O.create = (r, e) => new O({
|
|
2651
|
+
innerType: r,
|
|
2652
2652
|
typeName: g.ZodOptional,
|
|
2653
2653
|
...v(e)
|
|
2654
2654
|
});
|
|
@@ -2660,8 +2660,8 @@ class F extends _ {
|
|
|
2660
2660
|
return this._def.innerType;
|
|
2661
2661
|
}
|
|
2662
2662
|
}
|
|
2663
|
-
F.create = (
|
|
2664
|
-
innerType:
|
|
2663
|
+
F.create = (r, e) => new F({
|
|
2664
|
+
innerType: r,
|
|
2665
2665
|
typeName: g.ZodNullable,
|
|
2666
2666
|
...v(e)
|
|
2667
2667
|
});
|
|
@@ -2679,8 +2679,8 @@ class pe extends _ {
|
|
|
2679
2679
|
return this._def.innerType;
|
|
2680
2680
|
}
|
|
2681
2681
|
}
|
|
2682
|
-
pe.create = (
|
|
2683
|
-
innerType:
|
|
2682
|
+
pe.create = (r, e) => new pe({
|
|
2683
|
+
innerType: r,
|
|
2684
2684
|
typeName: g.ZodDefault,
|
|
2685
2685
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2686
2686
|
...v(e)
|
|
@@ -2722,8 +2722,8 @@ class fe extends _ {
|
|
|
2722
2722
|
return this._def.innerType;
|
|
2723
2723
|
}
|
|
2724
2724
|
}
|
|
2725
|
-
fe.create = (
|
|
2726
|
-
innerType:
|
|
2725
|
+
fe.create = (r, e) => new fe({
|
|
2726
|
+
innerType: r,
|
|
2727
2727
|
typeName: g.ZodCatch,
|
|
2728
2728
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2729
2729
|
...v(e)
|
|
@@ -2741,9 +2741,9 @@ class Te extends _ {
|
|
|
2741
2741
|
return { status: "valid", value: e.data };
|
|
2742
2742
|
}
|
|
2743
2743
|
}
|
|
2744
|
-
Te.create = (
|
|
2744
|
+
Te.create = (r) => new Te({
|
|
2745
2745
|
typeName: g.ZodNaN,
|
|
2746
|
-
...v(
|
|
2746
|
+
...v(r)
|
|
2747
2747
|
});
|
|
2748
2748
|
const Et = Symbol("zod_brand");
|
|
2749
2749
|
class Re extends _ {
|
|
@@ -2808,19 +2808,19 @@ class he extends _ {
|
|
|
2808
2808
|
return this._def.innerType;
|
|
2809
2809
|
}
|
|
2810
2810
|
}
|
|
2811
|
-
he.create = (
|
|
2812
|
-
innerType:
|
|
2811
|
+
he.create = (r, e) => new he({
|
|
2812
|
+
innerType: r,
|
|
2813
2813
|
typeName: g.ZodReadonly,
|
|
2814
2814
|
...v(e)
|
|
2815
2815
|
});
|
|
2816
|
-
function Le(
|
|
2817
|
-
const t = typeof
|
|
2816
|
+
function Le(r, e) {
|
|
2817
|
+
const t = typeof r == "function" ? r(e) : typeof r == "string" ? { message: r } : r;
|
|
2818
2818
|
return typeof t == "string" ? { message: t } : t;
|
|
2819
2819
|
}
|
|
2820
|
-
function Je(
|
|
2821
|
-
return
|
|
2820
|
+
function Je(r, e = {}, t) {
|
|
2821
|
+
return r ? J.create().superRefine((i, a) => {
|
|
2822
2822
|
var s, o;
|
|
2823
|
-
const c =
|
|
2823
|
+
const c = r(i);
|
|
2824
2824
|
if (c instanceof Promise)
|
|
2825
2825
|
return c.then((l) => {
|
|
2826
2826
|
var u, f;
|
|
@@ -2839,22 +2839,22 @@ const Rt = {
|
|
|
2839
2839
|
object: k.lazycreate
|
|
2840
2840
|
};
|
|
2841
2841
|
var g;
|
|
2842
|
-
(function(
|
|
2843
|
-
|
|
2842
|
+
(function(r) {
|
|
2843
|
+
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
2844
2844
|
})(g || (g = {}));
|
|
2845
|
-
const $t = (
|
|
2846
|
-
message: `Input not instance of ${
|
|
2847
|
-
}) => Je((t) => t instanceof
|
|
2848
|
-
string: (
|
|
2849
|
-
number: (
|
|
2850
|
-
boolean: (
|
|
2851
|
-
...
|
|
2845
|
+
const $t = (r, e = {
|
|
2846
|
+
message: `Input not instance of ${r.name}`
|
|
2847
|
+
}) => Je((t) => t instanceof r, e), He = N.create, Ke = z.create, Mt = Te.create, zt = V.create, et = ie.create, Vt = B.create, Lt = xe.create, Ft = ae.create, Ut = se.create, qt = J.create, Bt = U.create, Wt = M.create, Qt = ke.create, Yt = C.create, Xt = k.create, Gt = k.strictCreate, Jt = oe.create, Ht = Se.create, Kt = ce.create, en = P.create, tn = ue.create, nn = we.create, rn = W.create, an = X.create, sn = de.create, on = le.create, cn = L.create, un = me.create, dn = H.create, Fe = j.create, ln = O.create, mn = F.create, pn = j.createWithPreprocess, fn = ge.create, hn = () => He().optional(), gn = () => Ke().optional(), yn = () => et().optional(), vn = {
|
|
2848
|
+
string: (r) => N.create({ ...r, coerce: !0 }),
|
|
2849
|
+
number: (r) => z.create({ ...r, coerce: !0 }),
|
|
2850
|
+
boolean: (r) => ie.create({
|
|
2851
|
+
...r,
|
|
2852
2852
|
coerce: !0
|
|
2853
2853
|
}),
|
|
2854
|
-
bigint: (
|
|
2855
|
-
date: (
|
|
2854
|
+
bigint: (r) => V.create({ ...r, coerce: !0 }),
|
|
2855
|
+
date: (r) => B.create({ ...r, coerce: !0 })
|
|
2856
2856
|
}, _n = y;
|
|
2857
|
-
var
|
|
2857
|
+
var n = /* @__PURE__ */ Object.freeze({
|
|
2858
2858
|
__proto__: null,
|
|
2859
2859
|
defaultErrorMap: G,
|
|
2860
2860
|
setErrorMap: mt,
|
|
@@ -2867,7 +2867,7 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2867
2867
|
DIRTY: Y,
|
|
2868
2868
|
OK: S,
|
|
2869
2869
|
isAborted: Oe,
|
|
2870
|
-
isDirty:
|
|
2870
|
+
isDirty: De,
|
|
2871
2871
|
isValid: q,
|
|
2872
2872
|
isAsync: re,
|
|
2873
2873
|
get util() {
|
|
@@ -2897,7 +2897,7 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2897
2897
|
ZodUnion: oe,
|
|
2898
2898
|
ZodDiscriminatedUnion: Se,
|
|
2899
2899
|
ZodIntersection: ce,
|
|
2900
|
-
ZodTuple:
|
|
2900
|
+
ZodTuple: P,
|
|
2901
2901
|
ZodRecord: ue,
|
|
2902
2902
|
ZodMap: we,
|
|
2903
2903
|
ZodSet: W,
|
|
@@ -2970,290 +2970,290 @@ var r = /* @__PURE__ */ Object.freeze({
|
|
|
2970
2970
|
quotelessJson: lt,
|
|
2971
2971
|
ZodError: A
|
|
2972
2972
|
});
|
|
2973
|
-
const Ie =
|
|
2974
|
-
country:
|
|
2975
|
-
city:
|
|
2976
|
-
street:
|
|
2977
|
-
streetNumber:
|
|
2978
|
-
floor:
|
|
2979
|
-
apartmentEnterNumber:
|
|
2980
|
-
apartmentNumber:
|
|
2981
|
-
zip:
|
|
2982
|
-
}), $ =
|
|
2983
|
-
function Bn(
|
|
2984
|
-
return !!(
|
|
2985
|
-
}
|
|
2986
|
-
const ye =
|
|
2987
|
-
lang:
|
|
2988
|
-
value:
|
|
2989
|
-
}), tt =
|
|
2990
|
-
id:
|
|
2991
|
-
companyId:
|
|
2992
|
-
storeId:
|
|
2993
|
-
parentId:
|
|
2994
|
-
tag:
|
|
2995
|
-
locales:
|
|
2996
|
-
depth:
|
|
2973
|
+
const Ie = n.object({
|
|
2974
|
+
country: n.string().optional(),
|
|
2975
|
+
city: n.string().optional(),
|
|
2976
|
+
street: n.string().optional(),
|
|
2977
|
+
streetNumber: n.string().optional(),
|
|
2978
|
+
floor: n.string().optional(),
|
|
2979
|
+
apartmentEnterNumber: n.string().optional(),
|
|
2980
|
+
apartmentNumber: n.string().optional(),
|
|
2981
|
+
zip: n.string().optional()
|
|
2982
|
+
}), $ = n.string().min(1, { message: "שדה חובה" }), Un = n.string().regex(/^\d+$/, "Must be a numeric string"), qn = n.object({ url: n.string().url(), id: n.string() });
|
|
2983
|
+
function Bn(r) {
|
|
2984
|
+
return !!(r != null && r.url);
|
|
2985
|
+
}
|
|
2986
|
+
const ye = n.object({
|
|
2987
|
+
lang: n.enum(["he"]),
|
|
2988
|
+
value: n.string()
|
|
2989
|
+
}), tt = n.object({
|
|
2990
|
+
id: n.string().min(1),
|
|
2991
|
+
companyId: n.string().min(1),
|
|
2992
|
+
storeId: n.string().min(1),
|
|
2993
|
+
parentId: n.string().nullish(),
|
|
2994
|
+
tag: n.string().optional(),
|
|
2995
|
+
locales: n.array(ye),
|
|
2996
|
+
depth: n.number()
|
|
2997
2997
|
}), $e = tt.extend({
|
|
2998
|
-
children:
|
|
2998
|
+
children: n.lazy(() => $e.array())
|
|
2999
2999
|
}), Wn = tt.extend({
|
|
3000
|
-
index:
|
|
3001
|
-
depth:
|
|
3002
|
-
collapsed:
|
|
3003
|
-
children:
|
|
3004
|
-
}), ee =
|
|
3005
|
-
type:
|
|
3000
|
+
index: n.number(),
|
|
3001
|
+
depth: n.number(),
|
|
3002
|
+
collapsed: n.boolean().optional(),
|
|
3003
|
+
children: n.array($e)
|
|
3004
|
+
}), ee = n.string().min(1), Me = n.object({
|
|
3005
|
+
type: n.literal("Product"),
|
|
3006
3006
|
storeId: ee,
|
|
3007
3007
|
companyId: ee,
|
|
3008
3008
|
id: ee,
|
|
3009
3009
|
objectID: ee,
|
|
3010
3010
|
sku: ee,
|
|
3011
|
-
name:
|
|
3012
|
-
description:
|
|
3013
|
-
isPublished:
|
|
3014
|
-
vat:
|
|
3015
|
-
priceType:
|
|
3016
|
-
type:
|
|
3017
|
-
value:
|
|
3011
|
+
name: n.array(ye),
|
|
3012
|
+
description: n.array(ye),
|
|
3013
|
+
isPublished: n.boolean(),
|
|
3014
|
+
vat: n.boolean(),
|
|
3015
|
+
priceType: n.object({
|
|
3016
|
+
type: n.enum(["unit", "kg", "gram", "liter", "ml"]),
|
|
3017
|
+
value: n.number()
|
|
3018
3018
|
}),
|
|
3019
|
-
price:
|
|
3020
|
-
purchasePrice:
|
|
3021
|
-
profitPercentage:
|
|
3022
|
-
currency:
|
|
3023
|
-
discount:
|
|
3024
|
-
type:
|
|
3025
|
-
value:
|
|
3019
|
+
price: n.number().positive(),
|
|
3020
|
+
purchasePrice: n.number().optional(),
|
|
3021
|
+
profitPercentage: n.number().optional(),
|
|
3022
|
+
currency: n.literal("ILS"),
|
|
3023
|
+
discount: n.object({
|
|
3024
|
+
type: n.enum(["number", "percent", "none"]),
|
|
3025
|
+
value: n.number()
|
|
3026
3026
|
}),
|
|
3027
|
-
isDiscountable:
|
|
3028
|
-
weight:
|
|
3029
|
-
value:
|
|
3030
|
-
unit:
|
|
3027
|
+
isDiscountable: n.boolean({ description: "included in store discounts" }).optional(),
|
|
3028
|
+
weight: n.object({
|
|
3029
|
+
value: n.number(),
|
|
3030
|
+
unit: n.enum(["kg", "gram", "none"])
|
|
3031
3031
|
}),
|
|
3032
|
-
volume:
|
|
3033
|
-
value:
|
|
3034
|
-
unit:
|
|
3032
|
+
volume: n.object({
|
|
3033
|
+
value: n.number(),
|
|
3034
|
+
unit: n.enum(["liter", "ml", "none"])
|
|
3035
3035
|
}),
|
|
3036
|
-
images:
|
|
3037
|
-
manufacturer:
|
|
3038
|
-
brand:
|
|
3039
|
-
importer:
|
|
3040
|
-
supplier:
|
|
3041
|
-
ingredients:
|
|
3042
|
-
created_at:
|
|
3043
|
-
updated_at:
|
|
3044
|
-
categoryIds:
|
|
3045
|
-
stock:
|
|
3046
|
-
quantity:
|
|
3047
|
-
unit:
|
|
3036
|
+
images: n.array(n.object({ url: n.string().url(), id: n.string() })),
|
|
3037
|
+
manufacturer: n.string(),
|
|
3038
|
+
brand: n.string(),
|
|
3039
|
+
importer: n.string(),
|
|
3040
|
+
supplier: n.string(),
|
|
3041
|
+
ingredients: n.array(ye),
|
|
3042
|
+
created_at: n.number(),
|
|
3043
|
+
updated_at: n.number(),
|
|
3044
|
+
categoryIds: n.array(n.string().nonempty()),
|
|
3045
|
+
stock: n.object({
|
|
3046
|
+
quantity: n.number().min(0),
|
|
3047
|
+
unit: n.enum(["piece", "kg", "gram", "liter", "ml"])
|
|
3048
3048
|
}).optional(),
|
|
3049
3049
|
// @deprecated
|
|
3050
|
-
categoryList:
|
|
3050
|
+
categoryList: n.array($e).optional(),
|
|
3051
3051
|
// @deprecated
|
|
3052
|
-
categories:
|
|
3053
|
-
lvl0:
|
|
3054
|
-
lvl1:
|
|
3055
|
-
lvl2:
|
|
3056
|
-
lvl3:
|
|
3057
|
-
lvl4:
|
|
3052
|
+
categories: n.object({
|
|
3053
|
+
lvl0: n.array(n.string()),
|
|
3054
|
+
lvl1: n.array(n.string()),
|
|
3055
|
+
lvl2: n.array(n.string()),
|
|
3056
|
+
lvl3: n.array(n.string()),
|
|
3057
|
+
lvl4: n.array(n.string())
|
|
3058
3058
|
}).optional(),
|
|
3059
3059
|
// @deprecated
|
|
3060
|
-
categoryNames:
|
|
3060
|
+
categoryNames: n.array(n.string()).optional()
|
|
3061
3061
|
}), Qn = Me.extend({
|
|
3062
|
-
image:
|
|
3063
|
-
}), bn =
|
|
3062
|
+
image: n.instanceof(File).optional()
|
|
3063
|
+
}), bn = n.enum(["delivered", "missing", "substituted"]), xn = n.object({
|
|
3064
3064
|
product: Me,
|
|
3065
|
-
amount:
|
|
3066
|
-
price:
|
|
3067
|
-
}), nt =
|
|
3065
|
+
amount: n.number().positive(),
|
|
3066
|
+
price: n.number()
|
|
3067
|
+
}), nt = n.object({
|
|
3068
3068
|
product: Me,
|
|
3069
|
-
originalPrice:
|
|
3070
|
-
finalPrice:
|
|
3071
|
-
finalDiscount:
|
|
3072
|
-
amount:
|
|
3069
|
+
originalPrice: n.number().optional(),
|
|
3070
|
+
finalPrice: n.number().optional(),
|
|
3071
|
+
finalDiscount: n.number().optional(),
|
|
3072
|
+
amount: n.number().positive({ message: "Quantity must be a positive number." }),
|
|
3073
3073
|
// Picking / fulfillment — optional so existing items stay valid (treated as "delivered").
|
|
3074
3074
|
status: bn.optional(),
|
|
3075
3075
|
substitutedWith: xn.nullable().optional()
|
|
3076
|
-
}), Yn =
|
|
3077
|
-
type:
|
|
3078
|
-
id:
|
|
3079
|
-
companyId:
|
|
3080
|
-
storeId:
|
|
3081
|
-
userId:
|
|
3082
|
-
status:
|
|
3083
|
-
items:
|
|
3084
|
-
}), Xn =
|
|
3085
|
-
id:
|
|
3086
|
-
name:
|
|
3087
|
-
websiteDomains:
|
|
3088
|
-
}), Gn =
|
|
3089
|
-
type:
|
|
3090
|
-
id:
|
|
3091
|
-
companyId:
|
|
3092
|
-
storeId:
|
|
3093
|
-
userId:
|
|
3094
|
-
productId:
|
|
3095
|
-
}), Ae =
|
|
3096
|
-
type:
|
|
3076
|
+
}), Yn = n.object({
|
|
3077
|
+
type: n.literal("Cart"),
|
|
3078
|
+
id: n.string().uuid(),
|
|
3079
|
+
companyId: n.string().uuid(),
|
|
3080
|
+
storeId: n.string().uuid(),
|
|
3081
|
+
userId: n.string().uuid(),
|
|
3082
|
+
status: n.enum(["active", "draft", "completed"]),
|
|
3083
|
+
items: n.array(nt)
|
|
3084
|
+
}), Xn = n.object({
|
|
3085
|
+
id: n.string(),
|
|
3086
|
+
name: n.string(),
|
|
3087
|
+
websiteDomains: n.array(n.string())
|
|
3088
|
+
}), Gn = n.object({
|
|
3089
|
+
type: n.literal("FavoriteProduct"),
|
|
3090
|
+
id: n.string().uuid(),
|
|
3091
|
+
companyId: n.string().uuid(),
|
|
3092
|
+
storeId: n.string().uuid(),
|
|
3093
|
+
userId: n.string().uuid(),
|
|
3094
|
+
productId: n.string().uuid()
|
|
3095
|
+
}), Ae = n.enum(["external", "j5", "none"]), kn = n.object({
|
|
3096
|
+
type: n.literal("Profile"),
|
|
3097
3097
|
id: $,
|
|
3098
3098
|
companyId: $,
|
|
3099
3099
|
storeId: $,
|
|
3100
3100
|
tenantId: $,
|
|
3101
3101
|
// @deprecated
|
|
3102
|
-
clientType:
|
|
3103
|
-
companyName:
|
|
3102
|
+
clientType: n.enum(["user", "company"]),
|
|
3103
|
+
companyName: n.string().optional(),
|
|
3104
3104
|
displayName: $,
|
|
3105
|
-
email:
|
|
3106
|
-
phoneNumber:
|
|
3105
|
+
email: n.string().email(),
|
|
3106
|
+
phoneNumber: n.string().optional(),
|
|
3107
3107
|
address: Ie.optional(),
|
|
3108
|
-
isAnonymous:
|
|
3109
|
-
createdDate:
|
|
3110
|
-
lastActivityDate:
|
|
3108
|
+
isAnonymous: n.boolean(),
|
|
3109
|
+
createdDate: n.number(),
|
|
3110
|
+
lastActivityDate: n.number(),
|
|
3111
3111
|
//todo
|
|
3112
3112
|
paymentType: Ae.optional(),
|
|
3113
3113
|
/** @deprecated Use organizationIds instead */
|
|
3114
|
-
organizationId:
|
|
3114
|
+
organizationId: n.string().optional().nullable(),
|
|
3115
3115
|
/** Array of organization IDs this user belongs to */
|
|
3116
|
-
organizationIds:
|
|
3117
|
-
}), rt =
|
|
3118
|
-
_COMMENT:
|
|
3119
|
-
transaction_id:
|
|
3120
|
-
date:
|
|
3121
|
-
currency:
|
|
3122
|
-
rate:
|
|
3123
|
-
vat:
|
|
3124
|
-
vat_price:
|
|
3125
|
-
price_discount:
|
|
3126
|
-
price_discount_in_currency:
|
|
3127
|
-
price_total:
|
|
3128
|
-
price_total_in_currency:
|
|
3129
|
-
}), wn =
|
|
3130
|
-
doc_uuid:
|
|
3131
|
-
pdf_link:
|
|
3132
|
-
pdf_link_copy:
|
|
3133
|
-
doc_number:
|
|
3134
|
-
sent_mails:
|
|
3135
|
-
success:
|
|
3136
|
-
ua_uuid:
|
|
3116
|
+
organizationIds: n.array(n.string()).optional()
|
|
3117
|
+
}), rt = n.object({
|
|
3118
|
+
_COMMENT: n.string().optional(),
|
|
3119
|
+
transaction_id: n.string(),
|
|
3120
|
+
date: n.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be in YYYY-MM-DD format"),
|
|
3121
|
+
currency: n.string().length(3, "Currency must be 3 characters"),
|
|
3122
|
+
rate: n.number().positive(),
|
|
3123
|
+
vat: n.string().regex(/^\d+\.\d{2}$/, "VAT must be in format XX.XX"),
|
|
3124
|
+
vat_price: n.number().positive(),
|
|
3125
|
+
price_discount: n.number(),
|
|
3126
|
+
price_discount_in_currency: n.number(),
|
|
3127
|
+
price_total: n.string().regex(/^\d+\.\d{2}$/, "Price total must be in format XX.XX"),
|
|
3128
|
+
price_total_in_currency: n.number().positive()
|
|
3129
|
+
}), wn = n.object({
|
|
3130
|
+
doc_uuid: n.string().uuid("Document UUID must be a valid UUID"),
|
|
3131
|
+
pdf_link: n.string().url("PDF link must be a valid URL"),
|
|
3132
|
+
pdf_link_copy: n.string().url("PDF copy link must be a valid URL"),
|
|
3133
|
+
doc_number: n.string().min(1, "Document number is required"),
|
|
3134
|
+
sent_mails: n.array(n.string().email("Each email must be valid")),
|
|
3135
|
+
success: n.boolean(),
|
|
3136
|
+
ua_uuid: n.string().uuid("UA UUID must be a valid UUID"),
|
|
3137
3137
|
calculatedData: rt,
|
|
3138
|
-
warning:
|
|
3139
|
-
date:
|
|
3140
|
-
}), Tn =
|
|
3141
|
-
id:
|
|
3142
|
-
number:
|
|
3143
|
-
date:
|
|
3144
|
-
createdAt:
|
|
3145
|
-
status:
|
|
3146
|
-
companyDetails:
|
|
3147
|
-
name:
|
|
3148
|
-
address:
|
|
3149
|
-
phone:
|
|
3150
|
-
email:
|
|
3138
|
+
warning: n.string().optional(),
|
|
3139
|
+
date: n.number().optional()
|
|
3140
|
+
}), Tn = n.object({
|
|
3141
|
+
id: n.string().min(1, "ID is required"),
|
|
3142
|
+
number: n.string().min(1, "Number is required"),
|
|
3143
|
+
date: n.number().min(1, "Date is required"),
|
|
3144
|
+
createdAt: n.number().min(1, "Created at is required"),
|
|
3145
|
+
status: n.enum(["pending", "paid", "cancelled"]),
|
|
3146
|
+
companyDetails: n.object({
|
|
3147
|
+
name: n.string().min(1, "Name is required").optional(),
|
|
3148
|
+
address: n.string().min(1, "Address is required").optional(),
|
|
3149
|
+
phone: n.string().min(1, "Phone is required").optional(),
|
|
3150
|
+
email: n.string().email("Email must be valid").optional()
|
|
3151
3151
|
}).optional(),
|
|
3152
|
-
clientDetails:
|
|
3153
|
-
name:
|
|
3154
|
-
address:
|
|
3155
|
-
phone:
|
|
3156
|
-
email:
|
|
3152
|
+
clientDetails: n.object({
|
|
3153
|
+
name: n.string().min(1, "Name is required").optional(),
|
|
3154
|
+
address: n.string().min(1, "Address is required").optional(),
|
|
3155
|
+
phone: n.string().min(1, "Phone is required").optional(),
|
|
3156
|
+
email: n.string().email("Email must be valid").optional()
|
|
3157
3157
|
}).optional(),
|
|
3158
|
-
items:
|
|
3159
|
-
|
|
3160
|
-
name:
|
|
3161
|
-
price:
|
|
3162
|
-
quantity:
|
|
3163
|
-
total:
|
|
3158
|
+
items: n.array(
|
|
3159
|
+
n.object({
|
|
3160
|
+
name: n.string().min(1, "Name is required").optional(),
|
|
3161
|
+
price: n.number().min(1, "Price is required").optional(),
|
|
3162
|
+
quantity: n.number().min(1, "Quantity is required").optional(),
|
|
3163
|
+
total: n.number().min(1, "Total is required").optional()
|
|
3164
3164
|
})
|
|
3165
3165
|
).optional(),
|
|
3166
|
-
total:
|
|
3167
|
-
vat:
|
|
3168
|
-
link:
|
|
3169
|
-
}), Sn =
|
|
3166
|
+
total: n.number().min(1, "Total is required").optional(),
|
|
3167
|
+
vat: n.number().min(1, "VAT is required").optional(),
|
|
3168
|
+
link: n.string().url("Link must be a valid URL").optional()
|
|
3169
|
+
}), Sn = n.enum([
|
|
3170
3170
|
"credit",
|
|
3171
3171
|
"net15",
|
|
3172
3172
|
"net30",
|
|
3173
3173
|
"net60",
|
|
3174
3174
|
"net90"
|
|
3175
|
-
]), it =
|
|
3176
|
-
number:
|
|
3177
|
-
name:
|
|
3178
|
-
id:
|
|
3175
|
+
]), it = n.object({
|
|
3176
|
+
number: n.string(),
|
|
3177
|
+
name: n.string(),
|
|
3178
|
+
id: n.string(),
|
|
3179
3179
|
// Optional, admin-managed billing config (see company-edit-like-demo plan, Phase 2)
|
|
3180
3180
|
payTerms: Sn.optional(),
|
|
3181
|
-
creditLimit:
|
|
3182
|
-
isPrimary:
|
|
3181
|
+
creditLimit: n.number().optional(),
|
|
3182
|
+
isPrimary: n.boolean().optional(),
|
|
3183
3183
|
// Optional category restriction — when `restricted`, the account is limited to
|
|
3184
3184
|
// `allowedCategories` (category ids). Order-time enforcement is a separate concern.
|
|
3185
|
-
restricted:
|
|
3186
|
-
allowedCategories:
|
|
3187
|
-
}), In =
|
|
3188
|
-
id:
|
|
3189
|
-
label:
|
|
3190
|
-
address:
|
|
3191
|
-
phone:
|
|
3192
|
-
isPrimary:
|
|
3193
|
-
}), An =
|
|
3194
|
-
id:
|
|
3195
|
-
name:
|
|
3196
|
-
discountPercentage:
|
|
3197
|
-
nameOnInvoice:
|
|
3198
|
-
billingAccounts:
|
|
3185
|
+
restricted: n.boolean().optional(),
|
|
3186
|
+
allowedCategories: n.array(n.string()).optional()
|
|
3187
|
+
}), In = n.object({
|
|
3188
|
+
id: n.string(),
|
|
3189
|
+
label: n.string(),
|
|
3190
|
+
address: n.string().optional(),
|
|
3191
|
+
phone: n.string().optional(),
|
|
3192
|
+
isPrimary: n.boolean().optional()
|
|
3193
|
+
}), An = n.object({
|
|
3194
|
+
id: n.string(),
|
|
3195
|
+
name: n.string(),
|
|
3196
|
+
discountPercentage: n.number().positive().min(0).max(100).optional(),
|
|
3197
|
+
nameOnInvoice: n.string().optional(),
|
|
3198
|
+
billingAccounts: n.array(it),
|
|
3199
3199
|
paymentType: Ae,
|
|
3200
|
-
companyNumber:
|
|
3200
|
+
companyNumber: n.string().optional(),
|
|
3201
3201
|
address: Ie.optional(),
|
|
3202
|
-
groupId:
|
|
3202
|
+
groupId: n.string().optional(),
|
|
3203
3203
|
// Contact / billing details (admin-managed, optional — see company-edit-like-demo plan)
|
|
3204
|
-
phone:
|
|
3205
|
-
email:
|
|
3206
|
-
notes:
|
|
3207
|
-
freeShipping:
|
|
3208
|
-
branches:
|
|
3209
|
-
}), Jn = An.omit({ id: !0 }), Ue =
|
|
3210
|
-
doc_uuid:
|
|
3211
|
-
pdf_link:
|
|
3212
|
-
pdf_link_copy:
|
|
3213
|
-
doc_number:
|
|
3214
|
-
sent_mails:
|
|
3215
|
-
success:
|
|
3216
|
-
ua_uuid:
|
|
3204
|
+
phone: n.string().optional(),
|
|
3205
|
+
email: n.string().optional(),
|
|
3206
|
+
notes: n.string().optional(),
|
|
3207
|
+
freeShipping: n.boolean().optional(),
|
|
3208
|
+
branches: n.array(In).optional()
|
|
3209
|
+
}), Jn = An.omit({ id: !0 }), Ue = n.object({
|
|
3210
|
+
doc_uuid: n.string().uuid("Document UUID must be a valid UUID"),
|
|
3211
|
+
pdf_link: n.string().url("PDF link must be a valid URL"),
|
|
3212
|
+
pdf_link_copy: n.string().url("PDF copy link must be a valid URL"),
|
|
3213
|
+
doc_number: n.string().min(1, "Document number is required"),
|
|
3214
|
+
sent_mails: n.array(n.string().email("Each email must be valid")),
|
|
3215
|
+
success: n.boolean(),
|
|
3216
|
+
ua_uuid: n.string().uuid("UA UUID must be a valid UUID"),
|
|
3217
3217
|
calculatedData: rt,
|
|
3218
|
-
warning:
|
|
3219
|
-
date:
|
|
3220
|
-
}), Nn =
|
|
3221
|
-
id:
|
|
3222
|
-
number:
|
|
3223
|
-
date:
|
|
3224
|
-
createdAt:
|
|
3225
|
-
status:
|
|
3226
|
-
companyDetails:
|
|
3227
|
-
name:
|
|
3228
|
-
address:
|
|
3229
|
-
phone:
|
|
3230
|
-
email:
|
|
3218
|
+
warning: n.string().optional(),
|
|
3219
|
+
date: n.number().optional()
|
|
3220
|
+
}), Nn = n.object({
|
|
3221
|
+
id: n.string().min(1, "ID is required"),
|
|
3222
|
+
number: n.string().min(1, "Number is required"),
|
|
3223
|
+
date: n.string().min(1, "Date is required"),
|
|
3224
|
+
createdAt: n.number().min(1, "Created at is required"),
|
|
3225
|
+
status: n.enum(["pending", "paid", "cancelled"]),
|
|
3226
|
+
companyDetails: n.object({
|
|
3227
|
+
name: n.string().min(1, "Name is required").optional(),
|
|
3228
|
+
address: n.string().min(1, "Address is required").optional(),
|
|
3229
|
+
phone: n.string().min(1, "Phone is required").optional(),
|
|
3230
|
+
email: n.string().email("Email must be valid").optional()
|
|
3231
3231
|
}).optional(),
|
|
3232
|
-
clientDetails:
|
|
3233
|
-
name:
|
|
3234
|
-
address:
|
|
3235
|
-
phone:
|
|
3236
|
-
email:
|
|
3232
|
+
clientDetails: n.object({
|
|
3233
|
+
name: n.string().min(1, "Name is required").optional(),
|
|
3234
|
+
address: n.string().min(1, "Address is required").optional(),
|
|
3235
|
+
phone: n.string().min(1, "Phone is required").optional(),
|
|
3236
|
+
email: n.string().email("Email must be valid").optional()
|
|
3237
3237
|
}).optional(),
|
|
3238
|
-
items:
|
|
3239
|
-
|
|
3240
|
-
name:
|
|
3241
|
-
price:
|
|
3242
|
-
quantity:
|
|
3243
|
-
total:
|
|
3238
|
+
items: n.array(
|
|
3239
|
+
n.object({
|
|
3240
|
+
name: n.string().min(1, "Name is required").optional(),
|
|
3241
|
+
price: n.number().min(1, "Price is required").optional(),
|
|
3242
|
+
quantity: n.number().min(1, "Quantity is required").optional(),
|
|
3243
|
+
total: n.number().min(1, "Total is required").optional()
|
|
3244
3244
|
})
|
|
3245
3245
|
).optional(),
|
|
3246
|
-
total:
|
|
3247
|
-
vat:
|
|
3248
|
-
link:
|
|
3249
|
-
}), Hn =
|
|
3250
|
-
type:
|
|
3251
|
-
createdBy:
|
|
3246
|
+
total: n.number().min(1, "Total is required").optional(),
|
|
3247
|
+
vat: n.number().min(1, "VAT is required").optional(),
|
|
3248
|
+
link: n.string().url("Link must be a valid URL").optional()
|
|
3249
|
+
}), Hn = n.object({
|
|
3250
|
+
type: n.literal("Order"),
|
|
3251
|
+
createdBy: n.enum(["user", "admin"]).optional(),
|
|
3252
3252
|
id: $,
|
|
3253
3253
|
companyId: $,
|
|
3254
3254
|
storeId: $,
|
|
3255
3255
|
userId: $,
|
|
3256
|
-
status:
|
|
3256
|
+
status: n.enum([
|
|
3257
3257
|
"draft",
|
|
3258
3258
|
// before payment
|
|
3259
3259
|
"pending",
|
|
@@ -3268,53 +3268,53 @@ const ye = r.object({
|
|
|
3268
3268
|
"refunded"
|
|
3269
3269
|
]),
|
|
3270
3270
|
paymentType: Ae.optional(),
|
|
3271
|
-
paymentStatus:
|
|
3271
|
+
paymentStatus: n.enum(["pending", "pending_j5", "external", "completed", "failed", "refunded"]),
|
|
3272
3272
|
//todo check if hyp support partial refund
|
|
3273
|
-
cart:
|
|
3274
|
-
id:
|
|
3275
|
-
items:
|
|
3276
|
-
cartDiscount:
|
|
3277
|
-
cartTotal:
|
|
3278
|
-
cartVat:
|
|
3279
|
-
deliveryPrice:
|
|
3273
|
+
cart: n.object({
|
|
3274
|
+
id: n.string(),
|
|
3275
|
+
items: n.array(nt),
|
|
3276
|
+
cartDiscount: n.number(),
|
|
3277
|
+
cartTotal: n.number(),
|
|
3278
|
+
cartVat: n.number(),
|
|
3279
|
+
deliveryPrice: n.number().optional()
|
|
3280
3280
|
// final delivery price for cart
|
|
3281
3281
|
}),
|
|
3282
|
-
storeOptions:
|
|
3283
|
-
deliveryPrice:
|
|
3284
|
-
freeDeliveryPrice:
|
|
3285
|
-
isVatIncludedInPrice:
|
|
3282
|
+
storeOptions: n.object({
|
|
3283
|
+
deliveryPrice: n.number().optional(),
|
|
3284
|
+
freeDeliveryPrice: n.number().optional(),
|
|
3285
|
+
isVatIncludedInPrice: n.boolean().optional(),
|
|
3286
3286
|
// True when the ordering organization is exempt from delivery fees
|
|
3287
3287
|
// ("פטור מדמי משלוח"). Persisted so any later recompute (admin edit,
|
|
3288
3288
|
// invoice generation) keeps the exemption.
|
|
3289
|
-
freeShipping:
|
|
3289
|
+
freeShipping: n.boolean().optional()
|
|
3290
3290
|
}).optional(),
|
|
3291
|
-
originalAmount:
|
|
3291
|
+
originalAmount: n.number().positive().optional(),
|
|
3292
3292
|
// what client pay
|
|
3293
|
-
actualAmount:
|
|
3293
|
+
actualAmount: n.number().positive().optional(),
|
|
3294
3294
|
// what store charge
|
|
3295
|
-
date:
|
|
3296
|
-
deliveryDate:
|
|
3295
|
+
date: n.number(),
|
|
3296
|
+
deliveryDate: n.coerce.number(),
|
|
3297
3297
|
client: kn.optional(),
|
|
3298
3298
|
address: Ie.optional(),
|
|
3299
|
-
nameOnInvoice:
|
|
3300
|
-
emailOnInvoice:
|
|
3301
|
-
phoneNumberOnInvoice:
|
|
3302
|
-
clientComment:
|
|
3299
|
+
nameOnInvoice: n.string().optional(),
|
|
3300
|
+
emailOnInvoice: n.string().email().optional(),
|
|
3301
|
+
phoneNumberOnInvoice: n.string().optional(),
|
|
3302
|
+
clientComment: n.string().optional(),
|
|
3303
3303
|
// --- B2B buyer details (optional, additive — back-compat) ---
|
|
3304
|
-
companyName:
|
|
3305
|
-
companyNumber:
|
|
3304
|
+
companyName: n.string().optional(),
|
|
3305
|
+
companyNumber: n.string().optional(),
|
|
3306
3306
|
// ח.פ / עוסק מורשה (aligns with Organization.companyNumber)
|
|
3307
|
-
contact:
|
|
3308
|
-
fullName:
|
|
3309
|
-
role:
|
|
3307
|
+
contact: n.object({
|
|
3308
|
+
fullName: n.string().optional(),
|
|
3309
|
+
role: n.string().optional(),
|
|
3310
3310
|
// תפקיד
|
|
3311
|
-
phone:
|
|
3312
|
-
email:
|
|
3311
|
+
phone: n.string().optional(),
|
|
3312
|
+
email: n.string().optional()
|
|
3313
3313
|
}).optional(),
|
|
3314
|
-
poNumber:
|
|
3314
|
+
poNumber: n.string().optional(),
|
|
3315
3315
|
// הזמנת רכש
|
|
3316
|
-
outOfStockPolicy:
|
|
3317
|
-
organizationId:
|
|
3316
|
+
outOfStockPolicy: n.enum(["substitute", "remove"]).optional(),
|
|
3317
|
+
organizationId: n.string().optional(),
|
|
3318
3318
|
billingAccount: it.optional(),
|
|
3319
3319
|
deliveryNote: Tn.optional(),
|
|
3320
3320
|
invoice: Nn.optional(),
|
|
@@ -3325,7 +3325,7 @@ const ye = r.object({
|
|
|
3325
3325
|
* Epoch millis. Absent means no payment has been recorded via the admin payment flow.
|
|
3326
3326
|
* A row is "open" iff: invoice exists AND invoicePaidAt is unset AND ezReceipt is unset.
|
|
3327
3327
|
*/
|
|
3328
|
-
invoicePaidAt:
|
|
3328
|
+
invoicePaidAt: n.number().int().positive().optional(),
|
|
3329
3329
|
/**
|
|
3330
3330
|
* EZcount receipt stored after recording payment.
|
|
3331
3331
|
* Mirrors EzInvoiceSchema shape (doc_uuid, pdf_link, doc_number, …).
|
|
@@ -3333,48 +3333,48 @@ const ye = r.object({
|
|
|
3333
3333
|
*/
|
|
3334
3334
|
ezReceipt: Ue.optional(),
|
|
3335
3335
|
// Audit: who last changed the order + when (epoch millis). Stamped by admin writes.
|
|
3336
|
-
updatedBy:
|
|
3337
|
-
updatedAt:
|
|
3338
|
-
}), Cn =
|
|
3339
|
-
id:
|
|
3340
|
-
companyId:
|
|
3341
|
-
name:
|
|
3342
|
-
urls:
|
|
3343
|
-
logoUrl:
|
|
3344
|
-
tenantId:
|
|
3336
|
+
updatedBy: n.string().optional(),
|
|
3337
|
+
updatedAt: n.number().optional()
|
|
3338
|
+
}), Cn = n.enum(["individual", "company"]), Kn = n.object({
|
|
3339
|
+
id: n.string(),
|
|
3340
|
+
companyId: n.string(),
|
|
3341
|
+
name: n.string(),
|
|
3342
|
+
urls: n.array(n.string()),
|
|
3343
|
+
logoUrl: n.string(),
|
|
3344
|
+
tenantId: n.string(),
|
|
3345
3345
|
// firebase auth tenantId
|
|
3346
3346
|
paymentType: Ae,
|
|
3347
|
-
allowAnonymousClients:
|
|
3348
|
-
isVatIncludedInPrice:
|
|
3349
|
-
clientTypes:
|
|
3350
|
-
minimumOrder:
|
|
3351
|
-
freeDeliveryPrice:
|
|
3352
|
-
deliveryPrice:
|
|
3347
|
+
allowAnonymousClients: n.boolean(),
|
|
3348
|
+
isVatIncludedInPrice: n.boolean(),
|
|
3349
|
+
clientTypes: n.array(Cn),
|
|
3350
|
+
minimumOrder: n.number().optional(),
|
|
3351
|
+
freeDeliveryPrice: n.number().optional(),
|
|
3352
|
+
deliveryPrice: n.number().optional(),
|
|
3353
3353
|
address: Ie.optional(),
|
|
3354
|
-
companyNumber:
|
|
3354
|
+
companyNumber: n.string().optional()
|
|
3355
3355
|
// חפ של החברה
|
|
3356
|
-
}), jn =
|
|
3357
|
-
minSpend:
|
|
3358
|
-
stackable:
|
|
3359
|
-
}).optional(), Zn =
|
|
3360
|
-
|
|
3361
|
-
variantType:
|
|
3362
|
-
productsId:
|
|
3356
|
+
}), jn = n.object({
|
|
3357
|
+
minSpend: n.number().positive().optional(),
|
|
3358
|
+
stackable: n.boolean().default(!1)
|
|
3359
|
+
}).optional(), Zn = n.discriminatedUnion("variantType", [
|
|
3360
|
+
n.object({
|
|
3361
|
+
variantType: n.literal("bundle"),
|
|
3362
|
+
productsId: n.array(n.string().nonempty()).min(1),
|
|
3363
3363
|
// Which products are included
|
|
3364
|
-
requiredQuantity:
|
|
3364
|
+
requiredQuantity: n.number().positive(),
|
|
3365
3365
|
// How many items needed (e.g., 3)
|
|
3366
|
-
bundlePrice:
|
|
3366
|
+
bundlePrice: n.number().positive()
|
|
3367
3367
|
// Total price for the bundle (e.g., $25)
|
|
3368
3368
|
})
|
|
3369
|
-
]), er =
|
|
3370
|
-
type:
|
|
3371
|
-
storeId:
|
|
3372
|
-
companyId:
|
|
3373
|
-
id:
|
|
3374
|
-
name:
|
|
3375
|
-
active:
|
|
3376
|
-
startDate:
|
|
3377
|
-
endDate:
|
|
3369
|
+
]), er = n.object({
|
|
3370
|
+
type: n.literal("Discount"),
|
|
3371
|
+
storeId: n.string().min(1),
|
|
3372
|
+
companyId: n.string().min(1),
|
|
3373
|
+
id: n.string().min(1),
|
|
3374
|
+
name: n.array(n.object({ lang: n.enum(["he"]), value: n.string().nonempty() })),
|
|
3375
|
+
active: n.boolean(),
|
|
3376
|
+
startDate: n.number(),
|
|
3377
|
+
endDate: n.number(),
|
|
3378
3378
|
variant: Zn,
|
|
3379
3379
|
conditions: jn
|
|
3380
3380
|
});
|
|
@@ -3511,100 +3511,100 @@ class tr {
|
|
|
3511
3511
|
return this.filterActiveDiscounts(e);
|
|
3512
3512
|
}
|
|
3513
3513
|
}
|
|
3514
|
-
const
|
|
3515
|
-
id:
|
|
3516
|
-
name:
|
|
3517
|
-
}), nr =
|
|
3518
|
-
type:
|
|
3519
|
-
id:
|
|
3520
|
-
name:
|
|
3521
|
-
code:
|
|
3514
|
+
const Dn = n.object({
|
|
3515
|
+
id: n.string(),
|
|
3516
|
+
name: n.string()
|
|
3517
|
+
}), nr = Dn.omit({ id: !0 }), st = n.object({
|
|
3518
|
+
type: n.literal("Supplier"),
|
|
3519
|
+
id: n.string(),
|
|
3520
|
+
name: n.string(),
|
|
3521
|
+
code: n.string()
|
|
3522
3522
|
// supplier code number
|
|
3523
|
-
}), rr = st.omit({ id: !0 }),
|
|
3524
|
-
type:
|
|
3525
|
-
id:
|
|
3523
|
+
}), rr = st.omit({ id: !0 }), Pn = n.object({
|
|
3524
|
+
type: n.literal("SupplierInvoice"),
|
|
3525
|
+
id: n.string(),
|
|
3526
3526
|
// "draft" = work-in-progress, NOT yet finalized. Product prices are only
|
|
3527
3527
|
// updated once the invoice is finalized ("completed"). Legacy invoices have
|
|
3528
3528
|
// no status and are treated as finalized.
|
|
3529
|
-
status:
|
|
3529
|
+
status: n.enum(["draft", "completed"]).optional(),
|
|
3530
3530
|
supplier: st,
|
|
3531
|
-
invoiceNumber:
|
|
3532
|
-
date:
|
|
3533
|
-
rows:
|
|
3534
|
-
|
|
3535
|
-
id:
|
|
3536
|
-
rowNumber:
|
|
3537
|
-
sku:
|
|
3538
|
-
itemName:
|
|
3539
|
-
quantity:
|
|
3540
|
-
purchasePrice:
|
|
3541
|
-
lineDiscount:
|
|
3542
|
-
profitPercentage:
|
|
3543
|
-
price:
|
|
3544
|
-
totalPurchasePrice:
|
|
3545
|
-
vat:
|
|
3546
|
-
originalProduct:
|
|
3547
|
-
purchasePrice:
|
|
3548
|
-
price:
|
|
3549
|
-
profitPercentage:
|
|
3531
|
+
invoiceNumber: n.string(),
|
|
3532
|
+
date: n.number(),
|
|
3533
|
+
rows: n.array(
|
|
3534
|
+
n.object({
|
|
3535
|
+
id: n.string(),
|
|
3536
|
+
rowNumber: n.number(),
|
|
3537
|
+
sku: n.string(),
|
|
3538
|
+
itemName: n.string(),
|
|
3539
|
+
quantity: n.number(),
|
|
3540
|
+
purchasePrice: n.number(),
|
|
3541
|
+
lineDiscount: n.number(),
|
|
3542
|
+
profitPercentage: n.number(),
|
|
3543
|
+
price: n.number(),
|
|
3544
|
+
totalPurchasePrice: n.number(),
|
|
3545
|
+
vat: n.boolean(),
|
|
3546
|
+
originalProduct: n.object({
|
|
3547
|
+
purchasePrice: n.number(),
|
|
3548
|
+
price: n.number(),
|
|
3549
|
+
profitPercentage: n.number()
|
|
3550
3550
|
}).optional()
|
|
3551
3551
|
})
|
|
3552
3552
|
),
|
|
3553
|
-
productsToUpdate:
|
|
3554
|
-
|
|
3555
|
-
sku:
|
|
3556
|
-
itemName:
|
|
3557
|
-
oldPurchasePrice:
|
|
3558
|
-
newPurchasePrice:
|
|
3559
|
-
oldPrice:
|
|
3560
|
-
newPrice:
|
|
3561
|
-
oldProfitPercentage:
|
|
3562
|
-
newProfitPercentage:
|
|
3553
|
+
productsToUpdate: n.array(
|
|
3554
|
+
n.object({
|
|
3555
|
+
sku: n.string(),
|
|
3556
|
+
itemName: n.string(),
|
|
3557
|
+
oldPurchasePrice: n.number(),
|
|
3558
|
+
newPurchasePrice: n.number(),
|
|
3559
|
+
oldPrice: n.number(),
|
|
3560
|
+
newPrice: n.number(),
|
|
3561
|
+
oldProfitPercentage: n.number(),
|
|
3562
|
+
newProfitPercentage: n.number()
|
|
3563
3563
|
})
|
|
3564
3564
|
),
|
|
3565
|
-
total:
|
|
3566
|
-
totalBeforeVat:
|
|
3567
|
-
vat:
|
|
3568
|
-
}), ir =
|
|
3569
|
-
recordId:
|
|
3570
|
-
organizationId:
|
|
3571
|
-
customerId:
|
|
3565
|
+
total: n.number().optional(),
|
|
3566
|
+
totalBeforeVat: n.number().optional(),
|
|
3567
|
+
vat: n.number().optional()
|
|
3568
|
+
}), ir = Pn.omit({ id: !0 }), En = n.enum(["debt_increase", "debt_reduction"]), ar = n.object({
|
|
3569
|
+
recordId: n.string().min(1),
|
|
3570
|
+
organizationId: n.string().min(1),
|
|
3571
|
+
customerId: n.string(),
|
|
3572
3572
|
// "system" when no acting user
|
|
3573
|
-
customerName:
|
|
3574
|
-
billingAccountId:
|
|
3573
|
+
customerName: n.string(),
|
|
3574
|
+
billingAccountId: n.string().nullable(),
|
|
3575
3575
|
type: En,
|
|
3576
3576
|
/** Integer agorot, always positive */
|
|
3577
|
-
amount:
|
|
3578
|
-
currency:
|
|
3577
|
+
amount: n.number().int().positive(),
|
|
3578
|
+
currency: n.literal("ILS"),
|
|
3579
3579
|
/** orderId (debt_increase) | ledger transactionId (debt_reduction) */
|
|
3580
|
-
relatedId:
|
|
3581
|
-
source:
|
|
3580
|
+
relatedId: n.string().min(1),
|
|
3581
|
+
source: n.enum(["order", "ledger", "manual"]),
|
|
3582
3582
|
/** event that caused this — trace + idempotency key; null for manual */
|
|
3583
|
-
causedByEventId:
|
|
3583
|
+
causedByEventId: n.string().nullable(),
|
|
3584
3584
|
/** epoch millis */
|
|
3585
|
-
createdAt:
|
|
3585
|
+
createdAt: n.number().int().positive(),
|
|
3586
3586
|
/** Asia/Jerusalem date parts */
|
|
3587
|
-
year:
|
|
3588
|
-
month:
|
|
3587
|
+
year: n.number().int(),
|
|
3588
|
+
month: n.number().int().min(1).max(12),
|
|
3589
3589
|
/** "2026-05" */
|
|
3590
|
-
yearMonth:
|
|
3591
|
-
companyId:
|
|
3592
|
-
storeId:
|
|
3593
|
-
}), sr =
|
|
3590
|
+
yearMonth: n.string(),
|
|
3591
|
+
companyId: n.string().min(1),
|
|
3592
|
+
storeId: n.string().min(1)
|
|
3593
|
+
}), sr = n.object({
|
|
3594
3594
|
/** = doc id */
|
|
3595
|
-
organizationId:
|
|
3596
|
-
organizationName:
|
|
3595
|
+
organizationId: n.string().min(1),
|
|
3596
|
+
organizationName: n.string(),
|
|
3597
3597
|
/** integer agorot — current outstanding debt */
|
|
3598
|
-
totalCurrentDebt:
|
|
3598
|
+
totalCurrentDebt: n.number().int(),
|
|
3599
3599
|
/** lifetime sums (agorot) */
|
|
3600
|
-
totalDebits:
|
|
3601
|
-
totalCredits:
|
|
3602
|
-
currency:
|
|
3600
|
+
totalDebits: n.number().int(),
|
|
3601
|
+
totalCredits: n.number().int(),
|
|
3602
|
+
currency: n.literal("ILS"),
|
|
3603
3603
|
/** epoch millis */
|
|
3604
|
-
updatedAt:
|
|
3605
|
-
companyId:
|
|
3606
|
-
storeId:
|
|
3607
|
-
}), or =
|
|
3604
|
+
updatedAt: n.number().int().positive(),
|
|
3605
|
+
companyId: n.string().min(1),
|
|
3606
|
+
storeId: n.string().min(1)
|
|
3607
|
+
}), or = n.enum([
|
|
3608
3608
|
"delivery_note",
|
|
3609
3609
|
"payment_received",
|
|
3610
3610
|
"credit_note",
|
|
@@ -3615,63 +3615,94 @@ const Pn = r.object({
|
|
|
3615
3615
|
// legacy
|
|
3616
3616
|
"order_refunded"
|
|
3617
3617
|
// legacy
|
|
3618
|
-
]), cr =
|
|
3618
|
+
]), cr = n.enum(["check", "bank_transfer", "cash", "credit_card", "other"]), ur = n.object({
|
|
3619
3619
|
/** = deterministic dedup doc id */
|
|
3620
|
-
id:
|
|
3621
|
-
organizationId:
|
|
3620
|
+
id: n.string().min(1),
|
|
3621
|
+
organizationId: n.string().min(1),
|
|
3622
3622
|
/** "+" increases owed (accrual), "-" decreases owed (settlement/adjustment) */
|
|
3623
|
-
sign:
|
|
3624
|
-
kind:
|
|
3623
|
+
sign: n.enum(["+", "-"]),
|
|
3624
|
+
kind: n.enum(["accrual", "settlement", "adjustment"]),
|
|
3625
3625
|
/** Integer agorot, always positive; sign carries direction */
|
|
3626
|
-
amount:
|
|
3627
|
-
currency:
|
|
3628
|
-
source:
|
|
3626
|
+
amount: n.number().int().positive(),
|
|
3627
|
+
currency: n.literal("ILS"),
|
|
3628
|
+
source: n.enum(["delivery_note", "ledger_payment", "manual", "order_reversal", "credit_note"]),
|
|
3629
3629
|
/** Present for document-sourced accruals */
|
|
3630
|
-
document:
|
|
3631
|
-
type:
|
|
3632
|
-
id:
|
|
3633
|
-
number:
|
|
3630
|
+
document: n.object({
|
|
3631
|
+
type: n.enum(["delivery_note", "invoice", "credit_note"]),
|
|
3632
|
+
id: n.string().min(1),
|
|
3633
|
+
number: n.string().optional()
|
|
3634
3634
|
}).optional(),
|
|
3635
3635
|
/** Order id (accrual), ledger txId (settlement), or manual ref */
|
|
3636
|
-
reference:
|
|
3637
|
-
type:
|
|
3638
|
-
id:
|
|
3636
|
+
reference: n.object({
|
|
3637
|
+
type: n.enum(["order", "transaction", "manual"]),
|
|
3638
|
+
id: n.string().min(1)
|
|
3639
3639
|
}).optional(),
|
|
3640
3640
|
/** Optional sub-grouping within an org */
|
|
3641
|
-
billingAccountId:
|
|
3641
|
+
billingAccountId: n.string().nullable().optional(),
|
|
3642
3642
|
/** Deterministic dedup key; doc id is derived from this */
|
|
3643
|
-
dedupKey:
|
|
3643
|
+
dedupKey: n.string().min(1),
|
|
3644
3644
|
/** Event id when source is event-driven */
|
|
3645
|
-
causedByEventId:
|
|
3645
|
+
causedByEventId: n.string().optional(),
|
|
3646
3646
|
/** Epoch millis — used for date-range queries */
|
|
3647
|
-
createdAt:
|
|
3648
|
-
companyId:
|
|
3649
|
-
storeId:
|
|
3650
|
-
}), dr =
|
|
3647
|
+
createdAt: n.number().int().positive(),
|
|
3648
|
+
companyId: n.string().min(1),
|
|
3649
|
+
storeId: n.string().min(1)
|
|
3650
|
+
}), dr = n.object({
|
|
3651
3651
|
/** = doc id */
|
|
3652
|
-
organizationId:
|
|
3652
|
+
organizationId: n.string().min(1),
|
|
3653
3653
|
/** Σ(+) − Σ(−), clamped ≥ 0; integer agorot. Non-zero only when totalAccrued > totalSettled. */
|
|
3654
|
-
owed:
|
|
3654
|
+
owed: n.number().int(),
|
|
3655
3655
|
/**
|
|
3656
3656
|
* Overpayment credit: max(0, totalSettled − totalAccrued); integer agorot, ≥ 0.
|
|
3657
3657
|
* Non-zero only when org has paid MORE than it has accrued.
|
|
3658
3658
|
* Visibility only — not client-spendable. At most one of {owed, credit} is non-zero.
|
|
3659
3659
|
*/
|
|
3660
|
-
credit:
|
|
3660
|
+
credit: n.number().int(),
|
|
3661
3661
|
/** Lifetime Σ(+); integer agorot */
|
|
3662
|
-
totalAccrued:
|
|
3662
|
+
totalAccrued: n.number().int(),
|
|
3663
3663
|
/** Lifetime Σ(−); integer agorot */
|
|
3664
|
-
totalSettled:
|
|
3665
|
-
currency:
|
|
3664
|
+
totalSettled: n.number().int(),
|
|
3665
|
+
currency: n.literal("ILS"),
|
|
3666
3666
|
/** Epoch millis */
|
|
3667
|
-
updatedAt:
|
|
3668
|
-
companyId:
|
|
3669
|
-
storeId:
|
|
3667
|
+
updatedAt: n.number().int().positive(),
|
|
3668
|
+
companyId: n.string().min(1),
|
|
3669
|
+
storeId: n.string().min(1)
|
|
3670
|
+
}), lr = n.object({
|
|
3671
|
+
/** = deterministic doc id, derived from idempotencyKey */
|
|
3672
|
+
id: n.string().min(1),
|
|
3673
|
+
/** EZcount doc_number */
|
|
3674
|
+
number: n.string().min(1),
|
|
3675
|
+
/** EZcount doc_uuid */
|
|
3676
|
+
docUuid: n.string().min(1),
|
|
3677
|
+
/** EZcount pdf_link */
|
|
3678
|
+
pdfLink: n.string().min(1),
|
|
3679
|
+
/** EZcount pdf_link_copy */
|
|
3680
|
+
pdfLinkCopy: n.string().optional(),
|
|
3681
|
+
organizationId: n.string().min(1),
|
|
3682
|
+
billingAccountId: n.string().nullish(),
|
|
3683
|
+
/** Set when the credit note is linked to an existing invoice's order */
|
|
3684
|
+
orderId: n.string().nullish(),
|
|
3685
|
+
invoiceDocUuid: n.string().nullish(),
|
|
3686
|
+
invoiceNumber: n.string().nullish(),
|
|
3687
|
+
/** Integer agorot (1 ILS = 100 agorot), always positive; gross amount incl. VAT */
|
|
3688
|
+
amount: n.number().int().positive(),
|
|
3689
|
+
currency: n.literal("ILS"),
|
|
3690
|
+
/** Hebrew reason label */
|
|
3691
|
+
reason: n.string().min(1),
|
|
3692
|
+
note: n.string().nullish(),
|
|
3693
|
+
/** Epoch millis */
|
|
3694
|
+
creditDate: n.number().int().positive(),
|
|
3695
|
+
/** Epoch millis */
|
|
3696
|
+
createdAt: n.number().int().positive(),
|
|
3697
|
+
/** Admin uid */
|
|
3698
|
+
createdBy: n.string().min(1),
|
|
3699
|
+
companyId: n.string().min(1),
|
|
3700
|
+
storeId: n.string().min(1)
|
|
3670
3701
|
}), Ee = {
|
|
3671
3702
|
VAT: 18
|
|
3672
3703
|
};
|
|
3673
|
-
function Rn(
|
|
3674
|
-
return
|
|
3704
|
+
function Rn(r) {
|
|
3705
|
+
return r.reduce((e, t) => {
|
|
3675
3706
|
if (t.status === "missing")
|
|
3676
3707
|
return e;
|
|
3677
3708
|
if (t.status === "substituted" && t.substitutedWith) {
|
|
@@ -3687,28 +3718,28 @@ function Rn(n) {
|
|
|
3687
3718
|
return e.push(t), e;
|
|
3688
3719
|
}, []);
|
|
3689
3720
|
}
|
|
3690
|
-
function $n(
|
|
3721
|
+
function $n(r, e) {
|
|
3691
3722
|
var t, i;
|
|
3692
|
-
return ((t =
|
|
3723
|
+
return ((t = r.discount) == null ? void 0 : t.type) === "percent" ? r.price * (r.discount.value ?? 100) / 100 : ((i = r.discount) == null ? void 0 : i.type) === "number" ? r.discount.value ?? 0 : 0;
|
|
3693
3724
|
}
|
|
3694
|
-
function Mn(
|
|
3725
|
+
function Mn(r, e) {
|
|
3695
3726
|
var i, a;
|
|
3696
|
-
const t = e &&
|
|
3697
|
-
if (((i =
|
|
3698
|
-
const s = t *
|
|
3699
|
-
return
|
|
3727
|
+
const t = e && r.vat ? r.price + r.price * Ee.VAT / 100 : r.price;
|
|
3728
|
+
if (((i = r.discount) == null ? void 0 : i.type) === "percent") {
|
|
3729
|
+
const s = t * r.discount.value / 100;
|
|
3730
|
+
return r.price - s;
|
|
3700
3731
|
}
|
|
3701
|
-
return ((a =
|
|
3732
|
+
return ((a = r.discount) == null ? void 0 : a.type) === "number" ? t - r.discount.value : t;
|
|
3702
3733
|
}
|
|
3703
|
-
function
|
|
3704
|
-
cart:
|
|
3734
|
+
function mr({
|
|
3735
|
+
cart: r,
|
|
3705
3736
|
discounts: e,
|
|
3706
3737
|
deliveryPrice: t = 0,
|
|
3707
3738
|
freeDeliveryPrice: i = 0,
|
|
3708
3739
|
freeShipping: a = !1,
|
|
3709
3740
|
isVatIncludedInPrice: s = !1
|
|
3710
3741
|
}) {
|
|
3711
|
-
const c = Rn(
|
|
3742
|
+
const c = Rn(r).map((u, f) => ({
|
|
3712
3743
|
amount: u.amount,
|
|
3713
3744
|
product: { ...u.product },
|
|
3714
3745
|
originalPrice: u.product.price,
|
|
@@ -3772,38 +3803,39 @@ const zn = {
|
|
|
3772
3803
|
paymentLinks: "paymentLinks",
|
|
3773
3804
|
duplicateChargeAlerts: "duplicateChargeAlerts",
|
|
3774
3805
|
organizationBalance: "organizationBalance",
|
|
3775
|
-
organizationBalanceRollup: "organizationBalanceRollup"
|
|
3806
|
+
organizationBalanceRollup: "organizationBalanceRollup",
|
|
3807
|
+
creditNotes: "creditNotes"
|
|
3776
3808
|
}, Ln = {
|
|
3777
3809
|
systemCollections: zn,
|
|
3778
3810
|
storeCollections: Vn,
|
|
3779
3811
|
// for client and server
|
|
3780
3812
|
getPath: ({
|
|
3781
|
-
companyId:
|
|
3813
|
+
companyId: r,
|
|
3782
3814
|
storeId: e,
|
|
3783
3815
|
collectionName: t,
|
|
3784
3816
|
id: i
|
|
3785
|
-
}) => `${
|
|
3817
|
+
}) => `${r}/${e}/${t}${i ? `/${i}` : ""}`,
|
|
3786
3818
|
getSubPath: ({
|
|
3787
|
-
companyId:
|
|
3819
|
+
companyId: r,
|
|
3788
3820
|
storeId: e,
|
|
3789
3821
|
collectionName: t,
|
|
3790
3822
|
subCollectionName: i,
|
|
3791
3823
|
id: a,
|
|
3792
3824
|
subId: s
|
|
3793
|
-
}) => `${
|
|
3825
|
+
}) => `${r}/${e}/${t}/${a}/${i}${s ? `/${s}` : ""}`,
|
|
3794
3826
|
// for firestore events
|
|
3795
|
-
getDocPath: (
|
|
3796
|
-
getSubDocPath: (
|
|
3797
|
-
},
|
|
3827
|
+
getDocPath: (r) => `{companyId}/{storeId}/${r}/{id}`,
|
|
3828
|
+
getSubDocPath: (r, e, t) => `{companyId}/{storeId}/${r}/${e}/${t}/{id}`
|
|
3829
|
+
}, pr = {
|
|
3798
3830
|
firestore: Ln
|
|
3799
3831
|
}, qe = {
|
|
3800
|
-
round: (
|
|
3832
|
+
round: (r, e = 2) => {
|
|
3801
3833
|
const t = 10 ** e;
|
|
3802
|
-
return Math.round((
|
|
3834
|
+
return Math.round((r + Number.EPSILON) * t) / t;
|
|
3803
3835
|
}
|
|
3804
|
-
},
|
|
3805
|
-
calcSalePriceFromMargin: (
|
|
3806
|
-
calcMarginFromSalePrice: (
|
|
3836
|
+
}, fr = {
|
|
3837
|
+
calcSalePriceFromMargin: (r, e) => r <= 0 || e <= 0 || r >= 100 ? e : qe.round(e / (1 - r / 100)),
|
|
3838
|
+
calcMarginFromSalePrice: (r, e) => r <= 0 || e <= 0 ? 0 : qe.round((r - e) / r * 100)
|
|
3807
3839
|
};
|
|
3808
3840
|
export {
|
|
3809
3841
|
Ie as AddressSchema,
|
|
@@ -3819,6 +3851,7 @@ export {
|
|
|
3819
3851
|
Yn as CartSchema,
|
|
3820
3852
|
$e as CategorySchema,
|
|
3821
3853
|
Xn as CompanySchema,
|
|
3854
|
+
lr as CreditNoteSchema,
|
|
3822
3855
|
Tn as DeliveryNoteSchema,
|
|
3823
3856
|
jn as DiscountConditionsSchema,
|
|
3824
3857
|
tr as DiscountEngine,
|
|
@@ -3829,7 +3862,7 @@ export {
|
|
|
3829
3862
|
Ue as EzInvoiceSchema,
|
|
3830
3863
|
Gn as FavoriteProductSchema,
|
|
3831
3864
|
qn as FileSchema,
|
|
3832
|
-
|
|
3865
|
+
pr as FirebaseAPI,
|
|
3833
3866
|
bn as FulfillmentStatusSchema,
|
|
3834
3867
|
Nn as InvoiceSchema,
|
|
3835
3868
|
ye as LocaleSchema,
|
|
@@ -3842,7 +3875,7 @@ export {
|
|
|
3842
3875
|
ur as OrganizationBalanceEntrySchema,
|
|
3843
3876
|
dr as OrganizationBalanceRollupSchema,
|
|
3844
3877
|
sr as OrganizationBudgetSchema,
|
|
3845
|
-
|
|
3878
|
+
Dn as OrganizationGroupSchema,
|
|
3846
3879
|
An as OrganizationSchema,
|
|
3847
3880
|
cr as PaymentMethodSchema,
|
|
3848
3881
|
Sn as PaymentTermsSchema,
|
|
@@ -3851,17 +3884,17 @@ export {
|
|
|
3851
3884
|
kn as ProfileSchema,
|
|
3852
3885
|
Kn as StoreSchema,
|
|
3853
3886
|
xn as SubstitutedWithSchema,
|
|
3854
|
-
|
|
3887
|
+
Pn as SupplierInvoiceSchema,
|
|
3855
3888
|
st as SupplierSchema,
|
|
3856
3889
|
Wn as TFlattenCategorySchema,
|
|
3857
3890
|
Cn as clientTypesSchema,
|
|
3858
|
-
|
|
3891
|
+
mr as getCartCost,
|
|
3859
3892
|
Rn as getFulfilledCartItems,
|
|
3860
3893
|
Bn as isFile,
|
|
3861
3894
|
qe as math,
|
|
3862
3895
|
$ as notEmptyTextSchema,
|
|
3863
3896
|
Un as numericTextSchema,
|
|
3864
|
-
|
|
3897
|
+
fr as storeCalculator,
|
|
3865
3898
|
Vn as storeCollections,
|
|
3866
3899
|
zn as systemCollections
|
|
3867
3900
|
};
|