szdl-utils-kit 0.2.19 → 0.2.21
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/index.js +365 -355
- package/dist/index.umd.cjs +2 -2
- package/dist/types/batch.d.ts +5 -0
- package/dist/types/bx-boot.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var C = (y, A, e) => (
|
|
1
|
+
var fe = Object.defineProperty;
|
|
2
|
+
var Ne = (y, A, e) => A in y ? fe(y, A, { enumerable: !0, configurable: !0, writable: !0, value: e }) : y[A] = e;
|
|
3
|
+
var C = (y, A, e) => (Ne(y, typeof A != "symbol" ? A + "" : A, e), e), xt = (y, A, e) => {
|
|
4
4
|
if (!A.has(y))
|
|
5
5
|
throw TypeError("Cannot " + e);
|
|
6
6
|
};
|
|
7
|
-
var o = (y, A, e) => (
|
|
7
|
+
var o = (y, A, e) => (xt(y, A, "read from private field"), e ? e.call(y) : A.get(y)), f = (y, A, e) => {
|
|
8
8
|
if (A.has(y))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
A instanceof WeakSet ? A.add(y) : A.set(y, e);
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
function
|
|
11
|
+
}, E = (y, A, e, n) => (xt(y, A, "write to private field"), n ? n.call(y, e) : A.set(y, e), e);
|
|
12
|
+
var _ = (y, A, e) => (xt(y, A, "access private method"), e);
|
|
13
|
+
var _e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
14
|
+
function Oe(y) {
|
|
15
15
|
return y && y.__esModule && Object.prototype.hasOwnProperty.call(y, "default") ? y.default : y;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
17
|
+
var jt = { exports: {} };
|
|
18
18
|
(function(y, A) {
|
|
19
19
|
(function(e) {
|
|
20
20
|
Array.prototype.indexOf || (Array.prototype.indexOf = function(t, s) {
|
|
@@ -33,7 +33,7 @@ var xt = { exports: {} };
|
|
|
33
33
|
}, l = function(t, s) {
|
|
34
34
|
var a, c = "";
|
|
35
35
|
return a = t.slice(s, s + 1), a !== "" && !isNaN(Number(a)) && (c += "%H"), a = t.charAt(s + 2), a !== "" && a === ":" && (c += a), a = t.slice(s + 3, s + 4), a !== "" && !isNaN(Number(a)) && (c += "%M"), a = t.charAt(s + 5), a !== "" && a === ":" && (c += a), a = t.slice(s + 6, s + 7), a !== "" && !isNaN(Number(a)) && (c += "%S"), c;
|
|
36
|
-
},
|
|
36
|
+
}, O = function(t, s) {
|
|
37
37
|
var a, c = [
|
|
38
38
|
t.slice(s, s + 1),
|
|
39
39
|
t.charAt(s + 2),
|
|
@@ -48,7 +48,7 @@ var xt = { exports: {} };
|
|
|
48
48
|
t.charAt(s + 7),
|
|
49
49
|
t.slice(s + 8, s + 9)
|
|
50
50
|
], !isNaN(Number(L[0])) && !isNaN(Number(L[2])) && !isNaN(Number(L[4])) ? (L[1] === "-" && L[3] === "-" && (a = "%Y-%m-%d"), a) : "");
|
|
51
|
-
}, u = n.tempus, i,
|
|
51
|
+
}, u = n.tempus, i, T, g = n.navigator || {}, m = "en", N = {
|
|
52
52
|
en: {
|
|
53
53
|
JANUARY_SHORT: "Jan",
|
|
54
54
|
FEBRUARY_SHORT: "Feb",
|
|
@@ -211,55 +211,55 @@ var xt = { exports: {} };
|
|
|
211
211
|
}
|
|
212
212
|
}, G = function() {
|
|
213
213
|
return [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
214
|
+
N[m].JANUARY_LONG,
|
|
215
|
+
N[m].FEBRUARY_LONG,
|
|
216
|
+
N[m].MARCH_LONG,
|
|
217
|
+
N[m].APRIL_LONG,
|
|
218
|
+
N[m].MAY_LONG,
|
|
219
|
+
N[m].JUNE_LONG,
|
|
220
|
+
N[m].JULY_LONG,
|
|
221
|
+
N[m].AUGUST_LONG,
|
|
222
|
+
N[m].SEPTEMBER_LONG,
|
|
223
|
+
N[m].OCTOBER_LONG,
|
|
224
|
+
N[m].NOVEMBER_LONG,
|
|
225
|
+
N[m].DECEMBER_LONG
|
|
226
226
|
];
|
|
227
|
-
},
|
|
227
|
+
}, ht = function() {
|
|
228
228
|
return [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
229
|
+
N[m].JANUARY_SHORT,
|
|
230
|
+
N[m].FEBRUARY_SHORT,
|
|
231
|
+
N[m].MARCH_SHORT,
|
|
232
|
+
N[m].APRIL_SHORT,
|
|
233
|
+
N[m].MAY_SHORT,
|
|
234
|
+
N[m].JUNE_SHORT,
|
|
235
|
+
N[m].JULY_SHORT,
|
|
236
|
+
N[m].AUGUST_SHORT,
|
|
237
|
+
N[m].SEPTEMBER_SHORT,
|
|
238
|
+
N[m].OCTOBER_SHORT,
|
|
239
|
+
N[m].NOVEMBER_SHORT,
|
|
240
|
+
N[m].DECEMBER_SHORT
|
|
241
241
|
];
|
|
242
|
-
},
|
|
242
|
+
}, z = function() {
|
|
243
243
|
return [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
N[m].SUNDAY_LONG,
|
|
245
|
+
N[m].MONDAY_LONG,
|
|
246
|
+
N[m].TUESDAY_LONG,
|
|
247
|
+
N[m].WEDNESDAY_LONG,
|
|
248
|
+
N[m].THURSDAY_LONG,
|
|
249
|
+
N[m].FRIDAY_LONG,
|
|
250
|
+
N[m].SATURDAY_LONG
|
|
251
251
|
];
|
|
252
|
-
},
|
|
252
|
+
}, k = function() {
|
|
253
253
|
return [
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
N[m].SUNDAY_SHORT,
|
|
255
|
+
N[m].MONDAY_SHORT,
|
|
256
|
+
N[m].TUESDAY_SHORT,
|
|
257
|
+
N[m].WEDNESDAY_SHORT,
|
|
258
|
+
N[m].THURSDAY_SHORT,
|
|
259
|
+
N[m].FRIDAY_SHORT,
|
|
260
|
+
N[m].SATURDAY_SHORT
|
|
261
261
|
];
|
|
262
|
-
}, P,
|
|
262
|
+
}, P, Mt, ct, lt, me = function(t, s, a) {
|
|
263
263
|
var c;
|
|
264
264
|
n.XMLHttpRequest ? c = new XMLHttpRequest() : c = new ActiveXObject("Microsoft.XMLHTTP"), c.onreadystatechange = function() {
|
|
265
265
|
c.readyState === 4 && (c.status === 200 ? s && (n.JSON === e ? alert(`Please, include json2 into your project if you want use old browsers!
|
|
@@ -316,7 +316,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
316
316
|
"%a": {
|
|
317
317
|
format: function(t) {
|
|
318
318
|
var s = t.dayOfWeek();
|
|
319
|
-
return
|
|
319
|
+
return lt[s !== e ? s : i.MIN_DAY_OF_WEEK];
|
|
320
320
|
},
|
|
321
321
|
parse: function() {
|
|
322
322
|
return {};
|
|
@@ -328,7 +328,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
328
328
|
"%A": {
|
|
329
329
|
format: function(t) {
|
|
330
330
|
var s = t.dayOfWeek();
|
|
331
|
-
return
|
|
331
|
+
return ct[s !== e ? s : i.MIN_DAY_OF_WEEK];
|
|
332
332
|
},
|
|
333
333
|
parse: function() {
|
|
334
334
|
return {};
|
|
@@ -340,7 +340,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
340
340
|
"%b": {
|
|
341
341
|
format: function(t) {
|
|
342
342
|
var s = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
343
|
-
return
|
|
343
|
+
return Mt[s !== e ? s : i.MIN_MONTH];
|
|
344
344
|
},
|
|
345
345
|
parse: function(t) {
|
|
346
346
|
var s = i.monthNames().indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
|
|
@@ -442,11 +442,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
442
442
|
maxLength: 10,
|
|
443
443
|
type: "string"
|
|
444
444
|
}
|
|
445
|
-
},
|
|
445
|
+
}, pt = {
|
|
446
446
|
useMilliseconds: !1,
|
|
447
447
|
monthFromZero: !1
|
|
448
|
-
},
|
|
449
|
-
|
|
448
|
+
}, R;
|
|
449
|
+
R = function(t, s, a) {
|
|
450
450
|
return this._d = /* @__PURE__ */ new Date(), this._i = {
|
|
451
451
|
year: !1,
|
|
452
452
|
month: !1,
|
|
@@ -456,55 +456,55 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
456
456
|
seconds: !1,
|
|
457
457
|
milliseconds: !1
|
|
458
458
|
}, t !== e && this.set(t, s, a), this;
|
|
459
|
-
},
|
|
459
|
+
}, R.fn = R.prototype, R.fn.dayCount = function() {
|
|
460
460
|
var t = this.month(), s = i.MAX_DAY_IN_MONTHS[t - (i.options("monthFromZero") ? 0 : 1)];
|
|
461
461
|
return this.leapYear() && t === (i.options("monthFromZero") ? 1 : 2) && (s += 1), s;
|
|
462
|
-
},
|
|
462
|
+
}, R.fn.year = function(t) {
|
|
463
463
|
if (arguments.length !== 0)
|
|
464
464
|
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_YEAR && Number(t) <= i.MAX_YEAR ? (this._d.setFullYear(Number(t)), this._i.year = !1) : this._i.year = Number(t) : (this._d.setFullYear(i.MIN_YEAR), this._i.year = !1);
|
|
465
465
|
else
|
|
466
466
|
return this._i.year === !1 ? this._d.getFullYear() : this._i.year;
|
|
467
467
|
return this;
|
|
468
|
-
},
|
|
468
|
+
}, R.fn.month = function(t) {
|
|
469
469
|
if (arguments.length !== 0)
|
|
470
470
|
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MONTH && Number(t) <= i.MAX_MONTH ? (this._d.setMonth(i.options("monthFromZero") ? Number(t) : Number(t) - 1), this._i.month = !1) : this._i.month = Number(t) : (this._d.setMonth(i.options("monthFromZero") ? i.MIN_MONTH : i.MIN_MONTH - 1), this._i.month = !1);
|
|
471
471
|
else
|
|
472
472
|
return this._i.month === !1 ? i.options("monthFromZero") ? this._d.getMonth() : this._d.getMonth() + 1 : this._i.month;
|
|
473
473
|
return this;
|
|
474
|
-
},
|
|
474
|
+
}, R.fn.day = function(t) {
|
|
475
475
|
if (arguments.length !== 0)
|
|
476
476
|
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_DAY && Number(t) <= this.dayCount() ? (this._d.setDate(Number(t)), this._i.day = !1) : this._i.day = Number(t) : (this._d.setDate(i.MIN_DAY), this._i.day = !1);
|
|
477
477
|
else
|
|
478
478
|
return this._i.day === !1 ? this._d.getDate() : this._i.day;
|
|
479
479
|
return this;
|
|
480
|
-
},
|
|
480
|
+
}, R.fn.hours = function(t) {
|
|
481
481
|
if (arguments.length !== 0)
|
|
482
482
|
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_HOURS && Number(t) <= i.MAX_HOURS ? (this._d.setHours(Number(t)), this._i.hours = !1) : this._i.hours = Number(t) : (this._d.setHours(i.MIN_HOURS), this._i.hours = !1);
|
|
483
483
|
else
|
|
484
484
|
return this._i.hours === !1 ? this._d.getHours() : this._i.hours;
|
|
485
485
|
return this;
|
|
486
|
-
},
|
|
486
|
+
}, R.fn.minutes = function(t) {
|
|
487
487
|
if (arguments.length !== 0)
|
|
488
488
|
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MINUTES && Number(t) <= i.MAX_MINUTES ? (this._d.setMinutes(Number(t)), this._i.minutes = !1) : this._i.minutes = Number(t) : (this._d.setMinutes(i.MIN_MINUTES), this._i.minutes = !1);
|
|
489
489
|
else
|
|
490
490
|
return this._i.minutes === !1 ? this._d.getMinutes() : this._i.minutes;
|
|
491
491
|
return this;
|
|
492
|
-
},
|
|
492
|
+
}, R.fn.seconds = function(t) {
|
|
493
493
|
if (arguments.length !== 0)
|
|
494
494
|
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_SECONDS && Number(t) <= i.MAX_SECONDS ? (this._d.setSeconds(Number(t)), this._i.seconds = !1) : this._i.seconds = Number(t) : (this._d.setSeconds(i.MIN_SECONDS), this._i.seconds = !1);
|
|
495
495
|
else
|
|
496
496
|
return this._i.seconds === !1 ? this._d.getSeconds() : this._i.seconds;
|
|
497
497
|
return this;
|
|
498
|
-
},
|
|
498
|
+
}, R.fn.milliseconds = function(t) {
|
|
499
499
|
if (arguments.length !== 0)
|
|
500
500
|
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MILLISECONDS && Number(t) <= i.MAX_MILLISECONDS ? (this._d.setMilliseconds(Number(t)), this._i.milliseconds = !1) : this._i.milliseconds = Number(t) : (this._d.setMilliseconds(i.MIN_MILLISECONDS), this._i.milliseconds = !1);
|
|
501
501
|
else
|
|
502
502
|
return this._i.milliseconds === !1 ? this._d.getMilliseconds() : this._i.milliseconds;
|
|
503
503
|
return this;
|
|
504
|
-
},
|
|
504
|
+
}, R.fn.week = function() {
|
|
505
505
|
var t = new Date(this.year(), 0, 1), s = i(this.utc()).hours(0).minutes(0).seconds(0).milliseconds(0).utc() * 1e3;
|
|
506
506
|
return Math.ceil(((s - t.getTime()) / 864e5 + t.getDay() + 1) / 7);
|
|
507
|
-
},
|
|
507
|
+
}, R.fn.set = function(t, s, a) {
|
|
508
508
|
if (this._i = {
|
|
509
509
|
year: !1,
|
|
510
510
|
month: !1,
|
|
@@ -520,9 +520,9 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
520
520
|
if (typeof t == "number")
|
|
521
521
|
return this._d = new Date(t * (i.options("useMilliseconds") ? 1 : 1e3)), this;
|
|
522
522
|
if (typeof t == "object" && (t instanceof Array ? (this.day(i.MIN_DAY), this.year(t[0]), this.month(t[1]), this.day(t[2]), this.hours(t[3]), this.minutes(t[4]), this.seconds(t[5]), this.milliseconds(t[6])) : (this.day(i.MIN_DAY), this.year(t.year), this.month(t.month), this.day(t.day), this.hours(t.hours), this.minutes(t.minutes), this.seconds(t.seconds), this.milliseconds(t.milliseconds))), typeof t == "string") {
|
|
523
|
-
var c, L = [],
|
|
523
|
+
var c, L = [], d, S, X = [], H = 0, D = 0, M, w, p = {}, b;
|
|
524
524
|
if (t === e)
|
|
525
|
-
return
|
|
525
|
+
return d = h(this, a), d === e && (this._i = {
|
|
526
526
|
year: -1,
|
|
527
527
|
month: -1,
|
|
528
528
|
day: -1,
|
|
@@ -530,7 +530,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
530
530
|
minutes: -1,
|
|
531
531
|
seconds: -1,
|
|
532
532
|
milliseconds: -1
|
|
533
|
-
}),
|
|
533
|
+
}), d;
|
|
534
534
|
for (s === e && (s = i.detectFormat(t)); H < s.length; ) {
|
|
535
535
|
if (s.charAt(H) === "%") {
|
|
536
536
|
if (S = s.charAt(H) + s.charAt(H + 1), U[S] !== e) {
|
|
@@ -549,7 +549,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
549
549
|
break;
|
|
550
550
|
}
|
|
551
551
|
if (M < U[S].minLength)
|
|
552
|
-
return
|
|
552
|
+
return d = h(this, a), d === e && (this._i = {
|
|
553
553
|
year: -1,
|
|
554
554
|
month: -1,
|
|
555
555
|
day: -1,
|
|
@@ -557,11 +557,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
557
557
|
minutes: -1,
|
|
558
558
|
seconds: -1,
|
|
559
559
|
milliseconds: -1
|
|
560
|
-
}),
|
|
560
|
+
}), d;
|
|
561
561
|
L.push(S), X.push(w), M -= 1, D += M, H += 1;
|
|
562
562
|
}
|
|
563
563
|
} else if (t.charAt(D) !== s.charAt(H))
|
|
564
|
-
return
|
|
564
|
+
return d = h(this, a), d === e && (this._i = {
|
|
565
565
|
year: -1,
|
|
566
566
|
month: -1,
|
|
567
567
|
day: -1,
|
|
@@ -569,7 +569,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
569
569
|
minutes: -1,
|
|
570
570
|
seconds: -1,
|
|
571
571
|
milliseconds: -1
|
|
572
|
-
}),
|
|
572
|
+
}), d;
|
|
573
573
|
H += 1, D += 1;
|
|
574
574
|
}
|
|
575
575
|
for (c in L)
|
|
@@ -584,18 +584,18 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
584
584
|
this.day(i.MIN_DAY), this.year(p.year), this.month(p.month), this.day(p.day), this.hours(p.hours), this.minutes(p.minutes), this.seconds(p.seconds), this.milliseconds(p.milliseconds);
|
|
585
585
|
}
|
|
586
586
|
return this;
|
|
587
|
-
},
|
|
587
|
+
}, R.fn.leapYear = function() {
|
|
588
588
|
var t = this.year();
|
|
589
589
|
return t % 4 === 0 ? t % 100 === 0 ? t % 400 === 0 : !0 : !1;
|
|
590
|
-
},
|
|
590
|
+
}, R.fn.timestamp = function(t) {
|
|
591
591
|
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3) + this._d.getTimezoneOffset() * 6e4), this) : i.options("useMilliseconds") ? this._d.getTime() - this._d.getTimezoneOffset() * 6e4 : Math.floor(this._d.getTime() / 1e3) - this._d.getTimezoneOffset() * 60;
|
|
592
|
-
},
|
|
592
|
+
}, R.fn.utc = function(t) {
|
|
593
593
|
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3)), this) : i.options("useMilliseconds") ? this._d.getTime() : Math.floor(this._d.getTime() / 1e3);
|
|
594
|
-
},
|
|
594
|
+
}, R.fn.dayOfWeek = function(t) {
|
|
595
595
|
if (t === "long")
|
|
596
|
-
return ht[this._d.getDay()];
|
|
597
|
-
if (t === "short")
|
|
598
596
|
return ct[this._d.getDay()];
|
|
597
|
+
if (t === "short")
|
|
598
|
+
return lt[this._d.getDay()];
|
|
599
599
|
if (t === e)
|
|
600
600
|
return this._d.getDay();
|
|
601
601
|
if (t === 0 || t === "Sunday")
|
|
@@ -612,7 +612,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
612
612
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -2 : 5) - this.dayOfWeek() });
|
|
613
613
|
if (t === 6 || t === "Saturday")
|
|
614
614
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -1 : 6) - this.dayOfWeek() });
|
|
615
|
-
},
|
|
615
|
+
}, R.fn.timezone = function(t) {
|
|
616
616
|
switch (t) {
|
|
617
617
|
case "hours":
|
|
618
618
|
return Math.floor(this._d.getTimezoneOffset() / 60);
|
|
@@ -621,7 +621,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
621
621
|
default:
|
|
622
622
|
return this._d.getTimezoneOffset() * 60;
|
|
623
623
|
}
|
|
624
|
-
},
|
|
624
|
+
}, R.fn.get = function(t) {
|
|
625
625
|
switch (t) {
|
|
626
626
|
case "Date":
|
|
627
627
|
return new Date(
|
|
@@ -670,15 +670,15 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
670
670
|
timestamp: this.timestamp()
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
},
|
|
673
|
+
}, R.fn.format = function(t) {
|
|
674
674
|
for (var s = 0, a = "", c; s < t.length; )
|
|
675
675
|
t.charAt(s) === "%" ? (c = t.charAt(s) + t.charAt(s + 1), U[c] !== e ? (a += U[c].format(this), s += 1) : a += "%") : a += t.charAt(s), s += 1;
|
|
676
676
|
return a;
|
|
677
|
-
},
|
|
677
|
+
}, R.fn.valid = function() {
|
|
678
678
|
return this._i.year === !1 && this._i.month === !1 && this._i.day === !1 && this._i.hours === !1 && this._i.minutes === !1 && this._i.seconds === !1 && this._i.milliseconds === !1;
|
|
679
|
-
},
|
|
679
|
+
}, R.fn.errors = function() {
|
|
680
680
|
return this._i;
|
|
681
|
-
},
|
|
681
|
+
}, R.fn.between = function(t, s) {
|
|
682
682
|
var a = this.timestamp(), c = t.timestamp();
|
|
683
683
|
switch (s) {
|
|
684
684
|
case "year":
|
|
@@ -696,38 +696,38 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
696
696
|
default:
|
|
697
697
|
return e;
|
|
698
698
|
}
|
|
699
|
-
},
|
|
699
|
+
}, R.fn.calc = function(t) {
|
|
700
700
|
return t.year !== e && this._d.setFullYear(this._d.getFullYear() + t.year), t.month !== e && this._d.setMonth(this._d.getMonth() + t.month), t.day !== e && this._d.setDate(this._d.getDate() + t.day), t.hours !== e && this._d.setHours(this._d.getHours() + t.hours), t.minutes !== e && this._d.setMinutes(this._d.getMinutes() + t.minutes), t.seconds !== e && this._d.setSeconds(this._d.getSeconds() + t.seconds), t.milliseconds !== e && this._d.setMilliseconds(this._d.getMilliseconds() + t.milliseconds), this;
|
|
701
701
|
}, i = function(t, s, a) {
|
|
702
|
-
return new
|
|
702
|
+
return new R(t, s, a);
|
|
703
703
|
}, i.MIN_YEAR = 1e3, i.MAX_YEAR = 3e3, i.MIN_MONTH = 1, i.MAX_MONTH = 12, i.MIN_DAY = 1, i.MAX_DAY_IN_MONTHS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], i.MIN_DAY_OF_WEEK = 0, i.MAX_DAY_OF_WEEK = 6, i.MIN_HOURS = 0, i.MAX_HOURS = 23, i.MIN_MINUTES = 0, i.MAX_MINUTES = 59, i.MIN_SECONDS = 0, i.MAX_SECONDS = 59, i.MIN_MILLISECONDS = 0, i.MAX_MILLISECONDS = 999, i.VERSION = "0.2.18", i.options = function(t, s) {
|
|
704
704
|
if (t === e)
|
|
705
|
-
return
|
|
706
|
-
if (
|
|
705
|
+
return pt;
|
|
706
|
+
if (pt.hasOwnProperty(t)) {
|
|
707
707
|
if (s === e)
|
|
708
|
-
return
|
|
709
|
-
|
|
708
|
+
return pt[t];
|
|
709
|
+
pt[t] = s, t === "monthFromZero" && (i.MIN_MONTH = s ? 0 : 1, i.MAX_MONTH = s ? 11 : 12);
|
|
710
710
|
}
|
|
711
711
|
return e;
|
|
712
712
|
}, i.noConflict = function() {
|
|
713
713
|
return n.tempus = u, i;
|
|
714
714
|
}, i.generate = function(t) {
|
|
715
|
-
var s, a, c, L,
|
|
716
|
-
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof
|
|
715
|
+
var s, a, c, L, d, S, X, H;
|
|
716
|
+
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof R ? s = t.dateFrom.utc() : s = i(t.dateFrom, t.formatFrom).utc()), typeof t.dateTo != "number" && (t.dateTo instanceof R ? a = t.dateTo.utc() : a = i(t.dateTo, t.formatTo !== e ? t.formatTo : t.formatFrom).utc()), typeof t.period == "number" ? d = {
|
|
717
717
|
year: 0,
|
|
718
718
|
month: 0,
|
|
719
719
|
day: 0,
|
|
720
720
|
hours: 0,
|
|
721
721
|
minutes: 0,
|
|
722
722
|
seconds: t.period
|
|
723
|
-
} : typeof t.period == "string" ?
|
|
723
|
+
} : typeof t.period == "string" ? d = {
|
|
724
724
|
year: t.period === "year" ? 1 : 0,
|
|
725
725
|
month: t.period === "month" ? 1 : 0,
|
|
726
726
|
day: t.period === "day" ? 1 : 0,
|
|
727
727
|
hours: t.period === "hours" ? 1 : 0,
|
|
728
728
|
minutes: t.period === "minutes" ? 1 : 0,
|
|
729
729
|
seconds: t.period === "seconds" ? 1 : 0
|
|
730
|
-
} : typeof t.period == "object" && (
|
|
730
|
+
} : typeof t.period == "object" && (d = {
|
|
731
731
|
year: t.period.year !== e ? t.period.year : 0,
|
|
732
732
|
month: t.period.month !== e ? t.period.month : 0,
|
|
733
733
|
day: t.period.day !== e ? t.period.day : 0,
|
|
@@ -738,177 +738,186 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
738
738
|
return t.asObject === !0 ? t.format !== e ? w[i(p).format(t.format)] = {} : w[i(p).format("%F %H:%M:%S")] = {} : t.format !== e ? w.push(b ? null : i(p).format(t.format)) : w.push(b ? null : i(p)), w;
|
|
739
739
|
}, t.groupBy !== e && t.fillNulls) {
|
|
740
740
|
var D = {
|
|
741
|
-
year:
|
|
742
|
-
month:
|
|
743
|
-
day:
|
|
744
|
-
hours:
|
|
745
|
-
minutes:
|
|
746
|
-
seconds:
|
|
747
|
-
milliseconds:
|
|
741
|
+
year: d.year ? -d.year : e,
|
|
742
|
+
month: d.month ? -d.month : e,
|
|
743
|
+
day: d.day ? -d.day : e,
|
|
744
|
+
hours: d.hours ? -d.hours : e,
|
|
745
|
+
minutes: d.minutes ? -d.minutes : e,
|
|
746
|
+
seconds: d.seconds ? -d.seconds : e,
|
|
747
|
+
milliseconds: d.milliseconds ? -d.milliseconds : e
|
|
748
748
|
};
|
|
749
749
|
for (c = i(s).calc(D).utc(); i(c).get()[t.groupBy] === X; )
|
|
750
750
|
H(S[S.length - 1], c, !0), c = i(c).calc(D).utc();
|
|
751
751
|
if (t.groupBy === "week") {
|
|
752
752
|
var M = i(s).dayOfWeek();
|
|
753
753
|
for (c = i(s).dayOfWeek(0).utc(); S[0].length < M && c < s; )
|
|
754
|
-
H(S[S.length - 1], c, !0), c = i(c).calc(
|
|
754
|
+
H(S[S.length - 1], c, !0), c = i(c).calc(d).utc();
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
for (; s <= a; )
|
|
758
|
-
t.groupBy === e ? H(S, s) : i(s).get()[t.groupBy] === X ? H(S[S.length - 1], s) : (S.push([]), H(S[S.length - 1], s), X = i(s).get()[t.groupBy]), s = i(s).calc(
|
|
758
|
+
t.groupBy === e ? H(S, s) : i(s).get()[t.groupBy] === X ? H(S[S.length - 1], s) : (S.push([]), H(S[S.length - 1], s), X = i(s).get()[t.groupBy]), s = i(s).calc(d).utc();
|
|
759
759
|
if (t.groupBy !== e && t.fillNulls)
|
|
760
|
-
for (L = i(a).calc(
|
|
761
|
-
H(S[S.length - 1], L, !0), L = i(L).calc(
|
|
760
|
+
for (L = i(a).calc(d).utc(); i(L).get()[t.groupBy] === X; )
|
|
761
|
+
H(S[S.length - 1], L, !0), L = i(L).calc(d).utc();
|
|
762
762
|
return S;
|
|
763
763
|
}, i.monthNames = function(t) {
|
|
764
764
|
switch (t) {
|
|
765
765
|
case "long":
|
|
766
766
|
return P;
|
|
767
767
|
default:
|
|
768
|
-
return
|
|
768
|
+
return Mt;
|
|
769
769
|
}
|
|
770
770
|
}, i.dayNames = function(t) {
|
|
771
771
|
switch (t) {
|
|
772
772
|
case "long":
|
|
773
|
-
return ht;
|
|
774
|
-
default:
|
|
775
773
|
return ct;
|
|
774
|
+
default:
|
|
775
|
+
return lt;
|
|
776
776
|
}
|
|
777
777
|
}, i.lang = function(t) {
|
|
778
778
|
if (t !== e)
|
|
779
|
-
m = t,
|
|
779
|
+
m = t, N[m] === e && (m = "en"), P = G(), Mt = ht(), ct = z(), lt = k();
|
|
780
780
|
else
|
|
781
781
|
return m;
|
|
782
782
|
return e;
|
|
783
783
|
}, i.availableLangs = function() {
|
|
784
|
-
return Object.keys(
|
|
785
|
-
}, i.registerFormat = function(t, s, a, c, L,
|
|
784
|
+
return Object.keys(N);
|
|
785
|
+
}, i.registerFormat = function(t, s, a, c, L, d) {
|
|
786
786
|
U[t] = {
|
|
787
787
|
format: s,
|
|
788
788
|
parse: a,
|
|
789
789
|
minLength: c,
|
|
790
790
|
maxLength: L,
|
|
791
|
-
type:
|
|
791
|
+
type: d
|
|
792
792
|
};
|
|
793
793
|
}, i.unregisterFormat = function(t) {
|
|
794
794
|
delete U[t];
|
|
795
795
|
}, i.detectFormat = function(t) {
|
|
796
796
|
var s, a, c;
|
|
797
|
-
return s =
|
|
798
|
-
},
|
|
799
|
-
TempusDate:
|
|
797
|
+
return s = O(t, 0), s !== "" && (c = 10), a = t.charAt(c), (a === "T" || a === " ") && (s += a, c += 1), s += l(t, c), s;
|
|
798
|
+
}, T = {
|
|
799
|
+
TempusDate: R
|
|
800
800
|
}, i.classes = function(t, s) {
|
|
801
801
|
if (s === e)
|
|
802
|
-
return
|
|
803
|
-
|
|
802
|
+
return T[t];
|
|
803
|
+
T[t] = s;
|
|
804
804
|
}, i.loadTranslations = function(t) {
|
|
805
|
-
typeof t == "object" ?
|
|
806
|
-
|
|
805
|
+
typeof t == "object" ? N = t : typeof t == "string" && me(t, function(s) {
|
|
806
|
+
N = s;
|
|
807
807
|
}, function(s) {
|
|
808
808
|
});
|
|
809
|
-
}, m = (
|
|
810
|
-
}).call(
|
|
811
|
-
})(
|
|
812
|
-
var
|
|
813
|
-
const
|
|
814
|
-
var
|
|
809
|
+
}, m = (g.language || g.systemLanguage || g.userLanguage || "en").substr(0, 2).toLowerCase(), N[m] === e && (m = "en"), P = G(), Mt = ht(), ct = z(), lt = k(), y.exports && (A = y.exports = i), A.tempus = i;
|
|
810
|
+
}).call(_e);
|
|
811
|
+
})(jt, jt.exports);
|
|
812
|
+
var ye = jt.exports;
|
|
813
|
+
const Ht = /* @__PURE__ */ Oe(ye);
|
|
814
|
+
var K, mt, q, Y, W, j, v, $, I, Q, It, tt, F, et, At, nt, Dt, ft, Qt, Nt, Zt, _t, Vt, Ot, zt, yt, Kt, Ut, se, Gt, ie, dt, qt, Et, vt, gt, $t, ot, Yt, Tt, te, wt, re, st, ut, at, Bt, Rt, ee;
|
|
815
815
|
class x {
|
|
816
816
|
constructor(A, e = {}) {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
817
|
+
f(this, nt);
|
|
818
|
+
f(this, ft);
|
|
819
|
+
f(this, Nt);
|
|
820
|
+
f(this, _t);
|
|
821
|
+
f(this, Ot);
|
|
822
|
+
f(this, yt);
|
|
823
|
+
f(this, Ut);
|
|
824
|
+
f(this, Gt);
|
|
825
|
+
f(this, dt);
|
|
826
|
+
f(this, Et);
|
|
827
|
+
f(this, gt);
|
|
828
|
+
f(this, ot);
|
|
829
|
+
f(this, Tt);
|
|
830
|
+
f(this, wt);
|
|
831
|
+
f(this, st);
|
|
832
|
+
f(this, at);
|
|
833
|
+
f(this, Rt);
|
|
834
|
+
f(this, K, null);
|
|
835
|
+
f(this, mt, null);
|
|
836
|
+
f(this, q, []);
|
|
837
|
+
f(this, Y, {});
|
|
838
|
+
f(this, W, 50);
|
|
839
|
+
f(this, j, 50);
|
|
840
|
+
f(this, v, !0);
|
|
841
|
+
f(this, $, null);
|
|
842
|
+
f(this, I, null);
|
|
843
|
+
f(this, Q, null);
|
|
844
|
+
f(this, It, 100);
|
|
845
|
+
f(this, tt, "no");
|
|
846
|
+
f(this, F, !1);
|
|
847
|
+
f(this, et, !1);
|
|
848
|
+
f(this, At, !1);
|
|
848
849
|
C(this, "errors", {});
|
|
849
850
|
C(this, "answerData", {});
|
|
850
|
-
|
|
851
|
+
E(this, K, A), E(this, mt, e);
|
|
851
852
|
}
|
|
852
853
|
get serial() {
|
|
853
854
|
return o(this, F);
|
|
854
855
|
}
|
|
856
|
+
get limitCommandSerial() {
|
|
857
|
+
return o(this, j);
|
|
858
|
+
}
|
|
859
|
+
set limitCommandSerial(A) {
|
|
860
|
+
if (A < 10)
|
|
861
|
+
throw new Error("limitCommandSerial не может быть меньше 10");
|
|
862
|
+
A >= 10 && A < 50 && (E(this, W, A), E(this, j, A)), E(this, j, A);
|
|
863
|
+
}
|
|
855
864
|
setSerial() {
|
|
856
|
-
|
|
865
|
+
E(this, F, !0), E(this, et, !0), E(this, At, !1);
|
|
857
866
|
}
|
|
858
867
|
setParallel() {
|
|
859
|
-
|
|
868
|
+
E(this, F, !1), E(this, et, !1), E(this, At, !0);
|
|
860
869
|
}
|
|
861
870
|
stop() {
|
|
862
|
-
|
|
871
|
+
E(this, v, !1);
|
|
863
872
|
}
|
|
864
873
|
async batch(A, e) {
|
|
865
|
-
o(this,
|
|
866
|
-
const n =
|
|
867
|
-
if (Object.keys(A).length <
|
|
868
|
-
const r = n.map((h, l) =>
|
|
874
|
+
o(this, Q) && _(this, ft, Qt).call(this), e && E(this, $, e), o(this, et) === !1 && E(this, F, !1), Object.keys(A).length > o(this, j) && E(this, F, !0), E(this, v, !0), E(this, q, []), E(this, Y, {}), this.errors = {}, this.answerData = {};
|
|
875
|
+
const n = _(this, _t, Vt).call(this, A);
|
|
876
|
+
if (Object.keys(A).length < o(this, j)) {
|
|
877
|
+
const r = n.map((h, l) => _(this, Ot, zt).call(this, h, n[l]));
|
|
869
878
|
return Promise.allSettled(r).then((h) => {
|
|
870
879
|
let l = {};
|
|
871
|
-
for (let
|
|
872
|
-
|
|
880
|
+
for (let O of h)
|
|
881
|
+
O.status === "fulfilled" && (l = { ...l, ...O.value });
|
|
873
882
|
return l;
|
|
874
883
|
});
|
|
875
884
|
} else {
|
|
876
|
-
let r = {}, h = 0, l = 1,
|
|
877
|
-
h += Object.keys(i).length, l = Math.round(h /
|
|
885
|
+
let r = {}, h = 0, l = 1, O = Object.keys(A).length || 1, u = (i) => {
|
|
886
|
+
h += Object.keys(i).length, l = Math.round(h / O * 100);
|
|
878
887
|
};
|
|
879
|
-
for (let [i,
|
|
880
|
-
let
|
|
881
|
-
u(
|
|
888
|
+
for (let [i, T] of Object.entries(n)) {
|
|
889
|
+
let g = await _(this, Ot, zt).call(this, T, n[i], !0);
|
|
890
|
+
u(T), e && e({ percent: l }), r = { ...r, ...g };
|
|
882
891
|
}
|
|
883
892
|
return r;
|
|
884
893
|
}
|
|
885
894
|
}
|
|
886
895
|
async batchTotalCount(A, e) {
|
|
887
|
-
|
|
896
|
+
E(this, Y, {}), this.errors = {};
|
|
888
897
|
let n = 1, r = 0, h = Object.keys(A).length || 1, l = (u) => {
|
|
889
898
|
r += Object.keys(u).length, n = Math.round(r / h * 100);
|
|
890
899
|
};
|
|
891
900
|
e && e({ percent: n });
|
|
892
|
-
const
|
|
893
|
-
if (o(this,
|
|
894
|
-
const u =
|
|
901
|
+
const O = _(this, _t, Vt).call(this, A);
|
|
902
|
+
if (o(this, At)) {
|
|
903
|
+
const u = O.map((i) => _(this, yt, Kt).call(this, i).then((T) => (l(i), e && e({ percent: n }), T)));
|
|
895
904
|
return Promise.allSettled(u).then((i) => {
|
|
896
|
-
let
|
|
897
|
-
for (let
|
|
898
|
-
|
|
899
|
-
return
|
|
905
|
+
let T = {};
|
|
906
|
+
for (let g of i)
|
|
907
|
+
g.status === "fulfilled" && (T = { ...T, ...g.value });
|
|
908
|
+
return T;
|
|
900
909
|
});
|
|
901
910
|
} else {
|
|
902
911
|
let u = {};
|
|
903
|
-
for (let i of
|
|
904
|
-
let
|
|
905
|
-
l(i), e && e({ percent: n }), u = { ...u, ...
|
|
912
|
+
for (let i of O) {
|
|
913
|
+
let T = await _(this, yt, Kt).call(this, i);
|
|
914
|
+
l(i), e && e({ percent: n }), u = { ...u, ...T };
|
|
906
915
|
}
|
|
907
916
|
return u;
|
|
908
917
|
}
|
|
909
918
|
}
|
|
910
919
|
}
|
|
911
|
-
|
|
920
|
+
K = new WeakMap(), mt = new WeakMap(), q = new WeakMap(), Y = new WeakMap(), W = new WeakMap(), j = new WeakMap(), v = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), Q = new WeakMap(), It = new WeakMap(), tt = new WeakMap(), F = new WeakMap(), et = new WeakMap(), At = new WeakMap(), nt = new WeakSet(), Dt = function() {
|
|
912
921
|
let A = 0;
|
|
913
922
|
if (!o(this, I))
|
|
914
923
|
return Math.round(A);
|
|
@@ -917,108 +926,108 @@ z = new WeakMap(), ut = new WeakMap(), K = new WeakMap(), Y = new WeakMap(), k =
|
|
|
917
926
|
const { total: h, count: l } = r;
|
|
918
927
|
e += h ?? 0, n += l ?? 0;
|
|
919
928
|
}), e ? A = n / e * 100 : A = 100, { percent: Math.round(A), allCount: n, allTotal: e };
|
|
920
|
-
},
|
|
921
|
-
clearInterval(o(this,
|
|
922
|
-
},
|
|
923
|
-
const n =
|
|
929
|
+
}, ft = new WeakSet(), Qt = function() {
|
|
930
|
+
clearInterval(o(this, Q)), E(this, Q, ""), E(this, I, ""), E(this, $, ""), E(this, tt, "no");
|
|
931
|
+
}, Nt = new WeakSet(), Zt = function({ key: A, value: e }) {
|
|
932
|
+
const n = _(this, st, ut).call(this, e.data()), r = Array.isArray(n) ? n.length : 0, h = _(this, at, Bt).call(this, e.total(), r);
|
|
924
933
|
let l = 1;
|
|
925
|
-
n && (l = r), o(this,
|
|
926
|
-
const { percent:
|
|
927
|
-
(o(this,
|
|
934
|
+
n && (l = r), o(this, $) && (o(this, I) || E(this, I, {}), o(this, I)[A] && o(this, I)[A].count && (l += o(this, I)[A].count), o(this, I)[A] = { total: h, count: l }, o(this, Q) || E(this, Q, setInterval(() => {
|
|
935
|
+
const { percent: O, allCount: u, allTotal: i } = o(this, nt, Dt);
|
|
936
|
+
(o(this, tt) === "no" || o(this, tt) < o(this, nt, Dt).percent) && (o(this, $).call(this, {
|
|
928
937
|
data: o(this, I),
|
|
929
|
-
percent:
|
|
938
|
+
percent: O,
|
|
930
939
|
allCount: u,
|
|
931
940
|
allTotal: i
|
|
932
|
-
}),
|
|
933
|
-
}, o(this,
|
|
934
|
-
},
|
|
941
|
+
}), E(this, tt, o(this, nt, Dt).percent)), O === 100 && _(this, ft, Qt).call(this);
|
|
942
|
+
}, o(this, It))));
|
|
943
|
+
}, _t = new WeakSet(), Vt = function(A) {
|
|
935
944
|
const e = [], n = Object.entries(A);
|
|
936
|
-
for (let r = 0; r < n.length; r += o(this,
|
|
937
|
-
const h = n.slice(r, r + o(this,
|
|
945
|
+
for (let r = 0; r < n.length; r += o(this, W)) {
|
|
946
|
+
const h = n.slice(r, r + o(this, W));
|
|
938
947
|
e.push(Object.fromEntries(h));
|
|
939
948
|
}
|
|
940
949
|
return e;
|
|
941
|
-
},
|
|
950
|
+
}, Ot = new WeakSet(), zt = function(A, e, n) {
|
|
942
951
|
return new Promise((r) => {
|
|
943
|
-
const h =
|
|
944
|
-
let
|
|
945
|
-
o(this,
|
|
946
|
-
Object.entries(i).forEach(([
|
|
952
|
+
const h = _(this, Tt, te).call(this, e), l = [];
|
|
953
|
+
let O = 0, u = 0;
|
|
954
|
+
o(this, K).call(this, A, (i) => {
|
|
955
|
+
Object.entries(i).forEach(([T, g]) => {
|
|
947
956
|
let m = {};
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
-
let { query: { method:
|
|
951
|
-
this.errors[
|
|
957
|
+
const N = g.error();
|
|
958
|
+
if (N) {
|
|
959
|
+
let { query: { method: k }, answer: P } = g;
|
|
960
|
+
this.errors[T] = { error: N, method: k }, O += 1;
|
|
952
961
|
}
|
|
953
|
-
if (
|
|
954
|
-
for (let [
|
|
955
|
-
|
|
956
|
-
Object.keys(m).length && (this.answerData[
|
|
962
|
+
if (g != null && g.answer && Object.keys(g.answer).length) {
|
|
963
|
+
for (let [k, P] of Object.entries(g.answer))
|
|
964
|
+
k != "result" && P && (m[k] = P);
|
|
965
|
+
Object.keys(m).length && (this.answerData[T] = m);
|
|
957
966
|
}
|
|
958
|
-
const G =
|
|
959
|
-
if (Array.isArray(G) ? o(this, Y)[
|
|
960
|
-
const
|
|
961
|
-
l.push([
|
|
967
|
+
const G = _(this, st, ut).call(this, g.data()), ht = Array.isArray(G) ? G.length : 0, z = _(this, at, Bt).call(this, g.total(), ht);
|
|
968
|
+
if (Array.isArray(G) ? o(this, Y)[T] = G : typeof G == "object" && G !== null && Object.keys(G).length === 0 ? o(this, Y)[T] = [] : o(this, Y)[T] = G, u += z, n || _(this, Nt, Zt).call(this, { key: T, value: g }), z > o(this, W) && z > ht) {
|
|
969
|
+
const k = Math.ceil(z / o(this, W)) - 1, P = Array.from({ length: k });
|
|
970
|
+
l.push([T, h[T], P]);
|
|
962
971
|
}
|
|
963
|
-
}), u > 5e3 && o(this,
|
|
972
|
+
}), u > 5e3 && o(this, et) === !1 && o(this, At) === !1 && E(this, F, !0), O > 0 && _(this, Rt, ee).call(this), l.length ? (_(this, Ut, se).call(this, l), _(this, Gt, ie).call(this).then(() => r(_(this, ot, Yt).call(this)))) : r(_(this, ot, Yt).call(this));
|
|
964
973
|
});
|
|
965
974
|
});
|
|
966
|
-
},
|
|
975
|
+
}, yt = new WeakSet(), Kt = function(A) {
|
|
967
976
|
return new Promise((e) => {
|
|
968
|
-
const n =
|
|
977
|
+
const n = _(this, Tt, te).call(this, A);
|
|
969
978
|
let r = 0;
|
|
970
|
-
o(this,
|
|
971
|
-
Object.entries(h).forEach(([l,
|
|
972
|
-
const u =
|
|
979
|
+
o(this, K).call(this, n, (h) => {
|
|
980
|
+
Object.entries(h).forEach(([l, O]) => {
|
|
981
|
+
const u = O.error();
|
|
973
982
|
u && (this.errors[l] = u, r += 1);
|
|
974
|
-
const i =
|
|
975
|
-
o(this, Y)[l] =
|
|
976
|
-
}), r > 0 &&
|
|
983
|
+
const i = _(this, st, ut).call(this, O.data()), T = Array.isArray(i) ? i.length : 0, g = _(this, at, Bt).call(this, O.total(), T);
|
|
984
|
+
o(this, Y)[l] = g;
|
|
985
|
+
}), r > 0 && _(this, Rt, ee).call(this), e(_(this, ot, Yt).call(this));
|
|
977
986
|
});
|
|
978
987
|
});
|
|
979
|
-
},
|
|
988
|
+
}, Ut = new WeakSet(), se = function(A) {
|
|
980
989
|
let e = [];
|
|
981
990
|
A.forEach(([n, r, h]) => {
|
|
982
|
-
h.forEach((l,
|
|
983
|
-
const u =
|
|
984
|
-
e.length === o(this,
|
|
991
|
+
h.forEach((l, O) => {
|
|
992
|
+
const u = O + 1, i = o(this, W) * u, g = [[n, u].join("_"), _(this, wt, re).call(this, r, i)];
|
|
993
|
+
e.length === o(this, W) ? (o(this, q).push(e), e = [g]) : e.push(g);
|
|
985
994
|
});
|
|
986
|
-
}), e.length && o(this,
|
|
987
|
-
},
|
|
995
|
+
}), e.length && o(this, q).push(e);
|
|
996
|
+
}, Gt = new WeakSet(), ie = function() {
|
|
988
997
|
const A = [], e = [], n = (r) => {
|
|
989
998
|
Object.entries(r).forEach(([h, l]) => {
|
|
990
|
-
const [
|
|
991
|
-
Array.isArray(u) && o(this, Y)[
|
|
999
|
+
const [O] = h.split("_"), u = _(this, st, ut).call(this, l.data());
|
|
1000
|
+
Array.isArray(u) && o(this, Y)[O].push(...u), _(this, Nt, Zt).call(this, { key: O, value: l });
|
|
992
1001
|
});
|
|
993
1002
|
};
|
|
994
|
-
return o(this,
|
|
995
|
-
const l = Object.fromEntries(r),
|
|
1003
|
+
return o(this, q).forEach((r, h) => {
|
|
1004
|
+
const l = Object.fromEntries(r), O = () => new Promise((u) => o(this, K).call(this, l, (i) => {
|
|
996
1005
|
o(this, F) ? n(i) : e[h] = i, u();
|
|
997
1006
|
}));
|
|
998
|
-
A.push(
|
|
999
|
-
}), o(this, F) ?
|
|
1007
|
+
A.push(O);
|
|
1008
|
+
}), o(this, F) ? _(this, Et, vt).call(this, A) : _(this, gt, $t).call(this, A).then(() => {
|
|
1000
1009
|
e.forEach(n);
|
|
1001
1010
|
});
|
|
1002
|
-
},
|
|
1011
|
+
}, dt = new WeakSet(), qt = function() {
|
|
1003
1012
|
return new Promise((A) => setTimeout(A, 500));
|
|
1004
|
-
},
|
|
1013
|
+
}, Et = new WeakSet(), vt = function(A) {
|
|
1005
1014
|
if (!A.length)
|
|
1006
1015
|
return Promise.resolve();
|
|
1007
1016
|
const e = A.shift();
|
|
1008
1017
|
return Promise.allSettled([
|
|
1009
1018
|
e(),
|
|
1010
|
-
|
|
1011
|
-
]).then(() => o(this,
|
|
1012
|
-
},
|
|
1019
|
+
_(this, dt, qt).call(this)
|
|
1020
|
+
]).then(() => o(this, v) ? _(this, Et, vt).call(this, A) : Promise.resolve());
|
|
1021
|
+
}, gt = new WeakSet(), $t = function(A) {
|
|
1013
1022
|
if (!A.length)
|
|
1014
1023
|
return Promise.resolve();
|
|
1015
1024
|
const e = A.shift();
|
|
1016
|
-
return
|
|
1017
|
-
},
|
|
1018
|
-
return Object.entries(o(this,
|
|
1025
|
+
return _(this, dt, qt).call(this).then(() => e()).then(() => o(this, v) ? _(this, gt, $t).call(this, A) : Promise.resolve());
|
|
1026
|
+
}, ot = new WeakSet(), Yt = function() {
|
|
1027
|
+
return Object.entries(o(this, mt)).forEach(([A, e]) => {
|
|
1019
1028
|
o(this, Y)[A] && (o(this, Y)[A] = e(o(this, Y)[A]));
|
|
1020
1029
|
}), o(this, Y);
|
|
1021
|
-
},
|
|
1030
|
+
}, Tt = new WeakSet(), te = function(A) {
|
|
1022
1031
|
return Object.entries(A).reduce((e, [n, r]) => {
|
|
1023
1032
|
if (Array.isArray(r)) {
|
|
1024
1033
|
const [h, l = {}] = r;
|
|
@@ -1029,22 +1038,22 @@ z = new WeakMap(), ut = new WeakMap(), K = new WeakMap(), Y = new WeakMap(), k =
|
|
|
1029
1038
|
}
|
|
1030
1039
|
return e;
|
|
1031
1040
|
}, {});
|
|
1032
|
-
},
|
|
1041
|
+
}, wt = new WeakSet(), re = function(A, e) {
|
|
1033
1042
|
const [n, r] = A;
|
|
1034
1043
|
return [n, { start: e, ...r }];
|
|
1035
|
-
},
|
|
1044
|
+
}, st = new WeakSet(), ut = function(A) {
|
|
1036
1045
|
return ((A == null ? void 0 : A.items) || (A == null ? void 0 : A.documents)) ?? A;
|
|
1037
|
-
},
|
|
1046
|
+
}, at = new WeakSet(), Bt = function(A, e) {
|
|
1038
1047
|
return A !== A && (A = 0), A === 0 && e === 0 ? 0 : A || e;
|
|
1039
|
-
},
|
|
1048
|
+
}, Rt = new WeakSet(), ee = function() {
|
|
1040
1049
|
console.group(`${this.constructor.name}: Ошибки в методах!`), Object.entries(this.errors).forEach(([A, e]) => {
|
|
1041
1050
|
console.info(`[${A}]`, e);
|
|
1042
1051
|
}), console.groupEnd();
|
|
1043
1052
|
};
|
|
1044
|
-
var
|
|
1045
|
-
class
|
|
1053
|
+
var it;
|
|
1054
|
+
class ne {
|
|
1046
1055
|
constructor() {
|
|
1047
|
-
|
|
1056
|
+
f(this, it, {});
|
|
1048
1057
|
}
|
|
1049
1058
|
get hash() {
|
|
1050
1059
|
return this.createHash(8);
|
|
@@ -1059,7 +1068,7 @@ class re {
|
|
|
1059
1068
|
}
|
|
1060
1069
|
/** Фильтр часто запускаемых действий */
|
|
1061
1070
|
actionFilter({ keyTimer: A, duration: e = 10, action: n }) {
|
|
1062
|
-
o(this,
|
|
1071
|
+
o(this, it)[A] && (clearTimeout(o(this, it)[A]), o(this, it)[A] = null), n && (o(this, it)[A] = setTimeout(() => {
|
|
1063
1072
|
n();
|
|
1064
1073
|
}, e));
|
|
1065
1074
|
}
|
|
@@ -1084,28 +1093,28 @@ class re {
|
|
|
1084
1093
|
}, 200);
|
|
1085
1094
|
}
|
|
1086
1095
|
}
|
|
1087
|
-
|
|
1088
|
-
const
|
|
1089
|
-
var
|
|
1090
|
-
class
|
|
1096
|
+
it = new WeakMap();
|
|
1097
|
+
const bt = new ne();
|
|
1098
|
+
var J, Z, Ct, rt, St, V, Ft, oe, Lt, Ae, Pt, ae, Wt, he, Jt, ce;
|
|
1099
|
+
class de {
|
|
1091
1100
|
constructor() {
|
|
1092
|
-
|
|
1101
|
+
f(this, Ft);
|
|
1093
1102
|
/** Вывод ошибок логера
|
|
1094
1103
|
* @param {'entity'} type - тип ошибки
|
|
1095
1104
|
*/
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1105
|
+
f(this, Lt);
|
|
1106
|
+
f(this, Pt);
|
|
1107
|
+
f(this, Wt);
|
|
1108
|
+
f(this, Jt);
|
|
1109
|
+
f(this, J, "logger");
|
|
1110
|
+
f(this, Z, !1);
|
|
1111
|
+
f(this, Ct, 2e3);
|
|
1112
|
+
f(this, rt, /* @__PURE__ */ new Map());
|
|
1113
|
+
f(this, St, {});
|
|
1114
|
+
f(this, V, null);
|
|
1106
1115
|
/** Очистка хранилища элементов старше 'N' месяцев */
|
|
1107
1116
|
C(this, "periodClear", 3);
|
|
1108
|
-
|
|
1117
|
+
_(this, Ft, oe).call(this);
|
|
1109
1118
|
}
|
|
1110
1119
|
/** Инициализация логера */
|
|
1111
1120
|
async init() {
|
|
@@ -1113,22 +1122,22 @@ class ye {
|
|
|
1113
1122
|
entityList: { method: "entity.get" }
|
|
1114
1123
|
});
|
|
1115
1124
|
if (e != null && e.length)
|
|
1116
|
-
if (e.find((r) => r.ENTITY == o(this,
|
|
1117
|
-
|
|
1125
|
+
if (e.find((r) => r.ENTITY == o(this, J)))
|
|
1126
|
+
E(this, Z, !0);
|
|
1118
1127
|
else {
|
|
1119
1128
|
let { entityAdd: r } = await A.batch({
|
|
1120
1129
|
entityAdd: {
|
|
1121
1130
|
method: "entity.add",
|
|
1122
1131
|
params: {
|
|
1123
|
-
ENTITY: o(this,
|
|
1124
|
-
NAME: o(this,
|
|
1132
|
+
ENTITY: o(this, J),
|
|
1133
|
+
NAME: o(this, J),
|
|
1125
1134
|
ACCESS: { AU: "X" }
|
|
1126
1135
|
}
|
|
1127
1136
|
}
|
|
1128
1137
|
});
|
|
1129
|
-
r &&
|
|
1138
|
+
r && E(this, Z, !0);
|
|
1130
1139
|
}
|
|
1131
|
-
return
|
|
1140
|
+
return _(this, Wt, he).call(this), o(this, Z);
|
|
1132
1141
|
}
|
|
1133
1142
|
/**
|
|
1134
1143
|
* @param {{ type: 'call'|'batch'|'batch-total-count';
|
|
@@ -1140,15 +1149,15 @@ class ye {
|
|
|
1140
1149
|
* @returns {string}
|
|
1141
1150
|
*/
|
|
1142
1151
|
start({ type: A, data: e }) {
|
|
1143
|
-
if (!o(this,
|
|
1144
|
-
|
|
1152
|
+
if (!o(this, Z)) {
|
|
1153
|
+
_(this, Lt, Ae).call(this, "entity");
|
|
1145
1154
|
return;
|
|
1146
1155
|
}
|
|
1147
|
-
const n =
|
|
1148
|
-
return o(this,
|
|
1156
|
+
const n = bt.hash;
|
|
1157
|
+
return o(this, rt).set(n, {
|
|
1149
1158
|
type: A,
|
|
1150
1159
|
data: e,
|
|
1151
|
-
userInfo: o(this,
|
|
1160
|
+
userInfo: o(this, St),
|
|
1152
1161
|
errorList: [],
|
|
1153
1162
|
status: "",
|
|
1154
1163
|
answer: null,
|
|
@@ -1163,16 +1172,16 @@ class ye {
|
|
|
1163
1172
|
* answer: { [key]: unknown } }}
|
|
1164
1173
|
*/
|
|
1165
1174
|
stop({ key: A, errorList: e, status: n, answer: r }) {
|
|
1166
|
-
if (!o(this,
|
|
1167
|
-
|
|
1175
|
+
if (!o(this, Z)) {
|
|
1176
|
+
_(this, Lt, Ae).call(this, "entity");
|
|
1168
1177
|
return;
|
|
1169
1178
|
}
|
|
1170
|
-
let h = o(this,
|
|
1171
|
-
e && (h.errorList = e), n && (h.status = n), r && (h.answer = r),
|
|
1179
|
+
let h = o(this, rt).get(A);
|
|
1180
|
+
e && (h.errorList = e), n && (h.status = n), r && (h.answer = r), bt.actionFilter({
|
|
1172
1181
|
keyTimer: "add.entity.items",
|
|
1173
|
-
duration: o(this,
|
|
1182
|
+
duration: o(this, Ct),
|
|
1174
1183
|
action: () => {
|
|
1175
|
-
|
|
1184
|
+
_(this, Pt, ae).call(this);
|
|
1176
1185
|
}
|
|
1177
1186
|
});
|
|
1178
1187
|
}
|
|
@@ -1181,92 +1190,92 @@ class ye {
|
|
|
1181
1190
|
*/
|
|
1182
1191
|
async getEntityList(A) {
|
|
1183
1192
|
var r;
|
|
1184
|
-
if ((r = o(this,
|
|
1185
|
-
return o(this,
|
|
1193
|
+
if ((r = o(this, V)) != null && r.length)
|
|
1194
|
+
return o(this, V);
|
|
1186
1195
|
let e = new x(BX24.callBatch), { entityList: n } = await e.batch({
|
|
1187
1196
|
entityList: {
|
|
1188
1197
|
method: "entity.item.get",
|
|
1189
1198
|
params: {
|
|
1190
|
-
ENTITY: o(this,
|
|
1199
|
+
ENTITY: o(this, J),
|
|
1191
1200
|
SORT: { ID: "DESC" }
|
|
1192
1201
|
}
|
|
1193
1202
|
}
|
|
1194
1203
|
}, A);
|
|
1195
1204
|
return n = n.map((h) => {
|
|
1196
|
-
const { ID: l, DATE_CREATE:
|
|
1205
|
+
const { ID: l, DATE_CREATE: O, DETAIL_TEXT: u } = h;
|
|
1197
1206
|
return {
|
|
1198
1207
|
...JSON.parse(u),
|
|
1199
1208
|
id: l,
|
|
1200
|
-
dateCreate:
|
|
1209
|
+
dateCreate: O
|
|
1201
1210
|
};
|
|
1202
1211
|
}), n;
|
|
1203
1212
|
}
|
|
1204
1213
|
/** Выгрузка всех данных из хранилища в JSON-файл */
|
|
1205
1214
|
async downAllEntityJson() {
|
|
1206
|
-
let A = await this.getEntityList(), e =
|
|
1207
|
-
|
|
1215
|
+
let A = await this.getEntityList(), e = Ht().format("%Y-%m-%d");
|
|
1216
|
+
bt.downloadFileJson(A, `sdklogger-entity-data__${e}`);
|
|
1208
1217
|
}
|
|
1209
1218
|
}
|
|
1210
|
-
|
|
1219
|
+
J = new WeakMap(), Z = new WeakMap(), Ct = new WeakMap(), rt = new WeakMap(), St = new WeakMap(), V = new WeakMap(), Ft = new WeakSet(), oe = async function() {
|
|
1211
1220
|
const A = new x(BX24.callBatch), e = BX24.isAdmin(), { curUser: n } = await A.batch({
|
|
1212
1221
|
curUser: { method: "user.current" }
|
|
1213
1222
|
});
|
|
1214
|
-
|
|
1215
|
-
},
|
|
1216
|
-
A == "entity" &&
|
|
1223
|
+
E(this, St, { isAdmin: e, curUser: n });
|
|
1224
|
+
}, Lt = new WeakSet(), Ae = function(A) {
|
|
1225
|
+
A == "entity" && bt.actionFilter({
|
|
1217
1226
|
keyTimer: "error.logger.entity",
|
|
1218
1227
|
duration: 500,
|
|
1219
1228
|
action: () => {
|
|
1220
1229
|
console.error("Хранилище для логгера не инициализировано");
|
|
1221
1230
|
}
|
|
1222
1231
|
});
|
|
1223
|
-
},
|
|
1232
|
+
}, Pt = new WeakSet(), ae = async function() {
|
|
1224
1233
|
let A = {}, e = new x(BX24.callBatch);
|
|
1225
|
-
for (let [n, r] of o(this,
|
|
1234
|
+
for (let [n, r] of o(this, rt).entries())
|
|
1226
1235
|
r.status && (A[n] = {
|
|
1227
1236
|
method: "entity.item.add",
|
|
1228
1237
|
params: {
|
|
1229
|
-
ENTITY: o(this,
|
|
1230
|
-
NAME: o(this,
|
|
1238
|
+
ENTITY: o(this, J),
|
|
1239
|
+
NAME: o(this, J),
|
|
1231
1240
|
DETAIL_TEXT: JSON.stringify(r)
|
|
1232
1241
|
}
|
|
1233
1242
|
});
|
|
1234
1243
|
if (Object.keys(A).length) {
|
|
1235
1244
|
let n = await e.batch(A), { errors: r } = e;
|
|
1236
1245
|
for (let [h, l] of Object.entries({ ...n, ...r }))
|
|
1237
|
-
o(this,
|
|
1246
|
+
o(this, rt).delete(h);
|
|
1238
1247
|
}
|
|
1239
|
-
},
|
|
1248
|
+
}, Wt = new WeakSet(), he = async function() {
|
|
1240
1249
|
let A = new x(BX24.callBatch), { serverTime: e } = await A.batch({
|
|
1241
1250
|
serverTime: { method: "server.time" }
|
|
1242
1251
|
});
|
|
1243
|
-
o(this,
|
|
1244
|
-
let n = o(this,
|
|
1252
|
+
o(this, V) || E(this, V, await this.getEntityList());
|
|
1253
|
+
let n = o(this, V).filter((r) => {
|
|
1245
1254
|
let { dateCreate: h } = r;
|
|
1246
|
-
return
|
|
1255
|
+
return Ht(new Date(h)).between(Ht(new Date(e)), "month") >= this.periodClear;
|
|
1247
1256
|
});
|
|
1248
|
-
|
|
1249
|
-
},
|
|
1257
|
+
_(this, Jt, ce).call(this, n);
|
|
1258
|
+
}, Jt = new WeakSet(), ce = async function(A) {
|
|
1250
1259
|
let e = new x(BX24.callBatch), n = A.map((r) => {
|
|
1251
1260
|
let { id: h } = r;
|
|
1252
1261
|
return {
|
|
1253
1262
|
method: "entity.item.delete",
|
|
1254
1263
|
params: {
|
|
1255
|
-
ENTITY: o(this,
|
|
1264
|
+
ENTITY: o(this, J),
|
|
1256
1265
|
ID: h
|
|
1257
1266
|
}
|
|
1258
1267
|
};
|
|
1259
1268
|
});
|
|
1260
1269
|
return await e.batch(n);
|
|
1261
1270
|
};
|
|
1262
|
-
const B = new
|
|
1263
|
-
var
|
|
1264
|
-
class
|
|
1271
|
+
const B = new de();
|
|
1272
|
+
var kt, le, Xt, ue;
|
|
1273
|
+
class ge {
|
|
1265
1274
|
constructor(A) {
|
|
1266
1275
|
/** Запрос данных о приложении */
|
|
1267
|
-
|
|
1276
|
+
f(this, kt);
|
|
1268
1277
|
/** Запрос данных о текущем пользователе */
|
|
1269
|
-
|
|
1278
|
+
f(this, Xt);
|
|
1270
1279
|
C(this, "domain", "");
|
|
1271
1280
|
C(this, "isAdmin", !1);
|
|
1272
1281
|
C(this, "appInfo", null);
|
|
@@ -1282,10 +1291,10 @@ class Ee {
|
|
|
1282
1291
|
window.BX24 && BX24.init(async () => {
|
|
1283
1292
|
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await B.init();
|
|
1284
1293
|
const [n, r] = await Promise.all([
|
|
1285
|
-
|
|
1286
|
-
|
|
1294
|
+
_(this, kt, le).call(this),
|
|
1295
|
+
_(this, Xt, ue).call(this)
|
|
1287
1296
|
]);
|
|
1288
|
-
this.appInfo = n, this.userInfo = r, new
|
|
1297
|
+
this.appInfo = n, this.userInfo = r, new ne().noSleep(), A(!0);
|
|
1289
1298
|
});
|
|
1290
1299
|
}, 100);
|
|
1291
1300
|
});
|
|
@@ -1318,14 +1327,14 @@ class Ee {
|
|
|
1318
1327
|
});
|
|
1319
1328
|
return new Promise((h) => {
|
|
1320
1329
|
e || (e = {}), BX24.callMethod(A, e, function(l) {
|
|
1321
|
-
let
|
|
1330
|
+
let O = {};
|
|
1322
1331
|
if (l != null && l.answer)
|
|
1323
1332
|
for (let [u, i] of Object.entries(l.answer))
|
|
1324
|
-
u != "result" && i && (
|
|
1333
|
+
u != "result" && i && (O[u] = i);
|
|
1325
1334
|
if (l.error()) {
|
|
1326
1335
|
let u = l.error();
|
|
1327
1336
|
console.error(u), B.stop({
|
|
1328
|
-
answer:
|
|
1337
|
+
answer: O,
|
|
1329
1338
|
key: r,
|
|
1330
1339
|
status: "fail",
|
|
1331
1340
|
errorList: [u.toSting()]
|
|
@@ -1333,7 +1342,7 @@ class Ee {
|
|
|
1333
1342
|
} else {
|
|
1334
1343
|
let u = l.data();
|
|
1335
1344
|
u != null && u.items && (u = u.items), B.stop({
|
|
1336
|
-
answer:
|
|
1345
|
+
answer: O,
|
|
1337
1346
|
key: r,
|
|
1338
1347
|
status: "success"
|
|
1339
1348
|
}), h(u);
|
|
@@ -1360,42 +1369,43 @@ class Ee {
|
|
|
1360
1369
|
* }[]
|
|
1361
1370
|
* }}
|
|
1362
1371
|
*/
|
|
1363
|
-
async batch(A, e, { updateList: n, errorCall: r } = {}) {
|
|
1364
|
-
let
|
|
1372
|
+
async batch(A, e, { updateList: n, errorCall: r, limitCommandSerial: h } = {}) {
|
|
1373
|
+
let l = new x(BX24.callBatch), O = B.start({
|
|
1365
1374
|
type: "batch",
|
|
1366
1375
|
data: { commandList: A, updateList: n }
|
|
1367
1376
|
});
|
|
1377
|
+
h && (l.limitCommandSerial = h);
|
|
1368
1378
|
try {
|
|
1369
|
-
let
|
|
1370
|
-
if (Object.keys(
|
|
1371
|
-
let
|
|
1372
|
-
var
|
|
1379
|
+
let u = await l.batch(A, e);
|
|
1380
|
+
if (Object.keys(l.errors).length) {
|
|
1381
|
+
let i = Object.entries(l.errors).map(([T, g]) => {
|
|
1382
|
+
var m;
|
|
1373
1383
|
return {
|
|
1374
|
-
key:
|
|
1375
|
-
error: `${
|
|
1384
|
+
key: T,
|
|
1385
|
+
error: `${g == null ? void 0 : g.method} ${(m = g == null ? void 0 : g.error) == null ? void 0 : m.toString()}`.trim()
|
|
1376
1386
|
};
|
|
1377
1387
|
});
|
|
1378
|
-
r && r(
|
|
1379
|
-
key:
|
|
1388
|
+
r && r(l.errors), B.stop({
|
|
1389
|
+
key: O,
|
|
1380
1390
|
status: "fail",
|
|
1381
|
-
errorList:
|
|
1382
|
-
answer:
|
|
1391
|
+
errorList: i,
|
|
1392
|
+
answer: l.answerData
|
|
1383
1393
|
});
|
|
1384
1394
|
} else
|
|
1385
1395
|
B.stop({
|
|
1386
|
-
key:
|
|
1396
|
+
key: O,
|
|
1387
1397
|
status: "success",
|
|
1388
|
-
answer:
|
|
1398
|
+
answer: l.answerData
|
|
1389
1399
|
});
|
|
1390
|
-
return
|
|
1391
|
-
} catch (
|
|
1392
|
-
let
|
|
1400
|
+
return u;
|
|
1401
|
+
} catch (u) {
|
|
1402
|
+
let i = u == null ? void 0 : u.toString();
|
|
1393
1403
|
return B.stop({
|
|
1394
|
-
key:
|
|
1404
|
+
key: O,
|
|
1395
1405
|
status: "fail-runtime",
|
|
1396
|
-
errorList: [
|
|
1397
|
-
answer:
|
|
1398
|
-
}), console.error(
|
|
1406
|
+
errorList: [i],
|
|
1407
|
+
answer: l.answerData
|
|
1408
|
+
}), console.error(u), !1;
|
|
1399
1409
|
}
|
|
1400
1410
|
}
|
|
1401
1411
|
/**
|
|
@@ -1410,8 +1420,8 @@ class Ee {
|
|
|
1410
1420
|
try {
|
|
1411
1421
|
let h = await n.batchTotalCount(A, e);
|
|
1412
1422
|
if (Object.keys(n.errors).length) {
|
|
1413
|
-
let l = Object.entries(n.errors).map(([
|
|
1414
|
-
key:
|
|
1423
|
+
let l = Object.entries(n.errors).map(([O, u]) => ({
|
|
1424
|
+
key: O,
|
|
1415
1425
|
error: u.toSting()
|
|
1416
1426
|
}));
|
|
1417
1427
|
B.stop({
|
|
@@ -1488,7 +1498,7 @@ class Ee {
|
|
|
1488
1498
|
}
|
|
1489
1499
|
/* регистрация бота */
|
|
1490
1500
|
regBot({ code: A, type: e, name: n }) {
|
|
1491
|
-
const { appName: r, pathApp: h, chatBotLogo: l } = this.appConst,
|
|
1501
|
+
const { appName: r, pathApp: h, chatBotLogo: l } = this.appConst, O = this.appInfo.ID;
|
|
1492
1502
|
return this.call({
|
|
1493
1503
|
method: "imbot.register",
|
|
1494
1504
|
params: {
|
|
@@ -1504,7 +1514,7 @@ class Ee {
|
|
|
1504
1514
|
// строковый идентификатор чат-бота, используется только в режиме Вебхуков
|
|
1505
1515
|
PROPERTIES: {
|
|
1506
1516
|
// Личные данные чат-бота (обяз.)
|
|
1507
|
-
NAME: `${n ?? r} - бот #${
|
|
1517
|
+
NAME: `${n ?? r} - бот #${O}`,
|
|
1508
1518
|
// Имя чат-бота (обязательное одно из полей NAME или LAST_NAME)
|
|
1509
1519
|
LAST_NAME: "",
|
|
1510
1520
|
// Фамилия чат-бота (обязательное одно из полей NAME или LAST_NAME)
|
|
@@ -1512,7 +1522,7 @@ class Ee {
|
|
|
1512
1522
|
// Цвет чат-бота для мобильного приложения RED, GREEN, MINT, LIGHT_BLUE, DARK_BLUE, PURPLE, AQUA, PINK, LIME, BROWN, AZURE, KHAKI, SAND, MARENGO, GRAY, GRAPHITE
|
|
1513
1523
|
EMAIL: "",
|
|
1514
1524
|
// E-mail для связи. НЕЛЬЗЯ использовать e-mail, дублирующий e-mail реальных пользователей
|
|
1515
|
-
PERSONAL_BIRTHDAY:
|
|
1525
|
+
PERSONAL_BIRTHDAY: Ht().format("%Y-%m-%d"),
|
|
1516
1526
|
// День рождения в формате YYYY-mm-dd
|
|
1517
1527
|
WORK_POSITION: "Почтальон",
|
|
1518
1528
|
// Занимаемая должность, используется как описание чат-бота
|
|
@@ -1540,15 +1550,15 @@ class Ee {
|
|
|
1540
1550
|
return B.getEntityList(A);
|
|
1541
1551
|
}
|
|
1542
1552
|
}
|
|
1543
|
-
|
|
1553
|
+
kt = new WeakSet(), le = function() {
|
|
1544
1554
|
return this.call({ method: "app.info" });
|
|
1545
|
-
},
|
|
1555
|
+
}, Xt = new WeakSet(), ue = function() {
|
|
1546
1556
|
return this.call({ method: "user.current" });
|
|
1547
1557
|
};
|
|
1548
1558
|
export {
|
|
1549
1559
|
x as Batch,
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1560
|
+
ge as BxBoot,
|
|
1561
|
+
ne as BxHelper,
|
|
1562
|
+
de as BxLogger,
|
|
1563
|
+
Ht as tempus
|
|
1554
1564
|
};
|