@snabcentr/common-lib 2.5.1 → 2.6.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/release_notes.tmp +1 -1
- package/dist/sc-common-lib.js +199 -160
- 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/cart/providers/cart-provider.d.ts +1 -1
- package/dist/src/cart/providers/cart-provider.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/orders/classes/order.d.ts +4 -0
- package/dist/src/orders/classes/order.d.ts.map +1 -1
- package/dist/src/orders/enums/order-action.d.ts +4 -0
- package/dist/src/orders/enums/order-action.d.ts.map +1 -1
- package/dist/src/orders/interfaces/i-order.d.ts +4 -0
- package/dist/src/orders/interfaces/i-order.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 +19 -1
- 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,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var t = (i, r, e) =>
|
|
1
|
+
var Ir = Object.defineProperty;
|
|
2
|
+
var Lr = (i, r, e) => r in i ? Ir(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
|
|
5
|
+
import { merge as pe, 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 fe, forEach as Fr, isDate as _e, omitBy as cr, isObject as lr } from "lodash-es";
|
|
6
6
|
import { objectToCamel as He, objectToSnake as Ee } from "ts-case-convert";
|
|
7
7
|
import { defineStore as W } from "pinia";
|
|
8
8
|
import { ref as y, markRaw as Hr, computed as P } from "vue";
|
|
@@ -99,7 +99,7 @@ class j {
|
|
|
99
99
|
* @inheritDoc
|
|
100
100
|
*/
|
|
101
101
|
t(this, "email", "");
|
|
102
|
-
|
|
102
|
+
pe(this, r);
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Возвращает данные полезной нагрузки для указанного JWT-токена.
|
|
@@ -143,7 +143,7 @@ class Bt extends j {
|
|
|
143
143
|
* @inheritDoc
|
|
144
144
|
*/
|
|
145
145
|
t(this, "address");
|
|
146
|
-
|
|
146
|
+
pe(this, e);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Возвращает данные полезной нагрузки для указанного JWT-токена.
|
|
@@ -336,7 +336,7 @@ class rt {
|
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const d = W("common.config", () => {
|
|
340
340
|
const i = y(new rt());
|
|
341
341
|
return {
|
|
342
342
|
/**
|
|
@@ -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 = pe(i.value, s);
|
|
359
359
|
}
|
|
360
360
|
};
|
|
361
361
|
});
|
|
362
|
-
class
|
|
362
|
+
class ve {
|
|
363
363
|
/**
|
|
364
364
|
* Возвращает актуальные и не просроченные данные из хранилища.
|
|
365
365
|
*
|
|
@@ -480,13 +480,13 @@ 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
|
);
|
|
487
487
|
if (o)
|
|
488
488
|
return Promise.resolve(o);
|
|
489
|
-
const c = (u =
|
|
489
|
+
const c = (u = d().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());
|
|
@@ -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();
|
|
@@ -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 he 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 he {
|
|
722
722
|
/**
|
|
723
723
|
* Инициализирует экземпляр класса {@link CatalogableItem}.
|
|
724
724
|
*
|
|
@@ -786,7 +786,7 @@ class je {
|
|
|
786
786
|
return new r(e);
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
|
-
class
|
|
789
|
+
class x extends b {
|
|
790
790
|
/**
|
|
791
791
|
* Инициализирует экземпляр класса {@link UserShortInfo}.
|
|
792
792
|
*
|
|
@@ -837,7 +837,7 @@ class nt extends b {
|
|
|
837
837
|
* Дата и время удаления.
|
|
838
838
|
*/
|
|
839
839
|
t(this, "deletedAt");
|
|
840
|
-
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = C(e == null ? void 0 : e.publishedAt) ? a(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
|
|
840
|
+
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = C(e == null ? void 0 : e.publishedAt) ? a(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 x(e == null ? void 0 : e.owner), this.deletedAt = C(e == null ? void 0 : e.deletedAt) ? a(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
843
|
class Q extends ur {
|
|
@@ -918,7 +918,7 @@ class gr {
|
|
|
918
918
|
}
|
|
919
919
|
class F extends w {
|
|
920
920
|
}
|
|
921
|
-
class
|
|
921
|
+
class ye extends w {
|
|
922
922
|
/**
|
|
923
923
|
* Инициализирует экземпляр класса {@link Warehouse}.
|
|
924
924
|
*
|
|
@@ -965,7 +965,7 @@ class ot {
|
|
|
965
965
|
* Количество остатков товара на складе.
|
|
966
966
|
*/
|
|
967
967
|
t(this, "count");
|
|
968
|
-
this.warehouse = new
|
|
968
|
+
this.warehouse = new ye(r == null ? void 0 : r.warehouse), this.count = (r == null ? void 0 : r.count) ?? 0;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
class O extends b {
|
|
@@ -1101,7 +1101,7 @@ class L extends it {
|
|
|
1101
1101
|
t(this, "priceCoefficients");
|
|
1102
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
|
-
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,
|
|
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, d().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
|
}
|
|
1106
1106
|
/**
|
|
1107
1107
|
* Возвращает признак, что это измеряемый товар.
|
|
@@ -1162,7 +1162,7 @@ class G extends L {
|
|
|
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 we 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 we(), 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 x(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 {
|
|
@@ -1311,7 +1311,7 @@ let ct = class extends mr {
|
|
|
1311
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 ne {
|
|
1315
1315
|
/**
|
|
1316
1316
|
* Инициализирует экземпляр класса {@link Cart}.
|
|
1317
1317
|
*
|
|
@@ -1345,7 +1345,7 @@ const R = class R {
|
|
|
1345
1345
|
/**
|
|
1346
1346
|
* Базовый URL путь для выполнения запросов.
|
|
1347
1347
|
*/
|
|
1348
|
-
t(this, "baseUrl", `${
|
|
1348
|
+
t(this, "baseUrl", `${d().config.http.portalApiUrl}/api`);
|
|
1349
1349
|
/**
|
|
1350
1350
|
* Обработчик ошибок выполнения запросов текущего экземпляра класса.
|
|
1351
1351
|
*
|
|
@@ -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 ne(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 ne(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 ne(n.data),
|
|
1683
1683
|
s
|
|
1684
1684
|
);
|
|
1685
1685
|
}
|
|
@@ -1692,7 +1692,7 @@ class Wt extends p {
|
|
|
1692
1692
|
* @see /doc/api/internal#/Корзина/api_internal_client_cart_delete_item
|
|
1693
1693
|
*/
|
|
1694
1694
|
deleteCartItem(r, e) {
|
|
1695
|
-
return this.
|
|
1695
|
+
return this.delete(`internal/clients/${r.id}/cart/${e.id}`, (s) => new ne(s.data));
|
|
1696
1696
|
}
|
|
1697
1697
|
/**
|
|
1698
1698
|
* Добавляет продукты в корзину из файла CSV.
|
|
@@ -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 ne(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 we {
|
|
1721
1721
|
/**
|
|
1722
1722
|
* Инициализирует экземпляр класса {@link Category}.
|
|
1723
1723
|
*
|
|
@@ -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 we {
|
|
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 {
|
|
@@ -1922,7 +1922,7 @@ class yr {
|
|
|
1922
1922
|
this.priceCoefficient = (r == null ? void 0 : r.priceCoefficient) && new Re(r.priceCoefficient), this.increasePercent = r == null ? void 0 : r.increasePercent;
|
|
1923
1923
|
}
|
|
1924
1924
|
}
|
|
1925
|
-
class
|
|
1925
|
+
class de extends yr {
|
|
1926
1926
|
/**
|
|
1927
1927
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
1928
1928
|
*
|
|
@@ -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 we(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 ge 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 ge());
|
|
1992
|
+
e && (this.region = new ge(e.region));
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
1995
|
class wr extends b {
|
|
@@ -2080,7 +2080,7 @@ class te extends wr {
|
|
|
2080
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
|
-
class
|
|
2083
|
+
class oe extends re {
|
|
2084
2084
|
/**
|
|
2085
2085
|
* Инициализирует новый экземпляр класса.
|
|
2086
2086
|
*
|
|
@@ -2107,7 +2107,7 @@ class ne extends re {
|
|
|
2107
2107
|
this.createdAt = C(e == null ? void 0 : e.createdAt) ? a(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.deletedAt = C(e == null ? void 0 : e.deletedAt) ? a(e.deletedAt) : e == null ? void 0 : e.deletedAt, this.client = new te(e == null ? void 0 : e.client), this.priceTemplate = new Q(e == null ? void 0 : e.priceTemplate);
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
|
-
class
|
|
2110
|
+
class ke extends yr {
|
|
2111
2111
|
/**
|
|
2112
2112
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
2113
2113
|
*
|
|
@@ -2124,7 +2124,7 @@ class Ie extends yr {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
class vr extends w {
|
|
2126
2126
|
}
|
|
2127
|
-
class
|
|
2127
|
+
class ce extends b {
|
|
2128
2128
|
/**
|
|
2129
2129
|
* Инициализирует экземпляр класса {@link Property}.
|
|
2130
2130
|
*
|
|
@@ -2163,7 +2163,7 @@ class K {
|
|
|
2163
2163
|
* Может быть строкой, числом, boolean, диапазоном или JSON объектом.
|
|
2164
2164
|
*/
|
|
2165
2165
|
t(this, "value");
|
|
2166
|
-
this.property = new
|
|
2166
|
+
this.property = new ce(r == null ? void 0 : r.property), this.value = (r == null ? void 0 : r.value) ?? "";
|
|
2167
2167
|
}
|
|
2168
2168
|
}
|
|
2169
2169
|
class S {
|
|
@@ -2248,7 +2248,7 @@ class Jt {
|
|
|
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
|
}
|
|
2251
|
-
class
|
|
2251
|
+
class le extends b {
|
|
2252
2252
|
/**
|
|
2253
2253
|
* Инициализирует экземпляр класса {@link PricingRole}.
|
|
2254
2254
|
*
|
|
@@ -2302,7 +2302,7 @@ class Ye {
|
|
|
2302
2302
|
* Минимальный коэффициент цены.
|
|
2303
2303
|
*/
|
|
2304
2304
|
t(this, "minCoefficient");
|
|
2305
|
-
this.role = new
|
|
2305
|
+
this.role = new le(r == null ? void 0 : r.role), this.category = new we(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 {
|
|
@@ -2332,7 +2332,7 @@ class Et extends p {
|
|
|
2332
2332
|
*/
|
|
2333
2333
|
// eslint-disable-next-line class-methods-use-this
|
|
2334
2334
|
getPriceExportLink(r = "csv", e = !1, s = void 0, n = void 0) {
|
|
2335
|
-
let c = `${
|
|
2335
|
+
let c = `${d().config.http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;
|
|
2336
2336
|
return s && (c += `&category_id=${s}`), n && (c += `&client_id=${n}`), c;
|
|
2337
2337
|
}
|
|
2338
2338
|
}
|
|
@@ -2547,7 +2547,7 @@ class Kt extends p {
|
|
|
2547
2547
|
return this.get(
|
|
2548
2548
|
`/internal/clients/${r}/price/templates`,
|
|
2549
2549
|
{},
|
|
2550
|
-
(e) => e.data.map((s) => new
|
|
2550
|
+
(e) => e.data.map((s) => new oe(s))
|
|
2551
2551
|
);
|
|
2552
2552
|
}
|
|
2553
2553
|
/**
|
|
@@ -2558,7 +2558,7 @@ class Kt extends p {
|
|
|
2558
2558
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_get_active
|
|
2559
2559
|
*/
|
|
2560
2560
|
getActiveTemplate(r) {
|
|
2561
|
-
return this.get(`/internal/clients/${r}/price/templates/active`, {}, (e) => new
|
|
2561
|
+
return this.get(`/internal/clients/${r}/price/templates/active`, {}, (e) => new oe(e.data), !0);
|
|
2562
2562
|
}
|
|
2563
2563
|
/**
|
|
2564
2564
|
* Добавляет связь между клиентом и шаблоном прайс-листа.
|
|
@@ -2570,14 +2570,14 @@ class Kt extends p {
|
|
|
2570
2570
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_attach
|
|
2571
2571
|
*/
|
|
2572
2572
|
attachTemplate(r, e, s) {
|
|
2573
|
-
const n =
|
|
2573
|
+
const n = d().config.dateFormats.api;
|
|
2574
2574
|
return this.post(
|
|
2575
2575
|
`/internal/clients/${r}/price/templates/${e}`,
|
|
2576
2576
|
s && {
|
|
2577
2577
|
startAt: s.startAt && I(s.startAt, n),
|
|
2578
2578
|
endAt: s.endAt && I(s.endAt, n)
|
|
2579
2579
|
},
|
|
2580
|
-
(o) => new
|
|
2580
|
+
(o) => new oe(o.data),
|
|
2581
2581
|
{},
|
|
2582
2582
|
!0
|
|
2583
2583
|
);
|
|
@@ -2604,14 +2604,14 @@ class Kt extends p {
|
|
|
2604
2604
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_change
|
|
2605
2605
|
*/
|
|
2606
2606
|
changeTemplate(r, e, s, n) {
|
|
2607
|
-
const o =
|
|
2607
|
+
const o = d().config.dateFormats.api;
|
|
2608
2608
|
return this.patch(
|
|
2609
2609
|
`/internal/clients/${r}/price/templates/${e}/${s}`,
|
|
2610
2610
|
n && {
|
|
2611
2611
|
startAt: n.startAt && I(n.startAt, o),
|
|
2612
2612
|
endAt: n.endAt && I(n.endAt, o)
|
|
2613
2613
|
},
|
|
2614
|
-
(c) => new
|
|
2614
|
+
(c) => new oe(c.data)
|
|
2615
2615
|
);
|
|
2616
2616
|
}
|
|
2617
2617
|
/**
|
|
@@ -2687,7 +2687,7 @@ class Qt extends p {
|
|
|
2687
2687
|
showHidden: s,
|
|
2688
2688
|
withPriceCoefficients: e
|
|
2689
2689
|
},
|
|
2690
|
-
(n) =>
|
|
2690
|
+
(n) => fe(n.data, (o) => new L(o))
|
|
2691
2691
|
);
|
|
2692
2692
|
}
|
|
2693
2693
|
/**
|
|
@@ -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) => fe(e.data, (s) => new Ge(s))
|
|
2754
2754
|
);
|
|
2755
2755
|
}
|
|
2756
2756
|
/**
|
|
@@ -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) => fe(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) ? I(this.value,
|
|
2887
|
+
return r.value = _e(this.value) ? I(this.value, d().config.dateFormats.api) : this.value, r;
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
2890
|
class M {
|
|
@@ -3015,7 +3015,7 @@ class es extends Ae {
|
|
|
3015
3015
|
return this.get(
|
|
3016
3016
|
`/internal/price/templates/${r}/products`,
|
|
3017
3017
|
{},
|
|
3018
|
-
(e) => e.data.map((s) => new
|
|
3018
|
+
(e) => e.data.map((s) => new ke(s))
|
|
3019
3019
|
);
|
|
3020
3020
|
}
|
|
3021
3021
|
/**
|
|
@@ -3027,7 +3027,7 @@ class es extends Ae {
|
|
|
3027
3027
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_product_get
|
|
3028
3028
|
*/
|
|
3029
3029
|
getProductTemplatePrice(r, e) {
|
|
3030
|
-
return this.get(`/internal/price/templates/${r}/products/${e}`, {}, (s) => new
|
|
3030
|
+
return this.get(`/internal/price/templates/${r}/products/${e}`, {}, (s) => new ke(s.data));
|
|
3031
3031
|
}
|
|
3032
3032
|
/**
|
|
3033
3033
|
* Сохраняет цену на продукт в шаблоне прайс-листа.
|
|
@@ -3046,7 +3046,7 @@ class es extends Ae {
|
|
|
3046
3046
|
price_coefficient_id: (n = s.coefficient) == null ? void 0 : n.id,
|
|
3047
3047
|
increase_percent: s.value
|
|
3048
3048
|
},
|
|
3049
|
-
(o) => new
|
|
3049
|
+
(o) => new ke(o.data)
|
|
3050
3050
|
);
|
|
3051
3051
|
}
|
|
3052
3052
|
/**
|
|
@@ -3071,7 +3071,7 @@ class es extends Ae {
|
|
|
3071
3071
|
return this.get(
|
|
3072
3072
|
`/internal/price/templates/${r}/categories`,
|
|
3073
3073
|
{},
|
|
3074
|
-
(e) => e.data.map((s) => new
|
|
3074
|
+
(e) => e.data.map((s) => new de(s))
|
|
3075
3075
|
);
|
|
3076
3076
|
}
|
|
3077
3077
|
/**
|
|
@@ -3086,7 +3086,7 @@ class es extends Ae {
|
|
|
3086
3086
|
return this.get(
|
|
3087
3087
|
`/internal/price/templates/${r}/categories/${e}`,
|
|
3088
3088
|
{},
|
|
3089
|
-
(s) => new
|
|
3089
|
+
(s) => new de(s.data)
|
|
3090
3090
|
);
|
|
3091
3091
|
}
|
|
3092
3092
|
/**
|
|
@@ -3112,7 +3112,7 @@ class es extends Ae {
|
|
|
3112
3112
|
},
|
|
3113
3113
|
params: n ? { recursively: !0 } : {}
|
|
3114
3114
|
},
|
|
3115
|
-
(c) => new
|
|
3115
|
+
(c) => new de(c.data)
|
|
3116
3116
|
);
|
|
3117
3117
|
}
|
|
3118
3118
|
/**
|
|
@@ -3143,7 +3143,7 @@ class es extends Ae {
|
|
|
3143
3143
|
return this.get(
|
|
3144
3144
|
`/internal/price/templates/${r}/clients`,
|
|
3145
3145
|
{},
|
|
3146
|
-
(e) => e.data.map((s) => new
|
|
3146
|
+
(e) => e.data.map((s) => new oe(s))
|
|
3147
3147
|
);
|
|
3148
3148
|
}
|
|
3149
3149
|
}
|
|
@@ -3154,7 +3154,7 @@ class rs extends p {
|
|
|
3154
3154
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_get_list
|
|
3155
3155
|
*/
|
|
3156
3156
|
getRoles() {
|
|
3157
|
-
return this.get("/internal/price/roles", {}, (r) => r.data.map((e) => new
|
|
3157
|
+
return this.get("/internal/price/roles", {}, (r) => r.data.map((e) => new le(e)));
|
|
3158
3158
|
}
|
|
3159
3159
|
/**
|
|
3160
3160
|
* Добавляет новую роль ценообразования.
|
|
@@ -3164,7 +3164,7 @@ class rs extends p {
|
|
|
3164
3164
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_create
|
|
3165
3165
|
*/
|
|
3166
3166
|
createRole(r) {
|
|
3167
|
-
return this.post("/internal/price/roles", r, (e) => new
|
|
3167
|
+
return this.post("/internal/price/roles", r, (e) => new le(e.data));
|
|
3168
3168
|
}
|
|
3169
3169
|
/**
|
|
3170
3170
|
* Возвращает данные роли ценообразования.
|
|
@@ -3174,7 +3174,7 @@ class rs extends p {
|
|
|
3174
3174
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_get
|
|
3175
3175
|
*/
|
|
3176
3176
|
getRole(r) {
|
|
3177
|
-
return this.get(`/internal/price/roles/${r}`, {}, (e) => new
|
|
3177
|
+
return this.get(`/internal/price/roles/${r}`, {}, (e) => new le(e.data));
|
|
3178
3178
|
}
|
|
3179
3179
|
/**
|
|
3180
3180
|
* Обновляет данные роли ценообразования.
|
|
@@ -3185,7 +3185,7 @@ class rs extends p {
|
|
|
3185
3185
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_update
|
|
3186
3186
|
*/
|
|
3187
3187
|
updateRole(r, e) {
|
|
3188
|
-
return this.patch(`/internal/price/roles/${r}`, e, (s) => new
|
|
3188
|
+
return this.patch(`/internal/price/roles/${r}`, e, (s) => new le(s.data));
|
|
3189
3189
|
}
|
|
3190
3190
|
/**
|
|
3191
3191
|
* Удаляет роль ценообразования.
|
|
@@ -3240,7 +3240,7 @@ class ts extends Ae {
|
|
|
3240
3240
|
getProperties(r, e, s) {
|
|
3241
3241
|
return this.getPaginated("/internal/catalog/properties", r, e, s, {}, (n) => {
|
|
3242
3242
|
const o = { ...n.data };
|
|
3243
|
-
return o.data = o.data.map((c) => new
|
|
3243
|
+
return o.data = o.data.map((c) => new ce(c)), o;
|
|
3244
3244
|
});
|
|
3245
3245
|
}
|
|
3246
3246
|
/**
|
|
@@ -3257,7 +3257,7 @@ class ts extends Ae {
|
|
|
3257
3257
|
...s,
|
|
3258
3258
|
type: e
|
|
3259
3259
|
},
|
|
3260
|
-
(n) => new
|
|
3260
|
+
(n) => new ce(n.data)
|
|
3261
3261
|
);
|
|
3262
3262
|
}
|
|
3263
3263
|
/**
|
|
@@ -3267,7 +3267,7 @@ class ts extends Ae {
|
|
|
3267
3267
|
* @see /doc/api/internal#/operations/api_internal_catalog_properties_get
|
|
3268
3268
|
*/
|
|
3269
3269
|
getProperty(r) {
|
|
3270
|
-
return this.get(`/internal/catalog/properties/${r}`, {}, (e) => new
|
|
3270
|
+
return this.get(`/internal/catalog/properties/${r}`, {}, (e) => new ce(e.data));
|
|
3271
3271
|
}
|
|
3272
3272
|
/**
|
|
3273
3273
|
* Обновляет существующее свойство.
|
|
@@ -3284,7 +3284,7 @@ class ts extends Ae {
|
|
|
3284
3284
|
...n,
|
|
3285
3285
|
type: s
|
|
3286
3286
|
},
|
|
3287
|
-
(o) => new
|
|
3287
|
+
(o) => new ce(o.data)
|
|
3288
3288
|
);
|
|
3289
3289
|
}
|
|
3290
3290
|
/**
|
|
@@ -3657,7 +3657,7 @@ class ss extends p {
|
|
|
3657
3657
|
showHidden: n,
|
|
3658
3658
|
withPriceCoefficients: s
|
|
3659
3659
|
},
|
|
3660
|
-
(o) =>
|
|
3660
|
+
(o) => fe(o.data, (c) => new L(c))
|
|
3661
3661
|
);
|
|
3662
3662
|
}
|
|
3663
3663
|
}
|
|
@@ -3883,7 +3883,7 @@ class Ar extends b {
|
|
|
3883
3883
|
*/
|
|
3884
3884
|
t(this, "updater");
|
|
3885
3885
|
if (e) {
|
|
3886
|
-
if (this.opf = new B(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = C(e == null ? void 0 : e.createdAt) ? a(e.createdAt) : e.createdAt, this.creator = e.creator ? new
|
|
3886
|
+
if (this.opf = new B(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = C(e == null ? void 0 : e.createdAt) ? a(e.createdAt) : e.createdAt, this.creator = e.creator ? new x(e.creator) : void 0, this.updatedAt = C(e == null ? void 0 : e.updatedAt) ? a(e.updatedAt) : e.updatedAt, this.updater = e.updater ? new x(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new ee(e.partnerGroup)), e.contacts) {
|
|
3887
3887
|
const s = [];
|
|
3888
3888
|
e.contacts.forEach((n) => {
|
|
3889
3889
|
s.push(new z(n));
|
|
@@ -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 Ie 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 Ie(s))), e.relations.clients && (this.relations.clients = e.relations.clients.map((s) => new Ie(s))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((s) => new Ie(s))));
|
|
4052
4052
|
}
|
|
4053
4053
|
}
|
|
4054
|
-
class
|
|
4054
|
+
class ue 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 ue(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 ye(e.preferredWarehouse) : void 0, this.extraData = (e == null ? void 0 : e.extraData) ?? {};
|
|
4145
4145
|
}
|
|
4146
4146
|
}
|
|
4147
4147
|
class br {
|
|
@@ -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 ge(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 ge();
|
|
4278
4278
|
break;
|
|
4279
4279
|
case "isActive":
|
|
4280
4280
|
this.isActive = !0;
|
|
@@ -4340,7 +4340,7 @@ class Sr extends re {
|
|
|
4340
4340
|
* @inheritDoc
|
|
4341
4341
|
*/
|
|
4342
4342
|
t(this, "creator");
|
|
4343
|
-
this.createdAt = C(e == null ? void 0 : e.createdAt) ? a(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new
|
|
4343
|
+
this.createdAt = C(e == null ? void 0 : e.createdAt) ? a(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new x(e == null ? void 0 : e.creator);
|
|
4344
4344
|
}
|
|
4345
4345
|
}
|
|
4346
4346
|
class Rt extends b {
|
|
@@ -4814,7 +4814,7 @@ class _ extends Ae {
|
|
|
4814
4814
|
return this.post(
|
|
4815
4815
|
`/internal/clients/${r}/contragents`,
|
|
4816
4816
|
_.transformContragentClientDataToRequest(e),
|
|
4817
|
-
(n) =>
|
|
4817
|
+
(n) => ae.createInstance(n.data),
|
|
4818
4818
|
s
|
|
4819
4819
|
);
|
|
4820
4820
|
}
|
|
@@ -4830,7 +4830,7 @@ class _ extends Ae {
|
|
|
4830
4830
|
return this.patch(
|
|
4831
4831
|
`/internal/clients/${r}/contragents/${e.id}`,
|
|
4832
4832
|
_.transformContragentClientDataToRequest(e),
|
|
4833
|
-
(n) =>
|
|
4833
|
+
(n) => ae.createInstance(n.data),
|
|
4834
4834
|
s
|
|
4835
4835
|
);
|
|
4836
4836
|
}
|
|
@@ -4844,6 +4844,19 @@ class _ 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 ue(s))
|
|
4858
|
+
);
|
|
4859
|
+
}
|
|
4847
4860
|
/**
|
|
4848
4861
|
* Создаёт новую запись об адресе доставки клиента.
|
|
4849
4862
|
*
|
|
@@ -4856,7 +4869,7 @@ class _ extends Ae {
|
|
|
4856
4869
|
return this.post(
|
|
4857
4870
|
`/internal/clients/${r}/delivery-addresses`,
|
|
4858
4871
|
_.transformClientDeliveryAddressToRequest(e),
|
|
4859
|
-
(n) => new
|
|
4872
|
+
(n) => new ue(n.data),
|
|
4860
4873
|
s
|
|
4861
4874
|
);
|
|
4862
4875
|
}
|
|
@@ -4872,7 +4885,7 @@ class _ extends Ae {
|
|
|
4872
4885
|
return this.patch(
|
|
4873
4886
|
`/internal/clients/${r}/delivery-addresses/${e.id}`,
|
|
4874
4887
|
_.transformClientDeliveryAddressToRequest(e),
|
|
4875
|
-
(n) => new
|
|
4888
|
+
(n) => new ue(n.data),
|
|
4876
4889
|
s
|
|
4877
4890
|
);
|
|
4878
4891
|
}
|
|
@@ -5148,7 +5161,7 @@ const Y = class Y extends p {
|
|
|
5148
5161
|
* Время кэширования данных ответов на запросы (секунд).
|
|
5149
5162
|
*/
|
|
5150
5163
|
t(this, "responseDataCacheTimeout");
|
|
5151
|
-
this.responseDataCacheTimeout =
|
|
5164
|
+
this.responseDataCacheTimeout = d().config.http.responseDataCacheTimeout;
|
|
5152
5165
|
}
|
|
5153
5166
|
/**
|
|
5154
5167
|
* Возвращает кэшированные данные.
|
|
@@ -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 me = Y;
|
|
5200
5213
|
class us extends p {
|
|
5201
5214
|
/**
|
|
5202
5215
|
* Выполняет проверку занят ли указанный номер телефона.
|
|
@@ -5340,7 +5353,7 @@ class gs {
|
|
|
5340
5353
|
};
|
|
5341
5354
|
}
|
|
5342
5355
|
}
|
|
5343
|
-
class
|
|
5356
|
+
class dr {
|
|
5344
5357
|
/**
|
|
5345
5358
|
* Возвращает признак, что указанный товар имеет линейную единицу измерения.
|
|
5346
5359
|
*
|
|
@@ -5356,7 +5369,7 @@ class kr {
|
|
|
5356
5369
|
*/
|
|
5357
5370
|
static getProductMultiplicity(r) {
|
|
5358
5371
|
var e, s;
|
|
5359
|
-
return !((e = r.properties) != null && e.ignoreMinCountCheck) && ((s = r.properties) != null && s.minCount) && !
|
|
5372
|
+
return !((e = r.properties) != null && e.ignoreMinCountCheck) && ((s = r.properties) != null && s.minCount) && !dr.productIsMeasurable(r) ? r.properties.minCount : 1;
|
|
5360
5373
|
}
|
|
5361
5374
|
/**
|
|
5362
5375
|
* Возвращает кратность длины для указанного товара.
|
|
@@ -5388,19 +5401,19 @@ class fs {
|
|
|
5388
5401
|
return r.id === 0 && r.guid === "-undefined-";
|
|
5389
5402
|
}
|
|
5390
5403
|
}
|
|
5391
|
-
class At extends
|
|
5404
|
+
class At extends me {
|
|
5392
5405
|
/**
|
|
5393
5406
|
* Возвращает {@link Promise} для получения справочника списка менеджеров.
|
|
5394
5407
|
*/
|
|
5395
5408
|
async getManagers() {
|
|
5396
|
-
const r = "/internal/managers", e =
|
|
5409
|
+
const r = "/internal/managers", e = me.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));
|
|
5400
5413
|
return this.cacheResponse(r, n), n;
|
|
5401
5414
|
}
|
|
5402
5415
|
}
|
|
5403
|
-
var $t = /* @__PURE__ */ ((i) => (i.View = "view", i.Share = "share", i.EditTags = "edit_tags", i.SaveOrderIgnoredProducts = "save_order_ignored_products", i.ChangeStatus = "change_status", i.ChangeProducts = "change_products", i.ChangeOrderParameters = "change_order_parameters", i.Recalculate = "recalculate", i.AttachOrder = "attach_order", i.DetachOrder = "detach_order", i.SendOnlinePaymentLink = "send_online_payment_link", i.ConfirmOnlineFullPayment = "confirm_online_full_payment", i.MergeOrders = "merge_orders", i.GetHistory = "get_history", i.CloneOrder = "clone_order", i.DeleteAttachedFile = "delete_attached_file", i))($t || {});
|
|
5416
|
+
var $t = /* @__PURE__ */ ((i) => (i.View = "view", i.Share = "share", i.EditTags = "edit_tags", i.SaveOrderIgnoredProducts = "save_order_ignored_products", i.ChangeStatus = "change_status", i.ChangeProducts = "change_products", i.ChangeOrderParameters = "change_order_parameters", i.Recalculate = "recalculate", i.AttachOrder = "attach_order", i.DetachOrder = "detach_order", i.ChangeAttachedOperator = "change_attached_operator", i.SendOnlinePaymentLink = "send_online_payment_link", i.ConfirmOnlineFullPayment = "confirm_online_full_payment", i.MergeOrders = "merge_orders", i.GetHistory = "get_history", i.CloneOrder = "clone_order", i.DeleteAttachedFile = "delete_attached_file", i))($t || {});
|
|
5404
5417
|
class ys {
|
|
5405
5418
|
/**
|
|
5406
5419
|
* Инициализирует экземпляр класса {@link OrderEditorData}.
|
|
@@ -5465,10 +5478,10 @@ class ys {
|
|
|
5465
5478
|
*/
|
|
5466
5479
|
t(this, "isAdditionalSale");
|
|
5467
5480
|
var e, s, n;
|
|
5468
|
-
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) :
|
|
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
|
-
class
|
|
5484
|
+
class kr extends Sr {
|
|
5472
5485
|
/**
|
|
5473
5486
|
* Инициализирует экземпляр класса {@link OrderInfo}.
|
|
5474
5487
|
*
|
|
@@ -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
|
|
5548
|
+
address: (m = e == null ? void 0 : e.delivery) != null && m.address ? new ue(e.delivery.address) : void 0,
|
|
5549
|
+
warehouse: (f = e == null ? void 0 : e.delivery) != null && f.warehouse ? new ye(e.delivery.warehouse) : void 0
|
|
5550
|
+
}, this.attachedUser = e != null && e.attachedUser ? new x(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 me {
|
|
5542
5555
|
/**
|
|
5543
5556
|
* Возвращает {@link Promise} для получения данных указанного справочника.
|
|
5544
5557
|
*
|
|
@@ -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(ge, `/internal/references/region-with-country/search?term=${r}`);
|
|
5647
5660
|
}
|
|
5648
5661
|
/**
|
|
5649
5662
|
* Выполняет поиск данных о странах по терму в названии.
|
|
@@ -5663,7 +5676,7 @@ class T extends he {
|
|
|
5663
5676
|
* Возвращает {@link Promise} для получения справочника складов.
|
|
5664
5677
|
*/
|
|
5665
5678
|
getWarehouses() {
|
|
5666
|
-
return this.getTypedDataArrayRequester(
|
|
5679
|
+
return this.getTypedDataArrayRequester(ye, "/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
|
|
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 x(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 ye(u)), this.isToProcess = e == null ? void 0 : e.isToProcess;
|
|
6036
6049
|
}
|
|
6037
6050
|
/**
|
|
6038
6051
|
* @inheritDoc
|
|
@@ -6132,7 +6145,7 @@ class bt extends mr {
|
|
|
6132
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 k extends kr {
|
|
6136
6149
|
/**
|
|
6137
6150
|
* Инициализирует экземпляр класса {@link Order}.
|
|
6138
6151
|
*
|
|
@@ -6189,7 +6202,11 @@ class x extends Ir {
|
|
|
6189
6202
|
* @inheritDoc
|
|
6190
6203
|
*/
|
|
6191
6204
|
t(this, "operatorsForWarehouseComment");
|
|
6192
|
-
|
|
6205
|
+
/**
|
|
6206
|
+
* @inheritDoc
|
|
6207
|
+
*/
|
|
6208
|
+
t(this, "erpOrderUrl");
|
|
6209
|
+
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, this.erpOrderUrl = e.erpOrderUrl;
|
|
6193
6210
|
}
|
|
6194
6211
|
}
|
|
6195
6212
|
class St {
|
|
@@ -6215,7 +6232,7 @@ class St {
|
|
|
6215
6232
|
* @inheritDoc
|
|
6216
6233
|
*/
|
|
6217
6234
|
t(this, "createdAt");
|
|
6218
|
-
this.user = new
|
|
6235
|
+
this.user = new x(r == null ? void 0 : r.user), this.status = new $e(r == null ? void 0 : r.status), this.statusDetail = r != null && r.statusDetail ? new w(r.statusDetail) : void 0, this.createdAt = C(r == null ? void 0 : r.createdAt) ? a(r.createdAt) : (r == null ? void 0 : r.createdAt) ?? /* @__PURE__ */ new Date();
|
|
6219
6236
|
}
|
|
6220
6237
|
}
|
|
6221
6238
|
class Cs extends Ae {
|
|
@@ -6238,7 +6255,7 @@ class Cs extends Ae {
|
|
|
6238
6255
|
{},
|
|
6239
6256
|
(o) => {
|
|
6240
6257
|
const c = { ...o.data };
|
|
6241
|
-
return c.data = c.data.map((u) => new
|
|
6258
|
+
return c.data = c.data.map((u) => new kr(u)), c;
|
|
6242
6259
|
},
|
|
6243
6260
|
void 0,
|
|
6244
6261
|
n
|
|
@@ -6278,7 +6295,7 @@ class Cs extends Ae {
|
|
|
6278
6295
|
* @see /doc/api/internal#/Заказы/api_internal_orders_get
|
|
6279
6296
|
*/
|
|
6280
6297
|
getOrder(r) {
|
|
6281
|
-
return this.get(`/internal/orders/${r}`, {}, (e) => new
|
|
6298
|
+
return this.get(`/internal/orders/${r}`, {}, (e) => new k(e.data));
|
|
6282
6299
|
}
|
|
6283
6300
|
/**
|
|
6284
6301
|
* Создаёт новый заказ клиента из содержимого корзины текущего пользователя.
|
|
@@ -6292,14 +6309,14 @@ class Cs extends Ae {
|
|
|
6292
6309
|
* @see /doc/api/internal#/operations/api_internal_client_orders_create
|
|
6293
6310
|
*/
|
|
6294
6311
|
createClientOrder(r, e, s, n = {}) {
|
|
6295
|
-
const o =
|
|
6312
|
+
const o = d().config.dateFormats.api;
|
|
6296
6313
|
return this.post(
|
|
6297
6314
|
`/internal/clients/${r}/orders/${e}`,
|
|
6298
6315
|
{
|
|
6299
6316
|
...s,
|
|
6300
6317
|
deliveryDate: I(s.deliveryDate, o)
|
|
6301
6318
|
},
|
|
6302
|
-
(c) =>
|
|
6319
|
+
(c) => c.data.map((u) => new k(u)),
|
|
6303
6320
|
n
|
|
6304
6321
|
);
|
|
6305
6322
|
}
|
|
@@ -6311,7 +6328,7 @@ class Cs extends Ae {
|
|
|
6311
6328
|
* @see /doc/api/internal#/Заказы/api_internal_orders_attach
|
|
6312
6329
|
*/
|
|
6313
6330
|
attachOrder(r) {
|
|
6314
|
-
return this.patch(`/internal/orders/${r}/attach`, {}, (e) => new
|
|
6331
|
+
return this.patch(`/internal/orders/${r}/attach`, {}, (e) => new k(e.data));
|
|
6315
6332
|
}
|
|
6316
6333
|
/**
|
|
6317
6334
|
* Открепляет указанный заказ от оператора и возвращает полные данные заказа.
|
|
@@ -6321,7 +6338,7 @@ class Cs extends Ae {
|
|
|
6321
6338
|
* @see /doc/api/internal#/Заказы/api_internal_orders_detach
|
|
6322
6339
|
*/
|
|
6323
6340
|
detachOrder(r) {
|
|
6324
|
-
return this.patch(`/internal/orders/${r}/detach`, {}, (e) => new
|
|
6341
|
+
return this.patch(`/internal/orders/${r}/detach`, {}, (e) => new k(e.data));
|
|
6325
6342
|
}
|
|
6326
6343
|
/**
|
|
6327
6344
|
* Обновляет данные заказа без изменения состава товаров и возвращает обновлённые данные заказа.
|
|
@@ -6335,14 +6352,14 @@ class Cs extends Ae {
|
|
|
6335
6352
|
* @see /doc/api/internal#/Заказы/api_internal_orders_update
|
|
6336
6353
|
*/
|
|
6337
6354
|
updateOrder(r, e, s = {}) {
|
|
6338
|
-
const n =
|
|
6355
|
+
const n = d().config.dateFormats.api;
|
|
6339
6356
|
return this.patch(
|
|
6340
6357
|
`/internal/orders/${r}`,
|
|
6341
6358
|
{
|
|
6342
6359
|
...e,
|
|
6343
6360
|
deliveryDate: e.deliveryDate ? I(e.deliveryDate, n) : void 0
|
|
6344
6361
|
},
|
|
6345
|
-
(o) => new
|
|
6362
|
+
(o) => new k(o.data),
|
|
6346
6363
|
s
|
|
6347
6364
|
);
|
|
6348
6365
|
}
|
|
@@ -6372,7 +6389,7 @@ class Cs extends Ae {
|
|
|
6372
6389
|
is_additional_sale: e.isAdditionalSale,
|
|
6373
6390
|
...e.configuratorParams
|
|
6374
6391
|
},
|
|
6375
|
-
(n) => new
|
|
6392
|
+
(n) => new k(n.data),
|
|
6376
6393
|
s
|
|
6377
6394
|
);
|
|
6378
6395
|
}
|
|
@@ -6395,7 +6412,7 @@ class Cs extends Ae {
|
|
|
6395
6412
|
status: e,
|
|
6396
6413
|
statusDetail: s
|
|
6397
6414
|
},
|
|
6398
|
-
(o) => new
|
|
6415
|
+
(o) => new k(o.data),
|
|
6399
6416
|
n
|
|
6400
6417
|
);
|
|
6401
6418
|
}
|
|
@@ -6413,6 +6430,17 @@ class Cs extends Ae {
|
|
|
6413
6430
|
(e) => e.data.map((s) => new St(s))
|
|
6414
6431
|
);
|
|
6415
6432
|
}
|
|
6433
|
+
/**
|
|
6434
|
+
* Заменяет закреплённого за заказом оператора и возвращает обновлённые данные заказа.
|
|
6435
|
+
*
|
|
6436
|
+
* @param orderId Идентификатор заказа.
|
|
6437
|
+
* @param operatorId Идентификатор нового оператора.
|
|
6438
|
+
*
|
|
6439
|
+
* @see /doc/api/internal#/Заказы/api_internal_orders_change_attached_operator
|
|
6440
|
+
*/
|
|
6441
|
+
changeAttachedOperator(r, e) {
|
|
6442
|
+
return this.patch(`/internal/orders/${r}/change-attached-operator`, { operatorId: e }, (s) => new k(s.data));
|
|
6443
|
+
}
|
|
6416
6444
|
/**
|
|
6417
6445
|
* Удаляет файл, прикреплённый к заказу клиентом, и возвращает обновлённые данные заказа.
|
|
6418
6446
|
*
|
|
@@ -6421,7 +6449,18 @@ class Cs extends Ae {
|
|
|
6421
6449
|
* @see /doc/api/internal#/Заказы/api_internal_orders_attached_file_delete
|
|
6422
6450
|
*/
|
|
6423
6451
|
deleteOrderAttachedFile(r) {
|
|
6424
|
-
return this.delete(`/internal/orders/${r}/file/attached`, (e) => new
|
|
6452
|
+
return this.delete(`/internal/orders/${r}/file/attached`, (e) => new k(e.data));
|
|
6453
|
+
}
|
|
6454
|
+
/**
|
|
6455
|
+
* Удаляет продукт из заказа и возвращает обновлённые данные заказа.
|
|
6456
|
+
*
|
|
6457
|
+
* @param orderId Идентификатор заказа.
|
|
6458
|
+
* @param orderProductId Идентификатор записи продукта заказа.
|
|
6459
|
+
*
|
|
6460
|
+
* @see /doc/api/internal#/operations/api_internal_orders_product_delete
|
|
6461
|
+
*/
|
|
6462
|
+
deleteOrderProduct(r, e) {
|
|
6463
|
+
return this.delete(`/internal/orders/${r}/products/${e}`, (s) => new k(s.data));
|
|
6425
6464
|
}
|
|
6426
6465
|
/**
|
|
6427
6466
|
* Изменяет продукт заказа и возвращает обновлённые данные заказа.
|
|
@@ -6449,7 +6488,7 @@ class Cs extends Ae {
|
|
|
6449
6488
|
marker: s.marker,
|
|
6450
6489
|
...s.configuratorParams
|
|
6451
6490
|
},
|
|
6452
|
-
(o) => new
|
|
6491
|
+
(o) => new k(o.data),
|
|
6453
6492
|
n
|
|
6454
6493
|
);
|
|
6455
6494
|
}
|
|
@@ -6484,7 +6523,7 @@ class Cs extends Ae {
|
|
|
6484
6523
|
* @see /doc/api/internal#/operations/api_internal_orders_delivery_get_cost
|
|
6485
6524
|
*/
|
|
6486
6525
|
getDeliveryCost(r, e, s, n = void 0) {
|
|
6487
|
-
const o =
|
|
6526
|
+
const o = d().config.dateFormats.api;
|
|
6488
6527
|
return this.get(
|
|
6489
6528
|
`/internal/orders/delivery/${r}/cost`,
|
|
6490
6529
|
{
|
|
@@ -6497,7 +6536,7 @@ class Cs extends Ae {
|
|
|
6497
6536
|
);
|
|
6498
6537
|
}
|
|
6499
6538
|
}
|
|
6500
|
-
class
|
|
6539
|
+
class Le {
|
|
6501
6540
|
/**
|
|
6502
6541
|
* Инициализирует экземпляр класса {@link PriceAnalyze}.
|
|
6503
6542
|
*
|
|
@@ -6561,7 +6600,7 @@ class as extends p {
|
|
|
6561
6600
|
...tr(e),
|
|
6562
6601
|
filters: xe(s)
|
|
6563
6602
|
},
|
|
6564
|
-
(n) => n.data.map((o) => new
|
|
6603
|
+
(n) => n.data.map((o) => new Le(o))
|
|
6565
6604
|
);
|
|
6566
6605
|
}
|
|
6567
6606
|
/**
|
|
@@ -6580,7 +6619,7 @@ class as extends p {
|
|
|
6580
6619
|
...tr(e),
|
|
6581
6620
|
filters: xe(s)
|
|
6582
6621
|
},
|
|
6583
|
-
(n) => n.data.map((o) => new
|
|
6622
|
+
(n) => n.data.map((o) => new Le(o))
|
|
6584
6623
|
);
|
|
6585
6624
|
}
|
|
6586
6625
|
/**
|
|
@@ -6601,11 +6640,11 @@ class as extends p {
|
|
|
6601
6640
|
...e,
|
|
6602
6641
|
filters: xe(s)
|
|
6603
6642
|
},
|
|
6604
|
-
(n) => n.data.map((o) => new
|
|
6643
|
+
(n) => n.data.map((o) => new Le(o))
|
|
6605
6644
|
);
|
|
6606
6645
|
}
|
|
6607
6646
|
}
|
|
6608
|
-
class
|
|
6647
|
+
class dt {
|
|
6609
6648
|
/**
|
|
6610
6649
|
* Инициализирует экземпляр класса {@link PriceHistoryItem}.
|
|
6611
6650
|
*
|
|
@@ -6652,10 +6691,10 @@ class kt {
|
|
|
6652
6691
|
* @inheritDoc
|
|
6653
6692
|
*/
|
|
6654
6693
|
t(this, "currency");
|
|
6655
|
-
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
|
|
6694
|
+
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 he(r.product) : void 0, this.client = r.client ? new x(r.client) : void 0, this.executor = r.executor ? new x(r.executor) : void 0, this.currency = r.currency ? new O(r.currency) : void 0;
|
|
6656
6695
|
}
|
|
6657
6696
|
}
|
|
6658
|
-
class
|
|
6697
|
+
class kt extends he {
|
|
6659
6698
|
/**
|
|
6660
6699
|
* Инициализирует экземпляр класса {@link ProductPriceHistory}.
|
|
6661
6700
|
*
|
|
@@ -6667,7 +6706,7 @@ class It extends ue {
|
|
|
6667
6706
|
* @inheritDoc
|
|
6668
6707
|
*/
|
|
6669
6708
|
t(this, "history");
|
|
6670
|
-
this.history =
|
|
6709
|
+
this.history = fe(e.history, (s) => new dt(s));
|
|
6671
6710
|
}
|
|
6672
6711
|
}
|
|
6673
6712
|
class Rs extends p {
|
|
@@ -6680,8 +6719,8 @@ class Rs extends p {
|
|
|
6680
6719
|
*/
|
|
6681
6720
|
getProductPriceHistory(r) {
|
|
6682
6721
|
var o, c, u, h, m;
|
|
6683
|
-
const e =
|
|
6684
|
-
|
|
6722
|
+
const e = d().config.dateFormats.api, s = cr(
|
|
6723
|
+
pe(r, {
|
|
6685
6724
|
costDate: {
|
|
6686
6725
|
from: _e((o = r.costDate) == null ? void 0 : o.from) ? I(r.costDate.from, e) : (c = r.costDate) == null ? void 0 : c.from,
|
|
6687
6726
|
to: _e((u = r.costDate) == null ? void 0 : u.to) ? I(r.costDate.to, e) : (h = r.costDate) == null ? void 0 : h.to
|
|
@@ -6690,7 +6729,7 @@ class Rs extends p {
|
|
|
6690
6729
|
(f) => A(f) || (H(f) || lr(f)) && X(f)
|
|
6691
6730
|
), n = ((m = r.product) == null ? void 0 : m[0]) ?? 0;
|
|
6692
6731
|
return delete s.product, this.get(`/internal/price/products/${n}/history`, s).then((f) => [
|
|
6693
|
-
new
|
|
6732
|
+
new kt(pe(f[0], { history: f }))
|
|
6694
6733
|
]);
|
|
6695
6734
|
}
|
|
6696
6735
|
}
|
|
@@ -6709,7 +6748,7 @@ class sr {
|
|
|
6709
6748
|
* Список рекомендованных категорий продуктов.
|
|
6710
6749
|
*/
|
|
6711
6750
|
t(this, "productCategories", []);
|
|
6712
|
-
r != null && r.products && (this.products = r.products.map((e) => new
|
|
6751
|
+
r != null && r.products && (this.products = r.products.map((e) => new he(e))), r != null && r.productCategories && (this.productCategories = r.productCategories.map((e) => new he(e)));
|
|
6713
6752
|
}
|
|
6714
6753
|
}
|
|
6715
6754
|
class Ps extends p {
|
|
@@ -6758,7 +6797,7 @@ class Ps extends p {
|
|
|
6758
6797
|
});
|
|
6759
6798
|
}
|
|
6760
6799
|
}
|
|
6761
|
-
class
|
|
6800
|
+
class It {
|
|
6762
6801
|
/**
|
|
6763
6802
|
* Инициализирует экземпляр класса {@link MetaTagItem}.
|
|
6764
6803
|
*
|
|
@@ -6816,7 +6855,7 @@ class ir {
|
|
|
6816
6855
|
*/
|
|
6817
6856
|
t(this, "tags");
|
|
6818
6857
|
var e;
|
|
6819
|
-
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
|
|
6858
|
+
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;
|
|
6820
6859
|
}
|
|
6821
6860
|
}
|
|
6822
6861
|
class Ds extends p {
|
|
@@ -6897,7 +6936,7 @@ class As extends p {
|
|
|
6897
6936
|
});
|
|
6898
6937
|
}
|
|
6899
6938
|
}
|
|
6900
|
-
var
|
|
6939
|
+
var Lt = /* @__PURE__ */ ((i) => (i.Admin = "admin", i.Manager = "manager", i.Operator = "operator", i.Client = "client", i.Guest = "guest", i))(Lt || {});
|
|
6901
6940
|
class xt extends wr {
|
|
6902
6941
|
/**
|
|
6903
6942
|
* Инициализирует экземпляр класса {@link User}.
|
|
@@ -6926,7 +6965,7 @@ class $s extends p {
|
|
|
6926
6965
|
* Инициализирует экземпляр класса {@link UserAuthDataProvider}.
|
|
6927
6966
|
*/
|
|
6928
6967
|
constructor() {
|
|
6929
|
-
super(), this.baseUrl = `${
|
|
6968
|
+
super(), this.baseUrl = `${d().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
6930
6969
|
}
|
|
6931
6970
|
/**
|
|
6932
6971
|
* Функция для получения обновленных токенов доступа.
|
|
@@ -7000,7 +7039,7 @@ export {
|
|
|
7000
7039
|
Ne as BankAccount,
|
|
7001
7040
|
Ae as BasePaginationProvider,
|
|
7002
7041
|
lt as CalculationTypeEnum,
|
|
7003
|
-
|
|
7042
|
+
ne as Cart,
|
|
7004
7043
|
Wt as CartProvider,
|
|
7005
7044
|
Et as CatalogProvider,
|
|
7006
7045
|
pr as CatalogableItem,
|
|
@@ -7011,7 +7050,7 @@ export {
|
|
|
7011
7050
|
De as CityWithRegionAndCountry,
|
|
7012
7051
|
rr as Client,
|
|
7013
7052
|
Rt as ClientAdditionalData,
|
|
7014
|
-
|
|
7053
|
+
Ce as ClientCategory,
|
|
7015
7054
|
_ as ClientDataProvider,
|
|
7016
7055
|
Vt as ClientPriceProvider,
|
|
7017
7056
|
Kt as ClientPriceTemplateProvider,
|
|
@@ -7021,7 +7060,7 @@ export {
|
|
|
7021
7060
|
te as ClientShortInfo,
|
|
7022
7061
|
gt as ClientsAdditionalDataRequestTypeEnum,
|
|
7023
7062
|
os as ClientsListFilters,
|
|
7024
|
-
|
|
7063
|
+
he as CodedIdentity,
|
|
7025
7064
|
hs as ConfiguratorProvider,
|
|
7026
7065
|
Dt as ConfiguratorsEnum,
|
|
7027
7066
|
Ue as Contact,
|
|
@@ -7029,9 +7068,9 @@ export {
|
|
|
7029
7068
|
z as ContactPerson,
|
|
7030
7069
|
at as ContactPersonRelated,
|
|
7031
7070
|
ft as ContactPosition,
|
|
7032
|
-
|
|
7071
|
+
Ie as ContactRelation,
|
|
7033
7072
|
Ar as ContragentBase,
|
|
7034
|
-
|
|
7073
|
+
ae as ContragentFactory,
|
|
7035
7074
|
$r as ContragentIc,
|
|
7036
7075
|
vt as ContragentPerson,
|
|
7037
7076
|
Ct as ContragentUlNr,
|
|
@@ -7047,7 +7086,7 @@ export {
|
|
|
7047
7086
|
ls as DataTableSortRequestParams,
|
|
7048
7087
|
gs as DateTimeProvider,
|
|
7049
7088
|
tt as DeletableNamedIdentity,
|
|
7050
|
-
|
|
7089
|
+
ue as DeliveryAddress,
|
|
7051
7090
|
F as DeliveryType,
|
|
7052
7091
|
Bt as DetailedJwtPayload,
|
|
7053
7092
|
Yr as DeviceTypeResolutionConfig,
|
|
@@ -7058,7 +7097,7 @@ export {
|
|
|
7058
7097
|
Je as FilterOpEnum,
|
|
7059
7098
|
gr as GeoCoordinates,
|
|
7060
7099
|
it as HiddenCatalogableItem,
|
|
7061
|
-
|
|
7100
|
+
me as HttpCachedRequester,
|
|
7062
7101
|
Xr as HttpParamsConfig,
|
|
7063
7102
|
p as HttpRequester,
|
|
7064
7103
|
re as Identity,
|
|
@@ -7068,15 +7107,15 @@ export {
|
|
|
7068
7107
|
Be as ManagerCommon,
|
|
7069
7108
|
fs as ManagerDataFactory,
|
|
7070
7109
|
At as ManagerDataProvider,
|
|
7071
|
-
|
|
7110
|
+
It as MetaTagItem,
|
|
7072
7111
|
b as NamedIdentity,
|
|
7073
7112
|
ar as Operator,
|
|
7074
7113
|
B as Opf,
|
|
7075
7114
|
U as OpfEnum,
|
|
7076
|
-
|
|
7115
|
+
k as Order,
|
|
7077
7116
|
$t as OrderAction,
|
|
7078
7117
|
ys as OrderEditorData,
|
|
7079
|
-
|
|
7118
|
+
kr as OrderInfo,
|
|
7080
7119
|
bt as OrderItem,
|
|
7081
7120
|
mr as OrderItemBase,
|
|
7082
7121
|
yt as OrderPaymentStatus,
|
|
@@ -7089,20 +7128,20 @@ export {
|
|
|
7089
7128
|
br as PaginationFiltersBase,
|
|
7090
7129
|
ee as PartnerGroup,
|
|
7091
7130
|
Rr as PaymentType,
|
|
7092
|
-
|
|
7093
|
-
|
|
7131
|
+
ve as PreferencesStorageProvider,
|
|
7132
|
+
Le as PriceAnalyze,
|
|
7094
7133
|
as as PriceAnalyzeProvider,
|
|
7095
7134
|
Re as PriceCoefficient,
|
|
7096
7135
|
hr as PriceCoefficientEnum,
|
|
7097
7136
|
Rs as PriceHistoryDataProvider,
|
|
7098
|
-
|
|
7137
|
+
dt as PriceHistoryItem,
|
|
7099
7138
|
Q as PriceTemplate,
|
|
7100
|
-
|
|
7101
|
-
|
|
7139
|
+
de as PriceTemplateCategory,
|
|
7140
|
+
oe as PriceTemplateClient,
|
|
7102
7141
|
yr as PriceTemplateICatalogableItem,
|
|
7103
|
-
|
|
7142
|
+
ke as PriceTemplateProduct,
|
|
7104
7143
|
es as PriceTemplateProvider,
|
|
7105
|
-
|
|
7144
|
+
le as PricingRole,
|
|
7106
7145
|
rs as PricingRoleProvider,
|
|
7107
7146
|
qe as PrimaryCatalogableItem,
|
|
7108
7147
|
L as Product,
|
|
@@ -7110,10 +7149,10 @@ export {
|
|
|
7110
7149
|
Yt as ProductDataProvider,
|
|
7111
7150
|
wt as ProductFileType,
|
|
7112
7151
|
Ge as ProductPriceCoefficient,
|
|
7113
|
-
|
|
7152
|
+
kt as ProductPriceHistory,
|
|
7114
7153
|
Qe as ProductUnit,
|
|
7115
7154
|
ts as PropertiesProvider,
|
|
7116
|
-
|
|
7155
|
+
ce as Property,
|
|
7117
7156
|
vr as PropertyType,
|
|
7118
7157
|
ut as PropertyTypeEnum,
|
|
7119
7158
|
K as PropertyValue,
|
|
@@ -7122,7 +7161,7 @@ export {
|
|
|
7122
7161
|
w as Reference,
|
|
7123
7162
|
ns as ReferenceDataFactory,
|
|
7124
7163
|
T as ReferenceDataProvider,
|
|
7125
|
-
|
|
7164
|
+
ge as Region,
|
|
7126
7165
|
Pr as ResourceType,
|
|
7127
7166
|
q as SalesDirection,
|
|
7128
7167
|
Zr as SentryConfig,
|
|
@@ -7133,7 +7172,7 @@ export {
|
|
|
7133
7172
|
ss as TemplateProductCategoryDataProvider,
|
|
7134
7173
|
Jt as TemplatesListFilters,
|
|
7135
7174
|
je as TypedInstanceFactory,
|
|
7136
|
-
|
|
7175
|
+
dr as UnitsHelper,
|
|
7137
7176
|
us as UnknownClientDataProvider,
|
|
7138
7177
|
ur as UpdatableNamedIdentity,
|
|
7139
7178
|
xt as User,
|
|
@@ -7141,16 +7180,16 @@ export {
|
|
|
7141
7180
|
wr as UserCommonInfo,
|
|
7142
7181
|
_t as UserDataProvider,
|
|
7143
7182
|
pt as UserPricingRole,
|
|
7144
|
-
|
|
7145
|
-
|
|
7183
|
+
x as UserShortInfo,
|
|
7184
|
+
Lt as UserTypeEnum,
|
|
7146
7185
|
ps as VersionConfig,
|
|
7147
|
-
|
|
7186
|
+
ye as Warehouse,
|
|
7148
7187
|
et as WebSocketConfig,
|
|
7149
7188
|
Ze as findCatalogItemByIdRecursive,
|
|
7150
7189
|
er as flattenCatalogItems,
|
|
7151
7190
|
ms as pluralize,
|
|
7152
7191
|
Se as useAuthStateStore,
|
|
7153
|
-
|
|
7192
|
+
d as useBaseConfigStateStore,
|
|
7154
7193
|
ws as useReferencesStore,
|
|
7155
7194
|
Ts as useUserStateStore
|
|
7156
7195
|
};
|