@snabcentr/common-lib 2.5.0 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +1 -1
- package/dist/release_notes.tmp +1 -1
- package/dist/sc-common-lib.js +195 -164
- 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/methods/flatten-catalog-items.d.ts.map +1 -1
- package/dist/src/clients/providers/client-data-provider.d.ts +7 -0
- package/dist/src/clients/providers/client-data-provider.d.ts.map +1 -1
- package/dist/src/data-table/interfaces/i-filter-item.d.ts +1 -1
- package/dist/src/data-table/interfaces/i-filter-item.d.ts.map +1 -1
- package/dist/src/orders/classes/order-editor-data.d.ts +5 -5
- package/dist/src/orders/classes/order-editor-data.d.ts.map +1 -1
- package/dist/src/orders/interfaces/i-client-order-create-data.d.ts +63 -0
- package/dist/src/orders/interfaces/i-client-order-create-data.d.ts.map +1 -0
- package/dist/src/orders/interfaces/i-order-editor-data.d.ts +2 -59
- package/dist/src/orders/interfaces/i-order-editor-data.d.ts.map +1 -1
- package/dist/src/orders/interfaces/index.d.ts +1 -0
- package/dist/src/orders/interfaces/index.d.ts.map +1 -1
- package/dist/src/orders/providers/orders-data-provider.d.ts +3 -2
- package/dist/src/orders/providers/orders-data-provider.d.ts.map +1 -1
- package/dist/src/user/classes/user-short-info.d.ts +1 -1
- package/dist/src/user/classes/user-short-info.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var t = (i, r, e) =>
|
|
1
|
+
var dr = Object.defineProperty;
|
|
2
|
+
var Lr = (i, r, e) => r in i ? dr(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
|
|
3
|
+
var t = (i, r, e) => Lr(i, typeof r != "symbol" ? r + "" : r, e);
|
|
4
4
|
import { jwtDecode as nr } from "jwt-decode";
|
|
5
|
-
import { merge as
|
|
6
|
-
import { objectToCamel as
|
|
5
|
+
import { merge as ue, isNil as A, isEmpty as X, noop as v, mapValues as or, isArray as H, every as xr, split as _r, isString as C, constant as Or, toUpper as qr, cloneDeep as Nr, toLower as Ur, isFunction as Fe, map as me, forEach as Fr, isDate as _e, omitBy as cr, isObject as lr } from "lodash-es";
|
|
6
|
+
import { objectToCamel as He, objectToSnake as Ee } from "ts-case-convert";
|
|
7
7
|
import { defineStore as W } from "pinia";
|
|
8
|
-
import { ref as y, markRaw as
|
|
9
|
-
import { isAfter as Ve, parseISO as a, startOfToday as Oe, format as
|
|
8
|
+
import { ref as y, markRaw as Hr, computed as P } from "vue";
|
|
9
|
+
import { isAfter as Ve, parseISO as a, startOfToday as Oe, format as I, addSeconds as jr, addBusinessDays as Gr, endOfTomorrow as Mr, startOfTomorrow as Br, endOfYesterday as zr, startOfYesterday as Wr, endOfToday as Jr, endOfDay as Er, startOfDay as Vr } from "date-fns";
|
|
10
10
|
import Kr, { CanceledError as Qr } from "axios";
|
|
11
11
|
class j {
|
|
12
12
|
/**
|
|
@@ -99,7 +99,7 @@ class j {
|
|
|
99
99
|
* @inheritDoc
|
|
100
100
|
*/
|
|
101
101
|
t(this, "email", "");
|
|
102
|
-
|
|
102
|
+
ue(this, r);
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Возвращает данные полезной нагрузки для указанного JWT-токена.
|
|
@@ -107,7 +107,7 @@ class j {
|
|
|
107
107
|
* @param jwtToken JWT-ключ доступа.
|
|
108
108
|
*/
|
|
109
109
|
static getJwtPayload(r) {
|
|
110
|
-
const e = nr(r), s = new j(
|
|
110
|
+
const e = nr(r), s = new j(He(e));
|
|
111
111
|
return s.resourceAccess = e.resource_access, s;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -143,7 +143,7 @@ class Bt extends j {
|
|
|
143
143
|
* @inheritDoc
|
|
144
144
|
*/
|
|
145
145
|
t(this, "address");
|
|
146
|
-
|
|
146
|
+
ue(this, e);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Возвращает данные полезной нагрузки для указанного JWT-токена.
|
|
@@ -151,7 +151,7 @@ class Bt extends j {
|
|
|
151
151
|
* @param jwtToken JWT-ключ доступа.
|
|
152
152
|
*/
|
|
153
153
|
static getJwtPayload(e) {
|
|
154
|
-
return new j(
|
|
154
|
+
return new j(He(nr(e)));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
class Yr {
|
|
@@ -355,11 +355,11 @@ const k = W("common.config", () => {
|
|
|
355
355
|
* @param appConfig Конфигурация приложения.
|
|
356
356
|
*/
|
|
357
357
|
setConfig: (s) => {
|
|
358
|
-
i.value =
|
|
358
|
+
i.value = ue(i.value, s);
|
|
359
359
|
}
|
|
360
360
|
};
|
|
361
361
|
});
|
|
362
|
-
class
|
|
362
|
+
class ve {
|
|
363
363
|
/**
|
|
364
364
|
* Возвращает актуальные и не просроченные данные из хранилища.
|
|
365
365
|
*
|
|
@@ -480,7 +480,7 @@ const V = W("common.auth_state_private", () => {
|
|
|
480
480
|
const i = y(
|
|
481
481
|
(() => {
|
|
482
482
|
var u;
|
|
483
|
-
const o =
|
|
483
|
+
const o = ve.getActualDataFromStorage(
|
|
484
484
|
"sc.token"
|
|
485
485
|
/* JwtToken */
|
|
486
486
|
);
|
|
@@ -489,7 +489,7 @@ const V = W("common.auth_state_private", () => {
|
|
|
489
489
|
const c = (u = k().config.devMode) == null ? void 0 : u.initAuthBearerToken;
|
|
490
490
|
return c ? Promise.resolve(c) : void 0;
|
|
491
491
|
})()
|
|
492
|
-
), r = y(void 0), e = y(void 0), s =
|
|
492
|
+
), r = y(void 0), e = y(void 0), s = Hr(/* @__PURE__ */ new Map());
|
|
493
493
|
function n() {
|
|
494
494
|
e.value = void 0, A(i.value) || i.value.then((o) => {
|
|
495
495
|
const c = j.getJwtPayload(o);
|
|
@@ -524,7 +524,7 @@ const V = W("common.auth_state_private", () => {
|
|
|
524
524
|
if (A(o.jwtToken) && !A(o.jwtTokenUpdater)) {
|
|
525
525
|
const c = o.jwtTokenUpdater();
|
|
526
526
|
o.jwtToken = c, c.then((u) => {
|
|
527
|
-
o.jwtToken = Promise.resolve(u),
|
|
527
|
+
o.jwtToken = Promise.resolve(u), ve.saveActualDataToStorage("sc.token", u, Ke(u)), o.recalculateUserPermissions();
|
|
528
528
|
}).catch(v);
|
|
529
529
|
}
|
|
530
530
|
return o.jwtToken;
|
|
@@ -534,11 +534,11 @@ const V = W("common.auth_state_private", () => {
|
|
|
534
534
|
}
|
|
535
535
|
function e(o) {
|
|
536
536
|
const c = V();
|
|
537
|
-
c.jwtToken = Promise.resolve(o),
|
|
537
|
+
c.jwtToken = Promise.resolve(o), ve.saveActualDataToStorage("sc.token", o, Ke(o)), c.recalculateUserPermissions();
|
|
538
538
|
}
|
|
539
539
|
function s() {
|
|
540
540
|
const o = V();
|
|
541
|
-
o.jwtToken = void 0, o.userPermissions = void 0,
|
|
541
|
+
o.jwtToken = void 0, o.userPermissions = void 0, ve.saveActualDataToStorage("sc.token", void 0);
|
|
542
542
|
}
|
|
543
543
|
function n(o) {
|
|
544
544
|
const c = V();
|
|
@@ -546,7 +546,7 @@ const V = W("common.auth_state_private", () => {
|
|
|
546
546
|
const f = j.getJwtPayload(m);
|
|
547
547
|
c.userPermissions = f.exp * 1e3 > Date.now() ? or(f.resourceAccess, (D) => (D == null ? void 0 : D.roles) ?? []) : void 0;
|
|
548
548
|
}).catch(v);
|
|
549
|
-
const u =
|
|
549
|
+
const u = H(o) ? o.join(" && ") : o;
|
|
550
550
|
if (c.userPermissionsComputedRefs.has(u))
|
|
551
551
|
return c.userPermissionsComputedRefs.get(u);
|
|
552
552
|
const h = P(() => {
|
|
@@ -556,9 +556,9 @@ const V = W("common.auth_state_private", () => {
|
|
|
556
556
|
if (D.length < 2)
|
|
557
557
|
return !1;
|
|
558
558
|
const [se, ie] = D, J = (E = V().userPermissions) == null ? void 0 : E[se];
|
|
559
|
-
return
|
|
559
|
+
return H(J) && J.includes(ie);
|
|
560
560
|
};
|
|
561
|
-
return
|
|
561
|
+
return H(o) ? xr(o, (f) => m(f)) : m(o);
|
|
562
562
|
});
|
|
563
563
|
return c.userPermissionsComputedRefs.set(u, h), h;
|
|
564
564
|
}
|
|
@@ -631,7 +631,7 @@ class b extends re {
|
|
|
631
631
|
this.name = (e == null ? void 0 : e.name) ?? "";
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
class
|
|
634
|
+
class pe extends b {
|
|
635
635
|
/**
|
|
636
636
|
* Инициализирует экземпляр класса {@link NamedIdentity}.
|
|
637
637
|
*
|
|
@@ -718,7 +718,7 @@ class st {
|
|
|
718
718
|
this.image = `${e ?? ""}${r.image}`, this.preview = `${e ?? ""}${r.preview}`, this.isDefault = r.isDefault;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
class pr extends
|
|
721
|
+
class pr extends pe {
|
|
722
722
|
/**
|
|
723
723
|
* Инициализирует экземпляр класса {@link CatalogableItem}.
|
|
724
724
|
*
|
|
@@ -916,9 +916,9 @@ class gr {
|
|
|
916
916
|
this.lat = (r == null ? void 0 : r.lat) ?? 0, this.long = (r == null ? void 0 : r.long) ?? 0;
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
|
-
class
|
|
919
|
+
class F extends w {
|
|
920
920
|
}
|
|
921
|
-
class
|
|
921
|
+
class fe extends w {
|
|
922
922
|
/**
|
|
923
923
|
* Инициализирует экземпляр класса {@link Warehouse}.
|
|
924
924
|
*
|
|
@@ -947,7 +947,7 @@ class me extends w {
|
|
|
947
947
|
* Координаты склада.
|
|
948
948
|
*/
|
|
949
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((n) => new
|
|
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((n) => new F(n))) ?? [], this.regions = (e == null ? void 0 : e.regions) ?? [], this.coordinates = new gr(e == null ? void 0 : e.coordinates);
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
class ot {
|
|
@@ -965,10 +965,10 @@ class ot {
|
|
|
965
965
|
* Количество остатков товара на складе.
|
|
966
966
|
*/
|
|
967
967
|
t(this, "count");
|
|
968
|
-
this.warehouse = new
|
|
968
|
+
this.warehouse = new fe(r == null ? void 0 : r.warehouse), this.count = (r == null ? void 0 : r.count) ?? 0;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
class
|
|
971
|
+
class O extends b {
|
|
972
972
|
/**
|
|
973
973
|
* Инициализирует экземпляр класса {@link Currency}.
|
|
974
974
|
*
|
|
@@ -1022,7 +1022,7 @@ class Qe extends b {
|
|
|
1022
1022
|
e && (this.slug = e.slug ?? "", this.description = e.description, this.isSquare = e.isSquare ?? !1, this.isLinear = e.isLinear ?? !1);
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
class
|
|
1025
|
+
class d extends it {
|
|
1026
1026
|
/**
|
|
1027
1027
|
* Инициализирует экземпляр класса {@link Product}.
|
|
1028
1028
|
*
|
|
@@ -1099,7 +1099,7 @@ class I extends it {
|
|
|
1099
1099
|
* Список коэффициентов цен на продукт.
|
|
1100
1100
|
*/
|
|
1101
1101
|
t(this, "priceCoefficients");
|
|
1102
|
-
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = e != null && e.unit ? new Qe(e.unit) : new Qe(), this.pack = e == null ? void 0 : e.pack, this.minCount = e == null ? void 0 : e.minCount, this.currency = e != null && e.currency ? new
|
|
1102
|
+
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = e != null && e.unit ? new Qe(e.unit) : new Qe(), this.pack = e == null ? void 0 : e.pack, this.minCount = e == null ? void 0 : e.minCount, this.currency = e != null && e.currency ? new O(e.currency) : new O(), this.cost = (e == null ? void 0 : e.cost) ?? 0, this.costRub = (e == null ? void 0 : e.costRub) ?? 0, this.costDate = C(e == null ? void 0 : e.costDate) ? a(e.costDate) : e == null ? void 0 : e.costDate, this.onOrder = (e == null ? void 0 : e.onOrder) ?? !1, this.stockCount = ((n = e == null ? void 0 : e.stockCount) == null ? void 0 : n.map((h) => new ot(h))) ?? [], this.type = "product";
|
|
1103
1103
|
const s = (e == null ? void 0 : e.category) ?? ((o = e == null ? void 0 : e.categories) == null ? void 0 : o.find((h) => h.isPrimary));
|
|
1104
1104
|
s && (this.category = new qe({ ...s, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((h) => new qe(h))), this.images = ((c = e == null ? void 0 : e.images) == null ? void 0 : c.map((h) => new st(h, k().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 Ge(h))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
|
|
1105
1105
|
}
|
|
@@ -1123,7 +1123,7 @@ class I extends it {
|
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
var Me = /* @__PURE__ */ ((i) => (i.Discount = "discount", i.PriceTemplate = "price_template", i.ClientPrice = "client_price", i.Product = "product", i))(Me || {});
|
|
1126
|
-
class G extends
|
|
1126
|
+
class G extends d {
|
|
1127
1127
|
/**
|
|
1128
1128
|
* Инициализирует экземпляр класса {@link ClientProduct}.
|
|
1129
1129
|
*
|
|
@@ -1162,7 +1162,7 @@ class G extends I {
|
|
|
1162
1162
|
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.costSource = (e == null ? void 0 : e.costSource) ?? Me.Product, this.discount = e != null && e.discount ? new nt(e.discount) : void 0, this.priceTemplate = e != null && e.priceTemplate ? new Q(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;
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
1165
|
-
class
|
|
1165
|
+
class ye extends qe {
|
|
1166
1166
|
/**
|
|
1167
1167
|
* Инициализирует экземпляр класса {@link BaseCategory}.
|
|
1168
1168
|
*
|
|
@@ -1261,7 +1261,7 @@ class mr extends re {
|
|
|
1261
1261
|
* @inheritDoc
|
|
1262
1262
|
*/
|
|
1263
1263
|
t(this, "originalId");
|
|
1264
|
-
this.product = new G(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new
|
|
1264
|
+
this.product = new G(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new ye(), this.currency = e.currency ? new O(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && Nr(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new L(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId;
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
1267
|
let ct = class extends mr {
|
|
@@ -1308,10 +1308,10 @@ let ct = class extends mr {
|
|
|
1308
1308
|
* @inheritDoc
|
|
1309
1309
|
*/
|
|
1310
1310
|
t(this, "currency");
|
|
1311
|
-
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 =
|
|
1311
|
+
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 = H(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, this.currency = new O(e.currency);
|
|
1312
1312
|
}
|
|
1313
1313
|
};
|
|
1314
|
-
class
|
|
1314
|
+
class we {
|
|
1315
1315
|
/**
|
|
1316
1316
|
* Инициализирует экземпляр класса {@link Cart}.
|
|
1317
1317
|
*
|
|
@@ -1423,7 +1423,7 @@ const R = class R {
|
|
|
1423
1423
|
* @param response Данные ответа на запрос.
|
|
1424
1424
|
*/
|
|
1425
1425
|
// eslint-disable-next-line class-methods-use-this
|
|
1426
|
-
t(this, "dataConverterResponseInterceptor", (r) => (r.data && (r.data =
|
|
1426
|
+
t(this, "dataConverterResponseInterceptor", (r) => (r.data && (r.data = He(r.data)), r));
|
|
1427
1427
|
this.errorResponseHandler = R.defaultErrorsResponseHandler, this.httpClient = Kr.create({
|
|
1428
1428
|
headers: {
|
|
1429
1429
|
Accept: "application/json",
|
|
@@ -1611,7 +1611,7 @@ class Wt extends p {
|
|
|
1611
1611
|
* @see /doc/api/internal#/Корзина/api_internal_client_cart_get
|
|
1612
1612
|
*/
|
|
1613
1613
|
getCart(r) {
|
|
1614
|
-
return this.get(`internal/clients/${r.id}/cart`, {}, (e) => new
|
|
1614
|
+
return this.get(`internal/clients/${r.id}/cart`, {}, (e) => new we(e.data));
|
|
1615
1615
|
}
|
|
1616
1616
|
/**
|
|
1617
1617
|
* Удаляет всё содержимое корзины.
|
|
@@ -1649,7 +1649,7 @@ class Wt extends p {
|
|
|
1649
1649
|
is_additional_sale: e.isAdditionalSale,
|
|
1650
1650
|
...e.configuratorParams
|
|
1651
1651
|
},
|
|
1652
|
-
(n) => new
|
|
1652
|
+
(n) => new we(n.data),
|
|
1653
1653
|
s
|
|
1654
1654
|
);
|
|
1655
1655
|
}
|
|
@@ -1679,7 +1679,7 @@ class Wt extends p {
|
|
|
1679
1679
|
is_additional_sale: e.isAdditionalSale,
|
|
1680
1680
|
...e.configuratorParams
|
|
1681
1681
|
},
|
|
1682
|
-
(n) => new
|
|
1682
|
+
(n) => new we(n.data),
|
|
1683
1683
|
s
|
|
1684
1684
|
);
|
|
1685
1685
|
}
|
|
@@ -1703,7 +1703,7 @@ class Wt extends p {
|
|
|
1703
1703
|
* @see /doc/api/internal#/Корзина/api_internal_client_cart_add_products_from_csv
|
|
1704
1704
|
*/
|
|
1705
1705
|
addCartItemFromCSV(r, e) {
|
|
1706
|
-
return this.post(`internal/clients/${r.id}/cart/add-products-from-csv`, e, (s) => new
|
|
1706
|
+
return this.post(`internal/clients/${r.id}/cart/add-products-from-csv`, e, (s) => new we(s.data));
|
|
1707
1707
|
}
|
|
1708
1708
|
/**
|
|
1709
1709
|
* Возвращает пример CSV файла для добавления продуктов в корзину.
|
|
@@ -1717,7 +1717,7 @@ class Wt extends p {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
}
|
|
1719
1719
|
var lt = /* @__PURE__ */ ((i) => (i.m2Cost = "m2Cost", i.percent = "percent", i.value = "value", i))(lt || {}), ut = /* @__PURE__ */ ((i) => (i.Unknown = "unknown", i.Bool = "bool", i.Integer = "integer", i.Float = "float", i.String = "string", i.Range = "range", i.Json = "json", i.Object = "object", i))(ut || {});
|
|
1720
|
-
class N extends
|
|
1720
|
+
class N extends ye {
|
|
1721
1721
|
/**
|
|
1722
1722
|
* Инициализирует экземпляр класса {@link Category}.
|
|
1723
1723
|
*
|
|
@@ -1734,7 +1734,7 @@ class N extends fe {
|
|
|
1734
1734
|
* Список продуктов категории.
|
|
1735
1735
|
*/
|
|
1736
1736
|
t(this, "products");
|
|
1737
|
-
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new N(o)), this.products = (n = e == null ? void 0 : e.products) == null ? void 0 : n.map((o) => new
|
|
1737
|
+
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new N(o)), this.products = (n = e == null ? void 0 : e.products) == null ? void 0 : n.map((o) => new d(o));
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
class fr {
|
|
@@ -1755,7 +1755,7 @@ class fr {
|
|
|
1755
1755
|
this.phone = /^\d+$/.test(r.phone ?? "") ? `+${r.phone}` : r.phone, this.email = r.email;
|
|
1756
1756
|
}
|
|
1757
1757
|
}
|
|
1758
|
-
class
|
|
1758
|
+
class q extends w {
|
|
1759
1759
|
}
|
|
1760
1760
|
class Be extends b {
|
|
1761
1761
|
/**
|
|
@@ -1785,7 +1785,7 @@ class Be extends b {
|
|
|
1785
1785
|
* @inheritDoc
|
|
1786
1786
|
*/
|
|
1787
1787
|
t(this, "isRegionalDirector");
|
|
1788
|
-
this.salesDirection = e != null && e.salesDirection ? new
|
|
1788
|
+
this.salesDirection = e != null && e.salesDirection ? new q(e.salesDirection) : new q(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new fr(e.contacts) : void 0, this.isDefault = (e == null ? void 0 : e.isDefault) ?? !1, this.isRegionalDirector = (e == null ? void 0 : e.isRegionalDirector) ?? !1;
|
|
1789
1789
|
}
|
|
1790
1790
|
}
|
|
1791
1791
|
class ze extends w {
|
|
@@ -1853,7 +1853,7 @@ class Pe extends Be {
|
|
|
1853
1853
|
this.isActive = (e == null ? void 0 : e.isActive) ?? !1, this.isSupervisor = (e == null ? void 0 : e.isSupervisor) ?? !1, this.canDoReclamations = (e == null ? void 0 : e.canDoReclamations) ?? !1, this.createdAt = e == null ? void 0 : e.createdAt, this.supervisorId = e == null ? void 0 : e.supervisorId, this.pricingRole = e != null && e.pricingRole ? new pt(e.pricingRole) : void 0, this.curatedDirections = ((s = e == null ? void 0 : e.curatedDirections) == null ? void 0 : s.map((n) => new ze(n))) ?? [];
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
|
-
class ht extends
|
|
1856
|
+
class ht extends ye {
|
|
1857
1857
|
/**
|
|
1858
1858
|
* Инициализирует экземпляр класса {@link BaseClientCategory}.
|
|
1859
1859
|
*
|
|
@@ -1884,7 +1884,7 @@ class ht extends fe {
|
|
|
1884
1884
|
this.isDisabled = (e == null ? void 0 : e.isDisabled) ?? !1, this.isRequired = (e == null ? void 0 : e.isRequired) ?? !1, this.isFavorite = (e == null ? void 0 : e.isFavorite) ?? !1, this.hidingComment = e == null ? void 0 : e.hidingComment, this.manager = e != null && e.manager ? new Pe(e.manager) : void 0;
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
|
-
class
|
|
1887
|
+
class Ce extends ht {
|
|
1888
1888
|
/**
|
|
1889
1889
|
* Инициализирует экземпляр класса {@link ClientCategory}.
|
|
1890
1890
|
*
|
|
@@ -1901,7 +1901,7 @@ class ve extends ht {
|
|
|
1901
1901
|
* Список продуктов категории.
|
|
1902
1902
|
*/
|
|
1903
1903
|
t(this, "products");
|
|
1904
|
-
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new
|
|
1904
|
+
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new Ce(o)), this.products = (n = e == null ? void 0 : e.products) == null ? void 0 : n.map((o) => new G(o));
|
|
1905
1905
|
}
|
|
1906
1906
|
}
|
|
1907
1907
|
class yr {
|
|
@@ -1934,7 +1934,7 @@ class ke extends yr {
|
|
|
1934
1934
|
* Базовые данные о продукте.
|
|
1935
1935
|
*/
|
|
1936
1936
|
t(this, "productCategory");
|
|
1937
|
-
this.productCategory = new
|
|
1937
|
+
this.productCategory = new ye(e == null ? void 0 : e.productCategory);
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
1940
|
class We extends b {
|
|
@@ -1962,7 +1962,7 @@ class We extends b {
|
|
|
1962
1962
|
}
|
|
1963
1963
|
class Z extends w {
|
|
1964
1964
|
}
|
|
1965
|
-
class
|
|
1965
|
+
class he extends w {
|
|
1966
1966
|
/**
|
|
1967
1967
|
* Инициализирует экземпляр класса {@link Region}.
|
|
1968
1968
|
*
|
|
@@ -1988,8 +1988,8 @@ class De extends w {
|
|
|
1988
1988
|
/**
|
|
1989
1989
|
* Данные о регионе, в котором расположен город.
|
|
1990
1990
|
*/
|
|
1991
|
-
t(this, "region", new
|
|
1992
|
-
e && (this.region = new
|
|
1991
|
+
t(this, "region", new he());
|
|
1992
|
+
e && (this.region = new he(e.region));
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
1995
|
class wr extends b {
|
|
@@ -2028,7 +2028,7 @@ class wr extends b {
|
|
|
2028
2028
|
* Признак активности учетной записи пользователя.
|
|
2029
2029
|
*/
|
|
2030
2030
|
t(this, "isActive");
|
|
2031
|
-
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
|
|
2031
|
+
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 q(e.salesDirection) : void 0, this.createdAt = C(e == null ? void 0 : e.createdAt) ? a(e.createdAt) : e == null ? void 0 : e.createdAt, this.lastLoginAt = C(e == null ? void 0 : e.lastLoginAt) ? a(e.lastLoginAt) : e == null ? void 0 : e.lastLoginAt, this.isActive = (e == null ? void 0 : e.isActive) ?? !1;
|
|
2032
2032
|
}
|
|
2033
2033
|
}
|
|
2034
2034
|
class te extends wr {
|
|
@@ -2077,7 +2077,7 @@ class te extends wr {
|
|
|
2077
2077
|
* @inheritDoc
|
|
2078
2078
|
*/
|
|
2079
2079
|
t(this, "curators");
|
|
2080
|
-
this.salesDirection = new
|
|
2080
|
+
this.salesDirection = new q(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 De(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 Be(o))) ?? [], this.curators = ((n = e == null ? void 0 : e.curators) == null ? void 0 : n.map((o) => new We(o))) ?? void 0;
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
2083
2083
|
class ne extends re {
|
|
@@ -2119,7 +2119,7 @@ class Ie extends yr {
|
|
|
2119
2119
|
* Базовые данные о продукте.
|
|
2120
2120
|
*/
|
|
2121
2121
|
t(this, "product");
|
|
2122
|
-
this.product = new
|
|
2122
|
+
this.product = new d(e == null ? void 0 : e.product);
|
|
2123
2123
|
}
|
|
2124
2124
|
}
|
|
2125
2125
|
class vr extends w {
|
|
@@ -2244,7 +2244,7 @@ class Jt {
|
|
|
2244
2244
|
return Object.keys(this).forEach((c) => {
|
|
2245
2245
|
const u = this[c];
|
|
2246
2246
|
// eslint-disable-next-line prettier/prettier
|
|
2247
|
-
A(u) || C(u) && u.trim().length === 0 ||
|
|
2247
|
+
A(u) || C(u) && u.trim().length === 0 || Fe(u.isNewRec) && u.isNewRec() || (r[c] = u);
|
|
2248
2248
|
}), !((e = r == null ? void 0 : r.createdAt) != null && e.from) && !((s = r == null ? void 0 : r.createdAt) != null && s.to) && delete r.createdAt, !((n = r == null ? void 0 : r.updatedAt) != null && n.from) && !((o = r == null ? void 0 : r.updatedAt) != null && o.to) && delete r.updatedAt, r;
|
|
2249
2249
|
}
|
|
2250
2250
|
}
|
|
@@ -2302,7 +2302,7 @@ class Ye {
|
|
|
2302
2302
|
* Минимальный коэффициент цены.
|
|
2303
2303
|
*/
|
|
2304
2304
|
t(this, "minCoefficient");
|
|
2305
|
-
this.role = new ce(r == null ? void 0 : r.role), this.category = new
|
|
2305
|
+
this.role = new ce(r == null ? void 0 : r.role), this.category = new ye(r == null ? void 0 : r.category), this.minCoefficient = new Re(r == null ? void 0 : r.minCoefficient);
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
2308
2308
|
class Et extends p {
|
|
@@ -2574,8 +2574,8 @@ class Kt extends p {
|
|
|
2574
2574
|
return this.post(
|
|
2575
2575
|
`/internal/clients/${r}/price/templates/${e}`,
|
|
2576
2576
|
s && {
|
|
2577
|
-
startAt: s.startAt &&
|
|
2578
|
-
endAt: s.endAt &&
|
|
2577
|
+
startAt: s.startAt && I(s.startAt, n),
|
|
2578
|
+
endAt: s.endAt && I(s.endAt, n)
|
|
2579
2579
|
},
|
|
2580
2580
|
(o) => new ne(o.data),
|
|
2581
2581
|
{},
|
|
@@ -2608,8 +2608,8 @@ class Kt extends p {
|
|
|
2608
2608
|
return this.patch(
|
|
2609
2609
|
`/internal/clients/${r}/price/templates/${e}/${s}`,
|
|
2610
2610
|
n && {
|
|
2611
|
-
startAt: n.startAt &&
|
|
2612
|
-
endAt: n.endAt &&
|
|
2611
|
+
startAt: n.startAt && I(n.startAt, o),
|
|
2612
|
+
endAt: n.endAt && I(n.endAt, o)
|
|
2613
2613
|
},
|
|
2614
2614
|
(c) => new ne(c.data)
|
|
2615
2615
|
);
|
|
@@ -2687,7 +2687,7 @@ class Qt extends p {
|
|
|
2687
2687
|
showHidden: s,
|
|
2688
2688
|
withPriceCoefficients: e
|
|
2689
2689
|
},
|
|
2690
|
-
(n) =>
|
|
2690
|
+
(n) => me(n.data, (o) => new d(o))
|
|
2691
2691
|
);
|
|
2692
2692
|
}
|
|
2693
2693
|
/**
|
|
@@ -2700,7 +2700,7 @@ class Qt extends p {
|
|
|
2700
2700
|
getCategoryProductsCoefficients(r) {
|
|
2701
2701
|
return this.get(`/internal/catalog/categories/${r}/products/coefficients`, {}, (e) => {
|
|
2702
2702
|
const { data: s } = e;
|
|
2703
|
-
return
|
|
2703
|
+
return Fr(s, (n) => n.map((o) => new Ge(o))), s;
|
|
2704
2704
|
});
|
|
2705
2705
|
}
|
|
2706
2706
|
/**
|
|
@@ -2729,7 +2729,7 @@ class Yt extends p {
|
|
|
2729
2729
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_products_get
|
|
2730
2730
|
*/
|
|
2731
2731
|
getProductData(r, e = !1) {
|
|
2732
|
-
return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (s) => new
|
|
2732
|
+
return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (s) => new d(s.data));
|
|
2733
2733
|
}
|
|
2734
2734
|
/**
|
|
2735
2735
|
* Возвращает публичные данные об указанном продукте.
|
|
@@ -2737,7 +2737,7 @@ class Yt extends p {
|
|
|
2737
2737
|
* @param productId Идентификатор продукта.
|
|
2738
2738
|
*/
|
|
2739
2739
|
getPublicProductData(r) {
|
|
2740
|
-
return this.get(`/public/catalog/products/${r}`, {}, (e) => new
|
|
2740
|
+
return this.get(`/public/catalog/products/${r}`, {}, (e) => new d(e.data));
|
|
2741
2741
|
}
|
|
2742
2742
|
/**
|
|
2743
2743
|
* Возвращает данные о коэффициентах цен для указанного продукта.
|
|
@@ -2750,7 +2750,7 @@ class Yt extends p {
|
|
|
2750
2750
|
return this.get(
|
|
2751
2751
|
`/internal/catalog/products/${r}/coefficients`,
|
|
2752
2752
|
{},
|
|
2753
|
-
(e) =>
|
|
2753
|
+
(e) => me(e.data, (s) => new Ge(s))
|
|
2754
2754
|
);
|
|
2755
2755
|
}
|
|
2756
2756
|
/**
|
|
@@ -2762,7 +2762,7 @@ class Yt extends p {
|
|
|
2762
2762
|
publicSimpleSearch(r, e = 10) {
|
|
2763
2763
|
return new Promise((s, n) => {
|
|
2764
2764
|
this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then((o) => {
|
|
2765
|
-
s(o.products.map((c) => new
|
|
2765
|
+
s(o.products.map((c) => new d(c)));
|
|
2766
2766
|
}).catch((o) => {
|
|
2767
2767
|
n(o);
|
|
2768
2768
|
});
|
|
@@ -2785,7 +2785,7 @@ class Xt extends p {
|
|
|
2785
2785
|
clientId: r,
|
|
2786
2786
|
showHidden: e
|
|
2787
2787
|
},
|
|
2788
|
-
(s) => s.data.map((n) => new
|
|
2788
|
+
(s) => s.data.map((n) => new Ce(n))
|
|
2789
2789
|
);
|
|
2790
2790
|
}
|
|
2791
2791
|
/**
|
|
@@ -2806,7 +2806,7 @@ class Xt extends p {
|
|
|
2806
2806
|
showHidden: s,
|
|
2807
2807
|
withNestedCategories: n
|
|
2808
2808
|
},
|
|
2809
|
-
(o) => new
|
|
2809
|
+
(o) => new Ce(o.data)
|
|
2810
2810
|
);
|
|
2811
2811
|
}
|
|
2812
2812
|
/**
|
|
@@ -2827,7 +2827,7 @@ class Xt extends p {
|
|
|
2827
2827
|
showHidden: n,
|
|
2828
2828
|
withPriceCoefficients: s
|
|
2829
2829
|
},
|
|
2830
|
-
(o) =>
|
|
2830
|
+
(o) => me(o.data, (c) => new G(c))
|
|
2831
2831
|
);
|
|
2832
2832
|
}
|
|
2833
2833
|
}
|
|
@@ -2884,7 +2884,7 @@ class Xe {
|
|
|
2884
2884
|
field: this.field,
|
|
2885
2885
|
op: this.op
|
|
2886
2886
|
};
|
|
2887
|
-
return r.value = _e(this.value) ?
|
|
2887
|
+
return r.value = _e(this.value) ? I(this.value, k().config.dateFormats.api) : this.value, r;
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
2890
|
class M {
|
|
@@ -2917,7 +2917,7 @@ class M {
|
|
|
2917
2917
|
toPrimitive() {
|
|
2918
2918
|
return {
|
|
2919
2919
|
groupOp: this.groupOp,
|
|
2920
|
-
filters: this.filters.map((r) => r instanceof Xe &&
|
|
2920
|
+
filters: this.filters.map((r) => r instanceof Xe && Fe(r.toPrimitive) ? r.toPrimitive() : r),
|
|
2921
2921
|
groups: this.groups.map((r) => r instanceof M ? r.toPrimitive() : r)
|
|
2922
2922
|
};
|
|
2923
2923
|
}
|
|
@@ -2940,7 +2940,7 @@ class Ae extends p {
|
|
|
2940
2940
|
page: (n == null ? void 0 : n.page) ?? 1,
|
|
2941
2941
|
perPage: (n == null ? void 0 : n.pageSize) ?? 10
|
|
2942
2942
|
};
|
|
2943
|
-
return e && (m.filters = JSON.stringify((e instanceof M ? e : new M(e)).toPrimitive())), X(s) || (m.sort =
|
|
2943
|
+
return e && (m.filters = JSON.stringify((e instanceof M ? e : new M(e)).toPrimitive())), X(s) || (m.sort = H(s) ? s : [s]), o && (m = { ...m, ...o }), this.get(r, m, c, u, h);
|
|
2944
2944
|
}
|
|
2945
2945
|
}
|
|
2946
2946
|
class es extends Ae {
|
|
@@ -3657,7 +3657,7 @@ class ss extends p {
|
|
|
3657
3657
|
showHidden: n,
|
|
3658
3658
|
withPriceCoefficients: s
|
|
3659
3659
|
},
|
|
3660
|
-
(o) =>
|
|
3660
|
+
(o) => me(o.data, (c) => new d(c))
|
|
3661
3661
|
);
|
|
3662
3662
|
}
|
|
3663
3663
|
}
|
|
@@ -3775,8 +3775,8 @@ class Ne extends re {
|
|
|
3775
3775
|
/**
|
|
3776
3776
|
* Данные о валюте.
|
|
3777
3777
|
*/
|
|
3778
|
-
t(this, "currency", new
|
|
3779
|
-
e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new
|
|
3778
|
+
t(this, "currency", new O());
|
|
3779
|
+
e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new O(e.currency));
|
|
3780
3780
|
}
|
|
3781
3781
|
}
|
|
3782
3782
|
class Ue extends b {
|
|
@@ -3989,7 +3989,7 @@ class Ct extends Tr {
|
|
|
3989
3989
|
e && (this.registrationCountry = new Z(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
3990
3990
|
}
|
|
3991
3991
|
}
|
|
3992
|
-
class
|
|
3992
|
+
class ae {
|
|
3993
3993
|
/**
|
|
3994
3994
|
* Инициализирует и возвращает экземпляр класса с данными о контрагенте.
|
|
3995
3995
|
*
|
|
@@ -4008,7 +4008,7 @@ class Ce {
|
|
|
4008
4008
|
}
|
|
4009
4009
|
}
|
|
4010
4010
|
}
|
|
4011
|
-
class
|
|
4011
|
+
class de extends re {
|
|
4012
4012
|
/**
|
|
4013
4013
|
* Инициализирует экземпляр класса {@link ContactRelation}.
|
|
4014
4014
|
*
|
|
@@ -4048,10 +4048,10 @@ class at extends z {
|
|
|
4048
4048
|
*/
|
|
4049
4049
|
addresses: []
|
|
4050
4050
|
});
|
|
4051
|
-
e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((s) => new
|
|
4051
|
+
e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((s) => new de(s))), e.relations.clients && (this.relations.clients = e.relations.clients.map((s) => new de(s))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((s) => new de(s))));
|
|
4052
4052
|
}
|
|
4053
4053
|
}
|
|
4054
|
-
class
|
|
4054
|
+
class le extends tt {
|
|
4055
4055
|
/**
|
|
4056
4056
|
* Инициализирует экземпляр класса {@link DeliveryAddress}.
|
|
4057
4057
|
*
|
|
@@ -4141,7 +4141,7 @@ class rr extends te {
|
|
|
4141
4141
|
* @inheritDoc
|
|
4142
4142
|
*/
|
|
4143
4143
|
t(this, "extraData");
|
|
4144
|
-
this.contragents = ((s = e == null ? void 0 : e.contragents) == null ? void 0 : s.map((u) =>
|
|
4144
|
+
this.contragents = ((s = e == null ? void 0 : e.contragents) == null ? void 0 : s.map((u) => ae.createInstance(u))) ?? [], this.partnerGroups = ((n = e == null ? void 0 : e.partnerGroups) == null ? void 0 : n.map((u) => new ee(u))) ?? [], this.contacts = ((o = e == null ? void 0 : e.contacts) == null ? void 0 : o.map((u) => new z(u))) ?? [], this.deliveryAddresses = ((c = e == null ? void 0 : e.deliveryAddresses) == null ? void 0 : c.map((u) => new le(u))) ?? [], this.channelPrimaryInterest = new Cr(e == null ? void 0 : e.channelPrimaryInterest), this.sourcePrimaryInterest = new Dr(e == null ? void 0 : e.sourcePrimaryInterest), this.preferredDeliveryType = new F(e == null ? void 0 : e.preferredDeliveryType), this.primaryDemand = e == null ? void 0 : e.primaryDemand, this.preferredWarehouse = e != null && e.preferredWarehouse ? new fe(e.preferredWarehouse) : void 0, this.extraData = (e == null ? void 0 : e.extraData) ?? {};
|
|
4145
4145
|
}
|
|
4146
4146
|
}
|
|
4147
4147
|
class br {
|
|
@@ -4154,7 +4154,7 @@ class br {
|
|
|
4154
4154
|
return Object.keys(this).forEach((e) => {
|
|
4155
4155
|
const s = this[e];
|
|
4156
4156
|
A(s) || // eslint-disable-next-line prettier/prettier,lodash/prefer-lodash-method
|
|
4157
|
-
C(s) && s.trim().length === 0 ||
|
|
4157
|
+
C(s) && s.trim().length === 0 || Fe(s.isNewRec) && s.isNewRec() || (r[e] = s);
|
|
4158
4158
|
}), r;
|
|
4159
4159
|
}
|
|
4160
4160
|
}
|
|
@@ -4259,7 +4259,7 @@ class os extends br {
|
|
|
4259
4259
|
* @inheritDoc
|
|
4260
4260
|
*/
|
|
4261
4261
|
t(this, "lastOrder");
|
|
4262
|
-
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 De(D)), this.region = new
|
|
4262
|
+
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 De(D)), this.region = new he(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 = ((n = e == null ? void 0 : e.managers) == null ? void 0 : n.map((D) => new Pe(D))) ?? [], this.curators = ((o = e == null ? void 0 : e.curators) == null ? void 0 : o.map((D) => new We(D))) ?? [], this.salesDirections = (c = e == null ? void 0 : e.salesDirections) == null ? void 0 : c.map((D) => new q(D)), this.contragentInn = e == null ? void 0 : e.contragentInn, this.contragentType = new B(e == null ? void 0 : e.contragentType), this.preferredDeliveryType = e != null && e.preferredDeliveryType ? new F(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 Ue(e == null ? void 0 : e.contact), this.lastOrder = {
|
|
4263
4263
|
createdAt: new S((h = e == null ? void 0 : e.lastOrder) == null ? void 0 : h.createdAt),
|
|
4264
4264
|
creator: (m = e == null ? void 0 : e.lastOrder) == null ? void 0 : m.creator,
|
|
4265
4265
|
isApproved: (f = e == null ? void 0 : e.lastOrder) == null ? void 0 : f.isApproved
|
|
@@ -4274,7 +4274,7 @@ class os extends br {
|
|
|
4274
4274
|
this.cities = [];
|
|
4275
4275
|
break;
|
|
4276
4276
|
case "region":
|
|
4277
|
-
this.region = new
|
|
4277
|
+
this.region = new he();
|
|
4278
4278
|
break;
|
|
4279
4279
|
case "isActive":
|
|
4280
4280
|
this.isActive = !0;
|
|
@@ -4301,7 +4301,7 @@ class os extends br {
|
|
|
4301
4301
|
this.contragentType = new B();
|
|
4302
4302
|
break;
|
|
4303
4303
|
case "preferredDeliveryType":
|
|
4304
|
-
this.preferredDeliveryType = new
|
|
4304
|
+
this.preferredDeliveryType = new F();
|
|
4305
4305
|
break;
|
|
4306
4306
|
case "partnerGroups":
|
|
4307
4307
|
this.partnerGroups = [];
|
|
@@ -4380,7 +4380,7 @@ class Rt extends b {
|
|
|
4380
4380
|
* @inheritDoc
|
|
4381
4381
|
*/
|
|
4382
4382
|
t(this, "curators");
|
|
4383
|
-
this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new z(u))) ?? void 0, this.lastOrder = e.lastOrder ? new Sr(e.lastOrder) : void 0, this.partnerGroups = ((n = e.partnerGroups) == null ? void 0 : n.map((u) => new ee(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new
|
|
4383
|
+
this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new z(u))) ?? void 0, this.lastOrder = e.lastOrder ? new Sr(e.lastOrder) : void 0, this.partnerGroups = ((n = e.partnerGroups) == null ? void 0 : n.map((u) => new ee(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new F(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new q(e.salesDirection) : void 0, this.managers = ((o = e.managers) == null ? void 0 : o.map((u) => new Be(u))) ?? void 0, this.curators = ((c = e.curators) == null ? void 0 : c.map((u) => new We(u))) ?? void 0;
|
|
4384
4384
|
}
|
|
4385
4385
|
}
|
|
4386
4386
|
class Pt {
|
|
@@ -4450,7 +4450,7 @@ class ls {
|
|
|
4450
4450
|
this.field = (r == null ? void 0 : r.field) ?? "", this.direction = (r == null ? void 0 : r.direction) ?? "asc";
|
|
4451
4451
|
}
|
|
4452
4452
|
}
|
|
4453
|
-
class
|
|
4453
|
+
class _ extends Ae {
|
|
4454
4454
|
/**
|
|
4455
4455
|
* Преобразует данные о клиенте в данные требуемые для запроса.
|
|
4456
4456
|
*
|
|
@@ -4674,7 +4674,7 @@ class x extends Ae {
|
|
|
4674
4674
|
* @see /doc/api/internal#/Клиенты/api_internal_client_create
|
|
4675
4675
|
*/
|
|
4676
4676
|
createClientCommonData(r, e = {}) {
|
|
4677
|
-
return this.post("/internal/clients",
|
|
4677
|
+
return this.post("/internal/clients", _.transformClientDataToRequest(r), (s) => new rr(s.data), e);
|
|
4678
4678
|
}
|
|
4679
4679
|
/**
|
|
4680
4680
|
* Обновляет данные указанного клиента.
|
|
@@ -4684,7 +4684,7 @@ class x extends Ae {
|
|
|
4684
4684
|
* @see /doc/api/internal#/Клиенты/api_internal_client_change
|
|
4685
4685
|
*/
|
|
4686
4686
|
updateClientCommonData(r, e = {}) {
|
|
4687
|
-
return this.patch(`/internal/clients/${r.id}`,
|
|
4687
|
+
return this.patch(`/internal/clients/${r.id}`, _.transformClientDataToRequest(r), void 0, e);
|
|
4688
4688
|
}
|
|
4689
4689
|
/**
|
|
4690
4690
|
* Обновляет данные "Не беспокоить" указанного клиента.
|
|
@@ -4813,8 +4813,8 @@ class x extends Ae {
|
|
|
4813
4813
|
createContragentClientData(r, e, s = {}) {
|
|
4814
4814
|
return this.post(
|
|
4815
4815
|
`/internal/clients/${r}/contragents`,
|
|
4816
|
-
|
|
4817
|
-
(n) =>
|
|
4816
|
+
_.transformContragentClientDataToRequest(e),
|
|
4817
|
+
(n) => ae.createInstance(n.data),
|
|
4818
4818
|
s
|
|
4819
4819
|
);
|
|
4820
4820
|
}
|
|
@@ -4829,8 +4829,8 @@ class x extends Ae {
|
|
|
4829
4829
|
updateContragentClientData(r, e, s = {}) {
|
|
4830
4830
|
return this.patch(
|
|
4831
4831
|
`/internal/clients/${r}/contragents/${e.id}`,
|
|
4832
|
-
|
|
4833
|
-
(n) =>
|
|
4832
|
+
_.transformContragentClientDataToRequest(e),
|
|
4833
|
+
(n) => ae.createInstance(n.data),
|
|
4834
4834
|
s
|
|
4835
4835
|
);
|
|
4836
4836
|
}
|
|
@@ -4844,6 +4844,19 @@ class x extends Ae {
|
|
|
4844
4844
|
deleteClientContragent(r, e) {
|
|
4845
4845
|
return this.delete(`/internal/clients/${r}/contragents/${e.id}`);
|
|
4846
4846
|
}
|
|
4847
|
+
/**
|
|
4848
|
+
* Возвращает список адресов доставки клиента.
|
|
4849
|
+
*
|
|
4850
|
+
* @param clientId Идентификатор клиента, для которого необходимо получить адреса доставки.
|
|
4851
|
+
* @see /doc/api/internal#/operations/api_internal_client_delivery_address_get_list
|
|
4852
|
+
*/
|
|
4853
|
+
getClientDeliveryAddresses(r) {
|
|
4854
|
+
return this.get(
|
|
4855
|
+
`/internal/clients/${r}/delivery-addresses`,
|
|
4856
|
+
{},
|
|
4857
|
+
(e) => e.data.map((s) => new le(s))
|
|
4858
|
+
);
|
|
4859
|
+
}
|
|
4847
4860
|
/**
|
|
4848
4861
|
* Создаёт новую запись об адресе доставки клиента.
|
|
4849
4862
|
*
|
|
@@ -4855,8 +4868,8 @@ class x extends Ae {
|
|
|
4855
4868
|
createClientDeliveryAddress(r, e, s = {}) {
|
|
4856
4869
|
return this.post(
|
|
4857
4870
|
`/internal/clients/${r}/delivery-addresses`,
|
|
4858
|
-
|
|
4859
|
-
(n) => new
|
|
4871
|
+
_.transformClientDeliveryAddressToRequest(e),
|
|
4872
|
+
(n) => new le(n.data),
|
|
4860
4873
|
s
|
|
4861
4874
|
);
|
|
4862
4875
|
}
|
|
@@ -4871,8 +4884,8 @@ class x extends Ae {
|
|
|
4871
4884
|
updateClientDeliveryAddress(r, e, s = {}) {
|
|
4872
4885
|
return this.patch(
|
|
4873
4886
|
`/internal/clients/${r}/delivery-addresses/${e.id}`,
|
|
4874
|
-
|
|
4875
|
-
(n) => new
|
|
4887
|
+
_.transformClientDeliveryAddressToRequest(e),
|
|
4888
|
+
(n) => new le(n.data),
|
|
4876
4889
|
s
|
|
4877
4890
|
);
|
|
4878
4891
|
}
|
|
@@ -4898,7 +4911,7 @@ class x extends Ae {
|
|
|
4898
4911
|
createContragentBankAccount(r, e, s, n = {}) {
|
|
4899
4912
|
return this.post(
|
|
4900
4913
|
`/internal/clients/${r}/contragents/${e}/bank-accounts`,
|
|
4901
|
-
|
|
4914
|
+
_.transformClientContragentBankAccountToRequest(s),
|
|
4902
4915
|
(o) => new Ne(o.data),
|
|
4903
4916
|
n
|
|
4904
4917
|
);
|
|
@@ -4915,7 +4928,7 @@ class x extends Ae {
|
|
|
4915
4928
|
updateContragentBankAccount(r, e, s, n = {}) {
|
|
4916
4929
|
return this.patch(
|
|
4917
4930
|
`/internal/clients/${r}/contragents/${e}/bank-accounts/${s.id}`,
|
|
4918
|
-
|
|
4931
|
+
_.transformClientContragentBankAccountToRequest(s),
|
|
4919
4932
|
(o) => new Ne(o.data),
|
|
4920
4933
|
n
|
|
4921
4934
|
);
|
|
@@ -5196,7 +5209,7 @@ const Y = class Y extends p {
|
|
|
5196
5209
|
* Кэш результатов запросов.
|
|
5197
5210
|
*/
|
|
5198
5211
|
t(Y, "responseDataCache", /* @__PURE__ */ new Map());
|
|
5199
|
-
let
|
|
5212
|
+
let ge = Y;
|
|
5200
5213
|
class us extends p {
|
|
5201
5214
|
/**
|
|
5202
5215
|
* Выполняет проверку занят ли указанный номер телефона.
|
|
@@ -5264,7 +5277,7 @@ class hs extends p {
|
|
|
5264
5277
|
const o = this.get(
|
|
5265
5278
|
`internal/catalog/categories/${r.id}/configurators/${(c = r.properties) == null ? void 0 : c.configurator}/product`,
|
|
5266
5279
|
{ params: s, client_id: e },
|
|
5267
|
-
(u) => new
|
|
5280
|
+
(u) => new d(u.data)
|
|
5268
5281
|
);
|
|
5269
5282
|
return o.catch((u) => {
|
|
5270
5283
|
this.errorResponseHandler(u, n);
|
|
@@ -5388,12 +5401,12 @@ class fs {
|
|
|
5388
5401
|
return r.id === 0 && r.guid === "-undefined-";
|
|
5389
5402
|
}
|
|
5390
5403
|
}
|
|
5391
|
-
class At extends
|
|
5404
|
+
class At extends ge {
|
|
5392
5405
|
/**
|
|
5393
5406
|
* Возвращает {@link Promise} для получения справочника списка менеджеров.
|
|
5394
5407
|
*/
|
|
5395
5408
|
async getManagers() {
|
|
5396
|
-
const r = "/internal/managers", e =
|
|
5409
|
+
const r = "/internal/managers", e = ge.getCachedResponse(r);
|
|
5397
5410
|
if (e)
|
|
5398
5411
|
return e;
|
|
5399
5412
|
const n = (await this.get(r)).data.map((o) => je.instanceInitializer(Pe, o));
|
|
@@ -5465,7 +5478,7 @@ class ys {
|
|
|
5465
5478
|
*/
|
|
5466
5479
|
t(this, "isAdditionalSale");
|
|
5467
5480
|
var e, s, n;
|
|
5468
|
-
this.paymentType =
|
|
5481
|
+
this.paymentType = r == null ? void 0 : r.payment.type, this.deliveryType = r == null ? void 0 : r.delivery.type, this.contragentId = (e = r == null ? void 0 : r.contragent) == null ? void 0 : e.id, this.deliveryDate = r != null && r.delivery.date ? new Date(r.delivery.date) : void 0, this.addressId = (s = r == null ? void 0 : r.delivery.address) == null ? void 0 : s.id, this.warehouseId = (n = r == null ? void 0 : r.delivery.warehouse) == null ? void 0 : n.id, this.comment = r == null ? void 0 : r.comment, this.barcode = r == null ? void 0 : r.barcode, this.operatorsComment = r == null ? void 0 : r.operatorsComment, this.operatorsForWarehouseComment = r == null ? void 0 : r.operatorsForWarehouseComment, this.isAllowProcessingWithoutPayment = r == null ? void 0 : r.isAllowProcessingWithoutPayment;
|
|
5469
5482
|
}
|
|
5470
5483
|
}
|
|
5471
5484
|
class Ir extends Sr {
|
|
@@ -5532,13 +5545,13 @@ class Ir extends Sr {
|
|
|
5532
5545
|
}, this.delivery = {
|
|
5533
5546
|
type: ((c = e == null ? void 0 : e.delivery) == null ? void 0 : c.type) ?? -1,
|
|
5534
5547
|
date: C((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? a(e.delivery.date) : ((h = e == null ? void 0 : e.delivery) == null ? void 0 : h.date) ?? /* @__PURE__ */ new Date(),
|
|
5535
|
-
address: (m = e == null ? void 0 : e.delivery) != null && m.address ? new
|
|
5536
|
-
warehouse: (f = e == null ? void 0 : e.delivery) != null && f.warehouse ? new
|
|
5537
|
-
}, this.attachedUser = e != null && e.attachedUser ? new L(e == null ? void 0 : e.attachedUser) : void 0, this.status = new $e(e == null ? void 0 : e.status), this.statusDetail = e != null && e.statusDetail ? new w(e.statusDetail) : void 0, this.salesDirection = new
|
|
5548
|
+
address: (m = e == null ? void 0 : e.delivery) != null && m.address ? new le(e.delivery.address) : void 0,
|
|
5549
|
+
warehouse: (f = e == null ? void 0 : e.delivery) != null && f.warehouse ? new fe(e.delivery.warehouse) : void 0
|
|
5550
|
+
}, this.attachedUser = e != null && e.attachedUser ? new L(e == null ? void 0 : e.attachedUser) : void 0, this.status = new $e(e == null ? void 0 : e.status), this.statusDetail = e != null && e.statusDetail ? new w(e.statusDetail) : void 0, this.salesDirection = new q(e == null ? void 0 : e.salesDirection), this.attachedAt = C(e == null ? void 0 : e.attachedAt) ? a(e.attachedAt) : e == null ? void 0 : e.attachedAt, 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;
|
|
5538
5551
|
}
|
|
5539
5552
|
}
|
|
5540
5553
|
var Tt = /* @__PURE__ */ ((i) => (i.New = "new", i.Processing = "processing", i.AwaitingSupplyProducts = "awaiting_supply_products", i.InvoiceIssued = "invoice_issued", i.ProcessingOnStock = "processing_on_stock", i.Finished = "finished", i.OrderUpdated = "order_updated", i.Canceled = "canceled", i.Error = "error", i))(Tt || {});
|
|
5541
|
-
class T extends
|
|
5554
|
+
class T extends ge {
|
|
5542
5555
|
/**
|
|
5543
5556
|
* Возвращает {@link Promise} для получения данных указанного справочника.
|
|
5544
5557
|
*
|
|
@@ -5572,7 +5585,7 @@ class T extends he {
|
|
|
5572
5585
|
* Возвращает {@link Promise} для получения справочника списка валют.
|
|
5573
5586
|
*/
|
|
5574
5587
|
getCurrency() {
|
|
5575
|
-
return this.getTypedDataArrayRequester(
|
|
5588
|
+
return this.getTypedDataArrayRequester(O, "/public/references/currency", !0);
|
|
5576
5589
|
}
|
|
5577
5590
|
/**
|
|
5578
5591
|
* Возвращает {@link Promise} для получения справочника данных
|
|
@@ -5621,7 +5634,7 @@ class T extends he {
|
|
|
5621
5634
|
* Возвращает {@link Promise} для получения справочника данных направлений продаж.
|
|
5622
5635
|
*/
|
|
5623
5636
|
getSalesDirections() {
|
|
5624
|
-
return this.getTypedDataArrayRequester(
|
|
5637
|
+
return this.getTypedDataArrayRequester(q, "/public/references/sales-direction", !0);
|
|
5625
5638
|
}
|
|
5626
5639
|
/**
|
|
5627
5640
|
* Возвращает {@link Promise} для получения справочника данных об источнике первичного интереса.
|
|
@@ -5643,7 +5656,7 @@ class T extends he {
|
|
|
5643
5656
|
* @param term Терм поиска.
|
|
5644
5657
|
*/
|
|
5645
5658
|
searchRegion(r) {
|
|
5646
|
-
return this.getTypedDataArrayRequester(
|
|
5659
|
+
return this.getTypedDataArrayRequester(he, `/internal/references/region-with-country/search?term=${r}`);
|
|
5647
5660
|
}
|
|
5648
5661
|
/**
|
|
5649
5662
|
* Выполняет поиск данных о странах по терму в названии.
|
|
@@ -5657,13 +5670,13 @@ class T extends he {
|
|
|
5657
5670
|
* Возвращает {@link Promise} для получения справочника типов доставки.
|
|
5658
5671
|
*/
|
|
5659
5672
|
getDeliveryTypes() {
|
|
5660
|
-
return this.getTypedDataArrayRequester(
|
|
5673
|
+
return this.getTypedDataArrayRequester(F, "/internal/references/delivery-type", !0);
|
|
5661
5674
|
}
|
|
5662
5675
|
/**
|
|
5663
5676
|
* Возвращает {@link Promise} для получения справочника складов.
|
|
5664
5677
|
*/
|
|
5665
5678
|
getWarehouses() {
|
|
5666
|
-
return this.getTypedDataArrayRequester(
|
|
5679
|
+
return this.getTypedDataArrayRequester(fe, "/public/references/warehouse", !0);
|
|
5667
5680
|
}
|
|
5668
5681
|
/**
|
|
5669
5682
|
* Возвращает {@link Promise} для получения справочника типов свойств.
|
|
@@ -6032,7 +6045,7 @@ class vs extends br {
|
|
|
6032
6045
|
* @inheritDoc
|
|
6033
6046
|
*/
|
|
6034
6047
|
t(this, "onlyMyRegions");
|
|
6035
|
-
this.attachedOperators = (s = e == null ? void 0 : e.attachedOperators) == null ? void 0 : s.map((u) => new ar(u)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.client = e != null && e.client ? new te(e.client) : void 0, 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 L(e.creator) : void 0, this.deliveryDate = new S(e == null ? void 0 : e.deliveryDate), this.deliveryAddressSearch = e == null ? void 0 : e.deliveryAddressSearch, this.clientCities = (n = e == null ? void 0 : e.clientCities) == null ? void 0 : n.map((u) => new De(u)), this.id = e == null ? void 0 : e.id, this.isApproved = e == null ? void 0 : e.isApproved, this.isNotInStock = e == null ? void 0 : e.isNotInStock, this.isOnOrder = e == null ? void 0 : e.isOnOrder, this.isLargeOrder = e == null ? void 0 : e.isLargeOrder, this.attachedAt = new S(e == null ? void 0 : e.attachedAt), this.salesDirections = (o = e == null ? void 0 : e.salesDirections) == null ? void 0 : o.map((u) => new
|
|
6048
|
+
this.attachedOperators = (s = e == null ? void 0 : e.attachedOperators) == null ? void 0 : s.map((u) => new ar(u)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.client = e != null && e.client ? new te(e.client) : void 0, 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 L(e.creator) : void 0, this.deliveryDate = new S(e == null ? void 0 : e.deliveryDate), this.deliveryAddressSearch = e == null ? void 0 : e.deliveryAddressSearch, this.clientCities = (n = e == null ? void 0 : e.clientCities) == null ? void 0 : n.map((u) => new De(u)), this.id = e == null ? void 0 : e.id, this.isApproved = e == null ? void 0 : e.isApproved, this.isNotInStock = e == null ? void 0 : e.isNotInStock, this.isOnOrder = e == null ? void 0 : e.isOnOrder, this.isLargeOrder = e == null ? void 0 : e.isLargeOrder, this.attachedAt = new S(e == null ? void 0 : e.attachedAt), this.salesDirections = (o = e == null ? void 0 : e.salesDirections) == null ? void 0 : o.map((u) => new q(u)), this.status = e == null ? void 0 : e.status, this.statusDetail = e == null ? void 0 : e.statusDetail, this.deliveryType = e != null && e.deliveryType ? new F(e.deliveryType) : void 0, this.paymentType = e != null && e.paymentType ? new Rr(e.paymentType) : void 0, this.warehouses = (c = e == null ? void 0 : e.warehouses) == null ? void 0 : c.map((u) => new fe(u)), this.isToProcess = e == null ? void 0 : e.isToProcess;
|
|
6036
6049
|
}
|
|
6037
6050
|
/**
|
|
6038
6051
|
* @inheritDoc
|
|
@@ -6049,7 +6062,7 @@ class vs extends br {
|
|
|
6049
6062
|
this.deliveryDate.from = null, this.deliveryDate.to = null;
|
|
6050
6063
|
break;
|
|
6051
6064
|
case "deliveryType":
|
|
6052
|
-
this.deliveryType = new
|
|
6065
|
+
this.deliveryType = new F();
|
|
6053
6066
|
break;
|
|
6054
6067
|
case "clientCities":
|
|
6055
6068
|
this.clientCities = [];
|
|
@@ -6129,10 +6142,10 @@ class bt extends mr {
|
|
|
6129
6142
|
* @inheritDoc
|
|
6130
6143
|
*/
|
|
6131
6144
|
t(this, "currency");
|
|
6132
|
-
this.product = new G(e.product), this.currency = new
|
|
6145
|
+
this.product = new G(e.product), this.currency = new O(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;
|
|
6133
6146
|
}
|
|
6134
6147
|
}
|
|
6135
|
-
class
|
|
6148
|
+
class x extends Ir {
|
|
6136
6149
|
/**
|
|
6137
6150
|
* Инициализирует экземпляр класса {@link Order}.
|
|
6138
6151
|
*
|
|
@@ -6189,7 +6202,7 @@ class d extends Ir {
|
|
|
6189
6202
|
* @inheritDoc
|
|
6190
6203
|
*/
|
|
6191
6204
|
t(this, "operatorsForWarehouseComment");
|
|
6192
|
-
this.products = (e.products ?? []).map((n) => new bt(n)), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ?
|
|
6205
|
+
this.products = (e.products ?? []).map((n) => new bt(n)), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ? ae.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new w(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment, this.nextStatuses = (s = e.nextStatuses) == null ? void 0 : s.map((n) => new $e(n)), this.actions = e.actions, this.operatorsComment = e.operatorsComment, this.operatorsForWarehouseComment = e.operatorsForWarehouseComment;
|
|
6193
6206
|
}
|
|
6194
6207
|
}
|
|
6195
6208
|
class St {
|
|
@@ -6278,7 +6291,7 @@ class Cs extends Ae {
|
|
|
6278
6291
|
* @see /doc/api/internal#/Заказы/api_internal_orders_get
|
|
6279
6292
|
*/
|
|
6280
6293
|
getOrder(r) {
|
|
6281
|
-
return this.get(`/internal/orders/${r}`, {}, (e) => new
|
|
6294
|
+
return this.get(`/internal/orders/${r}`, {}, (e) => new x(e.data));
|
|
6282
6295
|
}
|
|
6283
6296
|
/**
|
|
6284
6297
|
* Создаёт новый заказ клиента из содержимого корзины текущего пользователя.
|
|
@@ -6292,7 +6305,16 @@ class Cs extends Ae {
|
|
|
6292
6305
|
* @see /doc/api/internal#/operations/api_internal_client_orders_create
|
|
6293
6306
|
*/
|
|
6294
6307
|
createClientOrder(r, e, s, n = {}) {
|
|
6295
|
-
|
|
6308
|
+
const o = k().config.dateFormats.api;
|
|
6309
|
+
return this.post(
|
|
6310
|
+
`/internal/clients/${r}/orders/${e}`,
|
|
6311
|
+
{
|
|
6312
|
+
...s,
|
|
6313
|
+
deliveryDate: I(s.deliveryDate, o)
|
|
6314
|
+
},
|
|
6315
|
+
(c) => c.data.map((u) => new x(u)),
|
|
6316
|
+
n
|
|
6317
|
+
);
|
|
6296
6318
|
}
|
|
6297
6319
|
/**
|
|
6298
6320
|
* Закрепляет указанный заказ за текущим оператором и возвращает полные данные заказа.
|
|
@@ -6302,7 +6324,7 @@ class Cs extends Ae {
|
|
|
6302
6324
|
* @see /doc/api/internal#/Заказы/api_internal_orders_attach
|
|
6303
6325
|
*/
|
|
6304
6326
|
attachOrder(r) {
|
|
6305
|
-
return this.patch(`/internal/orders/${r}/attach`, {}, (e) => new
|
|
6327
|
+
return this.patch(`/internal/orders/${r}/attach`, {}, (e) => new x(e.data));
|
|
6306
6328
|
}
|
|
6307
6329
|
/**
|
|
6308
6330
|
* Открепляет указанный заказ от оператора и возвращает полные данные заказа.
|
|
@@ -6312,7 +6334,7 @@ class Cs extends Ae {
|
|
|
6312
6334
|
* @see /doc/api/internal#/Заказы/api_internal_orders_detach
|
|
6313
6335
|
*/
|
|
6314
6336
|
detachOrder(r) {
|
|
6315
|
-
return this.patch(`/internal/orders/${r}/detach`, {}, (e) => new
|
|
6337
|
+
return this.patch(`/internal/orders/${r}/detach`, {}, (e) => new x(e.data));
|
|
6316
6338
|
}
|
|
6317
6339
|
/**
|
|
6318
6340
|
* Обновляет данные заказа без изменения состава товаров и возвращает обновлённые данные заказа.
|
|
@@ -6326,7 +6348,16 @@ class Cs extends Ae {
|
|
|
6326
6348
|
* @see /doc/api/internal#/Заказы/api_internal_orders_update
|
|
6327
6349
|
*/
|
|
6328
6350
|
updateOrder(r, e, s = {}) {
|
|
6329
|
-
|
|
6351
|
+
const n = k().config.dateFormats.api;
|
|
6352
|
+
return this.patch(
|
|
6353
|
+
`/internal/orders/${r}`,
|
|
6354
|
+
{
|
|
6355
|
+
...e,
|
|
6356
|
+
deliveryDate: e.deliveryDate ? I(e.deliveryDate, n) : void 0
|
|
6357
|
+
},
|
|
6358
|
+
(o) => new x(o.data),
|
|
6359
|
+
s
|
|
6360
|
+
);
|
|
6330
6361
|
}
|
|
6331
6362
|
/**
|
|
6332
6363
|
* Добавляет продукт в заказ и возвращает обновлённые данные заказа.
|
|
@@ -6354,7 +6385,7 @@ class Cs extends Ae {
|
|
|
6354
6385
|
is_additional_sale: e.isAdditionalSale,
|
|
6355
6386
|
...e.configuratorParams
|
|
6356
6387
|
},
|
|
6357
|
-
(n) => new
|
|
6388
|
+
(n) => new x(n.data),
|
|
6358
6389
|
s
|
|
6359
6390
|
);
|
|
6360
6391
|
}
|
|
@@ -6377,7 +6408,7 @@ class Cs extends Ae {
|
|
|
6377
6408
|
status: e,
|
|
6378
6409
|
statusDetail: s
|
|
6379
6410
|
},
|
|
6380
|
-
(o) => new
|
|
6411
|
+
(o) => new x(o.data),
|
|
6381
6412
|
n
|
|
6382
6413
|
);
|
|
6383
6414
|
}
|
|
@@ -6403,7 +6434,7 @@ class Cs extends Ae {
|
|
|
6403
6434
|
* @see /doc/api/internal#/Заказы/api_internal_orders_attached_file_delete
|
|
6404
6435
|
*/
|
|
6405
6436
|
deleteOrderAttachedFile(r) {
|
|
6406
|
-
return this.delete(`/internal/orders/${r}/file/attached`, (e) => new
|
|
6437
|
+
return this.delete(`/internal/orders/${r}/file/attached`, (e) => new x(e.data));
|
|
6407
6438
|
}
|
|
6408
6439
|
/**
|
|
6409
6440
|
* Изменяет продукт заказа и возвращает обновлённые данные заказа.
|
|
@@ -6431,7 +6462,7 @@ class Cs extends Ae {
|
|
|
6431
6462
|
marker: s.marker,
|
|
6432
6463
|
...s.configuratorParams
|
|
6433
6464
|
},
|
|
6434
|
-
(o) => new
|
|
6465
|
+
(o) => new x(o.data),
|
|
6435
6466
|
n
|
|
6436
6467
|
);
|
|
6437
6468
|
}
|
|
@@ -6470,7 +6501,7 @@ class Cs extends Ae {
|
|
|
6470
6501
|
return this.get(
|
|
6471
6502
|
`/internal/orders/delivery/${r}/cost`,
|
|
6472
6503
|
{
|
|
6473
|
-
date:
|
|
6504
|
+
date: I(e, o),
|
|
6474
6505
|
warehouse_id: s
|
|
6475
6506
|
},
|
|
6476
6507
|
(c) => c.data,
|
|
@@ -6479,7 +6510,7 @@ class Cs extends Ae {
|
|
|
6479
6510
|
);
|
|
6480
6511
|
}
|
|
6481
6512
|
}
|
|
6482
|
-
class
|
|
6513
|
+
class Le {
|
|
6483
6514
|
/**
|
|
6484
6515
|
* Инициализирует экземпляр класса {@link PriceAnalyze}.
|
|
6485
6516
|
*
|
|
@@ -6506,7 +6537,7 @@ class de {
|
|
|
6506
6537
|
* Источник клиентской цены.
|
|
6507
6538
|
*/
|
|
6508
6539
|
t(this, "source");
|
|
6509
|
-
this.client = new te(r == null ? void 0 : r.client), this.product = new
|
|
6540
|
+
this.client = new te(r == null ? void 0 : r.client), this.product = new d(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) ?? Me.Product;
|
|
6510
6541
|
}
|
|
6511
6542
|
}
|
|
6512
6543
|
const xe = (i) => {
|
|
@@ -6520,7 +6551,7 @@ const xe = (i) => {
|
|
|
6520
6551
|
salesDirections: (o = i.salesDirections) == null ? void 0 : o.map((c) => c.id),
|
|
6521
6552
|
hideNotActive: i.hideNotActive
|
|
6522
6553
|
},
|
|
6523
|
-
(c) => A(c) || (
|
|
6554
|
+
(c) => A(c) || (H(c) || lr(c)) && X(c)
|
|
6524
6555
|
) : {};
|
|
6525
6556
|
}, tr = (i) => {
|
|
6526
6557
|
const r = {};
|
|
@@ -6543,7 +6574,7 @@ class as extends p {
|
|
|
6543
6574
|
...tr(e),
|
|
6544
6575
|
filters: xe(s)
|
|
6545
6576
|
},
|
|
6546
|
-
(n) => n.data.map((o) => new
|
|
6577
|
+
(n) => n.data.map((o) => new Le(o))
|
|
6547
6578
|
);
|
|
6548
6579
|
}
|
|
6549
6580
|
/**
|
|
@@ -6562,7 +6593,7 @@ class as extends p {
|
|
|
6562
6593
|
...tr(e),
|
|
6563
6594
|
filters: xe(s)
|
|
6564
6595
|
},
|
|
6565
|
-
(n) => n.data.map((o) => new
|
|
6596
|
+
(n) => n.data.map((o) => new Le(o))
|
|
6566
6597
|
);
|
|
6567
6598
|
}
|
|
6568
6599
|
/**
|
|
@@ -6583,7 +6614,7 @@ class as extends p {
|
|
|
6583
6614
|
...e,
|
|
6584
6615
|
filters: xe(s)
|
|
6585
6616
|
},
|
|
6586
|
-
(n) => n.data.map((o) => new
|
|
6617
|
+
(n) => n.data.map((o) => new Le(o))
|
|
6587
6618
|
);
|
|
6588
6619
|
}
|
|
6589
6620
|
}
|
|
@@ -6634,10 +6665,10 @@ class kt {
|
|
|
6634
6665
|
* @inheritDoc
|
|
6635
6666
|
*/
|
|
6636
6667
|
t(this, "currency");
|
|
6637
|
-
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = C(r.costDate) ? a(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new
|
|
6668
|
+
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = C(r.costDate) ? a(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new pe(r.product) : void 0, this.client = r.client ? new L(r.client) : void 0, this.executor = r.executor ? new L(r.executor) : void 0, this.currency = r.currency ? new O(r.currency) : void 0;
|
|
6638
6669
|
}
|
|
6639
6670
|
}
|
|
6640
|
-
class It extends
|
|
6671
|
+
class It extends pe {
|
|
6641
6672
|
/**
|
|
6642
6673
|
* Инициализирует экземпляр класса {@link ProductPriceHistory}.
|
|
6643
6674
|
*
|
|
@@ -6649,7 +6680,7 @@ class It extends ue {
|
|
|
6649
6680
|
* @inheritDoc
|
|
6650
6681
|
*/
|
|
6651
6682
|
t(this, "history");
|
|
6652
|
-
this.history =
|
|
6683
|
+
this.history = me(e.history, (s) => new kt(s));
|
|
6653
6684
|
}
|
|
6654
6685
|
}
|
|
6655
6686
|
class Rs extends p {
|
|
@@ -6663,16 +6694,16 @@ class Rs extends p {
|
|
|
6663
6694
|
getProductPriceHistory(r) {
|
|
6664
6695
|
var o, c, u, h, m;
|
|
6665
6696
|
const e = k().config.dateFormats.api, s = cr(
|
|
6666
|
-
|
|
6697
|
+
ue(r, {
|
|
6667
6698
|
costDate: {
|
|
6668
|
-
from: _e((o = r.costDate) == null ? void 0 : o.from) ?
|
|
6669
|
-
to: _e((u = r.costDate) == null ? void 0 : u.to) ?
|
|
6699
|
+
from: _e((o = r.costDate) == null ? void 0 : o.from) ? I(r.costDate.from, e) : (c = r.costDate) == null ? void 0 : c.from,
|
|
6700
|
+
to: _e((u = r.costDate) == null ? void 0 : u.to) ? I(r.costDate.to, e) : (h = r.costDate) == null ? void 0 : h.to
|
|
6670
6701
|
}
|
|
6671
6702
|
}),
|
|
6672
|
-
(f) => A(f) || (
|
|
6703
|
+
(f) => A(f) || (H(f) || lr(f)) && X(f)
|
|
6673
6704
|
), n = ((m = r.product) == null ? void 0 : m[0]) ?? 0;
|
|
6674
6705
|
return delete s.product, this.get(`/internal/price/products/${n}/history`, s).then((f) => [
|
|
6675
|
-
new It(
|
|
6706
|
+
new It(ue(f[0], { history: f }))
|
|
6676
6707
|
]);
|
|
6677
6708
|
}
|
|
6678
6709
|
}
|
|
@@ -6691,7 +6722,7 @@ class sr {
|
|
|
6691
6722
|
* Список рекомендованных категорий продуктов.
|
|
6692
6723
|
*/
|
|
6693
6724
|
t(this, "productCategories", []);
|
|
6694
|
-
r != null && r.products && (this.products = r.products.map((e) => new
|
|
6725
|
+
r != null && r.products && (this.products = r.products.map((e) => new pe(e))), r != null && r.productCategories && (this.productCategories = r.productCategories.map((e) => new pe(e)));
|
|
6695
6726
|
}
|
|
6696
6727
|
}
|
|
6697
6728
|
class Ps extends p {
|
|
@@ -6740,7 +6771,7 @@ class Ps extends p {
|
|
|
6740
6771
|
});
|
|
6741
6772
|
}
|
|
6742
6773
|
}
|
|
6743
|
-
class
|
|
6774
|
+
class dt {
|
|
6744
6775
|
/**
|
|
6745
6776
|
* Инициализирует экземпляр класса {@link MetaTagItem}.
|
|
6746
6777
|
*
|
|
@@ -6798,7 +6829,7 @@ class ir {
|
|
|
6798
6829
|
*/
|
|
6799
6830
|
t(this, "tags");
|
|
6800
6831
|
var e;
|
|
6801
|
-
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
|
|
6832
|
+
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 dt(s))) ?? [], this.tags = r == null ? void 0 : r.tags;
|
|
6802
6833
|
}
|
|
6803
6834
|
}
|
|
6804
6835
|
class Ds extends p {
|
|
@@ -6879,7 +6910,7 @@ class As extends p {
|
|
|
6879
6910
|
});
|
|
6880
6911
|
}
|
|
6881
6912
|
}
|
|
6882
|
-
var
|
|
6913
|
+
var Lt = /* @__PURE__ */ ((i) => (i.Admin = "admin", i.Manager = "manager", i.Operator = "operator", i.Client = "client", i.Guest = "guest", i))(Lt || {});
|
|
6883
6914
|
class xt extends wr {
|
|
6884
6915
|
/**
|
|
6885
6916
|
* Инициализирует экземпляр класса {@link User}.
|
|
@@ -6982,7 +7013,7 @@ export {
|
|
|
6982
7013
|
Ne as BankAccount,
|
|
6983
7014
|
Ae as BasePaginationProvider,
|
|
6984
7015
|
lt as CalculationTypeEnum,
|
|
6985
|
-
|
|
7016
|
+
we as Cart,
|
|
6986
7017
|
Wt as CartProvider,
|
|
6987
7018
|
Et as CatalogProvider,
|
|
6988
7019
|
pr as CatalogableItem,
|
|
@@ -6993,8 +7024,8 @@ export {
|
|
|
6993
7024
|
De as CityWithRegionAndCountry,
|
|
6994
7025
|
rr as Client,
|
|
6995
7026
|
Rt as ClientAdditionalData,
|
|
6996
|
-
|
|
6997
|
-
|
|
7027
|
+
Ce as ClientCategory,
|
|
7028
|
+
_ as ClientDataProvider,
|
|
6998
7029
|
Vt as ClientPriceProvider,
|
|
6999
7030
|
Kt as ClientPriceTemplateProvider,
|
|
7000
7031
|
G as ClientProduct,
|
|
@@ -7003,7 +7034,7 @@ export {
|
|
|
7003
7034
|
te as ClientShortInfo,
|
|
7004
7035
|
gt as ClientsAdditionalDataRequestTypeEnum,
|
|
7005
7036
|
os as ClientsListFilters,
|
|
7006
|
-
|
|
7037
|
+
pe as CodedIdentity,
|
|
7007
7038
|
hs as ConfiguratorProvider,
|
|
7008
7039
|
Dt as ConfiguratorsEnum,
|
|
7009
7040
|
Ue as Contact,
|
|
@@ -7011,9 +7042,9 @@ export {
|
|
|
7011
7042
|
z as ContactPerson,
|
|
7012
7043
|
at as ContactPersonRelated,
|
|
7013
7044
|
ft as ContactPosition,
|
|
7014
|
-
|
|
7045
|
+
de as ContactRelation,
|
|
7015
7046
|
Ar as ContragentBase,
|
|
7016
|
-
|
|
7047
|
+
ae as ContragentFactory,
|
|
7017
7048
|
$r as ContragentIc,
|
|
7018
7049
|
vt as ContragentPerson,
|
|
7019
7050
|
Ct as ContragentUlNr,
|
|
@@ -7022,15 +7053,15 @@ export {
|
|
|
7022
7053
|
Z as Country,
|
|
7023
7054
|
ze as CuratedDirection,
|
|
7024
7055
|
We as Curator,
|
|
7025
|
-
|
|
7056
|
+
O as Currency,
|
|
7026
7057
|
As as DataSuggestionProvider,
|
|
7027
7058
|
cs as DataTablePagination,
|
|
7028
7059
|
Pt as DataTablePaginationRequestParams,
|
|
7029
7060
|
ls as DataTableSortRequestParams,
|
|
7030
7061
|
gs as DateTimeProvider,
|
|
7031
7062
|
tt as DeletableNamedIdentity,
|
|
7032
|
-
|
|
7033
|
-
|
|
7063
|
+
le as DeliveryAddress,
|
|
7064
|
+
F as DeliveryType,
|
|
7034
7065
|
Bt as DetailedJwtPayload,
|
|
7035
7066
|
Yr as DeviceTypeResolutionConfig,
|
|
7036
7067
|
nt as DiscountShortInfo,
|
|
@@ -7040,7 +7071,7 @@ export {
|
|
|
7040
7071
|
Je as FilterOpEnum,
|
|
7041
7072
|
gr as GeoCoordinates,
|
|
7042
7073
|
it as HiddenCatalogableItem,
|
|
7043
|
-
|
|
7074
|
+
ge as HttpCachedRequester,
|
|
7044
7075
|
Xr as HttpParamsConfig,
|
|
7045
7076
|
p as HttpRequester,
|
|
7046
7077
|
re as Identity,
|
|
@@ -7050,12 +7081,12 @@ export {
|
|
|
7050
7081
|
Be as ManagerCommon,
|
|
7051
7082
|
fs as ManagerDataFactory,
|
|
7052
7083
|
At as ManagerDataProvider,
|
|
7053
|
-
|
|
7084
|
+
dt as MetaTagItem,
|
|
7054
7085
|
b as NamedIdentity,
|
|
7055
7086
|
ar as Operator,
|
|
7056
7087
|
B as Opf,
|
|
7057
7088
|
U as OpfEnum,
|
|
7058
|
-
|
|
7089
|
+
x as Order,
|
|
7059
7090
|
$t as OrderAction,
|
|
7060
7091
|
ys as OrderEditorData,
|
|
7061
7092
|
Ir as OrderInfo,
|
|
@@ -7071,8 +7102,8 @@ export {
|
|
|
7071
7102
|
br as PaginationFiltersBase,
|
|
7072
7103
|
ee as PartnerGroup,
|
|
7073
7104
|
Rr as PaymentType,
|
|
7074
|
-
|
|
7075
|
-
|
|
7105
|
+
ve as PreferencesStorageProvider,
|
|
7106
|
+
Le as PriceAnalyze,
|
|
7076
7107
|
as as PriceAnalyzeProvider,
|
|
7077
7108
|
Re as PriceCoefficient,
|
|
7078
7109
|
hr as PriceCoefficientEnum,
|
|
@@ -7087,7 +7118,7 @@ export {
|
|
|
7087
7118
|
ce as PricingRole,
|
|
7088
7119
|
rs as PricingRoleProvider,
|
|
7089
7120
|
qe as PrimaryCatalogableItem,
|
|
7090
|
-
|
|
7121
|
+
d as Product,
|
|
7091
7122
|
Qt as ProductCategoryDataProvider,
|
|
7092
7123
|
Yt as ProductDataProvider,
|
|
7093
7124
|
wt as ProductFileType,
|
|
@@ -7104,9 +7135,9 @@ export {
|
|
|
7104
7135
|
w as Reference,
|
|
7105
7136
|
ns as ReferenceDataFactory,
|
|
7106
7137
|
T as ReferenceDataProvider,
|
|
7107
|
-
|
|
7138
|
+
he as Region,
|
|
7108
7139
|
Pr as ResourceType,
|
|
7109
|
-
|
|
7140
|
+
q as SalesDirection,
|
|
7110
7141
|
Zr as SentryConfig,
|
|
7111
7142
|
ir as Seo,
|
|
7112
7143
|
Ds as SeoDataProvider,
|
|
@@ -7124,9 +7155,9 @@ export {
|
|
|
7124
7155
|
_t as UserDataProvider,
|
|
7125
7156
|
pt as UserPricingRole,
|
|
7126
7157
|
L as UserShortInfo,
|
|
7127
|
-
|
|
7158
|
+
Lt as UserTypeEnum,
|
|
7128
7159
|
ps as VersionConfig,
|
|
7129
|
-
|
|
7160
|
+
fe as Warehouse,
|
|
7130
7161
|
et as WebSocketConfig,
|
|
7131
7162
|
Ze as findCatalogItemByIdRecursive,
|
|
7132
7163
|
er as flattenCatalogItems,
|