@snabcentr/common-lib 2.25.0 → 2.25.1
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/manifest.json +1 -1
- package/dist/release_notes.tmp +2 -5
- package/dist/sc-common-lib.js +639 -606
- package/dist/sc-common-lib.js.map +1 -1
- package/dist/sc-common-lib.umd.cjs +1 -1
- package/dist/sc-common-lib.umd.cjs.map +1 -1
- package/dist/src/http/classes/http-requester.d.ts +14 -0
- package/dist/src/http/classes/http-requester.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var s = (
|
|
1
|
+
var $t = Object.defineProperty;
|
|
2
|
+
var kt = (n, r, e) => r in n ? $t(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
|
+
var s = (n, r, e) => kt(n, typeof r != "symbol" ? r + "" : r, e);
|
|
4
4
|
import { jwtDecode as Kr } from "jwt-decode";
|
|
5
|
-
import { merge as Ne, isNil as m, isEmpty as J, noop as T, mapValues as Xr, isArray as
|
|
5
|
+
import { merge as Ne, isNil as m, isEmpty as J, noop as T, mapValues as Xr, isArray as W, every as Ot, split as Lt, startsWith as Zr, endsWith as It, includes as xt, isString as R, isFunction as br, map as De, isObject as Ve, isDate as Je, isError as _r, toLower as _t, isPlainObject as Nt, isUndefined as He, constant as qt, toUpper as Et, cloneDeep as Ut, forEach as Ft, round as Mt, omitBy as et } from "lodash-es";
|
|
6
6
|
import { objectToCamel as Sr, objectToSnake as Ht } from "ts-case-convert";
|
|
7
7
|
import { defineStore as ne } from "pinia";
|
|
8
|
-
import { ref as v, markRaw as Bt, computed as
|
|
9
|
-
import { isAfter as Nr, parseISO as C, startOfToday as qe, format as k, endOfMonth as x, addMonths as $, differenceInCalendarMonths as
|
|
8
|
+
import { ref as v, markRaw as Bt, computed as A } from "vue";
|
|
9
|
+
import { isAfter as Nr, parseISO as C, startOfToday as qe, format as k, endOfMonth as x, addMonths as $, differenceInCalendarMonths as zt, startOfMonth as E, getDate as qr, getDaysInMonth as Wt, endOfDay as z, startOfDay as ge, setDate as jt, startOfWeek as ee, addWeeks as ar, differenceInCalendarDays as We, addDays as re, isValid as Gt, subDays as je, addBusinessDays as Yt, startOfYear as ue, endOfYear as de, endOfWeek as $e, endOfTomorrow as Qt, startOfTomorrow as Vt, endOfYesterday as Jt, startOfYesterday as Kt, endOfToday as Xt, startOfQuarter as ke, endOfQuarter as Be, addYears as ir, addQuarters as nr, subYears as or, subQuarters as cr, subMonths as lr, subWeeks as Er, addSeconds as Zt } from "date-fns";
|
|
10
10
|
import es, { CanceledError as rs } from "axios";
|
|
11
11
|
class Te {
|
|
12
12
|
/**
|
|
@@ -111,7 +111,7 @@ class Te {
|
|
|
111
111
|
return t.resourceAccess = e.resource_access, t;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
class
|
|
114
|
+
class rt extends Te {
|
|
115
115
|
/**
|
|
116
116
|
* Инициализирует экземпляр класса {@link DetailedJwtPayload}.
|
|
117
117
|
*
|
|
@@ -151,8 +151,8 @@ class et extends Te {
|
|
|
151
151
|
* @param jwtToken JWT-ключ доступа.
|
|
152
152
|
*/
|
|
153
153
|
static getJwtPayload(e) {
|
|
154
|
-
const t = Kr(e),
|
|
155
|
-
return
|
|
154
|
+
const t = Kr(e), i = new rt(Sr(t));
|
|
155
|
+
return i.resourceAccess = t.resource_access, i;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
class ts {
|
|
@@ -230,7 +230,7 @@ class is {
|
|
|
230
230
|
* Дополнительные параметры.
|
|
231
231
|
*/
|
|
232
232
|
s(this, "additionalParams");
|
|
233
|
-
var e, t,
|
|
233
|
+
var e, t, i, o;
|
|
234
234
|
this.dsn = (r == null ? void 0 : r.dsn) ?? "", this.environment = (r == null ? void 0 : r.environment) ?? "production", this.ignoreErrors = (r == null ? void 0 : r.ignoreErrors) ?? [
|
|
235
235
|
/Network\s{1,3}Error/,
|
|
236
236
|
/Request\s{1,3}aborted/,
|
|
@@ -239,7 +239,7 @@ class is {
|
|
|
239
239
|
allowedTargets: ((e = r == null ? void 0 : r.trace) == null ? void 0 : e.allowedTargets) ?? [/^\//],
|
|
240
240
|
sampleRate: ((t = r == null ? void 0 : r.trace) == null ? void 0 : t.sampleRate) ?? 0
|
|
241
241
|
}, this.replay = {
|
|
242
|
-
replaysOnErrorSampleRate: ((
|
|
242
|
+
replaysOnErrorSampleRate: ((i = r == null ? void 0 : r.replay) == null ? void 0 : i.replaysOnErrorSampleRate) ?? 0,
|
|
243
243
|
replaysSessionSampleRate: ((o = r == null ? void 0 : r.replay) == null ? void 0 : o.replaysSessionSampleRate) ?? 0
|
|
244
244
|
}, this.additionalParams = (r == null ? void 0 : r.additionalParams) ?? {};
|
|
245
245
|
}
|
|
@@ -326,41 +326,41 @@ class os {
|
|
|
326
326
|
* @inheritDoc
|
|
327
327
|
*/
|
|
328
328
|
s(this, "dateFormats");
|
|
329
|
-
var e, t,
|
|
329
|
+
var e, t, i;
|
|
330
330
|
this.environment = (r == null ? void 0 : r.environment) ?? "production", this.devMode = (r == null ? void 0 : r.devMode) ?? {}, this.http = new ss(r == null ? void 0 : r.http), this.deviceTypeByResolution = new ts(r == null ? void 0 : r.deviceTypeByResolution), this.sentry = new is({
|
|
331
331
|
environment: this.environment,
|
|
332
332
|
...r == null ? void 0 : r.sentry
|
|
333
333
|
}), this.tableDefaultHeightCoefficient = (r == null ? void 0 : r.tableDefaultHeightCoefficient) ?? 0.7, this.urls = r == null ? void 0 : r.urls, this.websocket = r != null && r.websocket ? new ns(r.websocket) : void 0, this.dateFormats = {
|
|
334
334
|
api: ((e = r == null ? void 0 : r.dateFormats) == null ? void 0 : e.api) ?? "yyyy-MM-dd HH:mm:ss",
|
|
335
335
|
uiDate: ((t = r == null ? void 0 : r.dateFormats) == null ? void 0 : t.uiDate) ?? "dd.MM.yyyy",
|
|
336
|
-
uiDateWithTime: ((
|
|
336
|
+
uiDateWithTime: ((i = r == null ? void 0 : r.dateFormats) == null ? void 0 : i.uiDateWithTime) ?? "dd.MM.yyyy HH:mm"
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
const O = ne("common.config", () => {
|
|
341
|
-
const
|
|
341
|
+
const n = v(new os());
|
|
342
342
|
return {
|
|
343
343
|
/**
|
|
344
344
|
* Конфигурационные данные приложения.
|
|
345
345
|
*/
|
|
346
|
-
config:
|
|
346
|
+
config: n,
|
|
347
347
|
/**
|
|
348
348
|
* Получает конфигурацию приложения.
|
|
349
349
|
*
|
|
350
350
|
* @returns Конфигурация приложения.
|
|
351
351
|
*/
|
|
352
|
-
getConfig: () =>
|
|
352
|
+
getConfig: () => n.value,
|
|
353
353
|
/**
|
|
354
354
|
* Устанавливает конфигурацию приложения.
|
|
355
355
|
*
|
|
356
356
|
* @param appConfig Конфигурация приложения.
|
|
357
357
|
*/
|
|
358
358
|
setConfig: (t) => {
|
|
359
|
-
|
|
359
|
+
n.value = Ne(n.value, t);
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
362
|
});
|
|
363
|
-
class
|
|
363
|
+
class Ge {
|
|
364
364
|
/**
|
|
365
365
|
* Возвращает актуальные и не просроченные данные из хранилища.
|
|
366
366
|
*
|
|
@@ -405,14 +405,14 @@ class je {
|
|
|
405
405
|
try {
|
|
406
406
|
if (m(e) || J(e))
|
|
407
407
|
throw new Error("Data is empty");
|
|
408
|
-
const
|
|
408
|
+
const i = JSON.stringify({
|
|
409
409
|
availableFor: t,
|
|
410
410
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
411
411
|
data: e
|
|
412
412
|
});
|
|
413
|
-
localStorage.setItem(r,
|
|
414
|
-
} catch (
|
|
415
|
-
if (
|
|
413
|
+
localStorage.setItem(r, i);
|
|
414
|
+
} catch (i) {
|
|
415
|
+
if (i instanceof DOMException && i.code === DOMException.QUOTA_EXCEEDED_ERR) {
|
|
416
416
|
this.clearOldData();
|
|
417
417
|
try {
|
|
418
418
|
const o = JSON.stringify({
|
|
@@ -451,9 +451,9 @@ class je {
|
|
|
451
451
|
const t = localStorage.key(e);
|
|
452
452
|
if (t)
|
|
453
453
|
try {
|
|
454
|
-
const
|
|
455
|
-
if (
|
|
456
|
-
const o = JSON.parse(
|
|
454
|
+
const i = localStorage.getItem(t);
|
|
455
|
+
if (i) {
|
|
456
|
+
const o = JSON.parse(i);
|
|
457
457
|
o.availableFor && !Nr(C(o.availableFor) || qe(), /* @__PURE__ */ new Date()) && r.push(t);
|
|
458
458
|
}
|
|
459
459
|
} catch {
|
|
@@ -470,19 +470,19 @@ class je {
|
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
function Ur(
|
|
473
|
+
function Ur(n) {
|
|
474
474
|
try {
|
|
475
|
-
const r = Te.getJwtPayload(
|
|
475
|
+
const r = Te.getJwtPayload(n);
|
|
476
476
|
return new Date(r.exp * 1e3);
|
|
477
477
|
} catch {
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
const pe = ne("common.auth_state_private", () => {
|
|
482
|
-
const
|
|
482
|
+
const n = v(
|
|
483
483
|
(() => {
|
|
484
484
|
var u;
|
|
485
|
-
const o =
|
|
485
|
+
const o = Ge.getActualDataFromStorage(
|
|
486
486
|
"sc.token"
|
|
487
487
|
/* JwtToken */
|
|
488
488
|
);
|
|
@@ -492,8 +492,8 @@ const pe = ne("common.auth_state_private", () => {
|
|
|
492
492
|
return c ? Promise.resolve(c) : void 0;
|
|
493
493
|
})()
|
|
494
494
|
), r = v(void 0), e = v(void 0), t = Bt(/* @__PURE__ */ new Map());
|
|
495
|
-
function
|
|
496
|
-
e.value = void 0, m(
|
|
495
|
+
function i() {
|
|
496
|
+
e.value = void 0, m(n.value) || n.value.then((o) => {
|
|
497
497
|
const c = Te.getJwtPayload(o);
|
|
498
498
|
e.value = c.exp * 1e3 > Date.now() ? Xr(c.resourceAccess, (u) => (u == null ? void 0 : u.roles) ?? []) : void 0;
|
|
499
499
|
}).catch(T);
|
|
@@ -502,7 +502,7 @@ const pe = ne("common.auth_state_private", () => {
|
|
|
502
502
|
/**
|
|
503
503
|
* {@link Promise<string>} для получения jwt-ключа доступа к системам.
|
|
504
504
|
*/
|
|
505
|
-
jwtToken:
|
|
505
|
+
jwtToken: n,
|
|
506
506
|
/**
|
|
507
507
|
* Функция для обновления jwt-ключа доступа к системам.
|
|
508
508
|
*/
|
|
@@ -518,15 +518,15 @@ const pe = ne("common.auth_state_private", () => {
|
|
|
518
518
|
/**
|
|
519
519
|
* Принудительно пересчитывает права доступа пользователя на основе текущего JWT токена.
|
|
520
520
|
*/
|
|
521
|
-
recalculateUserPermissions:
|
|
521
|
+
recalculateUserPermissions: i
|
|
522
522
|
};
|
|
523
|
-
}),
|
|
524
|
-
const
|
|
523
|
+
}), ze = ne("common.auth_state", () => {
|
|
524
|
+
const n = A(() => {
|
|
525
525
|
const o = pe();
|
|
526
526
|
if (m(o.jwtToken) && !m(o.jwtTokenUpdater)) {
|
|
527
527
|
const c = o.jwtTokenUpdater();
|
|
528
528
|
o.jwtToken = c, c.then((u) => {
|
|
529
|
-
o.jwtToken = Promise.resolve(u),
|
|
529
|
+
o.jwtToken = Promise.resolve(u), Ge.saveActualDataToStorage("sc.token", u, Ur(u)), o.recalculateUserPermissions();
|
|
530
530
|
}).catch(T);
|
|
531
531
|
}
|
|
532
532
|
return o.jwtToken;
|
|
@@ -536,31 +536,31 @@ const pe = ne("common.auth_state_private", () => {
|
|
|
536
536
|
}
|
|
537
537
|
function e(o) {
|
|
538
538
|
const c = pe();
|
|
539
|
-
c.jwtToken = Promise.resolve(o),
|
|
539
|
+
c.jwtToken = Promise.resolve(o), Ge.saveActualDataToStorage("sc.token", o, Ur(o)), c.recalculateUserPermissions();
|
|
540
540
|
}
|
|
541
541
|
function t() {
|
|
542
542
|
const o = pe();
|
|
543
|
-
o.jwtToken = void 0, o.userPermissions = void 0,
|
|
543
|
+
o.jwtToken = void 0, o.userPermissions = void 0, Ge.saveActualDataToStorage("sc.token", void 0);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function i(o) {
|
|
546
546
|
const c = pe();
|
|
547
547
|
!m(c.jwtToken) && m(c.userPermissions) && c.jwtToken.then((g) => {
|
|
548
548
|
const a = Te.getJwtPayload(g);
|
|
549
549
|
c.userPermissions = a.exp * 1e3 > Date.now() ? Xr(a.resourceAccess, (P) => (P == null ? void 0 : P.roles) ?? []) : void 0;
|
|
550
550
|
}).catch(T);
|
|
551
|
-
const u =
|
|
551
|
+
const u = W(o) ? o.join(" && ") : o;
|
|
552
552
|
if (c.userPermissionsComputedRefs.has(u))
|
|
553
553
|
return c.userPermissionsComputedRefs.get(u);
|
|
554
|
-
const p =
|
|
554
|
+
const p = A(() => {
|
|
555
555
|
const g = (a) => {
|
|
556
556
|
var le;
|
|
557
|
-
const P =
|
|
557
|
+
const P = Lt(a, ".");
|
|
558
558
|
if (P.length < 2)
|
|
559
559
|
return !1;
|
|
560
|
-
const [
|
|
561
|
-
return
|
|
560
|
+
const [be, Se] = P, ce = (le = pe().userPermissions) == null ? void 0 : le[be];
|
|
561
|
+
return W(ce) && ce.includes(Se);
|
|
562
562
|
};
|
|
563
|
-
return
|
|
563
|
+
return W(o) ? Ot(o, (a) => g(a)) : g(o);
|
|
564
564
|
});
|
|
565
565
|
return c.userPermissionsComputedRefs.set(u, p), p;
|
|
566
566
|
}
|
|
@@ -568,7 +568,7 @@ const pe = ne("common.auth_state_private", () => {
|
|
|
568
568
|
/**
|
|
569
569
|
* {@link Promise<string>} для получения jwt-ключа доступа к системам.
|
|
570
570
|
*/
|
|
571
|
-
jwtToken:
|
|
571
|
+
jwtToken: n,
|
|
572
572
|
/**
|
|
573
573
|
* Устанавливает механизм для обновления jwt-ключа доступа к системам.
|
|
574
574
|
*
|
|
@@ -590,10 +590,10 @@ const pe = ne("common.auth_state_private", () => {
|
|
|
590
590
|
*
|
|
591
591
|
* @param name Проверяемое право доступа или их список. Должны быть представлены в виде значения: <РЕСУРС>.<РОЛЬ>.
|
|
592
592
|
*/
|
|
593
|
-
hasUserPermission:
|
|
593
|
+
hasUserPermission: i
|
|
594
594
|
};
|
|
595
595
|
});
|
|
596
|
-
var
|
|
596
|
+
var Ye = /* @__PURE__ */ ((n) => (n.Image = "image", n.Video = "video", n))(Ye || {});
|
|
597
597
|
class G {
|
|
598
598
|
/**
|
|
599
599
|
* Инициализирует экземпляр класса {@link Identity}.
|
|
@@ -647,22 +647,22 @@ class wr extends G {
|
|
|
647
647
|
* @inheritDoc
|
|
648
648
|
*/
|
|
649
649
|
s(this, "urlWebp");
|
|
650
|
-
this.mediaType = (e == null ? void 0 : e.mediaType) ??
|
|
650
|
+
this.mediaType = (e == null ? void 0 : e.mediaType) ?? Ye.Image, this.isCover = (e == null ? void 0 : e.isCover) ?? !1, this.isUnused = (e == null ? void 0 : e.isUnused) ?? !1, this.url = (e == null ? void 0 : e.url) ?? "", this.urlWebp = e == null ? void 0 : e.urlWebp;
|
|
651
651
|
}
|
|
652
652
|
/**
|
|
653
653
|
* Возвращает признак того, что медиафайл является изображением.
|
|
654
654
|
*/
|
|
655
655
|
isImage() {
|
|
656
|
-
return this.mediaType ===
|
|
656
|
+
return this.mediaType === Ye.Image;
|
|
657
657
|
}
|
|
658
658
|
/**
|
|
659
659
|
* Возвращает признак того, что медиафайл является видео.
|
|
660
660
|
*/
|
|
661
661
|
isVideo() {
|
|
662
|
-
return this.mediaType ===
|
|
662
|
+
return this.mediaType === Ye.Video;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
var
|
|
665
|
+
var Qe = /* @__PURE__ */ ((n) => (n.Draft = "draft", n.Published = "published", n.Scheduled = "scheduled", n))(Qe || {});
|
|
666
666
|
class ae extends G {
|
|
667
667
|
/**
|
|
668
668
|
* Инициализирует экземпляр класса {@link BlogPostShortInfo}.
|
|
@@ -695,7 +695,7 @@ class ae extends G {
|
|
|
695
695
|
* @param publishedAt Дата и время публикации статьи.
|
|
696
696
|
*/
|
|
697
697
|
static resolvePublicationStatus(e) {
|
|
698
|
-
return m(e) ?
|
|
698
|
+
return m(e) ? Qe.Draft : e.getTime() > Date.now() ? Qe.Scheduled : Qe.Published;
|
|
699
699
|
}
|
|
700
700
|
/**
|
|
701
701
|
* Возвращает описание ошибки символьного обозначения статьи либо пустую строку,
|
|
@@ -707,7 +707,7 @@ class ae extends G {
|
|
|
707
707
|
* @param slug Символьное обозначение статьи.
|
|
708
708
|
*/
|
|
709
709
|
static getSlugError(e) {
|
|
710
|
-
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." :
|
|
710
|
+
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." : Zr(e, "-") || It(e, "-") ? "Обозначение не может начинаться или заканчиваться дефисом." : xt(e, "--") ? "Дефисы не могут идти подряд: разделяйте слова одним дефисом." : "" : "";
|
|
711
711
|
}
|
|
712
712
|
/**
|
|
713
713
|
* Преобразует значение даты, полученное из API, в объект {@link Date}.
|
|
@@ -715,7 +715,7 @@ class ae extends G {
|
|
|
715
715
|
* @param value Значение даты.
|
|
716
716
|
*/
|
|
717
717
|
static parseDate(e) {
|
|
718
|
-
return m(e) ? null :
|
|
718
|
+
return m(e) ? null : R(e) ? C(e) : e;
|
|
719
719
|
}
|
|
720
720
|
/**
|
|
721
721
|
* Возвращает состояние публикации статьи.
|
|
@@ -781,11 +781,11 @@ class Fe {
|
|
|
781
781
|
return Object.keys(this).forEach((e) => {
|
|
782
782
|
const t = this[e];
|
|
783
783
|
m(t) || // eslint-disable-next-line prettier/prettier,lodash/prefer-lodash-method
|
|
784
|
-
|
|
784
|
+
R(t) && t.trim().length === 0 || br(t.isNewRec) && t.isNewRec() || (r[e] = t);
|
|
785
785
|
}), r;
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
|
-
class
|
|
788
|
+
class b {
|
|
789
789
|
/**
|
|
790
790
|
* Инициализирует экземпляр класса {@link DatePeriod}.
|
|
791
791
|
*
|
|
@@ -800,7 +800,7 @@ class A {
|
|
|
800
800
|
* Окончание периода.
|
|
801
801
|
*/
|
|
802
802
|
s(this, "to");
|
|
803
|
-
this.from =
|
|
803
|
+
this.from = R(r == null ? void 0 : r.from) ? C(r.from) : (r == null ? void 0 : r.from) ?? null, this.to = R(r == null ? void 0 : r.to) ? C(r.to) : (r == null ? void 0 : r.to) ?? null;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
806
|
class Ks extends Fe {
|
|
@@ -839,7 +839,7 @@ class Ks extends Fe {
|
|
|
839
839
|
* @inheritDoc
|
|
840
840
|
*/
|
|
841
841
|
s(this, "createdAt");
|
|
842
|
-
this.id = e == null ? void 0 : e.id, this.title = e == null ? void 0 : e.title, this.slug = e == null ? void 0 : e.slug, this.content = e == null ? void 0 : e.content, this.publicationStatus = e == null ? void 0 : e.publicationStatus, this.publishedAt = new
|
|
842
|
+
this.id = e == null ? void 0 : e.id, this.title = e == null ? void 0 : e.title, this.slug = e == null ? void 0 : e.slug, this.content = e == null ? void 0 : e.content, this.publicationStatus = e == null ? void 0 : e.publicationStatus, this.publishedAt = new b(e == null ? void 0 : e.publishedAt), this.createdAt = new b(e == null ? void 0 : e.createdAt);
|
|
843
843
|
}
|
|
844
844
|
/**
|
|
845
845
|
* Выполняет сброс указанного фильтра в значение по умолчанию.
|
|
@@ -873,12 +873,12 @@ class Ks extends Fe {
|
|
|
873
873
|
* задачей по унификации.
|
|
874
874
|
*/
|
|
875
875
|
asClearRaw() {
|
|
876
|
-
var t,
|
|
876
|
+
var t, i, o, c;
|
|
877
877
|
const e = super.asClearRaw();
|
|
878
|
-
return !((t = e == null ? void 0 : e.publishedAt) != null && t.from) && !((
|
|
878
|
+
return !((t = e == null ? void 0 : e.publishedAt) != null && t.from) && !((i = e == null ? void 0 : e.publishedAt) != null && i.to) && delete e.publishedAt, !((o = e == null ? void 0 : e.createdAt) != null && o.from) && !((c = e == null ? void 0 : e.createdAt) != null && c.to) && delete e.createdAt, e;
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
var M = /* @__PURE__ */ ((
|
|
881
|
+
var M = /* @__PURE__ */ ((n) => (n.BASE_URL_REQUEST_INTERCEPTOR = "baseUrlRequestInterceptor", n.DEFAULT_REQUEST_INTERCEPTOR = "defaultRequestInterceptor", n.AUTH_REQUEST_INTERCEPTOR = "authRequestInterceptor", n.DATA_CONVERTER_REQUEST_INTERCEPTOR = "dataConverterRequestInterceptor", n.CONVERT_HTTP_ERROR_RESPONSE_INTERCEPTOR = "convertHttpErrorResponseInterceptor", n.CANCELED_RESPONSE_INTERCEPTOR = "canceledResponseInterceptor", n.AUTH_ERRORS_RESPONSE_INTERCEPTOR = "authErrorsResponseInterceptor", n.DATA_CONVERTER_RESPONSE_INTERCEPTOR = "dataConverterResponseInterceptor", n))(M || {});
|
|
882
882
|
class _ {
|
|
883
883
|
/**
|
|
884
884
|
* Инициализирует экземпляр указанного класса.
|
|
@@ -906,7 +906,7 @@ class _ {
|
|
|
906
906
|
* @throws TypeError Если вместо списка данных получены данные другого типа.
|
|
907
907
|
*/
|
|
908
908
|
static instanceListInitializer(r, e) {
|
|
909
|
-
if (!
|
|
909
|
+
if (!W(e))
|
|
910
910
|
throw new TypeError(`Ожидался список данных для инициализации "${r.name}", получены данные типа "${typeof e}".`);
|
|
911
911
|
return De(e, (t) => _.instanceInitializer(r, t));
|
|
912
912
|
}
|
|
@@ -941,7 +941,7 @@ const w = class w {
|
|
|
941
941
|
*/
|
|
942
942
|
// eslint-disable-next-line class-methods-use-this
|
|
943
943
|
s(this, "authRequestInterceptor", async (r) => {
|
|
944
|
-
const e =
|
|
944
|
+
const e = ze().jwtToken, t = m(e) ? void 0 : await e;
|
|
945
945
|
return t && r.headers.set("Authorization", `Bearer ${t}`), r;
|
|
946
946
|
});
|
|
947
947
|
/**
|
|
@@ -964,7 +964,7 @@ const w = class w {
|
|
|
964
964
|
return Promise.reject(r);
|
|
965
965
|
e.__isRetryRequest = !0;
|
|
966
966
|
try {
|
|
967
|
-
await w.refreshAccessToken();
|
|
967
|
+
await w.isStaleUnauthorizedRequest(e) || await w.refreshAccessToken();
|
|
968
968
|
} catch {
|
|
969
969
|
return Promise.reject(r);
|
|
970
970
|
}
|
|
@@ -1046,7 +1046,7 @@ const w = class w {
|
|
|
1046
1046
|
* @param value Проверяемое значение.
|
|
1047
1047
|
*/
|
|
1048
1048
|
static canConvertCaseKeys(r) {
|
|
1049
|
-
return
|
|
1049
|
+
return Ve(r) ? !(r instanceof Blob || r instanceof FormData || r instanceof ArrayBuffer || Je(r) || ArrayBuffer.isView(r)) : !1;
|
|
1050
1050
|
}
|
|
1051
1051
|
/**
|
|
1052
1052
|
* Приводит ключи данных к camelCase, если значение является обычным объектом или массивом.
|
|
@@ -1064,14 +1064,46 @@ const w = class w {
|
|
|
1064
1064
|
static toSnakeCaseData(r) {
|
|
1065
1065
|
return w.canConvertCaseKeys(r) ? Ht(r) : r;
|
|
1066
1066
|
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Возвращает токен доступа из заголовка Authorization исходного запроса.
|
|
1069
|
+
*
|
|
1070
|
+
* @param request Данные запроса.
|
|
1071
|
+
*/
|
|
1072
|
+
static getRequestAccessToken(r) {
|
|
1073
|
+
const e = r.headers.get("Authorization"), t = R(e) ? e : void 0, i = "Bearer ";
|
|
1074
|
+
if (m(t) || !Zr(t, i))
|
|
1075
|
+
return;
|
|
1076
|
+
const o = t.slice(i.length);
|
|
1077
|
+
return o === "" ? void 0 : o;
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* Проверяет, что 401 пришёл на токен, который уже заменён.
|
|
1081
|
+
*
|
|
1082
|
+
* Такой ответ нельзя считать поводом сбрасывать текущий токен: запрос ушёл со старым ключом, а в сторе уже лежит новый.
|
|
1083
|
+
*
|
|
1084
|
+
* @param request Данные запроса.
|
|
1085
|
+
*/
|
|
1086
|
+
static async isStaleUnauthorizedRequest(r) {
|
|
1087
|
+
const e = w.getRequestAccessToken(r);
|
|
1088
|
+
if (m(e))
|
|
1089
|
+
return !1;
|
|
1090
|
+
const t = ze().jwtToken;
|
|
1091
|
+
if (m(t))
|
|
1092
|
+
return !1;
|
|
1093
|
+
try {
|
|
1094
|
+
return await t !== e;
|
|
1095
|
+
} catch {
|
|
1096
|
+
return !1;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1067
1099
|
/**
|
|
1068
1100
|
* Сбрасывает токен и запускает одно обновление на все параллельные ответы 401.
|
|
1069
1101
|
*/
|
|
1070
1102
|
static refreshAccessToken() {
|
|
1071
1103
|
if (!m(w.tokenRefreshPromise))
|
|
1072
1104
|
return w.tokenRefreshPromise;
|
|
1073
|
-
|
|
1074
|
-
const e =
|
|
1105
|
+
ze().invalidateJwtToken();
|
|
1106
|
+
const e = ze().jwtToken ?? Promise.resolve();
|
|
1075
1107
|
return w.tokenRefreshPromise = e.finally(() => {
|
|
1076
1108
|
w.tokenRefreshPromise = void 0;
|
|
1077
1109
|
}), w.tokenRefreshPromise;
|
|
@@ -1103,7 +1135,7 @@ const w = class w {
|
|
|
1103
1135
|
* @param error Данные об ошибке.
|
|
1104
1136
|
*/
|
|
1105
1137
|
static toHttpResponseError(r) {
|
|
1106
|
-
return
|
|
1138
|
+
return Ve(r) && "status" in r ? r : {
|
|
1107
1139
|
status: 0,
|
|
1108
1140
|
statusText: "Invalid response data",
|
|
1109
1141
|
message: _r(r) ? r.message : "Не удалось обработать данные ответа сервера.",
|
|
@@ -1117,15 +1149,16 @@ const w = class w {
|
|
|
1117
1149
|
* @param error Данные об ошибке.
|
|
1118
1150
|
*/
|
|
1119
1151
|
static convertHttpErrorResponse(r) {
|
|
1152
|
+
var e, t;
|
|
1120
1153
|
if (m(r) || !m(r.request) || !m(r.response)) {
|
|
1121
|
-
const
|
|
1154
|
+
const i = m(r) ? {} : r == null ? void 0 : r.response;
|
|
1122
1155
|
return Promise.reject({
|
|
1123
|
-
status: (
|
|
1124
|
-
statusText: (
|
|
1125
|
-
message: (
|
|
1126
|
-
errors: t == null ? void 0 : t.errors,
|
|
1127
|
-
headers: (
|
|
1128
|
-
data:
|
|
1156
|
+
status: (i == null ? void 0 : i.status) ?? 0,
|
|
1157
|
+
statusText: (i == null ? void 0 : i.statusText) ?? "Unknown",
|
|
1158
|
+
message: ((e = i == null ? void 0 : i.data) == null ? void 0 : e.message) ?? "Unknown Error. Probably network error.",
|
|
1159
|
+
errors: (t = i == null ? void 0 : i.data) == null ? void 0 : t.errors,
|
|
1160
|
+
headers: (i == null ? void 0 : i.headers) ?? {},
|
|
1161
|
+
data: i == null ? void 0 : i.data,
|
|
1129
1162
|
rawError: r
|
|
1130
1163
|
});
|
|
1131
1164
|
}
|
|
@@ -1139,10 +1172,10 @@ const w = class w {
|
|
|
1139
1172
|
* @param validationFieldResultData Список полей, для которых необходимо установить данные об ошибках валидации в случае ошибок в запросах.
|
|
1140
1173
|
* @param disableNotifications Признак необходимости отключить уведомления об ошибках.
|
|
1141
1174
|
*/
|
|
1142
|
-
request(r, e = void 0, t = {},
|
|
1175
|
+
request(r, e = void 0, t = {}, i = !1) {
|
|
1143
1176
|
const o = this.httpClient.request(r).then((c) => e ? e(c) : c.data);
|
|
1144
1177
|
return o.catch((c) => {
|
|
1145
|
-
(c == null ? void 0 : c.name) !== "CanceledError" && w.defaultErrorsResponseHandler(w.toHttpResponseError(c), t,
|
|
1178
|
+
(c == null ? void 0 : c.name) !== "CanceledError" && w.defaultErrorsResponseHandler(w.toHttpResponseError(c), t, i);
|
|
1146
1179
|
}), o;
|
|
1147
1180
|
}
|
|
1148
1181
|
/**
|
|
@@ -1154,8 +1187,8 @@ const w = class w {
|
|
|
1154
1187
|
* @param disableNotifications Признак необходимости отключить уведомления об ошибках.
|
|
1155
1188
|
* @param signal Сигнал отмены запроса.
|
|
1156
1189
|
*/
|
|
1157
|
-
get(r, e = {}, t = void 0,
|
|
1158
|
-
return this.request({ method: "GET", url: r, params: e, signal: o }, t, {},
|
|
1190
|
+
get(r, e = {}, t = void 0, i = !1, o = void 0) {
|
|
1191
|
+
return this.request({ method: "GET", url: r, params: e, signal: o }, t, {}, i);
|
|
1159
1192
|
}
|
|
1160
1193
|
/**
|
|
1161
1194
|
* Выполняет get-запрос и возвращает список экземпляров указанного класса.
|
|
@@ -1167,12 +1200,12 @@ const w = class w {
|
|
|
1167
1200
|
* @param signal Сигнал отмены запроса.
|
|
1168
1201
|
*/
|
|
1169
1202
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
1170
|
-
getTypedList(r, e, t = {},
|
|
1203
|
+
getTypedList(r, e, t = {}, i = !1, o = void 0) {
|
|
1171
1204
|
return this.get(
|
|
1172
1205
|
e,
|
|
1173
1206
|
t,
|
|
1174
1207
|
(c) => _.instanceListInitializer(r, c.data),
|
|
1175
|
-
|
|
1208
|
+
i,
|
|
1176
1209
|
o
|
|
1177
1210
|
);
|
|
1178
1211
|
}
|
|
@@ -1185,8 +1218,8 @@ const w = class w {
|
|
|
1185
1218
|
* @param disableNotifications Признак необходимости отключить уведомления об ошибках.
|
|
1186
1219
|
* @param signal Сигнал отмены запроса.
|
|
1187
1220
|
*/
|
|
1188
|
-
getBlob(r, e = {}, t = void 0,
|
|
1189
|
-
return this.request({ method: "GET", url: r, params: e, responseType: "blob", signal: o }, t, {},
|
|
1221
|
+
getBlob(r, e = {}, t = void 0, i = !1, o = void 0) {
|
|
1222
|
+
return this.request({ method: "GET", url: r, params: e, responseType: "blob", signal: o }, t, {}, i);
|
|
1190
1223
|
}
|
|
1191
1224
|
/**
|
|
1192
1225
|
* Выполняет patch-запрос с параметрами по умолчанию.
|
|
@@ -1198,8 +1231,8 @@ const w = class w {
|
|
|
1198
1231
|
* @param disableNotifications Признак необходимости отключить уведомления об ошибках.
|
|
1199
1232
|
* @param signal Сигнал отмены запроса.
|
|
1200
1233
|
*/
|
|
1201
|
-
patch(r, e = {}, t = void 0,
|
|
1202
|
-
return this.request({ method: "PATCH", url: r, data: e, signal: c }, t,
|
|
1234
|
+
patch(r, e = {}, t = void 0, i = {}, o = !1, c = void 0) {
|
|
1235
|
+
return this.request({ method: "PATCH", url: r, data: e, signal: c }, t, i, o);
|
|
1203
1236
|
}
|
|
1204
1237
|
/**
|
|
1205
1238
|
* Выполняет post-запрос с параметрами по умолчанию.
|
|
@@ -1211,8 +1244,8 @@ const w = class w {
|
|
|
1211
1244
|
* @param disableNotifications Признак необходимости отключить уведомления об ошибках.
|
|
1212
1245
|
* @param signal Сигнал отмены запроса.
|
|
1213
1246
|
*/
|
|
1214
|
-
post(r, e = {}, t = void 0,
|
|
1215
|
-
return this.request({ method: "POST", url: r, data: e, signal: c }, t,
|
|
1247
|
+
post(r, e = {}, t = void 0, i = {}, o = !1, c = void 0) {
|
|
1248
|
+
return this.request({ method: "POST", url: r, data: e, signal: c }, t, i, o);
|
|
1216
1249
|
}
|
|
1217
1250
|
/**
|
|
1218
1251
|
* Выполняет delete-запрос с параметрами по умолчанию.
|
|
@@ -1222,8 +1255,8 @@ const w = class w {
|
|
|
1222
1255
|
* @param disableNotifications Признак необходимости отключить уведомления об ошибках.
|
|
1223
1256
|
* @param signal Сигнал отмены запроса.
|
|
1224
1257
|
*/
|
|
1225
|
-
delete(r, e = void 0, t = !1,
|
|
1226
|
-
return this.request({ method: "DELETE", url: r, signal:
|
|
1258
|
+
delete(r, e = void 0, t = !1, i = void 0) {
|
|
1259
|
+
return this.request({ method: "DELETE", url: r, signal: i }, e, {}, t);
|
|
1227
1260
|
}
|
|
1228
1261
|
};
|
|
1229
1262
|
/**
|
|
@@ -1245,7 +1278,7 @@ s(w, "defaultRequestHook"), /**
|
|
|
1245
1278
|
*/
|
|
1246
1279
|
s(w, "tokenRefreshPromise");
|
|
1247
1280
|
let h = w;
|
|
1248
|
-
var dr = /* @__PURE__ */ ((
|
|
1281
|
+
var dr = /* @__PURE__ */ ((n) => (n.BeginWith = "bw", n.Contains = "cn", n.Custom = "custom", n.EndsWith = "ew", n.Equals = "eq", n.GreaterOrEqual = "ge", n.GreaterThan = "gt", n.InList = "in", n.LessOrEqual = "le", n.LessThan = "lt", n.NotBeginWith = "bn", n.NotContains = "nc", n.NotEndsWith = "en", n.NotEqual = "ne", n.NotInList = "ni", n.NotNull = "nn", n.Null = "nu", n))(dr || {});
|
|
1249
1282
|
class Fr {
|
|
1250
1283
|
/**
|
|
1251
1284
|
* Инициализирует экземпляр класса {@link FilterItem}.
|
|
@@ -1277,7 +1310,7 @@ class Fr {
|
|
|
1277
1310
|
field: this.field,
|
|
1278
1311
|
op: this.op
|
|
1279
1312
|
};
|
|
1280
|
-
if (
|
|
1313
|
+
if (Je(this.value))
|
|
1281
1314
|
e.value = k(this.value, r);
|
|
1282
1315
|
else if (Nt(this.value)) {
|
|
1283
1316
|
const t = this.value;
|
|
@@ -1310,7 +1343,7 @@ class te {
|
|
|
1310
1343
|
*/
|
|
1311
1344
|
s(this, "groups");
|
|
1312
1345
|
var e, t;
|
|
1313
|
-
this.groupOp = (r == null ? void 0 : r.groupOp) ?? "and", this.filters = ((e = r == null ? void 0 : r.filters) == null ? void 0 : e.map((
|
|
1346
|
+
this.groupOp = (r == null ? void 0 : r.groupOp) ?? "and", this.filters = ((e = r == null ? void 0 : r.filters) == null ? void 0 : e.map((i) => new Fr(i))) ?? [], this.groups = ((t = r == null ? void 0 : r.groups) == null ? void 0 : t.map((i) => new te(i))) ?? [];
|
|
1314
1347
|
}
|
|
1315
1348
|
/**
|
|
1316
1349
|
* Преобразует группу фильтров в примитивное представление для API.
|
|
@@ -1320,7 +1353,7 @@ class te {
|
|
|
1320
1353
|
toPrimitive() {
|
|
1321
1354
|
return {
|
|
1322
1355
|
groupOp: this.groupOp,
|
|
1323
|
-
filters: this.filters.map((r) => r instanceof Fr &&
|
|
1356
|
+
filters: this.filters.map((r) => r instanceof Fr && br(r.toPrimitive) ? r.toPrimitive() : r),
|
|
1324
1357
|
groups: this.groups.map((r) => r instanceof te ? r.toPrimitive() : r)
|
|
1325
1358
|
};
|
|
1326
1359
|
}
|
|
@@ -1338,12 +1371,12 @@ class Y extends h {
|
|
|
1338
1371
|
* @param disableDefaultNotificationErrorResponseHandler Признак отключения стандартного обработчика ошибок.
|
|
1339
1372
|
* @param signal Сигнал отмены запроса.
|
|
1340
1373
|
*/
|
|
1341
|
-
getPaginated(r, e, t,
|
|
1374
|
+
getPaginated(r, e, t, i, o, c, u, p = void 0) {
|
|
1342
1375
|
let g = {
|
|
1343
|
-
page: (
|
|
1344
|
-
perPage: (
|
|
1376
|
+
page: (i == null ? void 0 : i.page) ?? 1,
|
|
1377
|
+
perPage: (i == null ? void 0 : i.pageSize) ?? 10
|
|
1345
1378
|
};
|
|
1346
|
-
return e && (g.filters = JSON.stringify((e instanceof te ? e : new te(e)).toPrimitive())), J(t) || (g.sort =
|
|
1379
|
+
return e && (g.filters = JSON.stringify((e instanceof te ? e : new te(e)).toPrimitive())), J(t) || (g.sort = W(t) ? t : [t]), o && (g = { ...g, ...o }), this.get(r, g, c, u, p);
|
|
1347
1380
|
}
|
|
1348
1381
|
/**
|
|
1349
1382
|
* Получает пагинированный список экземпляров указанного класса.
|
|
@@ -1357,11 +1390,11 @@ class Y extends h {
|
|
|
1357
1390
|
* @param disableDefaultNotificationErrorResponseHandler Признак отключения стандартного обработчика ошибок.
|
|
1358
1391
|
* @param signal Сигнал отмены запроса.
|
|
1359
1392
|
*/
|
|
1360
|
-
getTypedPaginated(r, e, t,
|
|
1393
|
+
getTypedPaginated(r, e, t, i, o, c, u, p = void 0) {
|
|
1361
1394
|
return this.getPaginated(
|
|
1362
1395
|
e,
|
|
1363
1396
|
t,
|
|
1364
|
-
|
|
1397
|
+
i,
|
|
1365
1398
|
o,
|
|
1366
1399
|
c,
|
|
1367
1400
|
(g) => ({
|
|
@@ -1403,10 +1436,10 @@ class vr extends Y {
|
|
|
1403
1436
|
* @see /doc/api/internal#/operations/api_internal_blog_get_list
|
|
1404
1437
|
*/
|
|
1405
1438
|
getPostList(r, e, t) {
|
|
1406
|
-
return this.getPaginated("/internal/blog", r, e, t, {}, (
|
|
1407
|
-
...
|
|
1439
|
+
return this.getPaginated("/internal/blog", r, e, t, {}, (i) => ({
|
|
1440
|
+
...i.data,
|
|
1408
1441
|
// eslint-disable-next-line lodash/prefer-lodash-method
|
|
1409
|
-
data:
|
|
1442
|
+
data: i.data.data.map((o) => new ae(o))
|
|
1410
1443
|
}));
|
|
1411
1444
|
}
|
|
1412
1445
|
/**
|
|
@@ -1444,7 +1477,7 @@ class vr extends Y {
|
|
|
1444
1477
|
* @see /doc/api/internal#/operations/api_internal_blog_update
|
|
1445
1478
|
*/
|
|
1446
1479
|
updatePost(r, e, t = {}) {
|
|
1447
|
-
return this.patch(`/internal/blog/${r}`, vr.preparePostSaveData(e), (
|
|
1480
|
+
return this.patch(`/internal/blog/${r}`, vr.preparePostSaveData(e), (i) => new ur(i.data), t);
|
|
1448
1481
|
}
|
|
1449
1482
|
/**
|
|
1450
1483
|
* Удаляет статью блога.
|
|
@@ -1469,14 +1502,14 @@ class vr extends Y {
|
|
|
1469
1502
|
*
|
|
1470
1503
|
* @see /doc/api/internal#/operations/api_internal_blog_upload_media
|
|
1471
1504
|
*/
|
|
1472
|
-
uploadMedia(r, e, t,
|
|
1505
|
+
uploadMedia(r, e, t, i, o = {}) {
|
|
1473
1506
|
return this.request(
|
|
1474
1507
|
{
|
|
1475
1508
|
method: "POST",
|
|
1476
1509
|
url: `/internal/blog/${r}/media`,
|
|
1477
1510
|
data: { file: e, isCover: t ?? !1 },
|
|
1478
1511
|
onUploadProgress: (c) => {
|
|
1479
|
-
|
|
1512
|
+
i && i(c.total ? Math.round(c.loaded / c.total * 100) : 0);
|
|
1480
1513
|
}
|
|
1481
1514
|
},
|
|
1482
1515
|
(c) => new wr(c.data),
|
|
@@ -1495,12 +1528,12 @@ class vr extends Y {
|
|
|
1495
1528
|
*
|
|
1496
1529
|
* @see /doc/api/internal#/operations/api_internal_blog_update_media
|
|
1497
1530
|
*/
|
|
1498
|
-
updateMedia(r, e, t,
|
|
1531
|
+
updateMedia(r, e, t, i = {}) {
|
|
1499
1532
|
return this.patch(
|
|
1500
1533
|
`/internal/blog/${r}/media/${e}`,
|
|
1501
1534
|
{ isCover: t },
|
|
1502
1535
|
(o) => new wr(o.data),
|
|
1503
|
-
|
|
1536
|
+
i
|
|
1504
1537
|
);
|
|
1505
1538
|
}
|
|
1506
1539
|
/**
|
|
@@ -1593,10 +1626,10 @@ class cs extends L {
|
|
|
1593
1626
|
* Дата и время удаления.
|
|
1594
1627
|
*/
|
|
1595
1628
|
s(this, "deletedAt");
|
|
1596
|
-
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt =
|
|
1629
|
+
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = R(e == null ? void 0 : e.publishedAt) ? C(e.publishedAt) : e == null ? void 0 : e.publishedAt, this.description = (e == null ? void 0 : e.description) ?? void 0, this.percent = (e == null ? void 0 : e.percent) ?? 0, this.owner = new N(e == null ? void 0 : e.owner), this.deletedAt = R(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
1597
1630
|
}
|
|
1598
1631
|
}
|
|
1599
|
-
class
|
|
1632
|
+
class tt extends L {
|
|
1600
1633
|
/**
|
|
1601
1634
|
* Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
|
|
1602
1635
|
*
|
|
@@ -1608,10 +1641,10 @@ class rt extends L {
|
|
|
1608
1641
|
* Дата и время последнего изменения.
|
|
1609
1642
|
*/
|
|
1610
1643
|
s(this, "updatedAt");
|
|
1611
|
-
this.updatedAt =
|
|
1644
|
+
this.updatedAt = R(e == null ? void 0 : e.updatedAt) ? C(e.updatedAt) : e == null ? void 0 : e.updatedAt;
|
|
1612
1645
|
}
|
|
1613
1646
|
}
|
|
1614
|
-
class fe extends
|
|
1647
|
+
class fe extends tt {
|
|
1615
1648
|
/**
|
|
1616
1649
|
* Инициализирует экземпляр класса {@link PriceTemplate}.
|
|
1617
1650
|
*
|
|
@@ -1631,11 +1664,11 @@ class fe extends rt {
|
|
|
1631
1664
|
* Данные о пользователе, создавшем шаблон прайс-листа.
|
|
1632
1665
|
*/
|
|
1633
1666
|
s(this, "owner");
|
|
1634
|
-
this.description = (e == null ? void 0 : e.description) ?? "", this.createdAt =
|
|
1667
|
+
this.description = (e == null ? void 0 : e.description) ?? "", this.createdAt = R(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.owner = e != null && e.owner ? new N(e.owner) : void 0;
|
|
1635
1668
|
}
|
|
1636
1669
|
}
|
|
1637
|
-
var
|
|
1638
|
-
class
|
|
1670
|
+
var st = /* @__PURE__ */ ((n) => (n.K0 = "k0", n.K1 = "k1", n.K2 = "k2", n.K3 = "k3", n.K4 = "k4", n.Retail = "retail", n))(st || {});
|
|
1671
|
+
class D extends L {
|
|
1639
1672
|
/**
|
|
1640
1673
|
* Инициализирует экземпляр класса {@link Reference}.
|
|
1641
1674
|
*
|
|
@@ -1654,14 +1687,14 @@ class R extends L {
|
|
|
1654
1687
|
this.description = e == null ? void 0 : e.description, this.slug = e == null ? void 0 : e.slug;
|
|
1655
1688
|
}
|
|
1656
1689
|
}
|
|
1657
|
-
class Pe extends
|
|
1690
|
+
class Pe extends D {
|
|
1658
1691
|
/**
|
|
1659
1692
|
* Возвращает значение справочника коэффициента розничной цены.
|
|
1660
1693
|
*/
|
|
1661
1694
|
static getRetailPriceCoefficient() {
|
|
1662
1695
|
const r = new Pe({
|
|
1663
1696
|
id: -2,
|
|
1664
|
-
slug:
|
|
1697
|
+
slug: st.Retail,
|
|
1665
1698
|
name: "Розн. цена",
|
|
1666
1699
|
guid: ""
|
|
1667
1700
|
});
|
|
@@ -1698,7 +1731,7 @@ class $r {
|
|
|
1698
1731
|
this.coefficient = new Pe(r == null ? void 0 : r.coefficient), this.value = (r == null ? void 0 : r.value) ?? 0, this.cost = (r == null ? void 0 : r.cost) ?? 0, this.percent = (r == null ? void 0 : r.percent) ?? 0, this.readOnly = (r == null ? void 0 : r.readOnly) ?? !0;
|
|
1699
1732
|
}
|
|
1700
1733
|
}
|
|
1701
|
-
class
|
|
1734
|
+
class it {
|
|
1702
1735
|
/**
|
|
1703
1736
|
* Инициализирует экземпляр класса {@link GeoCoordinates}.
|
|
1704
1737
|
*
|
|
@@ -1716,9 +1749,9 @@ class st {
|
|
|
1716
1749
|
this.lat = (r == null ? void 0 : r.lat) ?? 0, this.long = (r == null ? void 0 : r.long) ?? 0;
|
|
1717
1750
|
}
|
|
1718
1751
|
}
|
|
1719
|
-
class K extends
|
|
1752
|
+
class K extends D {
|
|
1720
1753
|
}
|
|
1721
|
-
class Me extends
|
|
1754
|
+
class Me extends D {
|
|
1722
1755
|
/**
|
|
1723
1756
|
* Инициализирует экземпляр класса {@link Warehouse}.
|
|
1724
1757
|
*
|
|
@@ -1747,7 +1780,7 @@ class Me extends R {
|
|
|
1747
1780
|
* Координаты склада.
|
|
1748
1781
|
*/
|
|
1749
1782
|
s(this, "coordinates");
|
|
1750
|
-
this.address = (e == null ? void 0 : e.address) ?? "", this.isMain = (e == null ? void 0 : e.isMain) ?? !1, this.deliveryTypes = ((t = e == null ? void 0 : e.deliveryTypes) == null ? void 0 : t.map((
|
|
1783
|
+
this.address = (e == null ? void 0 : e.address) ?? "", this.isMain = (e == null ? void 0 : e.isMain) ?? !1, this.deliveryTypes = ((t = e == null ? void 0 : e.deliveryTypes) == null ? void 0 : t.map((i) => new K(i))) ?? [], this.regions = (e == null ? void 0 : e.regions) ?? [], this.coordinates = new it(e == null ? void 0 : e.coordinates);
|
|
1751
1784
|
}
|
|
1752
1785
|
}
|
|
1753
1786
|
class ls {
|
|
@@ -1837,7 +1870,7 @@ class Ee extends L {
|
|
|
1837
1870
|
this.code = (e == null ? void 0 : e.code) ?? "";
|
|
1838
1871
|
}
|
|
1839
1872
|
}
|
|
1840
|
-
class
|
|
1873
|
+
class nt extends Ee {
|
|
1841
1874
|
/**
|
|
1842
1875
|
* Инициализирует экземпляр класса {@link CatalogableItem}.
|
|
1843
1876
|
*
|
|
@@ -1856,7 +1889,7 @@ class it extends Ee {
|
|
|
1856
1889
|
this.slug = (e == null ? void 0 : e.slug) ?? "";
|
|
1857
1890
|
}
|
|
1858
1891
|
}
|
|
1859
|
-
class us extends
|
|
1892
|
+
class us extends nt {
|
|
1860
1893
|
/**
|
|
1861
1894
|
* Инициализирует экземпляр класса {@link HiddenCatalogableItem}.
|
|
1862
1895
|
*
|
|
@@ -1894,7 +1927,7 @@ class ps {
|
|
|
1894
1927
|
this.image = `${e ?? ""}${r.image}`, this.preview = `${e ?? ""}${r.preview}`, this.isDefault = r.isDefault;
|
|
1895
1928
|
}
|
|
1896
1929
|
}
|
|
1897
|
-
class
|
|
1930
|
+
class Rr extends nt {
|
|
1898
1931
|
/**
|
|
1899
1932
|
* Инициализирует экземпляр класса {@link PrimaryCatalogableItem}.
|
|
1900
1933
|
*
|
|
@@ -1916,7 +1949,7 @@ class q extends us {
|
|
|
1916
1949
|
* @param data Данные для первоначальной инициализации.
|
|
1917
1950
|
*/
|
|
1918
1951
|
constructor(e) {
|
|
1919
|
-
var
|
|
1952
|
+
var i, o, c, u;
|
|
1920
1953
|
super(e);
|
|
1921
1954
|
/**
|
|
1922
1955
|
* Артикул производителя/поставщика.
|
|
@@ -1986,9 +2019,9 @@ class q extends us {
|
|
|
1986
2019
|
* Список коэффициентов цен на продукт.
|
|
1987
2020
|
*/
|
|
1988
2021
|
s(this, "priceCoefficients");
|
|
1989
|
-
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = e != null && e.unit ? new Mr(e.unit) : new Mr(), this.pack = e == null ? void 0 : e.pack, this.minCount = e == null ? void 0 : e.minCount, this.currency = e != null && e.currency ? new j(e.currency) : new j(), this.cost = (e == null ? void 0 : e.cost) ?? 0, this.costRub = (e == null ? void 0 : e.costRub) ?? 0, this.costDate =
|
|
2022
|
+
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = e != null && e.unit ? new Mr(e.unit) : new Mr(), this.pack = e == null ? void 0 : e.pack, this.minCount = e == null ? void 0 : e.minCount, this.currency = e != null && e.currency ? new j(e.currency) : new j(), this.cost = (e == null ? void 0 : e.cost) ?? 0, this.costRub = (e == null ? void 0 : e.costRub) ?? 0, this.costDate = R(e == null ? void 0 : e.costDate) ? C(e.costDate) : e == null ? void 0 : e.costDate, this.onOrder = (e == null ? void 0 : e.onOrder) ?? !1, this.stockCount = ((i = e == null ? void 0 : e.stockCount) == null ? void 0 : i.map((p) => new ls(p))) ?? [], this.type = "product";
|
|
1990
2023
|
const t = (e == null ? void 0 : e.category) ?? ((o = e == null ? void 0 : e.categories) == null ? void 0 : o.find((p) => p.isPrimary));
|
|
1991
|
-
t && (this.category = new
|
|
2024
|
+
t && (this.category = new Rr({ ...t, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((p) => new Rr(p))), this.images = ((c = e == null ? void 0 : e.images) == null ? void 0 : c.map((p) => new ps(p, O().config.http.mediaUrl))) ?? [], this.properties = (e == null ? void 0 : e.properties) ?? {}, this.retailCost = e == null ? void 0 : e.retailCost, this.retailCostRub = e == null ? void 0 : e.retailCostRub, this.priceCoefficients = ((u = e == null ? void 0 : e.priceCoefficients) == null ? void 0 : u.map((p) => new $r(p))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
|
|
1992
2025
|
}
|
|
1993
2026
|
/**
|
|
1994
2027
|
* Возвращает признак, что это измеряемый товар.
|
|
@@ -2009,7 +2042,7 @@ class q extends us {
|
|
|
2009
2042
|
return this.retailCostRub ?? this.costRub;
|
|
2010
2043
|
}
|
|
2011
2044
|
}
|
|
2012
|
-
var kr = /* @__PURE__ */ ((
|
|
2045
|
+
var kr = /* @__PURE__ */ ((n) => (n.Discount = "discount", n.PriceTemplate = "price_template", n.ClientPrice = "client_price", n.Product = "product", n))(kr || {});
|
|
2013
2046
|
class X extends q {
|
|
2014
2047
|
/**
|
|
2015
2048
|
* Инициализирует экземпляр класса {@link ClientProduct}.
|
|
@@ -2049,7 +2082,7 @@ class X extends q {
|
|
|
2049
2082
|
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.costSource = (e == null ? void 0 : e.costSource) ?? kr.Product, this.discount = e != null && e.discount ? new cs(e.discount) : void 0, this.priceTemplate = e != null && e.priceTemplate ? new fe(e.priceTemplate) : void 0, this.isPreviouslyOrdered = e == null ? void 0 : e.isPreviouslyOrdered, this.isRequired = e == null ? void 0 : e.isRequired, this.isFavorite = e == null ? void 0 : e.isFavorite;
|
|
2050
2083
|
}
|
|
2051
2084
|
}
|
|
2052
|
-
class
|
|
2085
|
+
class Ae extends Rr {
|
|
2053
2086
|
/**
|
|
2054
2087
|
* Инициализирует экземпляр класса {@link BaseCategory}.
|
|
2055
2088
|
*
|
|
@@ -2073,10 +2106,10 @@ class be extends Cr {
|
|
|
2073
2106
|
* Список коэффициентов пересчёта из валют в рубли в формате ключ значение.
|
|
2074
2107
|
*/
|
|
2075
2108
|
s(this, "currencyRates");
|
|
2076
|
-
this.isHidden = (e == null ? void 0 : e.isHidden) ?? !1, this.parentCategoryId = e == null ? void 0 : e.parentCategoryId, this.properties = e == null ? void 0 : e.properties, this.type = "category", this.currencyRates = e != null && e.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([t,
|
|
2109
|
+
this.isHidden = (e == null ? void 0 : e.isHidden) ?? !1, this.parentCategoryId = e == null ? void 0 : e.parentCategoryId, this.properties = e == null ? void 0 : e.properties, this.type = "category", this.currencyRates = e != null && e.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([t, i]) => [Et(t), i])) : void 0;
|
|
2077
2110
|
}
|
|
2078
2111
|
}
|
|
2079
|
-
class
|
|
2112
|
+
class ot extends G {
|
|
2080
2113
|
/**
|
|
2081
2114
|
* Инициализирует экземпляр класса {@link OrderItemBase}.
|
|
2082
2115
|
*
|
|
@@ -2152,10 +2185,10 @@ class nt extends G {
|
|
|
2152
2185
|
* @inheritDoc
|
|
2153
2186
|
*/
|
|
2154
2187
|
s(this, "replacementId");
|
|
2155
|
-
this.product = new X(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new
|
|
2188
|
+
this.product = new X(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new Ae(), this.currency = e.currency ? new j(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && Ut(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new N(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
|
|
2156
2189
|
}
|
|
2157
2190
|
}
|
|
2158
|
-
let Or = class extends
|
|
2191
|
+
let Or = class extends ot {
|
|
2159
2192
|
/**
|
|
2160
2193
|
* Инициализирует экземпляр класса {@link OrderItem}.
|
|
2161
2194
|
*
|
|
@@ -2199,7 +2232,7 @@ let Or = class extends nt {
|
|
|
2199
2232
|
* @inheritDoc
|
|
2200
2233
|
*/
|
|
2201
2234
|
s(this, "currency");
|
|
2202
|
-
this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing =
|
|
2235
|
+
this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = W(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, this.currency = new j(e.currency);
|
|
2203
2236
|
}
|
|
2204
2237
|
};
|
|
2205
2238
|
class Oe {
|
|
@@ -2271,7 +2304,7 @@ class Zs extends h {
|
|
|
2271
2304
|
is_additional_sale: e.isAdditionalSale,
|
|
2272
2305
|
...e.configuratorParams
|
|
2273
2306
|
},
|
|
2274
|
-
(
|
|
2307
|
+
(i) => new Oe(i.data),
|
|
2275
2308
|
t
|
|
2276
2309
|
);
|
|
2277
2310
|
}
|
|
@@ -2301,7 +2334,7 @@ class Zs extends h {
|
|
|
2301
2334
|
is_additional_sale: e.isAdditionalSale,
|
|
2302
2335
|
...e.configuratorParams
|
|
2303
2336
|
},
|
|
2304
|
-
(
|
|
2337
|
+
(i) => new Oe(i.data),
|
|
2305
2338
|
t
|
|
2306
2339
|
);
|
|
2307
2340
|
}
|
|
@@ -2338,15 +2371,15 @@ class Zs extends h {
|
|
|
2338
2371
|
return this.get(`internal/clients/${r.id}/cart/add-products-from-csv/example`, {}, (e) => new Blob([e.data], { type: "text/csv" }));
|
|
2339
2372
|
}
|
|
2340
2373
|
}
|
|
2341
|
-
var hs = /* @__PURE__ */ ((
|
|
2342
|
-
class Q extends
|
|
2374
|
+
var hs = /* @__PURE__ */ ((n) => (n.m2Cost = "m2Cost", n.percent = "percent", n.value = "value", n))(hs || {}), gs = /* @__PURE__ */ ((n) => (n.Unknown = "unknown", n.Bool = "bool", n.Integer = "integer", n.Float = "float", n.String = "string", n.Range = "range", n.Json = "json", n.Object = "object", n))(gs || {}), ct = /* @__PURE__ */ ((n) => (n.Checkbox = "checkbox", n.Range = "range", n.Toggle = "toggle", n))(ct || {});
|
|
2375
|
+
class Q extends Ae {
|
|
2343
2376
|
/**
|
|
2344
2377
|
* Инициализирует экземпляр класса {@link Category}.
|
|
2345
2378
|
*
|
|
2346
2379
|
* @param data Данные для первоначальной инициализации.
|
|
2347
2380
|
*/
|
|
2348
2381
|
constructor(e) {
|
|
2349
|
-
var t,
|
|
2382
|
+
var t, i;
|
|
2350
2383
|
super(e);
|
|
2351
2384
|
/**
|
|
2352
2385
|
* Данные о вложенных категориях.
|
|
@@ -2356,10 +2389,10 @@ class Q extends be {
|
|
|
2356
2389
|
* Список продуктов категории.
|
|
2357
2390
|
*/
|
|
2358
2391
|
s(this, "products");
|
|
2359
|
-
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new Q(o)), this.products = (
|
|
2392
|
+
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new Q(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new q(o));
|
|
2360
2393
|
}
|
|
2361
2394
|
}
|
|
2362
|
-
class
|
|
2395
|
+
class lt {
|
|
2363
2396
|
/**
|
|
2364
2397
|
* Инициализирует экземпляр класса {@link ContactLinks}.
|
|
2365
2398
|
*
|
|
@@ -2377,7 +2410,7 @@ class ct {
|
|
|
2377
2410
|
this.phone = /^\d+$/.test(r.phone ?? "") ? `+${r.phone}` : r.phone, this.email = r.email;
|
|
2378
2411
|
}
|
|
2379
2412
|
}
|
|
2380
|
-
class U extends
|
|
2413
|
+
class U extends D {
|
|
2381
2414
|
}
|
|
2382
2415
|
class Lr extends L {
|
|
2383
2416
|
/**
|
|
@@ -2407,12 +2440,12 @@ class Lr extends L {
|
|
|
2407
2440
|
* @inheritDoc
|
|
2408
2441
|
*/
|
|
2409
2442
|
s(this, "isRegionalDirector");
|
|
2410
|
-
this.salesDirection = e != null && e.salesDirection ? new U(e.salesDirection) : new U(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new
|
|
2443
|
+
this.salesDirection = e != null && e.salesDirection ? new U(e.salesDirection) : new U(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new lt(e.contacts) : void 0, this.isDefault = (e == null ? void 0 : e.isDefault) ?? !1, this.isRegionalDirector = (e == null ? void 0 : e.isRegionalDirector) ?? !1;
|
|
2411
2444
|
}
|
|
2412
2445
|
}
|
|
2413
|
-
class Ir extends
|
|
2446
|
+
class Ir extends D {
|
|
2414
2447
|
}
|
|
2415
|
-
class
|
|
2448
|
+
class ut extends L {
|
|
2416
2449
|
/**
|
|
2417
2450
|
* Инициализирует экземпляр класса {@link IUserPricingRole}.
|
|
2418
2451
|
*
|
|
@@ -2435,7 +2468,7 @@ class lt extends L {
|
|
|
2435
2468
|
this.description = e.description, this.canChangeLowCost = e.canChangeLowCost, this.parentRoleId = e.parentRoleId;
|
|
2436
2469
|
}
|
|
2437
2470
|
}
|
|
2438
|
-
class
|
|
2471
|
+
class Ze extends L {
|
|
2439
2472
|
/**
|
|
2440
2473
|
* Инициализирует экземпляр класса {@link UserRegionShortInfo}.
|
|
2441
2474
|
*
|
|
@@ -2457,7 +2490,7 @@ class Z extends Lr {
|
|
|
2457
2490
|
* @param data Данные для первоначальной инициализации.
|
|
2458
2491
|
*/
|
|
2459
2492
|
constructor(e) {
|
|
2460
|
-
var t,
|
|
2493
|
+
var t, i, o;
|
|
2461
2494
|
super(e);
|
|
2462
2495
|
/**
|
|
2463
2496
|
* Признак активности учетной записи менеджера.
|
|
@@ -2507,10 +2540,10 @@ class Z extends Lr {
|
|
|
2507
2540
|
* Дата и время последнего входа в систему.
|
|
2508
2541
|
*/
|
|
2509
2542
|
s(this, "lastLoginAt");
|
|
2510
|
-
this.isActive = (e == null ? void 0 : e.isActive) ?? !1, this.isSupervisor = (e == null ? void 0 : e.isSupervisor) ?? !1, this.canDoReclamations = (e == null ? void 0 : e.canDoReclamations) ?? !1, this.createdAt =
|
|
2543
|
+
this.isActive = (e == null ? void 0 : e.isActive) ?? !1, this.isSupervisor = (e == null ? void 0 : e.isSupervisor) ?? !1, this.canDoReclamations = (e == null ? void 0 : e.canDoReclamations) ?? !1, this.createdAt = R(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e == null ? void 0 : e.createdAt, this.supervisorId = e == null ? void 0 : e.supervisorId, this.pricingRole = e != null && e.pricingRole ? new ut(e.pricingRole) : void 0, this.curatedDirections = ((t = e == null ? void 0 : e.curatedDirections) == null ? void 0 : t.map((c) => new Ir(c))) ?? [], this.showAllCosts = e == null ? void 0 : e.showAllCosts, this.authAsOperator = e == null ? void 0 : e.authAsOperator, this.managerRegions = (i = e == null ? void 0 : e.managerRegions) == null ? void 0 : i.map((c) => new Ze(c)), this.managers = (o = e == null ? void 0 : e.managers) == null ? void 0 : o.map((c) => new Z(c)), this.lastLoginAt = R(e == null ? void 0 : e.lastLoginAt) ? C(e.lastLoginAt) : e == null ? void 0 : e.lastLoginAt;
|
|
2511
2544
|
}
|
|
2512
2545
|
}
|
|
2513
|
-
class fs extends
|
|
2546
|
+
class fs extends Ae {
|
|
2514
2547
|
/**
|
|
2515
2548
|
* Инициализирует экземпляр класса {@link BaseClientCategory}.
|
|
2516
2549
|
*
|
|
@@ -2541,14 +2574,14 @@ class fs extends be {
|
|
|
2541
2574
|
this.isDisabled = (e == null ? void 0 : e.isDisabled) ?? !1, this.isRequired = (e == null ? void 0 : e.isRequired) ?? !1, this.isFavorite = (e == null ? void 0 : e.isFavorite) ?? !1, this.hidingComment = e == null ? void 0 : e.hidingComment, this.manager = e != null && e.manager ? new Z(e.manager) : void 0;
|
|
2542
2575
|
}
|
|
2543
2576
|
}
|
|
2544
|
-
class
|
|
2577
|
+
class Ke extends fs {
|
|
2545
2578
|
/**
|
|
2546
2579
|
* Инициализирует экземпляр класса {@link ClientCategory}.
|
|
2547
2580
|
*
|
|
2548
2581
|
* @param data Данные для первоначальной инициализации.
|
|
2549
2582
|
*/
|
|
2550
2583
|
constructor(e) {
|
|
2551
|
-
var t,
|
|
2584
|
+
var t, i;
|
|
2552
2585
|
super(e);
|
|
2553
2586
|
/**
|
|
2554
2587
|
* Данные о вложенных категориях.
|
|
@@ -2558,10 +2591,10 @@ class Je extends fs {
|
|
|
2558
2591
|
* Список продуктов категории.
|
|
2559
2592
|
*/
|
|
2560
2593
|
s(this, "products");
|
|
2561
|
-
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new
|
|
2594
|
+
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new Ke(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new X(o));
|
|
2562
2595
|
}
|
|
2563
2596
|
}
|
|
2564
|
-
class
|
|
2597
|
+
class pt {
|
|
2565
2598
|
/**
|
|
2566
2599
|
* Инициализирует экземпляр класса {@link PriceTemplateICatalogableItem}.
|
|
2567
2600
|
*
|
|
@@ -2579,7 +2612,7 @@ class ut {
|
|
|
2579
2612
|
this.priceCoefficient = (r == null ? void 0 : r.priceCoefficient) && new Pe(r.priceCoefficient), this.increasePercent = r == null ? void 0 : r.increasePercent;
|
|
2580
2613
|
}
|
|
2581
2614
|
}
|
|
2582
|
-
class pr extends
|
|
2615
|
+
class pr extends pt {
|
|
2583
2616
|
/**
|
|
2584
2617
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
2585
2618
|
*
|
|
@@ -2591,7 +2624,7 @@ class pr extends ut {
|
|
|
2591
2624
|
* Базовые данные о продукте.
|
|
2592
2625
|
*/
|
|
2593
2626
|
s(this, "productCategory");
|
|
2594
|
-
this.productCategory = new
|
|
2627
|
+
this.productCategory = new Ae(e == null ? void 0 : e.productCategory);
|
|
2595
2628
|
}
|
|
2596
2629
|
}
|
|
2597
2630
|
class xr extends L {
|
|
@@ -2614,12 +2647,12 @@ class xr extends L {
|
|
|
2614
2647
|
* @inheritDoc
|
|
2615
2648
|
*/
|
|
2616
2649
|
s(this, "curatedDirection");
|
|
2617
|
-
this.photo = e.photo, this.contacts = new
|
|
2650
|
+
this.photo = e.photo, this.contacts = new lt(e.contacts), this.curatedDirection = new Ir(e.curatedDirection);
|
|
2618
2651
|
}
|
|
2619
2652
|
}
|
|
2620
|
-
class we extends
|
|
2653
|
+
class we extends D {
|
|
2621
2654
|
}
|
|
2622
|
-
class ve extends
|
|
2655
|
+
class ve extends D {
|
|
2623
2656
|
/**
|
|
2624
2657
|
* Инициализирует экземпляр класса {@link Region}.
|
|
2625
2658
|
*
|
|
@@ -2634,7 +2667,7 @@ class ve extends R {
|
|
|
2634
2667
|
e && (this.country = new we(e.country));
|
|
2635
2668
|
}
|
|
2636
2669
|
}
|
|
2637
|
-
class
|
|
2670
|
+
class Re extends D {
|
|
2638
2671
|
/**
|
|
2639
2672
|
* Инициализирует экземпляр класса {@link CityWithRegionAndCountry}.
|
|
2640
2673
|
*
|
|
@@ -2649,7 +2682,7 @@ class Ce extends R {
|
|
|
2649
2682
|
e && (this.region = new ve(e.region));
|
|
2650
2683
|
}
|
|
2651
2684
|
}
|
|
2652
|
-
class
|
|
2685
|
+
class ht extends L {
|
|
2653
2686
|
/**
|
|
2654
2687
|
* Инициализирует экземпляр класса {@link UserCommonInfo}.
|
|
2655
2688
|
*
|
|
@@ -2685,10 +2718,10 @@ class pt extends L {
|
|
|
2685
2718
|
* Признак активности учетной записи пользователя.
|
|
2686
2719
|
*/
|
|
2687
2720
|
s(this, "isActive");
|
|
2688
|
-
this.phone = /^\d+$/.test((e == null ? void 0 : e.phone) ?? "") ? `+${e == null ? void 0 : e.phone}` : (e == null ? void 0 : e.phone) ?? "", this.email = (e == null ? void 0 : e.email) ?? "", this.getNews = (e == null ? void 0 : e.getNews) ?? !1, this.salesDirection = e != null && e.salesDirection ? new U(e.salesDirection) : void 0, this.createdAt =
|
|
2721
|
+
this.phone = /^\d+$/.test((e == null ? void 0 : e.phone) ?? "") ? `+${e == null ? void 0 : e.phone}` : (e == null ? void 0 : e.phone) ?? "", this.email = (e == null ? void 0 : e.email) ?? "", this.getNews = (e == null ? void 0 : e.getNews) ?? !1, this.salesDirection = e != null && e.salesDirection ? new U(e.salesDirection) : void 0, this.createdAt = R(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e == null ? void 0 : e.createdAt, this.lastLoginAt = R(e == null ? void 0 : e.lastLoginAt) ? C(e.lastLoginAt) : e == null ? void 0 : e.lastLoginAt, this.isActive = (e == null ? void 0 : e.isActive) ?? !1;
|
|
2689
2722
|
}
|
|
2690
2723
|
}
|
|
2691
|
-
class oe extends
|
|
2724
|
+
class oe extends ht {
|
|
2692
2725
|
/**
|
|
2693
2726
|
* Инициализирует экземпляр класса {@link Client}.
|
|
2694
2727
|
*
|
|
@@ -2696,7 +2729,7 @@ class oe extends pt {
|
|
|
2696
2729
|
*/
|
|
2697
2730
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
2698
2731
|
constructor(e) {
|
|
2699
|
-
var t,
|
|
2732
|
+
var t, i;
|
|
2700
2733
|
super(e);
|
|
2701
2734
|
/**
|
|
2702
2735
|
* Направление продаж.
|
|
@@ -2734,7 +2767,7 @@ class oe extends pt {
|
|
|
2734
2767
|
* @inheritDoc
|
|
2735
2768
|
*/
|
|
2736
2769
|
s(this, "curators");
|
|
2737
|
-
this.salesDirection = new U(e == null ? void 0 : e.salesDirection), this.debt = (e == null ? void 0 : e.debt) ?? 0, this.alternativeName = (e == null ? void 0 : e.alternativeName) ?? "", this.city = new
|
|
2770
|
+
this.salesDirection = new U(e == null ? void 0 : e.salesDirection), this.debt = (e == null ? void 0 : e.debt) ?? 0, this.alternativeName = (e == null ? void 0 : e.alternativeName) ?? "", this.city = new Re(e == null ? void 0 : e.city), this.comment = e == null ? void 0 : e.comment, this.isPhoneApproved = (e == null ? void 0 : e.isPhoneApproved) ?? !1, this.isEmailApproved = (e == null ? void 0 : e.isEmailApproved) ?? !1, this.managers = ((t = e == null ? void 0 : e.managers) == null ? void 0 : t.map((o) => new Lr(o))) ?? [], this.curators = ((i = e == null ? void 0 : e.curators) == null ? void 0 : i.map((o) => new xr(o))) ?? void 0;
|
|
2738
2771
|
}
|
|
2739
2772
|
}
|
|
2740
2773
|
class Le extends G {
|
|
@@ -2761,10 +2794,10 @@ class Le extends G {
|
|
|
2761
2794
|
* Данные шаблона прайс-листа.
|
|
2762
2795
|
*/
|
|
2763
2796
|
s(this, "priceTemplate");
|
|
2764
|
-
this.createdAt =
|
|
2797
|
+
this.createdAt = R(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.deletedAt = R(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt, this.client = new oe(e == null ? void 0 : e.client), this.priceTemplate = new fe(e == null ? void 0 : e.priceTemplate);
|
|
2765
2798
|
}
|
|
2766
2799
|
}
|
|
2767
|
-
class hr extends
|
|
2800
|
+
class hr extends pt {
|
|
2768
2801
|
/**
|
|
2769
2802
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
2770
2803
|
*
|
|
@@ -2779,7 +2812,7 @@ class hr extends ut {
|
|
|
2779
2812
|
this.product = new q(e == null ? void 0 : e.product);
|
|
2780
2813
|
}
|
|
2781
2814
|
}
|
|
2782
|
-
class
|
|
2815
|
+
class gt extends D {
|
|
2783
2816
|
}
|
|
2784
2817
|
class me extends L {
|
|
2785
2818
|
/**
|
|
@@ -2805,7 +2838,7 @@ class me extends L {
|
|
|
2805
2838
|
* Признак того, что по свойству может производиться фильтрация в каталоге.
|
|
2806
2839
|
*/
|
|
2807
2840
|
s(this, "isFilterable");
|
|
2808
|
-
this.type = new
|
|
2841
|
+
this.type = new gt(e == null ? void 0 : e.type), this.description = (e == null ? void 0 : e.description) ?? "", this.metadata = e == null ? void 0 : e.metadata, this.isFilterable = e == null ? void 0 : e.isFilterable;
|
|
2809
2842
|
}
|
|
2810
2843
|
}
|
|
2811
2844
|
class he {
|
|
@@ -2853,12 +2886,12 @@ class ei {
|
|
|
2853
2886
|
/**
|
|
2854
2887
|
* Период создания.
|
|
2855
2888
|
*/
|
|
2856
|
-
s(this, "createdAt", new
|
|
2889
|
+
s(this, "createdAt", new b());
|
|
2857
2890
|
/**
|
|
2858
2891
|
* Период изменения.
|
|
2859
2892
|
*/
|
|
2860
|
-
s(this, "updatedAt", new
|
|
2861
|
-
this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.description = r == null ? void 0 : r.description, this.ownerName = r == null ? void 0 : r.ownerName, this.createdAt = new
|
|
2893
|
+
s(this, "updatedAt", new b());
|
|
2894
|
+
this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.description = r == null ? void 0 : r.description, this.ownerName = r == null ? void 0 : r.ownerName, this.createdAt = new b(r == null ? void 0 : r.createdAt), this.updatedAt = new b(r == null ? void 0 : r.updatedAt);
|
|
2862
2895
|
}
|
|
2863
2896
|
/**
|
|
2864
2897
|
* Выполняет сброс указанного фильтра в значение по умолчанию.
|
|
@@ -2887,13 +2920,13 @@ class ei {
|
|
|
2887
2920
|
* только актуальные данные.
|
|
2888
2921
|
*/
|
|
2889
2922
|
asClearRaw() {
|
|
2890
|
-
var e, t,
|
|
2923
|
+
var e, t, i, o;
|
|
2891
2924
|
const r = {};
|
|
2892
2925
|
return Object.keys(this).forEach((c) => {
|
|
2893
2926
|
const u = this[c];
|
|
2894
2927
|
// eslint-disable-next-line prettier/prettier
|
|
2895
|
-
m(u) ||
|
|
2896
|
-
}), !((e = r == null ? void 0 : r.createdAt) != null && e.from) && !((t = r == null ? void 0 : r.createdAt) != null && t.to) && delete r.createdAt, !((
|
|
2928
|
+
m(u) || R(u) && u.trim().length === 0 || br(u.isNewRec) && u.isNewRec() || (r[c] = u);
|
|
2929
|
+
}), !((e = r == null ? void 0 : r.createdAt) != null && e.from) && !((t = r == null ? void 0 : r.createdAt) != null && t.to) && delete r.createdAt, !((i = r == null ? void 0 : r.updatedAt) != null && i.from) && !((o = r == null ? void 0 : r.updatedAt) != null && o.to) && delete r.updatedAt, r;
|
|
2897
2930
|
}
|
|
2898
2931
|
}
|
|
2899
2932
|
class Ie extends L {
|
|
@@ -2950,7 +2983,7 @@ class Hr {
|
|
|
2950
2983
|
* Минимальный коэффициент цены.
|
|
2951
2984
|
*/
|
|
2952
2985
|
s(this, "minCoefficient");
|
|
2953
|
-
this.role = new Ie(r == null ? void 0 : r.role), this.category = new
|
|
2986
|
+
this.role = new Ie(r == null ? void 0 : r.role), this.category = new Ae(r == null ? void 0 : r.category), this.minCoefficient = new Pe(r == null ? void 0 : r.minCoefficient);
|
|
2954
2987
|
}
|
|
2955
2988
|
}
|
|
2956
2989
|
class ms {
|
|
@@ -3005,7 +3038,7 @@ class Br {
|
|
|
3005
3038
|
* @inheritDoc
|
|
3006
3039
|
*/
|
|
3007
3040
|
s(this, "settings");
|
|
3008
|
-
this.category = new
|
|
3041
|
+
this.category = new Ae(r == null ? void 0 : r.category), this.property = new me(r == null ? void 0 : r.property), this.settings = new ms(r == null ? void 0 : r.settings);
|
|
3009
3042
|
}
|
|
3010
3043
|
}
|
|
3011
3044
|
class ys {
|
|
@@ -3069,7 +3102,7 @@ class as {
|
|
|
3069
3102
|
*/
|
|
3070
3103
|
s(this, "max");
|
|
3071
3104
|
var e;
|
|
3072
|
-
this.id = (r == null ? void 0 : r.id) ?? "", this.label = (r == null ? void 0 : r.label) ?? "", this.type = (r == null ? void 0 : r.type) ??
|
|
3105
|
+
this.id = (r == null ? void 0 : r.id) ?? "", this.label = (r == null ? void 0 : r.label) ?? "", this.type = (r == null ? void 0 : r.type) ?? ct.Checkbox, this.ord = (r == null ? void 0 : r.ord) ?? 0, this.isMultiple = (r == null ? void 0 : r.isMultiple) ?? null, this.values = ((e = r == null ? void 0 : r.values) == null ? void 0 : e.map((t) => new ys(t))) ?? [], this.min = (r == null ? void 0 : r.min) ?? null, this.max = (r == null ? void 0 : r.max) ?? null;
|
|
3073
3106
|
}
|
|
3074
3107
|
}
|
|
3075
3108
|
class ri extends h {
|
|
@@ -3098,9 +3131,9 @@ class ri extends h {
|
|
|
3098
3131
|
* @see /doc/api/internal#/operations/api_internal_price_export
|
|
3099
3132
|
*/
|
|
3100
3133
|
// eslint-disable-next-line class-methods-use-this
|
|
3101
|
-
getPriceExportLink(r = "csv", e = !1, t = void 0,
|
|
3134
|
+
getPriceExportLink(r = "csv", e = !1, t = void 0, i = void 0) {
|
|
3102
3135
|
let c = `${O().config.http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;
|
|
3103
|
-
return t && (c += `&category_id=${t}`),
|
|
3136
|
+
return t && (c += `&category_id=${t}`), i && (c += `&client_id=${i}`), c;
|
|
3104
3137
|
}
|
|
3105
3138
|
}
|
|
3106
3139
|
class ti extends h {
|
|
@@ -3125,9 +3158,9 @@ class ti extends h {
|
|
|
3125
3158
|
* @see /doc/api/internal#/operations/api_internal_client_price_category_update
|
|
3126
3159
|
*/
|
|
3127
3160
|
updateCategoryPrices(r, e, t) {
|
|
3128
|
-
var
|
|
3161
|
+
var i;
|
|
3129
3162
|
return this.patch(`/internal/clients/${r}/price/categories/${e}`, {
|
|
3130
|
-
price_coefficient_id: (
|
|
3163
|
+
price_coefficient_id: (i = t.coefficient) == null ? void 0 : i.id,
|
|
3131
3164
|
increase_percent: t.value
|
|
3132
3165
|
});
|
|
3133
3166
|
}
|
|
@@ -3220,11 +3253,11 @@ class ti extends h {
|
|
|
3220
3253
|
* @see /doc/api/internal#/operations/api_internal_client_price_products_update
|
|
3221
3254
|
*/
|
|
3222
3255
|
updateProductPrice(r, e, t) {
|
|
3223
|
-
var
|
|
3256
|
+
var i;
|
|
3224
3257
|
return this.patch(
|
|
3225
3258
|
`/internal/clients/${r}/price/products/${e}`,
|
|
3226
3259
|
{
|
|
3227
|
-
price_coefficient_id: (
|
|
3260
|
+
price_coefficient_id: (i = t.coefficient) == null ? void 0 : i.id,
|
|
3228
3261
|
increase_percent: t.value
|
|
3229
3262
|
},
|
|
3230
3263
|
(o) => new X(o.data)
|
|
@@ -3333,12 +3366,12 @@ class si extends h {
|
|
|
3333
3366
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_attach
|
|
3334
3367
|
*/
|
|
3335
3368
|
attachTemplate(r, e, t) {
|
|
3336
|
-
const
|
|
3369
|
+
const i = O().config.dateFormats.api;
|
|
3337
3370
|
return this.post(
|
|
3338
3371
|
`/internal/clients/${r}/price/templates/${e}`,
|
|
3339
3372
|
t && {
|
|
3340
|
-
startAt: t.startAt && k(t.startAt,
|
|
3341
|
-
endAt: t.endAt && k(t.endAt,
|
|
3373
|
+
startAt: t.startAt && k(t.startAt, i),
|
|
3374
|
+
endAt: t.endAt && k(t.endAt, i)
|
|
3342
3375
|
},
|
|
3343
3376
|
(o) => new Le(o.data),
|
|
3344
3377
|
{},
|
|
@@ -3366,13 +3399,13 @@ class si extends h {
|
|
|
3366
3399
|
*
|
|
3367
3400
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_change
|
|
3368
3401
|
*/
|
|
3369
|
-
changeTemplate(r, e, t,
|
|
3402
|
+
changeTemplate(r, e, t, i) {
|
|
3370
3403
|
const o = O().config.dateFormats.api;
|
|
3371
3404
|
return this.patch(
|
|
3372
3405
|
`/internal/clients/${r}/price/templates/${e}/${t}`,
|
|
3373
|
-
|
|
3374
|
-
startAt:
|
|
3375
|
-
endAt:
|
|
3406
|
+
i && {
|
|
3407
|
+
startAt: i.startAt && k(i.startAt, o),
|
|
3408
|
+
endAt: i.endAt && k(i.endAt, o)
|
|
3376
3409
|
},
|
|
3377
3410
|
(c) => new Le(c.data)
|
|
3378
3411
|
);
|
|
@@ -3419,7 +3452,7 @@ class ii extends h {
|
|
|
3419
3452
|
showHidden: e,
|
|
3420
3453
|
withNestedCategories: t
|
|
3421
3454
|
},
|
|
3422
|
-
(
|
|
3455
|
+
(i) => new Q(i.data)
|
|
3423
3456
|
);
|
|
3424
3457
|
}
|
|
3425
3458
|
/**
|
|
@@ -3446,7 +3479,7 @@ class ii extends h {
|
|
|
3446
3479
|
showHidden: t,
|
|
3447
3480
|
withPriceCoefficients: e
|
|
3448
3481
|
},
|
|
3449
|
-
(
|
|
3482
|
+
(i) => De(i.data, (o) => new q(o))
|
|
3450
3483
|
);
|
|
3451
3484
|
}
|
|
3452
3485
|
/**
|
|
@@ -3459,7 +3492,7 @@ class ii extends h {
|
|
|
3459
3492
|
getCategoryProductsCoefficients(r) {
|
|
3460
3493
|
return this.get(`/internal/catalog/categories/${r}/products/coefficients`, {}, (e) => {
|
|
3461
3494
|
const { data: t } = e;
|
|
3462
|
-
return Ft(t, (
|
|
3495
|
+
return Ft(t, (i) => i.map((o) => new $r(o))), t;
|
|
3463
3496
|
});
|
|
3464
3497
|
}
|
|
3465
3498
|
/**
|
|
@@ -3469,11 +3502,11 @@ class ii extends h {
|
|
|
3469
3502
|
* @param limit Количество возвращаемых записей.
|
|
3470
3503
|
*/
|
|
3471
3504
|
publicSimpleSearch(r, e = 10) {
|
|
3472
|
-
return new Promise((t,
|
|
3505
|
+
return new Promise((t, i) => {
|
|
3473
3506
|
this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then((o) => {
|
|
3474
3507
|
t(o.categories.map((c) => new Q(c)));
|
|
3475
3508
|
}).catch((o) => {
|
|
3476
|
-
|
|
3509
|
+
i(o);
|
|
3477
3510
|
});
|
|
3478
3511
|
});
|
|
3479
3512
|
}
|
|
@@ -3522,9 +3555,9 @@ class ni extends Y {
|
|
|
3522
3555
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_new_products_by_period_get
|
|
3523
3556
|
*/
|
|
3524
3557
|
getNewProducts(r, e, t = !0) {
|
|
3525
|
-
const
|
|
3558
|
+
const i = O().config.dateFormats.api;
|
|
3526
3559
|
return this.getTypedPaginated(q, "/internal/catalog/products/new", void 0, void 0, e, {
|
|
3527
|
-
period: { from: k(r,
|
|
3560
|
+
period: { from: k(r, i) },
|
|
3528
3561
|
withPriceCoefficients: t
|
|
3529
3562
|
});
|
|
3530
3563
|
}
|
|
@@ -3535,11 +3568,11 @@ class ni extends Y {
|
|
|
3535
3568
|
* @param limit Количество возвращаемых записей.
|
|
3536
3569
|
*/
|
|
3537
3570
|
publicSimpleSearch(r, e = 10) {
|
|
3538
|
-
return new Promise((t,
|
|
3571
|
+
return new Promise((t, i) => {
|
|
3539
3572
|
this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then((o) => {
|
|
3540
3573
|
t(o.products.map((c) => new q(c)));
|
|
3541
3574
|
}).catch((o) => {
|
|
3542
|
-
|
|
3575
|
+
i(o);
|
|
3543
3576
|
});
|
|
3544
3577
|
});
|
|
3545
3578
|
}
|
|
@@ -3554,7 +3587,7 @@ class oi extends h {
|
|
|
3554
3587
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_categories_get_list
|
|
3555
3588
|
*/
|
|
3556
3589
|
getRootCategoriesList(r, e = !1) {
|
|
3557
|
-
return this.getTypedList(
|
|
3590
|
+
return this.getTypedList(Ke, "/internal/catalog/categories", {
|
|
3558
3591
|
clientId: r,
|
|
3559
3592
|
showHidden: e
|
|
3560
3593
|
});
|
|
@@ -3569,15 +3602,15 @@ class oi extends h {
|
|
|
3569
3602
|
*
|
|
3570
3603
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_categories_get
|
|
3571
3604
|
*/
|
|
3572
|
-
getCategoryData(r, e, t = !1,
|
|
3605
|
+
getCategoryData(r, e, t = !1, i = !1) {
|
|
3573
3606
|
return this.get(
|
|
3574
3607
|
`/internal/catalog/categories/${e}`,
|
|
3575
3608
|
{
|
|
3576
3609
|
clientId: r,
|
|
3577
3610
|
showHidden: t,
|
|
3578
|
-
withNestedCategories:
|
|
3611
|
+
withNestedCategories: i
|
|
3579
3612
|
},
|
|
3580
|
-
(o) => new
|
|
3613
|
+
(o) => new Ke(o.data)
|
|
3581
3614
|
);
|
|
3582
3615
|
}
|
|
3583
3616
|
/**
|
|
@@ -3590,12 +3623,12 @@ class oi extends h {
|
|
|
3590
3623
|
*
|
|
3591
3624
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_categories_products_get
|
|
3592
3625
|
*/
|
|
3593
|
-
getCategoryProductsList(r, e, t = !0,
|
|
3626
|
+
getCategoryProductsList(r, e, t = !0, i = !1) {
|
|
3594
3627
|
return this.get(
|
|
3595
3628
|
`/internal/catalog/categories/${e}/products`,
|
|
3596
3629
|
{
|
|
3597
3630
|
client_id: r,
|
|
3598
|
-
showHidden:
|
|
3631
|
+
showHidden: i,
|
|
3599
3632
|
withPriceCoefficients: t
|
|
3600
3633
|
},
|
|
3601
3634
|
(o) => De(o.data, (c) => new X(c))
|
|
@@ -3619,7 +3652,7 @@ class ci extends Y {
|
|
|
3619
3652
|
clientId: e,
|
|
3620
3653
|
withPriceCoefficients: t
|
|
3621
3654
|
},
|
|
3622
|
-
(
|
|
3655
|
+
(i) => new X(i.data)
|
|
3623
3656
|
);
|
|
3624
3657
|
}
|
|
3625
3658
|
/**
|
|
@@ -3632,12 +3665,12 @@ class ci extends Y {
|
|
|
3632
3665
|
*
|
|
3633
3666
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_new_products_by_period_get
|
|
3634
3667
|
*/
|
|
3635
|
-
getNewProducts(r, e, t,
|
|
3668
|
+
getNewProducts(r, e, t, i = !0) {
|
|
3636
3669
|
const o = O().config.dateFormats.api;
|
|
3637
3670
|
return this.getTypedPaginated(X, "/internal/catalog/products/new", void 0, void 0, t, {
|
|
3638
3671
|
clientId: r,
|
|
3639
3672
|
period: { from: k(e, o) },
|
|
3640
|
-
withPriceCoefficients:
|
|
3673
|
+
withPriceCoefficients: i
|
|
3641
3674
|
});
|
|
3642
3675
|
}
|
|
3643
3676
|
}
|
|
@@ -3687,7 +3720,7 @@ class li extends Y {
|
|
|
3687
3720
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_update
|
|
3688
3721
|
*/
|
|
3689
3722
|
updateTemplate(r, e, t = {}) {
|
|
3690
|
-
return this.patch(`/internal/price/templates/${r}`, e, (
|
|
3723
|
+
return this.patch(`/internal/price/templates/${r}`, e, (i) => new fe(i.data), t);
|
|
3691
3724
|
}
|
|
3692
3725
|
/**
|
|
3693
3726
|
* Удаляет данные о шаблоне прайс-листа.
|
|
@@ -3730,11 +3763,11 @@ class li extends Y {
|
|
|
3730
3763
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_product_save
|
|
3731
3764
|
*/
|
|
3732
3765
|
saveProductTemplatePrice(r, e, t) {
|
|
3733
|
-
var
|
|
3766
|
+
var i;
|
|
3734
3767
|
return this.post(
|
|
3735
3768
|
`/internal/price/templates/${r}/products/${e}`,
|
|
3736
3769
|
{
|
|
3737
|
-
price_coefficient_id: (
|
|
3770
|
+
price_coefficient_id: (i = t.coefficient) == null ? void 0 : i.id,
|
|
3738
3771
|
increase_percent: t.value
|
|
3739
3772
|
},
|
|
3740
3773
|
(o) => new hr(o.data)
|
|
@@ -3787,7 +3820,7 @@ class li extends Y {
|
|
|
3787
3820
|
*
|
|
3788
3821
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_category_save
|
|
3789
3822
|
*/
|
|
3790
|
-
saveCategoryTemplatePrice(r, e, t,
|
|
3823
|
+
saveCategoryTemplatePrice(r, e, t, i = !1) {
|
|
3791
3824
|
var o;
|
|
3792
3825
|
return this.request(
|
|
3793
3826
|
{
|
|
@@ -3797,7 +3830,7 @@ class li extends Y {
|
|
|
3797
3830
|
price_coefficient_id: (o = t.coefficient) == null ? void 0 : o.id,
|
|
3798
3831
|
increase_percent: t.value
|
|
3799
3832
|
},
|
|
3800
|
-
params:
|
|
3833
|
+
params: i ? { recursively: !0 } : {}
|
|
3801
3834
|
},
|
|
3802
3835
|
(c) => new pr(c.data)
|
|
3803
3836
|
);
|
|
@@ -3933,7 +3966,7 @@ class pi extends Y {
|
|
|
3933
3966
|
...t,
|
|
3934
3967
|
type: e
|
|
3935
3968
|
},
|
|
3936
|
-
(
|
|
3969
|
+
(i) => new me(i.data)
|
|
3937
3970
|
);
|
|
3938
3971
|
}
|
|
3939
3972
|
/**
|
|
@@ -3953,11 +3986,11 @@ class pi extends Y {
|
|
|
3953
3986
|
* @see /doc/api/internal#/operations/api_internal_catalog_properties_update
|
|
3954
3987
|
*/
|
|
3955
3988
|
updateProperty(r, e) {
|
|
3956
|
-
const { typeId: t, ...
|
|
3989
|
+
const { typeId: t, ...i } = e;
|
|
3957
3990
|
return this.patch(
|
|
3958
3991
|
`/internal/catalog/properties/${r}`,
|
|
3959
3992
|
{
|
|
3960
|
-
...
|
|
3993
|
+
...i,
|
|
3961
3994
|
type: t
|
|
3962
3995
|
},
|
|
3963
3996
|
(o) => new me(o.data)
|
|
@@ -4000,7 +4033,7 @@ class pi extends Y {
|
|
|
4000
4033
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_update
|
|
4001
4034
|
*/
|
|
4002
4035
|
updateProductProperty(r, e, t) {
|
|
4003
|
-
return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: t }, (
|
|
4036
|
+
return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: t }, (i) => new he(i.data));
|
|
4004
4037
|
}
|
|
4005
4038
|
/**
|
|
4006
4039
|
* Удаляет значение свойства продукта.
|
|
@@ -4146,7 +4179,7 @@ class pi extends Y {
|
|
|
4146
4179
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_update
|
|
4147
4180
|
*/
|
|
4148
4181
|
updateCategoryProperty(r, e, t) {
|
|
4149
|
-
return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: t }, (
|
|
4182
|
+
return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: t }, (i) => new he(i.data));
|
|
4150
4183
|
}
|
|
4151
4184
|
/**
|
|
4152
4185
|
* Удаляет значение свойства категории.
|
|
@@ -4285,7 +4318,7 @@ class pi extends Y {
|
|
|
4285
4318
|
return this.get(
|
|
4286
4319
|
`/internal/catalog/categories/${r}/filters`,
|
|
4287
4320
|
{ recursively: e },
|
|
4288
|
-
(t) => t.data.map((
|
|
4321
|
+
(t) => t.data.map((i) => new as(i))
|
|
4289
4322
|
);
|
|
4290
4323
|
}
|
|
4291
4324
|
/**
|
|
@@ -4309,7 +4342,7 @@ class pi extends Y {
|
|
|
4309
4342
|
return this.patch(
|
|
4310
4343
|
`/internal/catalog/categories/${r}/filter-settings/${e}`,
|
|
4311
4344
|
t,
|
|
4312
|
-
(
|
|
4345
|
+
(i) => new Br(i.data)
|
|
4313
4346
|
);
|
|
4314
4347
|
}
|
|
4315
4348
|
/**
|
|
@@ -4348,13 +4381,13 @@ class hi extends h {
|
|
|
4348
4381
|
*
|
|
4349
4382
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_categories_get
|
|
4350
4383
|
*/
|
|
4351
|
-
getCategoryData(r, e, t = !1,
|
|
4384
|
+
getCategoryData(r, e, t = !1, i = !1) {
|
|
4352
4385
|
return this.get(
|
|
4353
4386
|
`/internal/catalog/categories/${e}`,
|
|
4354
4387
|
{
|
|
4355
4388
|
priceTemplateId: r,
|
|
4356
4389
|
showHidden: t,
|
|
4357
|
-
withNestedCategories:
|
|
4390
|
+
withNestedCategories: i
|
|
4358
4391
|
},
|
|
4359
4392
|
(o) => new Q(o.data)
|
|
4360
4393
|
);
|
|
@@ -4369,50 +4402,50 @@ class hi extends h {
|
|
|
4369
4402
|
*
|
|
4370
4403
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_categories_products_get
|
|
4371
4404
|
*/
|
|
4372
|
-
getCategoryProductsList(r, e, t = !0,
|
|
4405
|
+
getCategoryProductsList(r, e, t = !0, i = !1) {
|
|
4373
4406
|
return this.get(
|
|
4374
4407
|
`/internal/catalog/categories/${e}/products`,
|
|
4375
4408
|
{
|
|
4376
4409
|
priceTemplateId: r,
|
|
4377
|
-
showHidden:
|
|
4410
|
+
showHidden: i,
|
|
4378
4411
|
withPriceCoefficients: t
|
|
4379
4412
|
},
|
|
4380
4413
|
(o) => De(o.data, (c) => new q(c))
|
|
4381
4414
|
);
|
|
4382
4415
|
}
|
|
4383
4416
|
}
|
|
4384
|
-
function
|
|
4417
|
+
function zr(n, r, e) {
|
|
4385
4418
|
let t;
|
|
4386
|
-
return
|
|
4387
|
-
if (
|
|
4388
|
-
return t =
|
|
4389
|
-
if (
|
|
4419
|
+
return n.some((i) => {
|
|
4420
|
+
if (i.type === e && i.id === r)
|
|
4421
|
+
return t = i, !0;
|
|
4422
|
+
if (i.type === "product")
|
|
4390
4423
|
return !1;
|
|
4391
|
-
const o =
|
|
4424
|
+
const o = i;
|
|
4392
4425
|
if (o.products && o.products.length > 0) {
|
|
4393
|
-
const c =
|
|
4426
|
+
const c = zr(o.products, r, e);
|
|
4394
4427
|
if (c)
|
|
4395
4428
|
return t = c, !0;
|
|
4396
4429
|
}
|
|
4397
4430
|
if (o.categories && o.categories.length > 0) {
|
|
4398
|
-
const c =
|
|
4431
|
+
const c = zr(o.categories, r, e);
|
|
4399
4432
|
if (c)
|
|
4400
4433
|
return t = c, !0;
|
|
4401
4434
|
}
|
|
4402
4435
|
return !1;
|
|
4403
4436
|
}), t;
|
|
4404
4437
|
}
|
|
4405
|
-
function
|
|
4438
|
+
function Wr(n) {
|
|
4406
4439
|
const r = [];
|
|
4407
|
-
return
|
|
4440
|
+
return n.forEach((e) => {
|
|
4408
4441
|
if (r.push(e), e.type === "category") {
|
|
4409
4442
|
const t = e;
|
|
4410
|
-
t.products && t.products.length > 0 && r.push(...
|
|
4443
|
+
t.products && t.products.length > 0 && r.push(...Wr(t.products)), t.categories && t.categories.length > 0 && r.push(...Wr(t.categories));
|
|
4411
4444
|
}
|
|
4412
4445
|
}), r;
|
|
4413
4446
|
}
|
|
4414
|
-
var ws = /* @__PURE__ */ ((
|
|
4415
|
-
class
|
|
4447
|
+
var ws = /* @__PURE__ */ ((n) => (n.LastOrder = "last_order", n.Contacts = "contacts", n.PartnerGroups = "partner_groups", n.PreferredDeliveryType = "preferred_delivery_type", n.SalesDirection = "sales_direction", n.Managers = "managers", n.Curators = "curators", n))(ws || {}), V = /* @__PURE__ */ ((n) => (n.Person = "individual", n.Ic = "entrepreneur", n.UlR = "legal", n.UlNr = "non_resident_legal", n))(V || {});
|
|
4448
|
+
class Cr extends G {
|
|
4416
4449
|
/**
|
|
4417
4450
|
* Инициализирует экземпляр класса {@link BankAccount}.
|
|
4418
4451
|
*
|
|
@@ -4494,10 +4527,10 @@ class se extends Dr {
|
|
|
4494
4527
|
* Дата и время последнего удаления.
|
|
4495
4528
|
*/
|
|
4496
4529
|
s(this, "deletedAt");
|
|
4497
|
-
this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1, this.position = e == null ? void 0 : e.position, this.notDisturb = (e == null ? void 0 : e.notDisturb) ?? !1, this.comment = e == null ? void 0 : e.comment, this.updatedAt = e == null ? void 0 : e.updatedAt, this.deletedAt =
|
|
4530
|
+
this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1, this.position = e == null ? void 0 : e.position, this.notDisturb = (e == null ? void 0 : e.notDisturb) ?? !1, this.comment = e == null ? void 0 : e.comment, this.updatedAt = e == null ? void 0 : e.updatedAt, this.deletedAt = R(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
4498
4531
|
}
|
|
4499
4532
|
}
|
|
4500
|
-
class ie extends
|
|
4533
|
+
class ie extends D {
|
|
4501
4534
|
/**
|
|
4502
4535
|
* Возвращает сгенерированную запись-описание физического лица.
|
|
4503
4536
|
*/
|
|
@@ -4510,9 +4543,9 @@ class ie extends R {
|
|
|
4510
4543
|
});
|
|
4511
4544
|
}
|
|
4512
4545
|
}
|
|
4513
|
-
class
|
|
4546
|
+
class Ce extends D {
|
|
4514
4547
|
}
|
|
4515
|
-
class
|
|
4548
|
+
class ft extends tt {
|
|
4516
4549
|
/**
|
|
4517
4550
|
* Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
|
|
4518
4551
|
*
|
|
@@ -4524,10 +4557,10 @@ class gt extends rt {
|
|
|
4524
4557
|
* Дата и время последнего удаления.
|
|
4525
4558
|
*/
|
|
4526
4559
|
s(this, "deletedAt");
|
|
4527
|
-
this.deletedAt =
|
|
4560
|
+
this.deletedAt = R(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
4528
4561
|
}
|
|
4529
4562
|
}
|
|
4530
|
-
class
|
|
4563
|
+
class mt extends ft {
|
|
4531
4564
|
/**
|
|
4532
4565
|
* Инициализирует экземпляр класса {@link ContragentBase}.
|
|
4533
4566
|
*
|
|
@@ -4543,7 +4576,7 @@ class ft extends gt {
|
|
|
4543
4576
|
/**
|
|
4544
4577
|
* Группа партнеров (направление деятельности).
|
|
4545
4578
|
*/
|
|
4546
|
-
s(this, "partnerGroup", new
|
|
4579
|
+
s(this, "partnerGroup", new Ce());
|
|
4547
4580
|
/**
|
|
4548
4581
|
* Список контактных лиц контрагента.
|
|
4549
4582
|
*/
|
|
@@ -4573,22 +4606,22 @@ class ft extends gt {
|
|
|
4573
4606
|
*/
|
|
4574
4607
|
s(this, "updater");
|
|
4575
4608
|
if (e) {
|
|
4576
|
-
if (this.opf = new ie(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt =
|
|
4609
|
+
if (this.opf = new ie(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = R(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e.createdAt, this.creator = e.creator ? new N(e.creator) : void 0, this.updater = e.updater ? new N(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new Ce(e.partnerGroup)), e.contacts) {
|
|
4577
4610
|
const t = [];
|
|
4578
|
-
e.contacts.forEach((
|
|
4579
|
-
t.push(new se(
|
|
4611
|
+
e.contacts.forEach((i) => {
|
|
4612
|
+
t.push(new se(i));
|
|
4580
4613
|
}), this.contacts = t;
|
|
4581
4614
|
}
|
|
4582
4615
|
if (e.bankAccounts) {
|
|
4583
4616
|
const t = [];
|
|
4584
|
-
e.bankAccounts.forEach((
|
|
4585
|
-
t.push(new
|
|
4617
|
+
e.bankAccounts.forEach((i) => {
|
|
4618
|
+
t.push(new Cr(i));
|
|
4586
4619
|
}), this.bankAccounts = t;
|
|
4587
4620
|
}
|
|
4588
4621
|
}
|
|
4589
4622
|
}
|
|
4590
4623
|
}
|
|
4591
|
-
class vs extends
|
|
4624
|
+
class vs extends mt {
|
|
4592
4625
|
/**
|
|
4593
4626
|
* Инициализирует экземпляр класса {@link ContragentPerson}.
|
|
4594
4627
|
*
|
|
@@ -4598,7 +4631,7 @@ class vs extends ft {
|
|
|
4598
4631
|
super(r);
|
|
4599
4632
|
}
|
|
4600
4633
|
}
|
|
4601
|
-
class
|
|
4634
|
+
class yt extends mt {
|
|
4602
4635
|
/**
|
|
4603
4636
|
* Инициализирует экземпляр класса {@link ContragentIc}.
|
|
4604
4637
|
*
|
|
@@ -4641,7 +4674,7 @@ class mt extends ft {
|
|
|
4641
4674
|
e && (this.inn = e.inn ?? "", this.okpo = e.okpo ?? "", this.directorName = e.directorName ?? "", this.directorPosition = e.directorPosition ?? "", this.directorActsOn = e.directorActsOn ?? "", this.legalAddress = e.legalAddress ?? "", this.postalAddress = e.postalAddress ?? "", this.actualAddress = e.actualAddress ?? "");
|
|
4642
4675
|
}
|
|
4643
4676
|
}
|
|
4644
|
-
class
|
|
4677
|
+
class at extends yt {
|
|
4645
4678
|
/**
|
|
4646
4679
|
* Инициализирует экземпляр класса {@link ContragentUlR}.
|
|
4647
4680
|
*
|
|
@@ -4656,7 +4689,7 @@ class yt extends mt {
|
|
|
4656
4689
|
e && (this.kpp = e.kpp ?? "");
|
|
4657
4690
|
}
|
|
4658
4691
|
}
|
|
4659
|
-
class
|
|
4692
|
+
class Rs extends at {
|
|
4660
4693
|
/**
|
|
4661
4694
|
* Инициализирует экземпляр класса {@link ContragentUlNr}.
|
|
4662
4695
|
*
|
|
@@ -4679,7 +4712,7 @@ class Cs extends yt {
|
|
|
4679
4712
|
e && (this.registrationCountry = new we(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
4680
4713
|
}
|
|
4681
4714
|
}
|
|
4682
|
-
class
|
|
4715
|
+
class Xe {
|
|
4683
4716
|
/**
|
|
4684
4717
|
* Инициализирует и возвращает экземпляр класса с данными о контрагенте.
|
|
4685
4718
|
*
|
|
@@ -4688,17 +4721,17 @@ class Ke {
|
|
|
4688
4721
|
static createInstance(r) {
|
|
4689
4722
|
switch (r.opf.slug) {
|
|
4690
4723
|
case V.Ic:
|
|
4691
|
-
return new mt(r);
|
|
4692
|
-
case V.UlR:
|
|
4693
4724
|
return new yt(r);
|
|
4725
|
+
case V.UlR:
|
|
4726
|
+
return new at(r);
|
|
4694
4727
|
case V.UlNr:
|
|
4695
|
-
return new
|
|
4728
|
+
return new Rs(r);
|
|
4696
4729
|
default:
|
|
4697
4730
|
return new vs(r);
|
|
4698
4731
|
}
|
|
4699
4732
|
}
|
|
4700
4733
|
}
|
|
4701
|
-
class _e extends
|
|
4734
|
+
class _e extends ft {
|
|
4702
4735
|
/**
|
|
4703
4736
|
* Инициализирует экземпляр класса {@link DeliveryAddress}.
|
|
4704
4737
|
*
|
|
@@ -4735,12 +4768,12 @@ class _e extends gt {
|
|
|
4735
4768
|
* Признак того, что указанный адрес является адресом транспортной компании.
|
|
4736
4769
|
*/
|
|
4737
4770
|
s(this, "isTransportCompanyAddress");
|
|
4738
|
-
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new
|
|
4771
|
+
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new it(e == null ? void 0 : e.coordinates), this.contacts = ((t = e == null ? void 0 : e.contacts) == null ? void 0 : t.map((i) => new se(i))) ?? [], this.comment = e == null ? void 0 : e.comment, this.operatingHours = e == null ? void 0 : e.operatingHours, this.isOneTime = e == null ? void 0 : e.isOneTime, this.isTransportCompanyAddress = e == null ? void 0 : e.isTransportCompanyAddress;
|
|
4739
4772
|
}
|
|
4740
4773
|
}
|
|
4741
|
-
class
|
|
4774
|
+
class wt extends D {
|
|
4742
4775
|
}
|
|
4743
|
-
class
|
|
4776
|
+
class vt extends D {
|
|
4744
4777
|
}
|
|
4745
4778
|
class jr extends oe {
|
|
4746
4779
|
/**
|
|
@@ -4750,7 +4783,7 @@ class jr extends oe {
|
|
|
4750
4783
|
*/
|
|
4751
4784
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
4752
4785
|
constructor(e) {
|
|
4753
|
-
var t,
|
|
4786
|
+
var t, i, o, c;
|
|
4754
4787
|
super(e);
|
|
4755
4788
|
/**
|
|
4756
4789
|
* @inheritDoc
|
|
@@ -4792,7 +4825,7 @@ class jr extends oe {
|
|
|
4792
4825
|
* @inheritDoc
|
|
4793
4826
|
*/
|
|
4794
4827
|
s(this, "extraData");
|
|
4795
|
-
this.contragents = ((t = e == null ? void 0 : e.contragents) == null ? void 0 : t.map((u) =>
|
|
4828
|
+
this.contragents = ((t = e == null ? void 0 : e.contragents) == null ? void 0 : t.map((u) => Xe.createInstance(u))) ?? [], this.partnerGroups = ((i = e == null ? void 0 : e.partnerGroups) == null ? void 0 : i.map((u) => new Ce(u))) ?? [], this.contacts = ((o = e == null ? void 0 : e.contacts) == null ? void 0 : o.map((u) => new se(u))) ?? [], this.deliveryAddresses = ((c = e == null ? void 0 : e.deliveryAddresses) == null ? void 0 : c.map((u) => new _e(u))) ?? [], this.channelPrimaryInterest = new wt(e == null ? void 0 : e.channelPrimaryInterest), this.sourcePrimaryInterest = new vt(e == null ? void 0 : e.sourcePrimaryInterest), this.preferredDeliveryType = new K(e == null ? void 0 : e.preferredDeliveryType), this.primaryDemand = e == null ? void 0 : e.primaryDemand, this.preferredWarehouse = e != null && e.preferredWarehouse ? new Me(e.preferredWarehouse) : void 0, this.extraData = (e == null ? void 0 : e.extraData) ?? {};
|
|
4796
4829
|
}
|
|
4797
4830
|
}
|
|
4798
4831
|
class gi extends Fe {
|
|
@@ -4802,7 +4835,7 @@ class gi extends Fe {
|
|
|
4802
4835
|
* @param data Данные для первоначальной инициализации.
|
|
4803
4836
|
*/
|
|
4804
4837
|
constructor(e) {
|
|
4805
|
-
var t,
|
|
4838
|
+
var t, i, o, c, u, p, g, a;
|
|
4806
4839
|
super();
|
|
4807
4840
|
/**
|
|
4808
4841
|
* @inheritDoc
|
|
@@ -4851,11 +4884,11 @@ class gi extends Fe {
|
|
|
4851
4884
|
/**
|
|
4852
4885
|
* @inheritDoc
|
|
4853
4886
|
*/
|
|
4854
|
-
s(this, "createdAt", new
|
|
4887
|
+
s(this, "createdAt", new b());
|
|
4855
4888
|
/**
|
|
4856
4889
|
* @inheritDoc
|
|
4857
4890
|
*/
|
|
4858
|
-
s(this, "lastLoginDate", new
|
|
4891
|
+
s(this, "lastLoginDate", new b());
|
|
4859
4892
|
/**
|
|
4860
4893
|
* @inheritDoc
|
|
4861
4894
|
*/
|
|
@@ -4907,12 +4940,12 @@ class gi extends Fe {
|
|
|
4907
4940
|
/**
|
|
4908
4941
|
* @inheritDoc
|
|
4909
4942
|
*/
|
|
4910
|
-
s(this, "noOrdersPeriod", new
|
|
4911
|
-
this.id = e == null ? void 0 : e.id, this.guid = e == null ? void 0 : e.guid, this.name = e == null ? void 0 : e.name, this.alternativeName = e == null ? void 0 : e.alternativeName, this.searchTerm = e == null ? void 0 : e.searchTerm, this.cities = (t = e == null ? void 0 : e.cities) == null ? void 0 : t.map((P) => new
|
|
4912
|
-
createdAt: new
|
|
4943
|
+
s(this, "noOrdersPeriod", new b());
|
|
4944
|
+
this.id = e == null ? void 0 : e.id, this.guid = e == null ? void 0 : e.guid, this.name = e == null ? void 0 : e.name, this.alternativeName = e == null ? void 0 : e.alternativeName, this.searchTerm = e == null ? void 0 : e.searchTerm, this.cities = (t = e == null ? void 0 : e.cities) == null ? void 0 : t.map((P) => new Re(P)), this.region = new ve(e == null ? void 0 : e.region), this.country = new we(e == null ? void 0 : e.country), this.phone = e == null ? void 0 : e.phone, this.email = e == null ? void 0 : e.email, this.isActive = e && Object.prototype.hasOwnProperty.call(e, "isActive") ? e == null ? void 0 : e.isActive : !0, this.createdAt = new b(e == null ? void 0 : e.createdAt), this.lastLoginDate = new b(e == null ? void 0 : e.lastLoginDate), this.lastLoginDateHasOrder = (e == null ? void 0 : e.lastLoginDateHasOrder) ?? void 0, this.managers = ((i = e == null ? void 0 : e.managers) == null ? void 0 : i.map((P) => new Z(P))) ?? [], this.includeSubordinateManagers = (e == null ? void 0 : e.includeSubordinateManagers) ?? !0, this.curators = ((o = e == null ? void 0 : e.curators) == null ? void 0 : o.map((P) => new xr(P))) ?? [], this.salesDirections = (c = e == null ? void 0 : e.salesDirections) == null ? void 0 : c.map((P) => new U(P)), this.contragentInn = e == null ? void 0 : e.contragentInn, this.contragentType = new ie(e == null ? void 0 : e.contragentType), this.preferredDeliveryType = e != null && e.preferredDeliveryType ? new K(e == null ? void 0 : e.preferredDeliveryType) : void 0, this.partnerGroups = (u = e == null ? void 0 : e.partnerGroups) == null ? void 0 : u.map((P) => new Ce(P)), this.contact = new Dr(e == null ? void 0 : e.contact), this.lastOrder = {
|
|
4945
|
+
createdAt: new b((p = e == null ? void 0 : e.lastOrder) == null ? void 0 : p.createdAt),
|
|
4913
4946
|
creator: (g = e == null ? void 0 : e.lastOrder) == null ? void 0 : g.creator,
|
|
4914
4947
|
isApproved: (a = e == null ? void 0 : e.lastOrder) == null ? void 0 : a.isApproved
|
|
4915
|
-
}, this.noOrdersPeriod = new
|
|
4948
|
+
}, this.noOrdersPeriod = new b(e == null ? void 0 : e.noOrdersPeriod);
|
|
4916
4949
|
}
|
|
4917
4950
|
/**
|
|
4918
4951
|
* @inheritDoc
|
|
@@ -4971,12 +5004,12 @@ class gi extends Fe {
|
|
|
4971
5004
|
* @inheritDoc
|
|
4972
5005
|
*/
|
|
4973
5006
|
asClearRaw() {
|
|
4974
|
-
var t,
|
|
5007
|
+
var t, i, o, c, u, p;
|
|
4975
5008
|
const e = super.asClearRaw();
|
|
4976
|
-
return !((t = e == null ? void 0 : e.createdAt) != null && t.from) && !((
|
|
5009
|
+
return !((t = e == null ? void 0 : e.createdAt) != null && t.from) && !((i = e == null ? void 0 : e.createdAt) != null && i.to) && delete e.createdAt, !((o = e == null ? void 0 : e.lastLoginDate) != null && o.from) && !((c = e == null ? void 0 : e.lastLoginDate) != null && c.to) && delete e.lastLoginDate, !((u = e == null ? void 0 : e.noOrdersPeriod) != null && u.from) && !((p = e == null ? void 0 : e.noOrdersPeriod) != null && p.to) && delete e.noOrdersPeriod, e;
|
|
4977
5010
|
}
|
|
4978
5011
|
}
|
|
4979
|
-
class
|
|
5012
|
+
class Rt extends G {
|
|
4980
5013
|
/**
|
|
4981
5014
|
* Инициализирует экземпляр класса {@link OrderShortInfo}.
|
|
4982
5015
|
*
|
|
@@ -4992,17 +5025,17 @@ class vt extends G {
|
|
|
4992
5025
|
* @inheritDoc
|
|
4993
5026
|
*/
|
|
4994
5027
|
s(this, "creator");
|
|
4995
|
-
this.createdAt =
|
|
5028
|
+
this.createdAt = R(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new N(e == null ? void 0 : e.creator);
|
|
4996
5029
|
}
|
|
4997
5030
|
}
|
|
4998
|
-
class
|
|
5031
|
+
class Cs extends L {
|
|
4999
5032
|
/**
|
|
5000
5033
|
* Инициализирует экземпляр класса {@link ClientAdditionalData}.
|
|
5001
5034
|
*
|
|
5002
5035
|
* @param data Данные для первоначальной инициализации.
|
|
5003
5036
|
*/
|
|
5004
5037
|
constructor(e) {
|
|
5005
|
-
var t,
|
|
5038
|
+
var t, i, o, c;
|
|
5006
5039
|
super(e);
|
|
5007
5040
|
/**
|
|
5008
5041
|
* @inheritDoc
|
|
@@ -5032,7 +5065,7 @@ class Rs extends L {
|
|
|
5032
5065
|
* @inheritDoc
|
|
5033
5066
|
*/
|
|
5034
5067
|
s(this, "curators");
|
|
5035
|
-
this.contacts = ((t = e.contacts) == null ? void 0 : t.map((u) => new se(u))) ?? void 0, this.lastOrder = e.lastOrder ? new
|
|
5068
|
+
this.contacts = ((t = e.contacts) == null ? void 0 : t.map((u) => new se(u))) ?? void 0, this.lastOrder = e.lastOrder ? new Rt(e.lastOrder) : void 0, this.partnerGroups = ((i = e.partnerGroups) == null ? void 0 : i.map((u) => new Ce(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new K(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new U(e.salesDirection) : void 0, this.managers = ((o = e.managers) == null ? void 0 : o.map((u) => new Lr(u))) ?? void 0, this.curators = ((c = e.curators) == null ? void 0 : c.map((u) => new xr(u))) ?? void 0;
|
|
5036
5069
|
}
|
|
5037
5070
|
}
|
|
5038
5071
|
class gr extends G {
|
|
@@ -5089,7 +5122,7 @@ class H extends Y {
|
|
|
5089
5122
|
return {
|
|
5090
5123
|
name: r.name,
|
|
5091
5124
|
alternative_name: r.alternativeName,
|
|
5092
|
-
partner_groups: r.partnerGroups.map((
|
|
5125
|
+
partner_groups: r.partnerGroups.map((i) => i.id),
|
|
5093
5126
|
phone: r.phone,
|
|
5094
5127
|
email: r.email,
|
|
5095
5128
|
city_id: r.city.id,
|
|
@@ -5108,7 +5141,7 @@ class H extends Y {
|
|
|
5108
5141
|
static transformContragentClientDataToRequest(r) {
|
|
5109
5142
|
var c, u, p, g;
|
|
5110
5143
|
let e;
|
|
5111
|
-
const t = r,
|
|
5144
|
+
const t = r, i = r, o = r;
|
|
5112
5145
|
switch (r.opf.slug) {
|
|
5113
5146
|
case V.Ic:
|
|
5114
5147
|
e = {
|
|
@@ -5129,20 +5162,20 @@ class H extends Y {
|
|
|
5129
5162
|
break;
|
|
5130
5163
|
case V.UlR:
|
|
5131
5164
|
e = {
|
|
5132
|
-
opf:
|
|
5133
|
-
name:
|
|
5134
|
-
alternative_name:
|
|
5135
|
-
partner_group_id: (u =
|
|
5136
|
-
comment:
|
|
5137
|
-
inn:
|
|
5138
|
-
kpp:
|
|
5139
|
-
okpo:
|
|
5140
|
-
director_name:
|
|
5141
|
-
director_position:
|
|
5142
|
-
director_acts_on:
|
|
5143
|
-
legal_address:
|
|
5144
|
-
postal_address:
|
|
5145
|
-
actual_address:
|
|
5165
|
+
opf: i.opf.slug,
|
|
5166
|
+
name: i.name,
|
|
5167
|
+
alternative_name: i.alternativeName,
|
|
5168
|
+
partner_group_id: (u = i.partnerGroup) == null ? void 0 : u.id,
|
|
5169
|
+
comment: i.comment,
|
|
5170
|
+
inn: i.inn,
|
|
5171
|
+
kpp: i.kpp,
|
|
5172
|
+
okpo: i.okpo,
|
|
5173
|
+
director_name: i.directorName,
|
|
5174
|
+
director_position: i.directorPosition,
|
|
5175
|
+
director_acts_on: i.directorActsOn,
|
|
5176
|
+
legal_address: i.legalAddress,
|
|
5177
|
+
postal_address: i.postalAddress,
|
|
5178
|
+
actual_address: i.actualAddress
|
|
5146
5179
|
};
|
|
5147
5180
|
break;
|
|
5148
5181
|
case V.UlNr:
|
|
@@ -5181,7 +5214,7 @@ class H extends Y {
|
|
|
5181
5214
|
* @param deliveryAddress Данные об адресе доставки клиенту.
|
|
5182
5215
|
*/
|
|
5183
5216
|
static transformClientDeliveryAddressToRequest(r) {
|
|
5184
|
-
var t,
|
|
5217
|
+
var t, i;
|
|
5185
5218
|
const e = {
|
|
5186
5219
|
address: r.address,
|
|
5187
5220
|
is_one_time: r.isOneTime ?? !1,
|
|
@@ -5190,7 +5223,7 @@ class H extends Y {
|
|
|
5190
5223
|
};
|
|
5191
5224
|
return r.coordinates && (e.coordinates = {
|
|
5192
5225
|
lat: (t = r.coordinates) == null ? void 0 : t.lat,
|
|
5193
|
-
long: (
|
|
5226
|
+
long: (i = r.coordinates) == null ? void 0 : i.long
|
|
5194
5227
|
}), r.operatingHours && (e.operating_hours = {
|
|
5195
5228
|
from: r.operatingHours.from,
|
|
5196
5229
|
to: r.operatingHours.to
|
|
@@ -5230,8 +5263,8 @@ class H extends Y {
|
|
|
5230
5263
|
*
|
|
5231
5264
|
* @see /doc/api/internal#/Клиенты/api_internal_client_get_list
|
|
5232
5265
|
*/
|
|
5233
|
-
getClientsList(r, e, t,
|
|
5234
|
-
return this.getTypedPaginated(oe, "/internal/clients", r, e, t,
|
|
5266
|
+
getClientsList(r, e, t, i, o = void 0) {
|
|
5267
|
+
return this.getTypedPaginated(oe, "/internal/clients", r, e, t, i, void 0, o);
|
|
5235
5268
|
}
|
|
5236
5269
|
/**
|
|
5237
5270
|
* Выполняет поиск клиентов по терму в строке.
|
|
@@ -5264,11 +5297,11 @@ class H extends Y {
|
|
|
5264
5297
|
* @see /doc/api/internal#/Клиенты/api_internal_client_get_additional_data_for_clients_list
|
|
5265
5298
|
*/
|
|
5266
5299
|
getAdditionalClientsData(r, e) {
|
|
5267
|
-
const t = r.map((
|
|
5300
|
+
const t = r.map((i) => i.id);
|
|
5268
5301
|
return this.post(
|
|
5269
5302
|
"/internal/clients/additional-data",
|
|
5270
5303
|
{ clients: t, requested_data_types: e },
|
|
5271
|
-
(
|
|
5304
|
+
(i) => _.instanceListInitializer(Cs, i.data)
|
|
5272
5305
|
);
|
|
5273
5306
|
}
|
|
5274
5307
|
/**
|
|
@@ -5322,7 +5355,7 @@ class H extends Y {
|
|
|
5322
5355
|
* @param validationFieldResultData Список полей, для которых необходимо установить данные об ошибках валидации в случае ошибок в запросах.
|
|
5323
5356
|
* @see /doc/api/internal#/Клиенты/api_internal_client_change
|
|
5324
5357
|
*/
|
|
5325
|
-
changeClientPassword(r, e, t,
|
|
5358
|
+
changeClientPassword(r, e, t, i = {}) {
|
|
5326
5359
|
return this.patch(
|
|
5327
5360
|
`/internal/clients/${r}`,
|
|
5328
5361
|
{
|
|
@@ -5330,7 +5363,7 @@ class H extends Y {
|
|
|
5330
5363
|
password_confirmation: t
|
|
5331
5364
|
},
|
|
5332
5365
|
void 0,
|
|
5333
|
-
|
|
5366
|
+
i
|
|
5334
5367
|
);
|
|
5335
5368
|
}
|
|
5336
5369
|
/**
|
|
@@ -5360,7 +5393,7 @@ class H extends Y {
|
|
|
5360
5393
|
* @see /doc/api/internal#/Клиенты/api_internal_client_manager_attach
|
|
5361
5394
|
*/
|
|
5362
5395
|
async attachClientToManagers(r, e) {
|
|
5363
|
-
const t = e.map((
|
|
5396
|
+
const t = e.map((i) => this.patch(`/internal/clients/${r}/managers/${i.id}/attach`, { is_primary: i.isDefault }));
|
|
5364
5397
|
await Promise.all(t);
|
|
5365
5398
|
}
|
|
5366
5399
|
/**
|
|
@@ -5372,7 +5405,7 @@ class H extends Y {
|
|
|
5372
5405
|
* @see /doc/api/internal#/Клиенты/api_internal_client_manager_detach
|
|
5373
5406
|
*/
|
|
5374
5407
|
async detachClientFromManagers(r, e) {
|
|
5375
|
-
const t = e.map((
|
|
5408
|
+
const t = e.map((i) => this.patch(`/internal/clients/${r}/managers/${i.id}/detach`));
|
|
5376
5409
|
await Promise.all(t);
|
|
5377
5410
|
}
|
|
5378
5411
|
/**
|
|
@@ -5428,7 +5461,7 @@ class H extends Y {
|
|
|
5428
5461
|
return this.post(
|
|
5429
5462
|
`/internal/clients/${r}/contragents`,
|
|
5430
5463
|
H.transformContragentClientDataToRequest(e),
|
|
5431
|
-
(
|
|
5464
|
+
(i) => Xe.createInstance(i.data),
|
|
5432
5465
|
t
|
|
5433
5466
|
);
|
|
5434
5467
|
}
|
|
@@ -5444,7 +5477,7 @@ class H extends Y {
|
|
|
5444
5477
|
return this.patch(
|
|
5445
5478
|
`/internal/clients/${r}/contragents/${e.id}`,
|
|
5446
5479
|
H.transformContragentClientDataToRequest(e),
|
|
5447
|
-
(
|
|
5480
|
+
(i) => Xe.createInstance(i.data),
|
|
5448
5481
|
t
|
|
5449
5482
|
);
|
|
5450
5483
|
}
|
|
@@ -5479,7 +5512,7 @@ class H extends Y {
|
|
|
5479
5512
|
return this.post(
|
|
5480
5513
|
`/internal/clients/${r}/delivery-addresses`,
|
|
5481
5514
|
H.transformClientDeliveryAddressToRequest(e),
|
|
5482
|
-
(
|
|
5515
|
+
(i) => new _e(i.data),
|
|
5483
5516
|
t
|
|
5484
5517
|
);
|
|
5485
5518
|
}
|
|
@@ -5495,7 +5528,7 @@ class H extends Y {
|
|
|
5495
5528
|
return this.patch(
|
|
5496
5529
|
`/internal/clients/${r}/delivery-addresses/${e.id}`,
|
|
5497
5530
|
H.transformClientDeliveryAddressToRequest(e),
|
|
5498
|
-
(
|
|
5531
|
+
(i) => new _e(i.data),
|
|
5499
5532
|
t
|
|
5500
5533
|
);
|
|
5501
5534
|
}
|
|
@@ -5518,12 +5551,12 @@ class H extends Y {
|
|
|
5518
5551
|
* @param validationFieldResultData Список полей, для которых необходимо установить данные об ошибках валидации в случае ошибок в запросах.
|
|
5519
5552
|
* @see /doc/api/internal#/Банковские реквизиты/api_internal_client_contragent_bank_accounts_create
|
|
5520
5553
|
*/
|
|
5521
|
-
createContragentBankAccount(r, e, t,
|
|
5554
|
+
createContragentBankAccount(r, e, t, i = {}) {
|
|
5522
5555
|
return this.post(
|
|
5523
5556
|
`/internal/clients/${r}/contragents/${e}/bank-accounts`,
|
|
5524
5557
|
H.transformClientContragentBankAccountToRequest(t),
|
|
5525
|
-
(o) => new
|
|
5526
|
-
|
|
5558
|
+
(o) => new Cr(o.data),
|
|
5559
|
+
i
|
|
5527
5560
|
);
|
|
5528
5561
|
}
|
|
5529
5562
|
/**
|
|
@@ -5535,12 +5568,12 @@ class H extends Y {
|
|
|
5535
5568
|
* @param validationFieldResultData Список полей, для которых необходимо установить данные об ошибках валидации в случае ошибок в запросах.
|
|
5536
5569
|
* @see /doc/api/internal#/Адреса доставки/api_internal_client_delivery_address_update
|
|
5537
5570
|
*/
|
|
5538
|
-
updateContragentBankAccount(r, e, t,
|
|
5571
|
+
updateContragentBankAccount(r, e, t, i = {}) {
|
|
5539
5572
|
return this.patch(
|
|
5540
5573
|
`/internal/clients/${r}/contragents/${e}/bank-accounts/${t.id}`,
|
|
5541
5574
|
H.transformClientContragentBankAccountToRequest(t),
|
|
5542
|
-
(o) => new
|
|
5543
|
-
|
|
5575
|
+
(o) => new Cr(o.data),
|
|
5576
|
+
i
|
|
5544
5577
|
);
|
|
5545
5578
|
}
|
|
5546
5579
|
/**
|
|
@@ -5595,7 +5628,7 @@ class H extends Y {
|
|
|
5595
5628
|
comment: e.comment,
|
|
5596
5629
|
not_disturb: e.notDisturb
|
|
5597
5630
|
},
|
|
5598
|
-
(
|
|
5631
|
+
(i) => new se(i.data),
|
|
5599
5632
|
t
|
|
5600
5633
|
);
|
|
5601
5634
|
}
|
|
@@ -5628,7 +5661,7 @@ class H extends Y {
|
|
|
5628
5661
|
* @param validationFieldResultData Список полей, для которых необходимо установить данные об ошибках валидации в случае ошибок в запросах.
|
|
5629
5662
|
* @see /doc/api/internal#/Контакты/api_internal_client_contact_create
|
|
5630
5663
|
*/
|
|
5631
|
-
createContragentContact(r, e, t,
|
|
5664
|
+
createContragentContact(r, e, t, i = {}) {
|
|
5632
5665
|
return this.createContact(
|
|
5633
5666
|
r,
|
|
5634
5667
|
t,
|
|
@@ -5641,7 +5674,7 @@ class H extends Y {
|
|
|
5641
5674
|
}
|
|
5642
5675
|
]
|
|
5643
5676
|
},
|
|
5644
|
-
|
|
5677
|
+
i
|
|
5645
5678
|
);
|
|
5646
5679
|
}
|
|
5647
5680
|
/**
|
|
@@ -5675,7 +5708,7 @@ class H extends Y {
|
|
|
5675
5708
|
* @param validationFieldResultData Список полей, для которых необходимо установить данные об ошибках валидации в случае ошибок в запросах.
|
|
5676
5709
|
* @see /doc/api/internal#/Контакты/api_internal_client_contact_create
|
|
5677
5710
|
*/
|
|
5678
|
-
createDeliveryAddressContact(r, e, t,
|
|
5711
|
+
createDeliveryAddressContact(r, e, t, i = {}) {
|
|
5679
5712
|
return this.createContact(
|
|
5680
5713
|
r,
|
|
5681
5714
|
t,
|
|
@@ -5688,7 +5721,7 @@ class H extends Y {
|
|
|
5688
5721
|
}
|
|
5689
5722
|
]
|
|
5690
5723
|
},
|
|
5691
|
-
|
|
5724
|
+
i
|
|
5692
5725
|
);
|
|
5693
5726
|
}
|
|
5694
5727
|
/**
|
|
@@ -5724,7 +5757,7 @@ class H extends Y {
|
|
|
5724
5757
|
* @param extraData Дополнительные данные
|
|
5725
5758
|
* @param validationFieldResultData Список полей, для которых необходимо установить данные об ошибках валидации в случае ошибок в запросах.
|
|
5726
5759
|
*/
|
|
5727
|
-
createContact(r, e, t,
|
|
5760
|
+
createContact(r, e, t, i = {}) {
|
|
5728
5761
|
var c, u;
|
|
5729
5762
|
const o = {
|
|
5730
5763
|
name: e.name,
|
|
@@ -5732,7 +5765,7 @@ class H extends Y {
|
|
|
5732
5765
|
comment: e.comment,
|
|
5733
5766
|
...t
|
|
5734
5767
|
};
|
|
5735
|
-
return (c = e.phone) != null && c.length && (o.phone = e.phone), (u = e.email) != null && u.length && (o.email = e.email), this.post(`/internal/clients/${r}/contacts`, o, (p) => new se(p.data),
|
|
5768
|
+
return (c = e.phone) != null && c.length && (o.phone = e.phone), (u = e.email) != null && u.length && (o.email = e.email), this.post(`/internal/clients/${r}/contacts`, o, (p) => new se(p.data), i);
|
|
5736
5769
|
}
|
|
5737
5770
|
/**
|
|
5738
5771
|
* Устанавливает признак основного контактного лица.
|
|
@@ -5769,8 +5802,8 @@ class fi extends h {
|
|
|
5769
5802
|
*/
|
|
5770
5803
|
checkPhoneIsBusy(r) {
|
|
5771
5804
|
return new Promise((e, t) => {
|
|
5772
|
-
this.request({ method: "GET", url: "/public/user/verification/phone/check", params: { phone: r } }).then((
|
|
5773
|
-
e(!!
|
|
5805
|
+
this.request({ method: "GET", url: "/public/user/verification/phone/check", params: { phone: r } }).then((i) => {
|
|
5806
|
+
e(!!i.isBusy);
|
|
5774
5807
|
}).catch(t);
|
|
5775
5808
|
});
|
|
5776
5809
|
}
|
|
@@ -5794,10 +5827,10 @@ class mi {
|
|
|
5794
5827
|
* Текущая версия приложения.
|
|
5795
5828
|
*/
|
|
5796
5829
|
s(this, "version");
|
|
5797
|
-
this.date =
|
|
5830
|
+
this.date = R(r == null ? void 0 : r.date) ? C(r.date) : (r == null ? void 0 : r.date) ?? /* @__PURE__ */ new Date(), this.name = (r == null ? void 0 : r.name) ?? "", this.version = (r == null ? void 0 : r.version) ?? "0.0.0";
|
|
5798
5831
|
}
|
|
5799
5832
|
}
|
|
5800
|
-
var Ts = /* @__PURE__ */ ((
|
|
5833
|
+
var Ts = /* @__PURE__ */ ((n) => (n.Kozyrek = "kozyrek", n.Mosquitto = "mosquitto", n.Strip = "strip", n.MetalForDoors = "metal_for_doors", n.Sandwich = "sandwich", n.SandwichM2 = "sandwich_m2", n))(Ts || {});
|
|
5801
5834
|
class yi extends h {
|
|
5802
5835
|
/**
|
|
5803
5836
|
* Возвращает настройки указанного конфигуратора для указанной категории.
|
|
@@ -5823,16 +5856,16 @@ class yi extends h {
|
|
|
5823
5856
|
*
|
|
5824
5857
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_categories_configurator_products_get
|
|
5825
5858
|
*/
|
|
5826
|
-
searchProduct(r, e, t,
|
|
5859
|
+
searchProduct(r, e, t, i = {}) {
|
|
5827
5860
|
var o;
|
|
5828
5861
|
return this.request(
|
|
5829
5862
|
{
|
|
5830
5863
|
method: "GET",
|
|
5831
5864
|
url: `internal/catalog/categories/${r.id}/configurators/${(o = r.properties) == null ? void 0 : o.configurator}/product`,
|
|
5832
|
-
params: { client_id: e
|
|
5865
|
+
params: { params: t, client_id: e }
|
|
5833
5866
|
},
|
|
5834
5867
|
(c) => new q(c.data),
|
|
5835
|
-
|
|
5868
|
+
i
|
|
5836
5869
|
);
|
|
5837
5870
|
}
|
|
5838
5871
|
/**
|
|
@@ -5848,7 +5881,7 @@ class yi extends h {
|
|
|
5848
5881
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_categories_configurator_template_create
|
|
5849
5882
|
*/
|
|
5850
5883
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
5851
|
-
createTemplate(r, e, t,
|
|
5884
|
+
createTemplate(r, e, t, i = {}) {
|
|
5852
5885
|
var o;
|
|
5853
5886
|
return this.post(
|
|
5854
5887
|
`internal/catalog/categories/${r.id}/configurators/${(o = r.properties) == null ? void 0 : o.configurator}/template?client_id=${e}`,
|
|
@@ -5856,7 +5889,7 @@ class yi extends h {
|
|
|
5856
5889
|
// eslint-disable-next-line lodash/prefer-noop, @typescript-eslint/no-empty-function
|
|
5857
5890
|
() => {
|
|
5858
5891
|
},
|
|
5859
|
-
|
|
5892
|
+
i
|
|
5860
5893
|
);
|
|
5861
5894
|
}
|
|
5862
5895
|
/**
|
|
@@ -5870,8 +5903,8 @@ class yi extends h {
|
|
|
5870
5903
|
*/
|
|
5871
5904
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
5872
5905
|
removeTemplate(r, e, t) {
|
|
5873
|
-
var
|
|
5874
|
-
return this.delete(`internal/catalog/categories/${r.id}/configurators/${(
|
|
5906
|
+
var i;
|
|
5907
|
+
return this.delete(`internal/catalog/categories/${r.id}/configurators/${(i = r.properties) == null ? void 0 : i.configurator}/template/${t}?client_id=${e}`);
|
|
5875
5908
|
}
|
|
5876
5909
|
/**
|
|
5877
5910
|
* Выполняет расчет, через указанный конфигуратор с переданными параметрами.
|
|
@@ -5883,8 +5916,8 @@ class yi extends h {
|
|
|
5883
5916
|
* @see /doc/api/internal#/Каталог/api_public_catalog_categories_category_configurator_calculate
|
|
5884
5917
|
*/
|
|
5885
5918
|
calculate(r, e, t) {
|
|
5886
|
-
var
|
|
5887
|
-
return this.get(`internal/catalog/categories/${r.id}/configurators/${(
|
|
5919
|
+
var i;
|
|
5920
|
+
return this.get(`internal/catalog/categories/${r.id}/configurators/${(i = r.properties) == null ? void 0 : i.configurator}/calculate`, {
|
|
5888
5921
|
client_id: e,
|
|
5889
5922
|
...t
|
|
5890
5923
|
});
|
|
@@ -5974,8 +6007,8 @@ class y {
|
|
|
5974
6007
|
* @param shift Смещение в декадах, может быть отрицательным.
|
|
5975
6008
|
*/
|
|
5976
6009
|
static shiftDecadeInterval(r, e) {
|
|
5977
|
-
const [t,
|
|
5978
|
-
return { from: t, to:
|
|
6010
|
+
const [t, i] = y.shiftedDecadeBounds(r, e);
|
|
6011
|
+
return { from: t, to: i };
|
|
5979
6012
|
}
|
|
5980
6013
|
/**
|
|
5981
6014
|
* Возвращает начало полугодия, в которое попадает указанная дата.
|
|
@@ -6012,8 +6045,8 @@ class y {
|
|
|
6012
6045
|
* @param date Опорная дата.
|
|
6013
6046
|
*/
|
|
6014
6047
|
static intervalTillSameDate(r, e, t) {
|
|
6015
|
-
const
|
|
6016
|
-
return { from: ge(e), to:
|
|
6048
|
+
const i = zt(E(t), E(r)), o = E($(e, i)), c = Math.min(qr(t), Wt(o));
|
|
6049
|
+
return { from: ge(e), to: z(jt(o, c)) };
|
|
6017
6050
|
}
|
|
6018
6051
|
/**
|
|
6019
6052
|
* Возвращает интервал «сдвинутая неделя до такого же дня недели»; недели начинаются с понедельника.
|
|
@@ -6022,8 +6055,8 @@ class y {
|
|
|
6022
6055
|
* @param shiftWeeks Смещение в неделях, может быть отрицательным.
|
|
6023
6056
|
*/
|
|
6024
6057
|
static weekTillSameWeekday(r, e) {
|
|
6025
|
-
const t = ee(ar(r, e), { weekStartsOn: 1 }),
|
|
6026
|
-
return { from: t, to:
|
|
6058
|
+
const t = ee(ar(r, e), { weekStartsOn: 1 }), i = We(r, ee(r, { weekStartsOn: 1 }));
|
|
6059
|
+
return { from: t, to: z(re(t, i)) };
|
|
6027
6060
|
}
|
|
6028
6061
|
/**
|
|
6029
6062
|
* Возвращает интервал «сдвинутая декада до такого же номера дня»; если в целевой декаде дня с таким
|
|
@@ -6033,8 +6066,8 @@ class y {
|
|
|
6033
6066
|
* @param shift Смещение в декадах, может быть отрицательным.
|
|
6034
6067
|
*/
|
|
6035
6068
|
static decadeTillSameDayNumber(r, e) {
|
|
6036
|
-
const [t] = y.shiftedDecadeBounds(r, 0),
|
|
6037
|
-
return { from: o, to:
|
|
6069
|
+
const [t] = y.shiftedDecadeBounds(r, 0), i = We(r, t) + 1, [o, c] = y.shiftedDecadeBounds(r, e), u = We(c, o) + 1;
|
|
6070
|
+
return { from: o, to: z(re(o, Math.min(i, u) - 1)) };
|
|
6038
6071
|
}
|
|
6039
6072
|
/**
|
|
6040
6073
|
* Возвращает пару «начало и конец декады», отстоящей от декады указанной даты на заданное число декад.
|
|
@@ -6044,9 +6077,9 @@ class y {
|
|
|
6044
6077
|
*/
|
|
6045
6078
|
static shiftedDecadeBounds(r, e) {
|
|
6046
6079
|
const t = qr(r);
|
|
6047
|
-
let
|
|
6048
|
-
t <= 10 ?
|
|
6049
|
-
const o =
|
|
6080
|
+
let i = 2;
|
|
6081
|
+
t <= 10 ? i = 0 : t <= 20 && (i = 1);
|
|
6082
|
+
const o = i + e, c = Math.floor(o / 3), u = (o % 3 + 3) % 3, p = E($(r, c)), g = re(p, u * 10), a = u === 2 ? x(p) : z(re(g, 9));
|
|
6050
6083
|
return [g, a];
|
|
6051
6084
|
}
|
|
6052
6085
|
}
|
|
@@ -6060,56 +6093,56 @@ class Tr {
|
|
|
6060
6093
|
static parse(r) {
|
|
6061
6094
|
if (m(r))
|
|
6062
6095
|
return;
|
|
6063
|
-
const e =
|
|
6096
|
+
const e = R(r) ? C(r) : r;
|
|
6064
6097
|
return Gt(e) ? e : void 0;
|
|
6065
6098
|
}
|
|
6066
6099
|
}
|
|
6067
|
-
function vi(
|
|
6068
|
-
return k(
|
|
6100
|
+
function vi(n) {
|
|
6101
|
+
return k(je(qe(), n), "yyyy-MM-dd");
|
|
6069
6102
|
}
|
|
6070
|
-
function
|
|
6071
|
-
const e = [2, 0, 1, 1, 1, 2], t = Math.floor(Math.abs(
|
|
6103
|
+
function As(n, r) {
|
|
6104
|
+
const e = [2, 0, 1, 1, 1, 2], t = Math.floor(Math.abs(n));
|
|
6072
6105
|
return r[t % 100 > 4 && t % 100 < 20 ? 2 : e[Math.min(t % 10, 5)]];
|
|
6073
6106
|
}
|
|
6074
|
-
function
|
|
6075
|
-
const r = C(
|
|
6107
|
+
function Ri(n) {
|
|
6108
|
+
const r = C(n), e = We(qe(), r);
|
|
6076
6109
|
switch (!0) {
|
|
6077
6110
|
case e === 0:
|
|
6078
6111
|
return "Сегодня";
|
|
6079
6112
|
case e === 1:
|
|
6080
6113
|
return "Вчера";
|
|
6081
6114
|
case e < 0:
|
|
6082
|
-
return
|
|
6115
|
+
return n;
|
|
6083
6116
|
default:
|
|
6084
|
-
return `${e} ${
|
|
6117
|
+
return `${e} ${As(e, ["день", "дня", "дней"])} назад`;
|
|
6085
6118
|
}
|
|
6086
6119
|
}
|
|
6087
|
-
class
|
|
6120
|
+
class Ci {
|
|
6088
6121
|
/**
|
|
6089
6122
|
* Возвращает предустановленные диапазоны дат.
|
|
6090
6123
|
*
|
|
6091
6124
|
* @param year Год, от которого считаются годовые периоды (1/3/9 месяцев, кварталы, полугодия, год); по умолчанию текущий.
|
|
6092
6125
|
*/
|
|
6093
6126
|
static defaultDateRanges(r) {
|
|
6094
|
-
const e = Yt(/* @__PURE__ */ new Date(), 1), t = /* @__PURE__ */ new Date(),
|
|
6127
|
+
const e = Yt(/* @__PURE__ */ new Date(), 1), t = /* @__PURE__ */ new Date(), i = ue(r === void 0 ? t : new Date(r, 0, 1)), o = de(i);
|
|
6095
6128
|
return {
|
|
6096
6129
|
// 'Следующий рабочий день' - это значение по-умолчанию
|
|
6097
|
-
nextWorkingDay: { label: "Следующий рабочий день", from: ge(e), to:
|
|
6130
|
+
nextWorkingDay: { label: "Следующий рабочий день", from: ge(e), to: z(e) },
|
|
6098
6131
|
today: { label: "Сегодня", from: qe(), to: Xt() },
|
|
6099
6132
|
yesterday: { label: "Вчера", from: Kt(), to: Jt() },
|
|
6100
6133
|
tomorrow: { label: "Завтра", from: Vt(), to: Qt() },
|
|
6101
6134
|
currentWeek: { label: "Неделя", from: ee(t, { weekStartsOn: 1 }), to: $e(t, { weekStartsOn: 1 }) },
|
|
6102
6135
|
currentMonth: { label: "Месяц", from: E(t), to: x(t) },
|
|
6103
|
-
oneMonth: { label: "1 месяц", from:
|
|
6104
|
-
threeMonths: { label: "3 месяца", from:
|
|
6105
|
-
nineMonths: { label: "9 месяцев", from:
|
|
6106
|
-
firstQuarter: { label: "I квартал", from:
|
|
6107
|
-
secondQuarter: { label: "II квартал", from: $(
|
|
6108
|
-
thirdQuarter: { label: "III квартал", from: $(
|
|
6109
|
-
fourthQuarter: { label: "IV квартал", from: $(
|
|
6110
|
-
firstHalfYear: { label: "I полугодие", from:
|
|
6111
|
-
secondHalfYear: { label: "II полугодие", from: $(
|
|
6112
|
-
currentYear: { label: "12 месяцев", from:
|
|
6136
|
+
oneMonth: { label: "1 месяц", from: i, to: x(i) },
|
|
6137
|
+
threeMonths: { label: "3 месяца", from: i, to: x($(i, 2)) },
|
|
6138
|
+
nineMonths: { label: "9 месяцев", from: i, to: x($(i, 8)) },
|
|
6139
|
+
firstQuarter: { label: "I квартал", from: i, to: x($(i, 2)) },
|
|
6140
|
+
secondQuarter: { label: "II квартал", from: $(i, 3), to: x($(i, 5)) },
|
|
6141
|
+
thirdQuarter: { label: "III квартал", from: $(i, 6), to: x($(i, 8)) },
|
|
6142
|
+
fourthQuarter: { label: "IV квартал", from: $(i, 9), to: x($(i, 11)) },
|
|
6143
|
+
firstHalfYear: { label: "I полугодие", from: i, to: x($(i, 5)) },
|
|
6144
|
+
secondHalfYear: { label: "II полугодие", from: $(i, 6), to: o },
|
|
6145
|
+
currentYear: { label: "12 месяцев", from: i, to: o }
|
|
6113
6146
|
};
|
|
6114
6147
|
}
|
|
6115
6148
|
/**
|
|
@@ -6120,23 +6153,23 @@ class Ri {
|
|
|
6120
6153
|
* @param now Опорная дата «сейчас»; по умолчанию текущая.
|
|
6121
6154
|
*/
|
|
6122
6155
|
static standardPeriods(r = /* @__PURE__ */ new Date()) {
|
|
6123
|
-
const e = { weekStartsOn: 1 }, t = ge(r),
|
|
6156
|
+
const e = { weekStartsOn: 1 }, t = ge(r), i = z(r), o = y.decadeInterval(r), c = E(r), u = ke(r), p = y.startOfHalfYear(r), g = ue(r), a = y.addHalfYears(r, -1), P = y.addHalfYears(r, 1);
|
|
6124
6157
|
return {
|
|
6125
|
-
yesterday: { label: "Вчера", group: "day", from: ge(
|
|
6126
|
-
today: { label: "Сегодня", group: "day", from: t, to:
|
|
6127
|
-
tomorrow: { label: "Завтра", group: "day", from: ge(re(r, 1)), to:
|
|
6158
|
+
yesterday: { label: "Вчера", group: "day", from: ge(je(r, 1)), to: z(je(r, 1)) },
|
|
6159
|
+
today: { label: "Сегодня", group: "day", from: t, to: i },
|
|
6160
|
+
tomorrow: { label: "Завтра", group: "day", from: ge(re(r, 1)), to: z(re(r, 1)) },
|
|
6128
6161
|
lastWeek: { label: "Прошлая неделя", group: "week", from: ee(Er(r, 1), e), to: $e(Er(r, 1), e) },
|
|
6129
6162
|
thisWeek: { label: "Эта неделя", group: "week", from: ee(r, e), to: $e(r, e) },
|
|
6130
6163
|
nextWeek: { label: "Следующая неделя", group: "week", from: ee(ar(r, 1), e), to: $e(ar(r, 1), e) },
|
|
6131
6164
|
lastTenDays: { label: "Прошлая декада", group: "decade", ...y.shiftDecadeInterval(r, -1) },
|
|
6132
6165
|
thisTenDays: { label: "Эта декада", group: "decade", ...o },
|
|
6133
6166
|
nextTenDays: { label: "Следующая декада", group: "decade", ...y.shiftDecadeInterval(r, 1) },
|
|
6134
|
-
lastMonth: { label: "Прошлый месяц", group: "month", from: E(
|
|
6167
|
+
lastMonth: { label: "Прошлый месяц", group: "month", from: E(lr(r, 1)), to: x(lr(r, 1)) },
|
|
6135
6168
|
thisMonth: { label: "Этот месяц", group: "month", from: c, to: x(r) },
|
|
6136
6169
|
nextMonth: { label: "Следующий месяц", group: "month", from: E($(r, 1)), to: x($(r, 1)) },
|
|
6137
|
-
lastQuarter: { label: "Прошлый квартал", group: "quarter", from: ke(
|
|
6170
|
+
lastQuarter: { label: "Прошлый квартал", group: "quarter", from: ke(cr(r, 1)), to: Be(cr(r, 1)) },
|
|
6138
6171
|
thisQuarter: { label: "Этот квартал", group: "quarter", from: u, to: Be(r) },
|
|
6139
|
-
nextQuarter: { label: "Следующий квартал", group: "quarter", from: ke(
|
|
6172
|
+
nextQuarter: { label: "Следующий квартал", group: "quarter", from: ke(nr(r, 1)), to: Be(nr(r, 1)) },
|
|
6140
6173
|
lastHalfYear: {
|
|
6141
6174
|
label: "Прошлое полугодие",
|
|
6142
6175
|
group: "halfYear",
|
|
@@ -6145,15 +6178,15 @@ class Ri {
|
|
|
6145
6178
|
},
|
|
6146
6179
|
thisHalfYear: { label: "Это полугодие", group: "halfYear", from: p, to: y.endOfHalfYear(r) },
|
|
6147
6180
|
nextHalfYear: { label: "Следующее полугодие", group: "halfYear", from: y.startOfHalfYear(P), to: y.endOfHalfYear(P) },
|
|
6148
|
-
lastYear: { label: "Прошлый год", group: "year", from: ue(
|
|
6181
|
+
lastYear: { label: "Прошлый год", group: "year", from: ue(or(r, 1)), to: de(or(r, 1)) },
|
|
6149
6182
|
thisYear: { label: "Этот год", group: "year", from: g, to: de(r) },
|
|
6150
|
-
nextYear: { label: "Следующий год", group: "year", from: ue(
|
|
6151
|
-
fromBeginningOfThisWeek: { label: "С начала этой недели", group: "other", section: "fromBeginning", from: ee(r, e), to:
|
|
6152
|
-
fromBeginningOfThisTenDays: { label: "С начала этой декады", group: "other", section: "fromBeginning", from: o.from, to:
|
|
6153
|
-
fromBeginningOfThisMonth: { label: "С начала этого месяца", group: "other", section: "fromBeginning", from: c, to:
|
|
6154
|
-
fromBeginningOfThisQuarter: { label: "С начала этого квартала", group: "other", section: "fromBeginning", from: u, to:
|
|
6155
|
-
fromBeginningOfThisHalfYear: { label: "С начала этого полугодия", group: "other", section: "fromBeginning", from: p, to:
|
|
6156
|
-
fromBeginningOfThisYear: { label: "С начала этого года", group: "other", section: "fromBeginning", from: g, to:
|
|
6183
|
+
nextYear: { label: "Следующий год", group: "year", from: ue(ir(r, 1)), to: de(ir(r, 1)) },
|
|
6184
|
+
fromBeginningOfThisWeek: { label: "С начала этой недели", group: "other", section: "fromBeginning", from: ee(r, e), to: i },
|
|
6185
|
+
fromBeginningOfThisTenDays: { label: "С начала этой декады", group: "other", section: "fromBeginning", from: o.from, to: i },
|
|
6186
|
+
fromBeginningOfThisMonth: { label: "С начала этого месяца", group: "other", section: "fromBeginning", from: c, to: i },
|
|
6187
|
+
fromBeginningOfThisQuarter: { label: "С начала этого квартала", group: "other", section: "fromBeginning", from: u, to: i },
|
|
6188
|
+
fromBeginningOfThisHalfYear: { label: "С начала этого полугодия", group: "other", section: "fromBeginning", from: p, to: i },
|
|
6189
|
+
fromBeginningOfThisYear: { label: "С начала этого года", group: "other", section: "fromBeginning", from: g, to: i },
|
|
6157
6190
|
tillEndOfThisWeek: { label: "До конца этой недели", group: "other", section: "tillEnd", from: t, to: $e(r, e) },
|
|
6158
6191
|
tillEndOfThisTenDays: { label: "До конца этой декады", group: "other", section: "tillEnd", from: t, to: o.to },
|
|
6159
6192
|
tillEndOfThisMonth: { label: "До конца этого месяца", group: "other", section: "tillEnd", from: t, to: x(r) },
|
|
@@ -6171,13 +6204,13 @@ class Ri {
|
|
|
6171
6204
|
label: "Прошлый месяц, до такой же даты",
|
|
6172
6205
|
group: "other",
|
|
6173
6206
|
section: "lastTillSame",
|
|
6174
|
-
...y.intervalTillSameDate(c, E(
|
|
6207
|
+
...y.intervalTillSameDate(c, E(lr(r, 1)), r)
|
|
6175
6208
|
},
|
|
6176
6209
|
lastQuarterTillSameDate: {
|
|
6177
6210
|
label: "Прошлый квартал, до такой же даты",
|
|
6178
6211
|
group: "other",
|
|
6179
6212
|
section: "lastTillSame",
|
|
6180
|
-
...y.intervalTillSameDate(u, ke(
|
|
6213
|
+
...y.intervalTillSameDate(u, ke(cr(r, 1)), r)
|
|
6181
6214
|
},
|
|
6182
6215
|
lastHalfYearTillSameDate: {
|
|
6183
6216
|
label: "Прошлое полугодие, до такой же даты",
|
|
@@ -6189,7 +6222,7 @@ class Ri {
|
|
|
6189
6222
|
label: "Прошлый год, до такой же даты",
|
|
6190
6223
|
group: "other",
|
|
6191
6224
|
section: "lastTillSame",
|
|
6192
|
-
...y.intervalTillSameDate(g, ue(
|
|
6225
|
+
...y.intervalTillSameDate(g, ue(or(r, 1)), r)
|
|
6193
6226
|
},
|
|
6194
6227
|
nextWeekTillSameWeekDay: { label: "Следующая неделя, до такого же дня недели", group: "other", section: "nextTillSame", ...y.weekTillSameWeekday(r, 1) },
|
|
6195
6228
|
nextTenDaysTillSameDayNumber: {
|
|
@@ -6208,7 +6241,7 @@ class Ri {
|
|
|
6208
6241
|
label: "Следующий квартал, до такой же даты",
|
|
6209
6242
|
group: "other",
|
|
6210
6243
|
section: "nextTillSame",
|
|
6211
|
-
...y.intervalTillSameDate(u, ke(
|
|
6244
|
+
...y.intervalTillSameDate(u, ke(nr(r, 1)), r)
|
|
6212
6245
|
},
|
|
6213
6246
|
nextHalfYearTillSameDate: {
|
|
6214
6247
|
label: "Следующее полугодие, до такой же даты",
|
|
@@ -6220,10 +6253,10 @@ class Ri {
|
|
|
6220
6253
|
label: "Следующий год, до такой же даты",
|
|
6221
6254
|
group: "other",
|
|
6222
6255
|
section: "nextTillSame",
|
|
6223
|
-
...y.intervalTillSameDate(g, ue(
|
|
6256
|
+
...y.intervalTillSameDate(g, ue(ir(r, 1)), r)
|
|
6224
6257
|
},
|
|
6225
|
-
last7Days: { label: "Последние 7 дней", group: "other", section: "rollingDays", from: ge(
|
|
6226
|
-
next7Days: { label: "Следующие 7 дней", group: "other", section: "rollingDays", from: t, to:
|
|
6258
|
+
last7Days: { label: "Последние 7 дней", group: "other", section: "rollingDays", from: ge(je(r, 6)), to: i },
|
|
6259
|
+
next7Days: { label: "Следующие 7 дней", group: "other", section: "rollingDays", from: t, to: z(re(r, 6)) }
|
|
6227
6260
|
};
|
|
6228
6261
|
}
|
|
6229
6262
|
}
|
|
@@ -6243,8 +6276,8 @@ const Di = [
|
|
|
6243
6276
|
{ key: "nextTillSame", label: "Следующие, до такой же даты" },
|
|
6244
6277
|
{ key: "rollingDays", label: "7 дней" }
|
|
6245
6278
|
];
|
|
6246
|
-
function Pi(
|
|
6247
|
-
const r = Mt(
|
|
6279
|
+
function Pi(n) {
|
|
6280
|
+
const r = Mt(n * 100);
|
|
6248
6281
|
return `${r >= 0 ? "+" : ""}${r}%`;
|
|
6249
6282
|
}
|
|
6250
6283
|
class Ct {
|
|
@@ -6271,8 +6304,8 @@ class Ct {
|
|
|
6271
6304
|
* @param product Данные о товаре для которого необходимо вернуть кратность длины.
|
|
6272
6305
|
*/
|
|
6273
6306
|
static getProductLengthMultiplicity(r) {
|
|
6274
|
-
var e, t,
|
|
6275
|
-
return ((e = r.properties) == null ? void 0 : e.lengthStep) != null ? r.properties.lengthStep : !((t = r.properties) != null && t.ignoreMinCountCheck) && ((
|
|
6307
|
+
var e, t, i;
|
|
6308
|
+
return ((e = r.properties) == null ? void 0 : e.lengthStep) != null ? r.properties.lengthStep : !((t = r.properties) != null && t.ignoreMinCountCheck) && ((i = r.properties) == null ? void 0 : i.minCount) != null ? r.properties.minCount : 0.01;
|
|
6276
6309
|
}
|
|
6277
6310
|
}
|
|
6278
6311
|
const ye = class ye extends h {
|
|
@@ -6322,9 +6355,9 @@ const ye = class ye extends h {
|
|
|
6322
6355
|
* @param signal Сигнал отмены запроса.
|
|
6323
6356
|
*/
|
|
6324
6357
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
6325
|
-
getTypedDataArrayRequester(e, t,
|
|
6326
|
-
const u = t + (J(o) ? "" : ` >>> ${JSON.stringify(o)}`), p =
|
|
6327
|
-
return p ? Promise.resolve(p) : this.getTypedList(e, t, o, !1, c).then((g) => (
|
|
6358
|
+
getTypedDataArrayRequester(e, t, i = !1, o = {}, c = void 0) {
|
|
6359
|
+
const u = t + (J(o) ? "" : ` >>> ${JSON.stringify(o)}`), p = i ? ye.getCachedResponse(u) : void 0;
|
|
6360
|
+
return p ? Promise.resolve(p) : this.getTypedList(e, t, o, !1, c).then((g) => (i && g && this.cacheResponse(u, g), g));
|
|
6328
6361
|
}
|
|
6329
6362
|
};
|
|
6330
6363
|
/**
|
|
@@ -6332,7 +6365,7 @@ const ye = class ye extends h {
|
|
|
6332
6365
|
*/
|
|
6333
6366
|
s(ye, "responseDataCache", /* @__PURE__ */ new Map());
|
|
6334
6367
|
let Ue = ye;
|
|
6335
|
-
class
|
|
6368
|
+
class Ai {
|
|
6336
6369
|
/**
|
|
6337
6370
|
* Генерирует и возвращает данные-заглушку неопределённого менеджера.
|
|
6338
6371
|
*/
|
|
@@ -6348,7 +6381,7 @@ class bi {
|
|
|
6348
6381
|
return r.id === 0 && r.guid === "-undefined-";
|
|
6349
6382
|
}
|
|
6350
6383
|
}
|
|
6351
|
-
class
|
|
6384
|
+
class Dt extends Ue {
|
|
6352
6385
|
/**
|
|
6353
6386
|
* Возвращает {@link Promise} для получения справочника списка менеджеров.
|
|
6354
6387
|
*/
|
|
@@ -6356,8 +6389,8 @@ class Rt extends Ue {
|
|
|
6356
6389
|
const r = "/internal/managers", e = Ue.getCachedResponse(r);
|
|
6357
6390
|
if (e)
|
|
6358
6391
|
return e;
|
|
6359
|
-
const t = await this.get(r),
|
|
6360
|
-
return this.cacheResponse(r,
|
|
6392
|
+
const t = await this.get(r), i = _.instanceListInitializer(Z, t.data);
|
|
6393
|
+
return this.cacheResponse(r, i), i;
|
|
6361
6394
|
}
|
|
6362
6395
|
/**
|
|
6363
6396
|
* Возвращает {@link Promise} для получения полных данных о менеджере с указанным идентификатором.
|
|
@@ -6370,8 +6403,8 @@ class Rt extends Ue {
|
|
|
6370
6403
|
return this.get(`/internal/managers/${r}`, {}, (e) => new Z(e.data));
|
|
6371
6404
|
}
|
|
6372
6405
|
}
|
|
6373
|
-
var xe = /* @__PURE__ */ ((
|
|
6374
|
-
class
|
|
6406
|
+
var xe = /* @__PURE__ */ ((n) => (n.Processing = "processing", n.Completed = "completed", n.Error = "error", n.NeedsActualization = "needs_actualization", n))(xe || {});
|
|
6407
|
+
class bs {
|
|
6375
6408
|
/**
|
|
6376
6409
|
* Инициализирует экземпляр класса {@link OfferActualization}.
|
|
6377
6410
|
*
|
|
@@ -6427,7 +6460,7 @@ class As {
|
|
|
6427
6460
|
return this.status === xe.Completed && !this.isOutdatedAt(r);
|
|
6428
6461
|
}
|
|
6429
6462
|
}
|
|
6430
|
-
class
|
|
6463
|
+
class Tt extends G {
|
|
6431
6464
|
/**
|
|
6432
6465
|
* Инициализирует экземпляр класса {@link OfferShortInfo}.
|
|
6433
6466
|
*
|
|
@@ -6463,7 +6496,7 @@ class Dt extends G {
|
|
|
6463
6496
|
* @inheritDoc
|
|
6464
6497
|
*/
|
|
6465
6498
|
s(this, "file");
|
|
6466
|
-
this.name = e == null ? void 0 : e.name, this.createdAt = Tr.parse(e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.client = new oe(e == null ? void 0 : e.client), this.sum = e == null ? void 0 : e.sum, this.isProfstroy = e == null ? void 0 : e.isProfstroy, this.actualization = (e == null ? void 0 : e.actualization) && new
|
|
6499
|
+
this.name = e == null ? void 0 : e.name, this.createdAt = Tr.parse(e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.client = new oe(e == null ? void 0 : e.client), this.sum = e == null ? void 0 : e.sum, this.isProfstroy = e == null ? void 0 : e.isProfstroy, this.actualization = (e == null ? void 0 : e.actualization) && new bs(e.actualization), this.file = e == null ? void 0 : e.file;
|
|
6467
6500
|
}
|
|
6468
6501
|
}
|
|
6469
6502
|
class Ss extends Or {
|
|
@@ -6505,7 +6538,7 @@ class Ss extends Or {
|
|
|
6505
6538
|
return !this.isProductStub && !this.isIgnored && J(this.lineError);
|
|
6506
6539
|
}
|
|
6507
6540
|
}
|
|
6508
|
-
class F extends
|
|
6541
|
+
class F extends Tt {
|
|
6509
6542
|
/**
|
|
6510
6543
|
* Инициализирует экземпляр класса {@link Offer}.
|
|
6511
6544
|
*
|
|
@@ -6526,7 +6559,7 @@ class F extends Dt {
|
|
|
6526
6559
|
);
|
|
6527
6560
|
}
|
|
6528
6561
|
}
|
|
6529
|
-
class
|
|
6562
|
+
class bi extends Fe {
|
|
6530
6563
|
/**
|
|
6531
6564
|
* Инициализирует экземпляр класса {@link OffersListFilters}.
|
|
6532
6565
|
*
|
|
@@ -6549,8 +6582,8 @@ class Ai extends Fe {
|
|
|
6549
6582
|
/**
|
|
6550
6583
|
* @inheritDoc
|
|
6551
6584
|
*/
|
|
6552
|
-
s(this, "createdAt", new
|
|
6553
|
-
this.id = e == null ? void 0 : e.id, this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.name = e == null ? void 0 : e.name, this.createdAt = new
|
|
6585
|
+
s(this, "createdAt", new b());
|
|
6586
|
+
this.id = e == null ? void 0 : e.id, this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.name = e == null ? void 0 : e.name, this.createdAt = new b(e == null ? void 0 : e.createdAt);
|
|
6554
6587
|
}
|
|
6555
6588
|
/**
|
|
6556
6589
|
* @inheritDoc
|
|
@@ -6562,21 +6595,21 @@ class Ai extends Fe {
|
|
|
6562
6595
|
* @inheritDoc
|
|
6563
6596
|
*/
|
|
6564
6597
|
asClearRaw() {
|
|
6565
|
-
var t,
|
|
6598
|
+
var t, i;
|
|
6566
6599
|
const e = super.asClearRaw();
|
|
6567
|
-
return !((t = e == null ? void 0 : e.createdAt) != null && t.from) && !((
|
|
6600
|
+
return !((t = e == null ? void 0 : e.createdAt) != null && t.from) && !((i = e == null ? void 0 : e.createdAt) != null && i.to) && delete e.createdAt, e;
|
|
6568
6601
|
}
|
|
6569
6602
|
}
|
|
6570
|
-
class
|
|
6603
|
+
class er extends D {
|
|
6571
6604
|
}
|
|
6572
|
-
class
|
|
6605
|
+
class Pt extends Rt {
|
|
6573
6606
|
/**
|
|
6574
6607
|
* Инициализирует экземпляр класса {@link OrderInfo}.
|
|
6575
6608
|
*
|
|
6576
6609
|
* @param data Данные для первоначальной инициализации.
|
|
6577
6610
|
*/
|
|
6578
6611
|
constructor(e) {
|
|
6579
|
-
var t,
|
|
6612
|
+
var t, i, o, c, u, p, g, a;
|
|
6580
6613
|
super(e);
|
|
6581
6614
|
/**
|
|
6582
6615
|
* @inheritDoc
|
|
@@ -6632,17 +6665,17 @@ class Tt extends vt {
|
|
|
6632
6665
|
s(this, "isLargeOrder");
|
|
6633
6666
|
this.client = new oe(e == null ? void 0 : e.client), this.payment = {
|
|
6634
6667
|
type: ((t = e == null ? void 0 : e.payment) == null ? void 0 : t.type) ?? -1,
|
|
6635
|
-
status: ((
|
|
6668
|
+
status: ((i = e == null ? void 0 : e.payment) == null ? void 0 : i.status) ?? -1,
|
|
6636
6669
|
onlinePaymentLink: (o = e == null ? void 0 : e.payment) == null ? void 0 : o.onlinePaymentLink
|
|
6637
6670
|
}, this.delivery = {
|
|
6638
6671
|
type: ((c = e == null ? void 0 : e.delivery) == null ? void 0 : c.type) ?? -1,
|
|
6639
|
-
date:
|
|
6672
|
+
date: R((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? C(e.delivery.date) : ((p = e == null ? void 0 : e.delivery) == null ? void 0 : p.date) ?? /* @__PURE__ */ new Date(),
|
|
6640
6673
|
address: (g = e == null ? void 0 : e.delivery) != null && g.address ? new _e(e.delivery.address) : void 0,
|
|
6641
6674
|
warehouse: (a = e == null ? void 0 : e.delivery) != null && a.warehouse ? new Me(e.delivery.warehouse) : void 0
|
|
6642
|
-
}, this.attachedUser = e != null && e.attachedUser ? new N(e == null ? void 0 : e.attachedUser) : void 0, this.status = new
|
|
6675
|
+
}, this.attachedUser = e != null && e.attachedUser ? new N(e == null ? void 0 : e.attachedUser) : void 0, this.status = new er(e == null ? void 0 : e.status), this.statusDetail = e != null && e.statusDetail ? new D(e.statusDetail) : void 0, this.salesDirection = new U(e == null ? void 0 : e.salesDirection), this.attachedAt = R(e == null ? void 0 : e.attachedAt) ? C(e.attachedAt) : e == null ? void 0 : e.attachedAt, this.isOnOrder = (e == null ? void 0 : e.isOnOrder) ?? !1, this.isProfstroy = (e == null ? void 0 : e.isProfstroy) ?? !1, this.isNotInStock = (e == null ? void 0 : e.isNotInStock) ?? !1, this.sum = (e == null ? void 0 : e.sum) ?? 0, this.isLargeOrder = (e == null ? void 0 : e.isLargeOrder) ?? !1;
|
|
6643
6676
|
}
|
|
6644
6677
|
}
|
|
6645
|
-
class ds extends
|
|
6678
|
+
class ds extends ot {
|
|
6646
6679
|
/**
|
|
6647
6680
|
* Инициализирует экземпляр класса {@link OrderItem}.
|
|
6648
6681
|
*
|
|
@@ -6699,10 +6732,10 @@ class ds extends nt {
|
|
|
6699
6732
|
* Продукт, которым заменена текущая запись.
|
|
6700
6733
|
*/
|
|
6701
6734
|
s(this, "replacement");
|
|
6702
|
-
this.product = new X(e.product), this.currency = new j(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing =
|
|
6735
|
+
this.product = new X(e.product), this.currency = new j(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = W(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, t && (this.replacement = t, this.quantity !== t.quantity && this.changedFields.push("quantity"), this.length !== t.length && this.changedFields.push("length"));
|
|
6703
6736
|
}
|
|
6704
6737
|
}
|
|
6705
|
-
class I extends
|
|
6738
|
+
class I extends Pt {
|
|
6706
6739
|
/**
|
|
6707
6740
|
* Инициализирует экземпляр класса {@link Order}.
|
|
6708
6741
|
*
|
|
@@ -6767,11 +6800,11 @@ class I extends Tt {
|
|
|
6767
6800
|
* @inheritDoc
|
|
6768
6801
|
*/
|
|
6769
6802
|
s(this, "numberDoc");
|
|
6770
|
-
this.products = (e.products ?? []).map((
|
|
6803
|
+
this.products = (e.products ?? []).map((i) => {
|
|
6771
6804
|
var c;
|
|
6772
|
-
const o =
|
|
6773
|
-
return new ds(
|
|
6774
|
-
}), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ?
|
|
6805
|
+
const o = i.replacementId ? (c = e.products) == null ? void 0 : c.find((u) => u.id === i.replacementId) : void 0;
|
|
6806
|
+
return new ds(i, o);
|
|
6807
|
+
}), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ? Xe.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new D(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment, this.nextStatuses = (t = e.nextStatuses) == null ? void 0 : t.map((i) => new er(i)), this.actions = e.actions, this.operatorsComment = e.operatorsComment, this.operatorsForWarehouseComment = e.operatorsForWarehouseComment, this.erpOrderUrl = e.erpOrderUrl, this.numberDoc = e.numberDoc;
|
|
6775
6808
|
}
|
|
6776
6809
|
}
|
|
6777
6810
|
class Si extends Y {
|
|
@@ -6785,8 +6818,8 @@ class Si extends Y {
|
|
|
6785
6818
|
*
|
|
6786
6819
|
* @see /doc/api/internal#/Заказы/api_internal_order_commercial_offer_get_list
|
|
6787
6820
|
*/
|
|
6788
|
-
getOffers(r, e, t,
|
|
6789
|
-
return this.getTypedPaginated(
|
|
6821
|
+
getOffers(r, e, t, i = void 0) {
|
|
6822
|
+
return this.getTypedPaginated(Tt, "/internal/orders/offers", r, e, t, {}, void 0, i);
|
|
6790
6823
|
}
|
|
6791
6824
|
/**
|
|
6792
6825
|
* Создаёт заказ-черновик из содержимого корзины клиента и возвращает данные созданной записи.
|
|
@@ -6805,7 +6838,7 @@ class Si extends Y {
|
|
|
6805
6838
|
name: e,
|
|
6806
6839
|
items: t != null && t.length ? t : void 0
|
|
6807
6840
|
},
|
|
6808
|
-
(
|
|
6841
|
+
(i) => new F(i.data)
|
|
6809
6842
|
);
|
|
6810
6843
|
}
|
|
6811
6844
|
/**
|
|
@@ -6820,8 +6853,8 @@ class Si extends Y {
|
|
|
6820
6853
|
*
|
|
6821
6854
|
* @see /doc/api/internal#/Заказы/api_internal_order_commercial_offer_create_profstroy
|
|
6822
6855
|
*/
|
|
6823
|
-
createProfstroyOffer(r, e, t,
|
|
6824
|
-
return this.post(`/internal/orders/offers/${r}/profstroy`, { file: e, name: t }, (o) => new F(o.data),
|
|
6856
|
+
createProfstroyOffer(r, e, t, i = {}) {
|
|
6857
|
+
return this.post(`/internal/orders/offers/${r}/profstroy`, { file: e, name: t }, (o) => new F(o.data), i);
|
|
6825
6858
|
}
|
|
6826
6859
|
/**
|
|
6827
6860
|
* Запускает актуализацию заказа-черновика, созданного из файла «Профстрой»: текущий состав записи
|
|
@@ -6889,7 +6922,7 @@ class Si extends Y {
|
|
|
6889
6922
|
*
|
|
6890
6923
|
* @see /doc/api/internal#/Заказы/api_internal_order_commercial_offer_create_order
|
|
6891
6924
|
*/
|
|
6892
|
-
createOrderFromDraft(r, e, t,
|
|
6925
|
+
createOrderFromDraft(r, e, t, i = {}) {
|
|
6893
6926
|
const o = O().config.dateFormats.api;
|
|
6894
6927
|
return this.post(
|
|
6895
6928
|
`/internal/orders/offers/${r}/create-order`,
|
|
@@ -6899,7 +6932,7 @@ class Si extends Y {
|
|
|
6899
6932
|
items: t != null && t.length ? t : void 0
|
|
6900
6933
|
},
|
|
6901
6934
|
(c) => _.instanceListInitializer(I, c.data),
|
|
6902
|
-
|
|
6935
|
+
i
|
|
6903
6936
|
);
|
|
6904
6937
|
}
|
|
6905
6938
|
/**
|
|
@@ -6927,7 +6960,7 @@ class Si extends Y {
|
|
|
6927
6960
|
is_additional_sale: e.isAdditionalSale,
|
|
6928
6961
|
...e.configuratorParams
|
|
6929
6962
|
},
|
|
6930
|
-
(
|
|
6963
|
+
(i) => new F(i.data),
|
|
6931
6964
|
t
|
|
6932
6965
|
);
|
|
6933
6966
|
}
|
|
@@ -6942,7 +6975,7 @@ class Si extends Y {
|
|
|
6942
6975
|
*
|
|
6943
6976
|
* @see /doc/api/internal#/Заказы/api_internal_order_commercial_offer_product_modify
|
|
6944
6977
|
*/
|
|
6945
|
-
patchOfferProduct(r, e, t,
|
|
6978
|
+
patchOfferProduct(r, e, t, i = {}) {
|
|
6946
6979
|
return this.patch(
|
|
6947
6980
|
`/internal/orders/offers/${r}/products/${e}`,
|
|
6948
6981
|
{
|
|
@@ -6958,7 +6991,7 @@ class Si extends Y {
|
|
|
6958
6991
|
...t.configuratorParams
|
|
6959
6992
|
},
|
|
6960
6993
|
(o) => new F(o.data),
|
|
6961
|
-
|
|
6994
|
+
i
|
|
6962
6995
|
);
|
|
6963
6996
|
}
|
|
6964
6997
|
/**
|
|
@@ -7029,7 +7062,7 @@ class di {
|
|
|
7029
7062
|
return !m(r) && r.isProfstroy === !0 && !m(r.actualization);
|
|
7030
7063
|
}
|
|
7031
7064
|
}
|
|
7032
|
-
var $s = /* @__PURE__ */ ((
|
|
7065
|
+
var $s = /* @__PURE__ */ ((n) => (n.View = "view", n.Share = "share", n.EditTags = "edit_tags", n.SaveOrderIgnoredProducts = "save_order_ignored_products", n.ChangeStatus = "change_status", n.ChangeProducts = "change_products", n.ChangeOrderParameters = "change_order_parameters", n.Recalculate = "recalculate", n.AttachOrder = "attach_order", n.DetachOrder = "detach_order", n.ChangeAttachedOperator = "change_attached_operator", n.SendOnlinePaymentLink = "send_online_payment_link", n.ConfirmOnlineFullPayment = "confirm_online_full_payment", n.MergeOrders = "merge_orders", n.GetHistory = "get_history", n.CloneOrder = "clone_order", n.DeleteAttachedFile = "delete_attached_file", n))($s || {});
|
|
7033
7066
|
class $i {
|
|
7034
7067
|
/**
|
|
7035
7068
|
* Инициализирует экземпляр класса {@link OrderEditorData}.
|
|
@@ -7093,13 +7126,13 @@ class $i {
|
|
|
7093
7126
|
* @inheritDoc
|
|
7094
7127
|
*/
|
|
7095
7128
|
s(this, "isAdditionalSale");
|
|
7096
|
-
var e, t,
|
|
7097
|
-
this.paymentType = r == null ? void 0 : r.payment.type, this.deliveryType = r == null ? void 0 : r.delivery.type, this.contragentId = (e = r == null ? void 0 : r.contragent) == null ? void 0 : e.id, this.deliveryDate = r != null && r.delivery.date ? new Date(r.delivery.date) : void 0, this.addressId = (t = r == null ? void 0 : r.delivery.address) == null ? void 0 : t.id, this.warehouseId = (
|
|
7129
|
+
var e, t, i;
|
|
7130
|
+
this.paymentType = r == null ? void 0 : r.payment.type, this.deliveryType = r == null ? void 0 : r.delivery.type, this.contragentId = (e = r == null ? void 0 : r.contragent) == null ? void 0 : e.id, this.deliveryDate = r != null && r.delivery.date ? new Date(r.delivery.date) : void 0, this.addressId = (t = r == null ? void 0 : r.delivery.address) == null ? void 0 : t.id, this.warehouseId = (i = r == null ? void 0 : r.delivery.warehouse) == null ? void 0 : i.id, this.comment = r == null ? void 0 : r.comment, this.barcode = r == null ? void 0 : r.barcode, this.operatorsComment = r == null ? void 0 : r.operatorsComment, this.operatorsForWarehouseComment = r == null ? void 0 : r.operatorsForWarehouseComment, this.isAllowProcessingWithoutPayment = r == null ? void 0 : r.isAllowProcessingWithoutPayment;
|
|
7098
7131
|
}
|
|
7099
7132
|
}
|
|
7100
|
-
class
|
|
7133
|
+
class At extends D {
|
|
7101
7134
|
}
|
|
7102
|
-
class bt extends
|
|
7135
|
+
class bt extends D {
|
|
7103
7136
|
}
|
|
7104
7137
|
class ki extends Fe {
|
|
7105
7138
|
/**
|
|
@@ -7108,7 +7141,7 @@ class ki extends Fe {
|
|
|
7108
7141
|
* @param data Данные для первоначальной инициализации.
|
|
7109
7142
|
*/
|
|
7110
7143
|
constructor(e) {
|
|
7111
|
-
var t,
|
|
7144
|
+
var t, i, o, c;
|
|
7112
7145
|
super();
|
|
7113
7146
|
/**
|
|
7114
7147
|
* @inheritDoc
|
|
@@ -7129,7 +7162,7 @@ class ki extends Fe {
|
|
|
7129
7162
|
/**
|
|
7130
7163
|
* @inheritDoc
|
|
7131
7164
|
*/
|
|
7132
|
-
s(this, "createdAt", new
|
|
7165
|
+
s(this, "createdAt", new b());
|
|
7133
7166
|
/**
|
|
7134
7167
|
* @inheritDoc
|
|
7135
7168
|
*/
|
|
@@ -7137,7 +7170,7 @@ class ki extends Fe {
|
|
|
7137
7170
|
/**
|
|
7138
7171
|
* @inheritDoc
|
|
7139
7172
|
*/
|
|
7140
|
-
s(this, "deliveryDate", new
|
|
7173
|
+
s(this, "deliveryDate", new b());
|
|
7141
7174
|
/**
|
|
7142
7175
|
* @inheritDoc
|
|
7143
7176
|
*/
|
|
@@ -7165,7 +7198,7 @@ class ki extends Fe {
|
|
|
7165
7198
|
/**
|
|
7166
7199
|
* @inheritDoc
|
|
7167
7200
|
*/
|
|
7168
|
-
s(this, "attachedAt", new
|
|
7201
|
+
s(this, "attachedAt", new b());
|
|
7169
7202
|
/**
|
|
7170
7203
|
* @inheritDoc
|
|
7171
7204
|
*/
|
|
@@ -7202,7 +7235,7 @@ class ki extends Fe {
|
|
|
7202
7235
|
* @inheritDoc
|
|
7203
7236
|
*/
|
|
7204
7237
|
s(this, "onlyMyRegions");
|
|
7205
|
-
this.attachedUsers = (t = e == null ? void 0 : e.attachedUsers) == null ? void 0 : t.map((u) => "isActive" in u ? new Z(u) : new
|
|
7238
|
+
this.attachedUsers = (t = e == null ? void 0 : e.attachedUsers) == null ? void 0 : t.map((u) => "isActive" in u ? new Z(u) : new At(u)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.client = e != null && e.client ? new oe(e.client) : void 0, this.contragent = e == null ? void 0 : e.contragent, this.createdAt = new b(e == null ? void 0 : e.createdAt), this.creator = e != null && e.creator ? new N(e.creator) : void 0, this.deliveryDate = new b(e == null ? void 0 : e.deliveryDate), this.deliveryAddressSearch = e == null ? void 0 : e.deliveryAddressSearch, this.clientCities = (i = e == null ? void 0 : e.clientCities) == null ? void 0 : i.map((u) => new Re(u)), this.id = e == null ? void 0 : e.id, this.isApproved = e == null ? void 0 : e.isApproved, this.isNotInStock = e == null ? void 0 : e.isNotInStock, this.isOnOrder = e == null ? void 0 : e.isOnOrder, this.isLargeOrder = e == null ? void 0 : e.isLargeOrder, this.attachedAt = new b(e == null ? void 0 : e.attachedAt), this.salesDirections = (o = e == null ? void 0 : e.salesDirections) == null ? void 0 : o.map((u) => new U(u)), this.status = e == null ? void 0 : e.status, this.statusDetail = e == null ? void 0 : e.statusDetail, this.deliveryType = e != null && e.deliveryType ? new K(e.deliveryType) : void 0, this.paymentType = e != null && e.paymentType ? new bt(e.paymentType) : void 0, this.warehouses = (c = e == null ? void 0 : e.warehouses) == null ? void 0 : c.map((u) => new Me(u)), this.isToProcess = e == null ? void 0 : e.isToProcess;
|
|
7206
7239
|
}
|
|
7207
7240
|
/**
|
|
7208
7241
|
* @inheritDoc
|
|
@@ -7248,9 +7281,9 @@ class ki extends Fe {
|
|
|
7248
7281
|
* @inheritDoc
|
|
7249
7282
|
*/
|
|
7250
7283
|
asClearRaw() {
|
|
7251
|
-
var t,
|
|
7284
|
+
var t, i, o, c, u, p;
|
|
7252
7285
|
const e = super.asClearRaw();
|
|
7253
|
-
return !((t = e == null ? void 0 : e.createdAt) != null && t.from) && !((
|
|
7286
|
+
return !((t = e == null ? void 0 : e.createdAt) != null && t.from) && !((i = e == null ? void 0 : e.createdAt) != null && i.to) && delete e.createdAt, !((o = e == null ? void 0 : e.deliveryDate) != null && o.from) && !((c = e == null ? void 0 : e.deliveryDate) != null && c.to) && delete e.deliveryDate, !((u = e == null ? void 0 : e.attachedAt) != null && u.from) && !((p = e == null ? void 0 : e.attachedAt) != null && p.to) && delete e.attachedAt, e;
|
|
7254
7287
|
}
|
|
7255
7288
|
}
|
|
7256
7289
|
class ks {
|
|
@@ -7276,7 +7309,7 @@ class ks {
|
|
|
7276
7309
|
* @inheritDoc
|
|
7277
7310
|
*/
|
|
7278
7311
|
s(this, "createdAt");
|
|
7279
|
-
this.user = new N(r == null ? void 0 : r.user), this.status = new
|
|
7312
|
+
this.user = new N(r == null ? void 0 : r.user), this.status = new er(r == null ? void 0 : r.status), this.statusDetail = r != null && r.statusDetail ? new D(r.statusDetail) : void 0, this.createdAt = R(r == null ? void 0 : r.createdAt) ? C(r.createdAt) : (r == null ? void 0 : r.createdAt) ?? /* @__PURE__ */ new Date();
|
|
7280
7313
|
}
|
|
7281
7314
|
}
|
|
7282
7315
|
class Oi extends Y {
|
|
@@ -7290,8 +7323,8 @@ class Oi extends Y {
|
|
|
7290
7323
|
*
|
|
7291
7324
|
* @see /doc/api/internal#/Заказы/api_internal_orders_get_list
|
|
7292
7325
|
*/
|
|
7293
|
-
getOrders(r, e, t,
|
|
7294
|
-
return this.getTypedPaginated(
|
|
7326
|
+
getOrders(r, e, t, i = void 0) {
|
|
7327
|
+
return this.getTypedPaginated(Pt, "/internal/orders", r, e, t, {}, void 0, i);
|
|
7295
7328
|
}
|
|
7296
7329
|
/**
|
|
7297
7330
|
* Возвращает количество заказов, соответствующих указанным фильтрам.
|
|
@@ -7344,14 +7377,14 @@ class Oi extends Y {
|
|
|
7344
7377
|
* в случае ошибок в запросах.
|
|
7345
7378
|
* @see /doc/api/internal#/operations/api_internal_client_orders_create
|
|
7346
7379
|
*/
|
|
7347
|
-
createClientOrder(r, e, t,
|
|
7380
|
+
createClientOrder(r, e, t, i, o = {}) {
|
|
7348
7381
|
const c = O().config.dateFormats.api;
|
|
7349
7382
|
return this.post(
|
|
7350
7383
|
`/internal/clients/${r}/orders/${e}`,
|
|
7351
7384
|
{
|
|
7352
7385
|
...t,
|
|
7353
7386
|
deliveryDate: k(t.deliveryDate, c),
|
|
7354
|
-
items:
|
|
7387
|
+
items: i != null && i.length ? i : void 0
|
|
7355
7388
|
},
|
|
7356
7389
|
(u) => _.instanceListInitializer(I, u.data),
|
|
7357
7390
|
o
|
|
@@ -7420,12 +7453,12 @@ class Oi extends Y {
|
|
|
7420
7453
|
* @see /doc/api/internal#/Заказы/api_internal_orders_update
|
|
7421
7454
|
*/
|
|
7422
7455
|
updateOrder(r, e, t = {}) {
|
|
7423
|
-
const
|
|
7456
|
+
const i = O().config.dateFormats.api;
|
|
7424
7457
|
return this.patch(
|
|
7425
7458
|
`/internal/orders/${r}`,
|
|
7426
7459
|
{
|
|
7427
7460
|
...e,
|
|
7428
|
-
deliveryDate: e.deliveryDate ? k(e.deliveryDate,
|
|
7461
|
+
deliveryDate: e.deliveryDate ? k(e.deliveryDate, i) : void 0
|
|
7429
7462
|
},
|
|
7430
7463
|
(o) => new I(o.data),
|
|
7431
7464
|
t
|
|
@@ -7457,7 +7490,7 @@ class Oi extends Y {
|
|
|
7457
7490
|
is_additional_sale: e.isAdditionalSale,
|
|
7458
7491
|
...e.configuratorParams
|
|
7459
7492
|
},
|
|
7460
|
-
(
|
|
7493
|
+
(i) => new I(i.data),
|
|
7461
7494
|
t
|
|
7462
7495
|
);
|
|
7463
7496
|
}
|
|
@@ -7473,7 +7506,7 @@ class Oi extends Y {
|
|
|
7473
7506
|
*
|
|
7474
7507
|
* @see /doc/api/internal#/Заказы/api_internal_orders_status_change
|
|
7475
7508
|
*/
|
|
7476
|
-
changeOrderStatus(r, e, t,
|
|
7509
|
+
changeOrderStatus(r, e, t, i = {}) {
|
|
7477
7510
|
return this.patch(
|
|
7478
7511
|
`/internal/orders/${r}/status`,
|
|
7479
7512
|
{
|
|
@@ -7481,7 +7514,7 @@ class Oi extends Y {
|
|
|
7481
7514
|
statusDetail: t
|
|
7482
7515
|
},
|
|
7483
7516
|
(o) => new I(o.data),
|
|
7484
|
-
|
|
7517
|
+
i
|
|
7485
7518
|
);
|
|
7486
7519
|
}
|
|
7487
7520
|
/**
|
|
@@ -7583,7 +7616,7 @@ class Oi extends Y {
|
|
|
7583
7616
|
*
|
|
7584
7617
|
* @see /doc/api/internal#/Заказы/api_internal_orders_product_update
|
|
7585
7618
|
*/
|
|
7586
|
-
patchOrderProduct(r, e, t,
|
|
7619
|
+
patchOrderProduct(r, e, t, i = {}) {
|
|
7587
7620
|
return this.patch(
|
|
7588
7621
|
`/internal/orders/${r}/products/${e}`,
|
|
7589
7622
|
{
|
|
@@ -7599,7 +7632,7 @@ class Oi extends Y {
|
|
|
7599
7632
|
...t.configuratorParams
|
|
7600
7633
|
},
|
|
7601
7634
|
(o) => new I(o.data),
|
|
7602
|
-
|
|
7635
|
+
i
|
|
7603
7636
|
);
|
|
7604
7637
|
}
|
|
7605
7638
|
/**
|
|
@@ -7632,7 +7665,7 @@ class Oi extends Y {
|
|
|
7632
7665
|
*
|
|
7633
7666
|
* @see /doc/api/internal#/operations/api_internal_orders_delivery_get_cost
|
|
7634
7667
|
*/
|
|
7635
|
-
getDeliveryCost(r, e, t,
|
|
7668
|
+
getDeliveryCost(r, e, t, i = void 0) {
|
|
7636
7669
|
const o = O().config.dateFormats.api;
|
|
7637
7670
|
return this.get(
|
|
7638
7671
|
`/internal/orders/delivery/${r}/cost`,
|
|
@@ -7642,7 +7675,7 @@ class Oi extends Y {
|
|
|
7642
7675
|
},
|
|
7643
7676
|
(c) => c.data,
|
|
7644
7677
|
void 0,
|
|
7645
|
-
|
|
7678
|
+
i
|
|
7646
7679
|
);
|
|
7647
7680
|
}
|
|
7648
7681
|
}
|
|
@@ -7677,22 +7710,22 @@ class fr {
|
|
|
7677
7710
|
this.client = new oe(r == null ? void 0 : r.client), this.product = new q(r == null ? void 0 : r.product), this.cost = (r == null ? void 0 : r.cost) ?? 0, this.costCoefficient = (r == null ? void 0 : r.costCoefficient) ?? 0, this.source = (r == null ? void 0 : r.source) ?? kr.Product;
|
|
7678
7711
|
}
|
|
7679
7712
|
}
|
|
7680
|
-
const mr = (
|
|
7681
|
-
var r, e, t,
|
|
7682
|
-
return
|
|
7713
|
+
const mr = (n) => {
|
|
7714
|
+
var r, e, t, i, o;
|
|
7715
|
+
return n ? et(
|
|
7683
7716
|
{
|
|
7684
|
-
cities: (r =
|
|
7685
|
-
clients: (e =
|
|
7686
|
-
managers: (t =
|
|
7687
|
-
partnerGroups: (
|
|
7688
|
-
salesDirections: (o =
|
|
7689
|
-
hideNotActive:
|
|
7717
|
+
cities: (r = n.cities) == null ? void 0 : r.map((c) => c.id),
|
|
7718
|
+
clients: (e = n.clients) == null ? void 0 : e.map((c) => c.id),
|
|
7719
|
+
managers: (t = n.managers) == null ? void 0 : t.map((c) => c.id),
|
|
7720
|
+
partnerGroups: (i = n.partnerGroups) == null ? void 0 : i.map((c) => c.id),
|
|
7721
|
+
salesDirections: (o = n.salesDirections) == null ? void 0 : o.map((c) => c.id),
|
|
7722
|
+
hideNotActive: n.hideNotActive
|
|
7690
7723
|
},
|
|
7691
|
-
(c) => m(c) || (
|
|
7724
|
+
(c) => m(c) || (W(c) || Ve(c)) && J(c)
|
|
7692
7725
|
) : {};
|
|
7693
|
-
}, Gr = (
|
|
7726
|
+
}, Gr = (n) => {
|
|
7694
7727
|
const r = {};
|
|
7695
|
-
return
|
|
7728
|
+
return n.from && (n.from.coefficient || n.from.value) && (r.from = {}, n.from.coefficient && (r.from.priceCoefficientId = n.from.coefficient.id), n.from.value && (r.from.increasePercent = n.from.value)), n.to && (n.to.coefficient || n.to.value) && (r.to = {}, n.to.coefficient && (r.to.priceCoefficientId = n.to.coefficient.id), n.to.value && (r.to.increasePercent = n.to.value)), r;
|
|
7696
7729
|
};
|
|
7697
7730
|
class Ii extends h {
|
|
7698
7731
|
/**
|
|
@@ -7711,7 +7744,7 @@ class Ii extends h {
|
|
|
7711
7744
|
...Gr(e),
|
|
7712
7745
|
filters: mr(t)
|
|
7713
7746
|
},
|
|
7714
|
-
(
|
|
7747
|
+
(i) => _.instanceListInitializer(fr, i.data)
|
|
7715
7748
|
);
|
|
7716
7749
|
}
|
|
7717
7750
|
/**
|
|
@@ -7730,7 +7763,7 @@ class Ii extends h {
|
|
|
7730
7763
|
...Gr(e),
|
|
7731
7764
|
filters: mr(t)
|
|
7732
7765
|
},
|
|
7733
|
-
(
|
|
7766
|
+
(i) => _.instanceListInitializer(fr, i.data)
|
|
7734
7767
|
);
|
|
7735
7768
|
}
|
|
7736
7769
|
/**
|
|
@@ -7751,7 +7784,7 @@ class Ii extends h {
|
|
|
7751
7784
|
...e,
|
|
7752
7785
|
filters: mr(t)
|
|
7753
7786
|
},
|
|
7754
|
-
(
|
|
7787
|
+
(i) => _.instanceListInitializer(fr, i.data)
|
|
7755
7788
|
);
|
|
7756
7789
|
}
|
|
7757
7790
|
}
|
|
@@ -7802,7 +7835,7 @@ class Os {
|
|
|
7802
7835
|
* @inheritDoc
|
|
7803
7836
|
*/
|
|
7804
7837
|
s(this, "currency");
|
|
7805
|
-
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate =
|
|
7838
|
+
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = R(r.costDate) ? C(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new Ee(r.product) : void 0, this.client = r.client ? new N(r.client) : void 0, this.executor = r.executor ? new N(r.executor) : void 0, this.currency = r.currency ? new j(r.currency) : void 0;
|
|
7806
7839
|
}
|
|
7807
7840
|
}
|
|
7808
7841
|
class Ls extends Ee {
|
|
@@ -7830,16 +7863,16 @@ class xi extends h {
|
|
|
7830
7863
|
*/
|
|
7831
7864
|
getProductPriceHistory(r) {
|
|
7832
7865
|
var o, c, u, p, g;
|
|
7833
|
-
const e = O().config.dateFormats.api, t =
|
|
7866
|
+
const e = O().config.dateFormats.api, t = et(
|
|
7834
7867
|
Ne(r, {
|
|
7835
7868
|
costDate: {
|
|
7836
|
-
from:
|
|
7837
|
-
to:
|
|
7869
|
+
from: Je((o = r.costDate) == null ? void 0 : o.from) ? k(r.costDate.from, e) : (c = r.costDate) == null ? void 0 : c.from,
|
|
7870
|
+
to: Je((u = r.costDate) == null ? void 0 : u.to) ? k(r.costDate.to, e) : (p = r.costDate) == null ? void 0 : p.to
|
|
7838
7871
|
}
|
|
7839
7872
|
}),
|
|
7840
|
-
(a) => m(a) || (
|
|
7841
|
-
),
|
|
7842
|
-
return delete t.product, this.get(`/internal/price/products/${
|
|
7873
|
+
(a) => m(a) || (W(a) || Ve(a)) && J(a)
|
|
7874
|
+
), i = ((g = r.product) == null ? void 0 : g[0]) ?? 0;
|
|
7875
|
+
return delete t.product, this.get(`/internal/price/products/${i}/history`, t).then((a) => [
|
|
7843
7876
|
new Ls(Ne(a[0], { history: a }))
|
|
7844
7877
|
]);
|
|
7845
7878
|
}
|
|
@@ -7908,12 +7941,12 @@ class _i extends h {
|
|
|
7908
7941
|
});
|
|
7909
7942
|
}
|
|
7910
7943
|
}
|
|
7911
|
-
var Is = /* @__PURE__ */ ((
|
|
7912
|
-
class _s extends
|
|
7944
|
+
var Is = /* @__PURE__ */ ((n) => (n.New = "new", n.Processing = "processing", n.AwaitingSupplyProducts = "awaiting_supply_products", n.InvoiceIssued = "invoice_issued", n.ProcessingOnStock = "processing_on_stock", n.Finished = "finished", n.OrderUpdated = "order_updated", n.Canceled = "canceled", n.Error = "error", n))(Is || {}), xs = /* @__PURE__ */ ((n) => (n.CanceledBy1c = "canceled_by1c", n.CanceledByClient = "canceled_by_client", n.FinishedNotApproved = "finished_not_approved", n.ProcessingByPurchasingDepartment = "processing_by_purchasing_department", n.WillWaiting = "will_waiting", n))(xs || {});
|
|
7945
|
+
class _s extends D {
|
|
7913
7946
|
}
|
|
7914
|
-
class Ns extends
|
|
7947
|
+
class Ns extends D {
|
|
7915
7948
|
}
|
|
7916
|
-
class Qr extends
|
|
7949
|
+
class Qr extends D {
|
|
7917
7950
|
/**
|
|
7918
7951
|
* Инициализирует экземпляр класса {@link CityWithUserRegion}.
|
|
7919
7952
|
*
|
|
@@ -7926,16 +7959,16 @@ class Qr extends R {
|
|
|
7926
7959
|
* @inheritDoc
|
|
7927
7960
|
*/
|
|
7928
7961
|
s(this, "userRegions");
|
|
7929
|
-
this.userRegions = ((t = e == null ? void 0 : e.userRegions) == null ? void 0 : t.map((
|
|
7962
|
+
this.userRegions = ((t = e == null ? void 0 : e.userRegions) == null ? void 0 : t.map((i) => new Ze(i))) ?? [];
|
|
7930
7963
|
}
|
|
7931
7964
|
}
|
|
7932
|
-
class qs extends
|
|
7965
|
+
class qs extends D {
|
|
7933
7966
|
}
|
|
7934
|
-
class Es extends
|
|
7967
|
+
class Es extends D {
|
|
7935
7968
|
}
|
|
7936
|
-
class Us extends
|
|
7969
|
+
class Us extends D {
|
|
7937
7970
|
}
|
|
7938
|
-
class Fs extends
|
|
7971
|
+
class Fs extends D {
|
|
7939
7972
|
}
|
|
7940
7973
|
class Ni {
|
|
7941
7974
|
/**
|
|
@@ -7956,7 +7989,7 @@ class Ni {
|
|
|
7956
7989
|
return r.id === 0 && r.slug === "-undefined-";
|
|
7957
7990
|
}
|
|
7958
7991
|
}
|
|
7959
|
-
class
|
|
7992
|
+
class St extends D {
|
|
7960
7993
|
}
|
|
7961
7994
|
const B = class B extends Ue {
|
|
7962
7995
|
/**
|
|
@@ -7983,7 +8016,7 @@ const B = class B extends Ue {
|
|
|
7983
8016
|
* первичного интереса.
|
|
7984
8017
|
*/
|
|
7985
8018
|
getChannelPrimaryInterest() {
|
|
7986
|
-
return this.getTypedDataArrayRequester(
|
|
8019
|
+
return this.getTypedDataArrayRequester(wt, "/internal/references/channel-primary-interest", !0);
|
|
7987
8020
|
}
|
|
7988
8021
|
/**
|
|
7989
8022
|
* Возвращает {@link Promise} для получения справочника должностей контактных лиц.
|
|
@@ -8008,7 +8041,7 @@ const B = class B extends Ue {
|
|
|
8008
8041
|
* групп партнеров (направлений деятельности).
|
|
8009
8042
|
*/
|
|
8010
8043
|
getPartnerGroup() {
|
|
8011
|
-
return this.getTypedDataArrayRequester(
|
|
8044
|
+
return this.getTypedDataArrayRequester(Ce, "/internal/references/partner-group", !0);
|
|
8012
8045
|
}
|
|
8013
8046
|
/**
|
|
8014
8047
|
* Возвращает {@link Promise} для получения справочника данных организационно-правовых форм.
|
|
@@ -8020,7 +8053,7 @@ const B = class B extends Ue {
|
|
|
8020
8053
|
* Возвращает {@link Promise} для получения справочника операторов.
|
|
8021
8054
|
*/
|
|
8022
8055
|
getOperators() {
|
|
8023
|
-
return this.getTypedDataArrayRequester(
|
|
8056
|
+
return this.getTypedDataArrayRequester(At, "/internal/references/operator", !0);
|
|
8024
8057
|
}
|
|
8025
8058
|
/**
|
|
8026
8059
|
* Возвращает {@link Promise} для получения справочника данных статусов оплаты заказов.
|
|
@@ -8032,7 +8065,7 @@ const B = class B extends Ue {
|
|
|
8032
8065
|
* Возвращает {@link Promise} для получения справочника данных статусов заказов.
|
|
8033
8066
|
*/
|
|
8034
8067
|
getOrderStatuses() {
|
|
8035
|
-
return this.getTypedDataArrayRequester(
|
|
8068
|
+
return this.getTypedDataArrayRequester(er, "/internal/references/order-status", !0);
|
|
8036
8069
|
}
|
|
8037
8070
|
/**
|
|
8038
8071
|
* Возвращает {@link Promise} для получения справочника детализирующих статусов (подстатусов) заказов.
|
|
@@ -8050,7 +8083,7 @@ const B = class B extends Ue {
|
|
|
8050
8083
|
* Возвращает {@link Promise} для получения справочника типов ресурсов.
|
|
8051
8084
|
*/
|
|
8052
8085
|
getResourceTypes() {
|
|
8053
|
-
return this.getTypedDataArrayRequester(
|
|
8086
|
+
return this.getTypedDataArrayRequester(St, "/internal/references/resource-type", !0);
|
|
8054
8087
|
}
|
|
8055
8088
|
/**
|
|
8056
8089
|
* Возвращает {@link Promise} для получения справочника данных направлений продаж.
|
|
@@ -8062,7 +8095,7 @@ const B = class B extends Ue {
|
|
|
8062
8095
|
* Возвращает {@link Promise} для получения справочника данных об источнике первичного интереса.
|
|
8063
8096
|
*/
|
|
8064
8097
|
getSourcePrimaryInterest() {
|
|
8065
|
-
return this.getTypedDataArrayRequester(
|
|
8098
|
+
return this.getTypedDataArrayRequester(vt, "/internal/references/source-primary-interest", !0);
|
|
8066
8099
|
}
|
|
8067
8100
|
/**
|
|
8068
8101
|
* Выполняет поиск данных о городах по терму в названии.
|
|
@@ -8070,7 +8103,7 @@ const B = class B extends Ue {
|
|
|
8070
8103
|
* @param term Терм поиска.
|
|
8071
8104
|
*/
|
|
8072
8105
|
searchCity(r) {
|
|
8073
|
-
return this.getTypedDataArrayRequester(
|
|
8106
|
+
return this.getTypedDataArrayRequester(Re, `/internal/references/city-with-region-and-country/search?term=${r}`);
|
|
8074
8107
|
}
|
|
8075
8108
|
/**
|
|
8076
8109
|
* Выполняет поиск данных о регионах по терму в названии.
|
|
@@ -8125,12 +8158,12 @@ const B = class B extends Ue {
|
|
|
8125
8158
|
*/
|
|
8126
8159
|
searchCityWithRegion(r, e, t = void 0) {
|
|
8127
8160
|
return this.getTypedDataArrayRequester(
|
|
8128
|
-
|
|
8161
|
+
Re,
|
|
8129
8162
|
"/internal/references/city-with-region/search",
|
|
8130
8163
|
!1,
|
|
8131
8164
|
{ term: r, ...e ? { params: { countryId: e } } : {} },
|
|
8132
8165
|
t
|
|
8133
|
-
).then((
|
|
8166
|
+
).then((i) => B.withoutUnknownLocation(i));
|
|
8134
8167
|
}
|
|
8135
8168
|
/**
|
|
8136
8169
|
* Выполняет поиск данных о городах по терму в названии с данными
|
|
@@ -8168,7 +8201,7 @@ const B = class B extends Ue {
|
|
|
8168
8201
|
* Возвращает {@link Promise} для получения справочника типов свойств.
|
|
8169
8202
|
*/
|
|
8170
8203
|
getPropertyTypes() {
|
|
8171
|
-
return this.getTypedDataArrayRequester(
|
|
8204
|
+
return this.getTypedDataArrayRequester(gt, "/internal/references/property-type", !0);
|
|
8172
8205
|
}
|
|
8173
8206
|
/**
|
|
8174
8207
|
* Возвращает {@link Promise} для получения справочника коэффициентов цен.
|
|
@@ -8190,12 +8223,12 @@ const B = class B extends Ue {
|
|
|
8190
8223
|
s(B, "unknownLocationId", 1);
|
|
8191
8224
|
let S = B;
|
|
8192
8225
|
const d = ne("common.references_private", () => {
|
|
8193
|
-
const
|
|
8226
|
+
const n = v({}), r = v(void 0), e = v(void 0), t = v(void 0), i = v(void 0), o = v(void 0), c = v(void 0), u = v(void 0), p = v(void 0), g = v(void 0), a = v(void 0), P = v(void 0), be = v(void 0), Se = v(void 0), ce = v(void 0), le = v(void 0), rr = v(void 0), tr = v(void 0), sr = v(void 0), l = v(void 0);
|
|
8194
8227
|
return {
|
|
8195
8228
|
/**
|
|
8196
8229
|
* Список загружаемых/загруженных на данный момент значений.
|
|
8197
8230
|
*/
|
|
8198
|
-
dataLoaderList:
|
|
8231
|
+
dataLoaderList: n,
|
|
8199
8232
|
/**
|
|
8200
8233
|
* Справочник каналов первичного интереса.
|
|
8201
8234
|
*/
|
|
@@ -8211,7 +8244,7 @@ const d = ne("common.references_private", () => {
|
|
|
8211
8244
|
/**
|
|
8212
8245
|
* Справочник типов доставки.
|
|
8213
8246
|
*/
|
|
8214
|
-
deliveryTypeReference:
|
|
8247
|
+
deliveryTypeReference: i,
|
|
8215
8248
|
/**
|
|
8216
8249
|
* Список менеджеров.
|
|
8217
8250
|
*/
|
|
@@ -8243,7 +8276,7 @@ const d = ne("common.references_private", () => {
|
|
|
8243
8276
|
/**
|
|
8244
8277
|
* Справочник групп партнеров.
|
|
8245
8278
|
*/
|
|
8246
|
-
partnerGroupReference:
|
|
8279
|
+
partnerGroupReference: be,
|
|
8247
8280
|
/**
|
|
8248
8281
|
* Справочник типов файлов продукктов/категорий.
|
|
8249
8282
|
*/
|
|
@@ -8259,112 +8292,112 @@ const d = ne("common.references_private", () => {
|
|
|
8259
8292
|
/**
|
|
8260
8293
|
* Справочник источников первичного интереса.
|
|
8261
8294
|
*/
|
|
8262
|
-
sourcePrimaryInterestReference:
|
|
8295
|
+
sourcePrimaryInterestReference: rr,
|
|
8263
8296
|
/**
|
|
8264
8297
|
* Справочник складов.
|
|
8265
8298
|
*/
|
|
8266
|
-
warehousesReference:
|
|
8299
|
+
warehousesReference: tr,
|
|
8267
8300
|
/**
|
|
8268
8301
|
* Справочник типов свойств.
|
|
8269
8302
|
*/
|
|
8270
|
-
propertyTypesReference:
|
|
8303
|
+
propertyTypesReference: sr,
|
|
8271
8304
|
/**
|
|
8272
8305
|
* Справочник коэффициентов цен.
|
|
8273
8306
|
*/
|
|
8274
8307
|
priceCoefficientsReference: l
|
|
8275
8308
|
};
|
|
8276
8309
|
}), qi = ne("common.references", () => {
|
|
8277
|
-
const
|
|
8310
|
+
const n = A(() => {
|
|
8278
8311
|
const l = d();
|
|
8279
8312
|
return !l.channelPrimaryInterestReference && !l.dataLoaderList.channelPrimaryInterestReference && (l.dataLoaderList.channelPrimaryInterestReference = !0, h.getInstance(S).getChannelPrimaryInterest().then((f) => {
|
|
8280
8313
|
l.channelPrimaryInterestReference = f;
|
|
8281
8314
|
}).catch(T)), l.channelPrimaryInterestReference;
|
|
8282
|
-
}), r =
|
|
8315
|
+
}), r = A(() => {
|
|
8283
8316
|
const l = d();
|
|
8284
8317
|
return !l.contactPositionsReference && !l.dataLoaderList.contactPositionsReference && (l.dataLoaderList.contactPositionsReference = !0, h.getInstance(S).getContactPositions().then((f) => {
|
|
8285
8318
|
l.contactPositionsReference = f;
|
|
8286
8319
|
}).catch(T)), l.contactPositionsReference;
|
|
8287
|
-
}), e =
|
|
8320
|
+
}), e = A(() => {
|
|
8288
8321
|
const l = d();
|
|
8289
8322
|
return !l.currencyReference && !l.dataLoaderList.currencyReference && (l.dataLoaderList.currencyReference = !0, h.getInstance(S).getCurrency().then((f) => {
|
|
8290
8323
|
l.currencyReference = f;
|
|
8291
8324
|
}).catch(T)), l.currencyReference;
|
|
8292
|
-
}), t =
|
|
8325
|
+
}), t = A(() => {
|
|
8293
8326
|
const l = d();
|
|
8294
8327
|
return !l.opfReference && !l.dataLoaderList.opfReference && (l.dataLoaderList.opfReference = !0, h.getInstance(S).getOpf().then((f) => {
|
|
8295
8328
|
l.opfReference = f;
|
|
8296
8329
|
}).catch(T)), l.opfReference;
|
|
8297
|
-
}),
|
|
8330
|
+
}), i = A(() => {
|
|
8298
8331
|
const l = d();
|
|
8299
8332
|
return !l.operatorReference && !l.dataLoaderList.operatorReference && (l.dataLoaderList.operatorReference = !0, h.getInstance(S).getOperators().then((f) => {
|
|
8300
8333
|
l.operatorReference = f;
|
|
8301
8334
|
}).catch(T)), l.operatorReference;
|
|
8302
|
-
}), o =
|
|
8335
|
+
}), o = A(() => {
|
|
8303
8336
|
const l = d();
|
|
8304
8337
|
return !l.orderPaymentStatusReference && !l.dataLoaderList.orderPaymentStatusReference && (l.dataLoaderList.orderPaymentStatusReference = !0, h.getInstance(S).getOrderPaymentStatuses().then((f) => {
|
|
8305
8338
|
l.orderPaymentStatusReference = f;
|
|
8306
8339
|
}).catch(T)), l.orderPaymentStatusReference;
|
|
8307
|
-
}), c =
|
|
8340
|
+
}), c = A(() => {
|
|
8308
8341
|
const l = d();
|
|
8309
8342
|
return !l.orderStatusReference && !l.dataLoaderList.orderStatusReference && (l.dataLoaderList.orderStatusReference = !0, h.getInstance(S).getOrderStatuses().then((f) => {
|
|
8310
8343
|
l.orderStatusReference = f;
|
|
8311
8344
|
}).catch(T)), l.orderStatusReference;
|
|
8312
|
-
}), u =
|
|
8345
|
+
}), u = A(() => {
|
|
8313
8346
|
const l = d();
|
|
8314
8347
|
return !l.orderStatusDetailReference && !l.dataLoaderList.orderStatusDetailReference && (l.dataLoaderList.orderStatusDetailReference = !0, h.getInstance(S).getOrderStatusDetails().then((f) => {
|
|
8315
8348
|
l.orderStatusDetailReference = f;
|
|
8316
8349
|
}).catch(T)), l.orderStatusDetailReference;
|
|
8317
|
-
}), p =
|
|
8350
|
+
}), p = A(() => {
|
|
8318
8351
|
const l = d();
|
|
8319
8352
|
return !l.paymentTypeReference && !l.dataLoaderList.paymentTypeReference && (l.dataLoaderList.paymentTypeReference = !0, h.getInstance(S).getPaymentTypes().then((f) => {
|
|
8320
8353
|
l.paymentTypeReference = f;
|
|
8321
8354
|
}).catch(T)), l.paymentTypeReference;
|
|
8322
|
-
}), g =
|
|
8355
|
+
}), g = A(() => {
|
|
8323
8356
|
const l = d();
|
|
8324
8357
|
return !l.partnerGroupReference && !l.dataLoaderList.partnerGroupReference && (l.dataLoaderList.partnerGroupReference = !0, h.getInstance(S).getPartnerGroup().then((f) => {
|
|
8325
8358
|
l.partnerGroupReference = f;
|
|
8326
8359
|
}).catch(T)), l.partnerGroupReference;
|
|
8327
|
-
}), a =
|
|
8360
|
+
}), a = A(() => {
|
|
8328
8361
|
const l = d();
|
|
8329
8362
|
return !l.productFileTypeReference && !l.dataLoaderList.productFileTypeReference && (l.dataLoaderList.productFileTypeReference = !0, h.getInstance(S).getProductFileType().then((f) => {
|
|
8330
8363
|
l.productFileTypeReference = f;
|
|
8331
8364
|
}).catch(T)), l.productFileTypeReference;
|
|
8332
|
-
}), P =
|
|
8365
|
+
}), P = A(() => {
|
|
8333
8366
|
const l = d();
|
|
8334
8367
|
return !l.resourceTypesReference && !l.dataLoaderList.resourceTypesReference && (l.dataLoaderList.resourceTypesReference = !0, h.getInstance(S).getResourceTypes().then((f) => {
|
|
8335
8368
|
l.resourceTypesReference = f;
|
|
8336
8369
|
}).catch(T)), l.resourceTypesReference;
|
|
8337
|
-
}),
|
|
8370
|
+
}), be = A(() => {
|
|
8338
8371
|
const l = d();
|
|
8339
8372
|
return !l.salesDirectionsReference && !l.dataLoaderList.salesDirectionsReference && (l.dataLoaderList.salesDirectionsReference = !0, h.getInstance(S).getSalesDirections().then((f) => {
|
|
8340
8373
|
l.salesDirectionsReference = f;
|
|
8341
8374
|
}).catch(T)), l.salesDirectionsReference;
|
|
8342
|
-
}), Se =
|
|
8375
|
+
}), Se = A(() => {
|
|
8343
8376
|
const l = d();
|
|
8344
8377
|
return !l.sourcePrimaryInterestReference && !l.dataLoaderList.sourcePrimaryInterestReference && (l.dataLoaderList.sourcePrimaryInterestReference = !0, h.getInstance(S).getSourcePrimaryInterest().then((f) => {
|
|
8345
8378
|
l.sourcePrimaryInterestReference = f;
|
|
8346
8379
|
}).catch(T)), l.sourcePrimaryInterestReference;
|
|
8347
|
-
}), ce =
|
|
8380
|
+
}), ce = A(() => {
|
|
8348
8381
|
const l = d();
|
|
8349
8382
|
return !l.deliveryTypeReference && !l.dataLoaderList.deliveryTypeReference && (l.dataLoaderList.deliveryTypeReference = !0, h.getInstance(S).getDeliveryTypes().then((f) => {
|
|
8350
8383
|
l.deliveryTypeReference = f;
|
|
8351
8384
|
}).catch(T)), l.deliveryTypeReference;
|
|
8352
|
-
}), le =
|
|
8385
|
+
}), le = A(() => {
|
|
8353
8386
|
const l = d();
|
|
8354
|
-
return !l.managersList && !l.dataLoaderList.managersList && (l.dataLoaderList.managersList = !0, h.getInstance(
|
|
8387
|
+
return !l.managersList && !l.dataLoaderList.managersList && (l.dataLoaderList.managersList = !0, h.getInstance(Dt).getManagers().then((f) => {
|
|
8355
8388
|
l.managersList = f;
|
|
8356
8389
|
}).catch(T)), l.managersList;
|
|
8357
|
-
}),
|
|
8390
|
+
}), rr = A(() => {
|
|
8358
8391
|
const l = d();
|
|
8359
8392
|
return !l.warehousesReference && !l.dataLoaderList.warehousesReference && (l.dataLoaderList.warehousesReference = !0, h.getInstance(S).getWarehouses().then((f) => {
|
|
8360
8393
|
l.warehousesReference = f;
|
|
8361
8394
|
}).catch(T)), l.warehousesReference;
|
|
8362
|
-
}),
|
|
8395
|
+
}), tr = A(() => {
|
|
8363
8396
|
const l = d();
|
|
8364
8397
|
return !l.propertyTypesReference && !l.dataLoaderList.propertyTypesReference && (l.dataLoaderList.propertyTypesReference = !0, h.getInstance(S).getPropertyTypes().then((f) => {
|
|
8365
8398
|
l.propertyTypesReference = f;
|
|
8366
8399
|
}).catch(T)), l.propertyTypesReference;
|
|
8367
|
-
}),
|
|
8400
|
+
}), sr = A(() => {
|
|
8368
8401
|
const l = d();
|
|
8369
8402
|
return !l.priceCoefficientsReference && !l.dataLoaderList.priceCoefficientsReference && (l.dataLoaderList.priceCoefficientsReference = !0, h.getInstance(S).getPriceCoefficients().then((f) => {
|
|
8370
8403
|
l.priceCoefficientsReference = f;
|
|
@@ -8374,7 +8407,7 @@ const d = ne("common.references_private", () => {
|
|
|
8374
8407
|
/**
|
|
8375
8408
|
* Справочник каналов первичного интереса.
|
|
8376
8409
|
*/
|
|
8377
|
-
channelPrimaryInterestsReference:
|
|
8410
|
+
channelPrimaryInterestsReference: n,
|
|
8378
8411
|
/**
|
|
8379
8412
|
* Справочник должностей контактных лиц.
|
|
8380
8413
|
*/
|
|
@@ -8390,7 +8423,7 @@ const d = ne("common.references_private", () => {
|
|
|
8390
8423
|
/**
|
|
8391
8424
|
* Справочник операторов.
|
|
8392
8425
|
*/
|
|
8393
|
-
operatorReference:
|
|
8426
|
+
operatorReference: i,
|
|
8394
8427
|
/**
|
|
8395
8428
|
* Справочник статусов оплаты заказа.
|
|
8396
8429
|
*/
|
|
@@ -8422,7 +8455,7 @@ const d = ne("common.references_private", () => {
|
|
|
8422
8455
|
/**
|
|
8423
8456
|
* Справочник направлений продаж.
|
|
8424
8457
|
*/
|
|
8425
|
-
salesDirectionsReference:
|
|
8458
|
+
salesDirectionsReference: be,
|
|
8426
8459
|
/**
|
|
8427
8460
|
* Справочник каналов первичного интереса.
|
|
8428
8461
|
*/
|
|
@@ -8438,15 +8471,15 @@ const d = ne("common.references_private", () => {
|
|
|
8438
8471
|
/**
|
|
8439
8472
|
* Справочник складов.
|
|
8440
8473
|
*/
|
|
8441
|
-
warehousesReference:
|
|
8474
|
+
warehousesReference: rr,
|
|
8442
8475
|
/**
|
|
8443
8476
|
* Справочник типов свойств.
|
|
8444
8477
|
*/
|
|
8445
|
-
propertyTypesReference:
|
|
8478
|
+
propertyTypesReference: tr,
|
|
8446
8479
|
/**
|
|
8447
8480
|
* Справочник коэффициентов цен.
|
|
8448
8481
|
*/
|
|
8449
|
-
priceCoefficientsReference:
|
|
8482
|
+
priceCoefficientsReference: sr
|
|
8450
8483
|
};
|
|
8451
8484
|
});
|
|
8452
8485
|
class Ms {
|
|
@@ -8507,7 +8540,7 @@ class Vr {
|
|
|
8507
8540
|
*/
|
|
8508
8541
|
s(this, "tags");
|
|
8509
8542
|
var e;
|
|
8510
|
-
this.resourceType = new
|
|
8543
|
+
this.resourceType = new St(r == null ? void 0 : r.resourceType), this.resourceId = (r == null ? void 0 : r.resourceId) ?? "", this.h1 = r == null ? void 0 : r.h1, this.title = r == null ? void 0 : r.title, this.description = r == null ? void 0 : r.description, this.keywords = r == null ? void 0 : r.keywords, this.meta = ((e = r == null ? void 0 : r.meta) == null ? void 0 : e.map((t) => new Ms(t))) ?? [], this.tags = r == null ? void 0 : r.tags;
|
|
8511
8544
|
}
|
|
8512
8545
|
}
|
|
8513
8546
|
class Ei extends h {
|
|
@@ -8580,16 +8613,16 @@ class Ui extends h {
|
|
|
8580
8613
|
*/
|
|
8581
8614
|
execSuggestionQuery(r, e) {
|
|
8582
8615
|
return this.get(r, { query: e }).then((t) => {
|
|
8583
|
-
const
|
|
8616
|
+
const i = [...t];
|
|
8584
8617
|
let o = 1;
|
|
8585
|
-
return
|
|
8618
|
+
return i.forEach((c) => {
|
|
8586
8619
|
c.id = o++;
|
|
8587
|
-
}),
|
|
8620
|
+
}), i;
|
|
8588
8621
|
});
|
|
8589
8622
|
}
|
|
8590
8623
|
}
|
|
8591
|
-
var
|
|
8592
|
-
class Hs extends
|
|
8624
|
+
var dt = /* @__PURE__ */ ((n) => (n.Admin = "admin", n.Manager = "manager", n.Operator = "operator", n.Client = "client", n.ExternalSeo = "external_seo", n.Guest = "guest", n))(dt || {});
|
|
8625
|
+
class Hs extends ht {
|
|
8593
8626
|
/**
|
|
8594
8627
|
* Инициализирует экземпляр класса {@link User}.
|
|
8595
8628
|
*
|
|
@@ -8613,7 +8646,7 @@ class Hs extends pt {
|
|
|
8613
8646
|
* Роль ценообразования текущего пользователя.
|
|
8614
8647
|
*/
|
|
8615
8648
|
s(this, "pricingRole");
|
|
8616
|
-
this.type = e == null ? void 0 : e.type, this.canDoReclamations = (e == null ? void 0 : e.canDoReclamations) ?? !1, this.photo = e == null ? void 0 : e.photo, this.pricingRole = e != null && e.pricingRole ? new
|
|
8649
|
+
this.type = e == null ? void 0 : e.type, this.canDoReclamations = (e == null ? void 0 : e.canDoReclamations) ?? !1, this.photo = e == null ? void 0 : e.photo, this.pricingRole = e != null && e.pricingRole ? new ut(e.pricingRole) : void 0;
|
|
8617
8650
|
}
|
|
8618
8651
|
}
|
|
8619
8652
|
class Fi extends h {
|
|
@@ -8642,12 +8675,12 @@ class Bs extends h {
|
|
|
8642
8675
|
}
|
|
8643
8676
|
}
|
|
8644
8677
|
const Pr = ne("common.user_state_private", () => {
|
|
8645
|
-
const
|
|
8678
|
+
const n = v({}), r = v(void 0), e = v(void 0);
|
|
8646
8679
|
return {
|
|
8647
8680
|
/**
|
|
8648
8681
|
* Список загружаемых/загруженных на данный момент значений.
|
|
8649
8682
|
*/
|
|
8650
|
-
dataLoaderList:
|
|
8683
|
+
dataLoaderList: n,
|
|
8651
8684
|
/**
|
|
8652
8685
|
* Данные о текущем пользователе.
|
|
8653
8686
|
*/
|
|
@@ -8658,35 +8691,35 @@ const Pr = ne("common.user_state_private", () => {
|
|
|
8658
8691
|
currentManager: e
|
|
8659
8692
|
};
|
|
8660
8693
|
});
|
|
8661
|
-
function Jr(
|
|
8694
|
+
function Jr(n) {
|
|
8662
8695
|
const r = Pr();
|
|
8663
|
-
(
|
|
8696
|
+
(n == null ? void 0 : n.type) !== dt.Manager || r.currentManager || r.dataLoaderList.currentManager || (r.dataLoaderList.currentManager = !0, h.getInstance(Dt).getManager(n.id).then((e) => {
|
|
8664
8697
|
r.currentManager = e;
|
|
8665
8698
|
}).catch(T).finally(() => {
|
|
8666
8699
|
r.dataLoaderList.currentManager = !1;
|
|
8667
8700
|
}));
|
|
8668
8701
|
}
|
|
8669
8702
|
const Mi = ne("common.user_state", () => {
|
|
8670
|
-
const
|
|
8703
|
+
const n = A(() => {
|
|
8671
8704
|
const e = Pr();
|
|
8672
8705
|
return !e.currentUser && !e.dataLoaderList.currentUser && (e.dataLoaderList.currentUser = !0, h.getInstance(Bs).getCurrentUser().then((t) => {
|
|
8673
8706
|
e.currentUser = t, Jr(t);
|
|
8674
8707
|
}).catch(T).finally(() => {
|
|
8675
8708
|
e.dataLoaderList.currentUser = !1;
|
|
8676
8709
|
})), e.currentUser;
|
|
8677
|
-
}), r =
|
|
8710
|
+
}), r = A(() => (Jr(n.value), Pr().currentManager));
|
|
8678
8711
|
return {
|
|
8679
8712
|
/**
|
|
8680
8713
|
* Данные о текущем пользователе.
|
|
8681
8714
|
*/
|
|
8682
|
-
currentUser:
|
|
8715
|
+
currentUser: n,
|
|
8683
8716
|
/**
|
|
8684
8717
|
* Данные о текущем менеджере (если текущий пользователь является менеджером).
|
|
8685
8718
|
*/
|
|
8686
8719
|
currentManager: r
|
|
8687
8720
|
};
|
|
8688
8721
|
});
|
|
8689
|
-
class
|
|
8722
|
+
class Ar {
|
|
8690
8723
|
/**
|
|
8691
8724
|
* Инициализирует экземпляр класса {@link UserRegionEmployee}.
|
|
8692
8725
|
*
|
|
@@ -8704,14 +8737,14 @@ class br {
|
|
|
8704
8737
|
this.user = new N(r == null ? void 0 : r.user), this.salesDirection = new U(r == null ? void 0 : r.salesDirection);
|
|
8705
8738
|
}
|
|
8706
8739
|
}
|
|
8707
|
-
class yr extends
|
|
8740
|
+
class yr extends Ze {
|
|
8708
8741
|
/**
|
|
8709
8742
|
* Инициализирует экземпляр класса {@link UserRegion}.
|
|
8710
8743
|
*
|
|
8711
8744
|
* @param data Данные для первоначальной инициализации.
|
|
8712
8745
|
*/
|
|
8713
8746
|
constructor(e) {
|
|
8714
|
-
var t,
|
|
8747
|
+
var t, i;
|
|
8715
8748
|
super(e);
|
|
8716
8749
|
/**
|
|
8717
8750
|
* @inheritDoc
|
|
@@ -8721,7 +8754,7 @@ class yr extends Xe {
|
|
|
8721
8754
|
* @inheritDoc
|
|
8722
8755
|
*/
|
|
8723
8756
|
s(this, "users");
|
|
8724
|
-
this.cities = ((t = e == null ? void 0 : e.cities) == null ? void 0 : t.map((o) => new
|
|
8757
|
+
this.cities = ((t = e == null ? void 0 : e.cities) == null ? void 0 : t.map((o) => new Re(o))) ?? [], this.users = ((i = e == null ? void 0 : e.users) == null ? void 0 : i.map((o) => new Ar(o))) ?? [];
|
|
8725
8758
|
}
|
|
8726
8759
|
}
|
|
8727
8760
|
class Hi extends Fe {
|
|
@@ -8771,7 +8804,7 @@ class Bi extends Y {
|
|
|
8771
8804
|
* @see /doc/api/internal#/operations/api_internal_user_region_get_list
|
|
8772
8805
|
*/
|
|
8773
8806
|
getRegionsList(r, e, t) {
|
|
8774
|
-
return this.getTypedPaginated(
|
|
8807
|
+
return this.getTypedPaginated(Ze, "/internal/users/regions", r, e, t);
|
|
8775
8808
|
}
|
|
8776
8809
|
/**
|
|
8777
8810
|
* Возвращает полные данные о регионе пользователей.
|
|
@@ -8808,7 +8841,7 @@ class Bi extends Y {
|
|
|
8808
8841
|
* @see /doc/api/internal#/operations/api_internal_user_region_change
|
|
8809
8842
|
*/
|
|
8810
8843
|
updateRegion(r, e, t = {}) {
|
|
8811
|
-
return this.patch(`/internal/users/regions/${r}`, e, (
|
|
8844
|
+
return this.patch(`/internal/users/regions/${r}`, e, (i) => new yr(i.data), t);
|
|
8812
8845
|
}
|
|
8813
8846
|
/**
|
|
8814
8847
|
* Удаляет регион пользователей.
|
|
@@ -8828,7 +8861,7 @@ class Bi extends Y {
|
|
|
8828
8861
|
* @see /doc/api/internal#/operations/api_internal_user_region_user_get_list
|
|
8829
8862
|
*/
|
|
8830
8863
|
getRegionEmployees(r) {
|
|
8831
|
-
return this.getTypedList(
|
|
8864
|
+
return this.getTypedList(Ar, `/internal/users/regions/${r}/users`);
|
|
8832
8865
|
}
|
|
8833
8866
|
/**
|
|
8834
8867
|
* Закрепляет сотрудника за регионом по указанному направлению продаж.
|
|
@@ -8840,7 +8873,7 @@ class Bi extends Y {
|
|
|
8840
8873
|
* @see /doc/api/internal#/operations/api_internal_user_region_user_add
|
|
8841
8874
|
*/
|
|
8842
8875
|
attachRegionEmployee(r, e, t) {
|
|
8843
|
-
return this.post(`/internal/users/regions/${r}/users/${e}`, { salesDirectionId: t }, (
|
|
8876
|
+
return this.post(`/internal/users/regions/${r}/users/${e}`, { salesDirectionId: t }, (i) => new Ar(i.data));
|
|
8844
8877
|
}
|
|
8845
8878
|
/**
|
|
8846
8879
|
* Открепляет сотрудника от региона по указанному направлению продаж.
|
|
@@ -8859,7 +8892,7 @@ class Bi extends Y {
|
|
|
8859
8892
|
});
|
|
8860
8893
|
}
|
|
8861
8894
|
}
|
|
8862
|
-
class
|
|
8895
|
+
class zi {
|
|
8863
8896
|
/**
|
|
8864
8897
|
* Инициализирует экземпляр класса {@link FieldValidationResultData}.
|
|
8865
8898
|
*
|
|
@@ -8885,12 +8918,12 @@ class Wi {
|
|
|
8885
8918
|
export {
|
|
8886
8919
|
_s as AnyReference,
|
|
8887
8920
|
os as AppBaseConfig,
|
|
8888
|
-
|
|
8921
|
+
Cr as BankAccount,
|
|
8889
8922
|
Y as BasePaginationProvider,
|
|
8890
8923
|
ur as BlogPost,
|
|
8891
8924
|
wr as BlogPostMediaFile,
|
|
8892
|
-
|
|
8893
|
-
|
|
8925
|
+
Ye as BlogPostMediaTypeEnum,
|
|
8926
|
+
Qe as BlogPostPublicationStatusEnum,
|
|
8894
8927
|
ae as BlogPostShortInfo,
|
|
8895
8928
|
Ks as BlogPostsListFilters,
|
|
8896
8929
|
vr as BlogProvider,
|
|
@@ -8899,19 +8932,19 @@ export {
|
|
|
8899
8932
|
Oe as Cart,
|
|
8900
8933
|
Zs as CartProvider,
|
|
8901
8934
|
ri as CatalogProvider,
|
|
8902
|
-
|
|
8935
|
+
nt as CatalogableItem,
|
|
8903
8936
|
Q as Category,
|
|
8904
8937
|
as as CategoryFilter,
|
|
8905
8938
|
Br as CategoryFilterSetting,
|
|
8906
8939
|
ys as CategoryFilterValue,
|
|
8907
8940
|
Hr as CategoryPricingRule,
|
|
8908
|
-
|
|
8941
|
+
wt as ChannelPrimaryInterest,
|
|
8909
8942
|
Ns as City,
|
|
8910
|
-
|
|
8943
|
+
Re as CityWithRegionAndCountry,
|
|
8911
8944
|
Qr as CityWithUserRegion,
|
|
8912
8945
|
jr as Client,
|
|
8913
|
-
|
|
8914
|
-
|
|
8946
|
+
Cs as ClientAdditionalData,
|
|
8947
|
+
Ke as ClientCategory,
|
|
8915
8948
|
H as ClientDataProvider,
|
|
8916
8949
|
ti as ClientPriceProvider,
|
|
8917
8950
|
si as ClientPriceTemplateProvider,
|
|
@@ -8925,17 +8958,17 @@ export {
|
|
|
8925
8958
|
yi as ConfiguratorProvider,
|
|
8926
8959
|
Ts as ConfiguratorsEnum,
|
|
8927
8960
|
Dr as Contact,
|
|
8928
|
-
|
|
8961
|
+
lt as ContactLinks,
|
|
8929
8962
|
se as ContactPerson,
|
|
8930
8963
|
Ds as ContactPersonRelated,
|
|
8931
8964
|
qs as ContactPosition,
|
|
8932
8965
|
gr as ContactRelation,
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8966
|
+
mt as ContragentBase,
|
|
8967
|
+
Xe as ContragentFactory,
|
|
8968
|
+
yt as ContragentIc,
|
|
8936
8969
|
vs as ContragentPerson,
|
|
8937
|
-
|
|
8938
|
-
|
|
8970
|
+
Rs as ContragentUlNr,
|
|
8971
|
+
at as ContragentUlR,
|
|
8939
8972
|
kr as CostSourceEnum,
|
|
8940
8973
|
we as Country,
|
|
8941
8974
|
Ir as CuratedDirection,
|
|
@@ -8943,19 +8976,19 @@ export {
|
|
|
8943
8976
|
j as Currency,
|
|
8944
8977
|
Ui as DataSuggestionProvider,
|
|
8945
8978
|
Tr as DateHelper,
|
|
8946
|
-
|
|
8947
|
-
|
|
8979
|
+
Ci as DateTimeProvider,
|
|
8980
|
+
ft as DeletableNamedIdentity,
|
|
8948
8981
|
_e as DeliveryAddress,
|
|
8949
8982
|
K as DeliveryType,
|
|
8950
|
-
|
|
8983
|
+
rt as DetailedJwtPayload,
|
|
8951
8984
|
ts as DeviceTypeResolutionConfig,
|
|
8952
8985
|
cs as DiscountShortInfo,
|
|
8953
|
-
|
|
8986
|
+
zi as FieldValidationResultData,
|
|
8954
8987
|
te as FilterGroup,
|
|
8955
8988
|
Fr as FilterItem,
|
|
8956
8989
|
dr as FilterOpEnum,
|
|
8957
8990
|
ms as FilterSettings,
|
|
8958
|
-
|
|
8991
|
+
it as GeoCoordinates,
|
|
8959
8992
|
us as HiddenCatalogableItem,
|
|
8960
8993
|
Ue as HttpCachedRequester,
|
|
8961
8994
|
ss as HttpParamsConfig,
|
|
@@ -8966,29 +8999,29 @@ export {
|
|
|
8966
8999
|
Te as JwtPayload,
|
|
8967
9000
|
Z as Manager,
|
|
8968
9001
|
Lr as ManagerCommon,
|
|
8969
|
-
|
|
8970
|
-
|
|
9002
|
+
Ai as ManagerDataFactory,
|
|
9003
|
+
Dt as ManagerDataProvider,
|
|
8971
9004
|
Ms as MetaTagItem,
|
|
8972
9005
|
L as NamedIdentity,
|
|
8973
9006
|
F as Offer,
|
|
8974
|
-
|
|
9007
|
+
bs as OfferActualization,
|
|
8975
9008
|
xe as OfferActualizationStatus,
|
|
8976
9009
|
di as OfferHelper,
|
|
8977
|
-
|
|
9010
|
+
Tt as OfferShortInfo,
|
|
8978
9011
|
Si as OffersDataProvider,
|
|
8979
|
-
|
|
8980
|
-
|
|
9012
|
+
bi as OffersListFilters,
|
|
9013
|
+
At as Operator,
|
|
8981
9014
|
ie as Opf,
|
|
8982
9015
|
V as OpfEnum,
|
|
8983
9016
|
I as Order,
|
|
8984
9017
|
$s as OrderAction,
|
|
8985
9018
|
$i as OrderEditorData,
|
|
8986
|
-
|
|
9019
|
+
Pt as OrderInfo,
|
|
8987
9020
|
ds as OrderItem,
|
|
8988
|
-
|
|
9021
|
+
ot as OrderItemBase,
|
|
8989
9022
|
Es as OrderPaymentStatus,
|
|
8990
|
-
|
|
8991
|
-
|
|
9023
|
+
Rt as OrderShortInfo,
|
|
9024
|
+
er as OrderStatus,
|
|
8992
9025
|
Us as OrderStatusDetail,
|
|
8993
9026
|
xs as OrderStatusDetailEnum,
|
|
8994
9027
|
Is as OrderStatusEnum,
|
|
@@ -8996,52 +9029,52 @@ export {
|
|
|
8996
9029
|
Oi as OrdersDataProvider,
|
|
8997
9030
|
ki as OrdersListFilters,
|
|
8998
9031
|
Fe as PaginationFiltersBase,
|
|
8999
|
-
|
|
9032
|
+
Ce as PartnerGroup,
|
|
9000
9033
|
bt as PaymentType,
|
|
9001
|
-
|
|
9034
|
+
Ge as PreferencesStorageProvider,
|
|
9002
9035
|
fr as PriceAnalyze,
|
|
9003
9036
|
Ii as PriceAnalyzeProvider,
|
|
9004
9037
|
Pe as PriceCoefficient,
|
|
9005
|
-
|
|
9038
|
+
st as PriceCoefficientEnum,
|
|
9006
9039
|
xi as PriceHistoryDataProvider,
|
|
9007
9040
|
Os as PriceHistoryItem,
|
|
9008
9041
|
fe as PriceTemplate,
|
|
9009
9042
|
pr as PriceTemplateCategory,
|
|
9010
9043
|
Le as PriceTemplateClient,
|
|
9011
|
-
|
|
9044
|
+
pt as PriceTemplateICatalogableItem,
|
|
9012
9045
|
hr as PriceTemplateProduct,
|
|
9013
9046
|
li as PriceTemplateProvider,
|
|
9014
9047
|
Ie as PricingRole,
|
|
9015
9048
|
ui as PricingRoleProvider,
|
|
9016
|
-
|
|
9049
|
+
Rr as PrimaryCatalogableItem,
|
|
9017
9050
|
q as Product,
|
|
9018
9051
|
ii as ProductCategoryDataProvider,
|
|
9019
9052
|
ni as ProductDataProvider,
|
|
9020
9053
|
Fs as ProductFileType,
|
|
9021
|
-
|
|
9054
|
+
ct as ProductFilterTypeEnum,
|
|
9022
9055
|
$r as ProductPriceCoefficient,
|
|
9023
9056
|
Ls as ProductPriceHistory,
|
|
9024
9057
|
Mr as ProductUnit,
|
|
9025
9058
|
Ss as ProfstroyOfferItem,
|
|
9026
9059
|
pi as PropertiesProvider,
|
|
9027
9060
|
me as Property,
|
|
9028
|
-
|
|
9061
|
+
gt as PropertyType,
|
|
9029
9062
|
gs as PropertyTypeEnum,
|
|
9030
9063
|
he as PropertyValue,
|
|
9031
9064
|
_i as RecommendationsDataProvider,
|
|
9032
9065
|
Yr as RecommendationsList,
|
|
9033
|
-
|
|
9066
|
+
D as Reference,
|
|
9034
9067
|
Ni as ReferenceDataFactory,
|
|
9035
9068
|
S as ReferenceDataProvider,
|
|
9036
9069
|
ve as Region,
|
|
9037
|
-
|
|
9070
|
+
St as ResourceType,
|
|
9038
9071
|
Di as STANDARD_PERIOD_GROUPS,
|
|
9039
9072
|
Ti as STANDARD_PERIOD_SECTIONS,
|
|
9040
9073
|
U as SalesDirection,
|
|
9041
9074
|
is as SentryConfig,
|
|
9042
9075
|
Vr as Seo,
|
|
9043
9076
|
Ei as SeoDataProvider,
|
|
9044
|
-
|
|
9077
|
+
vt as SourcePrimaryInterest,
|
|
9045
9078
|
ls as StockCount,
|
|
9046
9079
|
ai as TableDataPagination,
|
|
9047
9080
|
Ps as TableDataPaginationRequestParams,
|
|
@@ -9051,30 +9084,30 @@ export {
|
|
|
9051
9084
|
_ as TypedInstanceFactory,
|
|
9052
9085
|
Ct as UnitsHelper,
|
|
9053
9086
|
fi as UnknownClientDataProvider,
|
|
9054
|
-
|
|
9087
|
+
tt as UpdatableNamedIdentity,
|
|
9055
9088
|
Hs as User,
|
|
9056
9089
|
Fi as UserAuthDataProvider,
|
|
9057
|
-
|
|
9090
|
+
ht as UserCommonInfo,
|
|
9058
9091
|
Bs as UserDataProvider,
|
|
9059
|
-
|
|
9092
|
+
ut as UserPricingRole,
|
|
9060
9093
|
yr as UserRegion,
|
|
9061
|
-
|
|
9094
|
+
Ar as UserRegionEmployee,
|
|
9062
9095
|
Bi as UserRegionProvider,
|
|
9063
|
-
|
|
9096
|
+
Ze as UserRegionShortInfo,
|
|
9064
9097
|
Hi as UserRegionsListFilters,
|
|
9065
9098
|
N as UserShortInfo,
|
|
9066
|
-
|
|
9099
|
+
dt as UserTypeEnum,
|
|
9067
9100
|
mi as VersionConfig,
|
|
9068
9101
|
Me as Warehouse,
|
|
9069
9102
|
ns as WebSocketConfig,
|
|
9070
9103
|
Li as currentOrderInjectionKey,
|
|
9071
9104
|
vi as daysAgoIso,
|
|
9072
|
-
|
|
9073
|
-
|
|
9105
|
+
zr as findCatalogItemByIdRecursive,
|
|
9106
|
+
Wr as flattenCatalogItems,
|
|
9074
9107
|
Pi as formatPercentChange,
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9108
|
+
Ri as formatRelativeDate,
|
|
9109
|
+
As as pluralize,
|
|
9110
|
+
ze as useAuthStateStore,
|
|
9078
9111
|
O as useBaseConfigStateStore,
|
|
9079
9112
|
qi as useReferencesStore,
|
|
9080
9113
|
Mi as useUserStateStore
|