@snabcentr/common-lib 1.87.0 → 1.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +1 -1
- package/dist/sc-common-lib.js +191 -174
- 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/orders/providers/orders-data-provider.d.ts +9 -0
- package/dist/src/orders/providers/orders-data-provider.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Lr = (n, r, e) => r in n ?
|
|
1
|
+
var Ir = Object.defineProperty;
|
|
2
|
+
var Lr = (n, r, e) => r in n ? Ir(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
3
|
var t = (n, r, e) => Lr(n, typeof r != "symbol" ? r + "" : r, e);
|
|
4
4
|
import { jwtDecode as ir } from "jwt-decode";
|
|
5
|
-
import { merge as
|
|
5
|
+
import { merge as oe, isNil as T, isEmpty as Y, noop as w, mapValues as nr, isArray as H, every as dr, split as xr, isString as v, constant as Or, toUpper as _r, cloneDeep as qr, toLower as Nr, isFunction as Ue, map as he, forEach as Ur, isDate as xe, omitBy as or, isObject as cr } from "lodash-es";
|
|
6
6
|
import { objectToCamel as He, objectToSnake as Je } from "ts-case-convert";
|
|
7
|
-
import { defineStore as
|
|
7
|
+
import { defineStore as z } from "pinia";
|
|
8
8
|
import { ref as y, markRaw as Hr, computed as A } from "vue";
|
|
9
9
|
import { isAfter as Ee, parseISO as C, startOfToday as Oe, format as U, addSeconds as jr, addBusinessDays as Fr, endOfTomorrow as Gr, startOfTomorrow as Mr, endOfYesterday as Br, startOfYesterday as zr, endOfToday as Wr, endOfDay as Jr, startOfDay as Er } from "date-fns";
|
|
10
10
|
import Vr, { CanceledError as Kr } from "axios";
|
|
@@ -99,7 +99,7 @@ class j {
|
|
|
99
99
|
* @inheritDoc
|
|
100
100
|
*/
|
|
101
101
|
t(this, "email", "");
|
|
102
|
-
|
|
102
|
+
oe(this, r);
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Возвращает данные полезной нагрузки для указанного JWT-токена.
|
|
@@ -143,7 +143,7 @@ class Gt extends j {
|
|
|
143
143
|
* @inheritDoc
|
|
144
144
|
*/
|
|
145
145
|
t(this, "address");
|
|
146
|
-
|
|
146
|
+
oe(this, e);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Возвращает данные полезной нагрузки для указанного JWT-токена.
|
|
@@ -336,7 +336,7 @@ class et {
|
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const I = z("common.config", () => {
|
|
340
340
|
const n = y(new et());
|
|
341
341
|
return {
|
|
342
342
|
/**
|
|
@@ -355,7 +355,7 @@ const a = B("common.config", () => {
|
|
|
355
355
|
* @param appConfig Конфигурация приложения.
|
|
356
356
|
*/
|
|
357
357
|
setConfig: (s) => {
|
|
358
|
-
n.value =
|
|
358
|
+
n.value = oe(n.value, s);
|
|
359
359
|
}
|
|
360
360
|
};
|
|
361
361
|
});
|
|
@@ -379,7 +379,7 @@ class ye {
|
|
|
379
379
|
try {
|
|
380
380
|
const s = JSON.parse(e);
|
|
381
381
|
if (!s.availableFor || Ee(C(s.availableFor) || Oe(), /* @__PURE__ */ new Date())) {
|
|
382
|
-
if (T(s.data) ||
|
|
382
|
+
if (T(s.data) || Y(s.data))
|
|
383
383
|
throw new Error("Data is empty");
|
|
384
384
|
return s.data;
|
|
385
385
|
}
|
|
@@ -401,7 +401,7 @@ class ye {
|
|
|
401
401
|
static saveActualDataToStorage(r, e, s) {
|
|
402
402
|
if (this.isLocalStorageAvailable())
|
|
403
403
|
try {
|
|
404
|
-
if (T(e) ||
|
|
404
|
+
if (T(e) || Y(e))
|
|
405
405
|
throw new Error("Data is empty");
|
|
406
406
|
const i = JSON.stringify({
|
|
407
407
|
availableFor: s,
|
|
@@ -476,7 +476,7 @@ function Ve(n) {
|
|
|
476
476
|
return;
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
const
|
|
479
|
+
const E = z("common.auth_state_private", () => {
|
|
480
480
|
const n = y(
|
|
481
481
|
(() => {
|
|
482
482
|
var u;
|
|
@@ -486,7 +486,7 @@ const J = B("common.auth_state_private", () => {
|
|
|
486
486
|
);
|
|
487
487
|
if (o)
|
|
488
488
|
return Promise.resolve(o);
|
|
489
|
-
const c = (u =
|
|
489
|
+
const c = (u = I().config.devMode) == null ? void 0 : u.initAuthBearerToken;
|
|
490
490
|
return c ? Promise.resolve(c) : void 0;
|
|
491
491
|
})()
|
|
492
492
|
), r = y(void 0), e = y(void 0), s = Hr(/* @__PURE__ */ new Map());
|
|
@@ -518,9 +518,9 @@ const J = B("common.auth_state_private", () => {
|
|
|
518
518
|
*/
|
|
519
519
|
recalculateUserPermissions: i
|
|
520
520
|
};
|
|
521
|
-
}), be =
|
|
521
|
+
}), be = z("common.auth_state", () => {
|
|
522
522
|
const n = A(() => {
|
|
523
|
-
const o =
|
|
523
|
+
const o = E();
|
|
524
524
|
if (T(o.jwtToken) && !T(o.jwtTokenUpdater)) {
|
|
525
525
|
const c = o.jwtTokenUpdater();
|
|
526
526
|
o.jwtToken = c, c.then((u) => {
|
|
@@ -530,18 +530,18 @@ const J = B("common.auth_state_private", () => {
|
|
|
530
530
|
return o.jwtToken;
|
|
531
531
|
});
|
|
532
532
|
function r(o) {
|
|
533
|
-
|
|
533
|
+
E().jwtTokenUpdater = o;
|
|
534
534
|
}
|
|
535
535
|
function e(o) {
|
|
536
|
-
const c =
|
|
536
|
+
const c = E();
|
|
537
537
|
c.jwtToken = Promise.resolve(o), ye.saveActualDataToStorage("sc.token", o, Ve(o)), c.recalculateUserPermissions();
|
|
538
538
|
}
|
|
539
539
|
function s() {
|
|
540
|
-
const o =
|
|
540
|
+
const o = E();
|
|
541
541
|
o.jwtToken = void 0, o.userPermissions = void 0, ye.saveActualDataToStorage("sc.token", void 0);
|
|
542
542
|
}
|
|
543
543
|
function i(o) {
|
|
544
|
-
const c =
|
|
544
|
+
const c = E();
|
|
545
545
|
!T(c.jwtToken) && T(c.userPermissions) && c.jwtToken.then((m) => {
|
|
546
546
|
const f = j.getJwtPayload(m);
|
|
547
547
|
c.userPermissions = f.exp * 1e3 > Date.now() ? nr(f.resourceAccess, (D) => (D == null ? void 0 : D.roles) ?? []) : void 0;
|
|
@@ -551,12 +551,12 @@ const J = B("common.auth_state_private", () => {
|
|
|
551
551
|
return c.userPermissionsComputedRefs.get(u);
|
|
552
552
|
const h = A(() => {
|
|
553
553
|
const m = (f) => {
|
|
554
|
-
var
|
|
554
|
+
var J;
|
|
555
555
|
const D = xr(f, ".");
|
|
556
556
|
if (D.length < 2)
|
|
557
557
|
return !1;
|
|
558
|
-
const [
|
|
559
|
-
return H(
|
|
558
|
+
const [re, te] = D, W = (J = E().userPermissions) == null ? void 0 : J[re];
|
|
559
|
+
return H(W) && W.includes(te);
|
|
560
560
|
};
|
|
561
561
|
return H(o) ? dr(o, (f) => m(f)) : m(o);
|
|
562
562
|
});
|
|
@@ -591,7 +591,7 @@ const J = B("common.auth_state_private", () => {
|
|
|
591
591
|
hasUserPermission: i
|
|
592
592
|
};
|
|
593
593
|
});
|
|
594
|
-
class
|
|
594
|
+
class ee {
|
|
595
595
|
/**
|
|
596
596
|
* Инициализирует экземпляр класса {@link Identity}.
|
|
597
597
|
*
|
|
@@ -616,7 +616,7 @@ class Z {
|
|
|
616
616
|
return typeof this.id == "number" ? this.id === -1 : typeof this.id == "string" ? this.id === "" : T(this.id);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
class k extends
|
|
619
|
+
class k extends ee {
|
|
620
620
|
/**
|
|
621
621
|
* Инициализирует экземпляр класса {@link NamedIdentity}.
|
|
622
622
|
*
|
|
@@ -631,7 +631,7 @@ class k extends Z {
|
|
|
631
631
|
this.name = (e == null ? void 0 : e.name) ?? "";
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
class
|
|
634
|
+
class ce extends k {
|
|
635
635
|
/**
|
|
636
636
|
* Инициализирует экземпляр класса {@link NamedIdentity}.
|
|
637
637
|
*
|
|
@@ -718,7 +718,7 @@ class tt {
|
|
|
718
718
|
this.image = `${e ?? ""}${r.image}`, this.preview = `${e ?? ""}${r.preview}`, this.isDefault = r.isDefault;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
class ur extends
|
|
721
|
+
class ur extends ce {
|
|
722
722
|
/**
|
|
723
723
|
* Инициализирует экземпляр класса {@link CatalogableItem}.
|
|
724
724
|
*
|
|
@@ -840,7 +840,7 @@ class it extends k {
|
|
|
840
840
|
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = v(e == null ? void 0 : e.publishedAt) ? C(e.publishedAt) : e == null ? void 0 : e.publishedAt, this.description = (e == null ? void 0 : e.description) ?? void 0, this.percent = (e == null ? void 0 : e.percent) ?? 0, this.owner = new d(e == null ? void 0 : e.owner), this.deletedAt = v(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
|
-
class
|
|
843
|
+
class K extends lr {
|
|
844
844
|
/**
|
|
845
845
|
* Инициализирует экземпляр класса {@link PriceTemplate}.
|
|
846
846
|
*
|
|
@@ -970,7 +970,7 @@ class Ke extends k {
|
|
|
970
970
|
e && (this.slug = e.slug ?? "", this.description = e.description, this.isSquare = e.isSquare ?? !1, this.isLinear = e.isLinear ?? !1);
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
|
-
class
|
|
973
|
+
class a extends st {
|
|
974
974
|
/**
|
|
975
975
|
* Инициализирует экземпляр класса {@link Product}.
|
|
976
976
|
*
|
|
@@ -1049,7 +1049,7 @@ class I extends st {
|
|
|
1049
1049
|
t(this, "priceCoefficients");
|
|
1050
1050
|
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = e != null && e.unit ? new Ke(e.unit) : new Ke(), this.pack = e == null ? void 0 : e.pack, this.minCount = e == null ? void 0 : e.minCount, this.currency = e != null && e.currency ? new x(e.currency) : new x(), this.cost = (e == null ? void 0 : e.cost) ?? 0, this.costRub = (e == null ? void 0 : e.costRub) ?? 0, this.costDate = v(e == null ? void 0 : e.costDate) ? C(e.costDate) : e == null ? void 0 : e.costDate, this.onOrder = (e == null ? void 0 : e.onOrder) ?? !1, this.stockCount = ((i = e == null ? void 0 : e.stockCount) == null ? void 0 : i.map((h) => new nt(h))) ?? [], this.type = "product";
|
|
1051
1051
|
const s = (e == null ? void 0 : e.category) ?? ((o = e == null ? void 0 : e.categories) == null ? void 0 : o.find((h) => h.isPrimary));
|
|
1052
|
-
s && (this.category = new _e({ ...s, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((h) => new _e(h))), this.images = ((c = e == null ? void 0 : e.images) == null ? void 0 : c.map((h) => new tt(h,
|
|
1052
|
+
s && (this.category = new _e({ ...s, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((h) => new _e(h))), this.images = ((c = e == null ? void 0 : e.images) == null ? void 0 : c.map((h) => new tt(h, I().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((h) => new Fe(h))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
|
|
1053
1053
|
}
|
|
1054
1054
|
/**
|
|
1055
1055
|
* Возвращает признак, что это измеряемый товар.
|
|
@@ -1071,7 +1071,7 @@ class I extends st {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
1073
|
var Ge = /* @__PURE__ */ ((n) => (n.Discount = "discount", n.PriceTemplate = "price_template", n.ClientPrice = "client_price", n.Product = "product", n))(Ge || {});
|
|
1074
|
-
class F extends
|
|
1074
|
+
class F extends a {
|
|
1075
1075
|
/**
|
|
1076
1076
|
* Инициализирует экземпляр класса {@link ClientProduct}.
|
|
1077
1077
|
*
|
|
@@ -1107,7 +1107,7 @@ class F extends I {
|
|
|
1107
1107
|
* Признак того, что указанный продукт входит в список избранных продуктов клиента.
|
|
1108
1108
|
*/
|
|
1109
1109
|
t(this, "isFavorite");
|
|
1110
|
-
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.costSource = (e == null ? void 0 : e.costSource) ?? Ge.Product, this.discount = e != null && e.discount ? new it(e.discount) : void 0, this.priceTemplate = e != null && e.priceTemplate ? new
|
|
1110
|
+
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.costSource = (e == null ? void 0 : e.costSource) ?? Ge.Product, this.discount = e != null && e.discount ? new it(e.discount) : void 0, this.priceTemplate = e != null && e.priceTemplate ? new K(e.priceTemplate) : void 0, this.isPreviouslyOrdered = e == null ? void 0 : e.isPreviouslyOrdered, this.isRequired = e == null ? void 0 : e.isRequired, this.isFavorite = e == null ? void 0 : e.isFavorite;
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
class ge extends _e {
|
|
@@ -1137,7 +1137,7 @@ class ge extends _e {
|
|
|
1137
1137
|
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(([s, i]) => [_r(s), i])) : void 0;
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
|
-
class hr extends
|
|
1140
|
+
class hr extends ee {
|
|
1141
1141
|
/**
|
|
1142
1142
|
* Инициализирует экземпляр класса {@link OrderItemBase}.
|
|
1143
1143
|
*
|
|
@@ -1277,7 +1277,7 @@ const P = class P {
|
|
|
1277
1277
|
/**
|
|
1278
1278
|
* Базовый URL путь для выполнения запросов.
|
|
1279
1279
|
*/
|
|
1280
|
-
t(this, "baseUrl", `${
|
|
1280
|
+
t(this, "baseUrl", `${I().config.http.portalApiUrl}/api`);
|
|
1281
1281
|
/**
|
|
1282
1282
|
* Обработчик ошибок выполнения запросов текущего экземпляра класса.
|
|
1283
1283
|
*
|
|
@@ -1666,7 +1666,7 @@ class _ extends ge {
|
|
|
1666
1666
|
* Список продуктов категории.
|
|
1667
1667
|
*/
|
|
1668
1668
|
t(this, "products");
|
|
1669
|
-
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new _(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new
|
|
1669
|
+
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new _(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new a(o));
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
1672
|
class gr {
|
|
@@ -1892,9 +1892,9 @@ class ze extends k {
|
|
|
1892
1892
|
this.photo = e.photo, this.contacts = new gr(e.contacts), this.curatedDirection = new Be(e.curatedDirection);
|
|
1893
1893
|
}
|
|
1894
1894
|
}
|
|
1895
|
-
class
|
|
1895
|
+
class X extends R {
|
|
1896
1896
|
}
|
|
1897
|
-
class
|
|
1897
|
+
class le extends R {
|
|
1898
1898
|
/**
|
|
1899
1899
|
* Инициализирует экземпляр класса {@link Region}.
|
|
1900
1900
|
*
|
|
@@ -1905,8 +1905,8 @@ class ce extends R {
|
|
|
1905
1905
|
/**
|
|
1906
1906
|
* Данные о стране, в которой расположен регион.
|
|
1907
1907
|
*/
|
|
1908
|
-
t(this, "country", new
|
|
1909
|
-
e && (this.country = new
|
|
1908
|
+
t(this, "country", new X());
|
|
1909
|
+
e && (this.country = new X(e.country));
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
1912
|
class Ae extends R {
|
|
@@ -1920,8 +1920,8 @@ class Ae extends R {
|
|
|
1920
1920
|
/**
|
|
1921
1921
|
* Данные о регионе, в котором расположен город.
|
|
1922
1922
|
*/
|
|
1923
|
-
t(this, "region", new
|
|
1924
|
-
e && (this.region = new
|
|
1923
|
+
t(this, "region", new le());
|
|
1924
|
+
e && (this.region = new le(e.region));
|
|
1925
1925
|
}
|
|
1926
1926
|
}
|
|
1927
1927
|
class fr extends k {
|
|
@@ -2012,7 +2012,7 @@ class me extends fr {
|
|
|
2012
2012
|
this.salesDirection = new O(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 Ae(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 = ((s = e == null ? void 0 : e.managers) == null ? void 0 : s.map((o) => new Me(o))) ?? [], this.curators = ((i = e == null ? void 0 : e.curators) == null ? void 0 : i.map((o) => new ze(o))) ?? void 0;
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
|
-
class
|
|
2015
|
+
class se extends ee {
|
|
2016
2016
|
/**
|
|
2017
2017
|
* Инициализирует новый экземпляр класса.
|
|
2018
2018
|
*
|
|
@@ -2036,7 +2036,7 @@ class te extends Z {
|
|
|
2036
2036
|
* Данные шаблона прайс-листа.
|
|
2037
2037
|
*/
|
|
2038
2038
|
t(this, "priceTemplate");
|
|
2039
|
-
this.createdAt = v(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.deletedAt = v(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt, this.client = new me(e == null ? void 0 : e.client), this.priceTemplate = new
|
|
2039
|
+
this.createdAt = v(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.deletedAt = v(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt, this.client = new me(e == null ? void 0 : e.client), this.priceTemplate = new K(e == null ? void 0 : e.priceTemplate);
|
|
2040
2040
|
}
|
|
2041
2041
|
}
|
|
2042
2042
|
class ke extends mr {
|
|
@@ -2051,12 +2051,12 @@ class ke extends mr {
|
|
|
2051
2051
|
* Базовые данные о продукте.
|
|
2052
2052
|
*/
|
|
2053
2053
|
t(this, "product");
|
|
2054
|
-
this.product = new
|
|
2054
|
+
this.product = new a(e == null ? void 0 : e.product);
|
|
2055
2055
|
}
|
|
2056
2056
|
}
|
|
2057
2057
|
class yr extends R {
|
|
2058
2058
|
}
|
|
2059
|
-
class
|
|
2059
|
+
class ie extends k {
|
|
2060
2060
|
/**
|
|
2061
2061
|
* Инициализирует экземпляр класса {@link Property}.
|
|
2062
2062
|
*
|
|
@@ -2079,7 +2079,7 @@ class se extends k {
|
|
|
2079
2079
|
this.type = new yr(e == null ? void 0 : e.type), this.description = (e == null ? void 0 : e.description) ?? "", this.metadata = e == null ? void 0 : e.metadata;
|
|
2080
2080
|
}
|
|
2081
2081
|
}
|
|
2082
|
-
class
|
|
2082
|
+
class V {
|
|
2083
2083
|
/**
|
|
2084
2084
|
* Инициализирует экземпляр класса {@link PropertyValue}.
|
|
2085
2085
|
*
|
|
@@ -2095,7 +2095,7 @@ class E {
|
|
|
2095
2095
|
* Может быть строкой, числом, boolean, диапазоном или JSON объектом.
|
|
2096
2096
|
*/
|
|
2097
2097
|
t(this, "value");
|
|
2098
|
-
this.property = new
|
|
2098
|
+
this.property = new ie(r == null ? void 0 : r.property), this.value = (r == null ? void 0 : r.value) ?? "";
|
|
2099
2099
|
}
|
|
2100
2100
|
}
|
|
2101
2101
|
class S {
|
|
@@ -2180,7 +2180,7 @@ class zt {
|
|
|
2180
2180
|
}), !((e = r == null ? void 0 : r.createdAt) != null && e.from) && !((s = r == null ? void 0 : r.createdAt) != null && s.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;
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
|
-
class
|
|
2183
|
+
class ne extends k {
|
|
2184
2184
|
/**
|
|
2185
2185
|
* Инициализирует экземпляр класса {@link PricingRole}.
|
|
2186
2186
|
*
|
|
@@ -2234,7 +2234,7 @@ class Qe {
|
|
|
2234
2234
|
* Минимальный коэффициент цены.
|
|
2235
2235
|
*/
|
|
2236
2236
|
t(this, "minCoefficient");
|
|
2237
|
-
this.role = new
|
|
2237
|
+
this.role = new ne(r == null ? void 0 : r.role), this.category = new ge(r == null ? void 0 : r.category), this.minCoefficient = new Re(r == null ? void 0 : r.minCoefficient);
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
2240
|
class Wt extends p {
|
|
@@ -2264,7 +2264,7 @@ class Wt extends p {
|
|
|
2264
2264
|
*/
|
|
2265
2265
|
// eslint-disable-next-line class-methods-use-this
|
|
2266
2266
|
getPriceExportLink(r = "csv", e = !1, s = void 0, i = void 0) {
|
|
2267
|
-
let c = `${
|
|
2267
|
+
let c = `${I().config.http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;
|
|
2268
2268
|
return s && (c += `&category_id=${s}`), i && (c += `&client_id=${i}`), c;
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
@@ -2479,7 +2479,7 @@ class Et extends p {
|
|
|
2479
2479
|
return this.get(
|
|
2480
2480
|
`/internal/clients/${r}/price/templates`,
|
|
2481
2481
|
{},
|
|
2482
|
-
(e) => e.data.map((s) => new
|
|
2482
|
+
(e) => e.data.map((s) => new se(s))
|
|
2483
2483
|
);
|
|
2484
2484
|
}
|
|
2485
2485
|
/**
|
|
@@ -2490,7 +2490,7 @@ class Et extends p {
|
|
|
2490
2490
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_get_active
|
|
2491
2491
|
*/
|
|
2492
2492
|
getActiveTemplate(r) {
|
|
2493
|
-
return this.get(`/internal/clients/${r}/price/templates/active`, {}, (e) => new
|
|
2493
|
+
return this.get(`/internal/clients/${r}/price/templates/active`, {}, (e) => new se(e.data), !0);
|
|
2494
2494
|
}
|
|
2495
2495
|
/**
|
|
2496
2496
|
* Добавляет связь между клиентом и шаблоном прайс-листа.
|
|
@@ -2502,14 +2502,14 @@ class Et extends p {
|
|
|
2502
2502
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_attach
|
|
2503
2503
|
*/
|
|
2504
2504
|
attachTemplate(r, e, s) {
|
|
2505
|
-
const i =
|
|
2505
|
+
const i = I().config.dateFormats.api;
|
|
2506
2506
|
return this.post(
|
|
2507
2507
|
`/internal/clients/${r}/price/templates/${e}`,
|
|
2508
2508
|
s && {
|
|
2509
2509
|
startAt: s.startAt && U(s.startAt, i),
|
|
2510
2510
|
endAt: s.endAt && U(s.endAt, i)
|
|
2511
2511
|
},
|
|
2512
|
-
(o) => new
|
|
2512
|
+
(o) => new se(o.data),
|
|
2513
2513
|
{},
|
|
2514
2514
|
!0
|
|
2515
2515
|
);
|
|
@@ -2536,14 +2536,14 @@ class Et extends p {
|
|
|
2536
2536
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_change
|
|
2537
2537
|
*/
|
|
2538
2538
|
changeTemplate(r, e, s, i) {
|
|
2539
|
-
const o =
|
|
2539
|
+
const o = I().config.dateFormats.api;
|
|
2540
2540
|
return this.patch(
|
|
2541
2541
|
`/internal/clients/${r}/price/templates/${e}/${s}`,
|
|
2542
2542
|
i && {
|
|
2543
2543
|
startAt: i.startAt && U(i.startAt, o),
|
|
2544
2544
|
endAt: i.endAt && U(i.endAt, o)
|
|
2545
2545
|
},
|
|
2546
|
-
(c) => new
|
|
2546
|
+
(c) => new se(c.data)
|
|
2547
2547
|
);
|
|
2548
2548
|
}
|
|
2549
2549
|
/**
|
|
@@ -2619,7 +2619,7 @@ class Vt extends p {
|
|
|
2619
2619
|
showHidden: s,
|
|
2620
2620
|
withPriceCoefficients: e
|
|
2621
2621
|
},
|
|
2622
|
-
(i) => he(i.data, (o) => new
|
|
2622
|
+
(i) => he(i.data, (o) => new a(o))
|
|
2623
2623
|
);
|
|
2624
2624
|
}
|
|
2625
2625
|
/**
|
|
@@ -2661,7 +2661,7 @@ class Kt extends p {
|
|
|
2661
2661
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_products_get
|
|
2662
2662
|
*/
|
|
2663
2663
|
getProductData(r, e = !1) {
|
|
2664
|
-
return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (s) => new
|
|
2664
|
+
return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (s) => new a(s.data));
|
|
2665
2665
|
}
|
|
2666
2666
|
/**
|
|
2667
2667
|
* Возвращает публичные данные об указанном продукте.
|
|
@@ -2669,7 +2669,7 @@ class Kt extends p {
|
|
|
2669
2669
|
* @param productId Идентификатор продукта.
|
|
2670
2670
|
*/
|
|
2671
2671
|
getPublicProductData(r) {
|
|
2672
|
-
return this.get(`/public/catalog/products/${r}`, {}, (e) => new
|
|
2672
|
+
return this.get(`/public/catalog/products/${r}`, {}, (e) => new a(e.data));
|
|
2673
2673
|
}
|
|
2674
2674
|
/**
|
|
2675
2675
|
* Возвращает данные о коэффициентах цен для указанного продукта.
|
|
@@ -2694,7 +2694,7 @@ class Kt extends p {
|
|
|
2694
2694
|
publicSimpleSearch(r, e = 10) {
|
|
2695
2695
|
return new Promise((s, i) => {
|
|
2696
2696
|
this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then((o) => {
|
|
2697
|
-
s(o.products.map((c) => new
|
|
2697
|
+
s(o.products.map((c) => new a(c)));
|
|
2698
2698
|
}).catch((o) => {
|
|
2699
2699
|
i(o);
|
|
2700
2700
|
});
|
|
@@ -2816,10 +2816,10 @@ class Ye {
|
|
|
2816
2816
|
field: this.field,
|
|
2817
2817
|
op: this.op
|
|
2818
2818
|
};
|
|
2819
|
-
return r.value = xe(this.value) ? U(this.value,
|
|
2819
|
+
return r.value = xe(this.value) ? U(this.value, I().config.dateFormats.api) : this.value, r;
|
|
2820
2820
|
}
|
|
2821
2821
|
}
|
|
2822
|
-
class
|
|
2822
|
+
class G {
|
|
2823
2823
|
/**
|
|
2824
2824
|
* Инициализирует экземпляр класса {@link FilterGroup}.
|
|
2825
2825
|
*
|
|
@@ -2839,7 +2839,7 @@ class le {
|
|
|
2839
2839
|
*/
|
|
2840
2840
|
t(this, "groups");
|
|
2841
2841
|
var e, s;
|
|
2842
|
-
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 Ye(i))) ?? [], this.groups = ((s = r == null ? void 0 : r.groups) == null ? void 0 : s.map((i) => new
|
|
2842
|
+
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 Ye(i))) ?? [], this.groups = ((s = r == null ? void 0 : r.groups) == null ? void 0 : s.map((i) => new G(i))) ?? [];
|
|
2843
2843
|
}
|
|
2844
2844
|
/**
|
|
2845
2845
|
* Преобразует группу фильтров в примитивное представление для API.
|
|
@@ -2850,7 +2850,7 @@ class le {
|
|
|
2850
2850
|
return {
|
|
2851
2851
|
groupOp: this.groupOp,
|
|
2852
2852
|
filters: this.filters.map((r) => r instanceof Ye && Ue(r.toPrimitive) ? r.toPrimitive() : r),
|
|
2853
|
-
groups: this.groups.map((r) => r instanceof
|
|
2853
|
+
groups: this.groups.map((r) => r instanceof G ? r.toPrimitive() : r)
|
|
2854
2854
|
};
|
|
2855
2855
|
}
|
|
2856
2856
|
}
|
|
@@ -2872,7 +2872,7 @@ class De extends p {
|
|
|
2872
2872
|
page: (i == null ? void 0 : i.page) ?? 1,
|
|
2873
2873
|
perPage: (i == null ? void 0 : i.pageSize) ?? 10
|
|
2874
2874
|
};
|
|
2875
|
-
return e && (m.filters = JSON.stringify((e instanceof
|
|
2875
|
+
return e && (m.filters = JSON.stringify((e instanceof G ? e : new G(e)).toPrimitive())), Y(s) || (m.sort = H(s) ? s : [s]), o && (m = { ...m, ...o }), this.get(r, m, c, u, h);
|
|
2876
2876
|
}
|
|
2877
2877
|
}
|
|
2878
2878
|
class Xt extends De {
|
|
@@ -2888,7 +2888,7 @@ class Xt extends De {
|
|
|
2888
2888
|
getTemplateList(r, e, s) {
|
|
2889
2889
|
return this.getPaginated("/internal/price/templates", r, e, s, {}, (i) => {
|
|
2890
2890
|
const o = { ...i.data };
|
|
2891
|
-
return o.data = o.data.map((c) => new
|
|
2891
|
+
return o.data = o.data.map((c) => new K(c)), o;
|
|
2892
2892
|
});
|
|
2893
2893
|
}
|
|
2894
2894
|
/**
|
|
@@ -2901,7 +2901,7 @@ class Xt extends De {
|
|
|
2901
2901
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_create
|
|
2902
2902
|
*/
|
|
2903
2903
|
createTemplate(r, e = {}) {
|
|
2904
|
-
return this.post("/internal/price/templates", r, (s) => new
|
|
2904
|
+
return this.post("/internal/price/templates", r, (s) => new K(s.data), e);
|
|
2905
2905
|
}
|
|
2906
2906
|
/**
|
|
2907
2907
|
* Возвращает данные о шаблоне прайс-листа.
|
|
@@ -2911,7 +2911,7 @@ class Xt extends De {
|
|
|
2911
2911
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_get
|
|
2912
2912
|
*/
|
|
2913
2913
|
getTemplate(r) {
|
|
2914
|
-
return this.get(`/internal/price/templates/${r}`, {}, (e) => new
|
|
2914
|
+
return this.get(`/internal/price/templates/${r}`, {}, (e) => new K(e.data));
|
|
2915
2915
|
}
|
|
2916
2916
|
/**
|
|
2917
2917
|
* Изменяет данные о шаблоне прайс-листа.
|
|
@@ -2924,7 +2924,7 @@ class Xt extends De {
|
|
|
2924
2924
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_update
|
|
2925
2925
|
*/
|
|
2926
2926
|
updateTemplate(r, e, s = {}) {
|
|
2927
|
-
return this.patch(`/internal/price/templates/${r}`, e, (i) => new
|
|
2927
|
+
return this.patch(`/internal/price/templates/${r}`, e, (i) => new K(i.data), s);
|
|
2928
2928
|
}
|
|
2929
2929
|
/**
|
|
2930
2930
|
* Удаляет данные о шаблоне прайс-листа.
|
|
@@ -3075,7 +3075,7 @@ class Xt extends De {
|
|
|
3075
3075
|
return this.get(
|
|
3076
3076
|
`/internal/price/templates/${r}/clients`,
|
|
3077
3077
|
{},
|
|
3078
|
-
(e) => e.data.map((s) => new
|
|
3078
|
+
(e) => e.data.map((s) => new se(s))
|
|
3079
3079
|
);
|
|
3080
3080
|
}
|
|
3081
3081
|
}
|
|
@@ -3086,7 +3086,7 @@ class Zt extends p {
|
|
|
3086
3086
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_get_list
|
|
3087
3087
|
*/
|
|
3088
3088
|
getRoles() {
|
|
3089
|
-
return this.get("/internal/price/roles", {}, (r) => r.data.map((e) => new
|
|
3089
|
+
return this.get("/internal/price/roles", {}, (r) => r.data.map((e) => new ne(e)));
|
|
3090
3090
|
}
|
|
3091
3091
|
/**
|
|
3092
3092
|
* Добавляет новую роль ценообразования.
|
|
@@ -3096,7 +3096,7 @@ class Zt extends p {
|
|
|
3096
3096
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_create
|
|
3097
3097
|
*/
|
|
3098
3098
|
createRole(r) {
|
|
3099
|
-
return this.post("/internal/price/roles", r, (e) => new
|
|
3099
|
+
return this.post("/internal/price/roles", r, (e) => new ne(e.data));
|
|
3100
3100
|
}
|
|
3101
3101
|
/**
|
|
3102
3102
|
* Возвращает данные роли ценообразования.
|
|
@@ -3106,7 +3106,7 @@ class Zt extends p {
|
|
|
3106
3106
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_get
|
|
3107
3107
|
*/
|
|
3108
3108
|
getRole(r) {
|
|
3109
|
-
return this.get(`/internal/price/roles/${r}`, {}, (e) => new
|
|
3109
|
+
return this.get(`/internal/price/roles/${r}`, {}, (e) => new ne(e.data));
|
|
3110
3110
|
}
|
|
3111
3111
|
/**
|
|
3112
3112
|
* Обновляет данные роли ценообразования.
|
|
@@ -3117,7 +3117,7 @@ class Zt extends p {
|
|
|
3117
3117
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_update
|
|
3118
3118
|
*/
|
|
3119
3119
|
updateRole(r, e) {
|
|
3120
|
-
return this.patch(`/internal/price/roles/${r}`, e, (s) => new
|
|
3120
|
+
return this.patch(`/internal/price/roles/${r}`, e, (s) => new ne(s.data));
|
|
3121
3121
|
}
|
|
3122
3122
|
/**
|
|
3123
3123
|
* Удаляет роль ценообразования.
|
|
@@ -3172,7 +3172,7 @@ class es extends De {
|
|
|
3172
3172
|
getProperties(r, e, s) {
|
|
3173
3173
|
return this.getPaginated("/internal/catalog/properties", r, e, s, {}, (i) => {
|
|
3174
3174
|
const o = { ...i.data };
|
|
3175
|
-
return o.data = o.data.map((c) => new
|
|
3175
|
+
return o.data = o.data.map((c) => new ie(c)), o;
|
|
3176
3176
|
});
|
|
3177
3177
|
}
|
|
3178
3178
|
/**
|
|
@@ -3189,7 +3189,7 @@ class es extends De {
|
|
|
3189
3189
|
...s,
|
|
3190
3190
|
type: e
|
|
3191
3191
|
},
|
|
3192
|
-
(i) => new
|
|
3192
|
+
(i) => new ie(i.data)
|
|
3193
3193
|
);
|
|
3194
3194
|
}
|
|
3195
3195
|
/**
|
|
@@ -3199,7 +3199,7 @@ class es extends De {
|
|
|
3199
3199
|
* @see /doc/api/internal#/operations/api_internal_catalog_properties_get
|
|
3200
3200
|
*/
|
|
3201
3201
|
getProperty(r) {
|
|
3202
|
-
return this.get(`/internal/catalog/properties/${r}`, {}, (e) => new
|
|
3202
|
+
return this.get(`/internal/catalog/properties/${r}`, {}, (e) => new ie(e.data));
|
|
3203
3203
|
}
|
|
3204
3204
|
/**
|
|
3205
3205
|
* Обновляет существующее свойство.
|
|
@@ -3216,7 +3216,7 @@ class es extends De {
|
|
|
3216
3216
|
...i,
|
|
3217
3217
|
type: s
|
|
3218
3218
|
},
|
|
3219
|
-
(o) => new
|
|
3219
|
+
(o) => new ie(o.data)
|
|
3220
3220
|
);
|
|
3221
3221
|
}
|
|
3222
3222
|
/**
|
|
@@ -3235,7 +3235,7 @@ class es extends De {
|
|
|
3235
3235
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_get_list
|
|
3236
3236
|
*/
|
|
3237
3237
|
getProductProperties(r) {
|
|
3238
|
-
return this.get(`/internal/catalog/products/${r}/properties`, {}, (e) => e.data.map((s) => new
|
|
3238
|
+
return this.get(`/internal/catalog/products/${r}/properties`, {}, (e) => e.data.map((s) => new V(s)));
|
|
3239
3239
|
}
|
|
3240
3240
|
/**
|
|
3241
3241
|
* Возвращает значение свойства продукта.
|
|
@@ -3245,7 +3245,7 @@ class es extends De {
|
|
|
3245
3245
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_get
|
|
3246
3246
|
*/
|
|
3247
3247
|
getProductProperty(r, e) {
|
|
3248
|
-
return this.get(`/internal/catalog/products/${r}/properties/${e}`, {}, (s) => new
|
|
3248
|
+
return this.get(`/internal/catalog/products/${r}/properties/${e}`, {}, (s) => new V(s.data));
|
|
3249
3249
|
}
|
|
3250
3250
|
/**
|
|
3251
3251
|
* Обновляет значение свойства продукта.
|
|
@@ -3256,7 +3256,7 @@ class es extends De {
|
|
|
3256
3256
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_update
|
|
3257
3257
|
*/
|
|
3258
3258
|
updateProductProperty(r, e, s) {
|
|
3259
|
-
return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: s }, (i) => new
|
|
3259
|
+
return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: s }, (i) => new V(i.data));
|
|
3260
3260
|
}
|
|
3261
3261
|
/**
|
|
3262
3262
|
* Удаляет значение свойства продукта.
|
|
@@ -3381,7 +3381,7 @@ class es extends De {
|
|
|
3381
3381
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_get_list
|
|
3382
3382
|
*/
|
|
3383
3383
|
getCategoryProperties(r) {
|
|
3384
|
-
return this.get(`/internal/catalog/categories/${r}/properties`, {}, (e) => e.data.map((s) => new
|
|
3384
|
+
return this.get(`/internal/catalog/categories/${r}/properties`, {}, (e) => e.data.map((s) => new V(s)));
|
|
3385
3385
|
}
|
|
3386
3386
|
/**
|
|
3387
3387
|
* Возвращает значение свойства категории.
|
|
@@ -3391,7 +3391,7 @@ class es extends De {
|
|
|
3391
3391
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_get
|
|
3392
3392
|
*/
|
|
3393
3393
|
getCategoryProperty(r, e) {
|
|
3394
|
-
return this.get(`/internal/catalog/categories/${r}/properties/${e}`, {}, (s) => new
|
|
3394
|
+
return this.get(`/internal/catalog/categories/${r}/properties/${e}`, {}, (s) => new V(s.data));
|
|
3395
3395
|
}
|
|
3396
3396
|
/**
|
|
3397
3397
|
* Обновляет значение свойства категории.
|
|
@@ -3402,7 +3402,7 @@ class es extends De {
|
|
|
3402
3402
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_update
|
|
3403
3403
|
*/
|
|
3404
3404
|
updateCategoryProperty(r, e, s) {
|
|
3405
|
-
return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: s }, (i) => new
|
|
3405
|
+
return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: s }, (i) => new V(i.data));
|
|
3406
3406
|
}
|
|
3407
3407
|
/**
|
|
3408
3408
|
* Удаляет значение свойства категории.
|
|
@@ -3589,7 +3589,7 @@ class rs extends p {
|
|
|
3589
3589
|
showHidden: i,
|
|
3590
3590
|
withPriceCoefficients: s
|
|
3591
3591
|
},
|
|
3592
|
-
(o) => he(o.data, (c) => new
|
|
3592
|
+
(o) => he(o.data, (c) => new a(c))
|
|
3593
3593
|
);
|
|
3594
3594
|
}
|
|
3595
3595
|
}
|
|
@@ -3634,12 +3634,12 @@ class mt extends R {
|
|
|
3634
3634
|
}
|
|
3635
3635
|
class N extends R {
|
|
3636
3636
|
}
|
|
3637
|
-
class
|
|
3637
|
+
class M extends R {
|
|
3638
3638
|
/**
|
|
3639
3639
|
* Возвращает сгенерированную запись-описание физического лица.
|
|
3640
3640
|
*/
|
|
3641
3641
|
static generatePersonItem() {
|
|
3642
|
-
return new
|
|
3642
|
+
return new M({
|
|
3643
3643
|
id: 1,
|
|
3644
3644
|
guid: "",
|
|
3645
3645
|
slug: q.Person,
|
|
@@ -3653,7 +3653,7 @@ class ft extends R {
|
|
|
3653
3653
|
}
|
|
3654
3654
|
class yt extends R {
|
|
3655
3655
|
}
|
|
3656
|
-
class
|
|
3656
|
+
class Z extends R {
|
|
3657
3657
|
}
|
|
3658
3658
|
class Cr extends R {
|
|
3659
3659
|
}
|
|
@@ -3713,7 +3713,7 @@ class ue extends R {
|
|
|
3713
3713
|
this.address = (e == null ? void 0 : e.address) ?? "", this.isMain = (e == null ? void 0 : e.isMain) ?? !1, this.deliveryTypes = ((s = e == null ? void 0 : e.deliveryTypes) == null ? void 0 : s.map((i) => new N(i))) ?? [], this.regions = (e == null ? void 0 : e.regions) ?? [], this.coordinates = new Ar(e == null ? void 0 : e.coordinates);
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
3716
|
-
class qe extends
|
|
3716
|
+
class qe extends ee {
|
|
3717
3717
|
/**
|
|
3718
3718
|
* Инициализирует экземпляр класса {@link BankAccount}.
|
|
3719
3719
|
*
|
|
@@ -3763,7 +3763,7 @@ class Ne extends k {
|
|
|
3763
3763
|
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;
|
|
3764
3764
|
}
|
|
3765
3765
|
}
|
|
3766
|
-
class
|
|
3766
|
+
class B extends Ne {
|
|
3767
3767
|
/**
|
|
3768
3768
|
* Инициализирует экземпляр класса {@link ContactPerson}.
|
|
3769
3769
|
*
|
|
@@ -3810,11 +3810,11 @@ class Dr extends k {
|
|
|
3810
3810
|
/**
|
|
3811
3811
|
* Данные об организационно-правовой форме.
|
|
3812
3812
|
*/
|
|
3813
|
-
t(this, "opf",
|
|
3813
|
+
t(this, "opf", M.generatePersonItem());
|
|
3814
3814
|
/**
|
|
3815
3815
|
* Группа партнеров (направление деятельности).
|
|
3816
3816
|
*/
|
|
3817
|
-
t(this, "partnerGroup", new
|
|
3817
|
+
t(this, "partnerGroup", new Z());
|
|
3818
3818
|
/**
|
|
3819
3819
|
* Список контактных лиц контрагента.
|
|
3820
3820
|
*/
|
|
@@ -3848,10 +3848,10 @@ class Dr extends k {
|
|
|
3848
3848
|
*/
|
|
3849
3849
|
t(this, "updater");
|
|
3850
3850
|
if (e) {
|
|
3851
|
-
if (this.opf = new
|
|
3851
|
+
if (this.opf = new M(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = v(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e.createdAt, this.creator = e.creator ? new d(e.creator) : void 0, this.updatedAt = v(e == null ? void 0 : e.updatedAt) ? C(e.updatedAt) : e.updatedAt, this.updater = e.updater ? new d(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new Z(e.partnerGroup)), e.contacts) {
|
|
3852
3852
|
const s = [];
|
|
3853
3853
|
e.contacts.forEach((i) => {
|
|
3854
|
-
s.push(new
|
|
3854
|
+
s.push(new B(i));
|
|
3855
3855
|
}), this.contacts = s;
|
|
3856
3856
|
}
|
|
3857
3857
|
if (e.bankAccounts) {
|
|
@@ -3942,7 +3942,7 @@ class Ct extends $r {
|
|
|
3942
3942
|
/**
|
|
3943
3943
|
* Страна регистрации юридического лица нерезидента.
|
|
3944
3944
|
*/
|
|
3945
|
-
t(this, "registrationCountry", new
|
|
3945
|
+
t(this, "registrationCountry", new X());
|
|
3946
3946
|
/**
|
|
3947
3947
|
* Регистрационный номер юридического лица нерезидента.
|
|
3948
3948
|
*/
|
|
@@ -3951,7 +3951,7 @@ class Ct extends $r {
|
|
|
3951
3951
|
* Налоговый номер юридического лица нерезидента.
|
|
3952
3952
|
*/
|
|
3953
3953
|
t(this, "taxNumber", "");
|
|
3954
|
-
e && (this.registrationCountry = new
|
|
3954
|
+
e && (this.registrationCountry = new X(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
3955
3955
|
}
|
|
3956
3956
|
}
|
|
3957
3957
|
class ve {
|
|
@@ -3973,7 +3973,7 @@ class ve {
|
|
|
3973
3973
|
}
|
|
3974
3974
|
}
|
|
3975
3975
|
}
|
|
3976
|
-
class
|
|
3976
|
+
class ae extends ee {
|
|
3977
3977
|
/**
|
|
3978
3978
|
* Инициализирует экземпляр класса {@link ContactRelation}.
|
|
3979
3979
|
*
|
|
@@ -3988,7 +3988,7 @@ class Ie extends Z {
|
|
|
3988
3988
|
this.isPrimary = e.isPrimary;
|
|
3989
3989
|
}
|
|
3990
3990
|
}
|
|
3991
|
-
class Rt extends
|
|
3991
|
+
class Rt extends B {
|
|
3992
3992
|
/**
|
|
3993
3993
|
* Инициализирует экземпляр класса {@link ContactPersonRelated}.
|
|
3994
3994
|
*
|
|
@@ -4013,7 +4013,7 @@ class Rt extends M {
|
|
|
4013
4013
|
*/
|
|
4014
4014
|
addresses: []
|
|
4015
4015
|
});
|
|
4016
|
-
e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((s) => new
|
|
4016
|
+
e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((s) => new ae(s))), e.relations.clients && (this.relations.clients = e.relations.clients.map((s) => new ae(s))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((s) => new ae(s))));
|
|
4017
4017
|
}
|
|
4018
4018
|
}
|
|
4019
4019
|
class Ce extends rt {
|
|
@@ -4053,7 +4053,7 @@ class Ce extends rt {
|
|
|
4053
4053
|
* Признак того, что указанный адрес является адресом транспортной компании.
|
|
4054
4054
|
*/
|
|
4055
4055
|
t(this, "isTransportCompanyAddress");
|
|
4056
|
-
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new Ar(e == null ? void 0 : e.coordinates), this.contacts = ((s = e == null ? void 0 : e.contacts) == null ? void 0 : s.map((i) => new
|
|
4056
|
+
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new Ar(e == null ? void 0 : e.coordinates), this.contacts = ((s = e == null ? void 0 : e.contacts) == null ? void 0 : s.map((i) => new B(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;
|
|
4057
4057
|
}
|
|
4058
4058
|
}
|
|
4059
4059
|
class er extends me {
|
|
@@ -4106,7 +4106,7 @@ class er extends me {
|
|
|
4106
4106
|
* @inheritDoc
|
|
4107
4107
|
*/
|
|
4108
4108
|
t(this, "extraData");
|
|
4109
|
-
this.contragents = ((s = e == null ? void 0 : e.contragents) == null ? void 0 : s.map((u) => ve.createInstance(u))) ?? [], this.partnerGroups = ((i = e == null ? void 0 : e.partnerGroups) == null ? void 0 : i.map((u) => new
|
|
4109
|
+
this.contragents = ((s = e == null ? void 0 : e.contragents) == null ? void 0 : s.map((u) => ve.createInstance(u))) ?? [], this.partnerGroups = ((i = e == null ? void 0 : e.partnerGroups) == null ? void 0 : i.map((u) => new Z(u))) ?? [], this.contacts = ((o = e == null ? void 0 : e.contacts) == null ? void 0 : o.map((u) => new B(u))) ?? [], this.deliveryAddresses = ((c = e == null ? void 0 : e.deliveryAddresses) == null ? void 0 : c.map((u) => new Ce(u))) ?? [], this.channelPrimaryInterest = new wr(e == null ? void 0 : e.channelPrimaryInterest), this.sourcePrimaryInterest = new Pr(e == null ? void 0 : e.sourcePrimaryInterest), this.preferredDeliveryType = new N(e == null ? void 0 : e.preferredDeliveryType), this.primaryDemand = e == null ? void 0 : e.primaryDemand, this.preferredWarehouse = e != null && e.preferredWarehouse ? new ue(e.preferredWarehouse) : void 0, this.extraData = (e == null ? void 0 : e.extraData) ?? {};
|
|
4110
4110
|
}
|
|
4111
4111
|
}
|
|
4112
4112
|
class br {
|
|
@@ -4224,7 +4224,7 @@ class ss extends br {
|
|
|
4224
4224
|
* @inheritDoc
|
|
4225
4225
|
*/
|
|
4226
4226
|
t(this, "lastOrder");
|
|
4227
|
-
this.id = e == null ? void 0 : e.id, 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 = (s = e == null ? void 0 : e.cities) == null ? void 0 : s.map((D) => new Ae(D)), this.region = new
|
|
4227
|
+
this.id = e == null ? void 0 : e.id, 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 = (s = e == null ? void 0 : e.cities) == null ? void 0 : s.map((D) => new Ae(D)), this.region = new le(e == null ? void 0 : e.region), this.country = new X(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 S(e == null ? void 0 : e.createdAt), this.lastLoginDate = new S(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((D) => new Pe(D))) ?? [], this.curators = ((o = e == null ? void 0 : e.curators) == null ? void 0 : o.map((D) => new ze(D))) ?? [], this.salesDirections = (c = e == null ? void 0 : e.salesDirections) == null ? void 0 : c.map((D) => new O(D)), this.contragentInn = e == null ? void 0 : e.contragentInn, this.contragentType = new M(e == null ? void 0 : e.contragentType), this.preferredDeliveryType = e != null && e.preferredDeliveryType ? new N(e == null ? void 0 : e.preferredDeliveryType) : void 0, this.partnerGroups = (u = e == null ? void 0 : e.partnerGroups) == null ? void 0 : u.map((D) => new Z(D)), this.contact = new Ne(e == null ? void 0 : e.contact), this.lastOrder = {
|
|
4228
4228
|
createdAt: new S((h = e == null ? void 0 : e.lastOrder) == null ? void 0 : h.createdAt),
|
|
4229
4229
|
creator: (m = e == null ? void 0 : e.lastOrder) == null ? void 0 : m.creator,
|
|
4230
4230
|
isApproved: (f = e == null ? void 0 : e.lastOrder) == null ? void 0 : f.isApproved
|
|
@@ -4239,7 +4239,7 @@ class ss extends br {
|
|
|
4239
4239
|
this.cities = [];
|
|
4240
4240
|
break;
|
|
4241
4241
|
case "region":
|
|
4242
|
-
this.region = new
|
|
4242
|
+
this.region = new le();
|
|
4243
4243
|
break;
|
|
4244
4244
|
case "isActive":
|
|
4245
4245
|
this.isActive = !0;
|
|
@@ -4263,7 +4263,7 @@ class ss extends br {
|
|
|
4263
4263
|
this.salesDirections = [];
|
|
4264
4264
|
break;
|
|
4265
4265
|
case "contragentType":
|
|
4266
|
-
this.contragentType = new
|
|
4266
|
+
this.contragentType = new M();
|
|
4267
4267
|
break;
|
|
4268
4268
|
case "preferredDeliveryType":
|
|
4269
4269
|
this.preferredDeliveryType = new N();
|
|
@@ -4289,7 +4289,7 @@ class ss extends br {
|
|
|
4289
4289
|
return !((s = e == null ? void 0 : e.createdAt) != null && s.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, e;
|
|
4290
4290
|
}
|
|
4291
4291
|
}
|
|
4292
|
-
class Sr extends
|
|
4292
|
+
class Sr extends ee {
|
|
4293
4293
|
/**
|
|
4294
4294
|
* Инициализирует экземпляр класса {@link OrderShortInfo}.
|
|
4295
4295
|
*
|
|
@@ -4349,7 +4349,7 @@ class Pt extends k {
|
|
|
4349
4349
|
* @inheritDoc
|
|
4350
4350
|
*/
|
|
4351
4351
|
t(this, "curators");
|
|
4352
|
-
this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new
|
|
4352
|
+
this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new B(u))) ?? void 0, this.lastOrder = e.lastOrder ? new Sr(e.lastOrder) : void 0, this.partnerGroups = ((i = e.partnerGroups) == null ? void 0 : i.map((u) => new Z(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new N(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new O(e.salesDirection) : void 0, this.managers = ((o = e.managers) == null ? void 0 : o.map((u) => new Me(u))) ?? void 0, this.curators = ((c = e.curators) == null ? void 0 : c.map((u) => new ze(u))) ?? void 0;
|
|
4353
4353
|
}
|
|
4354
4354
|
}
|
|
4355
4355
|
class At {
|
|
@@ -4941,7 +4941,7 @@ class L extends De {
|
|
|
4941
4941
|
comment: e.comment,
|
|
4942
4942
|
not_disturb: e.notDisturb
|
|
4943
4943
|
},
|
|
4944
|
-
(i) => new
|
|
4944
|
+
(i) => new B(i.data),
|
|
4945
4945
|
s
|
|
4946
4946
|
);
|
|
4947
4947
|
}
|
|
@@ -5078,7 +5078,7 @@ class L extends De {
|
|
|
5078
5078
|
comment: e.comment,
|
|
5079
5079
|
...s
|
|
5080
5080
|
};
|
|
5081
|
-
return (c = e.phone) != null && c.length && (o.phone = e.phone), (u = e.email) != null && u.length && (o.email = e.email), this.post(`/internal/clients/${r}/contacts`, o, (h) => new
|
|
5081
|
+
return (c = e.phone) != null && c.length && (o.phone = e.phone), (u = e.email) != null && u.length && (o.email = e.email), this.post(`/internal/clients/${r}/contacts`, o, (h) => new B(h.data), i);
|
|
5082
5082
|
}
|
|
5083
5083
|
/**
|
|
5084
5084
|
* Устанавливает признак основного контактного лица.
|
|
@@ -5107,7 +5107,7 @@ class L extends De {
|
|
|
5107
5107
|
return this.get(`/internal/clients/${r.id}/verification/email?email=${r.email}`);
|
|
5108
5108
|
}
|
|
5109
5109
|
}
|
|
5110
|
-
const
|
|
5110
|
+
const Q = class Q extends p {
|
|
5111
5111
|
/**
|
|
5112
5112
|
* Инициализирует экземпляр класса {@link HttpCachedRequester}.
|
|
5113
5113
|
*/
|
|
@@ -5117,7 +5117,7 @@ const K = class K extends p {
|
|
|
5117
5117
|
* Время кэширования данных ответов на запросы (секунд).
|
|
5118
5118
|
*/
|
|
5119
5119
|
t(this, "responseDataCacheTimeout");
|
|
5120
|
-
this.responseDataCacheTimeout =
|
|
5120
|
+
this.responseDataCacheTimeout = I().config.http.responseDataCacheTimeout;
|
|
5121
5121
|
}
|
|
5122
5122
|
/**
|
|
5123
5123
|
* Возвращает кэшированные данные.
|
|
@@ -5127,7 +5127,7 @@ const K = class K extends p {
|
|
|
5127
5127
|
*/
|
|
5128
5128
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
5129
5129
|
static getCachedResponse(e) {
|
|
5130
|
-
const s =
|
|
5130
|
+
const s = Q.responseDataCache.get(e);
|
|
5131
5131
|
if (s && s.validTo > /* @__PURE__ */ new Date())
|
|
5132
5132
|
return s.val;
|
|
5133
5133
|
}
|
|
@@ -5138,7 +5138,7 @@ const K = class K extends p {
|
|
|
5138
5138
|
* @param data Данные для кэширования.
|
|
5139
5139
|
*/
|
|
5140
5140
|
cacheResponse(e, s) {
|
|
5141
|
-
|
|
5141
|
+
Q.responseDataCache.set(e, {
|
|
5142
5142
|
validTo: jr(/* @__PURE__ */ new Date(), this.responseDataCacheTimeout),
|
|
5143
5143
|
val: s
|
|
5144
5144
|
});
|
|
@@ -5154,7 +5154,7 @@ const K = class K extends p {
|
|
|
5154
5154
|
*/
|
|
5155
5155
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
5156
5156
|
getTypedDataArrayRequester(e, s, i = !1, o = {}) {
|
|
5157
|
-
const c = s + (
|
|
5157
|
+
const c = s + (Y(o) ? "" : ` >>> ${JSON.stringify(o)}`), u = i ? Q.getCachedResponse(c) : void 0;
|
|
5158
5158
|
return u ? Promise.resolve(u) : this.get(s, o).then((h) => {
|
|
5159
5159
|
const m = h.map((f) => je.instanceInitializer(e, f));
|
|
5160
5160
|
return i && m && this.cacheResponse(s, m), m;
|
|
@@ -5164,8 +5164,8 @@ const K = class K extends p {
|
|
|
5164
5164
|
/**
|
|
5165
5165
|
* Кэш результатов запросов.
|
|
5166
5166
|
*/
|
|
5167
|
-
t(
|
|
5168
|
-
let pe =
|
|
5167
|
+
t(Q, "responseDataCache", /* @__PURE__ */ new Map());
|
|
5168
|
+
let pe = Q;
|
|
5169
5169
|
class os extends p {
|
|
5170
5170
|
/**
|
|
5171
5171
|
* Выполняет проверку занят ли указанный номер телефона.
|
|
@@ -5233,7 +5233,7 @@ class ls extends p {
|
|
|
5233
5233
|
const o = this.get(
|
|
5234
5234
|
`internal/catalog/categories/${r.id}/configurators/${(c = r.properties) == null ? void 0 : c.configurator}/product`,
|
|
5235
5235
|
{ params: s, client_id: e },
|
|
5236
|
-
(u) => new
|
|
5236
|
+
(u) => new a(u.data)
|
|
5237
5237
|
);
|
|
5238
5238
|
return o.catch((u) => {
|
|
5239
5239
|
this.errorResponseHandler(u, i);
|
|
@@ -5369,7 +5369,7 @@ class Tt extends pe {
|
|
|
5369
5369
|
return this.cacheResponse(r, i), i;
|
|
5370
5370
|
}
|
|
5371
5371
|
}
|
|
5372
|
-
class
|
|
5372
|
+
class ar extends Sr {
|
|
5373
5373
|
/**
|
|
5374
5374
|
* Инициализирует экземпляр класса {@link OrderInfo}.
|
|
5375
5375
|
*
|
|
@@ -5480,13 +5480,13 @@ class b extends pe {
|
|
|
5480
5480
|
* групп партнеров (направлений деятельности).
|
|
5481
5481
|
*/
|
|
5482
5482
|
getPartnerGroup() {
|
|
5483
|
-
return this.getTypedDataArrayRequester(
|
|
5483
|
+
return this.getTypedDataArrayRequester(Z, "/internal/references/partner-group", !0);
|
|
5484
5484
|
}
|
|
5485
5485
|
/**
|
|
5486
5486
|
* Возвращает {@link Promise} для получения справочника данных организационно-правовых форм.
|
|
5487
5487
|
*/
|
|
5488
5488
|
getOpf() {
|
|
5489
|
-
return this.getTypedDataArrayRequester(
|
|
5489
|
+
return this.getTypedDataArrayRequester(M, "/public/references/opf", !0);
|
|
5490
5490
|
}
|
|
5491
5491
|
/**
|
|
5492
5492
|
* Возвращает {@link Promise} для получения справочника операторов.
|
|
@@ -5544,7 +5544,7 @@ class b extends pe {
|
|
|
5544
5544
|
* @param term Терм поиска.
|
|
5545
5545
|
*/
|
|
5546
5546
|
searchRegion(r) {
|
|
5547
|
-
return this.getTypedDataArrayRequester(
|
|
5547
|
+
return this.getTypedDataArrayRequester(le, `/internal/references/region-with-country/search?term=${r}`);
|
|
5548
5548
|
}
|
|
5549
5549
|
/**
|
|
5550
5550
|
* Выполняет поиск данных о странах по терму в названии.
|
|
@@ -5552,7 +5552,7 @@ class b extends pe {
|
|
|
5552
5552
|
* @param term Терм поиска.
|
|
5553
5553
|
*/
|
|
5554
5554
|
searchCountry(r) {
|
|
5555
|
-
return this.getTypedDataArrayRequester(
|
|
5555
|
+
return this.getTypedDataArrayRequester(X, `/internal/references/country/search?term=${r}`);
|
|
5556
5556
|
}
|
|
5557
5557
|
/**
|
|
5558
5558
|
* Возвращает {@link Promise} для получения справочника типов доставки.
|
|
@@ -5585,8 +5585,8 @@ class b extends pe {
|
|
|
5585
5585
|
return this.getTypedDataArrayRequester(wt, "/public/references/product-file-type", !0);
|
|
5586
5586
|
}
|
|
5587
5587
|
}
|
|
5588
|
-
const $ =
|
|
5589
|
-
const n = y({}), r = y(void 0), e = y(void 0), s = y(void 0), i = y(void 0), o = y(void 0), c = y(void 0), u = y(void 0), h = y(void 0), m = y(void 0), f = y(void 0), D = y(void 0),
|
|
5588
|
+
const $ = z("common.references_private", () => {
|
|
5589
|
+
const n = y({}), r = y(void 0), e = y(void 0), s = y(void 0), i = y(void 0), o = y(void 0), c = y(void 0), u = y(void 0), h = y(void 0), m = y(void 0), f = y(void 0), D = y(void 0), re = y(void 0), te = y(void 0), W = y(void 0), J = y(void 0), Te = y(void 0), $e = y(void 0), l = y(void 0);
|
|
5590
5590
|
return {
|
|
5591
5591
|
/**
|
|
5592
5592
|
* Список загружаемых/загруженных на данный момент значений.
|
|
@@ -5639,19 +5639,19 @@ const $ = B("common.references_private", () => {
|
|
|
5639
5639
|
/**
|
|
5640
5640
|
* Справочник типов файлов продукктов/категорий.
|
|
5641
5641
|
*/
|
|
5642
|
-
productFileTypeReference:
|
|
5642
|
+
productFileTypeReference: re,
|
|
5643
5643
|
/**
|
|
5644
5644
|
* Справочник типов ресурсов.
|
|
5645
5645
|
*/
|
|
5646
|
-
resourceTypesReference:
|
|
5646
|
+
resourceTypesReference: te,
|
|
5647
5647
|
/**
|
|
5648
5648
|
* Справочник направлений продаж.
|
|
5649
5649
|
*/
|
|
5650
|
-
salesDirectionsReference:
|
|
5650
|
+
salesDirectionsReference: W,
|
|
5651
5651
|
/**
|
|
5652
5652
|
* Справочник источников первичного интереса.
|
|
5653
5653
|
*/
|
|
5654
|
-
sourcePrimaryInterestReference:
|
|
5654
|
+
sourcePrimaryInterestReference: J,
|
|
5655
5655
|
/**
|
|
5656
5656
|
* Справочник складов.
|
|
5657
5657
|
*/
|
|
@@ -5665,7 +5665,7 @@ const $ = B("common.references_private", () => {
|
|
|
5665
5665
|
*/
|
|
5666
5666
|
priceCoefficientsReference: l
|
|
5667
5667
|
};
|
|
5668
|
-
}), gs =
|
|
5668
|
+
}), gs = z("common.references", () => {
|
|
5669
5669
|
const n = A(() => {
|
|
5670
5670
|
const l = $();
|
|
5671
5671
|
return !l.channelPrimaryInterestReference && !l.dataLoaderList.channelPrimaryInterestReference && (l.dataLoaderList.channelPrimaryInterestReference = !0, p.getInstance(b).getChannelPrimaryInterest().then((g) => {
|
|
@@ -5726,22 +5726,22 @@ const $ = B("common.references_private", () => {
|
|
|
5726
5726
|
return !l.salesDirectionsReference && !l.dataLoaderList.salesDirectionsReference && (l.dataLoaderList.salesDirectionsReference = !0, p.getInstance(b).getSalesDirections().then((g) => {
|
|
5727
5727
|
l.salesDirectionsReference = g;
|
|
5728
5728
|
}).catch(w)), l.salesDirectionsReference;
|
|
5729
|
-
}),
|
|
5729
|
+
}), re = A(() => {
|
|
5730
5730
|
const l = $();
|
|
5731
5731
|
return !l.sourcePrimaryInterestReference && !l.dataLoaderList.sourcePrimaryInterestReference && (l.dataLoaderList.sourcePrimaryInterestReference = !0, p.getInstance(b).getSourcePrimaryInterest().then((g) => {
|
|
5732
5732
|
l.sourcePrimaryInterestReference = g;
|
|
5733
5733
|
}).catch(w)), l.sourcePrimaryInterestReference;
|
|
5734
|
-
}),
|
|
5734
|
+
}), te = A(() => {
|
|
5735
5735
|
const l = $();
|
|
5736
5736
|
return !l.deliveryTypeReference && !l.dataLoaderList.deliveryTypeReference && (l.dataLoaderList.deliveryTypeReference = !0, p.getInstance(b).getDeliveryTypes().then((g) => {
|
|
5737
5737
|
l.deliveryTypeReference = g;
|
|
5738
5738
|
}).catch(w)), l.deliveryTypeReference;
|
|
5739
|
-
}),
|
|
5739
|
+
}), W = A(() => {
|
|
5740
5740
|
const l = $();
|
|
5741
5741
|
return !l.managersList && !l.dataLoaderList.managersList && (l.dataLoaderList.managersList = !0, p.getInstance(Tt).getManagers().then((g) => {
|
|
5742
5742
|
l.managersList = g;
|
|
5743
5743
|
}).catch(w)), l.managersList;
|
|
5744
|
-
}),
|
|
5744
|
+
}), J = A(() => {
|
|
5745
5745
|
const l = $();
|
|
5746
5746
|
return !l.warehousesReference && !l.dataLoaderList.warehousesReference && (l.dataLoaderList.warehousesReference = !0, p.getInstance(b).getWarehouses().then((g) => {
|
|
5747
5747
|
l.warehousesReference = g;
|
|
@@ -5809,19 +5809,19 @@ const $ = B("common.references_private", () => {
|
|
|
5809
5809
|
/**
|
|
5810
5810
|
* Справочник каналов первичного интереса.
|
|
5811
5811
|
*/
|
|
5812
|
-
sourcePrimaryInterestsReference:
|
|
5812
|
+
sourcePrimaryInterestsReference: re,
|
|
5813
5813
|
/**
|
|
5814
5814
|
* Справочник типов доставки.
|
|
5815
5815
|
*/
|
|
5816
|
-
deliveryTypeReference:
|
|
5816
|
+
deliveryTypeReference: te,
|
|
5817
5817
|
/**
|
|
5818
5818
|
* Список менеджеров.
|
|
5819
5819
|
*/
|
|
5820
|
-
managersList:
|
|
5820
|
+
managersList: W,
|
|
5821
5821
|
/**
|
|
5822
5822
|
* Справочник складов.
|
|
5823
5823
|
*/
|
|
5824
|
-
warehousesReference:
|
|
5824
|
+
warehousesReference: J,
|
|
5825
5825
|
/**
|
|
5826
5826
|
* Справочник типов свойств.
|
|
5827
5827
|
*/
|
|
@@ -6028,7 +6028,7 @@ class bt extends hr {
|
|
|
6028
6028
|
this.product = new F(e.product), this.currency = new x(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 = e.sawing;
|
|
6029
6029
|
}
|
|
6030
6030
|
}
|
|
6031
|
-
class
|
|
6031
|
+
class Ie extends ar {
|
|
6032
6032
|
/**
|
|
6033
6033
|
* Инициализирует экземпляр класса {@link Order}.
|
|
6034
6034
|
*
|
|
@@ -6091,12 +6091,29 @@ class fs extends De {
|
|
|
6091
6091
|
{},
|
|
6092
6092
|
(o) => {
|
|
6093
6093
|
const c = { ...o.data };
|
|
6094
|
-
return c.data = c.data.map((u) => new
|
|
6094
|
+
return c.data = c.data.map((u) => new ar(u)), c;
|
|
6095
6095
|
},
|
|
6096
6096
|
void 0,
|
|
6097
6097
|
i
|
|
6098
6098
|
);
|
|
6099
6099
|
}
|
|
6100
|
+
/**
|
|
6101
|
+
* Возвращает количество заказов, соответствующих указанным фильтрам.
|
|
6102
|
+
*
|
|
6103
|
+
* @param filters Параметры фильтрации данных.
|
|
6104
|
+
* @param signal Сигнал отмены запроса.
|
|
6105
|
+
*
|
|
6106
|
+
* @see /doc/api/internal#/Заказы/api_internal_client_get_filtered_count
|
|
6107
|
+
*/
|
|
6108
|
+
getOrdersCount(r, e = void 0) {
|
|
6109
|
+
return this.get(
|
|
6110
|
+
"/internal/orders/count",
|
|
6111
|
+
r ? { filters: JSON.stringify((r instanceof G ? r : new G(r)).toPrimitive()) } : {},
|
|
6112
|
+
void 0,
|
|
6113
|
+
void 0,
|
|
6114
|
+
e
|
|
6115
|
+
).then((s) => s.count);
|
|
6116
|
+
}
|
|
6100
6117
|
/**
|
|
6101
6118
|
* Возвращает данные о количестве и сумме заказов клиента помесячно, с возможностью ограничения периода.
|
|
6102
6119
|
*
|
|
@@ -6112,7 +6129,7 @@ class fs extends De {
|
|
|
6112
6129
|
* @param orderId Идентификатор заказа для которого необходимо вернуть данные.
|
|
6113
6130
|
*/
|
|
6114
6131
|
getOrder(r) {
|
|
6115
|
-
return this.get(`/internal/orders/${r}`, {}, (e) => new
|
|
6132
|
+
return this.get(`/internal/orders/${r}`, {}, (e) => new Ie(e.data));
|
|
6116
6133
|
}
|
|
6117
6134
|
/**
|
|
6118
6135
|
* Добавляет продукт в заказ и возвращает обновлённые данные заказа.
|
|
@@ -6140,7 +6157,7 @@ class fs extends De {
|
|
|
6140
6157
|
is_additional_sale: e.isAdditionalSale,
|
|
6141
6158
|
...e.configuratorParams
|
|
6142
6159
|
},
|
|
6143
|
-
(i) => new
|
|
6160
|
+
(i) => new Ie(i.data),
|
|
6144
6161
|
s
|
|
6145
6162
|
);
|
|
6146
6163
|
}
|
|
@@ -6170,7 +6187,7 @@ class fs extends De {
|
|
|
6170
6187
|
marker: s.marker,
|
|
6171
6188
|
...s.configuratorParams
|
|
6172
6189
|
},
|
|
6173
|
-
(o) => new
|
|
6190
|
+
(o) => new Ie(o.data),
|
|
6174
6191
|
i
|
|
6175
6192
|
);
|
|
6176
6193
|
}
|
|
@@ -6202,7 +6219,7 @@ class Le {
|
|
|
6202
6219
|
* Источник клиентской цены.
|
|
6203
6220
|
*/
|
|
6204
6221
|
t(this, "source");
|
|
6205
|
-
this.client = new me(r == null ? void 0 : r.client), this.product = new
|
|
6222
|
+
this.client = new me(r == null ? void 0 : r.client), this.product = new a(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) ?? Ge.Product;
|
|
6206
6223
|
}
|
|
6207
6224
|
}
|
|
6208
6225
|
const de = (n) => {
|
|
@@ -6216,7 +6233,7 @@ const de = (n) => {
|
|
|
6216
6233
|
salesDirections: (o = n.salesDirections) == null ? void 0 : o.map((c) => c.id),
|
|
6217
6234
|
hideNotActive: n.hideNotActive
|
|
6218
6235
|
},
|
|
6219
|
-
(c) => T(c) || (H(c) || cr(c)) &&
|
|
6236
|
+
(c) => T(c) || (H(c) || cr(c)) && Y(c)
|
|
6220
6237
|
) : {};
|
|
6221
6238
|
}, rr = (n) => {
|
|
6222
6239
|
const r = {};
|
|
@@ -6330,10 +6347,10 @@ class St {
|
|
|
6330
6347
|
* @inheritDoc
|
|
6331
6348
|
*/
|
|
6332
6349
|
t(this, "currency");
|
|
6333
|
-
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = v(r.costDate) ? C(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new
|
|
6350
|
+
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = v(r.costDate) ? C(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new ce(r.product) : void 0, this.client = r.client ? new d(r.client) : void 0, this.executor = r.executor ? new d(r.executor) : void 0, this.currency = r.currency ? new x(r.currency) : void 0;
|
|
6334
6351
|
}
|
|
6335
6352
|
}
|
|
6336
|
-
class kt extends
|
|
6353
|
+
class kt extends ce {
|
|
6337
6354
|
/**
|
|
6338
6355
|
* Инициализирует экземпляр класса {@link ProductPriceHistory}.
|
|
6339
6356
|
*
|
|
@@ -6358,17 +6375,17 @@ class ws extends p {
|
|
|
6358
6375
|
*/
|
|
6359
6376
|
getProductPriceHistory(r) {
|
|
6360
6377
|
var o, c, u, h, m;
|
|
6361
|
-
const e =
|
|
6362
|
-
|
|
6378
|
+
const e = I().config.dateFormats.api, s = or(
|
|
6379
|
+
oe(r, {
|
|
6363
6380
|
costDate: {
|
|
6364
6381
|
from: xe((o = r.costDate) == null ? void 0 : o.from) ? U(r.costDate.from, e) : (c = r.costDate) == null ? void 0 : c.from,
|
|
6365
6382
|
to: xe((u = r.costDate) == null ? void 0 : u.to) ? U(r.costDate.to, e) : (h = r.costDate) == null ? void 0 : h.to
|
|
6366
6383
|
}
|
|
6367
6384
|
}),
|
|
6368
|
-
(f) => T(f) || (H(f) || cr(f)) &&
|
|
6385
|
+
(f) => T(f) || (H(f) || cr(f)) && Y(f)
|
|
6369
6386
|
), i = ((m = r.product) == null ? void 0 : m[0]) ?? 0;
|
|
6370
6387
|
return delete s.product, this.get(`/internal/price/products/${i}/history`, s).then((f) => [
|
|
6371
|
-
new kt(
|
|
6388
|
+
new kt(oe(f[0], { history: f }))
|
|
6372
6389
|
]);
|
|
6373
6390
|
}
|
|
6374
6391
|
}
|
|
@@ -6387,7 +6404,7 @@ class tr {
|
|
|
6387
6404
|
* Список рекомендованных категорий продуктов.
|
|
6388
6405
|
*/
|
|
6389
6406
|
t(this, "productCategories", []);
|
|
6390
|
-
r != null && r.products && (this.products = r.products.map((e) => new
|
|
6407
|
+
r != null && r.products && (this.products = r.products.map((e) => new ce(e))), r != null && r.productCategories && (this.productCategories = r.productCategories.map((e) => new ce(e)));
|
|
6391
6408
|
}
|
|
6392
6409
|
}
|
|
6393
6410
|
class vs extends p {
|
|
@@ -6436,7 +6453,7 @@ class vs extends p {
|
|
|
6436
6453
|
});
|
|
6437
6454
|
}
|
|
6438
6455
|
}
|
|
6439
|
-
class
|
|
6456
|
+
class at {
|
|
6440
6457
|
/**
|
|
6441
6458
|
* Инициализирует экземпляр класса {@link MetaTagItem}.
|
|
6442
6459
|
*
|
|
@@ -6494,7 +6511,7 @@ class sr {
|
|
|
6494
6511
|
*/
|
|
6495
6512
|
t(this, "tags");
|
|
6496
6513
|
var e;
|
|
6497
|
-
this.resourceType = new Rr(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((s) => new
|
|
6514
|
+
this.resourceType = new Rr(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((s) => new at(s))) ?? [], this.tags = r == null ? void 0 : r.tags;
|
|
6498
6515
|
}
|
|
6499
6516
|
}
|
|
6500
6517
|
class Cs extends p {
|
|
@@ -6575,7 +6592,7 @@ class Rs extends p {
|
|
|
6575
6592
|
});
|
|
6576
6593
|
}
|
|
6577
6594
|
}
|
|
6578
|
-
var
|
|
6595
|
+
var It = /* @__PURE__ */ ((n) => (n.Admin = "admin", n.Manager = "manager", n.Operator = "operator", n.Client = "client", n.Guest = "guest", n))(It || {});
|
|
6579
6596
|
class Lt extends fr {
|
|
6580
6597
|
/**
|
|
6581
6598
|
* Инициализирует экземпляр класса {@link User}.
|
|
@@ -6604,7 +6621,7 @@ class Ps extends p {
|
|
|
6604
6621
|
* Инициализирует экземпляр класса {@link UserAuthDataProvider}.
|
|
6605
6622
|
*/
|
|
6606
6623
|
constructor() {
|
|
6607
|
-
super(), this.baseUrl = `${
|
|
6624
|
+
super(), this.baseUrl = `${I().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
6608
6625
|
}
|
|
6609
6626
|
/**
|
|
6610
6627
|
* Функция для получения обновленных токенов доступа.
|
|
@@ -6624,7 +6641,7 @@ class dt extends p {
|
|
|
6624
6641
|
return this.get("/internal/users/info", {}, (r) => new Lt(r.data), !0);
|
|
6625
6642
|
}
|
|
6626
6643
|
}
|
|
6627
|
-
const xt =
|
|
6644
|
+
const xt = z("common.user_state_private", () => {
|
|
6628
6645
|
const n = y({}), r = y(void 0);
|
|
6629
6646
|
return {
|
|
6630
6647
|
/**
|
|
@@ -6636,7 +6653,7 @@ const xt = B("common.user_state_private", () => {
|
|
|
6636
6653
|
*/
|
|
6637
6654
|
currentUser: r
|
|
6638
6655
|
};
|
|
6639
|
-
}), As =
|
|
6656
|
+
}), As = z("common.user_state", () => ({
|
|
6640
6657
|
/**
|
|
6641
6658
|
* Данные о текущем пользователе.
|
|
6642
6659
|
*/
|
|
@@ -6699,15 +6716,15 @@ export {
|
|
|
6699
6716
|
me as ClientShortInfo,
|
|
6700
6717
|
ht as ClientsAdditionalDataRequestTypeEnum,
|
|
6701
6718
|
ss as ClientsListFilters,
|
|
6702
|
-
|
|
6719
|
+
ce as CodedIdentity,
|
|
6703
6720
|
ls as ConfiguratorProvider,
|
|
6704
6721
|
Dt as ConfiguratorsEnum,
|
|
6705
6722
|
Ne as Contact,
|
|
6706
6723
|
gr as ContactLinks,
|
|
6707
|
-
|
|
6724
|
+
B as ContactPerson,
|
|
6708
6725
|
Rt as ContactPersonRelated,
|
|
6709
6726
|
mt as ContactPosition,
|
|
6710
|
-
|
|
6727
|
+
ae as ContactRelation,
|
|
6711
6728
|
Dr as ContragentBase,
|
|
6712
6729
|
ve as ContragentFactory,
|
|
6713
6730
|
Tr as ContragentIc,
|
|
@@ -6715,7 +6732,7 @@ export {
|
|
|
6715
6732
|
Ct as ContragentUlNr,
|
|
6716
6733
|
$r as ContragentUlR,
|
|
6717
6734
|
Ge as CostSourceEnum,
|
|
6718
|
-
|
|
6735
|
+
X as Country,
|
|
6719
6736
|
Be as CuratedDirection,
|
|
6720
6737
|
ze as Curator,
|
|
6721
6738
|
x as Currency,
|
|
@@ -6731,7 +6748,7 @@ export {
|
|
|
6731
6748
|
Qr as DeviceTypeResolutionConfig,
|
|
6732
6749
|
it as DiscountShortInfo,
|
|
6733
6750
|
Ds as FieldValidationResultData,
|
|
6734
|
-
|
|
6751
|
+
G as FilterGroup,
|
|
6735
6752
|
Ye as FilterItem,
|
|
6736
6753
|
We as FilterOpEnum,
|
|
6737
6754
|
Ar as GeoCoordinates,
|
|
@@ -6739,20 +6756,20 @@ export {
|
|
|
6739
6756
|
pe as HttpCachedRequester,
|
|
6740
6757
|
Yr as HttpParamsConfig,
|
|
6741
6758
|
p as HttpRequester,
|
|
6742
|
-
|
|
6759
|
+
ee as Identity,
|
|
6743
6760
|
tt as Image,
|
|
6744
6761
|
j as JwtPayload,
|
|
6745
6762
|
Pe as Manager,
|
|
6746
6763
|
Me as ManagerCommon,
|
|
6747
6764
|
hs as ManagerDataFactory,
|
|
6748
6765
|
Tt as ManagerDataProvider,
|
|
6749
|
-
|
|
6766
|
+
at as MetaTagItem,
|
|
6750
6767
|
k as NamedIdentity,
|
|
6751
6768
|
vr as Operator,
|
|
6752
|
-
|
|
6769
|
+
M as Opf,
|
|
6753
6770
|
q as OpfEnum,
|
|
6754
|
-
|
|
6755
|
-
|
|
6771
|
+
Ie as Order,
|
|
6772
|
+
ar as OrderInfo,
|
|
6756
6773
|
bt as OrderItem,
|
|
6757
6774
|
hr as OrderItemBase,
|
|
6758
6775
|
ft as OrderPaymentStatus,
|
|
@@ -6762,7 +6779,7 @@ export {
|
|
|
6762
6779
|
fs as OrdersDataProvider,
|
|
6763
6780
|
ms as OrdersListFilters,
|
|
6764
6781
|
br as PaginationFiltersBase,
|
|
6765
|
-
|
|
6782
|
+
Z as PartnerGroup,
|
|
6766
6783
|
Cr as PaymentType,
|
|
6767
6784
|
ye as PreferencesStorageProvider,
|
|
6768
6785
|
Le as PriceAnalyze,
|
|
@@ -6771,16 +6788,16 @@ export {
|
|
|
6771
6788
|
pr as PriceCoefficientEnum,
|
|
6772
6789
|
ws as PriceHistoryDataProvider,
|
|
6773
6790
|
St as PriceHistoryItem,
|
|
6774
|
-
|
|
6791
|
+
K as PriceTemplate,
|
|
6775
6792
|
Se as PriceTemplateCategory,
|
|
6776
|
-
|
|
6793
|
+
se as PriceTemplateClient,
|
|
6777
6794
|
mr as PriceTemplateICatalogableItem,
|
|
6778
6795
|
ke as PriceTemplateProduct,
|
|
6779
6796
|
Xt as PriceTemplateProvider,
|
|
6780
|
-
|
|
6797
|
+
ne as PricingRole,
|
|
6781
6798
|
Zt as PricingRoleProvider,
|
|
6782
6799
|
_e as PrimaryCatalogableItem,
|
|
6783
|
-
|
|
6800
|
+
a as Product,
|
|
6784
6801
|
Vt as ProductCategoryDataProvider,
|
|
6785
6802
|
Kt as ProductDataProvider,
|
|
6786
6803
|
wt as ProductFileType,
|
|
@@ -6788,15 +6805,15 @@ export {
|
|
|
6788
6805
|
kt as ProductPriceHistory,
|
|
6789
6806
|
Ke as ProductUnit,
|
|
6790
6807
|
es as PropertiesProvider,
|
|
6791
|
-
|
|
6808
|
+
ie as Property,
|
|
6792
6809
|
yr as PropertyType,
|
|
6793
6810
|
lt as PropertyTypeEnum,
|
|
6794
|
-
|
|
6811
|
+
V as PropertyValue,
|
|
6795
6812
|
vs as RecommendationsDataProvider,
|
|
6796
6813
|
tr as RecommendationsList,
|
|
6797
6814
|
R as Reference,
|
|
6798
6815
|
b as ReferenceDataProvider,
|
|
6799
|
-
|
|
6816
|
+
le as Region,
|
|
6800
6817
|
Rr as ResourceType,
|
|
6801
6818
|
O as SalesDirection,
|
|
6802
6819
|
Xr as SentryConfig,
|
|
@@ -6816,7 +6833,7 @@ export {
|
|
|
6816
6833
|
dt as UserDataProvider,
|
|
6817
6834
|
ut as UserPricingRole,
|
|
6818
6835
|
d as UserShortInfo,
|
|
6819
|
-
|
|
6836
|
+
It as UserTypeEnum,
|
|
6820
6837
|
cs as VersionConfig,
|
|
6821
6838
|
ue as Warehouse,
|
|
6822
6839
|
Zr as WebSocketConfig,
|
|
@@ -6824,7 +6841,7 @@ export {
|
|
|
6824
6841
|
Ze as flattenCatalogItems,
|
|
6825
6842
|
ps as pluralize,
|
|
6826
6843
|
be as useAuthStateStore,
|
|
6827
|
-
|
|
6844
|
+
I as useBaseConfigStateStore,
|
|
6828
6845
|
gs as useReferencesStore,
|
|
6829
6846
|
As as useUserStateStore
|
|
6830
6847
|
};
|