@snabcentr/common-lib 3.8.2 → 3.9.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 -8
- package/dist/sc-common-lib.js +644 -623
- 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/discounts/classes/discount.d.ts.map +1 -1
- package/dist/src/discounts/helpers/index.d.ts +0 -1
- package/dist/src/discounts/helpers/index.d.ts.map +1 -1
- package/dist/src/discounts/interfaces/i-discount-save-data.d.ts +2 -2
- package/dist/src/discounts/interfaces/i-discount-save-data.d.ts.map +1 -1
- package/dist/src/discounts/providers/discount-provider.d.ts +2 -2
- package/dist/src/suggestion/enums/address-quality-enum.d.ts +18 -0
- package/dist/src/suggestion/enums/address-quality-enum.d.ts.map +1 -0
- package/dist/src/suggestion/enums/index.d.ts +2 -0
- package/dist/src/suggestion/enums/index.d.ts.map +1 -0
- package/dist/src/suggestion/helpers/address-quality-helper.d.ts +25 -0
- package/dist/src/suggestion/helpers/address-quality-helper.d.ts.map +1 -0
- package/dist/src/suggestion/helpers/index.d.ts +2 -0
- package/dist/src/suggestion/helpers/index.d.ts.map +1 -0
- package/dist/src/suggestion/index.d.ts +2 -0
- package/dist/src/suggestion/index.d.ts.map +1 -1
- package/dist/src/suggestion/interfaces/i-address-suggestion.d.ts +5 -0
- package/dist/src/suggestion/interfaces/i-address-suggestion.d.ts.map +1 -1
- package/dist/src/suggestion/interfaces/i-organization-suggestion.d.ts +13 -0
- package/dist/src/suggestion/interfaces/i-organization-suggestion.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src/discounts/helpers/discount-helper.d.ts +0 -13
- package/dist/src/discounts/helpers/discount-helper.d.ts.map +0 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var s = (n, r, e) =>
|
|
4
|
-
import { jwtDecode as
|
|
5
|
-
import { merge as Ne, isNil as m, isEmpty as Q, noop as R, mapValues as
|
|
6
|
-
import { objectToCamel as
|
|
1
|
+
var jt = Object.defineProperty;
|
|
2
|
+
var Yt = (n, r, e) => r in n ? jt(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
|
+
var s = (n, r, e) => Yt(n, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { jwtDecode as yt } from "jwt-decode";
|
|
5
|
+
import { merge as Ne, isNil as m, isEmpty as Q, noop as R, mapValues as at, isArray as V, every as Vt, split as Qt, isString as I, startsWith as wt, endsWith as Jt, includes as Kt, isFunction as Er, map as P, isObject as er, isDate as rr, isError as Yr, assign as Vr, toLower as Xt, isPlainObject as Zt, isUndefined as Be, constant as es, toUpper as rs, cloneDeep as ts, forEach as ss, some as Qr, round as is, omitBy as vt } from "lodash-es";
|
|
6
|
+
import { objectToCamel as Ur, objectToSnake as ns } from "ts-case-convert";
|
|
7
7
|
import { defineStore as ue } from "pinia";
|
|
8
|
-
import { ref as v, markRaw as
|
|
9
|
-
import { isAfter as
|
|
10
|
-
import
|
|
8
|
+
import { ref as v, markRaw as os, computed as b } from "vue";
|
|
9
|
+
import { isAfter as Jr, parseISO as _, startOfToday as Ee, isValid as Kr, format as S, endOfMonth as x, addMonths as k, differenceInCalendarMonths as cs, startOfMonth as H, getDate as Xr, getDaysInMonth as ls, endOfDay as B, startOfDay as re, setDate as us, startOfWeek as te, addWeeks as Sr, differenceInCalendarDays as je, addDays as se, subDays as Ye, addBusinessDays as ps, startOfYear as ae, endOfYear as $e, endOfWeek as ke, endOfTomorrow as hs, startOfTomorrow as gs, endOfYesterday as fs, startOfYesterday as ms, endOfToday as ys, startOfQuarter as Oe, endOfQuarter as Ge, addYears as gr, addQuarters as fr, subYears as mr, subQuarters as yr, subMonths as ar, subWeeks as Zr, addSeconds as as } from "date-fns";
|
|
10
|
+
import ws, { CanceledError as vs } from "axios";
|
|
11
11
|
class be {
|
|
12
12
|
/**
|
|
13
13
|
* Инициализирует экземпляр класса {@link JwtPayload}.
|
|
@@ -107,11 +107,11 @@ class be {
|
|
|
107
107
|
* @param jwtToken JWT-ключ доступа.
|
|
108
108
|
*/
|
|
109
109
|
static getJwtPayload(r) {
|
|
110
|
-
const e =
|
|
110
|
+
const e = yt(r), t = new be(Ur(e));
|
|
111
111
|
return t.resourceAccess = e.resource_access, t;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
class
|
|
114
|
+
class Ct extends be {
|
|
115
115
|
/**
|
|
116
116
|
* Инициализирует экземпляр класса {@link DetailedJwtPayload}.
|
|
117
117
|
*
|
|
@@ -151,11 +151,11 @@ class vt extends be {
|
|
|
151
151
|
* @param jwtToken JWT-ключ доступа.
|
|
152
152
|
*/
|
|
153
153
|
static getJwtPayload(e) {
|
|
154
|
-
const t =
|
|
154
|
+
const t = yt(e), i = new Ct(Ur(t));
|
|
155
155
|
return i.resourceAccess = t.resource_access, i;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
class
|
|
158
|
+
class Cs {
|
|
159
159
|
/**
|
|
160
160
|
* Инициализирует экземпляр класса {@link DeviceTypeResolutionConfig}.
|
|
161
161
|
*
|
|
@@ -177,7 +177,7 @@ class ws {
|
|
|
177
177
|
this.phone = (r == null ? void 0 : r.phone) ?? 360, this.tablet = (r == null ? void 0 : r.tablet) ?? 600, this.laptop = (r == null ? void 0 : r.laptop) ?? 1024;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
class
|
|
180
|
+
class Ds {
|
|
181
181
|
/**
|
|
182
182
|
* Инициализирует экземпляр класса {@link HttpParamsConfig}.
|
|
183
183
|
*
|
|
@@ -199,7 +199,7 @@ class vs {
|
|
|
199
199
|
this.portalApiUrl = (r == null ? void 0 : r.portalApiUrl) ?? "", this.mediaUrl = (r == null ? void 0 : r.mediaUrl) ?? "", this.responseDataCacheTimeout = (r == null ? void 0 : r.responseDataCacheTimeout) ?? 3 * 60 * 60;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
class
|
|
202
|
+
class Rs {
|
|
203
203
|
/**
|
|
204
204
|
* Инициализирует экземпляр класса {@link SentryConfig}.
|
|
205
205
|
*
|
|
@@ -244,7 +244,7 @@ class Cs {
|
|
|
244
244
|
}, this.additionalParams = (r == null ? void 0 : r.additionalParams) ?? {};
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
class
|
|
247
|
+
class Ps {
|
|
248
248
|
/**
|
|
249
249
|
* Инициализирует экземпляр класса {@link WebSocketConfig}.
|
|
250
250
|
*
|
|
@@ -283,7 +283,7 @@ class Ds {
|
|
|
283
283
|
this.broadcaster = r.broadcaster ?? "reverb", this.key = r.key ?? "", this.wsHost = r.wsHost ?? "", this.wsPort = r.wsPort ?? 8080, this.wssPort = r.wssPort ?? 8080, this.forceTLS = r.forceTLS ?? !1, this.enabledTransports = r.enabledTransports ?? ["wss"];
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
class
|
|
286
|
+
class Ts {
|
|
287
287
|
/**
|
|
288
288
|
* Инициализирует экземпляр класса {@link AppBaseConfig}.
|
|
289
289
|
*
|
|
@@ -331,10 +331,10 @@ class Rs {
|
|
|
331
331
|
*/
|
|
332
332
|
s(this, "numberPrecision");
|
|
333
333
|
var e, t, i, o;
|
|
334
|
-
this.environment = (r == null ? void 0 : r.environment) ?? "production", this.devMode = (r == null ? void 0 : r.devMode) ?? {}, this.http = new
|
|
334
|
+
this.environment = (r == null ? void 0 : r.environment) ?? "production", this.devMode = (r == null ? void 0 : r.devMode) ?? {}, this.http = new Ds(r == null ? void 0 : r.http), this.deviceTypeByResolution = new Cs(r == null ? void 0 : r.deviceTypeByResolution), this.sentry = new Rs({
|
|
335
335
|
environment: this.environment,
|
|
336
336
|
...r == null ? void 0 : r.sentry
|
|
337
|
-
}), 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
|
|
337
|
+
}), 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 Ps(r.websocket) : void 0, this.dateFormats = {
|
|
338
338
|
api: ((e = r == null ? void 0 : r.dateFormats) == null ? void 0 : e.api) ?? "yyyy-MM-dd HH:mm:ss",
|
|
339
339
|
uiDate: ((t = r == null ? void 0 : r.dateFormats) == null ? void 0 : t.uiDate) ?? "dd.MM.yyyy",
|
|
340
340
|
uiDateWithTime: ((i = r == null ? void 0 : r.dateFormats) == null ? void 0 : i.uiDateWithTime) ?? "dd.MM.yyyy HH:mm"
|
|
@@ -343,8 +343,8 @@ class Rs {
|
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
const
|
|
347
|
-
const n = v(new
|
|
346
|
+
const $ = ue("common.config", () => {
|
|
347
|
+
const n = v(new Ts());
|
|
348
348
|
return {
|
|
349
349
|
/**
|
|
350
350
|
* Конфигурационные данные приложения.
|
|
@@ -385,7 +385,7 @@ class Ve {
|
|
|
385
385
|
if (e)
|
|
386
386
|
try {
|
|
387
387
|
const t = JSON.parse(e);
|
|
388
|
-
if (!t.availableFor ||
|
|
388
|
+
if (!t.availableFor || Jr(_(t.availableFor) || Ee(), /* @__PURE__ */ new Date())) {
|
|
389
389
|
if (m(t.data) || Q(t.data))
|
|
390
390
|
throw new Error("Data is empty");
|
|
391
391
|
return t.data;
|
|
@@ -460,7 +460,7 @@ class Ve {
|
|
|
460
460
|
const i = localStorage.getItem(t);
|
|
461
461
|
if (i) {
|
|
462
462
|
const o = JSON.parse(i);
|
|
463
|
-
o.availableFor && !
|
|
463
|
+
o.availableFor && !Jr(_(o.availableFor) || Ee(), /* @__PURE__ */ new Date()) && r.push(t);
|
|
464
464
|
}
|
|
465
465
|
} catch {
|
|
466
466
|
r.push(t);
|
|
@@ -476,7 +476,7 @@ class Ve {
|
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function et(n) {
|
|
480
480
|
try {
|
|
481
481
|
const r = be.getJwtPayload(n);
|
|
482
482
|
return new Date(r.exp * 1e3);
|
|
@@ -494,14 +494,14 @@ const we = ue("common.auth_state_private", () => {
|
|
|
494
494
|
);
|
|
495
495
|
if (o)
|
|
496
496
|
return Promise.resolve(o);
|
|
497
|
-
const c = (u =
|
|
497
|
+
const c = (u = $().config.devMode) == null ? void 0 : u.initAuthBearerToken;
|
|
498
498
|
return c ? Promise.resolve(c) : void 0;
|
|
499
499
|
})()
|
|
500
|
-
), r = v(void 0), e = v(void 0), t =
|
|
500
|
+
), r = v(void 0), e = v(void 0), t = os(/* @__PURE__ */ new Map());
|
|
501
501
|
function i() {
|
|
502
502
|
e.value = void 0, m(n.value) || n.value.then((o) => {
|
|
503
503
|
const c = be.getJwtPayload(o);
|
|
504
|
-
e.value = c.exp * 1e3 > Date.now() ?
|
|
504
|
+
e.value = c.exp * 1e3 > Date.now() ? at(c.resourceAccess, (u) => (u == null ? void 0 : u.roles) ?? []) : void 0;
|
|
505
505
|
}).catch(R);
|
|
506
506
|
}
|
|
507
507
|
return {
|
|
@@ -532,7 +532,7 @@ const we = ue("common.auth_state_private", () => {
|
|
|
532
532
|
if (m(o.jwtToken) && !m(o.jwtTokenUpdater)) {
|
|
533
533
|
const c = o.jwtTokenUpdater();
|
|
534
534
|
o.jwtToken = c, c.then((u) => {
|
|
535
|
-
o.jwtToken = Promise.resolve(u), Ve.saveActualDataToStorage("sc.token", u,
|
|
535
|
+
o.jwtToken = Promise.resolve(u), Ve.saveActualDataToStorage("sc.token", u, et(u)), o.recalculateUserPermissions();
|
|
536
536
|
}).catch(R);
|
|
537
537
|
}
|
|
538
538
|
return o.jwtToken;
|
|
@@ -542,7 +542,7 @@ const we = ue("common.auth_state_private", () => {
|
|
|
542
542
|
}
|
|
543
543
|
function e(o) {
|
|
544
544
|
const c = we();
|
|
545
|
-
c.jwtToken = Promise.resolve(o), Ve.saveActualDataToStorage("sc.token", o,
|
|
545
|
+
c.jwtToken = Promise.resolve(o), Ve.saveActualDataToStorage("sc.token", o, et(o)), c.recalculateUserPermissions();
|
|
546
546
|
}
|
|
547
547
|
function t() {
|
|
548
548
|
const o = we();
|
|
@@ -552,7 +552,7 @@ const we = ue("common.auth_state_private", () => {
|
|
|
552
552
|
const c = we();
|
|
553
553
|
!m(c.jwtToken) && m(c.userPermissions) && c.jwtToken.then((g) => {
|
|
554
554
|
const a = be.getJwtPayload(g);
|
|
555
|
-
c.userPermissions = a.exp * 1e3 > Date.now() ?
|
|
555
|
+
c.userPermissions = a.exp * 1e3 > Date.now() ? at(a.resourceAccess, (T) => (T == null ? void 0 : T.roles) ?? []) : void 0;
|
|
556
556
|
}).catch(R);
|
|
557
557
|
const u = V(o) ? o.join(" && ") : o;
|
|
558
558
|
if (c.userPermissionsComputedRefs.has(u))
|
|
@@ -560,13 +560,13 @@ const we = ue("common.auth_state_private", () => {
|
|
|
560
560
|
const p = b(() => {
|
|
561
561
|
const g = (a) => {
|
|
562
562
|
var ye;
|
|
563
|
-
const T =
|
|
563
|
+
const T = Qt(a, ".");
|
|
564
564
|
if (T.length < 2)
|
|
565
565
|
return !1;
|
|
566
566
|
const [Ae, Se] = T, me = (ye = we().userPermissions) == null ? void 0 : ye[Ae];
|
|
567
567
|
return V(me) && me.includes(Se);
|
|
568
568
|
};
|
|
569
|
-
return V(o) ?
|
|
569
|
+
return V(o) ? Vt(o, (a) => g(a)) : g(o);
|
|
570
570
|
});
|
|
571
571
|
return c.userPermissionsComputedRefs.set(u, p), p;
|
|
572
572
|
}
|
|
@@ -625,7 +625,7 @@ class pe {
|
|
|
625
625
|
return typeof this.id == "number" ? this.id === -1 : typeof this.id == "string" ? this.id === "" : m(this.id);
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
|
-
class
|
|
628
|
+
class $r extends pe {
|
|
629
629
|
/**
|
|
630
630
|
* Инициализирует экземпляр класса {@link BlogPostMediaFile}.
|
|
631
631
|
*
|
|
@@ -680,7 +680,7 @@ class O {
|
|
|
680
680
|
if (m(r))
|
|
681
681
|
return;
|
|
682
682
|
const e = I(r) ? _(r) : r;
|
|
683
|
-
return
|
|
683
|
+
return Kr(e) ? e : void 0;
|
|
684
684
|
}
|
|
685
685
|
/**
|
|
686
686
|
* Возвращает дату в формате API либо `null`, если дата не задана или некорректна.
|
|
@@ -688,7 +688,7 @@ class O {
|
|
|
688
688
|
* @param date Дата.
|
|
689
689
|
*/
|
|
690
690
|
static toApiFormat(r) {
|
|
691
|
-
return m(r) || !
|
|
691
|
+
return m(r) || !Kr(r) ? null : S(r, $().config.dateFormats.api);
|
|
692
692
|
}
|
|
693
693
|
/**
|
|
694
694
|
* Возвращает период с датами начала и окончания в формате API.
|
|
@@ -699,7 +699,7 @@ class O {
|
|
|
699
699
|
return { from: O.toApiFormat(r.from), to: O.toApiFormat(r.to) };
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
class
|
|
702
|
+
class ir extends pe {
|
|
703
703
|
/**
|
|
704
704
|
* Инициализирует экземпляр класса {@link CreatableIdentity}.
|
|
705
705
|
*
|
|
@@ -715,7 +715,7 @@ class sr extends pe {
|
|
|
715
715
|
this.createdAt = O.parse(e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date();
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
class Ue extends
|
|
718
|
+
class Ue extends ir {
|
|
719
719
|
/**
|
|
720
720
|
* Инициализирует экземпляр класса {@link BlogPostShortInfo}.
|
|
721
721
|
*
|
|
@@ -755,7 +755,7 @@ class Ue extends sr {
|
|
|
755
755
|
* @param slug Символьное обозначение статьи.
|
|
756
756
|
*/
|
|
757
757
|
static getSlugError(e) {
|
|
758
|
-
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." :
|
|
758
|
+
return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." : wt(e, "-") || Jt(e, "-") ? "Обозначение не может начинаться или заканчиваться дефисом." : Kt(e, "--") ? "Дефисы не могут идти подряд: разделяйте слова одним дефисом." : "" : "";
|
|
759
759
|
}
|
|
760
760
|
/**
|
|
761
761
|
* Преобразует значение даты, полученное из API, в объект {@link Date}.
|
|
@@ -772,7 +772,7 @@ class Ue extends sr {
|
|
|
772
772
|
return Ue.resolvePublicationStatus(this.publishedAt);
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
|
-
class
|
|
775
|
+
class wr extends Ue {
|
|
776
776
|
/**
|
|
777
777
|
* Инициализирует экземпляр класса {@link BlogPost}.
|
|
778
778
|
*
|
|
@@ -788,7 +788,7 @@ class ar extends Ue {
|
|
|
788
788
|
* @inheritDoc
|
|
789
789
|
*/
|
|
790
790
|
s(this, "media");
|
|
791
|
-
this.content = (e == null ? void 0 : e.content) ?? "", this.media = ((e == null ? void 0 : e.media) ?? []).map((t) => new
|
|
791
|
+
this.content = (e == null ? void 0 : e.content) ?? "", this.media = ((e == null ? void 0 : e.media) ?? []).map((t) => new $r(t));
|
|
792
792
|
}
|
|
793
793
|
/**
|
|
794
794
|
* Возвращает данные статьи для отправки на портал.
|
|
@@ -829,7 +829,7 @@ class de {
|
|
|
829
829
|
return Object.keys(this).forEach((e) => {
|
|
830
830
|
const t = this[e];
|
|
831
831
|
m(t) || // eslint-disable-next-line prettier/prettier,lodash/prefer-lodash-method
|
|
832
|
-
I(t) && t.trim().length === 0 ||
|
|
832
|
+
I(t) && t.trim().length === 0 || Er(t.isNewRec) && t.isNewRec() || (r[e] = t);
|
|
833
833
|
}), r;
|
|
834
834
|
}
|
|
835
835
|
}
|
|
@@ -851,7 +851,7 @@ class D {
|
|
|
851
851
|
this.from = I(r == null ? void 0 : r.from) ? _(r.from) : (r == null ? void 0 : r.from) ?? null, this.to = I(r == null ? void 0 : r.to) ? _(r.to) : (r == null ? void 0 : r.to) ?? null;
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
class
|
|
854
|
+
class ai extends de {
|
|
855
855
|
/**
|
|
856
856
|
* Инициализирует экземпляр класса {@link BlogPostsListFilters}.
|
|
857
857
|
*
|
|
@@ -971,7 +971,7 @@ const w = class w {
|
|
|
971
971
|
/**
|
|
972
972
|
* Базовый URL путь для выполнения запросов.
|
|
973
973
|
*/
|
|
974
|
-
s(this, "baseUrl", `${
|
|
974
|
+
s(this, "baseUrl", `${$().config.http.portalApiUrl}/api`);
|
|
975
975
|
/**
|
|
976
976
|
* Список идентификаторов обработчиков запросов для возможности отключить те или иные обработчики.
|
|
977
977
|
*/
|
|
@@ -998,7 +998,7 @@ const w = class w {
|
|
|
998
998
|
* @param request Данные запроса.
|
|
999
999
|
*/
|
|
1000
1000
|
// eslint-disable-next-line class-methods-use-this
|
|
1001
|
-
s(this, "dataConverterRequestInterceptor", (r) => (r.method && (r.method === "get" && !m(r.params) && (r.params = w.toSnakeCaseData(r.params)), ["put", "patch", "post"].includes(
|
|
1001
|
+
s(this, "dataConverterRequestInterceptor", (r) => (r.method && (r.method === "get" && !m(r.params) && (r.params = w.toSnakeCaseData(r.params)), ["put", "patch", "post"].includes(Xt(r.method)) && !m(r.data) && (r.data = w.toSnakeCaseData(r.data))), r));
|
|
1002
1002
|
/**
|
|
1003
1003
|
* Перехватчик ошибок ответов на запрос.
|
|
1004
1004
|
*
|
|
@@ -1029,7 +1029,7 @@ const w = class w {
|
|
|
1029
1029
|
s(this, "canceledResponseInterceptor", (r) => {
|
|
1030
1030
|
const e = r.rawError ?? r;
|
|
1031
1031
|
if (e.name === "CanceledError" || e.code === "ERR_CANCELED")
|
|
1032
|
-
throw new
|
|
1032
|
+
throw new vs("Request canceled");
|
|
1033
1033
|
return Promise.reject(r);
|
|
1034
1034
|
});
|
|
1035
1035
|
/**
|
|
@@ -1039,7 +1039,7 @@ const w = class w {
|
|
|
1039
1039
|
*/
|
|
1040
1040
|
// eslint-disable-next-line class-methods-use-this
|
|
1041
1041
|
s(this, "dataConverterResponseInterceptor", (r) => (r.data = w.toCamelCaseData(r.data), r));
|
|
1042
|
-
this.httpClient =
|
|
1042
|
+
this.httpClient = ws.create({
|
|
1043
1043
|
headers: {
|
|
1044
1044
|
Accept: "application/json",
|
|
1045
1045
|
"Content-Type": "application/json"
|
|
@@ -1094,7 +1094,7 @@ const w = class w {
|
|
|
1094
1094
|
* @param value Проверяемое значение.
|
|
1095
1095
|
*/
|
|
1096
1096
|
static canConvertCaseKeys(r) {
|
|
1097
|
-
return
|
|
1097
|
+
return er(r) ? !(r instanceof Blob || r instanceof FormData || r instanceof ArrayBuffer || rr(r) || ArrayBuffer.isView(r)) : !1;
|
|
1098
1098
|
}
|
|
1099
1099
|
/**
|
|
1100
1100
|
* Приводит ключи данных к camelCase, если значение является обычным объектом или массивом.
|
|
@@ -1102,7 +1102,7 @@ const w = class w {
|
|
|
1102
1102
|
* @param data Исходные данные.
|
|
1103
1103
|
*/
|
|
1104
1104
|
static toCamelCaseData(r) {
|
|
1105
|
-
return w.canConvertCaseKeys(r) ?
|
|
1105
|
+
return w.canConvertCaseKeys(r) ? Ur(r) : r;
|
|
1106
1106
|
}
|
|
1107
1107
|
/**
|
|
1108
1108
|
* Приводит ключи данных к snake_case, если значение является обычным объектом или массивом.
|
|
@@ -1110,7 +1110,7 @@ const w = class w {
|
|
|
1110
1110
|
* @param data Исходные данные.
|
|
1111
1111
|
*/
|
|
1112
1112
|
static toSnakeCaseData(r) {
|
|
1113
|
-
return w.canConvertCaseKeys(r) ?
|
|
1113
|
+
return w.canConvertCaseKeys(r) ? ns(r) : r;
|
|
1114
1114
|
}
|
|
1115
1115
|
/**
|
|
1116
1116
|
* Возвращает токен доступа из заголовка Authorization исходного запроса.
|
|
@@ -1119,7 +1119,7 @@ const w = class w {
|
|
|
1119
1119
|
*/
|
|
1120
1120
|
static getRequestAccessToken(r) {
|
|
1121
1121
|
const e = r.headers.get("Authorization"), t = I(e) ? e : void 0, i = "Bearer ";
|
|
1122
|
-
if (m(t) || !
|
|
1122
|
+
if (m(t) || !wt(t, i))
|
|
1123
1123
|
return;
|
|
1124
1124
|
const o = t.slice(i.length);
|
|
1125
1125
|
return o === "" ? void 0 : o;
|
|
@@ -1183,15 +1183,15 @@ const w = class w {
|
|
|
1183
1183
|
* @param error Данные об ошибке.
|
|
1184
1184
|
*/
|
|
1185
1185
|
static toHttpResponseError(r) {
|
|
1186
|
-
if (
|
|
1186
|
+
if (er(r) && "status" in r)
|
|
1187
1187
|
return r;
|
|
1188
|
-
const e =
|
|
1189
|
-
return
|
|
1188
|
+
const e = Yr(r) ? r.message : "Не удалось обработать данные ответа сервера.";
|
|
1189
|
+
return Vr(new Error(e), {
|
|
1190
1190
|
name: "HttpResponseError",
|
|
1191
1191
|
status: 0,
|
|
1192
1192
|
statusText: "Invalid response data",
|
|
1193
1193
|
headers: {},
|
|
1194
|
-
rawError:
|
|
1194
|
+
rawError: Yr(r) ? r : new Error(String(r))
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
1197
|
/**
|
|
@@ -1204,7 +1204,7 @@ const w = class w {
|
|
|
1204
1204
|
if (m(r) || !m(r.request) || !m(r.response)) {
|
|
1205
1205
|
const i = m(r) ? {} : r == null ? void 0 : r.response;
|
|
1206
1206
|
return Promise.reject(
|
|
1207
|
-
|
|
1207
|
+
Vr(new Error(((e = i == null ? void 0 : i.data) == null ? void 0 : e.message) ?? "Unknown Error. Probably network error."), {
|
|
1208
1208
|
name: "HttpResponseError",
|
|
1209
1209
|
status: (i == null ? void 0 : i.status) ?? 0,
|
|
1210
1210
|
statusText: (i == null ? void 0 : i.statusText) ?? "Unknown",
|
|
@@ -1331,8 +1331,8 @@ s(w, "defaultRequestHook"), /**
|
|
|
1331
1331
|
*/
|
|
1332
1332
|
s(w, "tokenRefreshPromise");
|
|
1333
1333
|
let h = w;
|
|
1334
|
-
var
|
|
1335
|
-
class
|
|
1334
|
+
var Fr = /* @__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))(Fr || {});
|
|
1335
|
+
class rt {
|
|
1336
1336
|
/**
|
|
1337
1337
|
* Инициализирует экземпляр класса {@link FilterItem}.
|
|
1338
1338
|
*
|
|
@@ -1351,7 +1351,7 @@ class Zr {
|
|
|
1351
1351
|
* Значение с которым сравнивается поле.
|
|
1352
1352
|
*/
|
|
1353
1353
|
s(this, "value");
|
|
1354
|
-
this.field = (r == null ? void 0 : r.field) ?? "", this.op = (r == null ? void 0 : r.op) ??
|
|
1354
|
+
this.field = (r == null ? void 0 : r.field) ?? "", this.op = (r == null ? void 0 : r.op) ?? Fr.Equals, this.value = (r == null ? void 0 : r.value) ?? "";
|
|
1355
1355
|
}
|
|
1356
1356
|
/**
|
|
1357
1357
|
* Преобразует фильтр в примитивное представление для API.
|
|
@@ -1359,17 +1359,17 @@ class Zr {
|
|
|
1359
1359
|
* @returns Примитивное представление фильтра.
|
|
1360
1360
|
*/
|
|
1361
1361
|
toPrimitive() {
|
|
1362
|
-
const r =
|
|
1362
|
+
const r = $().config.dateFormats.api, e = {
|
|
1363
1363
|
field: this.field,
|
|
1364
1364
|
op: this.op
|
|
1365
1365
|
};
|
|
1366
|
-
if (
|
|
1367
|
-
e.value =
|
|
1368
|
-
else if (
|
|
1366
|
+
if (rr(this.value))
|
|
1367
|
+
e.value = S(this.value, r);
|
|
1368
|
+
else if (Zt(this.value)) {
|
|
1369
1369
|
const t = this.value;
|
|
1370
1370
|
e.value = {
|
|
1371
|
-
from: t.from ?
|
|
1372
|
-
to: t.to ?
|
|
1371
|
+
from: t.from ? S(t.from, r) : null,
|
|
1372
|
+
to: t.to ? S(t.to, r) : null
|
|
1373
1373
|
};
|
|
1374
1374
|
} else
|
|
1375
1375
|
e.value = this.value;
|
|
@@ -1396,7 +1396,7 @@ class ie {
|
|
|
1396
1396
|
*/
|
|
1397
1397
|
s(this, "groups");
|
|
1398
1398
|
var e, t;
|
|
1399
|
-
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
|
|
1399
|
+
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 rt(i))) ?? [], this.groups = ((t = r == null ? void 0 : r.groups) == null ? void 0 : t.map((i) => new ie(i))) ?? [];
|
|
1400
1400
|
}
|
|
1401
1401
|
/**
|
|
1402
1402
|
* Преобразует группу фильтров в примитивное представление для API.
|
|
@@ -1406,7 +1406,7 @@ class ie {
|
|
|
1406
1406
|
toPrimitive() {
|
|
1407
1407
|
return {
|
|
1408
1408
|
groupOp: this.groupOp,
|
|
1409
|
-
filters: this.filters.map((r) => r instanceof
|
|
1409
|
+
filters: this.filters.map((r) => r instanceof rt && Er(r.toPrimitive) ? r.toPrimitive() : r),
|
|
1410
1410
|
groups: this.groups.map((r) => r instanceof ie ? r.toPrimitive() : r)
|
|
1411
1411
|
};
|
|
1412
1412
|
}
|
|
@@ -1459,7 +1459,7 @@ class M extends h {
|
|
|
1459
1459
|
);
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
|
-
class
|
|
1462
|
+
class kr extends M {
|
|
1463
1463
|
/**
|
|
1464
1464
|
* Возвращает данные статьи блога, подготовленные для отправки на портал.
|
|
1465
1465
|
*
|
|
@@ -1471,8 +1471,8 @@ class Sr extends M {
|
|
|
1471
1471
|
static preparePostSaveData(r) {
|
|
1472
1472
|
const e = {};
|
|
1473
1473
|
if (Be(r.title) || (e.title = r.title), Be(r.slug) || (e.slug = r.slug), Be(r.content) || (e.content = r.content), !Be(r.publishedAt)) {
|
|
1474
|
-
const t =
|
|
1475
|
-
e.publishedAt = m(r.publishedAt) ? null :
|
|
1474
|
+
const t = $().config.dateFormats.api;
|
|
1475
|
+
e.publishedAt = m(r.publishedAt) ? null : S(r.publishedAt, t);
|
|
1476
1476
|
}
|
|
1477
1477
|
return e;
|
|
1478
1478
|
}
|
|
@@ -1503,7 +1503,7 @@ class Sr extends M {
|
|
|
1503
1503
|
* @see /doc/api/internal#/operations/api_internal_blog_get
|
|
1504
1504
|
*/
|
|
1505
1505
|
getPost(r) {
|
|
1506
|
-
return this.get(`/internal/blog/${r}`, {}, (e) => new
|
|
1506
|
+
return this.get(`/internal/blog/${r}`, {}, (e) => new wr(e.data));
|
|
1507
1507
|
}
|
|
1508
1508
|
/**
|
|
1509
1509
|
* Создаёт новую статью блога.
|
|
@@ -1516,7 +1516,7 @@ class Sr extends M {
|
|
|
1516
1516
|
* @see /doc/api/internal#/operations/api_internal_blog_create
|
|
1517
1517
|
*/
|
|
1518
1518
|
createPost(r, e = {}) {
|
|
1519
|
-
return this.post("/internal/blog",
|
|
1519
|
+
return this.post("/internal/blog", kr.preparePostSaveData(r), (t) => new wr(t.data), e);
|
|
1520
1520
|
}
|
|
1521
1521
|
/**
|
|
1522
1522
|
* Изменяет данные о статье блога.
|
|
@@ -1530,7 +1530,7 @@ class Sr extends M {
|
|
|
1530
1530
|
* @see /doc/api/internal#/operations/api_internal_blog_update
|
|
1531
1531
|
*/
|
|
1532
1532
|
updatePost(r, e, t = {}) {
|
|
1533
|
-
return this.patch(`/internal/blog/${r}`,
|
|
1533
|
+
return this.patch(`/internal/blog/${r}`, kr.preparePostSaveData(e), (i) => new wr(i.data), t);
|
|
1534
1534
|
}
|
|
1535
1535
|
/**
|
|
1536
1536
|
* Удаляет статью блога.
|
|
@@ -1565,7 +1565,7 @@ class Sr extends M {
|
|
|
1565
1565
|
i && i(c.total ? Math.round(c.loaded / c.total * 100) : 0);
|
|
1566
1566
|
}
|
|
1567
1567
|
},
|
|
1568
|
-
(c) => new
|
|
1568
|
+
(c) => new $r(c.data),
|
|
1569
1569
|
o
|
|
1570
1570
|
);
|
|
1571
1571
|
}
|
|
@@ -1585,7 +1585,7 @@ class Sr extends M {
|
|
|
1585
1585
|
return this.patch(
|
|
1586
1586
|
`/internal/blog/${r}/media/${e}`,
|
|
1587
1587
|
{ isCover: t },
|
|
1588
|
-
(o) => new
|
|
1588
|
+
(o) => new $r(o.data),
|
|
1589
1589
|
i
|
|
1590
1590
|
);
|
|
1591
1591
|
}
|
|
@@ -1624,7 +1624,7 @@ class N extends pe {
|
|
|
1624
1624
|
return Q(this.name) ? this.guid : this.name;
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
1627
|
-
class
|
|
1627
|
+
class nr extends N {
|
|
1628
1628
|
/**
|
|
1629
1629
|
* Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
|
|
1630
1630
|
*
|
|
@@ -1643,7 +1643,7 @@ class ir extends N {
|
|
|
1643
1643
|
this.createdAt = O.parse(e == null ? void 0 : e.createdAt), this.updatedAt = O.parse(e == null ? void 0 : e.updatedAt);
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
|
-
class
|
|
1646
|
+
class or extends nr {
|
|
1647
1647
|
/**
|
|
1648
1648
|
* Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
|
|
1649
1649
|
*
|
|
@@ -1677,7 +1677,7 @@ class q extends N {
|
|
|
1677
1677
|
this.type = e == null ? void 0 : e.type, this.isActive = (e == null ? void 0 : e.isActive) ?? !0;
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
|
-
class
|
|
1680
|
+
class Mr extends or {
|
|
1681
1681
|
/**
|
|
1682
1682
|
* Инициализирует экземпляр класса {@link DiscountShortInfo}.
|
|
1683
1683
|
*
|
|
@@ -1712,7 +1712,7 @@ class Ur extends nr {
|
|
|
1712
1712
|
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = O.parse(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 q(e == null ? void 0 : e.owner);
|
|
1713
1713
|
}
|
|
1714
1714
|
}
|
|
1715
|
-
class Ce extends
|
|
1715
|
+
class Ce extends nr {
|
|
1716
1716
|
/**
|
|
1717
1717
|
* Инициализирует экземпляр класса {@link PriceTemplate}.
|
|
1718
1718
|
*
|
|
@@ -1731,7 +1731,7 @@ class Ce extends ir {
|
|
|
1731
1731
|
this.description = (e == null ? void 0 : e.description) ?? "", this.owner = e != null && e.owner ? new q(e.owner) : void 0;
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
|
-
var
|
|
1734
|
+
var Dt = /* @__PURE__ */ ((n) => (n.K0 = "k0", n.K1 = "k1", n.K2 = "k2", n.K3 = "k3", n.K4 = "k4", n.Retail = "retail", n))(Dt || {});
|
|
1735
1735
|
class C extends N {
|
|
1736
1736
|
/**
|
|
1737
1737
|
* Инициализирует экземпляр класса {@link Reference}.
|
|
@@ -1758,14 +1758,14 @@ class he extends C {
|
|
|
1758
1758
|
static getRetailPriceCoefficient() {
|
|
1759
1759
|
const r = new he({
|
|
1760
1760
|
id: -2,
|
|
1761
|
-
slug:
|
|
1761
|
+
slug: Dt.Retail,
|
|
1762
1762
|
name: "Розн. цена",
|
|
1763
1763
|
guid: ""
|
|
1764
1764
|
});
|
|
1765
|
-
return r.isNewRec =
|
|
1765
|
+
return r.isNewRec = es(!0), r;
|
|
1766
1766
|
}
|
|
1767
1767
|
}
|
|
1768
|
-
class
|
|
1768
|
+
class Hr {
|
|
1769
1769
|
/**
|
|
1770
1770
|
* Инициализирует экземпляр класса {@link ProductPriceCoefficient}.
|
|
1771
1771
|
*
|
|
@@ -1795,7 +1795,7 @@ class Fr {
|
|
|
1795
1795
|
this.coefficient = new he(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;
|
|
1796
1796
|
}
|
|
1797
1797
|
}
|
|
1798
|
-
class
|
|
1798
|
+
class Rt {
|
|
1799
1799
|
/**
|
|
1800
1800
|
* Инициализирует экземпляр класса {@link GeoCoordinates}.
|
|
1801
1801
|
*
|
|
@@ -1844,10 +1844,10 @@ class He extends C {
|
|
|
1844
1844
|
* Координаты склада.
|
|
1845
1845
|
*/
|
|
1846
1846
|
s(this, "coordinates");
|
|
1847
|
-
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 X(i))) ?? [], this.regions = (e == null ? void 0 : e.regions) ?? [], this.coordinates = new
|
|
1847
|
+
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 X(i))) ?? [], this.regions = (e == null ? void 0 : e.regions) ?? [], this.coordinates = new Rt(e == null ? void 0 : e.coordinates);
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
|
-
class
|
|
1850
|
+
class bs {
|
|
1851
1851
|
/**
|
|
1852
1852
|
* Инициализирует экземпляр класса {@link StockCount}.
|
|
1853
1853
|
*
|
|
@@ -1892,7 +1892,7 @@ class J extends N {
|
|
|
1892
1892
|
e && (this.signature = e.signature ?? "", this.code = e.code, this.symbol = e.symbol ?? "", this.precision = e.precision);
|
|
1893
1893
|
}
|
|
1894
1894
|
}
|
|
1895
|
-
class
|
|
1895
|
+
class tt extends N {
|
|
1896
1896
|
/**
|
|
1897
1897
|
* Инициализирует экземпляр класса {@link ProductUnit}.
|
|
1898
1898
|
*
|
|
@@ -1934,7 +1934,7 @@ class Fe extends N {
|
|
|
1934
1934
|
this.code = (e == null ? void 0 : e.code) ?? "";
|
|
1935
1935
|
}
|
|
1936
1936
|
}
|
|
1937
|
-
class
|
|
1937
|
+
class Pt extends Fe {
|
|
1938
1938
|
/**
|
|
1939
1939
|
* Инициализирует экземпляр класса {@link CatalogableItem}.
|
|
1940
1940
|
*
|
|
@@ -1953,7 +1953,7 @@ class Rt extends Fe {
|
|
|
1953
1953
|
this.slug = (e == null ? void 0 : e.slug) ?? "";
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
|
-
class
|
|
1956
|
+
class ds extends Pt {
|
|
1957
1957
|
/**
|
|
1958
1958
|
* Инициализирует экземпляр класса {@link HiddenCatalogableItem}.
|
|
1959
1959
|
*
|
|
@@ -1968,7 +1968,7 @@ class Ts extends Rt {
|
|
|
1968
1968
|
this.isHidden = (e == null ? void 0 : e.isHidden) ?? !1;
|
|
1969
1969
|
}
|
|
1970
1970
|
}
|
|
1971
|
-
class
|
|
1971
|
+
class As {
|
|
1972
1972
|
/**
|
|
1973
1973
|
* Инициализирует экземпляр класса {@link Image}.
|
|
1974
1974
|
*
|
|
@@ -1991,7 +1991,7 @@ class bs {
|
|
|
1991
1991
|
this.image = `${e ?? ""}${r.image}`, this.preview = `${e ?? ""}${r.preview}`, this.isDefault = r.isDefault;
|
|
1992
1992
|
}
|
|
1993
1993
|
}
|
|
1994
|
-
class
|
|
1994
|
+
class Or extends Pt {
|
|
1995
1995
|
/**
|
|
1996
1996
|
* Инициализирует экземпляр класса {@link PrimaryCatalogableItem}.
|
|
1997
1997
|
*
|
|
@@ -2006,7 +2006,7 @@ class $r extends Rt {
|
|
|
2006
2006
|
this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1;
|
|
2007
2007
|
}
|
|
2008
2008
|
}
|
|
2009
|
-
class E extends
|
|
2009
|
+
class E extends ds {
|
|
2010
2010
|
/**
|
|
2011
2011
|
* Инициализирует экземпляр класса {@link Product}.
|
|
2012
2012
|
*
|
|
@@ -2083,9 +2083,9 @@ class E extends Ts {
|
|
|
2083
2083
|
* Список коэффициентов цен на продукт.
|
|
2084
2084
|
*/
|
|
2085
2085
|
s(this, "priceCoefficients");
|
|
2086
|
-
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = e != null && e.unit ? new
|
|
2086
|
+
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = e != null && e.unit ? new tt(e.unit) : new tt(), 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 = I(e == null ? void 0 : e.costDate) ? _(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 bs(p))) ?? [], this.type = "product";
|
|
2087
2087
|
const t = (e == null ? void 0 : e.category) ?? ((o = e == null ? void 0 : e.categories) == null ? void 0 : o.find((p) => p.isPrimary));
|
|
2088
|
-
t && (this.category = new
|
|
2088
|
+
t && (this.category = new Or({ ...t, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((p) => new Or(p))), this.images = ((c = e == null ? void 0 : e.images) == null ? void 0 : c.map((p) => new As(p, $().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 Hr(p))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
|
|
2089
2089
|
}
|
|
2090
2090
|
/**
|
|
2091
2091
|
* Возвращает признак, что это измеряемый товар.
|
|
@@ -2106,7 +2106,7 @@ class E extends Ts {
|
|
|
2106
2106
|
return this.retailCostRub ?? this.costRub;
|
|
2107
2107
|
}
|
|
2108
2108
|
}
|
|
2109
|
-
var
|
|
2109
|
+
var Br = /* @__PURE__ */ ((n) => (n.Discount = "discount", n.PriceTemplate = "price_template", n.ClientPrice = "client_price", n.Product = "product", n))(Br || {});
|
|
2110
2110
|
class Pe extends E {
|
|
2111
2111
|
/**
|
|
2112
2112
|
* Инициализирует экземпляр класса {@link ClientProduct}.
|
|
@@ -2151,10 +2151,10 @@ class Pe extends E {
|
|
|
2151
2151
|
* Признак того, что указанный продукт входит в список избранных продуктов клиента.
|
|
2152
2152
|
*/
|
|
2153
2153
|
s(this, "isFavorite");
|
|
2154
|
-
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.costSource = (e == null ? void 0 : e.costSource) ??
|
|
2154
|
+
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.costSource = (e == null ? void 0 : e.costSource) ?? Br.Product, this.discount = e != null && e.discount ? new Mr(e.discount) : void 0, this.priceTemplate = e != null && e.priceTemplate ? new Ce(e.priceTemplate) : void 0, this.priceCoefficient = e != null && e.priceCoefficient ? new he(e.priceCoefficient) : void 0, this.increasePercent = e == null ? void 0 : e.increasePercent, this.isPreviouslyOrdered = e == null ? void 0 : e.isPreviouslyOrdered, this.isRequired = e == null ? void 0 : e.isRequired, this.isFavorite = e == null ? void 0 : e.isFavorite;
|
|
2155
2155
|
}
|
|
2156
2156
|
}
|
|
2157
|
-
class ge extends
|
|
2157
|
+
class ge extends Or {
|
|
2158
2158
|
/**
|
|
2159
2159
|
* Инициализирует экземпляр класса {@link BaseCategory}.
|
|
2160
2160
|
*
|
|
@@ -2178,10 +2178,10 @@ class ge extends $r {
|
|
|
2178
2178
|
* Список коэффициентов пересчёта из валют в рубли в формате ключ значение.
|
|
2179
2179
|
*/
|
|
2180
2180
|
s(this, "currencyRates");
|
|
2181
|
-
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]) => [
|
|
2181
|
+
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]) => [rs(t), i])) : void 0;
|
|
2182
2182
|
}
|
|
2183
2183
|
}
|
|
2184
|
-
class
|
|
2184
|
+
class Tt extends pe {
|
|
2185
2185
|
/**
|
|
2186
2186
|
* Инициализирует экземпляр класса {@link OrderItemBase}.
|
|
2187
2187
|
*
|
|
@@ -2257,10 +2257,10 @@ class Pt extends pe {
|
|
|
2257
2257
|
* @inheritDoc
|
|
2258
2258
|
*/
|
|
2259
2259
|
s(this, "replacementId");
|
|
2260
|
-
this.product = new Pe(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new ge(), 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 &&
|
|
2260
|
+
this.product = new Pe(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new ge(), 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 && ts(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new q(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
|
|
2261
2261
|
}
|
|
2262
2262
|
}
|
|
2263
|
-
let
|
|
2263
|
+
let Gr = class extends Tt {
|
|
2264
2264
|
/**
|
|
2265
2265
|
* Инициализирует экземпляр класса {@link OrderItem}.
|
|
2266
2266
|
*
|
|
@@ -2326,10 +2326,10 @@ class Le {
|
|
|
2326
2326
|
* @inheritDoc
|
|
2327
2327
|
*/
|
|
2328
2328
|
s(this, "directionsSum");
|
|
2329
|
-
this.items = r.items.map((e) => new
|
|
2329
|
+
this.items = r.items.map((e) => new Gr(e)), this.resultSum = r.resultSum, this.directionsSum = r.directionsSum;
|
|
2330
2330
|
}
|
|
2331
2331
|
}
|
|
2332
|
-
class
|
|
2332
|
+
class vi extends h {
|
|
2333
2333
|
/**
|
|
2334
2334
|
* Возвращает содержимое корзины указанного клиента.
|
|
2335
2335
|
*
|
|
@@ -2443,7 +2443,7 @@ class wi extends h {
|
|
|
2443
2443
|
return this.get(`internal/clients/${r.id}/cart/add-products-from-csv/example`, {}, (e) => new Blob([e.data], { type: "text/csv" }));
|
|
2444
2444
|
}
|
|
2445
2445
|
}
|
|
2446
|
-
var
|
|
2446
|
+
var Ss = /* @__PURE__ */ ((n) => (n.m2Cost = "m2Cost", n.percent = "percent", n.value = "value", n))(Ss || {}), $s = /* @__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))($s || {}), bt = /* @__PURE__ */ ((n) => (n.Checkbox = "checkbox", n.Range = "range", n.Toggle = "toggle", n))(bt || {});
|
|
2447
2447
|
class Y extends ge {
|
|
2448
2448
|
/**
|
|
2449
2449
|
* Инициализирует экземпляр класса {@link Category}.
|
|
@@ -2464,7 +2464,7 @@ class Y extends ge {
|
|
|
2464
2464
|
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new Y(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new E(o));
|
|
2465
2465
|
}
|
|
2466
2466
|
}
|
|
2467
|
-
class
|
|
2467
|
+
class dt {
|
|
2468
2468
|
/**
|
|
2469
2469
|
* Инициализирует экземпляр класса {@link ContactLinks}.
|
|
2470
2470
|
*
|
|
@@ -2484,7 +2484,7 @@ class bt {
|
|
|
2484
2484
|
}
|
|
2485
2485
|
class F extends C {
|
|
2486
2486
|
}
|
|
2487
|
-
class
|
|
2487
|
+
class zr extends nr {
|
|
2488
2488
|
/**
|
|
2489
2489
|
* Инициализирует экземпляр класса {@link ManagerCommon}.
|
|
2490
2490
|
*
|
|
@@ -2512,12 +2512,12 @@ class Br extends ir {
|
|
|
2512
2512
|
* @inheritDoc
|
|
2513
2513
|
*/
|
|
2514
2514
|
s(this, "isRegionalDirector");
|
|
2515
|
-
this.salesDirection = e != null && e.salesDirection ? new F(e.salesDirection) : new F(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new
|
|
2515
|
+
this.salesDirection = e != null && e.salesDirection ? new F(e.salesDirection) : new F(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new dt(e.contacts) : void 0, this.isDefault = (e == null ? void 0 : e.isDefault) ?? !1, this.isRegionalDirector = (e == null ? void 0 : e.isRegionalDirector) ?? !1;
|
|
2516
2516
|
}
|
|
2517
2517
|
}
|
|
2518
|
-
class
|
|
2518
|
+
class Wr extends C {
|
|
2519
2519
|
}
|
|
2520
|
-
class
|
|
2520
|
+
class At extends N {
|
|
2521
2521
|
/**
|
|
2522
2522
|
* Инициализирует экземпляр класса {@link IUserPricingRole}.
|
|
2523
2523
|
*
|
|
@@ -2540,7 +2540,7 @@ class dt extends N {
|
|
|
2540
2540
|
this.description = e.description, this.canChangeLowCost = e.canChangeLowCost, this.parentRoleId = e.parentRoleId;
|
|
2541
2541
|
}
|
|
2542
2542
|
}
|
|
2543
|
-
class
|
|
2543
|
+
class cr extends N {
|
|
2544
2544
|
/**
|
|
2545
2545
|
* Инициализирует экземпляр класса {@link UserRegionShortInfo}.
|
|
2546
2546
|
*
|
|
@@ -2555,7 +2555,7 @@ class or extends N {
|
|
|
2555
2555
|
this.abbr = (e == null ? void 0 : e.abbr) ?? "";
|
|
2556
2556
|
}
|
|
2557
2557
|
}
|
|
2558
|
-
class Z extends
|
|
2558
|
+
class Z extends zr {
|
|
2559
2559
|
/**
|
|
2560
2560
|
* Инициализирует экземпляр класса {@link Manager}.
|
|
2561
2561
|
*
|
|
@@ -2608,10 +2608,10 @@ class Z extends Br {
|
|
|
2608
2608
|
* Дата и время последнего входа в систему.
|
|
2609
2609
|
*/
|
|
2610
2610
|
s(this, "lastLoginAt");
|
|
2611
|
-
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.supervisorId = e == null ? void 0 : e.supervisorId, this.pricingRole = e != null && e.pricingRole ? new
|
|
2611
|
+
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.supervisorId = e == null ? void 0 : e.supervisorId, this.pricingRole = e != null && e.pricingRole ? new At(e.pricingRole) : void 0, this.curatedDirections = ((t = e == null ? void 0 : e.curatedDirections) == null ? void 0 : t.map((c) => new Wr(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 cr(c)), this.managers = (o = e == null ? void 0 : e.managers) == null ? void 0 : o.map((c) => new Z(c)), this.lastLoginAt = I(e == null ? void 0 : e.lastLoginAt) ? _(e.lastLoginAt) : e == null ? void 0 : e.lastLoginAt;
|
|
2612
2612
|
}
|
|
2613
2613
|
}
|
|
2614
|
-
class
|
|
2614
|
+
class ks extends ge {
|
|
2615
2615
|
/**
|
|
2616
2616
|
* Инициализирует экземпляр класса {@link BaseClientCategory}.
|
|
2617
2617
|
*
|
|
@@ -2642,7 +2642,7 @@ class Ss extends ge {
|
|
|
2642
2642
|
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;
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
|
-
class
|
|
2645
|
+
class tr extends ks {
|
|
2646
2646
|
/**
|
|
2647
2647
|
* Инициализирует экземпляр класса {@link ClientCategory}.
|
|
2648
2648
|
*
|
|
@@ -2659,10 +2659,10 @@ class rr extends Ss {
|
|
|
2659
2659
|
* Список продуктов категории.
|
|
2660
2660
|
*/
|
|
2661
2661
|
s(this, "products");
|
|
2662
|
-
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new
|
|
2662
|
+
this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new tr(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new Pe(o));
|
|
2663
2663
|
}
|
|
2664
2664
|
}
|
|
2665
|
-
class
|
|
2665
|
+
class St {
|
|
2666
2666
|
/**
|
|
2667
2667
|
* Инициализирует экземпляр класса {@link PriceCatalogableItem}.
|
|
2668
2668
|
*
|
|
@@ -2680,7 +2680,7 @@ class At {
|
|
|
2680
2680
|
this.priceCoefficient = (r == null ? void 0 : r.priceCoefficient) && new he(r.priceCoefficient), this.increasePercent = r == null ? void 0 : r.increasePercent;
|
|
2681
2681
|
}
|
|
2682
2682
|
}
|
|
2683
|
-
class
|
|
2683
|
+
class $t extends St {
|
|
2684
2684
|
/**
|
|
2685
2685
|
* Инициализирует экземпляр класса {@link PriceTemplateICatalogableItem}.
|
|
2686
2686
|
*
|
|
@@ -2690,7 +2690,7 @@ class St extends At {
|
|
|
2690
2690
|
super(r);
|
|
2691
2691
|
}
|
|
2692
2692
|
}
|
|
2693
|
-
class
|
|
2693
|
+
class vr extends $t {
|
|
2694
2694
|
/**
|
|
2695
2695
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
2696
2696
|
*
|
|
@@ -2705,7 +2705,7 @@ class wr extends St {
|
|
|
2705
2705
|
this.productCategory = new ge(e == null ? void 0 : e.productCategory);
|
|
2706
2706
|
}
|
|
2707
2707
|
}
|
|
2708
|
-
class
|
|
2708
|
+
class jr extends N {
|
|
2709
2709
|
/**
|
|
2710
2710
|
* Инициализирует экземпляр класса {@link Curator}.
|
|
2711
2711
|
*
|
|
@@ -2725,7 +2725,7 @@ class zr extends N {
|
|
|
2725
2725
|
* @inheritDoc
|
|
2726
2726
|
*/
|
|
2727
2727
|
s(this, "curatedDirection");
|
|
2728
|
-
this.photo = e.photo, this.contacts = new
|
|
2728
|
+
this.photo = e.photo, this.contacts = new dt(e.contacts), this.curatedDirection = new Wr(e.curatedDirection);
|
|
2729
2729
|
}
|
|
2730
2730
|
}
|
|
2731
2731
|
class Te extends C {
|
|
@@ -2760,7 +2760,7 @@ class ee extends C {
|
|
|
2760
2760
|
e && (this.region = new ne(e.region));
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
|
-
class
|
|
2763
|
+
class kt extends nr {
|
|
2764
2764
|
/**
|
|
2765
2765
|
* Инициализирует экземпляр класса {@link UserCommonInfo}.
|
|
2766
2766
|
*
|
|
@@ -2795,7 +2795,7 @@ class $t extends ir {
|
|
|
2795
2795
|
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 F(e.salesDirection) : void 0, this.lastLoginAt = I(e == null ? void 0 : e.lastLoginAt) ? _(e.lastLoginAt) : e == null ? void 0 : e.lastLoginAt, this.isActive = (e == null ? void 0 : e.isActive) ?? !1;
|
|
2796
2796
|
}
|
|
2797
2797
|
}
|
|
2798
|
-
class fe extends
|
|
2798
|
+
class fe extends kt {
|
|
2799
2799
|
/**
|
|
2800
2800
|
* Инициализирует экземпляр класса {@link Client}.
|
|
2801
2801
|
*
|
|
@@ -2841,10 +2841,10 @@ class fe extends $t {
|
|
|
2841
2841
|
* @inheritDoc
|
|
2842
2842
|
*/
|
|
2843
2843
|
s(this, "curators");
|
|
2844
|
-
this.salesDirection = new F(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 ee(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
|
|
2844
|
+
this.salesDirection = new F(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 ee(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 zr(o))) ?? [], this.curators = ((i = e == null ? void 0 : e.curators) == null ? void 0 : i.map((o) => new jr(o))) ?? void 0;
|
|
2845
2845
|
}
|
|
2846
2846
|
}
|
|
2847
|
-
class
|
|
2847
|
+
class Os extends ir {
|
|
2848
2848
|
/**
|
|
2849
2849
|
* Инициализирует экземпляр класса {@link DeletableIdentity}.
|
|
2850
2850
|
*
|
|
@@ -2860,7 +2860,7 @@ class $s extends sr {
|
|
|
2860
2860
|
this.deletedAt = O.parse(e == null ? void 0 : e.deletedAt);
|
|
2861
2861
|
}
|
|
2862
2862
|
}
|
|
2863
|
-
class xe extends
|
|
2863
|
+
class xe extends Os {
|
|
2864
2864
|
/**
|
|
2865
2865
|
* Инициализирует новый экземпляр класса.
|
|
2866
2866
|
*
|
|
@@ -2879,7 +2879,7 @@ class xe extends $s {
|
|
|
2879
2879
|
this.client = new fe(e == null ? void 0 : e.client), this.priceTemplate = new Ce(e == null ? void 0 : e.priceTemplate);
|
|
2880
2880
|
}
|
|
2881
2881
|
}
|
|
2882
|
-
class
|
|
2882
|
+
class Cr extends $t {
|
|
2883
2883
|
/**
|
|
2884
2884
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
2885
2885
|
*
|
|
@@ -2894,7 +2894,7 @@ class vr extends St {
|
|
|
2894
2894
|
this.product = new E(e == null ? void 0 : e.product);
|
|
2895
2895
|
}
|
|
2896
2896
|
}
|
|
2897
|
-
class
|
|
2897
|
+
class Ot extends C {
|
|
2898
2898
|
}
|
|
2899
2899
|
class De extends N {
|
|
2900
2900
|
/**
|
|
@@ -2920,7 +2920,7 @@ class De extends N {
|
|
|
2920
2920
|
* Признак того, что по свойству может производиться фильтрация в каталоге.
|
|
2921
2921
|
*/
|
|
2922
2922
|
s(this, "isFilterable");
|
|
2923
|
-
this.type = new
|
|
2923
|
+
this.type = new Ot(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;
|
|
2924
2924
|
}
|
|
2925
2925
|
}
|
|
2926
2926
|
class ve {
|
|
@@ -2942,7 +2942,7 @@ class ve {
|
|
|
2942
2942
|
this.property = new De(r == null ? void 0 : r.property), this.value = (r == null ? void 0 : r.value) ?? "";
|
|
2943
2943
|
}
|
|
2944
2944
|
}
|
|
2945
|
-
class
|
|
2945
|
+
class Ci {
|
|
2946
2946
|
/**
|
|
2947
2947
|
* Инициализирует экземпляр класса {@link TemplatesListFilters}.
|
|
2948
2948
|
*
|
|
@@ -3007,11 +3007,11 @@ class vi {
|
|
|
3007
3007
|
return Object.keys(this).forEach((c) => {
|
|
3008
3008
|
const u = this[c];
|
|
3009
3009
|
// eslint-disable-next-line prettier/prettier
|
|
3010
|
-
m(u) || I(u) && u.trim().length === 0 ||
|
|
3010
|
+
m(u) || I(u) && u.trim().length === 0 || Er(u.isNewRec) && u.isNewRec() || (r[c] = u);
|
|
3011
3011
|
}), !((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;
|
|
3012
3012
|
}
|
|
3013
3013
|
}
|
|
3014
|
-
class
|
|
3014
|
+
class Lt extends St {
|
|
3015
3015
|
/**
|
|
3016
3016
|
* Инициализирует экземпляр класса {@link ClientPriceCatalogableItem}.
|
|
3017
3017
|
*
|
|
@@ -3030,7 +3030,7 @@ class Ot extends At {
|
|
|
3030
3030
|
this.executor = e != null && e.executor ? new q(e.executor) : void 0, this.createdAt = O.parse(e == null ? void 0 : e.createdAt);
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
|
-
class
|
|
3033
|
+
class Dr extends Lt {
|
|
3034
3034
|
/**
|
|
3035
3035
|
* Инициализирует экземпляр класса {@link ClientPriceProduct}.
|
|
3036
3036
|
*
|
|
@@ -3045,7 +3045,7 @@ class Cr extends Ot {
|
|
|
3045
3045
|
this.product = new E(e == null ? void 0 : e.product);
|
|
3046
3046
|
}
|
|
3047
3047
|
}
|
|
3048
|
-
class
|
|
3048
|
+
class st extends Lt {
|
|
3049
3049
|
/**
|
|
3050
3050
|
* Инициализирует экземпляр класса {@link ClientPriceCategory}.
|
|
3051
3051
|
*
|
|
@@ -3095,7 +3095,7 @@ class Ie extends N {
|
|
|
3095
3095
|
this.description = e == null ? void 0 : e.description, this.canChangeLowCost = (e == null ? void 0 : e.canChangeLowCost) ?? !1, this.parentRoleId = e == null ? void 0 : e.parentRoleId;
|
|
3096
3096
|
}
|
|
3097
3097
|
}
|
|
3098
|
-
class
|
|
3098
|
+
class it {
|
|
3099
3099
|
/**
|
|
3100
3100
|
* Инициализирует экземпляр класса {@link PricingRoleCategoryRule}.
|
|
3101
3101
|
*
|
|
@@ -3117,7 +3117,7 @@ class tt {
|
|
|
3117
3117
|
this.role = new Ie(r == null ? void 0 : r.role), this.category = new ge(r == null ? void 0 : r.category), this.minCoefficient = new he(r == null ? void 0 : r.minCoefficient);
|
|
3118
3118
|
}
|
|
3119
3119
|
}
|
|
3120
|
-
class
|
|
3120
|
+
class Ls {
|
|
3121
3121
|
/**
|
|
3122
3122
|
* Инициализирует экземпляр класса {@link FilterSettings}.
|
|
3123
3123
|
*
|
|
@@ -3150,7 +3150,7 @@ class ks {
|
|
|
3150
3150
|
this.isFake = (r == null ? void 0 : r.isFake) ?? !1, this.isHidden = (r == null ? void 0 : r.isHidden) ?? !1, this.isMultiple = (r == null ? void 0 : r.isMultiple) ?? null, this.type = (r == null ? void 0 : r.type) ?? null, this.ord = (r == null ? void 0 : r.ord) ?? 0;
|
|
3151
3151
|
}
|
|
3152
3152
|
}
|
|
3153
|
-
class
|
|
3153
|
+
class nt {
|
|
3154
3154
|
/**
|
|
3155
3155
|
* Инициализирует экземпляр класса {@link CategoryFilterSetting}.
|
|
3156
3156
|
*
|
|
@@ -3169,10 +3169,10 @@ class st {
|
|
|
3169
3169
|
* @inheritDoc
|
|
3170
3170
|
*/
|
|
3171
3171
|
s(this, "settings");
|
|
3172
|
-
this.category = new ge(r == null ? void 0 : r.category), this.property = new De(r == null ? void 0 : r.property), this.settings = new
|
|
3172
|
+
this.category = new ge(r == null ? void 0 : r.category), this.property = new De(r == null ? void 0 : r.property), this.settings = new Ls(r == null ? void 0 : r.settings);
|
|
3173
3173
|
}
|
|
3174
3174
|
}
|
|
3175
|
-
class
|
|
3175
|
+
class xs {
|
|
3176
3176
|
/**
|
|
3177
3177
|
* Инициализирует экземпляр класса {@link CategoryFilterValue}.
|
|
3178
3178
|
*
|
|
@@ -3190,7 +3190,7 @@ class Os {
|
|
|
3190
3190
|
this.id = (r == null ? void 0 : r.id) ?? "", this.label = (r == null ? void 0 : r.label) ?? "";
|
|
3191
3191
|
}
|
|
3192
3192
|
}
|
|
3193
|
-
class
|
|
3193
|
+
class Is {
|
|
3194
3194
|
/**
|
|
3195
3195
|
* Инициализирует экземпляр класса {@link CategoryFilter}.
|
|
3196
3196
|
*
|
|
@@ -3233,10 +3233,10 @@ class Ls {
|
|
|
3233
3233
|
*/
|
|
3234
3234
|
s(this, "max");
|
|
3235
3235
|
var e;
|
|
3236
|
-
this.id = (r == null ? void 0 : r.id) ?? "", this.label = (r == null ? void 0 : r.label) ?? "", this.type = (r == null ? void 0 : r.type) ??
|
|
3236
|
+
this.id = (r == null ? void 0 : r.id) ?? "", this.label = (r == null ? void 0 : r.label) ?? "", this.type = (r == null ? void 0 : r.type) ?? bt.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 xs(t))) ?? [], this.min = (r == null ? void 0 : r.min) ?? null, this.max = (r == null ? void 0 : r.max) ?? null;
|
|
3237
3237
|
}
|
|
3238
3238
|
}
|
|
3239
|
-
class
|
|
3239
|
+
class Di extends h {
|
|
3240
3240
|
/**
|
|
3241
3241
|
* Возвращает данные о результатах поиска категорий и товаров.
|
|
3242
3242
|
*
|
|
@@ -3263,11 +3263,11 @@ class Ci extends h {
|
|
|
3263
3263
|
*/
|
|
3264
3264
|
// eslint-disable-next-line class-methods-use-this
|
|
3265
3265
|
getPriceExportLink(r = "csv", e = !1, t = void 0, i = void 0) {
|
|
3266
|
-
let c = `${
|
|
3266
|
+
let c = `${$().config.http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;
|
|
3267
3267
|
return t && (c += `&category_id=${t}`), i && (c += `&client_id=${i}`), c;
|
|
3268
3268
|
}
|
|
3269
3269
|
}
|
|
3270
|
-
class
|
|
3270
|
+
class Ri extends h {
|
|
3271
3271
|
/**
|
|
3272
3272
|
* Импортирует цены клиента из CSV файла.
|
|
3273
3273
|
*
|
|
@@ -3288,7 +3288,7 @@ class Di extends h {
|
|
|
3288
3288
|
* @see /doc/api/internal#/operations/api_internal_client_price_categories_get_list
|
|
3289
3289
|
*/
|
|
3290
3290
|
getCategoryPrices(r) {
|
|
3291
|
-
return this.getTypedList(
|
|
3291
|
+
return this.getTypedList(st, `/internal/clients/${r}/price/categories`);
|
|
3292
3292
|
}
|
|
3293
3293
|
/**
|
|
3294
3294
|
* Возвращает цену прайс-листа клиента, установленную на категорию.
|
|
@@ -3299,7 +3299,7 @@ class Di extends h {
|
|
|
3299
3299
|
* @see /doc/api/internal#/operations/api_internal_client_price_categories_get
|
|
3300
3300
|
*/
|
|
3301
3301
|
getCategoryPrice(r, e) {
|
|
3302
|
-
return this.get(`/internal/clients/${r}/price/categories/${e}`, {}, (t) => new
|
|
3302
|
+
return this.get(`/internal/clients/${r}/price/categories/${e}`, {}, (t) => new st(t.data));
|
|
3303
3303
|
}
|
|
3304
3304
|
/**
|
|
3305
3305
|
* Устанавливает цену прайс-листа клиента на категорию.
|
|
@@ -3431,7 +3431,7 @@ class Di extends h {
|
|
|
3431
3431
|
* @see /doc/api/internal#/operations/api_internal_client_price_products_get_list
|
|
3432
3432
|
*/
|
|
3433
3433
|
getProductPrices(r) {
|
|
3434
|
-
return this.getTypedList(
|
|
3434
|
+
return this.getTypedList(Dr, `/internal/clients/${r}/price/products`);
|
|
3435
3435
|
}
|
|
3436
3436
|
/**
|
|
3437
3437
|
* Возвращает цену прайс-листа клиента, установленную на продукт.
|
|
@@ -3442,7 +3442,7 @@ class Di extends h {
|
|
|
3442
3442
|
* @see /doc/api/internal#/operations/api_internal_client_price_products_get
|
|
3443
3443
|
*/
|
|
3444
3444
|
getProductPrice(r, e) {
|
|
3445
|
-
return this.get(`/internal/clients/${r}/price/products/${e}`, {}, (t) => new
|
|
3445
|
+
return this.get(`/internal/clients/${r}/price/products/${e}`, {}, (t) => new Dr(t.data));
|
|
3446
3446
|
}
|
|
3447
3447
|
/**
|
|
3448
3448
|
* Устанавливает цену прайс-листа клиента на продукт.
|
|
@@ -3461,7 +3461,7 @@ class Di extends h {
|
|
|
3461
3461
|
price_coefficient_id: (i = t.coefficient) == null ? void 0 : i.id,
|
|
3462
3462
|
increase_percent: t.value
|
|
3463
3463
|
},
|
|
3464
|
-
(o) => new
|
|
3464
|
+
(o) => new Dr(o.data)
|
|
3465
3465
|
);
|
|
3466
3466
|
}
|
|
3467
3467
|
/**
|
|
@@ -3536,7 +3536,7 @@ class Di extends h {
|
|
|
3536
3536
|
return this.post(`/internal/clients/${r}/price/commercial-offer/send`, e);
|
|
3537
3537
|
}
|
|
3538
3538
|
}
|
|
3539
|
-
class
|
|
3539
|
+
class Pi extends h {
|
|
3540
3540
|
/**
|
|
3541
3541
|
* Возвращает список шаблонов прайс-листа привязанных к клиенту.
|
|
3542
3542
|
*
|
|
@@ -3567,12 +3567,12 @@ class Ri extends h {
|
|
|
3567
3567
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_attach
|
|
3568
3568
|
*/
|
|
3569
3569
|
attachTemplate(r, e, t) {
|
|
3570
|
-
const i =
|
|
3570
|
+
const i = $().config.dateFormats.api;
|
|
3571
3571
|
return this.post(
|
|
3572
3572
|
`/internal/clients/${r}/price/templates/${e}`,
|
|
3573
3573
|
t && {
|
|
3574
|
-
startAt: t.startAt &&
|
|
3575
|
-
endAt: t.endAt &&
|
|
3574
|
+
startAt: t.startAt && S(t.startAt, i),
|
|
3575
|
+
endAt: t.endAt && S(t.endAt, i)
|
|
3576
3576
|
},
|
|
3577
3577
|
(o) => new xe(o.data),
|
|
3578
3578
|
{},
|
|
@@ -3601,12 +3601,12 @@ class Ri extends h {
|
|
|
3601
3601
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_change
|
|
3602
3602
|
*/
|
|
3603
3603
|
changeTemplate(r, e, t, i) {
|
|
3604
|
-
const o =
|
|
3604
|
+
const o = $().config.dateFormats.api;
|
|
3605
3605
|
return this.patch(
|
|
3606
3606
|
`/internal/clients/${r}/price/templates/${e}/${t}`,
|
|
3607
3607
|
i && {
|
|
3608
|
-
startAt: i.startAt &&
|
|
3609
|
-
endAt: i.endAt &&
|
|
3608
|
+
startAt: i.startAt && S(i.startAt, o),
|
|
3609
|
+
endAt: i.endAt && S(i.endAt, o)
|
|
3610
3610
|
},
|
|
3611
3611
|
(c) => new xe(c.data)
|
|
3612
3612
|
);
|
|
@@ -3624,7 +3624,7 @@ class Ri extends h {
|
|
|
3624
3624
|
return this.delete(`/internal/clients/${r}/price/templates/${e}/${t}`);
|
|
3625
3625
|
}
|
|
3626
3626
|
}
|
|
3627
|
-
class
|
|
3627
|
+
class Ti extends h {
|
|
3628
3628
|
/**
|
|
3629
3629
|
* Возвращает список данных о корневых категориях.
|
|
3630
3630
|
*
|
|
@@ -3693,7 +3693,7 @@ class Pi extends h {
|
|
|
3693
3693
|
getCategoryProductsCoefficients(r) {
|
|
3694
3694
|
return this.get(`/internal/catalog/categories/${r}/products/coefficients`, {}, (e) => {
|
|
3695
3695
|
const { data: t } = e;
|
|
3696
|
-
return
|
|
3696
|
+
return ss(t, (i) => i.map((o) => new Hr(o))), t;
|
|
3697
3697
|
});
|
|
3698
3698
|
}
|
|
3699
3699
|
/**
|
|
@@ -3712,7 +3712,7 @@ class Pi extends h {
|
|
|
3712
3712
|
});
|
|
3713
3713
|
}
|
|
3714
3714
|
}
|
|
3715
|
-
class
|
|
3715
|
+
class bi extends M {
|
|
3716
3716
|
/**
|
|
3717
3717
|
* Возвращает данные об указанном продукте.
|
|
3718
3718
|
*
|
|
@@ -3743,7 +3743,7 @@ class Ti extends M {
|
|
|
3743
3743
|
return this.get(
|
|
3744
3744
|
`/internal/catalog/products/${r}/coefficients`,
|
|
3745
3745
|
{},
|
|
3746
|
-
(e) => P(e.data, (t) => new
|
|
3746
|
+
(e) => P(e.data, (t) => new Hr(t))
|
|
3747
3747
|
);
|
|
3748
3748
|
}
|
|
3749
3749
|
/**
|
|
@@ -3756,9 +3756,9 @@ class Ti extends M {
|
|
|
3756
3756
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_new_products_by_period_get
|
|
3757
3757
|
*/
|
|
3758
3758
|
getNewProducts(r, e, t = !0) {
|
|
3759
|
-
const i =
|
|
3759
|
+
const i = $().config.dateFormats.api;
|
|
3760
3760
|
return this.getTypedPaginated(E, "/internal/catalog/products/new", void 0, void 0, e, {
|
|
3761
|
-
period: { from:
|
|
3761
|
+
period: { from: S(r, i) },
|
|
3762
3762
|
withPriceCoefficients: t
|
|
3763
3763
|
});
|
|
3764
3764
|
}
|
|
@@ -3778,7 +3778,7 @@ class Ti extends M {
|
|
|
3778
3778
|
});
|
|
3779
3779
|
}
|
|
3780
3780
|
}
|
|
3781
|
-
class
|
|
3781
|
+
class di extends h {
|
|
3782
3782
|
/**
|
|
3783
3783
|
* Возвращает список данных о корневых категориях указанного клиента.
|
|
3784
3784
|
*
|
|
@@ -3788,7 +3788,7 @@ class bi extends h {
|
|
|
3788
3788
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_categories_get_list
|
|
3789
3789
|
*/
|
|
3790
3790
|
getRootCategoriesList(r, e = !1) {
|
|
3791
|
-
return this.getTypedList(
|
|
3791
|
+
return this.getTypedList(tr, "/internal/catalog/categories", {
|
|
3792
3792
|
clientId: r,
|
|
3793
3793
|
showHidden: e
|
|
3794
3794
|
});
|
|
@@ -3811,7 +3811,7 @@ class bi extends h {
|
|
|
3811
3811
|
showHidden: t,
|
|
3812
3812
|
withNestedCategories: i
|
|
3813
3813
|
},
|
|
3814
|
-
(o) => new
|
|
3814
|
+
(o) => new tr(o.data)
|
|
3815
3815
|
);
|
|
3816
3816
|
}
|
|
3817
3817
|
/**
|
|
@@ -3836,7 +3836,7 @@ class bi extends h {
|
|
|
3836
3836
|
);
|
|
3837
3837
|
}
|
|
3838
3838
|
}
|
|
3839
|
-
class
|
|
3839
|
+
class Ai extends M {
|
|
3840
3840
|
/**
|
|
3841
3841
|
* Возвращает данные об указанном продукте для указанного клиента.
|
|
3842
3842
|
*
|
|
@@ -3867,15 +3867,15 @@ class di extends M {
|
|
|
3867
3867
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_new_products_by_period_get
|
|
3868
3868
|
*/
|
|
3869
3869
|
getNewProducts(r, e, t, i = !0) {
|
|
3870
|
-
const o =
|
|
3870
|
+
const o = $().config.dateFormats.api;
|
|
3871
3871
|
return this.getTypedPaginated(Pe, "/internal/catalog/products/new", void 0, void 0, t, {
|
|
3872
3872
|
clientId: r,
|
|
3873
|
-
period: { from:
|
|
3873
|
+
period: { from: S(e, o) },
|
|
3874
3874
|
withPriceCoefficients: i
|
|
3875
3875
|
});
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
3878
|
-
class
|
|
3878
|
+
class Si extends M {
|
|
3879
3879
|
/**
|
|
3880
3880
|
* Возвращает список шаблонов прайс-листа.
|
|
3881
3881
|
*
|
|
@@ -3941,7 +3941,7 @@ class Ai extends M {
|
|
|
3941
3941
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_product_get_list
|
|
3942
3942
|
*/
|
|
3943
3943
|
getProductTemplatePrices(r) {
|
|
3944
|
-
return this.getTypedList(
|
|
3944
|
+
return this.getTypedList(Cr, `/internal/price/templates/${r}/products`);
|
|
3945
3945
|
}
|
|
3946
3946
|
/**
|
|
3947
3947
|
* Возвращает данные о цене на продукт в шаблоне прайс-листа.
|
|
@@ -3952,7 +3952,7 @@ class Ai extends M {
|
|
|
3952
3952
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_product_get
|
|
3953
3953
|
*/
|
|
3954
3954
|
getProductTemplatePrice(r, e) {
|
|
3955
|
-
return this.get(`/internal/price/templates/${r}/products/${e}`, {}, (t) => new
|
|
3955
|
+
return this.get(`/internal/price/templates/${r}/products/${e}`, {}, (t) => new Cr(t.data));
|
|
3956
3956
|
}
|
|
3957
3957
|
/**
|
|
3958
3958
|
* Сохраняет цену на продукт в шаблоне прайс-листа.
|
|
@@ -3971,7 +3971,7 @@ class Ai extends M {
|
|
|
3971
3971
|
price_coefficient_id: (i = t.coefficient) == null ? void 0 : i.id,
|
|
3972
3972
|
increase_percent: t.value
|
|
3973
3973
|
},
|
|
3974
|
-
(o) => new
|
|
3974
|
+
(o) => new Cr(o.data)
|
|
3975
3975
|
);
|
|
3976
3976
|
}
|
|
3977
3977
|
/**
|
|
@@ -3993,7 +3993,7 @@ class Ai extends M {
|
|
|
3993
3993
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_category_get_list
|
|
3994
3994
|
*/
|
|
3995
3995
|
getCategoryTemplatePrices(r) {
|
|
3996
|
-
return this.getTypedList(
|
|
3996
|
+
return this.getTypedList(vr, `/internal/price/templates/${r}/categories`);
|
|
3997
3997
|
}
|
|
3998
3998
|
/**
|
|
3999
3999
|
* Возвращает данные о цене на категорию продуктов в шаблоне прайс-листа.
|
|
@@ -4007,7 +4007,7 @@ class Ai extends M {
|
|
|
4007
4007
|
return this.get(
|
|
4008
4008
|
`/internal/price/templates/${r}/categories/${e}`,
|
|
4009
4009
|
{},
|
|
4010
|
-
(t) => new
|
|
4010
|
+
(t) => new vr(t.data)
|
|
4011
4011
|
);
|
|
4012
4012
|
}
|
|
4013
4013
|
/**
|
|
@@ -4033,7 +4033,7 @@ class Ai extends M {
|
|
|
4033
4033
|
},
|
|
4034
4034
|
params: i ? { recursively: !0 } : {}
|
|
4035
4035
|
},
|
|
4036
|
-
(c) => new
|
|
4036
|
+
(c) => new vr(c.data)
|
|
4037
4037
|
);
|
|
4038
4038
|
}
|
|
4039
4039
|
/**
|
|
@@ -4064,7 +4064,7 @@ class Ai extends M {
|
|
|
4064
4064
|
return this.getTypedList(xe, `/internal/price/templates/${r}/clients`);
|
|
4065
4065
|
}
|
|
4066
4066
|
}
|
|
4067
|
-
class
|
|
4067
|
+
class $i extends h {
|
|
4068
4068
|
/**
|
|
4069
4069
|
* Возвращает список ролей ценообразования.
|
|
4070
4070
|
*
|
|
@@ -4122,7 +4122,7 @@ class Si extends h {
|
|
|
4122
4122
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_category_rules_get
|
|
4123
4123
|
*/
|
|
4124
4124
|
getCategoryRules(r) {
|
|
4125
|
-
return this.getTypedList(
|
|
4125
|
+
return this.getTypedList(it, `/internal/price/roles/rules/categories/${r}`);
|
|
4126
4126
|
}
|
|
4127
4127
|
/**
|
|
4128
4128
|
* Обновляет правила для роли ценообразования по указанной категории.
|
|
@@ -4136,11 +4136,11 @@ class Si extends h {
|
|
|
4136
4136
|
return this.patch(
|
|
4137
4137
|
`/internal/price/roles/rules/categories/${r}`,
|
|
4138
4138
|
e,
|
|
4139
|
-
(t) => U.instanceListInitializer(
|
|
4139
|
+
(t) => U.instanceListInitializer(it, t.data)
|
|
4140
4140
|
);
|
|
4141
4141
|
}
|
|
4142
4142
|
}
|
|
4143
|
-
class
|
|
4143
|
+
class ki extends M {
|
|
4144
4144
|
/**
|
|
4145
4145
|
* Возвращает пагинированный список свойств.
|
|
4146
4146
|
*
|
|
@@ -4519,7 +4519,7 @@ class $i extends M {
|
|
|
4519
4519
|
return this.get(
|
|
4520
4520
|
`/internal/catalog/categories/${r}/filters`,
|
|
4521
4521
|
{ recursively: e },
|
|
4522
|
-
(t) => t.data.map((i) => new
|
|
4522
|
+
(t) => t.data.map((i) => new Is(i))
|
|
4523
4523
|
);
|
|
4524
4524
|
}
|
|
4525
4525
|
/**
|
|
@@ -4529,7 +4529,7 @@ class $i extends M {
|
|
|
4529
4529
|
* @see /doc/api/internal#/operations/api_internal_catalog_categories_filter_settings_get_list
|
|
4530
4530
|
*/
|
|
4531
4531
|
getCategoryFilterSettings(r) {
|
|
4532
|
-
return this.getTypedList(
|
|
4532
|
+
return this.getTypedList(nt, `/internal/catalog/categories/${r}/filter-settings`);
|
|
4533
4533
|
}
|
|
4534
4534
|
/**
|
|
4535
4535
|
* Сохраняет настройки фильтра в категории.
|
|
@@ -4543,7 +4543,7 @@ class $i extends M {
|
|
|
4543
4543
|
return this.patch(
|
|
4544
4544
|
`/internal/catalog/categories/${r}/filter-settings/${e}`,
|
|
4545
4545
|
t,
|
|
4546
|
-
(i) => new
|
|
4546
|
+
(i) => new nt(i.data)
|
|
4547
4547
|
);
|
|
4548
4548
|
}
|
|
4549
4549
|
/**
|
|
@@ -4557,7 +4557,7 @@ class $i extends M {
|
|
|
4557
4557
|
return this.delete(`/internal/catalog/categories/${r}/filter-settings/${e}`);
|
|
4558
4558
|
}
|
|
4559
4559
|
}
|
|
4560
|
-
class
|
|
4560
|
+
class Oi extends h {
|
|
4561
4561
|
/**
|
|
4562
4562
|
* Возвращает список данных о корневых категориях указанного шаблона прайс-листа.
|
|
4563
4563
|
*
|
|
@@ -4615,7 +4615,7 @@ class ki extends h {
|
|
|
4615
4615
|
);
|
|
4616
4616
|
}
|
|
4617
4617
|
}
|
|
4618
|
-
function
|
|
4618
|
+
function ot(n, r, e) {
|
|
4619
4619
|
let t;
|
|
4620
4620
|
return n.some((i) => {
|
|
4621
4621
|
if (i.type === e && i.id === r)
|
|
@@ -4624,29 +4624,29 @@ function it(n, r, e) {
|
|
|
4624
4624
|
return !1;
|
|
4625
4625
|
const o = i;
|
|
4626
4626
|
if (o.products && o.products.length > 0) {
|
|
4627
|
-
const c =
|
|
4627
|
+
const c = ot(o.products, r, e);
|
|
4628
4628
|
if (c)
|
|
4629
4629
|
return t = c, !0;
|
|
4630
4630
|
}
|
|
4631
4631
|
if (o.categories && o.categories.length > 0) {
|
|
4632
|
-
const c =
|
|
4632
|
+
const c = ot(o.categories, r, e);
|
|
4633
4633
|
if (c)
|
|
4634
4634
|
return t = c, !0;
|
|
4635
4635
|
}
|
|
4636
4636
|
return !1;
|
|
4637
4637
|
}), t;
|
|
4638
4638
|
}
|
|
4639
|
-
function
|
|
4639
|
+
function ct(n) {
|
|
4640
4640
|
const r = [];
|
|
4641
4641
|
return n.forEach((e) => {
|
|
4642
4642
|
if (r.push(e), e.type === "category") {
|
|
4643
4643
|
const t = e;
|
|
4644
|
-
t.products && t.products.length > 0 && r.push(...
|
|
4644
|
+
t.products && t.products.length > 0 && r.push(...ct(t.products)), t.categories && t.categories.length > 0 && r.push(...ct(t.categories));
|
|
4645
4645
|
}
|
|
4646
4646
|
}), r;
|
|
4647
4647
|
}
|
|
4648
|
-
var
|
|
4649
|
-
class
|
|
4648
|
+
var _s = /* @__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))(_s || {}), K = /* @__PURE__ */ ((n) => (n.Person = "individual", n.Ic = "entrepreneur", n.UlR = "legal", n.UlNr = "non_resident_legal", n))(K || {});
|
|
4649
|
+
class Lr extends pe {
|
|
4650
4650
|
/**
|
|
4651
4651
|
* Инициализирует экземпляр класса {@link BankAccount}.
|
|
4652
4652
|
*
|
|
@@ -4677,7 +4677,7 @@ class kr extends pe {
|
|
|
4677
4677
|
e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new J(e.currency));
|
|
4678
4678
|
}
|
|
4679
4679
|
}
|
|
4680
|
-
class
|
|
4680
|
+
class xr extends or {
|
|
4681
4681
|
/**
|
|
4682
4682
|
* Инициализирует экземпляр класса {@link Contact}.
|
|
4683
4683
|
*
|
|
@@ -4696,7 +4696,7 @@ class Or extends nr {
|
|
|
4696
4696
|
this.email = e == null ? void 0 : e.email, this.phone = /^\d+$/.test((e == null ? void 0 : e.phone) ?? "") ? `+${e == null ? void 0 : e.phone}` : e == null ? void 0 : e.phone;
|
|
4697
4697
|
}
|
|
4698
4698
|
}
|
|
4699
|
-
class oe extends
|
|
4699
|
+
class oe extends xr {
|
|
4700
4700
|
/**
|
|
4701
4701
|
* Инициализирует экземпляр класса {@link ContactPerson}.
|
|
4702
4702
|
*
|
|
@@ -4738,7 +4738,7 @@ class ce extends C {
|
|
|
4738
4738
|
}
|
|
4739
4739
|
class le extends C {
|
|
4740
4740
|
}
|
|
4741
|
-
class
|
|
4741
|
+
class xt extends or {
|
|
4742
4742
|
/**
|
|
4743
4743
|
* Инициализирует экземпляр класса {@link ContragentBase}.
|
|
4744
4744
|
*
|
|
@@ -4789,13 +4789,13 @@ class Lt extends nr {
|
|
|
4789
4789
|
if (e.bankAccounts) {
|
|
4790
4790
|
const t = [];
|
|
4791
4791
|
e.bankAccounts.forEach((i) => {
|
|
4792
|
-
t.push(new
|
|
4792
|
+
t.push(new Lr(i));
|
|
4793
4793
|
}), this.bankAccounts = t;
|
|
4794
4794
|
}
|
|
4795
4795
|
}
|
|
4796
4796
|
}
|
|
4797
4797
|
}
|
|
4798
|
-
class
|
|
4798
|
+
class qs extends xt {
|
|
4799
4799
|
/**
|
|
4800
4800
|
* Инициализирует экземпляр класса {@link ContragentPerson}.
|
|
4801
4801
|
*
|
|
@@ -4805,7 +4805,7 @@ class Is extends Lt {
|
|
|
4805
4805
|
super(r);
|
|
4806
4806
|
}
|
|
4807
4807
|
}
|
|
4808
|
-
class
|
|
4808
|
+
class It extends xt {
|
|
4809
4809
|
/**
|
|
4810
4810
|
* Инициализирует экземпляр класса {@link ContragentIc}.
|
|
4811
4811
|
*
|
|
@@ -4852,7 +4852,7 @@ class xt extends Lt {
|
|
|
4852
4852
|
e && (this.inn = e.inn ?? "", this.okpo = e.okpo ?? "", this.ogrn = e.ogrn ?? "", this.directorName = e.directorName ?? "", this.directorPosition = e.directorPosition ?? "", this.directorActsOn = e.directorActsOn ?? "", this.legalAddress = e.legalAddress ?? "", this.postalAddress = e.postalAddress ?? "", this.actualAddress = e.actualAddress ?? "");
|
|
4853
4853
|
}
|
|
4854
4854
|
}
|
|
4855
|
-
class
|
|
4855
|
+
class _t extends It {
|
|
4856
4856
|
/**
|
|
4857
4857
|
* Инициализирует экземпляр класса {@link ContragentUlR}.
|
|
4858
4858
|
*
|
|
@@ -4867,7 +4867,7 @@ class It extends xt {
|
|
|
4867
4867
|
e && (this.kpp = e.kpp ?? "");
|
|
4868
4868
|
}
|
|
4869
4869
|
}
|
|
4870
|
-
class
|
|
4870
|
+
class Ns extends _t {
|
|
4871
4871
|
/**
|
|
4872
4872
|
* Инициализирует экземпляр класса {@link ContragentUlNr}.
|
|
4873
4873
|
*
|
|
@@ -4890,7 +4890,7 @@ class _s extends It {
|
|
|
4890
4890
|
e && (this.registrationCountry = new Te(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
4891
4891
|
}
|
|
4892
4892
|
}
|
|
4893
|
-
class
|
|
4893
|
+
class sr {
|
|
4894
4894
|
/**
|
|
4895
4895
|
* Инициализирует и возвращает экземпляр класса с данными о контрагенте.
|
|
4896
4896
|
*
|
|
@@ -4899,17 +4899,17 @@ class tr {
|
|
|
4899
4899
|
static createInstance(r) {
|
|
4900
4900
|
switch (r.opf.slug) {
|
|
4901
4901
|
case K.Ic:
|
|
4902
|
-
return new xt(r);
|
|
4903
|
-
case K.UlR:
|
|
4904
4902
|
return new It(r);
|
|
4903
|
+
case K.UlR:
|
|
4904
|
+
return new _t(r);
|
|
4905
4905
|
case K.UlNr:
|
|
4906
|
-
return new
|
|
4906
|
+
return new Ns(r);
|
|
4907
4907
|
default:
|
|
4908
|
-
return new
|
|
4908
|
+
return new qs(r);
|
|
4909
4909
|
}
|
|
4910
4910
|
}
|
|
4911
4911
|
}
|
|
4912
|
-
class qe extends
|
|
4912
|
+
class qe extends or {
|
|
4913
4913
|
/**
|
|
4914
4914
|
* Инициализирует экземпляр класса {@link DeliveryAddress}.
|
|
4915
4915
|
*
|
|
@@ -4946,14 +4946,14 @@ class qe extends nr {
|
|
|
4946
4946
|
* Признак того, что указанный адрес является адресом транспортной компании.
|
|
4947
4947
|
*/
|
|
4948
4948
|
s(this, "isTransportCompanyAddress");
|
|
4949
|
-
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new
|
|
4949
|
+
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new Rt(e == null ? void 0 : e.coordinates), this.contacts = ((t = e == null ? void 0 : e.contacts) == null ? void 0 : t.map((i) => new oe(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;
|
|
4950
4950
|
}
|
|
4951
4951
|
}
|
|
4952
|
-
class _t extends C {
|
|
4953
|
-
}
|
|
4954
4952
|
class qt extends C {
|
|
4955
4953
|
}
|
|
4956
|
-
class
|
|
4954
|
+
class Nt extends C {
|
|
4955
|
+
}
|
|
4956
|
+
class lt extends fe {
|
|
4957
4957
|
/**
|
|
4958
4958
|
* Инициализирует экземпляр класса {@link Client}.
|
|
4959
4959
|
*
|
|
@@ -5003,10 +5003,10 @@ class ot extends fe {
|
|
|
5003
5003
|
* @inheritDoc
|
|
5004
5004
|
*/
|
|
5005
5005
|
s(this, "extraData");
|
|
5006
|
-
this.contragents = ((t = e == null ? void 0 : e.contragents) == null ? void 0 : t.map((u) =>
|
|
5006
|
+
this.contragents = ((t = e == null ? void 0 : e.contragents) == null ? void 0 : t.map((u) => sr.createInstance(u))) ?? [], this.partnerGroups = ((i = e == null ? void 0 : e.partnerGroups) == null ? void 0 : i.map((u) => new le(u))) ?? [], this.contacts = ((o = e == null ? void 0 : e.contacts) == null ? void 0 : o.map((u) => new oe(u))) ?? [], this.deliveryAddresses = ((c = e == null ? void 0 : e.deliveryAddresses) == null ? void 0 : c.map((u) => new qe(u))) ?? [], this.channelPrimaryInterest = new qt(e == null ? void 0 : e.channelPrimaryInterest), this.sourcePrimaryInterest = new Nt(e == null ? void 0 : e.sourcePrimaryInterest), this.preferredDeliveryType = new X(e == null ? void 0 : e.preferredDeliveryType), this.primaryDemand = e == null ? void 0 : e.primaryDemand, this.preferredWarehouse = e != null && e.preferredWarehouse ? new He(e.preferredWarehouse) : void 0, this.extraData = (e == null ? void 0 : e.extraData) ?? {};
|
|
5007
5007
|
}
|
|
5008
5008
|
}
|
|
5009
|
-
class
|
|
5009
|
+
class Li extends de {
|
|
5010
5010
|
/**
|
|
5011
5011
|
* Инициализирует экземпляр класса {@link ClientsListFilters}.
|
|
5012
5012
|
*
|
|
@@ -5119,7 +5119,7 @@ class Oi extends de {
|
|
|
5119
5119
|
* @inheritDoc
|
|
5120
5120
|
*/
|
|
5121
5121
|
s(this, "noOrdersPeriod", new D());
|
|
5122
|
-
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((T) => new ee(T)), this.region = new ne(e == null ? void 0 : e.region), this.country = new Te(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 D(e == null ? void 0 : e.createdAt), this.lastLoginDate = new D(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((T) => new Z(T))) ?? [], this.includeSubordinateManagers = (e == null ? void 0 : e.includeSubordinateManagers) ?? !0, this.curators = ((o = e == null ? void 0 : e.curators) == null ? void 0 : o.map((T) => new
|
|
5122
|
+
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((T) => new ee(T)), this.region = new ne(e == null ? void 0 : e.region), this.country = new Te(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 D(e == null ? void 0 : e.createdAt), this.lastLoginDate = new D(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((T) => new Z(T))) ?? [], this.includeSubordinateManagers = (e == null ? void 0 : e.includeSubordinateManagers) ?? !0, this.curators = ((o = e == null ? void 0 : e.curators) == null ? void 0 : o.map((T) => new jr(T))) ?? [], this.salesDirections = (c = e == null ? void 0 : e.salesDirections) == null ? void 0 : c.map((T) => new F(T)), this.contragentInn = e == null ? void 0 : e.contragentInn, this.contragentType = new ce(e == null ? void 0 : e.contragentType), this.preferredDeliveryType = e != null && e.preferredDeliveryType ? new X(e == null ? void 0 : e.preferredDeliveryType) : void 0, this.partnerGroups = (u = e == null ? void 0 : e.partnerGroups) == null ? void 0 : u.map((T) => new le(T)), this.contact = new xr(e == null ? void 0 : e.contact), this.lastOrder = {
|
|
5123
5123
|
createdAt: new D((p = e == null ? void 0 : e.lastOrder) == null ? void 0 : p.createdAt),
|
|
5124
5124
|
creator: (g = e == null ? void 0 : e.lastOrder) == null ? void 0 : g.creator,
|
|
5125
5125
|
isApproved: (a = e == null ? void 0 : e.lastOrder) == null ? void 0 : a.isApproved
|
|
@@ -5170,7 +5170,7 @@ class Oi extends de {
|
|
|
5170
5170
|
this.partnerGroups = [];
|
|
5171
5171
|
break;
|
|
5172
5172
|
case "contact":
|
|
5173
|
-
this.contact = new
|
|
5173
|
+
this.contact = new xr();
|
|
5174
5174
|
break;
|
|
5175
5175
|
default:
|
|
5176
5176
|
this[e] = void 0;
|
|
@@ -5187,7 +5187,7 @@ class Oi extends de {
|
|
|
5187
5187
|
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;
|
|
5188
5188
|
}
|
|
5189
5189
|
}
|
|
5190
|
-
class
|
|
5190
|
+
class Et extends ir {
|
|
5191
5191
|
/**
|
|
5192
5192
|
* Инициализирует экземпляр класса {@link OrderShortInfo}.
|
|
5193
5193
|
*
|
|
@@ -5202,7 +5202,7 @@ class Nt extends sr {
|
|
|
5202
5202
|
this.creator = new q(e == null ? void 0 : e.creator);
|
|
5203
5203
|
}
|
|
5204
5204
|
}
|
|
5205
|
-
class
|
|
5205
|
+
class Es extends N {
|
|
5206
5206
|
/**
|
|
5207
5207
|
* Инициализирует экземпляр класса {@link ClientAdditionalData}.
|
|
5208
5208
|
*
|
|
@@ -5239,10 +5239,10 @@ class qs extends N {
|
|
|
5239
5239
|
* @inheritDoc
|
|
5240
5240
|
*/
|
|
5241
5241
|
s(this, "curators");
|
|
5242
|
-
this.contacts = ((t = e.contacts) == null ? void 0 : t.map((u) => new oe(u))) ?? void 0, this.lastOrder = e.lastOrder ? new
|
|
5242
|
+
this.contacts = ((t = e.contacts) == null ? void 0 : t.map((u) => new oe(u))) ?? void 0, this.lastOrder = e.lastOrder ? new Et(e.lastOrder) : void 0, this.partnerGroups = ((i = e.partnerGroups) == null ? void 0 : i.map((u) => new le(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new X(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new F(e.salesDirection) : void 0, this.managers = ((o = e.managers) == null ? void 0 : o.map((u) => new zr(u))) ?? void 0, this.curators = ((c = e.curators) == null ? void 0 : c.map((u) => new jr(u))) ?? void 0;
|
|
5243
5243
|
}
|
|
5244
5244
|
}
|
|
5245
|
-
class
|
|
5245
|
+
class Rr extends pe {
|
|
5246
5246
|
/**
|
|
5247
5247
|
* Инициализирует экземпляр класса {@link ContactRelation}.
|
|
5248
5248
|
*
|
|
@@ -5257,7 +5257,7 @@ class Dr extends pe {
|
|
|
5257
5257
|
this.isPrimary = e.isPrimary;
|
|
5258
5258
|
}
|
|
5259
5259
|
}
|
|
5260
|
-
class
|
|
5260
|
+
class Us extends oe {
|
|
5261
5261
|
/**
|
|
5262
5262
|
* Инициализирует экземпляр класса {@link ContactPersonRelated}.
|
|
5263
5263
|
*
|
|
@@ -5282,7 +5282,7 @@ class Ns extends oe {
|
|
|
5282
5282
|
*/
|
|
5283
5283
|
addresses: []
|
|
5284
5284
|
});
|
|
5285
|
-
e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((t) => new
|
|
5285
|
+
e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((t) => new Rr(t))), e.relations.clients && (this.relations.clients = e.relations.clients.map((t) => new Rr(t))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((t) => new Rr(t))));
|
|
5286
5286
|
}
|
|
5287
5287
|
}
|
|
5288
5288
|
class W extends M {
|
|
@@ -5426,7 +5426,7 @@ class W extends M {
|
|
|
5426
5426
|
* @see /doc/api/internal#/Клиенты/api_internal_client_get_full_info
|
|
5427
5427
|
*/
|
|
5428
5428
|
getClient(r) {
|
|
5429
|
-
return this.get(`/internal/clients/${r}`, {}, (e) => new
|
|
5429
|
+
return this.get(`/internal/clients/${r}`, {}, (e) => new lt(e.data));
|
|
5430
5430
|
}
|
|
5431
5431
|
/**
|
|
5432
5432
|
* Возвращает данные о клиентах, удовлетворяющих указанным параметрам поиска.
|
|
@@ -5462,7 +5462,7 @@ class W extends M {
|
|
|
5462
5462
|
return this.getClientsList({
|
|
5463
5463
|
groupOp: "and",
|
|
5464
5464
|
groups: [],
|
|
5465
|
-
filters: [{ field: "phone", op:
|
|
5465
|
+
filters: [{ field: "phone", op: Fr.Contains, value: r }]
|
|
5466
5466
|
});
|
|
5467
5467
|
}
|
|
5468
5468
|
/**
|
|
@@ -5477,7 +5477,7 @@ class W extends M {
|
|
|
5477
5477
|
return this.post(
|
|
5478
5478
|
"/internal/clients/additional-data",
|
|
5479
5479
|
{ clients: t, requested_data_types: e },
|
|
5480
|
-
(i) => U.instanceListInitializer(
|
|
5480
|
+
(i) => U.instanceListInitializer(Es, i.data)
|
|
5481
5481
|
);
|
|
5482
5482
|
}
|
|
5483
5483
|
/**
|
|
@@ -5487,7 +5487,7 @@ class W extends M {
|
|
|
5487
5487
|
* @see /doc/api/internal#/Контакты/api_internal_client_contact_get_all_contact_list
|
|
5488
5488
|
*/
|
|
5489
5489
|
getAllClientContacts(r) {
|
|
5490
|
-
return this.getTypedList(
|
|
5490
|
+
return this.getTypedList(Us, `/internal/clients/${r}/contacts/all`);
|
|
5491
5491
|
}
|
|
5492
5492
|
/**
|
|
5493
5493
|
* Создаёт нового клиента на основе указанных данных.
|
|
@@ -5497,7 +5497,7 @@ class W extends M {
|
|
|
5497
5497
|
* @see /doc/api/internal#/Клиенты/api_internal_client_create
|
|
5498
5498
|
*/
|
|
5499
5499
|
createClientCommonData(r, e = {}) {
|
|
5500
|
-
return this.post("/internal/clients", W.transformClientDataToRequest(r), (t) => new
|
|
5500
|
+
return this.post("/internal/clients", W.transformClientDataToRequest(r), (t) => new lt(t.data), e);
|
|
5501
5501
|
}
|
|
5502
5502
|
/**
|
|
5503
5503
|
* Обновляет данные указанного клиента.
|
|
@@ -5637,7 +5637,7 @@ class W extends M {
|
|
|
5637
5637
|
return this.post(
|
|
5638
5638
|
`/internal/clients/${r}/contragents`,
|
|
5639
5639
|
W.transformContragentClientDataToRequest(e),
|
|
5640
|
-
(i) =>
|
|
5640
|
+
(i) => sr.createInstance(i.data),
|
|
5641
5641
|
t
|
|
5642
5642
|
);
|
|
5643
5643
|
}
|
|
@@ -5653,7 +5653,7 @@ class W extends M {
|
|
|
5653
5653
|
return this.patch(
|
|
5654
5654
|
`/internal/clients/${r}/contragents/${e.id}`,
|
|
5655
5655
|
W.transformContragentClientDataToRequest(e),
|
|
5656
|
-
(i) =>
|
|
5656
|
+
(i) => sr.createInstance(i.data),
|
|
5657
5657
|
t
|
|
5658
5658
|
);
|
|
5659
5659
|
}
|
|
@@ -5731,7 +5731,7 @@ class W extends M {
|
|
|
5731
5731
|
return this.post(
|
|
5732
5732
|
`/internal/clients/${r}/contragents/${e}/bank-accounts`,
|
|
5733
5733
|
W.transformClientContragentBankAccountToRequest(t),
|
|
5734
|
-
(o) => new
|
|
5734
|
+
(o) => new Lr(o.data),
|
|
5735
5735
|
i
|
|
5736
5736
|
);
|
|
5737
5737
|
}
|
|
@@ -5748,7 +5748,7 @@ class W extends M {
|
|
|
5748
5748
|
return this.patch(
|
|
5749
5749
|
`/internal/clients/${r}/contragents/${e}/bank-accounts/${t.id}`,
|
|
5750
5750
|
W.transformClientContragentBankAccountToRequest(t),
|
|
5751
|
-
(o) => new
|
|
5751
|
+
(o) => new Lr(o.data),
|
|
5752
5752
|
i
|
|
5753
5753
|
);
|
|
5754
5754
|
}
|
|
@@ -5970,7 +5970,7 @@ class W extends M {
|
|
|
5970
5970
|
return this.get(`/internal/clients/${r.id}/verification/email?email=${r.email}`);
|
|
5971
5971
|
}
|
|
5972
5972
|
}
|
|
5973
|
-
class
|
|
5973
|
+
class xi extends h {
|
|
5974
5974
|
/**
|
|
5975
5975
|
* Выполняет проверку занят ли указанный номер телефона.
|
|
5976
5976
|
*
|
|
@@ -5984,7 +5984,7 @@ class Li extends h {
|
|
|
5984
5984
|
});
|
|
5985
5985
|
}
|
|
5986
5986
|
}
|
|
5987
|
-
class
|
|
5987
|
+
class Ii {
|
|
5988
5988
|
/**
|
|
5989
5989
|
* Инициализирует экземпляр класса {@link VersionConfig}.
|
|
5990
5990
|
*
|
|
@@ -6006,8 +6006,8 @@ class xi {
|
|
|
6006
6006
|
this.date = I(r == null ? void 0 : r.date) ? _(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";
|
|
6007
6007
|
}
|
|
6008
6008
|
}
|
|
6009
|
-
var
|
|
6010
|
-
class
|
|
6009
|
+
var Fs = /* @__PURE__ */ ((n) => (n.Kozyrek = "kozyrek", n.Mosquitto = "mosquitto", n.Strip = "strip", n.MetalForDoors = "metal_for_doors", n.Sandwich = "sandwich", n.SandwichM2 = "sandwich_m2", n))(Fs || {});
|
|
6010
|
+
class _i extends h {
|
|
6011
6011
|
/**
|
|
6012
6012
|
* Возвращает настройки указанного конфигуратора для указанной категории.
|
|
6013
6013
|
*
|
|
@@ -6099,7 +6099,7 @@ class Ii extends h {
|
|
|
6099
6099
|
});
|
|
6100
6100
|
}
|
|
6101
6101
|
}
|
|
6102
|
-
class
|
|
6102
|
+
class Ms {
|
|
6103
6103
|
/**
|
|
6104
6104
|
* Инициализирует экземпляр класса {@link TableDataPaginationRequestParams}.
|
|
6105
6105
|
*
|
|
@@ -6117,7 +6117,7 @@ class Us {
|
|
|
6117
6117
|
this.page = (r == null ? void 0 : r.page) ?? 1, this.pageSize = (r == null ? void 0 : r.pageSize) ?? 50;
|
|
6118
6118
|
}
|
|
6119
6119
|
}
|
|
6120
|
-
class
|
|
6120
|
+
class qi extends Ms {
|
|
6121
6121
|
/**
|
|
6122
6122
|
* Инициализирует экземпляр класса {@link TableDataPagination}.
|
|
6123
6123
|
*
|
|
@@ -6148,7 +6148,7 @@ class _i extends Us {
|
|
|
6148
6148
|
this.itemCount = (e == null ? void 0 : e.itemCount) ?? 0, this.pageCount = (e == null ? void 0 : e.pageCount) ?? 1, this.pageSlot = (e == null ? void 0 : e.pageSlot) ?? 5, this.pageSizes = (e == null ? void 0 : e.pageSizes) ?? [25, 50, 100], this.showSizePicker = (e == null ? void 0 : e.showSizePicker) ?? !0;
|
|
6149
6149
|
}
|
|
6150
6150
|
}
|
|
6151
|
-
class
|
|
6151
|
+
class Ni {
|
|
6152
6152
|
/**
|
|
6153
6153
|
* Инициализирует экземпляр класса {@link ISortRequestParams}.
|
|
6154
6154
|
*
|
|
@@ -6221,8 +6221,8 @@ class y {
|
|
|
6221
6221
|
* @param date Опорная дата.
|
|
6222
6222
|
*/
|
|
6223
6223
|
static intervalTillSameDate(r, e, t) {
|
|
6224
|
-
const i =
|
|
6225
|
-
return { from: re(e), to: B(
|
|
6224
|
+
const i = cs(H(t), H(r)), o = H(k(e, i)), c = Math.min(Xr(t), ls(o));
|
|
6225
|
+
return { from: re(e), to: B(us(o, c)) };
|
|
6226
6226
|
}
|
|
6227
6227
|
/**
|
|
6228
6228
|
* Возвращает интервал «сдвинутая неделя до такого же дня недели»; недели начинаются с понедельника.
|
|
@@ -6231,7 +6231,7 @@ class y {
|
|
|
6231
6231
|
* @param shiftWeeks Смещение в неделях, может быть отрицательным.
|
|
6232
6232
|
*/
|
|
6233
6233
|
static weekTillSameWeekday(r, e) {
|
|
6234
|
-
const t = te(
|
|
6234
|
+
const t = te(Sr(r, e), { weekStartsOn: 1 }), i = je(r, te(r, { weekStartsOn: 1 }));
|
|
6235
6235
|
return { from: t, to: B(se(t, i)) };
|
|
6236
6236
|
}
|
|
6237
6237
|
/**
|
|
@@ -6252,21 +6252,21 @@ class y {
|
|
|
6252
6252
|
* @param shift Смещение в декадах, может быть отрицательным.
|
|
6253
6253
|
*/
|
|
6254
6254
|
static shiftedDecadeBounds(r, e) {
|
|
6255
|
-
const t =
|
|
6255
|
+
const t = Xr(r);
|
|
6256
6256
|
let i = 2;
|
|
6257
6257
|
t <= 10 ? i = 0 : t <= 20 && (i = 1);
|
|
6258
6258
|
const o = i + e, c = Math.floor(o / 3), u = (o % 3 + 3) % 3, p = H(k(r, c)), g = se(p, u * 10), a = u === 2 ? x(p) : B(se(g, 9));
|
|
6259
6259
|
return [g, a];
|
|
6260
6260
|
}
|
|
6261
6261
|
}
|
|
6262
|
-
function
|
|
6263
|
-
return
|
|
6262
|
+
function Ei(n) {
|
|
6263
|
+
return S(Ye(Ee(), n), "yyyy-MM-dd");
|
|
6264
6264
|
}
|
|
6265
|
-
function
|
|
6265
|
+
function Hs(n, r) {
|
|
6266
6266
|
const e = [2, 0, 1, 1, 1, 2], t = Math.floor(Math.abs(n));
|
|
6267
6267
|
return r[t % 100 > 4 && t % 100 < 20 ? 2 : e[Math.min(t % 10, 5)]];
|
|
6268
6268
|
}
|
|
6269
|
-
function
|
|
6269
|
+
function Ui(n) {
|
|
6270
6270
|
const r = _(n), e = je(Ee(), r);
|
|
6271
6271
|
switch (!0) {
|
|
6272
6272
|
case e === 0:
|
|
@@ -6276,23 +6276,23 @@ function Ei(n) {
|
|
|
6276
6276
|
case e < 0:
|
|
6277
6277
|
return n;
|
|
6278
6278
|
default:
|
|
6279
|
-
return `${e} ${
|
|
6279
|
+
return `${e} ${Hs(e, ["день", "дня", "дней"])} назад`;
|
|
6280
6280
|
}
|
|
6281
6281
|
}
|
|
6282
|
-
class
|
|
6282
|
+
class Fi {
|
|
6283
6283
|
/**
|
|
6284
6284
|
* Возвращает предустановленные диапазоны дат.
|
|
6285
6285
|
*
|
|
6286
6286
|
* @param year Год, от которого считаются годовые периоды (1/3/9 месяцев, кварталы, полугодия, год); по умолчанию текущий.
|
|
6287
6287
|
*/
|
|
6288
6288
|
static defaultDateRanges(r) {
|
|
6289
|
-
const e =
|
|
6289
|
+
const e = ps(/* @__PURE__ */ new Date(), 1), t = /* @__PURE__ */ new Date(), i = ae(r === void 0 ? t : new Date(r, 0, 1)), o = $e(i);
|
|
6290
6290
|
return {
|
|
6291
6291
|
// 'Следующий рабочий день' - это значение по-умолчанию
|
|
6292
6292
|
nextWorkingDay: { label: "Следующий рабочий день", from: re(e), to: B(e) },
|
|
6293
|
-
today: { label: "Сегодня", from: Ee(), to:
|
|
6294
|
-
yesterday: { label: "Вчера", from:
|
|
6295
|
-
tomorrow: { label: "Завтра", from:
|
|
6293
|
+
today: { label: "Сегодня", from: Ee(), to: ys() },
|
|
6294
|
+
yesterday: { label: "Вчера", from: ms(), to: fs() },
|
|
6295
|
+
tomorrow: { label: "Завтра", from: gs(), to: hs() },
|
|
6296
6296
|
currentWeek: { label: "Неделя", from: te(t, { weekStartsOn: 1 }), to: ke(t, { weekStartsOn: 1 }) },
|
|
6297
6297
|
currentMonth: { label: "Месяц", from: H(t), to: x(t) },
|
|
6298
6298
|
oneMonth: { label: "1 месяц", from: i, to: x(i) },
|
|
@@ -6320,18 +6320,18 @@ class Ui {
|
|
|
6320
6320
|
yesterday: { label: "Вчера", group: "day", from: re(Ye(r, 1)), to: B(Ye(r, 1)) },
|
|
6321
6321
|
today: { label: "Сегодня", group: "day", from: t, to: i },
|
|
6322
6322
|
tomorrow: { label: "Завтра", group: "day", from: re(se(r, 1)), to: B(se(r, 1)) },
|
|
6323
|
-
lastWeek: { label: "Прошлая неделя", group: "week", from: te(
|
|
6323
|
+
lastWeek: { label: "Прошлая неделя", group: "week", from: te(Zr(r, 1), e), to: ke(Zr(r, 1), e) },
|
|
6324
6324
|
thisWeek: { label: "Эта неделя", group: "week", from: te(r, e), to: ke(r, e) },
|
|
6325
|
-
nextWeek: { label: "Следующая неделя", group: "week", from: te(
|
|
6325
|
+
nextWeek: { label: "Следующая неделя", group: "week", from: te(Sr(r, 1), e), to: ke(Sr(r, 1), e) },
|
|
6326
6326
|
lastTenDays: { label: "Прошлая декада", group: "decade", ...y.shiftDecadeInterval(r, -1) },
|
|
6327
6327
|
thisTenDays: { label: "Эта декада", group: "decade", ...o },
|
|
6328
6328
|
nextTenDays: { label: "Следующая декада", group: "decade", ...y.shiftDecadeInterval(r, 1) },
|
|
6329
|
-
lastMonth: { label: "Прошлый месяц", group: "month", from: H(
|
|
6329
|
+
lastMonth: { label: "Прошлый месяц", group: "month", from: H(ar(r, 1)), to: x(ar(r, 1)) },
|
|
6330
6330
|
thisMonth: { label: "Этот месяц", group: "month", from: c, to: x(r) },
|
|
6331
6331
|
nextMonth: { label: "Следующий месяц", group: "month", from: H(k(r, 1)), to: x(k(r, 1)) },
|
|
6332
|
-
lastQuarter: { label: "Прошлый квартал", group: "quarter", from: Oe(
|
|
6332
|
+
lastQuarter: { label: "Прошлый квартал", group: "quarter", from: Oe(yr(r, 1)), to: Ge(yr(r, 1)) },
|
|
6333
6333
|
thisQuarter: { label: "Этот квартал", group: "quarter", from: u, to: Ge(r) },
|
|
6334
|
-
nextQuarter: { label: "Следующий квартал", group: "quarter", from: Oe(
|
|
6334
|
+
nextQuarter: { label: "Следующий квартал", group: "quarter", from: Oe(fr(r, 1)), to: Ge(fr(r, 1)) },
|
|
6335
6335
|
lastHalfYear: {
|
|
6336
6336
|
label: "Прошлое полугодие",
|
|
6337
6337
|
group: "halfYear",
|
|
@@ -6340,9 +6340,9 @@ class Ui {
|
|
|
6340
6340
|
},
|
|
6341
6341
|
thisHalfYear: { label: "Это полугодие", group: "halfYear", from: p, to: y.endOfHalfYear(r) },
|
|
6342
6342
|
nextHalfYear: { label: "Следующее полугодие", group: "halfYear", from: y.startOfHalfYear(T), to: y.endOfHalfYear(T) },
|
|
6343
|
-
lastYear: { label: "Прошлый год", group: "year", from: ae(
|
|
6343
|
+
lastYear: { label: "Прошлый год", group: "year", from: ae(mr(r, 1)), to: $e(mr(r, 1)) },
|
|
6344
6344
|
thisYear: { label: "Этот год", group: "year", from: g, to: $e(r) },
|
|
6345
|
-
nextYear: { label: "Следующий год", group: "year", from: ae(
|
|
6345
|
+
nextYear: { label: "Следующий год", group: "year", from: ae(gr(r, 1)), to: $e(gr(r, 1)) },
|
|
6346
6346
|
fromBeginningOfThisWeek: { label: "С начала этой недели", group: "other", section: "fromBeginning", from: te(r, e), to: i },
|
|
6347
6347
|
fromBeginningOfThisTenDays: { label: "С начала этой декады", group: "other", section: "fromBeginning", from: o.from, to: i },
|
|
6348
6348
|
fromBeginningOfThisMonth: { label: "С начала этого месяца", group: "other", section: "fromBeginning", from: c, to: i },
|
|
@@ -6366,13 +6366,13 @@ class Ui {
|
|
|
6366
6366
|
label: "Прошлый месяц, до такой же даты",
|
|
6367
6367
|
group: "other",
|
|
6368
6368
|
section: "lastTillSame",
|
|
6369
|
-
...y.intervalTillSameDate(c, H(
|
|
6369
|
+
...y.intervalTillSameDate(c, H(ar(r, 1)), r)
|
|
6370
6370
|
},
|
|
6371
6371
|
lastQuarterTillSameDate: {
|
|
6372
6372
|
label: "Прошлый квартал, до такой же даты",
|
|
6373
6373
|
group: "other",
|
|
6374
6374
|
section: "lastTillSame",
|
|
6375
|
-
...y.intervalTillSameDate(u, Oe(
|
|
6375
|
+
...y.intervalTillSameDate(u, Oe(yr(r, 1)), r)
|
|
6376
6376
|
},
|
|
6377
6377
|
lastHalfYearTillSameDate: {
|
|
6378
6378
|
label: "Прошлое полугодие, до такой же даты",
|
|
@@ -6384,7 +6384,7 @@ class Ui {
|
|
|
6384
6384
|
label: "Прошлый год, до такой же даты",
|
|
6385
6385
|
group: "other",
|
|
6386
6386
|
section: "lastTillSame",
|
|
6387
|
-
...y.intervalTillSameDate(g, ae(
|
|
6387
|
+
...y.intervalTillSameDate(g, ae(mr(r, 1)), r)
|
|
6388
6388
|
},
|
|
6389
6389
|
nextWeekTillSameWeekDay: { label: "Следующая неделя, до такого же дня недели", group: "other", section: "nextTillSame", ...y.weekTillSameWeekday(r, 1) },
|
|
6390
6390
|
nextTenDaysTillSameDayNumber: {
|
|
@@ -6403,7 +6403,7 @@ class Ui {
|
|
|
6403
6403
|
label: "Следующий квартал, до такой же даты",
|
|
6404
6404
|
group: "other",
|
|
6405
6405
|
section: "nextTillSame",
|
|
6406
|
-
...y.intervalTillSameDate(u, Oe(
|
|
6406
|
+
...y.intervalTillSameDate(u, Oe(fr(r, 1)), r)
|
|
6407
6407
|
},
|
|
6408
6408
|
nextHalfYearTillSameDate: {
|
|
6409
6409
|
label: "Следующее полугодие, до такой же даты",
|
|
@@ -6415,14 +6415,14 @@ class Ui {
|
|
|
6415
6415
|
label: "Следующий год, до такой же даты",
|
|
6416
6416
|
group: "other",
|
|
6417
6417
|
section: "nextTillSame",
|
|
6418
|
-
...y.intervalTillSameDate(g, ae(
|
|
6418
|
+
...y.intervalTillSameDate(g, ae(gr(r, 1)), r)
|
|
6419
6419
|
},
|
|
6420
6420
|
last7Days: { label: "Последние 7 дней", group: "other", section: "rollingDays", from: re(Ye(r, 6)), to: i },
|
|
6421
6421
|
next7Days: { label: "Следующие 7 дней", group: "other", section: "rollingDays", from: t, to: B(se(r, 6)) }
|
|
6422
6422
|
};
|
|
6423
6423
|
}
|
|
6424
6424
|
}
|
|
6425
|
-
const
|
|
6425
|
+
const Mi = [
|
|
6426
6426
|
{ key: "day", label: "День" },
|
|
6427
6427
|
{ key: "week", label: "Неделя" },
|
|
6428
6428
|
{ key: "decade", label: "Декада" },
|
|
@@ -6431,14 +6431,14 @@ const Fi = [
|
|
|
6431
6431
|
{ key: "halfYear", label: "Полугодие" },
|
|
6432
6432
|
{ key: "year", label: "Год" },
|
|
6433
6433
|
{ key: "other", label: "Прочее" }
|
|
6434
|
-
],
|
|
6434
|
+
], Hi = [
|
|
6435
6435
|
{ key: "fromBeginning", label: "С начала периода" },
|
|
6436
6436
|
{ key: "tillEnd", label: "До конца периода" },
|
|
6437
6437
|
{ key: "lastTillSame", label: "Прошлые, до такой же даты" },
|
|
6438
6438
|
{ key: "nextTillSame", label: "Следующие, до такой же даты" },
|
|
6439
6439
|
{ key: "rollingDays", label: "7 дней" }
|
|
6440
6440
|
];
|
|
6441
|
-
class
|
|
6441
|
+
class Ir extends N {
|
|
6442
6442
|
/**
|
|
6443
6443
|
* Инициализирует экземпляр класса {@link DiscountClient}.
|
|
6444
6444
|
*
|
|
@@ -6457,7 +6457,7 @@ class Lr extends N {
|
|
|
6457
6457
|
this.city = e != null && e.city ? new ee(e.city) : void 0, this.isActive = (e == null ? void 0 : e.isActive) ?? !1;
|
|
6458
6458
|
}
|
|
6459
6459
|
}
|
|
6460
|
-
class
|
|
6460
|
+
class Bs {
|
|
6461
6461
|
/**
|
|
6462
6462
|
* Инициализирует экземпляр класса {@link DiscountConditions}.
|
|
6463
6463
|
*
|
|
@@ -6500,7 +6500,7 @@ class Ms {
|
|
|
6500
6500
|
* @inheritDoc
|
|
6501
6501
|
*/
|
|
6502
6502
|
s(this, "lastOrderDate");
|
|
6503
|
-
this.salesDirections = P((r == null ? void 0 : r.salesDirections) ?? [], (e) => new F(e)), this.partnerGroups = P((r == null ? void 0 : r.partnerGroups) ?? [], (e) => new le(e)), this.managers = P((r == null ? void 0 : r.managers) ?? [], (e) => new q(e)), this.additionalClients = P((r == null ? void 0 : r.additionalClients) ?? [], (e) => new
|
|
6503
|
+
this.salesDirections = P((r == null ? void 0 : r.salesDirections) ?? [], (e) => new F(e)), this.partnerGroups = P((r == null ? void 0 : r.partnerGroups) ?? [], (e) => new le(e)), this.managers = P((r == null ? void 0 : r.managers) ?? [], (e) => new q(e)), this.additionalClients = P((r == null ? void 0 : r.additionalClients) ?? [], (e) => new Ir(e)), this.fixedClients = P((r == null ? void 0 : r.fixedClients) ?? [], (e) => new Ir(e)), this.regions = P((r == null ? void 0 : r.regions) ?? [], (e) => new ne(e)), this.cities = P((r == null ? void 0 : r.cities) ?? [], (e) => new ee(e)), this.lastLoginDate = new D(r == null ? void 0 : r.lastLoginDate), this.lastOrderDate = new D(r == null ? void 0 : r.lastOrderDate);
|
|
6504
6504
|
}
|
|
6505
6505
|
/**
|
|
6506
6506
|
* Возвращает признак того, что задано хотя бы одно условие отбора клиентов.
|
|
@@ -6508,7 +6508,7 @@ class Ms {
|
|
|
6508
6508
|
* Скидка без условий отбора клиентов доступна всем клиентам.
|
|
6509
6509
|
*/
|
|
6510
6510
|
hasClientConditions() {
|
|
6511
|
-
return
|
|
6511
|
+
return Qr([this.salesDirections, this.partnerGroups, this.managers, this.additionalClients, this.fixedClients, this.regions, this.cities], (r) => !Q(r)) || Qr([this.lastLoginDate, this.lastOrderDate], (r) => !!r.from || !!r.to);
|
|
6512
6512
|
}
|
|
6513
6513
|
/**
|
|
6514
6514
|
* Устанавливает период последнего входа или последнего заказа клиента целыми днями:
|
|
@@ -6536,19 +6536,8 @@ class Ms {
|
|
|
6536
6536
|
};
|
|
6537
6537
|
}
|
|
6538
6538
|
}
|
|
6539
|
-
class Hs {
|
|
6540
|
-
/**
|
|
6541
|
-
* Возвращает коэффициент стоимости товара от розничной цены для указанного процента скидки
|
|
6542
|
-
* с точностью коэффициента из настроек приложения.
|
|
6543
|
-
*
|
|
6544
|
-
* @param percent Процент скидки (10 для скидки 10 %).
|
|
6545
|
-
*/
|
|
6546
|
-
static percentToCostCoefficient(r) {
|
|
6547
|
-
return at((100 - r) / 100, S().config.numberPrecision.priceCoefficient);
|
|
6548
|
-
}
|
|
6549
|
-
}
|
|
6550
6539
|
var Ke = /* @__PURE__ */ ((n) => (n.Active = "active", n.Scheduled = "scheduled", n.Completed = "completed", n))(Ke || {});
|
|
6551
|
-
class
|
|
6540
|
+
class Gs {
|
|
6552
6541
|
/**
|
|
6553
6542
|
* Возвращает состояние скидки на указанный момент по датам начала и окончания действия.
|
|
6554
6543
|
*
|
|
@@ -6559,7 +6548,7 @@ class Bs {
|
|
|
6559
6548
|
return r.deletedAt && r.deletedAt.getTime() <= e.getTime() ? Ke.Completed : r.publishedAt && r.publishedAt.getTime() > e.getTime() ? Ke.Scheduled : Ke.Active;
|
|
6560
6549
|
}
|
|
6561
6550
|
}
|
|
6562
|
-
class
|
|
6551
|
+
class Pr extends Mr {
|
|
6563
6552
|
/**
|
|
6564
6553
|
* Инициализирует экземпляр класса {@link Discount}.
|
|
6565
6554
|
*
|
|
@@ -6595,7 +6584,7 @@ class Rr extends Ur {
|
|
|
6595
6584
|
* @inheritDoc
|
|
6596
6585
|
*/
|
|
6597
6586
|
s(this, "countDiscountedClients");
|
|
6598
|
-
this.conditions = new
|
|
6587
|
+
this.conditions = new Bs(e == null ? void 0 : e.conditions), this.products = P((e == null ? void 0 : e.products) ?? [], (t) => new E(t)), this.productCategories = P((e == null ? void 0 : e.productCategories) ?? [], (t) => new Y(t)), this.countDiscountedPrices = (e == null ? void 0 : e.countDiscountedPrices) ?? 0, this.expectedCountDiscountedPrices = (e == null ? void 0 : e.expectedCountDiscountedPrices) ?? 0, this.countDiscountedProducts = (e == null ? void 0 : e.countDiscountedProducts) ?? 0, this.countDiscountedClients = (e == null ? void 0 : e.countDiscountedClients) ?? 0;
|
|
6599
6588
|
}
|
|
6600
6589
|
/**
|
|
6601
6590
|
* Возвращает состояние скидки на указанный момент.
|
|
@@ -6603,7 +6592,7 @@ class Rr extends Ur {
|
|
|
6603
6592
|
* @param now Момент, на который определяется состояние.
|
|
6604
6593
|
*/
|
|
6605
6594
|
getState(e = /* @__PURE__ */ new Date()) {
|
|
6606
|
-
return
|
|
6595
|
+
return Gs.resolve(this, e);
|
|
6607
6596
|
}
|
|
6608
6597
|
/**
|
|
6609
6598
|
* Переносит счётчики цен, товаров и клиентов из указанной скидки, не затрагивая остальные данные.
|
|
@@ -6625,7 +6614,7 @@ class Rr extends Ur {
|
|
|
6625
6614
|
toSaveData() {
|
|
6626
6615
|
return {
|
|
6627
6616
|
name: this.name,
|
|
6628
|
-
|
|
6617
|
+
percent: this.percent,
|
|
6629
6618
|
isLowPriceAllowed: this.isLowPriceAllowed,
|
|
6630
6619
|
publishedAt: this.publishedAt ?? null,
|
|
6631
6620
|
deletedAt: this.deletedAt ?? null,
|
|
@@ -6636,7 +6625,7 @@ class Rr extends Ur {
|
|
|
6636
6625
|
};
|
|
6637
6626
|
}
|
|
6638
6627
|
}
|
|
6639
|
-
class
|
|
6628
|
+
class ut {
|
|
6640
6629
|
/**
|
|
6641
6630
|
* Инициализирует экземпляр класса {@link DiscountClientEligibility}.
|
|
6642
6631
|
*
|
|
@@ -6675,7 +6664,7 @@ class ct {
|
|
|
6675
6664
|
* @inheritDoc
|
|
6676
6665
|
*/
|
|
6677
6666
|
s(this, "salesDirectionsCondition");
|
|
6678
|
-
this.client = new
|
|
6667
|
+
this.client = new Ir(r == null ? void 0 : r.client), this.additionalClientsCondition = (r == null ? void 0 : r.additionalClientsCondition) ?? !1, this.fixedClientsCondition = (r == null ? void 0 : r.fixedClientsCondition) ?? !1, this.partnerGroupsCondition = (r == null ? void 0 : r.partnerGroupsCondition) ?? !1, this.managersCondition = (r == null ? void 0 : r.managersCondition) ?? !1, this.citiesCondition = (r == null ? void 0 : r.citiesCondition) ?? !1, this.regionsCondition = (r == null ? void 0 : r.regionsCondition) ?? !1, this.salesDirectionsCondition = (r == null ? void 0 : r.salesDirectionsCondition) ?? !1;
|
|
6679
6668
|
}
|
|
6680
6669
|
/**
|
|
6681
6670
|
* Возвращает признак того, что у клиента выполнено хотя бы одно условие отбора скидки.
|
|
@@ -6684,7 +6673,7 @@ class ct {
|
|
|
6684
6673
|
return this.additionalClientsCondition || this.fixedClientsCondition || this.partnerGroupsCondition || this.managersCondition || this.citiesCondition || this.regionsCondition || this.salesDirectionsCondition;
|
|
6685
6674
|
}
|
|
6686
6675
|
}
|
|
6687
|
-
class
|
|
6676
|
+
class Bi extends de {
|
|
6688
6677
|
/**
|
|
6689
6678
|
* Инициализирует экземпляр класса {@link DiscountsListFilters}.
|
|
6690
6679
|
*
|
|
@@ -6722,7 +6711,7 @@ class Hi extends de {
|
|
|
6722
6711
|
return this;
|
|
6723
6712
|
}
|
|
6724
6713
|
}
|
|
6725
|
-
class
|
|
6714
|
+
class _r extends M {
|
|
6726
6715
|
/**
|
|
6727
6716
|
* Возвращает данные скидки, подготовленные для запроса сохранения.
|
|
6728
6717
|
*
|
|
@@ -6753,7 +6742,7 @@ class xr extends M {
|
|
|
6753
6742
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_discount_get_list
|
|
6754
6743
|
*/
|
|
6755
6744
|
getDiscountsList(r, e, t, i = void 0) {
|
|
6756
|
-
return this.getTypedPaginated(
|
|
6745
|
+
return this.getTypedPaginated(Mr, "/internal/price/discounts", r, e, t, {}, void 0, i);
|
|
6757
6746
|
}
|
|
6758
6747
|
/**
|
|
6759
6748
|
* Возвращает полные данные о скидке.
|
|
@@ -6763,7 +6752,7 @@ class xr extends M {
|
|
|
6763
6752
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_discount_get
|
|
6764
6753
|
*/
|
|
6765
6754
|
getDiscount(r) {
|
|
6766
|
-
return this.get(`/internal/price/discounts/${r}`, {}, (e) => new
|
|
6755
|
+
return this.get(`/internal/price/discounts/${r}`, {}, (e) => new Pr(e.data));
|
|
6767
6756
|
}
|
|
6768
6757
|
/**
|
|
6769
6758
|
* Создаёт новую скидку.
|
|
@@ -6773,15 +6762,15 @@ class xr extends M {
|
|
|
6773
6762
|
* @param validationFieldResultData Список полей, для которых необходимо
|
|
6774
6763
|
* установить данные об ошибках валидации
|
|
6775
6764
|
* в случае ошибок в запросах.
|
|
6776
|
-
* Ошибка размера скидки приходит по ключу `
|
|
6765
|
+
* Ошибка размера скидки приходит по ключу `percent`.
|
|
6777
6766
|
*
|
|
6778
6767
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_discount_create
|
|
6779
6768
|
*/
|
|
6780
6769
|
createDiscount(r, e, t = {}) {
|
|
6781
6770
|
return this.post(
|
|
6782
6771
|
"/internal/price/discounts",
|
|
6783
|
-
|
|
6784
|
-
(i) => new
|
|
6772
|
+
_r.prepareSaveData(r, e),
|
|
6773
|
+
(i) => new Pr(i.data),
|
|
6785
6774
|
t
|
|
6786
6775
|
);
|
|
6787
6776
|
}
|
|
@@ -6794,15 +6783,15 @@ class xr extends M {
|
|
|
6794
6783
|
* @param validationFieldResultData Список полей, для которых необходимо
|
|
6795
6784
|
* установить данные об ошибках валидации
|
|
6796
6785
|
* в случае ошибок в запросах.
|
|
6797
|
-
* Ошибка размера скидки приходит по ключу `
|
|
6786
|
+
* Ошибка размера скидки приходит по ключу `percent`.
|
|
6798
6787
|
*
|
|
6799
6788
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_discount_change
|
|
6800
6789
|
*/
|
|
6801
6790
|
updateDiscount(r, e, t, i = {}) {
|
|
6802
6791
|
return this.patch(
|
|
6803
6792
|
`/internal/price/discounts/${r}`,
|
|
6804
|
-
|
|
6805
|
-
(o) => new
|
|
6793
|
+
_r.prepareSaveData(e, t),
|
|
6794
|
+
(o) => new Pr(o.data),
|
|
6806
6795
|
i
|
|
6807
6796
|
);
|
|
6808
6797
|
}
|
|
@@ -6824,7 +6813,7 @@ class xr extends M {
|
|
|
6824
6813
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_discount_clients_get
|
|
6825
6814
|
*/
|
|
6826
6815
|
getEligibleClients(r) {
|
|
6827
|
-
return this.getTypedList(
|
|
6816
|
+
return this.getTypedList(ut, `/internal/price/discounts/${r}/clients`);
|
|
6828
6817
|
}
|
|
6829
6818
|
/**
|
|
6830
6819
|
* Проверяет, подходит ли клиент под скидку.
|
|
@@ -6838,7 +6827,7 @@ class xr extends M {
|
|
|
6838
6827
|
return this.get(
|
|
6839
6828
|
`/internal/price/discounts/${r}/clients/${e}/check`,
|
|
6840
6829
|
{},
|
|
6841
|
-
(t) => new
|
|
6830
|
+
(t) => new ut(t.data)
|
|
6842
6831
|
);
|
|
6843
6832
|
}
|
|
6844
6833
|
}
|
|
@@ -6887,7 +6876,7 @@ class We extends pe {
|
|
|
6887
6876
|
};
|
|
6888
6877
|
}
|
|
6889
6878
|
}
|
|
6890
|
-
class
|
|
6879
|
+
class Gi extends M {
|
|
6891
6880
|
/**
|
|
6892
6881
|
* Возвращает список часто задаваемых вопросов.
|
|
6893
6882
|
*
|
|
@@ -6992,11 +6981,11 @@ class Bi extends M {
|
|
|
6992
6981
|
return this.delete(`/internal/faq/groups/${r}`);
|
|
6993
6982
|
}
|
|
6994
6983
|
}
|
|
6995
|
-
function
|
|
6996
|
-
const r =
|
|
6984
|
+
function zi(n) {
|
|
6985
|
+
const r = is(n * 100);
|
|
6997
6986
|
return `${r >= 0 ? "+" : ""}${r}%`;
|
|
6998
6987
|
}
|
|
6999
|
-
class
|
|
6988
|
+
class Ut {
|
|
7000
6989
|
/**
|
|
7001
6990
|
* Возвращает признак, что указанный товар имеет линейную единицу измерения.
|
|
7002
6991
|
*
|
|
@@ -7012,7 +7001,7 @@ class Et {
|
|
|
7012
7001
|
*/
|
|
7013
7002
|
static getProductMultiplicity(r) {
|
|
7014
7003
|
var e, t;
|
|
7015
|
-
return !((e = r.properties) != null && e.ignoreMinCountCheck) && ((t = r.properties) == null ? void 0 : t.minCount) != null && !
|
|
7004
|
+
return !((e = r.properties) != null && e.ignoreMinCountCheck) && ((t = r.properties) == null ? void 0 : t.minCount) != null && !Ut.productIsMeasurable(r) ? r.properties.minCount : 1;
|
|
7016
7005
|
}
|
|
7017
7006
|
/**
|
|
7018
7007
|
* Возвращает кратность длины для указанного товара.
|
|
@@ -7034,7 +7023,7 @@ const Re = class Re extends h {
|
|
|
7034
7023
|
* Время кэширования данных ответов на запросы (секунд).
|
|
7035
7024
|
*/
|
|
7036
7025
|
s(this, "responseDataCacheTimeout");
|
|
7037
|
-
this.responseDataCacheTimeout =
|
|
7026
|
+
this.responseDataCacheTimeout = $().config.http.responseDataCacheTimeout;
|
|
7038
7027
|
}
|
|
7039
7028
|
/**
|
|
7040
7029
|
* Возвращает кэшированные данные.
|
|
@@ -7056,7 +7045,7 @@ const Re = class Re extends h {
|
|
|
7056
7045
|
*/
|
|
7057
7046
|
cacheResponse(e, t) {
|
|
7058
7047
|
Re.responseDataCache.set(e, {
|
|
7059
|
-
validTo:
|
|
7048
|
+
validTo: as(/* @__PURE__ */ new Date(), this.responseDataCacheTimeout),
|
|
7060
7049
|
val: t
|
|
7061
7050
|
});
|
|
7062
7051
|
}
|
|
@@ -7081,7 +7070,7 @@ const Re = class Re extends h {
|
|
|
7081
7070
|
*/
|
|
7082
7071
|
s(Re, "responseDataCache", /* @__PURE__ */ new Map());
|
|
7083
7072
|
let Me = Re;
|
|
7084
|
-
class
|
|
7073
|
+
class Wi {
|
|
7085
7074
|
/**
|
|
7086
7075
|
* Генерирует и возвращает данные-заглушку неопределённого менеджера.
|
|
7087
7076
|
*/
|
|
@@ -7097,7 +7086,7 @@ class zi {
|
|
|
7097
7086
|
return r.id === 0 && r.guid === "-undefined-";
|
|
7098
7087
|
}
|
|
7099
7088
|
}
|
|
7100
|
-
class
|
|
7089
|
+
class Ft extends Me {
|
|
7101
7090
|
/**
|
|
7102
7091
|
* Возвращает {@link Promise} для получения справочника списка менеджеров.
|
|
7103
7092
|
*/
|
|
@@ -7120,7 +7109,7 @@ class Ut extends Me {
|
|
|
7120
7109
|
}
|
|
7121
7110
|
}
|
|
7122
7111
|
var _e = /* @__PURE__ */ ((n) => (n.Processing = "processing", n.Completed = "completed", n.Error = "error", n.NeedsActualization = "needs_actualization", n))(_e || {});
|
|
7123
|
-
class
|
|
7112
|
+
class zs {
|
|
7124
7113
|
/**
|
|
7125
7114
|
* Инициализирует экземпляр класса {@link OfferActualization}.
|
|
7126
7115
|
*
|
|
@@ -7176,7 +7165,7 @@ class Gs {
|
|
|
7176
7165
|
return this.status === _e.Completed && !this.isOutdatedAt(r);
|
|
7177
7166
|
}
|
|
7178
7167
|
}
|
|
7179
|
-
class
|
|
7168
|
+
class Mt extends ir {
|
|
7180
7169
|
/**
|
|
7181
7170
|
* Инициализирует экземпляр класса {@link OfferShortInfo}.
|
|
7182
7171
|
*
|
|
@@ -7208,10 +7197,10 @@ class Ft extends sr {
|
|
|
7208
7197
|
* @inheritDoc
|
|
7209
7198
|
*/
|
|
7210
7199
|
s(this, "file");
|
|
7211
|
-
this.name = e == null ? void 0 : e.name, this.client = new fe(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
|
|
7200
|
+
this.name = e == null ? void 0 : e.name, this.client = new fe(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 zs(e.actualization), this.file = e == null ? void 0 : e.file;
|
|
7212
7201
|
}
|
|
7213
7202
|
}
|
|
7214
|
-
class
|
|
7203
|
+
class Ws extends Gr {
|
|
7215
7204
|
/**
|
|
7216
7205
|
* Инициализирует экземпляр класса {@link ProfstroyOfferItem}.
|
|
7217
7206
|
*
|
|
@@ -7250,7 +7239,7 @@ class zs extends Hr {
|
|
|
7250
7239
|
return !this.isProductStub && !this.isIgnored && Q(this.lineError);
|
|
7251
7240
|
}
|
|
7252
7241
|
}
|
|
7253
|
-
class G extends
|
|
7242
|
+
class G extends Mt {
|
|
7254
7243
|
/**
|
|
7255
7244
|
* Инициализирует экземпляр класса {@link Offer}.
|
|
7256
7245
|
*
|
|
@@ -7267,11 +7256,11 @@ class G extends Ft {
|
|
|
7267
7256
|
*/
|
|
7268
7257
|
s(this, "products");
|
|
7269
7258
|
this.sum = e.sum ?? 0, this.products = (e.products ?? []).map(
|
|
7270
|
-
(t) => e.isProfstroy ? new
|
|
7259
|
+
(t) => e.isProfstroy ? new Ws(t) : new Gr(t)
|
|
7271
7260
|
);
|
|
7272
7261
|
}
|
|
7273
7262
|
}
|
|
7274
|
-
class
|
|
7263
|
+
class ji extends de {
|
|
7275
7264
|
/**
|
|
7276
7265
|
* Инициализирует экземпляр класса {@link OffersListFilters}.
|
|
7277
7266
|
*
|
|
@@ -7312,9 +7301,9 @@ class Wi extends de {
|
|
|
7312
7301
|
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;
|
|
7313
7302
|
}
|
|
7314
7303
|
}
|
|
7315
|
-
class
|
|
7304
|
+
class lr extends C {
|
|
7316
7305
|
}
|
|
7317
|
-
class
|
|
7306
|
+
class Ht extends Et {
|
|
7318
7307
|
/**
|
|
7319
7308
|
* Инициализирует экземпляр класса {@link OrderInfo}.
|
|
7320
7309
|
*
|
|
@@ -7384,10 +7373,10 @@ class Mt extends Nt {
|
|
|
7384
7373
|
date: I((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? _(e.delivery.date) : ((p = e == null ? void 0 : e.delivery) == null ? void 0 : p.date) ?? /* @__PURE__ */ new Date(),
|
|
7385
7374
|
address: (g = e == null ? void 0 : e.delivery) != null && g.address ? new qe(e.delivery.address) : void 0,
|
|
7386
7375
|
warehouse: (a = e == null ? void 0 : e.delivery) != null && a.warehouse ? new He(e.delivery.warehouse) : void 0
|
|
7387
|
-
}, this.attachedUser = e != null && e.attachedUser ? new q(e == null ? void 0 : e.attachedUser) : void 0, this.status = new
|
|
7376
|
+
}, this.attachedUser = e != null && e.attachedUser ? new q(e == null ? void 0 : e.attachedUser) : void 0, this.status = new lr(e == null ? void 0 : e.status), this.statusDetail = e != null && e.statusDetail ? new C(e.statusDetail) : void 0, this.salesDirection = new F(e == null ? void 0 : e.salesDirection), this.attachedAt = I(e == null ? void 0 : e.attachedAt) ? _(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;
|
|
7388
7377
|
}
|
|
7389
7378
|
}
|
|
7390
|
-
class
|
|
7379
|
+
class js extends Tt {
|
|
7391
7380
|
/**
|
|
7392
7381
|
* Инициализирует экземпляр класса {@link OrderItem}.
|
|
7393
7382
|
*
|
|
@@ -7447,7 +7436,7 @@ class Ws extends Pt {
|
|
|
7447
7436
|
this.product = new Pe(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 = V(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"));
|
|
7448
7437
|
}
|
|
7449
7438
|
}
|
|
7450
|
-
class L extends
|
|
7439
|
+
class L extends Ht {
|
|
7451
7440
|
/**
|
|
7452
7441
|
* Инициализирует экземпляр класса {@link Order}.
|
|
7453
7442
|
*
|
|
@@ -7515,11 +7504,11 @@ class L extends Mt {
|
|
|
7515
7504
|
this.products = (e.products ?? []).map((i) => {
|
|
7516
7505
|
var c;
|
|
7517
7506
|
const o = i.replacementId ? (c = e.products) == null ? void 0 : c.find((u) => u.id === i.replacementId) : void 0;
|
|
7518
|
-
return new
|
|
7519
|
-
}), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ?
|
|
7507
|
+
return new js(i, o);
|
|
7508
|
+
}), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ? sr.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new C(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment, this.nextStatuses = (t = e.nextStatuses) == null ? void 0 : t.map((i) => new lr(i)), this.actions = e.actions, this.operatorsComment = e.operatorsComment, this.operatorsForWarehouseComment = e.operatorsForWarehouseComment, this.erpOrderUrl = e.erpOrderUrl, this.numberDoc = e.numberDoc;
|
|
7520
7509
|
}
|
|
7521
7510
|
}
|
|
7522
|
-
class
|
|
7511
|
+
class Yi extends M {
|
|
7523
7512
|
/**
|
|
7524
7513
|
* Возвращает список заказов-черновиков, удовлетворяющих указанным параметрам поиска.
|
|
7525
7514
|
*
|
|
@@ -7531,7 +7520,7 @@ class ji extends M {
|
|
|
7531
7520
|
* @see /doc/api/internal#/Заказы/api_internal_order_commercial_offer_get_list
|
|
7532
7521
|
*/
|
|
7533
7522
|
getOffers(r, e, t, i = void 0) {
|
|
7534
|
-
return this.getTypedPaginated(
|
|
7523
|
+
return this.getTypedPaginated(Mt, "/internal/orders/offers", r, e, t, {}, void 0, i);
|
|
7535
7524
|
}
|
|
7536
7525
|
/**
|
|
7537
7526
|
* Создаёт заказ-черновик из содержимого корзины клиента и возвращает данные созданной записи.
|
|
@@ -7635,12 +7624,12 @@ class ji extends M {
|
|
|
7635
7624
|
* @see /doc/api/internal#/Заказы/api_internal_order_commercial_offer_create_order
|
|
7636
7625
|
*/
|
|
7637
7626
|
createOrderFromDraft(r, e, t, i = {}) {
|
|
7638
|
-
const o =
|
|
7627
|
+
const o = $().config.dateFormats.api;
|
|
7639
7628
|
return this.post(
|
|
7640
7629
|
`/internal/orders/offers/${r}/create-order`,
|
|
7641
7630
|
{
|
|
7642
7631
|
...e,
|
|
7643
|
-
deliveryDate: e.deliveryDate ?
|
|
7632
|
+
deliveryDate: e.deliveryDate ? S(e.deliveryDate, o) : void 0,
|
|
7644
7633
|
items: t != null && t.length ? t : void 0
|
|
7645
7634
|
},
|
|
7646
7635
|
(c) => U.instanceListInitializer(L, c.data),
|
|
@@ -7755,7 +7744,7 @@ class ji extends M {
|
|
|
7755
7744
|
return this.post(`/internal/orders/offers/${r}/send`, e);
|
|
7756
7745
|
}
|
|
7757
7746
|
}
|
|
7758
|
-
class
|
|
7747
|
+
class Vi {
|
|
7759
7748
|
/**
|
|
7760
7749
|
* Возвращает признак того, что запись создана из файла выгрузки программы «Профстрой».
|
|
7761
7750
|
*
|
|
@@ -7774,8 +7763,8 @@ class Yi {
|
|
|
7774
7763
|
return !m(r) && r.isProfstroy === !0 && !m(r.actualization);
|
|
7775
7764
|
}
|
|
7776
7765
|
}
|
|
7777
|
-
var
|
|
7778
|
-
class
|
|
7766
|
+
var Ys = /* @__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))(Ys || {});
|
|
7767
|
+
class Qi {
|
|
7779
7768
|
/**
|
|
7780
7769
|
* Инициализирует экземпляр класса {@link OrderEditorData}.
|
|
7781
7770
|
*
|
|
@@ -7842,11 +7831,11 @@ class Vi {
|
|
|
7842
7831
|
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;
|
|
7843
7832
|
}
|
|
7844
7833
|
}
|
|
7845
|
-
class Ht extends C {
|
|
7846
|
-
}
|
|
7847
7834
|
class Bt extends C {
|
|
7848
7835
|
}
|
|
7849
|
-
class
|
|
7836
|
+
class Gt extends C {
|
|
7837
|
+
}
|
|
7838
|
+
class Ji extends de {
|
|
7850
7839
|
/**
|
|
7851
7840
|
* Инициализирует экземпляр класса {@link OrdersListFilters}.
|
|
7852
7841
|
*
|
|
@@ -7947,7 +7936,7 @@ class Qi extends de {
|
|
|
7947
7936
|
* @inheritDoc
|
|
7948
7937
|
*/
|
|
7949
7938
|
s(this, "onlyMyRegions");
|
|
7950
|
-
this.attachedUsers = (t = e == null ? void 0 : e.attachedUsers) == null ? void 0 : t.map((u) => "isActive" in u ? new Z(u) : new
|
|
7939
|
+
this.attachedUsers = (t = e == null ? void 0 : e.attachedUsers) == null ? void 0 : t.map((u) => "isActive" in u ? new Z(u) : new Bt(u)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.client = e != null && e.client ? new fe(e.client) : void 0, this.contragent = e == null ? void 0 : e.contragent, this.createdAt = new D(e == null ? void 0 : e.createdAt), this.creator = e != null && e.creator ? new q(e.creator) : void 0, this.deliveryDate = new D(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 ee(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 D(e == null ? void 0 : e.attachedAt), this.salesDirections = (o = e == null ? void 0 : e.salesDirections) == null ? void 0 : o.map((u) => new F(u)), this.status = e == null ? void 0 : e.status, this.statusDetail = e == null ? void 0 : e.statusDetail, this.deliveryType = e != null && e.deliveryType ? new X(e.deliveryType) : void 0, this.paymentType = e != null && e.paymentType ? new Gt(e.paymentType) : void 0, this.warehouses = (c = e == null ? void 0 : e.warehouses) == null ? void 0 : c.map((u) => new He(u)), this.isToProcess = e == null ? void 0 : e.isToProcess;
|
|
7951
7940
|
}
|
|
7952
7941
|
/**
|
|
7953
7942
|
* @inheritDoc
|
|
@@ -7998,7 +7987,7 @@ class Qi extends de {
|
|
|
7998
7987
|
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;
|
|
7999
7988
|
}
|
|
8000
7989
|
}
|
|
8001
|
-
class
|
|
7990
|
+
class Vs {
|
|
8002
7991
|
/**
|
|
8003
7992
|
* Инициализирует экземпляр класса {@link OrderStatusHistoryInfo}.
|
|
8004
7993
|
*
|
|
@@ -8021,10 +8010,10 @@ class Ys {
|
|
|
8021
8010
|
* @inheritDoc
|
|
8022
8011
|
*/
|
|
8023
8012
|
s(this, "createdAt");
|
|
8024
|
-
this.user = new q(r == null ? void 0 : r.user), this.status = new
|
|
8013
|
+
this.user = new q(r == null ? void 0 : r.user), this.status = new lr(r == null ? void 0 : r.status), this.statusDetail = r != null && r.statusDetail ? new C(r.statusDetail) : void 0, this.createdAt = I(r == null ? void 0 : r.createdAt) ? _(r.createdAt) : (r == null ? void 0 : r.createdAt) ?? /* @__PURE__ */ new Date();
|
|
8025
8014
|
}
|
|
8026
8015
|
}
|
|
8027
|
-
class
|
|
8016
|
+
class Ki extends M {
|
|
8028
8017
|
/**
|
|
8029
8018
|
* Возвращает данные о заказах, удовлетворяющих указанным параметрам поиска.
|
|
8030
8019
|
*
|
|
@@ -8036,7 +8025,7 @@ class Ji extends M {
|
|
|
8036
8025
|
* @see /doc/api/internal#/Заказы/api_internal_orders_get_list
|
|
8037
8026
|
*/
|
|
8038
8027
|
getOrders(r, e, t, i = void 0) {
|
|
8039
|
-
return this.getTypedPaginated(
|
|
8028
|
+
return this.getTypedPaginated(Ht, "/internal/orders", r, e, t, {}, void 0, i);
|
|
8040
8029
|
}
|
|
8041
8030
|
/**
|
|
8042
8031
|
* Возвращает количество заказов, соответствующих указанным фильтрам.
|
|
@@ -8091,12 +8080,12 @@ class Ji extends M {
|
|
|
8091
8080
|
* @see /doc/api/internal#/operations/api_internal_client_orders_create
|
|
8092
8081
|
*/
|
|
8093
8082
|
createClientOrder(r, e, t, i = {}) {
|
|
8094
|
-
const o =
|
|
8083
|
+
const o = $().config.dateFormats.api;
|
|
8095
8084
|
return this.post(
|
|
8096
8085
|
`/internal/clients/${r}/orders`,
|
|
8097
8086
|
{
|
|
8098
8087
|
...e,
|
|
8099
|
-
deliveryDate:
|
|
8088
|
+
deliveryDate: S(e.deliveryDate, o),
|
|
8100
8089
|
items: t != null && t.length ? t : void 0
|
|
8101
8090
|
},
|
|
8102
8091
|
(c) => U.instanceListInitializer(L, c.data),
|
|
@@ -8166,12 +8155,12 @@ class Ji extends M {
|
|
|
8166
8155
|
* @see /doc/api/internal#/Заказы/api_internal_orders_update
|
|
8167
8156
|
*/
|
|
8168
8157
|
updateOrder(r, e, t = {}) {
|
|
8169
|
-
const i =
|
|
8158
|
+
const i = $().config.dateFormats.api;
|
|
8170
8159
|
return this.patch(
|
|
8171
8160
|
`/internal/orders/${r}`,
|
|
8172
8161
|
{
|
|
8173
8162
|
...e,
|
|
8174
|
-
deliveryDate: e.deliveryDate ?
|
|
8163
|
+
deliveryDate: e.deliveryDate ? S(e.deliveryDate, i) : void 0
|
|
8175
8164
|
},
|
|
8176
8165
|
(o) => new L(o.data),
|
|
8177
8166
|
t
|
|
@@ -8250,7 +8239,7 @@ class Ji extends M {
|
|
|
8250
8239
|
* @see /doc/api/internal#/Заказы/api_internal_orders_status_history_get
|
|
8251
8240
|
*/
|
|
8252
8241
|
getOrderStatusHistory(r) {
|
|
8253
|
-
return this.getTypedList(
|
|
8242
|
+
return this.getTypedList(Vs, `/internal/orders/${r}/history`);
|
|
8254
8243
|
}
|
|
8255
8244
|
/**
|
|
8256
8245
|
* Возвращает содержимое печатной формы заказа в формате HTML.
|
|
@@ -8379,11 +8368,11 @@ class Ji extends M {
|
|
|
8379
8368
|
* @see /doc/api/internal#/operations/api_internal_orders_delivery_get_cost
|
|
8380
8369
|
*/
|
|
8381
8370
|
getDeliveryCost(r, e, t, i = void 0) {
|
|
8382
|
-
const o =
|
|
8371
|
+
const o = $().config.dateFormats.api;
|
|
8383
8372
|
return this.get(
|
|
8384
8373
|
`/internal/orders/delivery/${r}/cost`,
|
|
8385
8374
|
{
|
|
8386
|
-
date:
|
|
8375
|
+
date: S(e, o),
|
|
8387
8376
|
warehouse_id: t
|
|
8388
8377
|
},
|
|
8389
8378
|
(c) => c.data,
|
|
@@ -8392,8 +8381,8 @@ class Ji extends M {
|
|
|
8392
8381
|
);
|
|
8393
8382
|
}
|
|
8394
8383
|
}
|
|
8395
|
-
const
|
|
8396
|
-
class
|
|
8384
|
+
const Xi = Symbol("currentOrder");
|
|
8385
|
+
class Tr {
|
|
8397
8386
|
/**
|
|
8398
8387
|
* Инициализирует экземпляр класса {@link PriceAnalyze}.
|
|
8399
8388
|
*
|
|
@@ -8420,12 +8409,12 @@ class Pr {
|
|
|
8420
8409
|
* Источник клиентской цены.
|
|
8421
8410
|
*/
|
|
8422
8411
|
s(this, "source");
|
|
8423
|
-
this.client = new fe(r == null ? void 0 : r.client), this.product = new E(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) ??
|
|
8412
|
+
this.client = new fe(r == null ? void 0 : r.client), this.product = new E(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) ?? Br.Product;
|
|
8424
8413
|
}
|
|
8425
8414
|
}
|
|
8426
|
-
const
|
|
8415
|
+
const br = (n) => {
|
|
8427
8416
|
var r, e, t, i, o;
|
|
8428
|
-
return n ?
|
|
8417
|
+
return n ? vt(
|
|
8429
8418
|
{
|
|
8430
8419
|
cities: (r = n.cities) == null ? void 0 : r.map((c) => c.id),
|
|
8431
8420
|
clients: (e = n.clients) == null ? void 0 : e.map((c) => c.id),
|
|
@@ -8434,13 +8423,13 @@ const Tr = (n) => {
|
|
|
8434
8423
|
salesDirections: (o = n.salesDirections) == null ? void 0 : o.map((c) => c.id),
|
|
8435
8424
|
hideNotActive: n.hideNotActive
|
|
8436
8425
|
},
|
|
8437
|
-
(c) => m(c) || (V(c) ||
|
|
8426
|
+
(c) => m(c) || (V(c) || er(c)) && Q(c)
|
|
8438
8427
|
) : {};
|
|
8439
|
-
},
|
|
8428
|
+
}, pt = (n) => {
|
|
8440
8429
|
const r = {};
|
|
8441
8430
|
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;
|
|
8442
8431
|
};
|
|
8443
|
-
class
|
|
8432
|
+
class Zi extends h {
|
|
8444
8433
|
/**
|
|
8445
8434
|
* Возвращает список клиентских цен на продукты в указанном диапазоне цены.
|
|
8446
8435
|
*
|
|
@@ -8454,10 +8443,10 @@ class Xi extends h {
|
|
|
8454
8443
|
return this.get(
|
|
8455
8444
|
`/internal/price/products/${r}/analyze`,
|
|
8456
8445
|
{
|
|
8457
|
-
...
|
|
8458
|
-
filters:
|
|
8446
|
+
...pt(e),
|
|
8447
|
+
filters: br(t)
|
|
8459
8448
|
},
|
|
8460
|
-
(i) => U.instanceListInitializer(
|
|
8449
|
+
(i) => U.instanceListInitializer(Tr, i.data)
|
|
8461
8450
|
);
|
|
8462
8451
|
}
|
|
8463
8452
|
/**
|
|
@@ -8473,10 +8462,10 @@ class Xi extends h {
|
|
|
8473
8462
|
return this.get(
|
|
8474
8463
|
`/internal/price/categories/${r}/analyze`,
|
|
8475
8464
|
{
|
|
8476
|
-
...
|
|
8477
|
-
filters:
|
|
8465
|
+
...pt(e),
|
|
8466
|
+
filters: br(t)
|
|
8478
8467
|
},
|
|
8479
|
-
(i) => U.instanceListInitializer(
|
|
8468
|
+
(i) => U.instanceListInitializer(Tr, i.data)
|
|
8480
8469
|
);
|
|
8481
8470
|
}
|
|
8482
8471
|
/**
|
|
@@ -8495,13 +8484,13 @@ class Xi extends h {
|
|
|
8495
8484
|
`/internal/price/categories/${r}/analyze/square`,
|
|
8496
8485
|
{
|
|
8497
8486
|
...e,
|
|
8498
|
-
filters:
|
|
8487
|
+
filters: br(t)
|
|
8499
8488
|
},
|
|
8500
|
-
(i) => U.instanceListInitializer(
|
|
8489
|
+
(i) => U.instanceListInitializer(Tr, i.data)
|
|
8501
8490
|
);
|
|
8502
8491
|
}
|
|
8503
8492
|
}
|
|
8504
|
-
class
|
|
8493
|
+
class Qs {
|
|
8505
8494
|
/**
|
|
8506
8495
|
* Инициализирует экземпляр класса {@link PriceHistoryItem}.
|
|
8507
8496
|
*
|
|
@@ -8551,7 +8540,7 @@ class Vs {
|
|
|
8551
8540
|
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = I(r.costDate) ? _(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new Fe(r.product) : void 0, this.client = r.client ? new q(r.client) : void 0, this.executor = r.executor ? new q(r.executor) : void 0, this.currency = r.currency ? new J(r.currency) : void 0;
|
|
8552
8541
|
}
|
|
8553
8542
|
}
|
|
8554
|
-
class
|
|
8543
|
+
class Js extends Fe {
|
|
8555
8544
|
/**
|
|
8556
8545
|
* Инициализирует экземпляр класса {@link ProductPriceHistory}.
|
|
8557
8546
|
*
|
|
@@ -8563,10 +8552,10 @@ class Qs extends Fe {
|
|
|
8563
8552
|
* @inheritDoc
|
|
8564
8553
|
*/
|
|
8565
8554
|
s(this, "history");
|
|
8566
|
-
this.history = P(e.history, (t) => new
|
|
8555
|
+
this.history = P(e.history, (t) => new Qs(t));
|
|
8567
8556
|
}
|
|
8568
8557
|
}
|
|
8569
|
-
class
|
|
8558
|
+
class en extends h {
|
|
8570
8559
|
/**
|
|
8571
8560
|
* Возвращает данные об истории изменения цен.
|
|
8572
8561
|
*
|
|
@@ -8576,21 +8565,21 @@ class Zi extends h {
|
|
|
8576
8565
|
*/
|
|
8577
8566
|
getProductPriceHistory(r) {
|
|
8578
8567
|
var o, c, u, p, g;
|
|
8579
|
-
const e =
|
|
8568
|
+
const e = $().config.dateFormats.api, t = vt(
|
|
8580
8569
|
Ne(r, {
|
|
8581
8570
|
costDate: {
|
|
8582
|
-
from:
|
|
8583
|
-
to:
|
|
8571
|
+
from: rr((o = r.costDate) == null ? void 0 : o.from) ? S(r.costDate.from, e) : (c = r.costDate) == null ? void 0 : c.from,
|
|
8572
|
+
to: rr((u = r.costDate) == null ? void 0 : u.to) ? S(r.costDate.to, e) : (p = r.costDate) == null ? void 0 : p.to
|
|
8584
8573
|
}
|
|
8585
8574
|
}),
|
|
8586
|
-
(a) => m(a) || (V(a) ||
|
|
8575
|
+
(a) => m(a) || (V(a) || er(a)) && Q(a)
|
|
8587
8576
|
), i = ((g = r.product) == null ? void 0 : g[0]) ?? 0;
|
|
8588
8577
|
return delete t.product, this.get(`/internal/price/products/${i}/history`, t).then((a) => [
|
|
8589
|
-
new
|
|
8578
|
+
new Js(Ne(a[0], { history: a }))
|
|
8590
8579
|
]);
|
|
8591
8580
|
}
|
|
8592
8581
|
}
|
|
8593
|
-
class
|
|
8582
|
+
class ht {
|
|
8594
8583
|
/**
|
|
8595
8584
|
* Инициализирует экземпляр класса {@link RecommendationsList}.
|
|
8596
8585
|
*
|
|
@@ -8608,7 +8597,7 @@ class ut {
|
|
|
8608
8597
|
r != null && r.products && (this.products = r.products.map((e) => new Fe(e))), r != null && r.productCategories && (this.productCategories = r.productCategories.map((e) => new Fe(e)));
|
|
8609
8598
|
}
|
|
8610
8599
|
}
|
|
8611
|
-
class
|
|
8600
|
+
class rn extends h {
|
|
8612
8601
|
/**
|
|
8613
8602
|
* Возвращает данные о рекомендациях указанной категории продуктов.
|
|
8614
8603
|
*
|
|
@@ -8616,7 +8605,7 @@ class en extends h {
|
|
|
8616
8605
|
* @see /docs/api#/operations/api_internal_recommendations_product_category_get
|
|
8617
8606
|
*/
|
|
8618
8607
|
getProductCategoryRecommendations(r) {
|
|
8619
|
-
return this.get(`/internal/catalog/recommendations/categories/${r.id}`, {}, (e) => new
|
|
8608
|
+
return this.get(`/internal/catalog/recommendations/categories/${r.id}`, {}, (e) => new ht(e.data));
|
|
8620
8609
|
}
|
|
8621
8610
|
/**
|
|
8622
8611
|
* Возвращает данные о рекомендациях указанного продукта.
|
|
@@ -8625,7 +8614,7 @@ class en extends h {
|
|
|
8625
8614
|
* @see /docs/api#/operations/api_internal_recommendations_product_get
|
|
8626
8615
|
*/
|
|
8627
8616
|
getProductRecommendations(r) {
|
|
8628
|
-
return this.get(`/internal/catalog/recommendations/products/${r.id}`, {}, (e) => new
|
|
8617
|
+
return this.get(`/internal/catalog/recommendations/products/${r.id}`, {}, (e) => new ht(e.data));
|
|
8629
8618
|
}
|
|
8630
8619
|
/**
|
|
8631
8620
|
* Выполняет сохранение данных о рекомендуемых категориях продуктов.
|
|
@@ -8654,12 +8643,12 @@ class en extends h {
|
|
|
8654
8643
|
});
|
|
8655
8644
|
}
|
|
8656
8645
|
}
|
|
8657
|
-
var
|
|
8658
|
-
class Xs extends C {
|
|
8659
|
-
}
|
|
8646
|
+
var Ks = /* @__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))(Ks || {}), 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 || {});
|
|
8660
8647
|
class Zs extends C {
|
|
8661
8648
|
}
|
|
8662
|
-
class
|
|
8649
|
+
class ei extends C {
|
|
8650
|
+
}
|
|
8651
|
+
class gt extends C {
|
|
8663
8652
|
/**
|
|
8664
8653
|
* Инициализирует экземпляр класса {@link CityWithUserRegion}.
|
|
8665
8654
|
*
|
|
@@ -8672,18 +8661,18 @@ class pt extends C {
|
|
|
8672
8661
|
* @inheritDoc
|
|
8673
8662
|
*/
|
|
8674
8663
|
s(this, "userRegions");
|
|
8675
|
-
this.userRegions = ((t = e == null ? void 0 : e.userRegions) == null ? void 0 : t.map((i) => new
|
|
8664
|
+
this.userRegions = ((t = e == null ? void 0 : e.userRegions) == null ? void 0 : t.map((i) => new cr(i))) ?? [];
|
|
8676
8665
|
}
|
|
8677
8666
|
}
|
|
8678
|
-
class ei extends C {
|
|
8679
|
-
}
|
|
8680
8667
|
class ri extends C {
|
|
8681
8668
|
}
|
|
8682
8669
|
class ti extends C {
|
|
8683
8670
|
}
|
|
8684
8671
|
class si extends C {
|
|
8685
8672
|
}
|
|
8686
|
-
class
|
|
8673
|
+
class ii extends C {
|
|
8674
|
+
}
|
|
8675
|
+
class tn {
|
|
8687
8676
|
/**
|
|
8688
8677
|
* Генерирует и возвращает данные-заглушку неопределённой записи справочника.
|
|
8689
8678
|
*
|
|
@@ -8702,7 +8691,7 @@ class rn {
|
|
|
8702
8691
|
return r.id === 0 && r.slug === "-undefined-";
|
|
8703
8692
|
}
|
|
8704
8693
|
}
|
|
8705
|
-
class
|
|
8694
|
+
class zt extends C {
|
|
8706
8695
|
}
|
|
8707
8696
|
const j = class j extends Me {
|
|
8708
8697
|
/**
|
|
@@ -8722,26 +8711,26 @@ const j = class j extends Me {
|
|
|
8722
8711
|
* и использовать в случае аналогичных запросов.
|
|
8723
8712
|
*/
|
|
8724
8713
|
getReference(r, e = !1) {
|
|
8725
|
-
return this.getTypedDataArrayRequester(
|
|
8714
|
+
return this.getTypedDataArrayRequester(Zs, `/internal/references/${r}`, e);
|
|
8726
8715
|
}
|
|
8727
8716
|
/**
|
|
8728
8717
|
* Возвращает {@link Promise} для получения справочника данных о канале
|
|
8729
8718
|
* первичного интереса.
|
|
8730
8719
|
*/
|
|
8731
8720
|
getChannelPrimaryInterest() {
|
|
8732
|
-
return this.getTypedDataArrayRequester(
|
|
8721
|
+
return this.getTypedDataArrayRequester(qt, "/internal/references/channel-primary-interest", !0);
|
|
8733
8722
|
}
|
|
8734
8723
|
/**
|
|
8735
8724
|
* Возвращает {@link Promise} для получения справочника должностей контактных лиц.
|
|
8736
8725
|
*/
|
|
8737
8726
|
getContactPositions() {
|
|
8738
|
-
return this.getTypedDataArrayRequester(
|
|
8727
|
+
return this.getTypedDataArrayRequester(ri, "/internal/references/contact-position", !0);
|
|
8739
8728
|
}
|
|
8740
8729
|
/**
|
|
8741
8730
|
* Возвращает {@link Promise} для получения справочника списка направлений кураторства.
|
|
8742
8731
|
*/
|
|
8743
8732
|
getCuratedDirection() {
|
|
8744
|
-
return this.getTypedDataArrayRequester(
|
|
8733
|
+
return this.getTypedDataArrayRequester(Wr, "/internal/references/curated-direction", !0);
|
|
8745
8734
|
}
|
|
8746
8735
|
/**
|
|
8747
8736
|
* Возвращает {@link Promise} для получения справочника списка валют.
|
|
@@ -8766,37 +8755,37 @@ const j = class j extends Me {
|
|
|
8766
8755
|
* Возвращает {@link Promise} для получения справочника операторов.
|
|
8767
8756
|
*/
|
|
8768
8757
|
getOperators() {
|
|
8769
|
-
return this.getTypedDataArrayRequester(
|
|
8758
|
+
return this.getTypedDataArrayRequester(Bt, "/internal/references/operator", !0);
|
|
8770
8759
|
}
|
|
8771
8760
|
/**
|
|
8772
8761
|
* Возвращает {@link Promise} для получения справочника данных статусов оплаты заказов.
|
|
8773
8762
|
*/
|
|
8774
8763
|
getOrderPaymentStatuses() {
|
|
8775
|
-
return this.getTypedDataArrayRequester(
|
|
8764
|
+
return this.getTypedDataArrayRequester(ti, "/public/references/order-payment-status", !0);
|
|
8776
8765
|
}
|
|
8777
8766
|
/**
|
|
8778
8767
|
* Возвращает {@link Promise} для получения справочника данных статусов заказов.
|
|
8779
8768
|
*/
|
|
8780
8769
|
getOrderStatuses() {
|
|
8781
|
-
return this.getTypedDataArrayRequester(
|
|
8770
|
+
return this.getTypedDataArrayRequester(lr, "/internal/references/order-status", !0);
|
|
8782
8771
|
}
|
|
8783
8772
|
/**
|
|
8784
8773
|
* Возвращает {@link Promise} для получения справочника детализирующих статусов (подстатусов) заказов.
|
|
8785
8774
|
*/
|
|
8786
8775
|
getOrderStatusDetails() {
|
|
8787
|
-
return this.getTypedDataArrayRequester(
|
|
8776
|
+
return this.getTypedDataArrayRequester(si, "/internal/references/order-status-detail", !0);
|
|
8788
8777
|
}
|
|
8789
8778
|
/**
|
|
8790
8779
|
* Возвращает {@link Promise} для получения справочника данных типов оплаты заказов.
|
|
8791
8780
|
*/
|
|
8792
8781
|
getPaymentTypes() {
|
|
8793
|
-
return this.getTypedDataArrayRequester(
|
|
8782
|
+
return this.getTypedDataArrayRequester(Gt, "/public/references/payment-type", !0);
|
|
8794
8783
|
}
|
|
8795
8784
|
/**
|
|
8796
8785
|
* Возвращает {@link Promise} для получения справочника типов ресурсов.
|
|
8797
8786
|
*/
|
|
8798
8787
|
getResourceTypes() {
|
|
8799
|
-
return this.getTypedDataArrayRequester(
|
|
8788
|
+
return this.getTypedDataArrayRequester(zt, "/internal/references/resource-type", !0);
|
|
8800
8789
|
}
|
|
8801
8790
|
/**
|
|
8802
8791
|
* Возвращает {@link Promise} для получения справочника данных направлений продаж.
|
|
@@ -8808,7 +8797,7 @@ const j = class j extends Me {
|
|
|
8808
8797
|
* Возвращает {@link Promise} для получения справочника данных об источнике первичного интереса.
|
|
8809
8798
|
*/
|
|
8810
8799
|
getSourcePrimaryInterest() {
|
|
8811
|
-
return this.getTypedDataArrayRequester(
|
|
8800
|
+
return this.getTypedDataArrayRequester(Nt, "/internal/references/source-primary-interest", !0);
|
|
8812
8801
|
}
|
|
8813
8802
|
/**
|
|
8814
8803
|
* Выполняет поиск данных о городах по терму в названии.
|
|
@@ -8846,7 +8835,7 @@ const j = class j extends Me {
|
|
|
8846
8835
|
* @param regionId Идентификатор региона.
|
|
8847
8836
|
*/
|
|
8848
8837
|
getCitiesByRegion(r) {
|
|
8849
|
-
return this.getTypedDataArrayRequester(
|
|
8838
|
+
return this.getTypedDataArrayRequester(ei, "/internal/references/city", !1, { params: { regionId: r } }).then(
|
|
8850
8839
|
(e) => j.withoutUnknownLocation(e)
|
|
8851
8840
|
);
|
|
8852
8841
|
}
|
|
@@ -8857,7 +8846,7 @@ const j = class j extends Me {
|
|
|
8857
8846
|
* @param regionId Идентификатор региона.
|
|
8858
8847
|
*/
|
|
8859
8848
|
getCitiesWithUserRegionByRegion(r) {
|
|
8860
|
-
return this.getTypedDataArrayRequester(
|
|
8849
|
+
return this.getTypedDataArrayRequester(gt, "/internal/references/city-with-user-region", !1, { params: { regionId: r } }).then(
|
|
8861
8850
|
(e) => j.withoutUnknownLocation(e)
|
|
8862
8851
|
);
|
|
8863
8852
|
}
|
|
@@ -8886,7 +8875,7 @@ const j = class j extends Me {
|
|
|
8886
8875
|
* @param signal Сигнал отмены запроса.
|
|
8887
8876
|
*/
|
|
8888
8877
|
searchCityWithUserRegion(r, e = void 0) {
|
|
8889
|
-
return this.getTypedDataArrayRequester(
|
|
8878
|
+
return this.getTypedDataArrayRequester(gt, "/internal/references/city-with-user-region/search", !1, { term: r }, e).then(
|
|
8890
8879
|
(t) => j.withoutUnknownLocation(t)
|
|
8891
8880
|
);
|
|
8892
8881
|
}
|
|
@@ -8914,7 +8903,7 @@ const j = class j extends Me {
|
|
|
8914
8903
|
* Возвращает {@link Promise} для получения справочника типов свойств.
|
|
8915
8904
|
*/
|
|
8916
8905
|
getPropertyTypes() {
|
|
8917
|
-
return this.getTypedDataArrayRequester(
|
|
8906
|
+
return this.getTypedDataArrayRequester(Ot, "/internal/references/property-type", !0);
|
|
8918
8907
|
}
|
|
8919
8908
|
/**
|
|
8920
8909
|
* Возвращает {@link Promise} для получения справочника коэффициентов цен.
|
|
@@ -8926,7 +8915,7 @@ const j = class j extends Me {
|
|
|
8926
8915
|
* Возвращает {@link Promise} для получения справочника типов файлов продуктов/категорий.
|
|
8927
8916
|
*/
|
|
8928
8917
|
getProductFileType() {
|
|
8929
|
-
return this.getTypedDataArrayRequester(
|
|
8918
|
+
return this.getTypedDataArrayRequester(ii, "/public/references/product-file-type", !0);
|
|
8930
8919
|
}
|
|
8931
8920
|
};
|
|
8932
8921
|
/**
|
|
@@ -8936,7 +8925,7 @@ const j = class j extends Me {
|
|
|
8936
8925
|
s(j, "unknownLocationId", 1);
|
|
8937
8926
|
let d = j;
|
|
8938
8927
|
const A = ue("common.references_private", () => {
|
|
8939
|
-
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), T = v(void 0), Ae = v(void 0), Se = v(void 0), me = v(void 0), ye = v(void 0),
|
|
8928
|
+
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), T = v(void 0), Ae = v(void 0), Se = v(void 0), me = v(void 0), ye = v(void 0), ur = v(void 0), pr = v(void 0), hr = v(void 0), l = v(void 0);
|
|
8940
8929
|
return {
|
|
8941
8930
|
/**
|
|
8942
8931
|
* Список загружаемых/загруженных на данный момент значений.
|
|
@@ -9005,21 +8994,21 @@ const A = ue("common.references_private", () => {
|
|
|
9005
8994
|
/**
|
|
9006
8995
|
* Справочник источников первичного интереса.
|
|
9007
8996
|
*/
|
|
9008
|
-
sourcePrimaryInterestReference:
|
|
8997
|
+
sourcePrimaryInterestReference: ur,
|
|
9009
8998
|
/**
|
|
9010
8999
|
* Справочник складов.
|
|
9011
9000
|
*/
|
|
9012
|
-
warehousesReference:
|
|
9001
|
+
warehousesReference: pr,
|
|
9013
9002
|
/**
|
|
9014
9003
|
* Справочник типов свойств.
|
|
9015
9004
|
*/
|
|
9016
|
-
propertyTypesReference:
|
|
9005
|
+
propertyTypesReference: hr,
|
|
9017
9006
|
/**
|
|
9018
9007
|
* Справочник коэффициентов цен.
|
|
9019
9008
|
*/
|
|
9020
9009
|
priceCoefficientsReference: l
|
|
9021
9010
|
};
|
|
9022
|
-
}),
|
|
9011
|
+
}), sn = ue("common.references", () => {
|
|
9023
9012
|
const n = b(() => {
|
|
9024
9013
|
const l = A();
|
|
9025
9014
|
return !l.channelPrimaryInterestReference && !l.dataLoaderList.channelPrimaryInterestReference && (l.dataLoaderList.channelPrimaryInterestReference = !0, h.getInstance(d).getChannelPrimaryInterest().then((f) => {
|
|
@@ -9097,20 +9086,20 @@ const A = ue("common.references_private", () => {
|
|
|
9097
9086
|
}).catch(R)), l.deliveryTypeReference;
|
|
9098
9087
|
}), ye = b(() => {
|
|
9099
9088
|
const l = A();
|
|
9100
|
-
return !l.managersList && !l.dataLoaderList.managersList && (l.dataLoaderList.managersList = !0, h.getInstance(
|
|
9089
|
+
return !l.managersList && !l.dataLoaderList.managersList && (l.dataLoaderList.managersList = !0, h.getInstance(Ft).getManagers().then((f) => {
|
|
9101
9090
|
l.managersList = f;
|
|
9102
9091
|
}).catch(R)), l.managersList;
|
|
9103
|
-
}),
|
|
9092
|
+
}), ur = b(() => {
|
|
9104
9093
|
const l = A();
|
|
9105
9094
|
return !l.warehousesReference && !l.dataLoaderList.warehousesReference && (l.dataLoaderList.warehousesReference = !0, h.getInstance(d).getWarehouses().then((f) => {
|
|
9106
9095
|
l.warehousesReference = f;
|
|
9107
9096
|
}).catch(R)), l.warehousesReference;
|
|
9108
|
-
}),
|
|
9097
|
+
}), pr = b(() => {
|
|
9109
9098
|
const l = A();
|
|
9110
9099
|
return !l.propertyTypesReference && !l.dataLoaderList.propertyTypesReference && (l.dataLoaderList.propertyTypesReference = !0, h.getInstance(d).getPropertyTypes().then((f) => {
|
|
9111
9100
|
l.propertyTypesReference = f;
|
|
9112
9101
|
}).catch(R)), l.propertyTypesReference;
|
|
9113
|
-
}),
|
|
9102
|
+
}), hr = b(() => {
|
|
9114
9103
|
const l = A();
|
|
9115
9104
|
return !l.priceCoefficientsReference && !l.dataLoaderList.priceCoefficientsReference && (l.dataLoaderList.priceCoefficientsReference = !0, h.getInstance(d).getPriceCoefficients().then((f) => {
|
|
9116
9105
|
l.priceCoefficientsReference = f;
|
|
@@ -9184,18 +9173,18 @@ const A = ue("common.references_private", () => {
|
|
|
9184
9173
|
/**
|
|
9185
9174
|
* Справочник складов.
|
|
9186
9175
|
*/
|
|
9187
|
-
warehousesReference:
|
|
9176
|
+
warehousesReference: ur,
|
|
9188
9177
|
/**
|
|
9189
9178
|
* Справочник типов свойств.
|
|
9190
9179
|
*/
|
|
9191
|
-
propertyTypesReference:
|
|
9180
|
+
propertyTypesReference: pr,
|
|
9192
9181
|
/**
|
|
9193
9182
|
* Справочник коэффициентов цен.
|
|
9194
9183
|
*/
|
|
9195
|
-
priceCoefficientsReference:
|
|
9184
|
+
priceCoefficientsReference: hr
|
|
9196
9185
|
};
|
|
9197
9186
|
});
|
|
9198
|
-
class
|
|
9187
|
+
class ni {
|
|
9199
9188
|
/**
|
|
9200
9189
|
* Инициализирует экземпляр класса {@link MetaTagItem}.
|
|
9201
9190
|
*
|
|
@@ -9213,7 +9202,7 @@ class ii {
|
|
|
9213
9202
|
this.name = r.name, this.content = r.content;
|
|
9214
9203
|
}
|
|
9215
9204
|
}
|
|
9216
|
-
class
|
|
9205
|
+
class ft {
|
|
9217
9206
|
/**
|
|
9218
9207
|
* Инициализирует экземпляр класса {@link Seo}.
|
|
9219
9208
|
*
|
|
@@ -9253,10 +9242,10 @@ class ht {
|
|
|
9253
9242
|
*/
|
|
9254
9243
|
s(this, "tags");
|
|
9255
9244
|
var e;
|
|
9256
|
-
this.resourceType = new
|
|
9245
|
+
this.resourceType = new zt(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 ni(t))) ?? [], this.tags = r == null ? void 0 : r.tags;
|
|
9257
9246
|
}
|
|
9258
9247
|
}
|
|
9259
|
-
class
|
|
9248
|
+
class nn extends h {
|
|
9260
9249
|
/**
|
|
9261
9250
|
* Возвращает {@link Promise} для получения данных о SEO-параметрах указанного ресурса.
|
|
9262
9251
|
*
|
|
@@ -9264,7 +9253,7 @@ class sn extends h {
|
|
|
9264
9253
|
* @param resourceId Идентификатор ресурса для которого необходимо получить SEO-данные.
|
|
9265
9254
|
*/
|
|
9266
9255
|
getResourceSeoData(r, e) {
|
|
9267
|
-
return this.get(`/internal/seo/${r.slug}/${e}`, {}, (t) => new
|
|
9256
|
+
return this.get(`/internal/seo/${r.slug}/${e}`, {}, (t) => new ft(t.data));
|
|
9268
9257
|
}
|
|
9269
9258
|
/**
|
|
9270
9259
|
* Выполняет сохранение данных о SEO-параметрах для указанного ресурса.
|
|
@@ -9275,7 +9264,7 @@ class sn extends h {
|
|
|
9275
9264
|
* в случае ошибок в запросах.
|
|
9276
9265
|
*/
|
|
9277
9266
|
saveResourceSeoData(r, e = {}) {
|
|
9278
|
-
return this.post(`/internal/seo/${r.resourceType.slug}/${r.resourceId}`, r, (t) => new
|
|
9267
|
+
return this.post(`/internal/seo/${r.resourceType.slug}/${r.resourceId}`, r, (t) => new ft(t.data), e);
|
|
9279
9268
|
}
|
|
9280
9269
|
/**
|
|
9281
9270
|
* Возвращает {@link Promise} для удаления данных о SEO-параметрах указанного ресурса.
|
|
@@ -9287,7 +9276,61 @@ class sn extends h {
|
|
|
9287
9276
|
return this.delete(`/internal/seo/${r.slug}/${e}`);
|
|
9288
9277
|
}
|
|
9289
9278
|
}
|
|
9290
|
-
|
|
9279
|
+
var Ze = /* @__PURE__ */ ((n) => (n[n.Undetermined = 0] = "Undetermined", n[n.Complete = 1] = "Complete", n[n.Incomplete = 2] = "Incomplete", n))(Ze || {});
|
|
9280
|
+
class dr {
|
|
9281
|
+
/**
|
|
9282
|
+
* Инициализирует экземпляр класса {@link FieldValidationResultData}.
|
|
9283
|
+
*
|
|
9284
|
+
* @param feedback Сообщение об ошибке валидации.
|
|
9285
|
+
* @param validationStatus Статус валидации.
|
|
9286
|
+
*/
|
|
9287
|
+
constructor(r, e) {
|
|
9288
|
+
/**
|
|
9289
|
+
* Признак необходимости отображать сообщение об ошибке валидации.
|
|
9290
|
+
*/
|
|
9291
|
+
s(this, "showFeedback", !1);
|
|
9292
|
+
/**
|
|
9293
|
+
* Сообщение об ошибке валидации.
|
|
9294
|
+
*/
|
|
9295
|
+
s(this, "feedback", "");
|
|
9296
|
+
/**
|
|
9297
|
+
* Статус валидации.
|
|
9298
|
+
*/
|
|
9299
|
+
s(this, "validationStatus");
|
|
9300
|
+
this.showFeedback = !!r, this.feedback = r, this.validationStatus = e;
|
|
9301
|
+
}
|
|
9302
|
+
}
|
|
9303
|
+
class on {
|
|
9304
|
+
/**
|
|
9305
|
+
* Возвращает признак, что адрес с указанной полнотой нельзя сохранять.
|
|
9306
|
+
*
|
|
9307
|
+
* @param quality Полнота адреса или `undefined`, если она неизвестна.
|
|
9308
|
+
* @param isIncompleteBlocked Признак, что сохранение неполного адреса запрещено.
|
|
9309
|
+
*/
|
|
9310
|
+
static isBlocked(r, e) {
|
|
9311
|
+
return e && r === Ze.Incomplete;
|
|
9312
|
+
}
|
|
9313
|
+
/**
|
|
9314
|
+
* Возвращает результат проверки полноты адреса для отображения под полем ввода
|
|
9315
|
+
* или `undefined`, если адрес полный или полнота неизвестна.
|
|
9316
|
+
*
|
|
9317
|
+
* Неполный адрес при запрете сохранения отображается как ошибка, в остальных случаях как предупреждение.
|
|
9318
|
+
*
|
|
9319
|
+
* @param quality Полнота адреса.
|
|
9320
|
+
* @param isIncompleteBlocked Признак, что сохранение неполного адреса запрещено.
|
|
9321
|
+
*/
|
|
9322
|
+
static getValidationResult(r, e) {
|
|
9323
|
+
switch (r) {
|
|
9324
|
+
case Ze.Incomplete:
|
|
9325
|
+
return e ? new dr("Адрес неполный, выберите более точный вариант из подсказок", "error") : new dr("Адрес неполный, проверьте его", "warning");
|
|
9326
|
+
case Ze.Undetermined:
|
|
9327
|
+
return new dr("Не удалось определить полноту адреса, проверьте его", "warning");
|
|
9328
|
+
default:
|
|
9329
|
+
return;
|
|
9330
|
+
}
|
|
9331
|
+
}
|
|
9332
|
+
}
|
|
9333
|
+
class cn extends h {
|
|
9291
9334
|
/**
|
|
9292
9335
|
* Возвращает подсказки по адресам.
|
|
9293
9336
|
*
|
|
@@ -9334,8 +9377,8 @@ class nn extends h {
|
|
|
9334
9377
|
});
|
|
9335
9378
|
}
|
|
9336
9379
|
}
|
|
9337
|
-
var
|
|
9338
|
-
class
|
|
9380
|
+
var Wt = /* @__PURE__ */ ((n) => (n.Admin = "admin", n.Manager = "manager", n.Operator = "operator", n.Client = "client", n.ExternalSeo = "external_seo", n.Guest = "guest", n))(Wt || {});
|
|
9381
|
+
class oi extends kt {
|
|
9339
9382
|
/**
|
|
9340
9383
|
* Инициализирует экземпляр класса {@link User}.
|
|
9341
9384
|
*
|
|
@@ -9359,15 +9402,15 @@ class ni extends $t {
|
|
|
9359
9402
|
* Роль ценообразования текущего пользователя.
|
|
9360
9403
|
*/
|
|
9361
9404
|
s(this, "pricingRole");
|
|
9362
|
-
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
|
|
9405
|
+
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 At(e.pricingRole) : void 0;
|
|
9363
9406
|
}
|
|
9364
9407
|
}
|
|
9365
|
-
class
|
|
9408
|
+
class ln extends h {
|
|
9366
9409
|
/**
|
|
9367
9410
|
* Инициализирует экземпляр класса {@link UserAuthDataProvider}.
|
|
9368
9411
|
*/
|
|
9369
9412
|
constructor() {
|
|
9370
|
-
super(), this.baseUrl = `${
|
|
9413
|
+
super(), this.baseUrl = `${$().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
9371
9414
|
}
|
|
9372
9415
|
/**
|
|
9373
9416
|
* Функция для получения обновленных токенов доступа.
|
|
@@ -9378,16 +9421,16 @@ class on extends h {
|
|
|
9378
9421
|
return this.get("internal/users/current-tokens").then((r) => r.accessToken);
|
|
9379
9422
|
}
|
|
9380
9423
|
}
|
|
9381
|
-
class
|
|
9424
|
+
class ci extends h {
|
|
9382
9425
|
/**
|
|
9383
9426
|
* Возвращает данные о текущем пользователе.
|
|
9384
9427
|
*/
|
|
9385
9428
|
// eslint-disable-next-line class-methods-use-this
|
|
9386
9429
|
getCurrentUser() {
|
|
9387
|
-
return this.get("/internal/users/info", {}, (r) => new
|
|
9430
|
+
return this.get("/internal/users/info", {}, (r) => new oi(r.data), !0);
|
|
9388
9431
|
}
|
|
9389
9432
|
}
|
|
9390
|
-
const
|
|
9433
|
+
const qr = ue("common.user_state_private", () => {
|
|
9391
9434
|
const n = v({}), r = v(void 0), e = v(void 0);
|
|
9392
9435
|
return {
|
|
9393
9436
|
/**
|
|
@@ -9404,23 +9447,23 @@ const Ir = ue("common.user_state_private", () => {
|
|
|
9404
9447
|
currentManager: e
|
|
9405
9448
|
};
|
|
9406
9449
|
});
|
|
9407
|
-
function
|
|
9408
|
-
const r =
|
|
9409
|
-
(n == null ? void 0 : n.type) !==
|
|
9450
|
+
function mt(n) {
|
|
9451
|
+
const r = qr();
|
|
9452
|
+
(n == null ? void 0 : n.type) !== Wt.Manager || r.currentManager || r.dataLoaderList.currentManager || (r.dataLoaderList.currentManager = !0, h.getInstance(Ft).getManager(n.id).then((e) => {
|
|
9410
9453
|
r.currentManager = e;
|
|
9411
9454
|
}).catch(R).finally(() => {
|
|
9412
9455
|
r.dataLoaderList.currentManager = !1;
|
|
9413
9456
|
}));
|
|
9414
9457
|
}
|
|
9415
|
-
const
|
|
9458
|
+
const un = ue("common.user_state", () => {
|
|
9416
9459
|
const n = b(() => {
|
|
9417
|
-
const e =
|
|
9418
|
-
return !e.currentUser && !e.dataLoaderList.currentUser && (e.dataLoaderList.currentUser = !0, h.getInstance(
|
|
9419
|
-
e.currentUser = t,
|
|
9460
|
+
const e = qr();
|
|
9461
|
+
return !e.currentUser && !e.dataLoaderList.currentUser && (e.dataLoaderList.currentUser = !0, h.getInstance(ci).getCurrentUser().then((t) => {
|
|
9462
|
+
e.currentUser = t, mt(t);
|
|
9420
9463
|
}).catch(R).finally(() => {
|
|
9421
9464
|
e.dataLoaderList.currentUser = !1;
|
|
9422
9465
|
})), e.currentUser;
|
|
9423
|
-
}), r = b(() => (
|
|
9466
|
+
}), r = b(() => (mt(n.value), qr().currentManager));
|
|
9424
9467
|
return {
|
|
9425
9468
|
/**
|
|
9426
9469
|
* Данные о текущем пользователе.
|
|
@@ -9432,7 +9475,7 @@ const cn = ue("common.user_state", () => {
|
|
|
9432
9475
|
currentManager: r
|
|
9433
9476
|
};
|
|
9434
9477
|
});
|
|
9435
|
-
class
|
|
9478
|
+
class Nr {
|
|
9436
9479
|
/**
|
|
9437
9480
|
* Инициализирует экземпляр класса {@link UserRegionEmployee}.
|
|
9438
9481
|
*
|
|
@@ -9450,7 +9493,7 @@ class _r {
|
|
|
9450
9493
|
this.user = new q(r == null ? void 0 : r.user), this.salesDirection = new F(r == null ? void 0 : r.salesDirection);
|
|
9451
9494
|
}
|
|
9452
9495
|
}
|
|
9453
|
-
class
|
|
9496
|
+
class Ar extends cr {
|
|
9454
9497
|
/**
|
|
9455
9498
|
* Инициализирует экземпляр класса {@link UserRegion}.
|
|
9456
9499
|
*
|
|
@@ -9467,10 +9510,10 @@ class br extends or {
|
|
|
9467
9510
|
* @inheritDoc
|
|
9468
9511
|
*/
|
|
9469
9512
|
s(this, "users");
|
|
9470
|
-
this.cities = ((t = e == null ? void 0 : e.cities) == null ? void 0 : t.map((o) => new ee(o))) ?? [], this.users = ((i = e == null ? void 0 : e.users) == null ? void 0 : i.map((o) => new
|
|
9513
|
+
this.cities = ((t = e == null ? void 0 : e.cities) == null ? void 0 : t.map((o) => new ee(o))) ?? [], this.users = ((i = e == null ? void 0 : e.users) == null ? void 0 : i.map((o) => new Nr(o))) ?? [];
|
|
9471
9514
|
}
|
|
9472
9515
|
}
|
|
9473
|
-
class
|
|
9516
|
+
class pn extends de {
|
|
9474
9517
|
/**
|
|
9475
9518
|
* Инициализирует экземпляр класса {@link UserRegionsListFilters}.
|
|
9476
9519
|
*
|
|
@@ -9506,7 +9549,7 @@ class ln extends de {
|
|
|
9506
9549
|
return this;
|
|
9507
9550
|
}
|
|
9508
9551
|
}
|
|
9509
|
-
class
|
|
9552
|
+
class hn extends M {
|
|
9510
9553
|
/**
|
|
9511
9554
|
* Возвращает список регионов пользователей.
|
|
9512
9555
|
*
|
|
@@ -9517,7 +9560,7 @@ class un extends M {
|
|
|
9517
9560
|
* @see /doc/api/internal#/operations/api_internal_user_region_get_list
|
|
9518
9561
|
*/
|
|
9519
9562
|
getRegionsList(r, e, t) {
|
|
9520
|
-
return this.getTypedPaginated(
|
|
9563
|
+
return this.getTypedPaginated(cr, "/internal/users/regions", r, e, t);
|
|
9521
9564
|
}
|
|
9522
9565
|
/**
|
|
9523
9566
|
* Возвращает полные данные о регионе пользователей.
|
|
@@ -9527,7 +9570,7 @@ class un extends M {
|
|
|
9527
9570
|
* @see /doc/api/internal#/operations/api_internal_user_region_get
|
|
9528
9571
|
*/
|
|
9529
9572
|
getRegion(r) {
|
|
9530
|
-
return this.get(`/internal/users/regions/${r}`, {}, (e) => new
|
|
9573
|
+
return this.get(`/internal/users/regions/${r}`, {}, (e) => new Ar(e.data));
|
|
9531
9574
|
}
|
|
9532
9575
|
/**
|
|
9533
9576
|
* Создаёт новый регион пользователей.
|
|
@@ -9540,7 +9583,7 @@ class un extends M {
|
|
|
9540
9583
|
* @see /doc/api/internal#/operations/api_internal_user_region_create
|
|
9541
9584
|
*/
|
|
9542
9585
|
createRegion(r, e = {}) {
|
|
9543
|
-
return this.post("/internal/users/regions", r, (t) => new
|
|
9586
|
+
return this.post("/internal/users/regions", r, (t) => new Ar(t.data), e);
|
|
9544
9587
|
}
|
|
9545
9588
|
/**
|
|
9546
9589
|
* Изменяет данные о регионе пользователей.
|
|
@@ -9554,7 +9597,7 @@ class un extends M {
|
|
|
9554
9597
|
* @see /doc/api/internal#/operations/api_internal_user_region_change
|
|
9555
9598
|
*/
|
|
9556
9599
|
updateRegion(r, e, t = {}) {
|
|
9557
|
-
return this.patch(`/internal/users/regions/${r}`, e, (i) => new
|
|
9600
|
+
return this.patch(`/internal/users/regions/${r}`, e, (i) => new Ar(i.data), t);
|
|
9558
9601
|
}
|
|
9559
9602
|
/**
|
|
9560
9603
|
* Удаляет регион пользователей.
|
|
@@ -9574,7 +9617,7 @@ class un extends M {
|
|
|
9574
9617
|
* @see /doc/api/internal#/operations/api_internal_user_region_user_get_list
|
|
9575
9618
|
*/
|
|
9576
9619
|
getRegionEmployees(r) {
|
|
9577
|
-
return this.getTypedList(
|
|
9620
|
+
return this.getTypedList(Nr, `/internal/users/regions/${r}/users`);
|
|
9578
9621
|
}
|
|
9579
9622
|
/**
|
|
9580
9623
|
* Закрепляет сотрудника за регионом по указанному направлению продаж.
|
|
@@ -9586,7 +9629,7 @@ class un extends M {
|
|
|
9586
9629
|
* @see /doc/api/internal#/operations/api_internal_user_region_user_add
|
|
9587
9630
|
*/
|
|
9588
9631
|
attachRegionEmployee(r, e, t) {
|
|
9589
|
-
return this.post(`/internal/users/regions/${r}/users/${e}`, { salesDirectionId: t }, (i) => new
|
|
9632
|
+
return this.post(`/internal/users/regions/${r}/users/${e}`, { salesDirectionId: t }, (i) => new Nr(i.data));
|
|
9590
9633
|
}
|
|
9591
9634
|
/**
|
|
9592
9635
|
* Открепляет сотрудника от региона по указанному направлению продаж.
|
|
@@ -9605,241 +9648,219 @@ class un extends M {
|
|
|
9605
9648
|
});
|
|
9606
9649
|
}
|
|
9607
9650
|
}
|
|
9608
|
-
class pn {
|
|
9609
|
-
/**
|
|
9610
|
-
* Инициализирует экземпляр класса {@link FieldValidationResultData}.
|
|
9611
|
-
*
|
|
9612
|
-
* @param feedback Сообщение об ошибке валидации.
|
|
9613
|
-
* @param validationStatus Статус валидации.
|
|
9614
|
-
*/
|
|
9615
|
-
constructor(r, e) {
|
|
9616
|
-
/**
|
|
9617
|
-
* Признак необходимости отображать сообщение об ошибке валидации.
|
|
9618
|
-
*/
|
|
9619
|
-
s(this, "showFeedback", !1);
|
|
9620
|
-
/**
|
|
9621
|
-
* Сообщение об ошибке валидации.
|
|
9622
|
-
*/
|
|
9623
|
-
s(this, "feedback", "");
|
|
9624
|
-
/**
|
|
9625
|
-
* Статус валидации.
|
|
9626
|
-
*/
|
|
9627
|
-
s(this, "validationStatus");
|
|
9628
|
-
this.showFeedback = !!r, this.feedback = r, this.validationStatus = e;
|
|
9629
|
-
}
|
|
9630
|
-
}
|
|
9631
9651
|
export {
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9652
|
+
Ze as AddressQualityEnum,
|
|
9653
|
+
on as AddressQualityHelper,
|
|
9654
|
+
Zs as AnyReference,
|
|
9655
|
+
Ts as AppBaseConfig,
|
|
9656
|
+
Lr as BankAccount,
|
|
9635
9657
|
M as BasePaginationProvider,
|
|
9636
|
-
|
|
9637
|
-
|
|
9658
|
+
wr as BlogPost,
|
|
9659
|
+
$r as BlogPostMediaFile,
|
|
9638
9660
|
Qe as BlogPostMediaTypeEnum,
|
|
9639
9661
|
Je as BlogPostPublicationStatusEnum,
|
|
9640
9662
|
Ue as BlogPostShortInfo,
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9663
|
+
ai as BlogPostsListFilters,
|
|
9664
|
+
kr as BlogProvider,
|
|
9665
|
+
Ss as CalculationTypeEnum,
|
|
9644
9666
|
y as CalendarHelper,
|
|
9645
9667
|
Le as Cart,
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9668
|
+
vi as CartProvider,
|
|
9669
|
+
Di as CatalogProvider,
|
|
9670
|
+
Pt as CatalogableItem,
|
|
9649
9671
|
Y as Category,
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9672
|
+
Is as CategoryFilter,
|
|
9673
|
+
nt as CategoryFilterSetting,
|
|
9674
|
+
xs as CategoryFilterValue,
|
|
9675
|
+
it as CategoryPricingRule,
|
|
9676
|
+
qt as ChannelPrimaryInterest,
|
|
9677
|
+
ei as City,
|
|
9656
9678
|
ee as CityWithRegionAndCountry,
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9679
|
+
gt as CityWithUserRegion,
|
|
9680
|
+
lt as Client,
|
|
9681
|
+
Es as ClientAdditionalData,
|
|
9682
|
+
tr as ClientCategory,
|
|
9661
9683
|
W as ClientDataProvider,
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9684
|
+
Lt as ClientPriceCatalogableItem,
|
|
9685
|
+
st as ClientPriceCategory,
|
|
9686
|
+
Dr as ClientPriceProduct,
|
|
9687
|
+
Ri as ClientPriceProvider,
|
|
9688
|
+
Pi as ClientPriceTemplateProvider,
|
|
9667
9689
|
Pe as ClientProduct,
|
|
9668
|
-
|
|
9669
|
-
|
|
9690
|
+
di as ClientProductCategoryDataProvider,
|
|
9691
|
+
Ai as ClientProductDataProvider,
|
|
9670
9692
|
fe as ClientShortInfo,
|
|
9671
|
-
|
|
9672
|
-
|
|
9693
|
+
_s as ClientsAdditionalDataRequestTypeEnum,
|
|
9694
|
+
Li as ClientsListFilters,
|
|
9673
9695
|
Fe as CodedIdentity,
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9696
|
+
_i as ConfiguratorProvider,
|
|
9697
|
+
Fs as ConfiguratorsEnum,
|
|
9698
|
+
xr as Contact,
|
|
9699
|
+
dt as ContactLinks,
|
|
9678
9700
|
oe as ContactPerson,
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9701
|
+
Us as ContactPersonRelated,
|
|
9702
|
+
ri as ContactPosition,
|
|
9703
|
+
Rr as ContactRelation,
|
|
9704
|
+
xt as ContragentBase,
|
|
9705
|
+
sr as ContragentFactory,
|
|
9706
|
+
It as ContragentIc,
|
|
9707
|
+
qs as ContragentPerson,
|
|
9708
|
+
Ns as ContragentUlNr,
|
|
9709
|
+
_t as ContragentUlR,
|
|
9710
|
+
Br as CostSourceEnum,
|
|
9689
9711
|
Te as Country,
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9712
|
+
ir as CreatableIdentity,
|
|
9713
|
+
Wr as CuratedDirection,
|
|
9714
|
+
jr as Curator,
|
|
9693
9715
|
J as Currency,
|
|
9694
|
-
|
|
9716
|
+
cn as DataSuggestionProvider,
|
|
9695
9717
|
O as DateHelper,
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9718
|
+
Fi as DateTimeProvider,
|
|
9719
|
+
Os as DeletableIdentity,
|
|
9720
|
+
or as DeletableNamedIdentity,
|
|
9699
9721
|
qe as DeliveryAddress,
|
|
9700
9722
|
X as DeliveryType,
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
Ur as DiscountShortInfo,
|
|
9723
|
+
Ct as DetailedJwtPayload,
|
|
9724
|
+
Cs as DeviceTypeResolutionConfig,
|
|
9725
|
+
Pr as Discount,
|
|
9726
|
+
Ir as DiscountClient,
|
|
9727
|
+
ut as DiscountClientEligibility,
|
|
9728
|
+
Bs as DiscountConditions,
|
|
9729
|
+
_r as DiscountProvider,
|
|
9730
|
+
Mr as DiscountShortInfo,
|
|
9710
9731
|
Ke as DiscountStateEnum,
|
|
9711
|
-
|
|
9712
|
-
|
|
9732
|
+
Gs as DiscountStateHelper,
|
|
9733
|
+
Bi as DiscountsListFilters,
|
|
9713
9734
|
We as Faq,
|
|
9714
9735
|
Xe as FaqGroup,
|
|
9715
|
-
|
|
9716
|
-
|
|
9736
|
+
Gi as FaqProvider,
|
|
9737
|
+
dr as FieldValidationResultData,
|
|
9717
9738
|
ie as FilterGroup,
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9739
|
+
rt as FilterItem,
|
|
9740
|
+
Fr as FilterOpEnum,
|
|
9741
|
+
Ls as FilterSettings,
|
|
9742
|
+
Rt as GeoCoordinates,
|
|
9743
|
+
ds as HiddenCatalogableItem,
|
|
9723
9744
|
Me as HttpCachedRequester,
|
|
9724
|
-
|
|
9745
|
+
Ds as HttpParamsConfig,
|
|
9725
9746
|
h as HttpRequester,
|
|
9726
9747
|
pe as Identity,
|
|
9727
|
-
|
|
9748
|
+
As as Image,
|
|
9728
9749
|
z as InterceptorsEnum,
|
|
9729
9750
|
be as JwtPayload,
|
|
9730
9751
|
Z as Manager,
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9752
|
+
zr as ManagerCommon,
|
|
9753
|
+
Wi as ManagerDataFactory,
|
|
9754
|
+
Ft as ManagerDataProvider,
|
|
9755
|
+
ni as MetaTagItem,
|
|
9735
9756
|
N as NamedIdentity,
|
|
9736
9757
|
G as Offer,
|
|
9737
|
-
|
|
9758
|
+
zs as OfferActualization,
|
|
9738
9759
|
_e as OfferActualizationStatus,
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9760
|
+
Vi as OfferHelper,
|
|
9761
|
+
Mt as OfferShortInfo,
|
|
9762
|
+
Yi as OffersDataProvider,
|
|
9763
|
+
ji as OffersListFilters,
|
|
9764
|
+
Bt as Operator,
|
|
9744
9765
|
ce as Opf,
|
|
9745
9766
|
K as OpfEnum,
|
|
9746
9767
|
L as Order,
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9768
|
+
Ys as OrderAction,
|
|
9769
|
+
Qi as OrderEditorData,
|
|
9770
|
+
Ht as OrderInfo,
|
|
9771
|
+
js as OrderItem,
|
|
9772
|
+
Tt as OrderItemBase,
|
|
9773
|
+
ti as OrderPaymentStatus,
|
|
9774
|
+
Et as OrderShortInfo,
|
|
9775
|
+
lr as OrderStatus,
|
|
9776
|
+
si as OrderStatusDetail,
|
|
9777
|
+
Xs as OrderStatusDetailEnum,
|
|
9778
|
+
Ks as OrderStatusEnum,
|
|
9779
|
+
Vs as OrderStatusHistoryInfo,
|
|
9780
|
+
Ki as OrdersDataProvider,
|
|
9781
|
+
Ji as OrdersListFilters,
|
|
9761
9782
|
de as PaginationFiltersBase,
|
|
9762
9783
|
le as PartnerGroup,
|
|
9763
|
-
|
|
9784
|
+
Gt as PaymentType,
|
|
9764
9785
|
Ve as PreferencesStorageProvider,
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9786
|
+
Tr as PriceAnalyze,
|
|
9787
|
+
Zi as PriceAnalyzeProvider,
|
|
9788
|
+
St as PriceCatalogableItem,
|
|
9768
9789
|
he as PriceCoefficient,
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9790
|
+
Dt as PriceCoefficientEnum,
|
|
9791
|
+
en as PriceHistoryDataProvider,
|
|
9792
|
+
Qs as PriceHistoryItem,
|
|
9772
9793
|
Ce as PriceTemplate,
|
|
9773
|
-
|
|
9794
|
+
vr as PriceTemplateCategory,
|
|
9774
9795
|
xe as PriceTemplateClient,
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9796
|
+
$t as PriceTemplateICatalogableItem,
|
|
9797
|
+
Cr as PriceTemplateProduct,
|
|
9798
|
+
Si as PriceTemplateProvider,
|
|
9778
9799
|
Ie as PricingRole,
|
|
9779
|
-
|
|
9780
|
-
|
|
9800
|
+
$i as PricingRoleProvider,
|
|
9801
|
+
Or as PrimaryCatalogableItem,
|
|
9781
9802
|
E as Product,
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9803
|
+
Ti as ProductCategoryDataProvider,
|
|
9804
|
+
bi as ProductDataProvider,
|
|
9805
|
+
ii as ProductFileType,
|
|
9806
|
+
bt as ProductFilterTypeEnum,
|
|
9807
|
+
Hr as ProductPriceCoefficient,
|
|
9808
|
+
Js as ProductPriceHistory,
|
|
9809
|
+
tt as ProductUnit,
|
|
9810
|
+
Ws as ProfstroyOfferItem,
|
|
9811
|
+
ki as PropertiesProvider,
|
|
9791
9812
|
De as Property,
|
|
9792
|
-
|
|
9793
|
-
|
|
9813
|
+
Ot as PropertyType,
|
|
9814
|
+
$s as PropertyTypeEnum,
|
|
9794
9815
|
ve as PropertyValue,
|
|
9795
|
-
|
|
9796
|
-
|
|
9816
|
+
rn as RecommendationsDataProvider,
|
|
9817
|
+
ht as RecommendationsList,
|
|
9797
9818
|
C as Reference,
|
|
9798
|
-
|
|
9819
|
+
tn as ReferenceDataFactory,
|
|
9799
9820
|
d as ReferenceDataProvider,
|
|
9800
9821
|
ne as Region,
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9822
|
+
zt as ResourceType,
|
|
9823
|
+
Mi as STANDARD_PERIOD_GROUPS,
|
|
9824
|
+
Hi as STANDARD_PERIOD_SECTIONS,
|
|
9804
9825
|
F as SalesDirection,
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9826
|
+
Rs as SentryConfig,
|
|
9827
|
+
ft as Seo,
|
|
9828
|
+
nn as SeoDataProvider,
|
|
9829
|
+
Nt as SourcePrimaryInterest,
|
|
9830
|
+
bs as StockCount,
|
|
9831
|
+
qi as TableDataPagination,
|
|
9832
|
+
Ms as TableDataPaginationRequestParams,
|
|
9833
|
+
Ni as TableDataSortRequestParams,
|
|
9834
|
+
Oi as TemplateProductCategoryDataProvider,
|
|
9835
|
+
Ci as TemplatesListFilters,
|
|
9815
9836
|
U as TypedInstanceFactory,
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9837
|
+
Ut as UnitsHelper,
|
|
9838
|
+
xi as UnknownClientDataProvider,
|
|
9839
|
+
nr as UpdatableNamedIdentity,
|
|
9840
|
+
oi as User,
|
|
9841
|
+
ln as UserAuthDataProvider,
|
|
9842
|
+
kt as UserCommonInfo,
|
|
9843
|
+
ci as UserDataProvider,
|
|
9844
|
+
At as UserPricingRole,
|
|
9845
|
+
Ar as UserRegion,
|
|
9846
|
+
Nr as UserRegionEmployee,
|
|
9847
|
+
hn as UserRegionProvider,
|
|
9848
|
+
cr as UserRegionShortInfo,
|
|
9849
|
+
pn as UserRegionsListFilters,
|
|
9829
9850
|
q as UserShortInfo,
|
|
9830
|
-
|
|
9831
|
-
|
|
9851
|
+
Wt as UserTypeEnum,
|
|
9852
|
+
Ii as VersionConfig,
|
|
9832
9853
|
He as Warehouse,
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9854
|
+
Ps as WebSocketConfig,
|
|
9855
|
+
Xi as currentOrderInjectionKey,
|
|
9856
|
+
Ei as daysAgoIso,
|
|
9857
|
+
ot as findCatalogItemByIdRecursive,
|
|
9858
|
+
ct as flattenCatalogItems,
|
|
9859
|
+
zi as formatPercentChange,
|
|
9860
|
+
Ui as formatRelativeDate,
|
|
9861
|
+
Hs as pluralize,
|
|
9841
9862
|
ze as useAuthStateStore,
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9863
|
+
$ as useBaseConfigStateStore,
|
|
9864
|
+
sn as useReferencesStore,
|
|
9865
|
+
un as useUserStateStore
|
|
9845
9866
|
};
|