@snabcentr/common-lib 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +1 -1
- package/dist/sc-common-lib.js +130 -126
- 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/clients/classes/client-additional-data.d.ts +11 -6
- package/dist/src/clients/classes/client-additional-data.d.ts.map +1 -1
- package/dist/src/clients/classes/client-short-info.d.ts +1 -1
- package/dist/src/clients/classes/client-short-info.d.ts.map +1 -1
- package/dist/src/clients/enums/clients-additional-data-request-type-enum.d.ts +5 -1
- package/dist/src/clients/enums/clients-additional-data-request-type-enum.d.ts.map +1 -1
- package/dist/src/clients/interfaces/i-client-additional-data.d.ts +5 -0
- package/dist/src/clients/interfaces/i-client-additional-data.d.ts.map +1 -1
- package/dist/src/clients/interfaces/i-client-short-info.d.ts +1 -1
- package/dist/src/clients/interfaces/i-client-short-info.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var $r = Object.defineProperty;
|
|
2
2
|
var br = (n, r, e) => r in n ? $r(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
3
|
var t = (n, r, e) => br(n, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
-
import { jwtDecode as
|
|
5
|
-
import { merge as Ne, isUndefined as
|
|
6
|
-
import { objectToCamel as Fe, objectToSnake as
|
|
7
|
-
import { isAfter as
|
|
4
|
+
import { jwtDecode as ir } from "jwt-decode";
|
|
5
|
+
import { merge as Ne, isUndefined as ar, isNil as A, isEmpty as Y, noop as w, mapValues as nr, isArray as Q, every as Sr, split as Ir, toUpper as xr, constant as Lr, isString as C, cloneDeep as kr, toLower as _r, isFunction as Ue, map as he, forEach as dr, isDate as ke, omitBy as or, isObject as cr } from "lodash-es";
|
|
6
|
+
import { objectToCamel as Fe, objectToSnake as We } from "ts-case-convert";
|
|
7
|
+
import { isAfter as Je, parseISO as v, startOfToday as _e, format as O, addSeconds as Or, addBusinessDays as qr, endOfTomorrow as Nr, startOfTomorrow as Ur, endOfYesterday as Fr, startOfYesterday as Mr, endOfToday as jr, endOfDay as Gr, startOfDay as Hr } from "date-fns";
|
|
8
8
|
import { defineStore as te } from "pinia";
|
|
9
9
|
import { ref as y, markRaw as Br, computed as R } from "vue";
|
|
10
10
|
import Er from "axios";
|
|
@@ -107,7 +107,7 @@ class N {
|
|
|
107
107
|
* @param jwtToken JWT-ключ доступа.
|
|
108
108
|
*/
|
|
109
109
|
static getJwtPayload(r) {
|
|
110
|
-
const e =
|
|
110
|
+
const e = ir(r), s = new N(Fe(e));
|
|
111
111
|
return s.resourceAccess = e.resource_access, s;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -151,7 +151,7 @@ class Ut extends N {
|
|
|
151
151
|
* @param jwtToken JWT-ключ доступа.
|
|
152
152
|
*/
|
|
153
153
|
static getJwtPayload(e) {
|
|
154
|
-
return new N(Fe(
|
|
154
|
+
return new N(Fe(ir(e)));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
const J = class J {
|
|
@@ -168,7 +168,7 @@ const J = class J {
|
|
|
168
168
|
*/
|
|
169
169
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
170
170
|
static getConfig() {
|
|
171
|
-
if (
|
|
171
|
+
if (ar(J.config))
|
|
172
172
|
throw new Error("Config is undefined. Please set config by AppConfigProvider.init().");
|
|
173
173
|
return J.config;
|
|
174
174
|
}
|
|
@@ -210,7 +210,7 @@ class ye {
|
|
|
210
210
|
if (e)
|
|
211
211
|
try {
|
|
212
212
|
const s = JSON.parse(e);
|
|
213
|
-
if (!s.availableFor ||
|
|
213
|
+
if (!s.availableFor || Je(v(s.availableFor) || _e(), /* @__PURE__ */ new Date())) {
|
|
214
214
|
if (A(s.data) || Y(s.data))
|
|
215
215
|
throw new Error("Data is empty");
|
|
216
216
|
return s.data;
|
|
@@ -284,7 +284,7 @@ class ye {
|
|
|
284
284
|
const i = localStorage.getItem(s);
|
|
285
285
|
if (i) {
|
|
286
286
|
const o = JSON.parse(i);
|
|
287
|
-
o.availableFor && !
|
|
287
|
+
o.availableFor && !Je(v(o.availableFor) || _e(), /* @__PURE__ */ new Date()) && r.push(s);
|
|
288
288
|
}
|
|
289
289
|
} catch {
|
|
290
290
|
r.push(s);
|
|
@@ -300,7 +300,7 @@ class ye {
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Ve(n) {
|
|
304
304
|
try {
|
|
305
305
|
const r = N.getJwtPayload(n);
|
|
306
306
|
return new Date(r.exp * 1e3);
|
|
@@ -325,7 +325,7 @@ const B = te("__auth_state_private", () => {
|
|
|
325
325
|
function i() {
|
|
326
326
|
e.value = void 0, A(n.value) || n.value.then((o) => {
|
|
327
327
|
const c = N.getJwtPayload(o);
|
|
328
|
-
e.value = c.exp * 1e3 > Date.now() ?
|
|
328
|
+
e.value = c.exp * 1e3 > Date.now() ? nr(c.resourceAccess, (u) => (u == null ? void 0 : u.roles) ?? []) : void 0;
|
|
329
329
|
}).catch(w);
|
|
330
330
|
}
|
|
331
331
|
return {
|
|
@@ -356,7 +356,7 @@ const B = te("__auth_state_private", () => {
|
|
|
356
356
|
if (A(o.jwtToken) && !A(o.jwtTokenUpdater)) {
|
|
357
357
|
const c = o.jwtTokenUpdater();
|
|
358
358
|
o.jwtToken = c, c.then((u) => {
|
|
359
|
-
o.jwtToken = Promise.resolve(u), ye.saveActualDataToStorage("sc.token", u,
|
|
359
|
+
o.jwtToken = Promise.resolve(u), ye.saveActualDataToStorage("sc.token", u, Ve(u)), o.recalculateUserPermissions();
|
|
360
360
|
}).catch(w);
|
|
361
361
|
}
|
|
362
362
|
return o.jwtToken;
|
|
@@ -366,7 +366,7 @@ const B = te("__auth_state_private", () => {
|
|
|
366
366
|
}
|
|
367
367
|
function e(o) {
|
|
368
368
|
const c = B();
|
|
369
|
-
c.jwtToken = Promise.resolve(o), ye.saveActualDataToStorage("sc.token", o,
|
|
369
|
+
c.jwtToken = Promise.resolve(o), ye.saveActualDataToStorage("sc.token", o, Ve(o)), c.recalculateUserPermissions();
|
|
370
370
|
}
|
|
371
371
|
function s() {
|
|
372
372
|
const o = B();
|
|
@@ -376,7 +376,7 @@ const B = te("__auth_state_private", () => {
|
|
|
376
376
|
const c = B();
|
|
377
377
|
!A(c.jwtToken) && A(c.userPermissions) && c.jwtToken.then((f) => {
|
|
378
378
|
const m = N.getJwtPayload(f);
|
|
379
|
-
c.userPermissions = m.exp * 1e3 > Date.now() ?
|
|
379
|
+
c.userPermissions = m.exp * 1e3 > Date.now() ? nr(m.resourceAccess, (a) => (a == null ? void 0 : a.roles) ?? []) : void 0;
|
|
380
380
|
}).catch(w);
|
|
381
381
|
const u = Q(o) ? o.join(" && ") : o;
|
|
382
382
|
if (c.userPermissionsComputedRefs.has(u))
|
|
@@ -384,13 +384,13 @@ const B = te("__auth_state_private", () => {
|
|
|
384
384
|
const p = R(() => {
|
|
385
385
|
const f = (m) => {
|
|
386
386
|
var H;
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
387
|
+
const a = Ir(m, ".");
|
|
388
|
+
if (a.length < 2)
|
|
389
389
|
return !1;
|
|
390
|
-
const [_, d] =
|
|
390
|
+
const [_, d] = a, G = (H = B().userPermissions) == null ? void 0 : H[_];
|
|
391
391
|
return Q(G) && G.includes(d);
|
|
392
392
|
};
|
|
393
|
-
return Q(o) ?
|
|
393
|
+
return Q(o) ? Sr(o, (m) => f(m)) : f(o);
|
|
394
394
|
});
|
|
395
395
|
return c.userPermissionsComputedRefs.set(u, p), p;
|
|
396
396
|
}
|
|
@@ -478,7 +478,7 @@ class oe extends b {
|
|
|
478
478
|
this.code = (e == null ? void 0 : e.code) ?? "";
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
class
|
|
481
|
+
class lr extends oe {
|
|
482
482
|
/**
|
|
483
483
|
* Инициализирует экземпляр класса {@link CatalogableItem}.
|
|
484
484
|
*
|
|
@@ -497,7 +497,7 @@ class cr extends oe {
|
|
|
497
497
|
this.slug = (e == null ? void 0 : e.slug) ?? "";
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
class de extends
|
|
500
|
+
class de extends lr {
|
|
501
501
|
/**
|
|
502
502
|
* Инициализирует экземпляр класса {@link PrimaryCatalogableItem}.
|
|
503
503
|
*
|
|
@@ -539,7 +539,7 @@ class ge extends de {
|
|
|
539
539
|
this.isHidden = (e == null ? void 0 : e.isHidden) ?? !1, this.parentCategoryId = e == null ? void 0 : e.parentCategoryId, this.properties = e == null ? void 0 : e.properties, this.type = "category", this.currencyRates = e != null && e.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([s, i]) => [xr(s), i])) : void 0;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
var
|
|
542
|
+
var ur = /* @__PURE__ */ ((n) => (n.K0 = "k0", n.K1 = "k1", n.K2 = "k2", n.K3 = "k3", n.K4 = "k4", n.Retail = "retail", n))(ur || {});
|
|
543
543
|
class P extends b {
|
|
544
544
|
/**
|
|
545
545
|
* Инициализирует экземпляр класса {@link Reference}.
|
|
@@ -564,7 +564,7 @@ class Re extends P {
|
|
|
564
564
|
* Возвращает значение справочника коэффициента розничной цены.
|
|
565
565
|
*/
|
|
566
566
|
static getRetailPriceCoefficient() {
|
|
567
|
-
return { id: -2, slug:
|
|
567
|
+
return { id: -2, slug: ur.Retail, name: "Розн. цена", guid: "", isNewRec: Lr(!0) };
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
class Me {
|
|
@@ -597,7 +597,7 @@ class Me {
|
|
|
597
597
|
this.coefficient = new Re(r == null ? void 0 : r.coefficient), this.value = (r == null ? void 0 : r.value) ?? 0, this.cost = (r == null ? void 0 : r.cost) ?? 0, this.percent = (r == null ? void 0 : r.percent) ?? 0, this.readOnly = (r == null ? void 0 : r.readOnly) ?? !0;
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
class
|
|
600
|
+
class pr {
|
|
601
601
|
/**
|
|
602
602
|
* Инициализирует экземпляр класса {@link GeoCoordinates}.
|
|
603
603
|
*
|
|
@@ -646,7 +646,7 @@ class De extends P {
|
|
|
646
646
|
* Координаты склада.
|
|
647
647
|
*/
|
|
648
648
|
t(this, "coordinates");
|
|
649
|
-
this.address = (e == null ? void 0 : e.address) ?? "", this.isMain = (e == null ? void 0 : e.isMain) ?? !1, this.deliveryTypes = ((s = e == null ? void 0 : e.deliveryTypes) == null ? void 0 : s.map((i) => new X(i))) ?? [], this.regions = (e == null ? void 0 : e.regions) ?? [], this.coordinates = new
|
|
649
|
+
this.address = (e == null ? void 0 : e.address) ?? "", this.isMain = (e == null ? void 0 : e.isMain) ?? !1, this.deliveryTypes = ((s = e == null ? void 0 : e.deliveryTypes) == null ? void 0 : s.map((i) => new X(i))) ?? [], this.regions = (e == null ? void 0 : e.regions) ?? [], this.coordinates = new pr(e == null ? void 0 : e.coordinates);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
class zr {
|
|
@@ -667,7 +667,7 @@ class zr {
|
|
|
667
667
|
this.warehouse = new De(r == null ? void 0 : r.warehouse), this.count = (r == null ? void 0 : r.count) ?? 0;
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
class Wr extends
|
|
670
|
+
class Wr extends lr {
|
|
671
671
|
/**
|
|
672
672
|
* Инициализирует экземпляр класса {@link HiddenCatalogableItem}.
|
|
673
673
|
*
|
|
@@ -961,7 +961,7 @@ class je {
|
|
|
961
961
|
return new r(e);
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
const
|
|
964
|
+
const S = class S {
|
|
965
965
|
/**
|
|
966
966
|
* Инициализирует экземпляр класса {@link HttpRequester}.
|
|
967
967
|
*/
|
|
@@ -1008,7 +1008,7 @@ const a = class a {
|
|
|
1008
1008
|
* @param request Данные запроса.
|
|
1009
1009
|
*/
|
|
1010
1010
|
// eslint-disable-next-line class-methods-use-this
|
|
1011
|
-
t(this, "dataConverterRequestInterceptor", (r) => (r.method && (r.method === "get" && r.params && (r.params =
|
|
1011
|
+
t(this, "dataConverterRequestInterceptor", (r) => (r.method && (r.method === "get" && r.params && (r.params = We(r.params)), ["put", "patch", "post"].includes(_r(r.method)) && r.data && (r.data = We(r.data))), r));
|
|
1012
1012
|
/**
|
|
1013
1013
|
* Перехватчик ошибок ответов на запрос.
|
|
1014
1014
|
*
|
|
@@ -1027,7 +1027,7 @@ const a = class a {
|
|
|
1027
1027
|
// eslint-disable-next-line class-methods-use-this
|
|
1028
1028
|
t(this, "dataConverterResponseInterceptor", (r) => (r.data && (r.data = Fe(r.data)), r));
|
|
1029
1029
|
const r = T.getConfig().version;
|
|
1030
|
-
this.errorResponseHandler =
|
|
1030
|
+
this.errorResponseHandler = S.defaultErrorsResponseHandler, this.httpClient = Er.create({
|
|
1031
1031
|
headers: {
|
|
1032
1032
|
"APP-VERSION": `${r.name} (${r.version}, ${O(r.date, T.getConfig().dateFormats.uiDate)})`,
|
|
1033
1033
|
Accept: "application/json",
|
|
@@ -1038,7 +1038,7 @@ const a = class a {
|
|
|
1038
1038
|
(e) => Promise.reject(e)
|
|
1039
1039
|
), this.interceptorIds.response.convertHttpErrorResponseInterceptor = this.httpClient.interceptors.response.use(
|
|
1040
1040
|
(e) => e,
|
|
1041
|
-
(e) =>
|
|
1041
|
+
(e) => S.convertHttpErrorResponse(e)
|
|
1042
1042
|
), this.interceptorIds.response.authErrorsResponseInterceptor = this.httpClient.interceptors.response.use((e) => e, this.authErrorsResponseInterceptors), this.interceptorIds.response.dataConverterResponseInterceptor = this.httpClient.interceptors.response.use(
|
|
1043
1043
|
this.dataConverterResponseInterceptor,
|
|
1044
1044
|
(e) => Promise.reject(e)
|
|
@@ -1050,7 +1050,7 @@ const a = class a {
|
|
|
1050
1050
|
* @param handler Ссылка на функцию-обработчик ошибок.
|
|
1051
1051
|
*/
|
|
1052
1052
|
static setDefaultErrorsResponseHandler(r) {
|
|
1053
|
-
|
|
1053
|
+
S.defaultErrorsResponseHandler = r;
|
|
1054
1054
|
}
|
|
1055
1055
|
/**
|
|
1056
1056
|
* Возвращает экземпляр объекта текущего класса.
|
|
@@ -1058,7 +1058,7 @@ const a = class a {
|
|
|
1058
1058
|
* @param type Тип данных, которыми оперирует метод.
|
|
1059
1059
|
*/
|
|
1060
1060
|
static getInstance(r) {
|
|
1061
|
-
return Object.prototype.hasOwnProperty.call(
|
|
1061
|
+
return Object.prototype.hasOwnProperty.call(S.instances, r.name) || (S.instances[r.name] = je.simpleInstanceInitializer(r)), S.instances[r.name];
|
|
1062
1062
|
}
|
|
1063
1063
|
/**
|
|
1064
1064
|
* Конвертирует данные ошибки HTTP запроса в более упрощённую и часто используемую форму.
|
|
@@ -1156,15 +1156,15 @@ const a = class a {
|
|
|
1156
1156
|
* Экземпляр объекта текущего класса.
|
|
1157
1157
|
*/
|
|
1158
1158
|
// eslint-disable-next-line no-use-before-define
|
|
1159
|
-
t(
|
|
1159
|
+
t(S, "instances", {}), /**
|
|
1160
1160
|
* Базовый обработчик ошибок выполнения запросов.
|
|
1161
1161
|
*
|
|
1162
1162
|
* @param error Данные об ошибке.
|
|
1163
1163
|
* @param validationFieldResultData Список полей, для которых необходимо установить данные об ошибках валидации в случае ошибок в запросах.
|
|
1164
1164
|
* @param disableNotifications Признак необходимости отключить уведомления об ошибках.
|
|
1165
1165
|
*/
|
|
1166
|
-
t(
|
|
1167
|
-
let h =
|
|
1166
|
+
t(S, "defaultErrorsResponseHandler", w);
|
|
1167
|
+
let h = S;
|
|
1168
1168
|
class Ft extends h {
|
|
1169
1169
|
/**
|
|
1170
1170
|
* Возвращает содержимое корзины указанного клиента.
|
|
@@ -1300,7 +1300,7 @@ class z extends ge {
|
|
|
1300
1300
|
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new z(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new I(o));
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
|
-
class
|
|
1303
|
+
class hr extends b {
|
|
1304
1304
|
/**
|
|
1305
1305
|
* Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
|
|
1306
1306
|
*
|
|
@@ -1315,7 +1315,7 @@ class pr extends b {
|
|
|
1315
1315
|
this.updatedAt = C(e == null ? void 0 : e.updatedAt) ? v(e.updatedAt) : e == null ? void 0 : e.updatedAt;
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
|
-
class Xr extends
|
|
1318
|
+
class Xr extends hr {
|
|
1319
1319
|
/**
|
|
1320
1320
|
* Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
|
|
1321
1321
|
*
|
|
@@ -1384,7 +1384,7 @@ class Zr extends b {
|
|
|
1384
1384
|
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) ? v(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 U(e == null ? void 0 : e.owner), this.deletedAt = C(e == null ? void 0 : e.deletedAt) ? v(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
|
-
class W extends
|
|
1387
|
+
class W extends hr {
|
|
1388
1388
|
/**
|
|
1389
1389
|
* Инициализирует экземпляр класса {@link PriceTemplate}.
|
|
1390
1390
|
*
|
|
@@ -1442,7 +1442,7 @@ class Z extends I {
|
|
|
1442
1442
|
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.costSource = (e == null ? void 0 : e.costSource) ?? Ge.Product, this.discount = e != null && e.discount ? new Zr(e.discount) : void 0, this.priceTemplate = e != null && e.priceTemplate ? new W(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;
|
|
1443
1443
|
}
|
|
1444
1444
|
}
|
|
1445
|
-
class
|
|
1445
|
+
class gr {
|
|
1446
1446
|
/**
|
|
1447
1447
|
* Инициализирует экземпляр класса {@link ContactLinks}.
|
|
1448
1448
|
*
|
|
@@ -1490,7 +1490,7 @@ class ce extends b {
|
|
|
1490
1490
|
* @inheritDoc
|
|
1491
1491
|
*/
|
|
1492
1492
|
t(this, "isRegionalDirector");
|
|
1493
|
-
this.salesDirection = e != null && e.salesDirection ? new x(e.salesDirection) : new x(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new
|
|
1493
|
+
this.salesDirection = e != null && e.salesDirection ? new x(e.salesDirection) : new x(), this.photo = e == null ? void 0 : e.photo, this.contacts = e != null && e.contacts ? new gr(e.contacts) : void 0, this.isDefault = (e == null ? void 0 : e.isDefault) ?? !1, this.isRegionalDirector = (e == null ? void 0 : e.isRegionalDirector) ?? !1;
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
1496
|
class He extends P {
|
|
@@ -1609,7 +1609,7 @@ class we extends rt {
|
|
|
1609
1609
|
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new we(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new Z(o));
|
|
1610
1610
|
}
|
|
1611
1611
|
}
|
|
1612
|
-
class
|
|
1612
|
+
class mr {
|
|
1613
1613
|
/**
|
|
1614
1614
|
* Инициализирует экземпляр класса {@link PriceTemplateICatalogableItem}.
|
|
1615
1615
|
*
|
|
@@ -1627,7 +1627,7 @@ class gr {
|
|
|
1627
1627
|
this.priceCoefficient = (r == null ? void 0 : r.priceCoefficient) && new Re(r.priceCoefficient), this.increasePercent = r == null ? void 0 : r.increasePercent;
|
|
1628
1628
|
}
|
|
1629
1629
|
}
|
|
1630
|
-
class
|
|
1630
|
+
class ae extends mr {
|
|
1631
1631
|
/**
|
|
1632
1632
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
1633
1633
|
*
|
|
@@ -1642,7 +1642,7 @@ class Se extends gr {
|
|
|
1642
1642
|
this.productCategory = new ge(e == null ? void 0 : e.productCategory);
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
|
-
class
|
|
1645
|
+
class Be extends b {
|
|
1646
1646
|
/**
|
|
1647
1647
|
* Инициализирует экземпляр класса {@link Curator}.
|
|
1648
1648
|
*
|
|
@@ -1662,7 +1662,7 @@ class mr extends b {
|
|
|
1662
1662
|
* @inheritDoc
|
|
1663
1663
|
*/
|
|
1664
1664
|
t(this, "curatedDirection");
|
|
1665
|
-
this.photo = e.photo, this.contacts = new
|
|
1665
|
+
this.photo = e.photo, this.contacts = new gr(e.contacts), this.curatedDirection = new He(e.curatedDirection);
|
|
1666
1666
|
}
|
|
1667
1667
|
}
|
|
1668
1668
|
class ee extends P {
|
|
@@ -1682,7 +1682,7 @@ class le extends P {
|
|
|
1682
1682
|
e && (this.country = new ee(e.country));
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
1685
|
-
class
|
|
1685
|
+
class Ee extends P {
|
|
1686
1686
|
/**
|
|
1687
1687
|
* Инициализирует экземпляр класса {@link CityWithRegionAndCountry}.
|
|
1688
1688
|
*
|
|
@@ -1782,7 +1782,7 @@ class me extends fr {
|
|
|
1782
1782
|
* @inheritDoc
|
|
1783
1783
|
*/
|
|
1784
1784
|
t(this, "curators");
|
|
1785
|
-
this.salesDirection = new x(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
|
|
1785
|
+
this.salesDirection = new x(e == null ? void 0 : e.salesDirection), this.debt = (e == null ? void 0 : e.debt) ?? 0, this.alternativeName = (e == null ? void 0 : e.alternativeName) ?? "", this.city = new Ee(e == null ? void 0 : e.city), this.comment = e == null ? void 0 : e.comment, this.isPhoneApproved = (e == null ? void 0 : e.isPhoneApproved) ?? !1, this.isEmailApproved = (e == null ? void 0 : e.isEmailApproved) ?? !1, this.managers = ((s = e == null ? void 0 : e.managers) == null ? void 0 : s.map((o) => new ce(o))) ?? [], this.curators = ((i = e == null ? void 0 : e.curators) == null ? void 0 : i.map((o) => new Be(o))) ?? void 0;
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
1788
|
class se extends j {
|
|
@@ -1812,7 +1812,7 @@ class se extends j {
|
|
|
1812
1812
|
this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.deletedAt = C(e == null ? void 0 : e.deletedAt) ? v(e.deletedAt) : e == null ? void 0 : e.deletedAt, this.client = new me(e == null ? void 0 : e.client), this.priceTemplate = new W(e == null ? void 0 : e.priceTemplate);
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
|
-
class
|
|
1815
|
+
class Se extends mr {
|
|
1816
1816
|
/**
|
|
1817
1817
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
1818
1818
|
*
|
|
@@ -1988,7 +1988,7 @@ class ne extends b {
|
|
|
1988
1988
|
this.description = e == null ? void 0 : e.description, this.canChangeLowCost = (e == null ? void 0 : e.canChangeLowCost) ?? !1, this.parentRoleId = e == null ? void 0 : e.parentRoleId;
|
|
1989
1989
|
}
|
|
1990
1990
|
}
|
|
1991
|
-
class
|
|
1991
|
+
class Ke {
|
|
1992
1992
|
/**
|
|
1993
1993
|
* Инициализирует экземпляр класса {@link PricingRoleCategoryRule}.
|
|
1994
1994
|
*
|
|
@@ -2773,8 +2773,8 @@ class Jt extends h {
|
|
|
2773
2773
|
);
|
|
2774
2774
|
}
|
|
2775
2775
|
}
|
|
2776
|
-
var
|
|
2777
|
-
class
|
|
2776
|
+
var ze = /* @__PURE__ */ ((n) => (n.BeginWith = "bw", n.Contains = "cn", n.Custom = "custom", n.EndsWith = "ew", n.Equals = "eq", n.GreaterOrEqual = "ge", n.GreaterThan = "gt", n.InList = "in", n.LessOrEqual = "le", n.LessThan = "lt", n.NotBeginWith = "bn", n.NotContains = "nc", n.NotEndsWith = "en", n.NotEqual = "ne", n.NotInList = "ni", n.NotNull = "nn", n.Null = "nu", n))(ze || {});
|
|
2777
|
+
class Qe {
|
|
2778
2778
|
/**
|
|
2779
2779
|
* Инициализирует экземпляр класса {@link FilterItem}.
|
|
2780
2780
|
*
|
|
@@ -2793,7 +2793,7 @@ class Ke {
|
|
|
2793
2793
|
* Значение с которым сравнивается поле.
|
|
2794
2794
|
*/
|
|
2795
2795
|
t(this, "value");
|
|
2796
|
-
this.field = (r == null ? void 0 : r.field) ?? "", this.op = (r == null ? void 0 : r.op) ??
|
|
2796
|
+
this.field = (r == null ? void 0 : r.field) ?? "", this.op = (r == null ? void 0 : r.op) ?? ze.Equals, this.value = (r == null ? void 0 : r.value) ?? "";
|
|
2797
2797
|
}
|
|
2798
2798
|
/**
|
|
2799
2799
|
* Преобразует фильтр в примитивное представление для API.
|
|
@@ -2828,7 +2828,7 @@ class ue {
|
|
|
2828
2828
|
*/
|
|
2829
2829
|
t(this, "groups");
|
|
2830
2830
|
var e, s;
|
|
2831
|
-
this.groupOp = (r == null ? void 0 : r.groupOp) ?? "and", this.filters = ((e = r == null ? void 0 : r.filters) == null ? void 0 : e.map((i) => new
|
|
2831
|
+
this.groupOp = (r == null ? void 0 : r.groupOp) ?? "and", this.filters = ((e = r == null ? void 0 : r.filters) == null ? void 0 : e.map((i) => new Qe(i))) ?? [], this.groups = ((s = r == null ? void 0 : r.groups) == null ? void 0 : s.map((i) => new ue(i))) ?? [];
|
|
2832
2832
|
}
|
|
2833
2833
|
/**
|
|
2834
2834
|
* Преобразует группу фильтров в примитивное представление для API.
|
|
@@ -2838,7 +2838,7 @@ class ue {
|
|
|
2838
2838
|
toPrimitive() {
|
|
2839
2839
|
return {
|
|
2840
2840
|
groupOp: this.groupOp,
|
|
2841
|
-
filters: this.filters.map((r) => r instanceof
|
|
2841
|
+
filters: this.filters.map((r) => r instanceof Qe && Ue(r.toPrimitive) ? r.toPrimitive() : r),
|
|
2842
2842
|
groups: this.groups.map((r) => r instanceof ue ? r.toPrimitive() : r)
|
|
2843
2843
|
};
|
|
2844
2844
|
}
|
|
@@ -2935,7 +2935,7 @@ class Vt extends Te {
|
|
|
2935
2935
|
return this.get(
|
|
2936
2936
|
`/internal/price/templates/${r}/products`,
|
|
2937
2937
|
{},
|
|
2938
|
-
(e) => e.data.map((s) => new
|
|
2938
|
+
(e) => e.data.map((s) => new Se(s))
|
|
2939
2939
|
);
|
|
2940
2940
|
}
|
|
2941
2941
|
/**
|
|
@@ -2947,7 +2947,7 @@ class Vt extends Te {
|
|
|
2947
2947
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_product_get
|
|
2948
2948
|
*/
|
|
2949
2949
|
getProductTemplatePrice(r, e) {
|
|
2950
|
-
return this.get(`/internal/price/templates/${r}/products/${e}`, {}, (s) => new
|
|
2950
|
+
return this.get(`/internal/price/templates/${r}/products/${e}`, {}, (s) => new Se(s.data));
|
|
2951
2951
|
}
|
|
2952
2952
|
/**
|
|
2953
2953
|
* Сохраняет цену на продукт в шаблоне прайс-листа.
|
|
@@ -2966,7 +2966,7 @@ class Vt extends Te {
|
|
|
2966
2966
|
price_coefficient_id: (i = s.coefficient) == null ? void 0 : i.id,
|
|
2967
2967
|
increase_percent: s.value
|
|
2968
2968
|
},
|
|
2969
|
-
(o) => new
|
|
2969
|
+
(o) => new Se(o.data)
|
|
2970
2970
|
);
|
|
2971
2971
|
}
|
|
2972
2972
|
/**
|
|
@@ -2991,7 +2991,7 @@ class Vt extends Te {
|
|
|
2991
2991
|
return this.get(
|
|
2992
2992
|
`/internal/price/templates/${r}/categories`,
|
|
2993
2993
|
{},
|
|
2994
|
-
(e) => e.data.map((s) => new
|
|
2994
|
+
(e) => e.data.map((s) => new ae(s))
|
|
2995
2995
|
);
|
|
2996
2996
|
}
|
|
2997
2997
|
/**
|
|
@@ -3006,7 +3006,7 @@ class Vt extends Te {
|
|
|
3006
3006
|
return this.get(
|
|
3007
3007
|
`/internal/price/templates/${r}/categories/${e}`,
|
|
3008
3008
|
{},
|
|
3009
|
-
(s) => new
|
|
3009
|
+
(s) => new ae(s.data)
|
|
3010
3010
|
);
|
|
3011
3011
|
}
|
|
3012
3012
|
/**
|
|
@@ -3032,7 +3032,7 @@ class Vt extends Te {
|
|
|
3032
3032
|
},
|
|
3033
3033
|
params: i ? { recursively: !0 } : {}
|
|
3034
3034
|
},
|
|
3035
|
-
(c) => new
|
|
3035
|
+
(c) => new ae(c.data)
|
|
3036
3036
|
);
|
|
3037
3037
|
}
|
|
3038
3038
|
/**
|
|
@@ -3128,7 +3128,7 @@ class Kt extends h {
|
|
|
3128
3128
|
return this.get(
|
|
3129
3129
|
`/internal/price/roles/rules/categories/${r}`,
|
|
3130
3130
|
{},
|
|
3131
|
-
(e) => e.data.map((s) => new
|
|
3131
|
+
(e) => e.data.map((s) => new Ke(s))
|
|
3132
3132
|
);
|
|
3133
3133
|
}
|
|
3134
3134
|
/**
|
|
@@ -3143,7 +3143,7 @@ class Kt extends h {
|
|
|
3143
3143
|
return this.patch(
|
|
3144
3144
|
`/internal/price/roles/rules/categories/${r}`,
|
|
3145
3145
|
e,
|
|
3146
|
-
(s) => s.data.map((i) => new
|
|
3146
|
+
(s) => s.data.map((i) => new Ke(i))
|
|
3147
3147
|
);
|
|
3148
3148
|
}
|
|
3149
3149
|
}
|
|
@@ -3519,7 +3519,7 @@ class Qt extends Te {
|
|
|
3519
3519
|
return this.post(`/internal/catalog/categories/${r}/image`, { image: e });
|
|
3520
3520
|
}
|
|
3521
3521
|
}
|
|
3522
|
-
function
|
|
3522
|
+
function Ye(n, r, e) {
|
|
3523
3523
|
let s;
|
|
3524
3524
|
return n.some((i) => {
|
|
3525
3525
|
if (i.type === e && i.id === r)
|
|
@@ -3528,28 +3528,28 @@ function Qe(n, r, e) {
|
|
|
3528
3528
|
return !1;
|
|
3529
3529
|
const o = i;
|
|
3530
3530
|
if (o.products && o.products.length > 0) {
|
|
3531
|
-
const c =
|
|
3531
|
+
const c = Ye(o.products, r, e);
|
|
3532
3532
|
if (c)
|
|
3533
3533
|
return s = c, !0;
|
|
3534
3534
|
}
|
|
3535
3535
|
if (o.categories && o.categories.length > 0) {
|
|
3536
|
-
const c =
|
|
3536
|
+
const c = Ye(o.categories, r, e);
|
|
3537
3537
|
if (c)
|
|
3538
3538
|
return s = c, !0;
|
|
3539
3539
|
}
|
|
3540
3540
|
return !1;
|
|
3541
3541
|
}), s;
|
|
3542
3542
|
}
|
|
3543
|
-
function
|
|
3543
|
+
function Xe(n) {
|
|
3544
3544
|
const r = [];
|
|
3545
3545
|
return n.forEach((e) => {
|
|
3546
3546
|
if (r.push(e), e.type === "category") {
|
|
3547
3547
|
const s = e;
|
|
3548
|
-
s.products && s.products.length > 0 && r.push(...
|
|
3548
|
+
s.products && s.products.length > 0 && r.push(...Xe(s.products)), s.categories && s.categories.length > 0 && r.push(...Xe(s.categories));
|
|
3549
3549
|
}
|
|
3550
3550
|
}), r;
|
|
3551
3551
|
}
|
|
3552
|
-
var ct = /* @__PURE__ */ ((n) => (n.LastOrder = "last_order", n.Contacts = "contacts", n.PartnerGroups = "partner_groups", n.PreferredDeliveryType = "preferred_delivery_type", n.SalesDirection = "sales_direction", n.Managers = "managers", n))(ct || {}), q = /* @__PURE__ */ ((n) => (n.Person = "individual", n.Ic = "entrepreneur", n.UlR = "legal", n.UlNr = "non_resident_legal", n))(q || {});
|
|
3552
|
+
var ct = /* @__PURE__ */ ((n) => (n.LastOrder = "last_order", n.Contacts = "contacts", n.PartnerGroups = "partner_groups", n.PreferredDeliveryType = "preferred_delivery_type", n.SalesDirection = "sales_direction", n.Managers = "managers", n.Curators = "curators", n))(ct || {}), q = /* @__PURE__ */ ((n) => (n.Person = "individual", n.Ic = "entrepreneur", n.UlR = "legal", n.UlNr = "non_resident_legal", n))(q || {});
|
|
3553
3553
|
class lt extends P {
|
|
3554
3554
|
}
|
|
3555
3555
|
class wr extends P {
|
|
@@ -3952,10 +3952,10 @@ class Pe extends Xr {
|
|
|
3952
3952
|
* Признак того, что указанный адрес является адресом транспортной компании.
|
|
3953
3953
|
*/
|
|
3954
3954
|
t(this, "isTransportCompanyAddress");
|
|
3955
|
-
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new
|
|
3955
|
+
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new pr(e == null ? void 0 : e.coordinates), this.contacts = ((s = e == null ? void 0 : e.contacts) == null ? void 0 : s.map((i) => new M(i))) ?? [], this.comment = e == null ? void 0 : e.comment, this.operatingHours = e == null ? void 0 : e.operatingHours, this.isOneTime = e == null ? void 0 : e.isOneTime, this.isTransportCompanyAddress = e == null ? void 0 : e.isTransportCompanyAddress;
|
|
3956
3956
|
}
|
|
3957
3957
|
}
|
|
3958
|
-
class
|
|
3958
|
+
class Ze extends me {
|
|
3959
3959
|
/**
|
|
3960
3960
|
* Инициализирует экземпляр класса {@link Client}.
|
|
3961
3961
|
*
|
|
@@ -4120,7 +4120,7 @@ class Xt {
|
|
|
4120
4120
|
*/
|
|
4121
4121
|
t(this, "isExcludedFromMsCallsToClients");
|
|
4122
4122
|
var e, s, i, o, c, u, p, f;
|
|
4123
|
-
this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.alternativeName = r == null ? void 0 : r.alternativeName, this.searchTerm = r == null ? void 0 : r.searchTerm, this.cities = (e = r == null ? void 0 : r.cities) == null ? void 0 : e.map((m) => new
|
|
4123
|
+
this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.alternativeName = r == null ? void 0 : r.alternativeName, this.searchTerm = r == null ? void 0 : r.searchTerm, this.cities = (e = r == null ? void 0 : r.cities) == null ? void 0 : e.map((m) => new Ee(m)), this.region = new le(r == null ? void 0 : r.region), this.country = new ee(r == null ? void 0 : r.country), this.phone = r == null ? void 0 : r.phone, this.email = r == null ? void 0 : r.email, this.isActive = r && Object.prototype.hasOwnProperty.call(r, "isActive") ? r == null ? void 0 : r.isActive : !0, this.createdAt = new k(r == null ? void 0 : r.createdAt), this.lastLoginDate = new k(r == null ? void 0 : r.lastLoginDate), this.lastLoginDateHasOrder = (r == null ? void 0 : r.lastLoginDateHasOrder) ?? void 0, this.managers = ((s = r == null ? void 0 : r.managers) == null ? void 0 : s.map((m) => new Ae(m))) ?? [], this.curators = ((i = r == null ? void 0 : r.curators) == null ? void 0 : i.map((m) => new Be(m))) ?? [], this.salesDirections = (o = r == null ? void 0 : r.salesDirections) == null ? void 0 : o.map((m) => new x(m)), this.contragentInn = r == null ? void 0 : r.contragentInn, this.contragentType = new F(r == null ? void 0 : r.contragentType), this.preferredDeliveryType = new X(r == null ? void 0 : r.preferredDeliveryType), this.partnerGroups = (c = r == null ? void 0 : r.partnerGroups) == null ? void 0 : c.map((m) => new re(m)), this.contact = new qe(r == null ? void 0 : r.contact), this.lastOrder = {
|
|
4124
4124
|
createdAt: new k((u = r == null ? void 0 : r.lastOrder) == null ? void 0 : u.createdAt),
|
|
4125
4125
|
creator: (p = r == null ? void 0 : r.lastOrder) == null ? void 0 : p.creator,
|
|
4126
4126
|
isApproved: (f = r == null ? void 0 : r.lastOrder) == null ? void 0 : f.isApproved
|
|
@@ -4222,33 +4222,37 @@ class Ct extends b {
|
|
|
4222
4222
|
* @param data Данные для первоначальной инициализации.
|
|
4223
4223
|
*/
|
|
4224
4224
|
constructor(e) {
|
|
4225
|
-
var s, i;
|
|
4225
|
+
var s, i, o, c;
|
|
4226
4226
|
super(e);
|
|
4227
4227
|
/**
|
|
4228
|
-
*
|
|
4228
|
+
* @inheritDoc
|
|
4229
4229
|
*/
|
|
4230
4230
|
t(this, "contacts", []);
|
|
4231
4231
|
/**
|
|
4232
|
-
*
|
|
4232
|
+
* @inheritDoc
|
|
4233
4233
|
*/
|
|
4234
4234
|
t(this, "preferredDeliveryType");
|
|
4235
4235
|
/**
|
|
4236
|
-
*
|
|
4236
|
+
* @inheritDoc
|
|
4237
4237
|
*/
|
|
4238
4238
|
t(this, "partnerGroups", []);
|
|
4239
4239
|
/**
|
|
4240
|
-
*
|
|
4240
|
+
* @inheritDoc
|
|
4241
4241
|
*/
|
|
4242
4242
|
t(this, "lastOrder");
|
|
4243
4243
|
/**
|
|
4244
|
-
*
|
|
4244
|
+
* @inheritDoc
|
|
4245
4245
|
*/
|
|
4246
4246
|
t(this, "salesDirection");
|
|
4247
4247
|
/**
|
|
4248
|
-
*
|
|
4248
|
+
* @inheritDoc
|
|
4249
4249
|
*/
|
|
4250
4250
|
t(this, "managers");
|
|
4251
|
-
|
|
4251
|
+
/**
|
|
4252
|
+
* @inheritDoc
|
|
4253
|
+
*/
|
|
4254
|
+
t(this, "curators");
|
|
4255
|
+
this.contacts = ((s = e.contacts) == null ? void 0 : s.map((u) => new M(u))) ?? void 0, this.lastOrder = e.lastOrder ? new Ar(e.lastOrder) : void 0, this.partnerGroups = ((i = e.partnerGroups) == null ? void 0 : i.map((u) => new re(u))) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new X(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new x(e.salesDirection) : void 0, this.managers = ((o = e.managers) == null ? void 0 : o.map((u) => new ce(u))) ?? void 0, this.curators = ((c = e.curators) == null ? void 0 : c.map((u) => new Be(u))) ?? void 0;
|
|
4252
4256
|
}
|
|
4253
4257
|
}
|
|
4254
4258
|
class vt {
|
|
@@ -4348,7 +4352,7 @@ class L extends Te {
|
|
|
4348
4352
|
* @param contragent Данные о контрагенте клиента.
|
|
4349
4353
|
*/
|
|
4350
4354
|
static transformContragentClientDataToRequest(r) {
|
|
4351
|
-
var c, u, p, f, m,
|
|
4355
|
+
var c, u, p, f, m, a, _, d;
|
|
4352
4356
|
let e;
|
|
4353
4357
|
const s = r, i = r, o = r;
|
|
4354
4358
|
switch (r.opf.slug) {
|
|
@@ -4395,7 +4399,7 @@ class L extends Te {
|
|
|
4395
4399
|
name: o.name,
|
|
4396
4400
|
alternative_name: o.alternativeName,
|
|
4397
4401
|
partner_group_id: (m = o.partnerGroup) == null ? void 0 : m.id,
|
|
4398
|
-
manager_id: (
|
|
4402
|
+
manager_id: (a = o.manager) == null ? void 0 : a.id,
|
|
4399
4403
|
comment: o.comment,
|
|
4400
4404
|
director_name: o.directorName,
|
|
4401
4405
|
director_position: o.directorPosition,
|
|
@@ -4463,7 +4467,7 @@ class L extends Te {
|
|
|
4463
4467
|
* @see /doc/api/internal#/Клиенты/api_internal_client_get_full_info
|
|
4464
4468
|
*/
|
|
4465
4469
|
getClient(r) {
|
|
4466
|
-
return this.get(`/internal/clients/${r}`, {}, (e) => new
|
|
4470
|
+
return this.get(`/internal/clients/${r}`, {}, (e) => new Ze(e.data));
|
|
4467
4471
|
}
|
|
4468
4472
|
/**
|
|
4469
4473
|
* Возвращает данные о клиентах, удовлетворяющих указанным параметрам поиска.
|
|
@@ -4491,7 +4495,7 @@ class L extends Te {
|
|
|
4491
4495
|
return this.getClientsList({
|
|
4492
4496
|
groupOp: "and",
|
|
4493
4497
|
groups: [],
|
|
4494
|
-
filters: [{ field: "phone", op:
|
|
4498
|
+
filters: [{ field: "phone", op: ze.Contains, value: r }]
|
|
4495
4499
|
});
|
|
4496
4500
|
}
|
|
4497
4501
|
/**
|
|
@@ -4528,7 +4532,7 @@ class L extends Te {
|
|
|
4528
4532
|
* @see /doc/api/internal#/Клиенты/api_internal_client_create
|
|
4529
4533
|
*/
|
|
4530
4534
|
createClientCommonData(r, e = {}) {
|
|
4531
|
-
return this.post("/internal/clients", L.transformClientDataToRequest(r), (s) => new
|
|
4535
|
+
return this.post("/internal/clients", L.transformClientDataToRequest(r), (s) => new Ze(s.data), e);
|
|
4532
4536
|
}
|
|
4533
4537
|
/**
|
|
4534
4538
|
* Обновляет данные указанного клиента.
|
|
@@ -5196,7 +5200,7 @@ const K = class K {
|
|
|
5196
5200
|
* Список единиц измерения линейной величины.
|
|
5197
5201
|
*/
|
|
5198
5202
|
t(K, "linearValues", ["пог.м.", "м.", "м2"]);
|
|
5199
|
-
let
|
|
5203
|
+
let er = K;
|
|
5200
5204
|
class is {
|
|
5201
5205
|
/**
|
|
5202
5206
|
* Генерирует и возвращает данные-заглушку неопределённого менеджера.
|
|
@@ -5478,7 +5482,7 @@ class xe {
|
|
|
5478
5482
|
}
|
|
5479
5483
|
const Le = (n) => {
|
|
5480
5484
|
var r, e, s, i, o;
|
|
5481
|
-
return n ?
|
|
5485
|
+
return n ? or(
|
|
5482
5486
|
{
|
|
5483
5487
|
cities: (r = n.cities) == null ? void 0 : r.map((c) => c.id),
|
|
5484
5488
|
clients: (e = n.clients) == null ? void 0 : e.map((c) => c.id),
|
|
@@ -5487,9 +5491,9 @@ const Le = (n) => {
|
|
|
5487
5491
|
salesDirections: (o = n.salesDirections) == null ? void 0 : o.map((c) => c.id),
|
|
5488
5492
|
hideNotActive: n.hideNotActive
|
|
5489
5493
|
},
|
|
5490
|
-
(c) => A(c) || (Q(c) ||
|
|
5494
|
+
(c) => A(c) || (Q(c) || cr(c)) && Y(c)
|
|
5491
5495
|
) : {};
|
|
5492
|
-
},
|
|
5496
|
+
}, rr = (n) => {
|
|
5493
5497
|
const r = {};
|
|
5494
5498
|
return n.from && (n.from.coefficient || n.from.value) && (r.from = {}, n.from.coefficient && (r.from.priceCoefficientId = n.from.coefficient.id), n.from.value && (r.from.increasePercent = n.from.value)), n.to && (n.to.coefficient || n.to.value) && (r.to = {}, n.to.coefficient && (r.to.priceCoefficientId = n.to.coefficient.id), n.to.value && (r.to.increasePercent = n.to.value)), r;
|
|
5495
5499
|
};
|
|
@@ -5507,7 +5511,7 @@ class os extends h {
|
|
|
5507
5511
|
return this.get(
|
|
5508
5512
|
`/internal/price/products/${r}/analyze`,
|
|
5509
5513
|
{
|
|
5510
|
-
...
|
|
5514
|
+
...rr(e),
|
|
5511
5515
|
filters: Le(s)
|
|
5512
5516
|
},
|
|
5513
5517
|
(i) => i.data.map((o) => new xe(o))
|
|
@@ -5526,7 +5530,7 @@ class os extends h {
|
|
|
5526
5530
|
return this.get(
|
|
5527
5531
|
`/internal/price/categories/${r}/analyze`,
|
|
5528
5532
|
{
|
|
5529
|
-
...
|
|
5533
|
+
...rr(e),
|
|
5530
5534
|
filters: Le(s)
|
|
5531
5535
|
},
|
|
5532
5536
|
(i) => i.data.map((o) => new xe(o))
|
|
@@ -5635,19 +5639,19 @@ class cs extends h {
|
|
|
5635
5639
|
*/
|
|
5636
5640
|
getProductPriceHistory(r) {
|
|
5637
5641
|
var i, o, c, u;
|
|
5638
|
-
const e = T.getConfig().dateFormats.api, s =
|
|
5642
|
+
const e = T.getConfig().dateFormats.api, s = or(
|
|
5639
5643
|
Ne(r, {
|
|
5640
5644
|
costDate: {
|
|
5641
5645
|
from: ke((i = r.costDate) == null ? void 0 : i.from) ? O(r.costDate.from, e) : (o = r.costDate) == null ? void 0 : o.from,
|
|
5642
5646
|
to: ke((c = r.costDate) == null ? void 0 : c.to) ? O(r.costDate.to, e) : (u = r.costDate) == null ? void 0 : u.to
|
|
5643
5647
|
}
|
|
5644
5648
|
}),
|
|
5645
|
-
(p) => A(p) || (Q(p) ||
|
|
5649
|
+
(p) => A(p) || (Q(p) || cr(p)) && Y(p)
|
|
5646
5650
|
);
|
|
5647
5651
|
return this.get("/internal/history", s, (p) => he(p.data, (f) => new Tt(f)));
|
|
5648
5652
|
}
|
|
5649
5653
|
}
|
|
5650
|
-
class
|
|
5654
|
+
class tr {
|
|
5651
5655
|
/**
|
|
5652
5656
|
* Инициализирует экземпляр класса {@link RecommendationsList}.
|
|
5653
5657
|
*
|
|
@@ -5679,7 +5683,7 @@ class ls extends h {
|
|
|
5679
5683
|
* @see /docs/api#/operations/api_internal_recommendations_product_category_get
|
|
5680
5684
|
*/
|
|
5681
5685
|
getProductCategoryRecommendations(r) {
|
|
5682
|
-
return this.get(`/internal/recommendations/categories/${r.id}`, {}, (e) => new
|
|
5686
|
+
return this.get(`/internal/recommendations/categories/${r.id}`, {}, (e) => new tr(e.data));
|
|
5683
5687
|
}
|
|
5684
5688
|
/**
|
|
5685
5689
|
* Возвращает данные о рекомендациях указанного продукта.
|
|
@@ -5688,7 +5692,7 @@ class ls extends h {
|
|
|
5688
5692
|
* @see /docs/api#/operations/api_internal_recommendations_product_get
|
|
5689
5693
|
*/
|
|
5690
5694
|
getProductRecommendations(r) {
|
|
5691
|
-
return this.get(`/internal/recommendations/products/${r.id}`, {}, (e) => new
|
|
5695
|
+
return this.get(`/internal/recommendations/products/${r.id}`, {}, (e) => new tr(e.data));
|
|
5692
5696
|
}
|
|
5693
5697
|
/**
|
|
5694
5698
|
* Выполняет сохранение данных о рекомендуемых категориях продуктов.
|
|
@@ -5808,7 +5812,7 @@ class $ extends pe {
|
|
|
5808
5812
|
* @param term Терм поиска.
|
|
5809
5813
|
*/
|
|
5810
5814
|
searchCity(r) {
|
|
5811
|
-
return this.getTypedDataArrayRequester(
|
|
5815
|
+
return this.getTypedDataArrayRequester(Ee, `/internal/references/city-with-region-and-country/search?term=${r}`);
|
|
5812
5816
|
}
|
|
5813
5817
|
/**
|
|
5814
5818
|
* Выполняет поиск данных о регионах по терму в названии.
|
|
@@ -5858,7 +5862,7 @@ class $ extends pe {
|
|
|
5858
5862
|
}
|
|
5859
5863
|
}
|
|
5860
5864
|
const D = te("__references_private", () => {
|
|
5861
|
-
const n = y({}), r = y(void 0), e = y(void 0), s = y(void 0), i = y(void 0), o = y(void 0), c = y(void 0), u = y(void 0), p = y(void 0), f = y(void 0), m = y(void 0),
|
|
5865
|
+
const n = y({}), r = y(void 0), e = y(void 0), s = y(void 0), i = y(void 0), o = y(void 0), c = y(void 0), u = y(void 0), p = y(void 0), f = y(void 0), m = y(void 0), a = y(void 0), _ = y(void 0), d = y(void 0), G = y(void 0), H = y(void 0), $e = y(void 0), l = y(void 0);
|
|
5862
5866
|
return {
|
|
5863
5867
|
/**
|
|
5864
5868
|
* Список загружаемых/загруженных на данный момент значений.
|
|
@@ -5907,7 +5911,7 @@ const D = te("__references_private", () => {
|
|
|
5907
5911
|
/**
|
|
5908
5912
|
* Справочник типов файлов продукктов/категорий.
|
|
5909
5913
|
*/
|
|
5910
|
-
productFileTypeReference:
|
|
5914
|
+
productFileTypeReference: a,
|
|
5911
5915
|
/**
|
|
5912
5916
|
* Справочник типов ресурсов.
|
|
5913
5917
|
*/
|
|
@@ -5989,7 +5993,7 @@ const D = te("__references_private", () => {
|
|
|
5989
5993
|
return !l.salesDirectionsReference && !l.dataLoaderList.salesDirectionsReference && (l.dataLoaderList.salesDirectionsReference = !0, h.getInstance($).getSalesDirections().then((g) => {
|
|
5990
5994
|
l.salesDirectionsReference = g;
|
|
5991
5995
|
}).catch(w)), l.salesDirectionsReference;
|
|
5992
|
-
}),
|
|
5996
|
+
}), a = R(() => {
|
|
5993
5997
|
const l = D();
|
|
5994
5998
|
return !l.sourcePrimaryInterestReference && !l.dataLoaderList.sourcePrimaryInterestReference && (l.dataLoaderList.sourcePrimaryInterestReference = !0, h.getInstance($).getSourcePrimaryInterest().then((g) => {
|
|
5995
5999
|
l.sourcePrimaryInterestReference = g;
|
|
@@ -6068,7 +6072,7 @@ const D = te("__references_private", () => {
|
|
|
6068
6072
|
/**
|
|
6069
6073
|
* Справочник каналов первичного интереса.
|
|
6070
6074
|
*/
|
|
6071
|
-
sourcePrimaryInterestsReference:
|
|
6075
|
+
sourcePrimaryInterestsReference: a,
|
|
6072
6076
|
/**
|
|
6073
6077
|
* Справочник типов доставки.
|
|
6074
6078
|
*/
|
|
@@ -6109,7 +6113,7 @@ class $t {
|
|
|
6109
6113
|
this.name = r.name, this.content = r.content;
|
|
6110
6114
|
}
|
|
6111
6115
|
}
|
|
6112
|
-
class
|
|
6116
|
+
class sr {
|
|
6113
6117
|
/**
|
|
6114
6118
|
* Инициализирует экземпляр класса {@link Seo}.
|
|
6115
6119
|
*
|
|
@@ -6156,7 +6160,7 @@ class ps extends h {
|
|
|
6156
6160
|
* @param resourceId Идентификатор ресурса для которого необходимо получить SEO-данные.
|
|
6157
6161
|
*/
|
|
6158
6162
|
getResourceSeoData(r, e) {
|
|
6159
|
-
return this.get(`/internal/seo/${r.slug}/${e}`, {}, (s) => new
|
|
6163
|
+
return this.get(`/internal/seo/${r.slug}/${e}`, {}, (s) => new sr(s.data));
|
|
6160
6164
|
}
|
|
6161
6165
|
/**
|
|
6162
6166
|
* Выполняет сохранение данных о SEO-параметрах для указанного ресурса.
|
|
@@ -6167,7 +6171,7 @@ class ps extends h {
|
|
|
6167
6171
|
* в случае ошибок в запросах.
|
|
6168
6172
|
*/
|
|
6169
6173
|
saveResourceSeoData(r, e = {}) {
|
|
6170
|
-
return this.post(`/internal/seo/${r.resourceType.slug}/${r.resourceId}`, r, (s) => new
|
|
6174
|
+
return this.post(`/internal/seo/${r.resourceType.slug}/${r.resourceId}`, r, (s) => new sr(s.data), e);
|
|
6171
6175
|
}
|
|
6172
6176
|
/**
|
|
6173
6177
|
* Возвращает {@link Promise} для удаления данных о SEO-параметрах указанного ресурса.
|
|
@@ -6227,7 +6231,7 @@ class hs extends h {
|
|
|
6227
6231
|
}
|
|
6228
6232
|
}
|
|
6229
6233
|
var bt = /* @__PURE__ */ ((n) => (n.Admin = "admin", n.Manager = "manager", n.Operator = "operator", n.Client = "client", n.Guest = "guest", n))(bt || {});
|
|
6230
|
-
class
|
|
6234
|
+
class at extends fr {
|
|
6231
6235
|
/**
|
|
6232
6236
|
* Инициализирует экземпляр класса {@link User}.
|
|
6233
6237
|
*
|
|
@@ -6266,13 +6270,13 @@ class gs extends h {
|
|
|
6266
6270
|
return this.get("internal/users/current-tokens").then((r) => r.accessToken);
|
|
6267
6271
|
}
|
|
6268
6272
|
}
|
|
6269
|
-
class
|
|
6273
|
+
class St extends h {
|
|
6270
6274
|
/**
|
|
6271
6275
|
* Возвращает данные о текущем пользователе.
|
|
6272
6276
|
*/
|
|
6273
6277
|
// eslint-disable-next-line class-methods-use-this
|
|
6274
6278
|
getCurrentUser() {
|
|
6275
|
-
return this.get("/internal/users/info", {}, (r) => new
|
|
6279
|
+
return this.get("/internal/users/info", {}, (r) => new at(r.data));
|
|
6276
6280
|
}
|
|
6277
6281
|
}
|
|
6278
6282
|
const It = te("__user_state_private", () => {
|
|
@@ -6293,7 +6297,7 @@ const It = te("__user_state_private", () => {
|
|
|
6293
6297
|
*/
|
|
6294
6298
|
currentUser: R(() => {
|
|
6295
6299
|
const r = It();
|
|
6296
|
-
return !r.currentUser && !r.dataLoaderList.currentUser && (r.dataLoaderList.currentUser = !0, h.getInstance(
|
|
6300
|
+
return !r.currentUser && !r.dataLoaderList.currentUser && (r.dataLoaderList.currentUser = !0, h.getInstance(St).getCurrentUser().then((e) => {
|
|
6297
6301
|
r.currentUser = e;
|
|
6298
6302
|
}).catch(w).finally(() => {
|
|
6299
6303
|
r.dataLoaderList.currentUser = !1;
|
|
@@ -6335,13 +6339,13 @@ export {
|
|
|
6335
6339
|
Vr as CartItemBase,
|
|
6336
6340
|
Ft as CartProvider,
|
|
6337
6341
|
Gt as CatalogProvider,
|
|
6338
|
-
|
|
6342
|
+
lr as CatalogableItem,
|
|
6339
6343
|
z as Category,
|
|
6340
|
-
|
|
6344
|
+
Ke as CategoryPricingRule,
|
|
6341
6345
|
wr as ChannelPrimaryInterest,
|
|
6342
6346
|
Yt as City,
|
|
6343
|
-
|
|
6344
|
-
|
|
6347
|
+
Ee as CityWithRegionAndCountry,
|
|
6348
|
+
Ze as Client,
|
|
6345
6349
|
Ct as ClientAdditionalData,
|
|
6346
6350
|
we as ClientCategory,
|
|
6347
6351
|
L as ClientDataProvider,
|
|
@@ -6356,7 +6360,7 @@ export {
|
|
|
6356
6360
|
oe as CodedIdentity,
|
|
6357
6361
|
ts as ConfiguratorProvider,
|
|
6358
6362
|
qe as Contact,
|
|
6359
|
-
|
|
6363
|
+
gr as ContactLinks,
|
|
6360
6364
|
M as ContactPerson,
|
|
6361
6365
|
wt as ContactPersonRelated,
|
|
6362
6366
|
ut as ContactPosition,
|
|
@@ -6370,7 +6374,7 @@ export {
|
|
|
6370
6374
|
Ge as CostSourceEnum,
|
|
6371
6375
|
ee as Country,
|
|
6372
6376
|
He as CuratedDirection,
|
|
6373
|
-
|
|
6377
|
+
Be as Curator,
|
|
6374
6378
|
Ce as Currency,
|
|
6375
6379
|
hs as DataSuggestionProvider,
|
|
6376
6380
|
Zt as DataTablePagination,
|
|
@@ -6385,9 +6389,9 @@ export {
|
|
|
6385
6389
|
Zr as DiscountShortInfo,
|
|
6386
6390
|
fs as FieldValidationResultData,
|
|
6387
6391
|
ue as FilterGroup,
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6392
|
+
Qe as FilterItem,
|
|
6393
|
+
ze as FilterOpEnum,
|
|
6394
|
+
pr as GeoCoordinates,
|
|
6391
6395
|
Wr as HiddenCatalogableItem,
|
|
6392
6396
|
pe as HttpCachedRequester,
|
|
6393
6397
|
st as HttpParamsConfig,
|
|
@@ -6416,14 +6420,14 @@ export {
|
|
|
6416
6420
|
xe as PriceAnalyze,
|
|
6417
6421
|
os as PriceAnalyzeProvider,
|
|
6418
6422
|
Re as PriceCoefficient,
|
|
6419
|
-
|
|
6423
|
+
ur as PriceCoefficientEnum,
|
|
6420
6424
|
cs as PriceHistoryDataProvider,
|
|
6421
6425
|
At as PriceHistoryItem,
|
|
6422
6426
|
W as PriceTemplate,
|
|
6423
|
-
|
|
6427
|
+
ae as PriceTemplateCategory,
|
|
6424
6428
|
se as PriceTemplateClient,
|
|
6425
|
-
|
|
6426
|
-
|
|
6429
|
+
mr as PriceTemplateICatalogableItem,
|
|
6430
|
+
Se as PriceTemplateProduct,
|
|
6427
6431
|
Vt as PriceTemplateProvider,
|
|
6428
6432
|
ne as PricingRole,
|
|
6429
6433
|
Kt as PricingRoleProvider,
|
|
@@ -6440,34 +6444,34 @@ export {
|
|
|
6440
6444
|
Yr as PropertyTypeEnum,
|
|
6441
6445
|
E as PropertyValue,
|
|
6442
6446
|
ls as RecommendationsDataProvider,
|
|
6443
|
-
|
|
6447
|
+
tr as RecommendationsList,
|
|
6444
6448
|
P as Reference,
|
|
6445
6449
|
$ as ReferenceDataProvider,
|
|
6446
6450
|
le as Region,
|
|
6447
6451
|
Cr as ResourceType,
|
|
6448
6452
|
x as SalesDirection,
|
|
6449
6453
|
it as SentryConfig,
|
|
6450
|
-
|
|
6454
|
+
sr as Seo,
|
|
6451
6455
|
ps as SeoDataProvider,
|
|
6452
6456
|
vr as SourcePrimaryInterest,
|
|
6453
6457
|
zr as StockCount,
|
|
6454
6458
|
Mt as TemplatesListFilters,
|
|
6455
6459
|
je as TypedInstanceFactory,
|
|
6456
|
-
|
|
6460
|
+
er as UnitsHelper,
|
|
6457
6461
|
rs as UnknownClientDataProvider,
|
|
6458
|
-
|
|
6459
|
-
|
|
6462
|
+
hr as UpdatableNamedIdentity,
|
|
6463
|
+
at as User,
|
|
6460
6464
|
gs as UserAuthDataProvider,
|
|
6461
6465
|
fr as UserCommonInfo,
|
|
6462
|
-
|
|
6466
|
+
St as UserDataProvider,
|
|
6463
6467
|
et as UserPricingRole,
|
|
6464
6468
|
U as UserShortInfo,
|
|
6465
6469
|
bt as UserTypeEnum,
|
|
6466
6470
|
nt as VersionConfig,
|
|
6467
6471
|
De as Warehouse,
|
|
6468
6472
|
ot as WebSocketConfig,
|
|
6469
|
-
|
|
6470
|
-
|
|
6473
|
+
Ye as findCatalogItemByIdRecursive,
|
|
6474
|
+
Xe as flattenCatalogItems,
|
|
6471
6475
|
be as useAuthStateStore,
|
|
6472
6476
|
us as useReferencesStore,
|
|
6473
6477
|
ms as useUserStateStore
|