@snabcentr/common-lib 1.87.0 → 1.89.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 +284 -267
- 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/catalog/classes/stock-count.d.ts +4 -3
- package/dist/src/catalog/classes/stock-count.d.ts.map +1 -1
- package/dist/src/catalog/interfaces/i-stock-count.d.ts +4 -3
- package/dist/src/catalog/interfaces/i-stock-count.d.ts.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
|
|
3
|
-
var t = (n, r, e) =>
|
|
1
|
+
var Lr = Object.defineProperty;
|
|
2
|
+
var ar = (n, r, e) => r in n ? Lr(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
|
+
var t = (n, r, e) => ar(n, typeof r != "symbol" ? r + "" : r, e);
|
|
4
4
|
import { jwtDecode as ir } from "jwt-decode";
|
|
5
|
-
import { merge as
|
|
5
|
+
import { merge as ce, 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
|
+
ce(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
|
+
ce(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 L = 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 = ce(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 = L().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 [te, se] = D, W = (J = E().userPermissions) == null ? void 0 : J[te];
|
|
559
|
+
return H(W) && W.includes(se);
|
|
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 re {
|
|
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 re {
|
|
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 le 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 le {
|
|
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
|
*
|
|
@@ -898,6 +898,58 @@ class Fe {
|
|
|
898
898
|
this.coefficient = new Re(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;
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
+
class hr {
|
|
902
|
+
/**
|
|
903
|
+
* Инициализирует экземпляр класса {@link GeoCoordinates}.
|
|
904
|
+
*
|
|
905
|
+
* @param data Данные для первоначальной инициализации.
|
|
906
|
+
*/
|
|
907
|
+
constructor(r) {
|
|
908
|
+
/**
|
|
909
|
+
* Широта.
|
|
910
|
+
*/
|
|
911
|
+
t(this, "lat");
|
|
912
|
+
/**
|
|
913
|
+
* Долгота.
|
|
914
|
+
*/
|
|
915
|
+
t(this, "long");
|
|
916
|
+
this.lat = (r == null ? void 0 : r.lat) ?? 0, this.long = (r == null ? void 0 : r.long) ?? 0;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
class N extends R {
|
|
920
|
+
}
|
|
921
|
+
class X extends R {
|
|
922
|
+
/**
|
|
923
|
+
* Инициализирует экземпляр класса {@link Warehouse}.
|
|
924
|
+
*
|
|
925
|
+
* @param data Данные для первоначальной инициализации.
|
|
926
|
+
*/
|
|
927
|
+
constructor(e) {
|
|
928
|
+
var s;
|
|
929
|
+
super(e);
|
|
930
|
+
/**
|
|
931
|
+
* Адрес склада.
|
|
932
|
+
*/
|
|
933
|
+
t(this, "address");
|
|
934
|
+
/**
|
|
935
|
+
* Признак того, что склад является основным.
|
|
936
|
+
*/
|
|
937
|
+
t(this, "isMain");
|
|
938
|
+
/**
|
|
939
|
+
* Список типов доставки.
|
|
940
|
+
*/
|
|
941
|
+
t(this, "deliveryTypes");
|
|
942
|
+
/**
|
|
943
|
+
* Список идентификаторов регионов, в которые осуществляется доставка со склада.
|
|
944
|
+
*/
|
|
945
|
+
t(this, "regions");
|
|
946
|
+
/**
|
|
947
|
+
* Координаты склада.
|
|
948
|
+
*/
|
|
949
|
+
t(this, "coordinates");
|
|
950
|
+
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 hr(e == null ? void 0 : e.coordinates);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
901
953
|
class nt {
|
|
902
954
|
/**
|
|
903
955
|
* Инициализирует экземпляр класса {@link StockCount}.
|
|
@@ -906,14 +958,14 @@ class nt {
|
|
|
906
958
|
*/
|
|
907
959
|
constructor(r) {
|
|
908
960
|
/**
|
|
909
|
-
*
|
|
961
|
+
* Данные склада.
|
|
910
962
|
*/
|
|
911
|
-
t(this, "
|
|
963
|
+
t(this, "warehouse");
|
|
912
964
|
/**
|
|
913
965
|
* Количество остатков товара на складе.
|
|
914
966
|
*/
|
|
915
967
|
t(this, "count");
|
|
916
|
-
this.
|
|
968
|
+
this.warehouse = new X(r == null ? void 0 : r.warehouse), this.count = (r == null ? void 0 : r.count) ?? 0;
|
|
917
969
|
}
|
|
918
970
|
}
|
|
919
971
|
class x extends k {
|
|
@@ -1049,7 +1101,7 @@ class I extends st {
|
|
|
1049
1101
|
t(this, "priceCoefficients");
|
|
1050
1102
|
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
1103
|
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,
|
|
1104
|
+
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, L().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
1105
|
}
|
|
1054
1106
|
/**
|
|
1055
1107
|
* Возвращает признак, что это измеряемый товар.
|
|
@@ -1107,7 +1159,7 @@ class F extends I {
|
|
|
1107
1159
|
* Признак того, что указанный продукт входит в список избранных продуктов клиента.
|
|
1108
1160
|
*/
|
|
1109
1161
|
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
|
|
1162
|
+
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
1163
|
}
|
|
1112
1164
|
}
|
|
1113
1165
|
class ge extends _e {
|
|
@@ -1137,7 +1189,7 @@ class ge extends _e {
|
|
|
1137
1189
|
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
1190
|
}
|
|
1139
1191
|
}
|
|
1140
|
-
class
|
|
1192
|
+
class gr extends re {
|
|
1141
1193
|
/**
|
|
1142
1194
|
* Инициализирует экземпляр класса {@link OrderItemBase}.
|
|
1143
1195
|
*
|
|
@@ -1196,7 +1248,7 @@ class hr extends Z {
|
|
|
1196
1248
|
this.product = new F(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new ge(), this.currency = e.currency ? new x(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && qr(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creatorUser = e.creatorUser && new d(e.creatorUser);
|
|
1197
1249
|
}
|
|
1198
1250
|
}
|
|
1199
|
-
let ot = class extends
|
|
1251
|
+
let ot = class extends gr {
|
|
1200
1252
|
/**
|
|
1201
1253
|
* Инициализирует экземпляр класса {@link OrderItem}.
|
|
1202
1254
|
*
|
|
@@ -1277,7 +1329,7 @@ const P = class P {
|
|
|
1277
1329
|
/**
|
|
1278
1330
|
* Базовый URL путь для выполнения запросов.
|
|
1279
1331
|
*/
|
|
1280
|
-
t(this, "baseUrl", `${
|
|
1332
|
+
t(this, "baseUrl", `${L().config.http.portalApiUrl}/api`);
|
|
1281
1333
|
/**
|
|
1282
1334
|
* Обработчик ошибок выполнения запросов текущего экземпляра класса.
|
|
1283
1335
|
*
|
|
@@ -1669,7 +1721,7 @@ class _ extends ge {
|
|
|
1669
1721
|
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 I(o));
|
|
1670
1722
|
}
|
|
1671
1723
|
}
|
|
1672
|
-
class
|
|
1724
|
+
class mr {
|
|
1673
1725
|
/**
|
|
1674
1726
|
* Инициализирует экземпляр класса {@link ContactLinks}.
|
|
1675
1727
|
*
|
|
@@ -1717,7 +1769,7 @@ class Me extends k {
|
|
|
1717
1769
|
* @inheritDoc
|
|
1718
1770
|
*/
|
|
1719
1771
|
t(this, "isRegionalDirector");
|
|
1720
|
-
this.salesDirection = e != null && e.salesDirection ? new O(e.salesDirection) : new O(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new
|
|
1772
|
+
this.salesDirection = e != null && e.salesDirection ? new O(e.salesDirection) : new O(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new mr(e.contacts) : void 0, this.isDefault = (e == null ? void 0 : e.isDefault) ?? !1, this.isRegionalDirector = (e == null ? void 0 : e.isRegionalDirector) ?? !1;
|
|
1721
1773
|
}
|
|
1722
1774
|
}
|
|
1723
1775
|
class Be extends R {
|
|
@@ -1836,7 +1888,7 @@ class we extends pt {
|
|
|
1836
1888
|
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new we(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new F(o));
|
|
1837
1889
|
}
|
|
1838
1890
|
}
|
|
1839
|
-
class
|
|
1891
|
+
class fr {
|
|
1840
1892
|
/**
|
|
1841
1893
|
* Инициализирует экземпляр класса {@link PriceTemplateICatalogableItem}.
|
|
1842
1894
|
*
|
|
@@ -1854,7 +1906,7 @@ class mr {
|
|
|
1854
1906
|
this.priceCoefficient = (r == null ? void 0 : r.priceCoefficient) && new Re(r.priceCoefficient), this.increasePercent = r == null ? void 0 : r.increasePercent;
|
|
1855
1907
|
}
|
|
1856
1908
|
}
|
|
1857
|
-
class Se extends
|
|
1909
|
+
class Se extends fr {
|
|
1858
1910
|
/**
|
|
1859
1911
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
1860
1912
|
*
|
|
@@ -1889,12 +1941,12 @@ class ze extends k {
|
|
|
1889
1941
|
* @inheritDoc
|
|
1890
1942
|
*/
|
|
1891
1943
|
t(this, "curatedDirection");
|
|
1892
|
-
this.photo = e.photo, this.contacts = new
|
|
1944
|
+
this.photo = e.photo, this.contacts = new mr(e.contacts), this.curatedDirection = new Be(e.curatedDirection);
|
|
1893
1945
|
}
|
|
1894
1946
|
}
|
|
1895
|
-
class
|
|
1947
|
+
class Z extends R {
|
|
1896
1948
|
}
|
|
1897
|
-
class
|
|
1949
|
+
class ue extends R {
|
|
1898
1950
|
/**
|
|
1899
1951
|
* Инициализирует экземпляр класса {@link Region}.
|
|
1900
1952
|
*
|
|
@@ -1905,8 +1957,8 @@ class ce extends R {
|
|
|
1905
1957
|
/**
|
|
1906
1958
|
* Данные о стране, в которой расположен регион.
|
|
1907
1959
|
*/
|
|
1908
|
-
t(this, "country", new
|
|
1909
|
-
e && (this.country = new
|
|
1960
|
+
t(this, "country", new Z());
|
|
1961
|
+
e && (this.country = new Z(e.country));
|
|
1910
1962
|
}
|
|
1911
1963
|
}
|
|
1912
1964
|
class Ae extends R {
|
|
@@ -1920,11 +1972,11 @@ class Ae extends R {
|
|
|
1920
1972
|
/**
|
|
1921
1973
|
* Данные о регионе, в котором расположен город.
|
|
1922
1974
|
*/
|
|
1923
|
-
t(this, "region", new
|
|
1924
|
-
e && (this.region = new
|
|
1975
|
+
t(this, "region", new ue());
|
|
1976
|
+
e && (this.region = new ue(e.region));
|
|
1925
1977
|
}
|
|
1926
1978
|
}
|
|
1927
|
-
class
|
|
1979
|
+
class yr extends k {
|
|
1928
1980
|
/**
|
|
1929
1981
|
* Инициализирует экземпляр класса {@link UserCommonInfo}.
|
|
1930
1982
|
*
|
|
@@ -1963,7 +2015,7 @@ class fr extends k {
|
|
|
1963
2015
|
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 O(e.salesDirection) : void 0, this.createdAt = v(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e == null ? void 0 : e.createdAt, this.lastLoginAt = v(e == null ? void 0 : e.lastLoginAt) ? C(e.lastLoginAt) : e == null ? void 0 : e.lastLoginAt, this.isActive = (e == null ? void 0 : e.isActive) ?? !1;
|
|
1964
2016
|
}
|
|
1965
2017
|
}
|
|
1966
|
-
class me extends
|
|
2018
|
+
class me extends yr {
|
|
1967
2019
|
/**
|
|
1968
2020
|
* Инициализирует экземпляр класса {@link Client}.
|
|
1969
2021
|
*
|
|
@@ -2012,7 +2064,7 @@ class me extends fr {
|
|
|
2012
2064
|
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
2065
|
}
|
|
2014
2066
|
}
|
|
2015
|
-
class
|
|
2067
|
+
class ie extends re {
|
|
2016
2068
|
/**
|
|
2017
2069
|
* Инициализирует новый экземпляр класса.
|
|
2018
2070
|
*
|
|
@@ -2036,10 +2088,10 @@ class te extends Z {
|
|
|
2036
2088
|
* Данные шаблона прайс-листа.
|
|
2037
2089
|
*/
|
|
2038
2090
|
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
|
|
2091
|
+
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
2092
|
}
|
|
2041
2093
|
}
|
|
2042
|
-
class ke extends
|
|
2094
|
+
class ke extends fr {
|
|
2043
2095
|
/**
|
|
2044
2096
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
2045
2097
|
*
|
|
@@ -2054,9 +2106,9 @@ class ke extends mr {
|
|
|
2054
2106
|
this.product = new I(e == null ? void 0 : e.product);
|
|
2055
2107
|
}
|
|
2056
2108
|
}
|
|
2057
|
-
class
|
|
2109
|
+
class wr extends R {
|
|
2058
2110
|
}
|
|
2059
|
-
class
|
|
2111
|
+
class ne extends k {
|
|
2060
2112
|
/**
|
|
2061
2113
|
* Инициализирует экземпляр класса {@link Property}.
|
|
2062
2114
|
*
|
|
@@ -2076,10 +2128,10 @@ class se extends k {
|
|
|
2076
2128
|
* Дополнительные метаданные свойства.
|
|
2077
2129
|
*/
|
|
2078
2130
|
t(this, "metadata");
|
|
2079
|
-
this.type = new
|
|
2131
|
+
this.type = new wr(e == null ? void 0 : e.type), this.description = (e == null ? void 0 : e.description) ?? "", this.metadata = e == null ? void 0 : e.metadata;
|
|
2080
2132
|
}
|
|
2081
2133
|
}
|
|
2082
|
-
class
|
|
2134
|
+
class V {
|
|
2083
2135
|
/**
|
|
2084
2136
|
* Инициализирует экземпляр класса {@link PropertyValue}.
|
|
2085
2137
|
*
|
|
@@ -2095,7 +2147,7 @@ class E {
|
|
|
2095
2147
|
* Может быть строкой, числом, boolean, диапазоном или JSON объектом.
|
|
2096
2148
|
*/
|
|
2097
2149
|
t(this, "value");
|
|
2098
|
-
this.property = new
|
|
2150
|
+
this.property = new ne(r == null ? void 0 : r.property), this.value = (r == null ? void 0 : r.value) ?? "";
|
|
2099
2151
|
}
|
|
2100
2152
|
}
|
|
2101
2153
|
class S {
|
|
@@ -2180,7 +2232,7 @@ class zt {
|
|
|
2180
2232
|
}), !((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
2233
|
}
|
|
2182
2234
|
}
|
|
2183
|
-
class
|
|
2235
|
+
class oe extends k {
|
|
2184
2236
|
/**
|
|
2185
2237
|
* Инициализирует экземпляр класса {@link PricingRole}.
|
|
2186
2238
|
*
|
|
@@ -2234,7 +2286,7 @@ class Qe {
|
|
|
2234
2286
|
* Минимальный коэффициент цены.
|
|
2235
2287
|
*/
|
|
2236
2288
|
t(this, "minCoefficient");
|
|
2237
|
-
this.role = new
|
|
2289
|
+
this.role = new oe(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
2290
|
}
|
|
2239
2291
|
}
|
|
2240
2292
|
class Wt extends p {
|
|
@@ -2264,7 +2316,7 @@ class Wt extends p {
|
|
|
2264
2316
|
*/
|
|
2265
2317
|
// eslint-disable-next-line class-methods-use-this
|
|
2266
2318
|
getPriceExportLink(r = "csv", e = !1, s = void 0, i = void 0) {
|
|
2267
|
-
let c = `${
|
|
2319
|
+
let c = `${L().config.http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;
|
|
2268
2320
|
return s && (c += `&category_id=${s}`), i && (c += `&client_id=${i}`), c;
|
|
2269
2321
|
}
|
|
2270
2322
|
}
|
|
@@ -2479,7 +2531,7 @@ class Et extends p {
|
|
|
2479
2531
|
return this.get(
|
|
2480
2532
|
`/internal/clients/${r}/price/templates`,
|
|
2481
2533
|
{},
|
|
2482
|
-
(e) => e.data.map((s) => new
|
|
2534
|
+
(e) => e.data.map((s) => new ie(s))
|
|
2483
2535
|
);
|
|
2484
2536
|
}
|
|
2485
2537
|
/**
|
|
@@ -2490,7 +2542,7 @@ class Et extends p {
|
|
|
2490
2542
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_get_active
|
|
2491
2543
|
*/
|
|
2492
2544
|
getActiveTemplate(r) {
|
|
2493
|
-
return this.get(`/internal/clients/${r}/price/templates/active`, {}, (e) => new
|
|
2545
|
+
return this.get(`/internal/clients/${r}/price/templates/active`, {}, (e) => new ie(e.data), !0);
|
|
2494
2546
|
}
|
|
2495
2547
|
/**
|
|
2496
2548
|
* Добавляет связь между клиентом и шаблоном прайс-листа.
|
|
@@ -2502,14 +2554,14 @@ class Et extends p {
|
|
|
2502
2554
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_attach
|
|
2503
2555
|
*/
|
|
2504
2556
|
attachTemplate(r, e, s) {
|
|
2505
|
-
const i =
|
|
2557
|
+
const i = L().config.dateFormats.api;
|
|
2506
2558
|
return this.post(
|
|
2507
2559
|
`/internal/clients/${r}/price/templates/${e}`,
|
|
2508
2560
|
s && {
|
|
2509
2561
|
startAt: s.startAt && U(s.startAt, i),
|
|
2510
2562
|
endAt: s.endAt && U(s.endAt, i)
|
|
2511
2563
|
},
|
|
2512
|
-
(o) => new
|
|
2564
|
+
(o) => new ie(o.data),
|
|
2513
2565
|
{},
|
|
2514
2566
|
!0
|
|
2515
2567
|
);
|
|
@@ -2536,14 +2588,14 @@ class Et extends p {
|
|
|
2536
2588
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_change
|
|
2537
2589
|
*/
|
|
2538
2590
|
changeTemplate(r, e, s, i) {
|
|
2539
|
-
const o =
|
|
2591
|
+
const o = L().config.dateFormats.api;
|
|
2540
2592
|
return this.patch(
|
|
2541
2593
|
`/internal/clients/${r}/price/templates/${e}/${s}`,
|
|
2542
2594
|
i && {
|
|
2543
2595
|
startAt: i.startAt && U(i.startAt, o),
|
|
2544
2596
|
endAt: i.endAt && U(i.endAt, o)
|
|
2545
2597
|
},
|
|
2546
|
-
(c) => new
|
|
2598
|
+
(c) => new ie(c.data)
|
|
2547
2599
|
);
|
|
2548
2600
|
}
|
|
2549
2601
|
/**
|
|
@@ -2816,10 +2868,10 @@ class Ye {
|
|
|
2816
2868
|
field: this.field,
|
|
2817
2869
|
op: this.op
|
|
2818
2870
|
};
|
|
2819
|
-
return r.value = xe(this.value) ? U(this.value,
|
|
2871
|
+
return r.value = xe(this.value) ? U(this.value, L().config.dateFormats.api) : this.value, r;
|
|
2820
2872
|
}
|
|
2821
2873
|
}
|
|
2822
|
-
class
|
|
2874
|
+
class G {
|
|
2823
2875
|
/**
|
|
2824
2876
|
* Инициализирует экземпляр класса {@link FilterGroup}.
|
|
2825
2877
|
*
|
|
@@ -2839,7 +2891,7 @@ class le {
|
|
|
2839
2891
|
*/
|
|
2840
2892
|
t(this, "groups");
|
|
2841
2893
|
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
|
|
2894
|
+
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
2895
|
}
|
|
2844
2896
|
/**
|
|
2845
2897
|
* Преобразует группу фильтров в примитивное представление для API.
|
|
@@ -2850,7 +2902,7 @@ class le {
|
|
|
2850
2902
|
return {
|
|
2851
2903
|
groupOp: this.groupOp,
|
|
2852
2904
|
filters: this.filters.map((r) => r instanceof Ye && Ue(r.toPrimitive) ? r.toPrimitive() : r),
|
|
2853
|
-
groups: this.groups.map((r) => r instanceof
|
|
2905
|
+
groups: this.groups.map((r) => r instanceof G ? r.toPrimitive() : r)
|
|
2854
2906
|
};
|
|
2855
2907
|
}
|
|
2856
2908
|
}
|
|
@@ -2872,7 +2924,7 @@ class De extends p {
|
|
|
2872
2924
|
page: (i == null ? void 0 : i.page) ?? 1,
|
|
2873
2925
|
perPage: (i == null ? void 0 : i.pageSize) ?? 10
|
|
2874
2926
|
};
|
|
2875
|
-
return e && (m.filters = JSON.stringify((e instanceof
|
|
2927
|
+
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
2928
|
}
|
|
2877
2929
|
}
|
|
2878
2930
|
class Xt extends De {
|
|
@@ -2888,7 +2940,7 @@ class Xt extends De {
|
|
|
2888
2940
|
getTemplateList(r, e, s) {
|
|
2889
2941
|
return this.getPaginated("/internal/price/templates", r, e, s, {}, (i) => {
|
|
2890
2942
|
const o = { ...i.data };
|
|
2891
|
-
return o.data = o.data.map((c) => new
|
|
2943
|
+
return o.data = o.data.map((c) => new K(c)), o;
|
|
2892
2944
|
});
|
|
2893
2945
|
}
|
|
2894
2946
|
/**
|
|
@@ -2901,7 +2953,7 @@ class Xt extends De {
|
|
|
2901
2953
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_create
|
|
2902
2954
|
*/
|
|
2903
2955
|
createTemplate(r, e = {}) {
|
|
2904
|
-
return this.post("/internal/price/templates", r, (s) => new
|
|
2956
|
+
return this.post("/internal/price/templates", r, (s) => new K(s.data), e);
|
|
2905
2957
|
}
|
|
2906
2958
|
/**
|
|
2907
2959
|
* Возвращает данные о шаблоне прайс-листа.
|
|
@@ -2911,7 +2963,7 @@ class Xt extends De {
|
|
|
2911
2963
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_get
|
|
2912
2964
|
*/
|
|
2913
2965
|
getTemplate(r) {
|
|
2914
|
-
return this.get(`/internal/price/templates/${r}`, {}, (e) => new
|
|
2966
|
+
return this.get(`/internal/price/templates/${r}`, {}, (e) => new K(e.data));
|
|
2915
2967
|
}
|
|
2916
2968
|
/**
|
|
2917
2969
|
* Изменяет данные о шаблоне прайс-листа.
|
|
@@ -2924,7 +2976,7 @@ class Xt extends De {
|
|
|
2924
2976
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_update
|
|
2925
2977
|
*/
|
|
2926
2978
|
updateTemplate(r, e, s = {}) {
|
|
2927
|
-
return this.patch(`/internal/price/templates/${r}`, e, (i) => new
|
|
2979
|
+
return this.patch(`/internal/price/templates/${r}`, e, (i) => new K(i.data), s);
|
|
2928
2980
|
}
|
|
2929
2981
|
/**
|
|
2930
2982
|
* Удаляет данные о шаблоне прайс-листа.
|
|
@@ -3075,7 +3127,7 @@ class Xt extends De {
|
|
|
3075
3127
|
return this.get(
|
|
3076
3128
|
`/internal/price/templates/${r}/clients`,
|
|
3077
3129
|
{},
|
|
3078
|
-
(e) => e.data.map((s) => new
|
|
3130
|
+
(e) => e.data.map((s) => new ie(s))
|
|
3079
3131
|
);
|
|
3080
3132
|
}
|
|
3081
3133
|
}
|
|
@@ -3086,7 +3138,7 @@ class Zt extends p {
|
|
|
3086
3138
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_get_list
|
|
3087
3139
|
*/
|
|
3088
3140
|
getRoles() {
|
|
3089
|
-
return this.get("/internal/price/roles", {}, (r) => r.data.map((e) => new
|
|
3141
|
+
return this.get("/internal/price/roles", {}, (r) => r.data.map((e) => new oe(e)));
|
|
3090
3142
|
}
|
|
3091
3143
|
/**
|
|
3092
3144
|
* Добавляет новую роль ценообразования.
|
|
@@ -3096,7 +3148,7 @@ class Zt extends p {
|
|
|
3096
3148
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_create
|
|
3097
3149
|
*/
|
|
3098
3150
|
createRole(r) {
|
|
3099
|
-
return this.post("/internal/price/roles", r, (e) => new
|
|
3151
|
+
return this.post("/internal/price/roles", r, (e) => new oe(e.data));
|
|
3100
3152
|
}
|
|
3101
3153
|
/**
|
|
3102
3154
|
* Возвращает данные роли ценообразования.
|
|
@@ -3106,7 +3158,7 @@ class Zt extends p {
|
|
|
3106
3158
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_get
|
|
3107
3159
|
*/
|
|
3108
3160
|
getRole(r) {
|
|
3109
|
-
return this.get(`/internal/price/roles/${r}`, {}, (e) => new
|
|
3161
|
+
return this.get(`/internal/price/roles/${r}`, {}, (e) => new oe(e.data));
|
|
3110
3162
|
}
|
|
3111
3163
|
/**
|
|
3112
3164
|
* Обновляет данные роли ценообразования.
|
|
@@ -3117,7 +3169,7 @@ class Zt extends p {
|
|
|
3117
3169
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_update
|
|
3118
3170
|
*/
|
|
3119
3171
|
updateRole(r, e) {
|
|
3120
|
-
return this.patch(`/internal/price/roles/${r}`, e, (s) => new
|
|
3172
|
+
return this.patch(`/internal/price/roles/${r}`, e, (s) => new oe(s.data));
|
|
3121
3173
|
}
|
|
3122
3174
|
/**
|
|
3123
3175
|
* Удаляет роль ценообразования.
|
|
@@ -3172,7 +3224,7 @@ class es extends De {
|
|
|
3172
3224
|
getProperties(r, e, s) {
|
|
3173
3225
|
return this.getPaginated("/internal/catalog/properties", r, e, s, {}, (i) => {
|
|
3174
3226
|
const o = { ...i.data };
|
|
3175
|
-
return o.data = o.data.map((c) => new
|
|
3227
|
+
return o.data = o.data.map((c) => new ne(c)), o;
|
|
3176
3228
|
});
|
|
3177
3229
|
}
|
|
3178
3230
|
/**
|
|
@@ -3189,7 +3241,7 @@ class es extends De {
|
|
|
3189
3241
|
...s,
|
|
3190
3242
|
type: e
|
|
3191
3243
|
},
|
|
3192
|
-
(i) => new
|
|
3244
|
+
(i) => new ne(i.data)
|
|
3193
3245
|
);
|
|
3194
3246
|
}
|
|
3195
3247
|
/**
|
|
@@ -3199,7 +3251,7 @@ class es extends De {
|
|
|
3199
3251
|
* @see /doc/api/internal#/operations/api_internal_catalog_properties_get
|
|
3200
3252
|
*/
|
|
3201
3253
|
getProperty(r) {
|
|
3202
|
-
return this.get(`/internal/catalog/properties/${r}`, {}, (e) => new
|
|
3254
|
+
return this.get(`/internal/catalog/properties/${r}`, {}, (e) => new ne(e.data));
|
|
3203
3255
|
}
|
|
3204
3256
|
/**
|
|
3205
3257
|
* Обновляет существующее свойство.
|
|
@@ -3216,7 +3268,7 @@ class es extends De {
|
|
|
3216
3268
|
...i,
|
|
3217
3269
|
type: s
|
|
3218
3270
|
},
|
|
3219
|
-
(o) => new
|
|
3271
|
+
(o) => new ne(o.data)
|
|
3220
3272
|
);
|
|
3221
3273
|
}
|
|
3222
3274
|
/**
|
|
@@ -3235,7 +3287,7 @@ class es extends De {
|
|
|
3235
3287
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_get_list
|
|
3236
3288
|
*/
|
|
3237
3289
|
getProductProperties(r) {
|
|
3238
|
-
return this.get(`/internal/catalog/products/${r}/properties`, {}, (e) => e.data.map((s) => new
|
|
3290
|
+
return this.get(`/internal/catalog/products/${r}/properties`, {}, (e) => e.data.map((s) => new V(s)));
|
|
3239
3291
|
}
|
|
3240
3292
|
/**
|
|
3241
3293
|
* Возвращает значение свойства продукта.
|
|
@@ -3245,7 +3297,7 @@ class es extends De {
|
|
|
3245
3297
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_get
|
|
3246
3298
|
*/
|
|
3247
3299
|
getProductProperty(r, e) {
|
|
3248
|
-
return this.get(`/internal/catalog/products/${r}/properties/${e}`, {}, (s) => new
|
|
3300
|
+
return this.get(`/internal/catalog/products/${r}/properties/${e}`, {}, (s) => new V(s.data));
|
|
3249
3301
|
}
|
|
3250
3302
|
/**
|
|
3251
3303
|
* Обновляет значение свойства продукта.
|
|
@@ -3256,7 +3308,7 @@ class es extends De {
|
|
|
3256
3308
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_update
|
|
3257
3309
|
*/
|
|
3258
3310
|
updateProductProperty(r, e, s) {
|
|
3259
|
-
return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: s }, (i) => new
|
|
3311
|
+
return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: s }, (i) => new V(i.data));
|
|
3260
3312
|
}
|
|
3261
3313
|
/**
|
|
3262
3314
|
* Удаляет значение свойства продукта.
|
|
@@ -3381,7 +3433,7 @@ class es extends De {
|
|
|
3381
3433
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_get_list
|
|
3382
3434
|
*/
|
|
3383
3435
|
getCategoryProperties(r) {
|
|
3384
|
-
return this.get(`/internal/catalog/categories/${r}/properties`, {}, (e) => e.data.map((s) => new
|
|
3436
|
+
return this.get(`/internal/catalog/categories/${r}/properties`, {}, (e) => e.data.map((s) => new V(s)));
|
|
3385
3437
|
}
|
|
3386
3438
|
/**
|
|
3387
3439
|
* Возвращает значение свойства категории.
|
|
@@ -3391,7 +3443,7 @@ class es extends De {
|
|
|
3391
3443
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_get
|
|
3392
3444
|
*/
|
|
3393
3445
|
getCategoryProperty(r, e) {
|
|
3394
|
-
return this.get(`/internal/catalog/categories/${r}/properties/${e}`, {}, (s) => new
|
|
3446
|
+
return this.get(`/internal/catalog/categories/${r}/properties/${e}`, {}, (s) => new V(s.data));
|
|
3395
3447
|
}
|
|
3396
3448
|
/**
|
|
3397
3449
|
* Обновляет значение свойства категории.
|
|
@@ -3402,7 +3454,7 @@ class es extends De {
|
|
|
3402
3454
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_update
|
|
3403
3455
|
*/
|
|
3404
3456
|
updateCategoryProperty(r, e, s) {
|
|
3405
|
-
return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: s }, (i) => new
|
|
3457
|
+
return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: s }, (i) => new V(i.data));
|
|
3406
3458
|
}
|
|
3407
3459
|
/**
|
|
3408
3460
|
* Удаляет значение свойства категории.
|
|
@@ -3626,20 +3678,18 @@ function Ze(n) {
|
|
|
3626
3678
|
var ht = /* @__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))(ht || {}), q = /* @__PURE__ */ ((n) => (n.Person = "individual", n.Ic = "entrepreneur", n.UlR = "legal", n.UlNr = "non_resident_legal", n))(q || {});
|
|
3627
3679
|
class gt extends R {
|
|
3628
3680
|
}
|
|
3629
|
-
class
|
|
3681
|
+
class vr extends R {
|
|
3630
3682
|
}
|
|
3631
3683
|
class ts extends R {
|
|
3632
3684
|
}
|
|
3633
3685
|
class mt extends R {
|
|
3634
3686
|
}
|
|
3635
|
-
class
|
|
3636
|
-
}
|
|
3637
|
-
class G extends R {
|
|
3687
|
+
class M extends R {
|
|
3638
3688
|
/**
|
|
3639
3689
|
* Возвращает сгенерированную запись-описание физического лица.
|
|
3640
3690
|
*/
|
|
3641
3691
|
static generatePersonItem() {
|
|
3642
|
-
return new
|
|
3692
|
+
return new M({
|
|
3643
3693
|
id: 1,
|
|
3644
3694
|
guid: "",
|
|
3645
3695
|
slug: q.Person,
|
|
@@ -3647,73 +3697,23 @@ class G extends R {
|
|
|
3647
3697
|
});
|
|
3648
3698
|
}
|
|
3649
3699
|
}
|
|
3650
|
-
class
|
|
3700
|
+
class Cr extends R {
|
|
3651
3701
|
}
|
|
3652
3702
|
class ft extends R {
|
|
3653
3703
|
}
|
|
3654
3704
|
class yt extends R {
|
|
3655
3705
|
}
|
|
3656
|
-
class
|
|
3706
|
+
class ee extends R {
|
|
3657
3707
|
}
|
|
3658
|
-
class
|
|
3708
|
+
class Rr extends R {
|
|
3659
3709
|
}
|
|
3660
3710
|
class wt extends R {
|
|
3661
3711
|
}
|
|
3662
|
-
class Rr extends R {
|
|
3663
|
-
}
|
|
3664
3712
|
class Pr extends R {
|
|
3665
3713
|
}
|
|
3666
|
-
class Ar {
|
|
3667
|
-
/**
|
|
3668
|
-
* Инициализирует экземпляр класса {@link GeoCoordinates}.
|
|
3669
|
-
*
|
|
3670
|
-
* @param data Данные для первоначальной инициализации.
|
|
3671
|
-
*/
|
|
3672
|
-
constructor(r) {
|
|
3673
|
-
/**
|
|
3674
|
-
* Широта.
|
|
3675
|
-
*/
|
|
3676
|
-
t(this, "lat");
|
|
3677
|
-
/**
|
|
3678
|
-
* Долгота.
|
|
3679
|
-
*/
|
|
3680
|
-
t(this, "long");
|
|
3681
|
-
this.lat = (r == null ? void 0 : r.lat) ?? 0, this.long = (r == null ? void 0 : r.long) ?? 0;
|
|
3682
|
-
}
|
|
3714
|
+
class Ar extends R {
|
|
3683
3715
|
}
|
|
3684
|
-
class
|
|
3685
|
-
/**
|
|
3686
|
-
* Инициализирует экземпляр класса {@link Warehouse}.
|
|
3687
|
-
*
|
|
3688
|
-
* @param data Данные для первоначальной инициализации.
|
|
3689
|
-
*/
|
|
3690
|
-
constructor(e) {
|
|
3691
|
-
var s;
|
|
3692
|
-
super(e);
|
|
3693
|
-
/**
|
|
3694
|
-
* Адрес склада.
|
|
3695
|
-
*/
|
|
3696
|
-
t(this, "address");
|
|
3697
|
-
/**
|
|
3698
|
-
* Признак того, что склад является основным.
|
|
3699
|
-
*/
|
|
3700
|
-
t(this, "isMain");
|
|
3701
|
-
/**
|
|
3702
|
-
* Список типов доставки.
|
|
3703
|
-
*/
|
|
3704
|
-
t(this, "deliveryTypes");
|
|
3705
|
-
/**
|
|
3706
|
-
* Список идентификаторов регионов, в которые осуществляется доставка со склада.
|
|
3707
|
-
*/
|
|
3708
|
-
t(this, "regions");
|
|
3709
|
-
/**
|
|
3710
|
-
* Координаты склада.
|
|
3711
|
-
*/
|
|
3712
|
-
t(this, "coordinates");
|
|
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
|
-
}
|
|
3715
|
-
}
|
|
3716
|
-
class qe extends Z {
|
|
3716
|
+
class qe extends re {
|
|
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 ee());
|
|
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 ee(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 Z());
|
|
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 Z(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 Ie extends
|
|
3976
|
+
class Ie extends re {
|
|
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
|
*
|
|
@@ -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
|
|
4056
|
+
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new hr(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 ee(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 vr(e == null ? void 0 : e.channelPrimaryInterest), this.sourcePrimaryInterest = new Ar(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 X(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 ue(e == null ? void 0 : e.region), this.country = new Z(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 ee(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 ue();
|
|
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 re {
|
|
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 ee(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 {
|
|
@@ -4419,7 +4419,7 @@ class ns {
|
|
|
4419
4419
|
this.field = (r == null ? void 0 : r.field) ?? "", this.direction = (r == null ? void 0 : r.direction) ?? "asc";
|
|
4420
4420
|
}
|
|
4421
4421
|
}
|
|
4422
|
-
class
|
|
4422
|
+
class a extends De {
|
|
4423
4423
|
/**
|
|
4424
4424
|
* Преобразует данные о клиенте в данные требуемые для запроса.
|
|
4425
4425
|
*
|
|
@@ -4643,7 +4643,7 @@ class L extends De {
|
|
|
4643
4643
|
* @see /doc/api/internal#/Клиенты/api_internal_client_create
|
|
4644
4644
|
*/
|
|
4645
4645
|
createClientCommonData(r, e = {}) {
|
|
4646
|
-
return this.post("/internal/clients",
|
|
4646
|
+
return this.post("/internal/clients", a.transformClientDataToRequest(r), (s) => new er(s.data), e);
|
|
4647
4647
|
}
|
|
4648
4648
|
/**
|
|
4649
4649
|
* Обновляет данные указанного клиента.
|
|
@@ -4653,7 +4653,7 @@ class L extends De {
|
|
|
4653
4653
|
* @see /doc/api/internal#/Клиенты/api_internal_client_change
|
|
4654
4654
|
*/
|
|
4655
4655
|
updateClientCommonData(r, e = {}) {
|
|
4656
|
-
return this.patch(`/internal/clients/${r.id}`,
|
|
4656
|
+
return this.patch(`/internal/clients/${r.id}`, a.transformClientDataToRequest(r), void 0, e);
|
|
4657
4657
|
}
|
|
4658
4658
|
/**
|
|
4659
4659
|
* Обновляет данные "Не беспокоить" указанного клиента.
|
|
@@ -4782,7 +4782,7 @@ class L extends De {
|
|
|
4782
4782
|
createContragentClientData(r, e, s = {}) {
|
|
4783
4783
|
return this.post(
|
|
4784
4784
|
`/internal/clients/${r}/contragents`,
|
|
4785
|
-
|
|
4785
|
+
a.transformContragentClientDataToRequest(e),
|
|
4786
4786
|
(i) => ve.createInstance(i.data),
|
|
4787
4787
|
s
|
|
4788
4788
|
);
|
|
@@ -4798,7 +4798,7 @@ class L extends De {
|
|
|
4798
4798
|
updateContragentClientData(r, e, s = {}) {
|
|
4799
4799
|
return this.patch(
|
|
4800
4800
|
`/internal/clients/${r}/contragents/${e.id}`,
|
|
4801
|
-
|
|
4801
|
+
a.transformContragentClientDataToRequest(e),
|
|
4802
4802
|
(i) => ve.createInstance(i.data),
|
|
4803
4803
|
s
|
|
4804
4804
|
);
|
|
@@ -4824,7 +4824,7 @@ class L extends De {
|
|
|
4824
4824
|
createClientDeliveryAddress(r, e, s = {}) {
|
|
4825
4825
|
return this.post(
|
|
4826
4826
|
`/internal/clients/${r}/delivery-addresses`,
|
|
4827
|
-
|
|
4827
|
+
a.transformClientDeliveryAddressToRequest(e),
|
|
4828
4828
|
(i) => new Ce(i.data),
|
|
4829
4829
|
s
|
|
4830
4830
|
);
|
|
@@ -4840,7 +4840,7 @@ class L extends De {
|
|
|
4840
4840
|
updateClientDeliveryAddress(r, e, s = {}) {
|
|
4841
4841
|
return this.patch(
|
|
4842
4842
|
`/internal/clients/${r}/delivery-addresses/${e.id}`,
|
|
4843
|
-
|
|
4843
|
+
a.transformClientDeliveryAddressToRequest(e),
|
|
4844
4844
|
(i) => new Ce(i.data),
|
|
4845
4845
|
s
|
|
4846
4846
|
);
|
|
@@ -4867,7 +4867,7 @@ class L extends De {
|
|
|
4867
4867
|
createContragentBankAccount(r, e, s, i = {}) {
|
|
4868
4868
|
return this.post(
|
|
4869
4869
|
`/internal/clients/${r}/contragents/${e}/bank-accounts`,
|
|
4870
|
-
|
|
4870
|
+
a.transformClientContragentBankAccountToRequest(s),
|
|
4871
4871
|
(o) => new qe(o.data),
|
|
4872
4872
|
i
|
|
4873
4873
|
);
|
|
@@ -4884,7 +4884,7 @@ class L extends De {
|
|
|
4884
4884
|
updateContragentBankAccount(r, e, s, i = {}) {
|
|
4885
4885
|
return this.patch(
|
|
4886
4886
|
`/internal/clients/${r}/contragents/${e}/bank-accounts/${s.id}`,
|
|
4887
|
-
|
|
4887
|
+
a.transformClientContragentBankAccountToRequest(s),
|
|
4888
4888
|
(o) => new qe(o.data),
|
|
4889
4889
|
i
|
|
4890
4890
|
);
|
|
@@ -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 = L().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
|
* Выполняет проверку занят ли указанный номер телефона.
|
|
@@ -5434,7 +5434,7 @@ class Ir extends Sr {
|
|
|
5434
5434
|
type: ((c = e == null ? void 0 : e.delivery) == null ? void 0 : c.type) ?? -1,
|
|
5435
5435
|
date: v((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? C(e.delivery.date) : ((h = e == null ? void 0 : e.delivery) == null ? void 0 : h.date) ?? /* @__PURE__ */ new Date(),
|
|
5436
5436
|
address: (m = e == null ? void 0 : e.delivery) != null && m.address ? new Ce(e.delivery.address) : void 0,
|
|
5437
|
-
warehouse: (f = e == null ? void 0 : e.delivery) != null && f.warehouse ? new
|
|
5437
|
+
warehouse: (f = e == null ? void 0 : e.delivery) != null && f.warehouse ? new X(e.delivery.warehouse) : void 0
|
|
5438
5438
|
}, this.attachedUser = e != null && e.attachedUser ? new d(e == null ? void 0 : e.attachedUser) : void 0, this.status = (e == null ? void 0 : e.status) ?? 0, this.salesDirection = new O(e == null ? void 0 : e.salesDirection), this.pendingAt = v(e == null ? void 0 : e.pendingAt) ? C(e.pendingAt) : e == null ? void 0 : e.pendingAt, this.processedAt = v(e == null ? void 0 : e.processedAt) ? C(e.processedAt) : e == null ? void 0 : e.processedAt, this.isOnOrder = (e == null ? void 0 : e.isOnOrder) ?? !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;
|
|
5439
5439
|
}
|
|
5440
5440
|
}
|
|
@@ -5455,7 +5455,7 @@ class b extends pe {
|
|
|
5455
5455
|
* первичного интереса.
|
|
5456
5456
|
*/
|
|
5457
5457
|
getChannelPrimaryInterest() {
|
|
5458
|
-
return this.getTypedDataArrayRequester(
|
|
5458
|
+
return this.getTypedDataArrayRequester(vr, "/internal/references/channel-primary-interest", !0);
|
|
5459
5459
|
}
|
|
5460
5460
|
/**
|
|
5461
5461
|
* Возвращает {@link Promise} для получения справочника должностей контактных лиц.
|
|
@@ -5480,19 +5480,19 @@ class b extends pe {
|
|
|
5480
5480
|
* групп партнеров (направлений деятельности).
|
|
5481
5481
|
*/
|
|
5482
5482
|
getPartnerGroup() {
|
|
5483
|
-
return this.getTypedDataArrayRequester(
|
|
5483
|
+
return this.getTypedDataArrayRequester(ee, "/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} для получения справочника операторов.
|
|
5493
5493
|
*/
|
|
5494
5494
|
getOperators() {
|
|
5495
|
-
return this.getTypedDataArrayRequester(
|
|
5495
|
+
return this.getTypedDataArrayRequester(Cr, "/internal/references/operator", !0);
|
|
5496
5496
|
}
|
|
5497
5497
|
/**
|
|
5498
5498
|
* Возвращает {@link Promise} для получения справочника данных статусов оплаты заказов.
|
|
@@ -5510,13 +5510,13 @@ class b extends pe {
|
|
|
5510
5510
|
* Возвращает {@link Promise} для получения справочника данных типов оплаты заказов.
|
|
5511
5511
|
*/
|
|
5512
5512
|
getPaymentTypes() {
|
|
5513
|
-
return this.getTypedDataArrayRequester(
|
|
5513
|
+
return this.getTypedDataArrayRequester(Rr, "/public/references/payment-type", !0);
|
|
5514
5514
|
}
|
|
5515
5515
|
/**
|
|
5516
5516
|
* Возвращает {@link Promise} для получения справочника типов ресурсов.
|
|
5517
5517
|
*/
|
|
5518
5518
|
getResourceTypes() {
|
|
5519
|
-
return this.getTypedDataArrayRequester(
|
|
5519
|
+
return this.getTypedDataArrayRequester(Pr, "/internal/references/resource-type", !0);
|
|
5520
5520
|
}
|
|
5521
5521
|
/**
|
|
5522
5522
|
* Возвращает {@link Promise} для получения справочника данных направлений продаж.
|
|
@@ -5528,7 +5528,7 @@ class b extends pe {
|
|
|
5528
5528
|
* Возвращает {@link Promise} для получения справочника данных об источнике первичного интереса.
|
|
5529
5529
|
*/
|
|
5530
5530
|
getSourcePrimaryInterest() {
|
|
5531
|
-
return this.getTypedDataArrayRequester(
|
|
5531
|
+
return this.getTypedDataArrayRequester(Ar, "/internal/references/source-primary-interest", !0);
|
|
5532
5532
|
}
|
|
5533
5533
|
/**
|
|
5534
5534
|
* Выполняет поиск данных о городах по терму в названии.
|
|
@@ -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(ue, `/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(Z, `/internal/references/country/search?term=${r}`);
|
|
5556
5556
|
}
|
|
5557
5557
|
/**
|
|
5558
5558
|
* Возвращает {@link Promise} для получения справочника типов доставки.
|
|
@@ -5564,13 +5564,13 @@ class b extends pe {
|
|
|
5564
5564
|
* Возвращает {@link Promise} для получения справочника складов.
|
|
5565
5565
|
*/
|
|
5566
5566
|
getWarehouses() {
|
|
5567
|
-
return this.getTypedDataArrayRequester(
|
|
5567
|
+
return this.getTypedDataArrayRequester(X, "/public/references/warehouse", !0);
|
|
5568
5568
|
}
|
|
5569
5569
|
/**
|
|
5570
5570
|
* Возвращает {@link Promise} для получения справочника типов свойств.
|
|
5571
5571
|
*/
|
|
5572
5572
|
getPropertyTypes() {
|
|
5573
|
-
return this.getTypedDataArrayRequester(
|
|
5573
|
+
return this.getTypedDataArrayRequester(wr, "/internal/references/property-type", !0);
|
|
5574
5574
|
}
|
|
5575
5575
|
/**
|
|
5576
5576
|
* Возвращает {@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), te = y(void 0), se = 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: te,
|
|
5643
5643
|
/**
|
|
5644
5644
|
* Справочник типов ресурсов.
|
|
5645
5645
|
*/
|
|
5646
|
-
resourceTypesReference:
|
|
5646
|
+
resourceTypesReference: se,
|
|
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
|
+
}), te = 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
|
+
}), se = 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: te,
|
|
5813
5813
|
/**
|
|
5814
5814
|
* Справочник типов доставки.
|
|
5815
5815
|
*/
|
|
5816
|
-
deliveryTypeReference:
|
|
5816
|
+
deliveryTypeReference: se,
|
|
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
|
*/
|
|
@@ -5925,7 +5925,7 @@ class ms extends br {
|
|
|
5925
5925
|
* @inheritDoc
|
|
5926
5926
|
*/
|
|
5927
5927
|
t(this, "isLargeOrder");
|
|
5928
|
-
this.attachedOperators = (s = e == null ? void 0 : e.attachedOperators) == null ? void 0 : s.map((c) => new
|
|
5928
|
+
this.attachedOperators = (s = e == null ? void 0 : e.attachedOperators) == null ? void 0 : s.map((c) => new Cr(c)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.contragent = e == null ? void 0 : e.contragent, this.createdAt = new S(e == null ? void 0 : e.createdAt), this.creator = e != null && e.creator ? new d(e.creator) : void 0, this.deliveryDate = new S(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((c) => new Ae(c)), this.id = e == null ? void 0 : e.id, this.isApproved = e == null ? void 0 : e.isApproved, this.isApproved1c = e == null ? void 0 : e.isApproved1c, 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.pendingAt = new S(e == null ? void 0 : e.pendingAt), this.processedAt = new S(e == null ? void 0 : e.processedAt), this.salesDirections = (o = e == null ? void 0 : e.salesDirections) == null ? void 0 : o.map((c) => new O(c)), this.status = e == null ? void 0 : e.status, this.deliveryType = e != null && e.deliveryType ? new N(e.deliveryType) : void 0, this.paymentType = e != null && e.paymentType ? new Rr(e.paymentType) : void 0, this.warehouse = e != null && e.warehouse ? new X(e.warehouse) : void 0;
|
|
5929
5929
|
}
|
|
5930
5930
|
/**
|
|
5931
5931
|
* @inheritDoc
|
|
@@ -5960,7 +5960,7 @@ class ms extends br {
|
|
|
5960
5960
|
this.status = [];
|
|
5961
5961
|
break;
|
|
5962
5962
|
case "warehouse":
|
|
5963
|
-
this.warehouse = new
|
|
5963
|
+
this.warehouse = new X();
|
|
5964
5964
|
break;
|
|
5965
5965
|
default:
|
|
5966
5966
|
this[e] = void 0;
|
|
@@ -5977,7 +5977,7 @@ class ms extends br {
|
|
|
5977
5977
|
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.deliveryDate) != null && o.from) && !((c = e == null ? void 0 : e.deliveryDate) != null && c.to) && delete e.deliveryDate, !((u = e == null ? void 0 : e.pendingAt) != null && u.from) && !((h = e == null ? void 0 : e.pendingAt) != null && h.to) && delete e.pendingAt, !((m = e == null ? void 0 : e.processedAt) != null && m.from) && !((f = e == null ? void 0 : e.processedAt) != null && f.to) && delete e.processedAt, e;
|
|
5978
5978
|
}
|
|
5979
5979
|
}
|
|
5980
|
-
class bt extends
|
|
5980
|
+
class bt extends gr {
|
|
5981
5981
|
/**
|
|
5982
5982
|
* Инициализирует экземпляр класса {@link OrderItem}.
|
|
5983
5983
|
*
|
|
@@ -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 Le extends Ir {
|
|
6032
6032
|
/**
|
|
6033
6033
|
* Инициализирует экземпляр класса {@link Order}.
|
|
6034
6034
|
*
|
|
@@ -6097,6 +6097,23 @@ class fs extends De {
|
|
|
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 Le(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 Le(i.data),
|
|
6144
6161
|
s
|
|
6145
6162
|
);
|
|
6146
6163
|
}
|
|
@@ -6170,12 +6187,12 @@ class fs extends De {
|
|
|
6170
6187
|
marker: s.marker,
|
|
6171
6188
|
...s.configuratorParams
|
|
6172
6189
|
},
|
|
6173
|
-
(o) => new
|
|
6190
|
+
(o) => new Le(o.data),
|
|
6174
6191
|
i
|
|
6175
6192
|
);
|
|
6176
6193
|
}
|
|
6177
6194
|
}
|
|
6178
|
-
class
|
|
6195
|
+
class ae {
|
|
6179
6196
|
/**
|
|
6180
6197
|
* Инициализирует экземпляр класса {@link PriceAnalyze}.
|
|
6181
6198
|
*
|
|
@@ -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 = {};
|
|
@@ -6239,7 +6256,7 @@ class ys extends p {
|
|
|
6239
6256
|
...rr(e),
|
|
6240
6257
|
filters: de(s)
|
|
6241
6258
|
},
|
|
6242
|
-
(i) => i.data.map((o) => new
|
|
6259
|
+
(i) => i.data.map((o) => new ae(o))
|
|
6243
6260
|
);
|
|
6244
6261
|
}
|
|
6245
6262
|
/**
|
|
@@ -6258,7 +6275,7 @@ class ys extends p {
|
|
|
6258
6275
|
...rr(e),
|
|
6259
6276
|
filters: de(s)
|
|
6260
6277
|
},
|
|
6261
|
-
(i) => i.data.map((o) => new
|
|
6278
|
+
(i) => i.data.map((o) => new ae(o))
|
|
6262
6279
|
);
|
|
6263
6280
|
}
|
|
6264
6281
|
/**
|
|
@@ -6279,7 +6296,7 @@ class ys extends p {
|
|
|
6279
6296
|
...e,
|
|
6280
6297
|
filters: de(s)
|
|
6281
6298
|
},
|
|
6282
|
-
(i) => i.data.map((o) => new
|
|
6299
|
+
(i) => i.data.map((o) => new ae(o))
|
|
6283
6300
|
);
|
|
6284
6301
|
}
|
|
6285
6302
|
}
|
|
@@ -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 le(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 le {
|
|
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 = L().config.dateFormats.api, s = or(
|
|
6379
|
+
ce(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(ce(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 le(e))), r != null && r.productCategories && (this.productCategories = r.productCategories.map((e) => new le(e)));
|
|
6391
6408
|
}
|
|
6392
6409
|
}
|
|
6393
6410
|
class vs extends p {
|
|
@@ -6494,7 +6511,7 @@ class sr {
|
|
|
6494
6511
|
*/
|
|
6495
6512
|
t(this, "tags");
|
|
6496
6513
|
var e;
|
|
6497
|
-
this.resourceType = new
|
|
6514
|
+
this.resourceType = new Pr(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 It(s))) ?? [], this.tags = r == null ? void 0 : r.tags;
|
|
6498
6515
|
}
|
|
6499
6516
|
}
|
|
6500
6517
|
class Cs extends p {
|
|
@@ -6575,8 +6592,8 @@ class Rs extends p {
|
|
|
6575
6592
|
});
|
|
6576
6593
|
}
|
|
6577
6594
|
}
|
|
6578
|
-
var
|
|
6579
|
-
class
|
|
6595
|
+
var Lt = /* @__PURE__ */ ((n) => (n.Admin = "admin", n.Manager = "manager", n.Operator = "operator", n.Client = "client", n.Guest = "guest", n))(Lt || {});
|
|
6596
|
+
class at extends yr {
|
|
6580
6597
|
/**
|
|
6581
6598
|
* Инициализирует экземпляр класса {@link User}.
|
|
6582
6599
|
*
|
|
@@ -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 = `${L().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
6608
6625
|
}
|
|
6609
6626
|
/**
|
|
6610
6627
|
* Функция для получения обновленных токенов доступа.
|
|
@@ -6621,10 +6638,10 @@ class dt extends p {
|
|
|
6621
6638
|
*/
|
|
6622
6639
|
// eslint-disable-next-line class-methods-use-this
|
|
6623
6640
|
getCurrentUser() {
|
|
6624
|
-
return this.get("/internal/users/info", {}, (r) => new
|
|
6641
|
+
return this.get("/internal/users/info", {}, (r) => new at(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
|
*/
|
|
@@ -6684,13 +6701,13 @@ export {
|
|
|
6684
6701
|
ur as CatalogableItem,
|
|
6685
6702
|
_ as Category,
|
|
6686
6703
|
Qe as CategoryPricingRule,
|
|
6687
|
-
|
|
6704
|
+
vr as ChannelPrimaryInterest,
|
|
6688
6705
|
ts as City,
|
|
6689
6706
|
Ae as CityWithRegionAndCountry,
|
|
6690
6707
|
er as Client,
|
|
6691
6708
|
Pt as ClientAdditionalData,
|
|
6692
6709
|
we as ClientCategory,
|
|
6693
|
-
|
|
6710
|
+
a as ClientDataProvider,
|
|
6694
6711
|
Jt as ClientPriceProvider,
|
|
6695
6712
|
Et as ClientPriceTemplateProvider,
|
|
6696
6713
|
F as ClientProduct,
|
|
@@ -6699,12 +6716,12 @@ export {
|
|
|
6699
6716
|
me as ClientShortInfo,
|
|
6700
6717
|
ht as ClientsAdditionalDataRequestTypeEnum,
|
|
6701
6718
|
ss as ClientsListFilters,
|
|
6702
|
-
|
|
6719
|
+
le as CodedIdentity,
|
|
6703
6720
|
ls as ConfiguratorProvider,
|
|
6704
6721
|
Dt as ConfiguratorsEnum,
|
|
6705
6722
|
Ne as Contact,
|
|
6706
|
-
|
|
6707
|
-
|
|
6723
|
+
mr as ContactLinks,
|
|
6724
|
+
B as ContactPerson,
|
|
6708
6725
|
Rt as ContactPersonRelated,
|
|
6709
6726
|
mt as ContactPosition,
|
|
6710
6727
|
Ie as ContactRelation,
|
|
@@ -6715,7 +6732,7 @@ export {
|
|
|
6715
6732
|
Ct as ContragentUlNr,
|
|
6716
6733
|
$r as ContragentUlR,
|
|
6717
6734
|
Ge as CostSourceEnum,
|
|
6718
|
-
|
|
6735
|
+
Z as Country,
|
|
6719
6736
|
Be as CuratedDirection,
|
|
6720
6737
|
ze as Curator,
|
|
6721
6738
|
x as Currency,
|
|
@@ -6731,15 +6748,15 @@ 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
|
+
hr as GeoCoordinates,
|
|
6738
6755
|
st as HiddenCatalogableItem,
|
|
6739
6756
|
pe as HttpCachedRequester,
|
|
6740
6757
|
Yr as HttpParamsConfig,
|
|
6741
6758
|
p as HttpRequester,
|
|
6742
|
-
|
|
6759
|
+
re as Identity,
|
|
6743
6760
|
tt as Image,
|
|
6744
6761
|
j as JwtPayload,
|
|
6745
6762
|
Pe as Manager,
|
|
@@ -6748,13 +6765,13 @@ export {
|
|
|
6748
6765
|
Tt as ManagerDataProvider,
|
|
6749
6766
|
It as MetaTagItem,
|
|
6750
6767
|
k as NamedIdentity,
|
|
6751
|
-
|
|
6752
|
-
|
|
6768
|
+
Cr as Operator,
|
|
6769
|
+
M as Opf,
|
|
6753
6770
|
q as OpfEnum,
|
|
6754
|
-
|
|
6771
|
+
Le as Order,
|
|
6755
6772
|
Ir as OrderInfo,
|
|
6756
6773
|
bt as OrderItem,
|
|
6757
|
-
|
|
6774
|
+
gr as OrderItemBase,
|
|
6758
6775
|
ft as OrderPaymentStatus,
|
|
6759
6776
|
Sr as OrderShortInfo,
|
|
6760
6777
|
yt as OrderStatus,
|
|
@@ -6762,22 +6779,22 @@ export {
|
|
|
6762
6779
|
fs as OrdersDataProvider,
|
|
6763
6780
|
ms as OrdersListFilters,
|
|
6764
6781
|
br as PaginationFiltersBase,
|
|
6765
|
-
|
|
6766
|
-
|
|
6782
|
+
ee as PartnerGroup,
|
|
6783
|
+
Rr as PaymentType,
|
|
6767
6784
|
ye as PreferencesStorageProvider,
|
|
6768
|
-
|
|
6785
|
+
ae as PriceAnalyze,
|
|
6769
6786
|
ys as PriceAnalyzeProvider,
|
|
6770
6787
|
Re as PriceCoefficient,
|
|
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
|
-
|
|
6777
|
-
|
|
6793
|
+
ie as PriceTemplateClient,
|
|
6794
|
+
fr as PriceTemplateICatalogableItem,
|
|
6778
6795
|
ke as PriceTemplateProduct,
|
|
6779
6796
|
Xt as PriceTemplateProvider,
|
|
6780
|
-
|
|
6797
|
+
oe as PricingRole,
|
|
6781
6798
|
Zt as PricingRoleProvider,
|
|
6782
6799
|
_e as PrimaryCatalogableItem,
|
|
6783
6800
|
I as Product,
|
|
@@ -6788,21 +6805,21 @@ export {
|
|
|
6788
6805
|
kt as ProductPriceHistory,
|
|
6789
6806
|
Ke as ProductUnit,
|
|
6790
6807
|
es as PropertiesProvider,
|
|
6791
|
-
|
|
6792
|
-
|
|
6808
|
+
ne as Property,
|
|
6809
|
+
wr 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
|
-
|
|
6800
|
-
|
|
6816
|
+
ue as Region,
|
|
6817
|
+
Pr as ResourceType,
|
|
6801
6818
|
O as SalesDirection,
|
|
6802
6819
|
Xr as SentryConfig,
|
|
6803
6820
|
sr as Seo,
|
|
6804
6821
|
Cs as SeoDataProvider,
|
|
6805
|
-
|
|
6822
|
+
Ar as SourcePrimaryInterest,
|
|
6806
6823
|
nt as StockCount,
|
|
6807
6824
|
rs as TemplateProductCategoryDataProvider,
|
|
6808
6825
|
zt as TemplatesListFilters,
|
|
@@ -6810,21 +6827,21 @@ export {
|
|
|
6810
6827
|
kr as UnitsHelper,
|
|
6811
6828
|
os as UnknownClientDataProvider,
|
|
6812
6829
|
lr as UpdatableNamedIdentity,
|
|
6813
|
-
|
|
6830
|
+
at as User,
|
|
6814
6831
|
Ps as UserAuthDataProvider,
|
|
6815
|
-
|
|
6832
|
+
yr as UserCommonInfo,
|
|
6816
6833
|
dt as UserDataProvider,
|
|
6817
6834
|
ut as UserPricingRole,
|
|
6818
6835
|
d as UserShortInfo,
|
|
6819
|
-
|
|
6836
|
+
Lt as UserTypeEnum,
|
|
6820
6837
|
cs as VersionConfig,
|
|
6821
|
-
|
|
6838
|
+
X as Warehouse,
|
|
6822
6839
|
Zr as WebSocketConfig,
|
|
6823
6840
|
Xe as findCatalogItemByIdRecursive,
|
|
6824
6841
|
Ze as flattenCatalogItems,
|
|
6825
6842
|
ps as pluralize,
|
|
6826
6843
|
be as useAuthStateStore,
|
|
6827
|
-
|
|
6844
|
+
L as useBaseConfigStateStore,
|
|
6828
6845
|
gs as useReferencesStore,
|
|
6829
6846
|
As as useUserStateStore
|
|
6830
6847
|
};
|