@snabcentr/common-lib 1.71.6 → 1.72.1
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 +19 -2
- package/dist/sc-common-lib.js +510 -507
- 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/auth/states/auth-state-store.d.ts +19 -1
- package/dist/src/auth/states/auth-state-store.d.ts.map +1 -1
- package/dist/src/config/classes/http-params-config.d.ts +0 -8
- package/dist/src/config/classes/http-params-config.d.ts.map +1 -1
- package/dist/src/config/interfaces/i-http-params-config.d.ts +0 -8
- package/dist/src/config/interfaces/i-http-params-config.d.ts.map +1 -1
- package/dist/src/http/classes/http-requester.d.ts +1 -1
- package/dist/src/http/classes/http-requester.d.ts.map +1 -1
- package/dist/src/price-history/providers/price-history-data-provider.d.ts +0 -4
- package/dist/src/price-history/providers/price-history-data-provider.d.ts.map +1 -1
- package/dist/src/recommendations/providers/recommendations-data-provider.d.ts +0 -4
- package/dist/src/recommendations/providers/recommendations-data-provider.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/sc-common-lib.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var t = (n, r, e) =>
|
|
1
|
+
var Cr = Object.defineProperty;
|
|
2
|
+
var vr = (n, r, e) => r in n ? Cr(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
|
+
var t = (n, r, e) => vr(n, typeof r != "symbol" ? r + "" : r, e);
|
|
4
4
|
import { jwtDecode as Ye } from "jwt-decode";
|
|
5
|
-
import { merge as
|
|
5
|
+
import { merge as me, isUndefined as Pr, isNil as $, noop as w, mapValues as Xe, isArray as K, every as Rr, split as ar, toUpper as Ar, constant as Dr, isString as C, cloneDeep as $r, toLower as Tr, isFunction as Ne, map as ve, forEach as br, isDate as Ie, isEmpty as Pe, omitBy as Ze, isObject as er } from "lodash-es";
|
|
6
6
|
import { objectToCamel as Oe, objectToSnake as Me } from "ts-case-convert";
|
|
7
|
-
import { defineStore as
|
|
8
|
-
import { ref as
|
|
9
|
-
import { parseISO as
|
|
7
|
+
import { defineStore as re } from "pinia";
|
|
8
|
+
import { ref as y, markRaw as _r, computed as R } from "vue";
|
|
9
|
+
import { parseISO as v, format as q, isAfter as Sr, startOfToday as rr, addSeconds as dr, addBusinessDays as Ir, endOfTomorrow as kr, startOfTomorrow as Lr, endOfYesterday as xr, startOfYesterday as Nr, endOfToday as Or, endOfDay as qr, startOfDay as Ur } from "date-fns";
|
|
10
10
|
import Gr from "axios";
|
|
11
|
-
class
|
|
11
|
+
class Q {
|
|
12
12
|
/**
|
|
13
13
|
* Инициализирует экземпляр класса {@link JwtPayload}.
|
|
14
14
|
*
|
|
@@ -99,7 +99,7 @@ class ie {
|
|
|
99
99
|
* @inheritDoc
|
|
100
100
|
*/
|
|
101
101
|
t(this, "email", "");
|
|
102
|
-
|
|
102
|
+
me(this, r);
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Возвращает данные полезной нагрузки для указанного JWT-токена.
|
|
@@ -107,11 +107,11 @@ class ie {
|
|
|
107
107
|
* @param jwtToken JWT-ключ доступа.
|
|
108
108
|
*/
|
|
109
109
|
static getJwtPayload(r) {
|
|
110
|
-
const e = Ye(r), s = new
|
|
110
|
+
const e = Ye(r), s = new Q(Oe(e));
|
|
111
111
|
return s.resourceAccess = e.resource_access, s;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
class
|
|
114
|
+
class Lt extends Q {
|
|
115
115
|
/**
|
|
116
116
|
* Инициализирует экземпляр класса {@link DetailedJwtPayload}.
|
|
117
117
|
*
|
|
@@ -143,7 +143,7 @@ class kt extends ie {
|
|
|
143
143
|
* @inheritDoc
|
|
144
144
|
*/
|
|
145
145
|
t(this, "address");
|
|
146
|
-
|
|
146
|
+
me(this, e);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Возвращает данные полезной нагрузки для указанного JWT-токена.
|
|
@@ -151,26 +151,26 @@ class kt extends ie {
|
|
|
151
151
|
* @param jwtToken JWT-ключ доступа.
|
|
152
152
|
*/
|
|
153
153
|
static getJwtPayload(e) {
|
|
154
|
-
return new
|
|
154
|
+
return new Q(Oe(Ye(e)));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
const
|
|
157
|
+
const E = class E {
|
|
158
158
|
/**
|
|
159
159
|
* Инициализирует и возвращает конфигурацию приложения.
|
|
160
160
|
*
|
|
161
161
|
* @param config Данные для первоначальной инициализации.
|
|
162
162
|
*/
|
|
163
163
|
static init(r) {
|
|
164
|
-
|
|
164
|
+
E.config = r;
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* Возвращает текущую конфигурацию приложения.
|
|
168
168
|
*/
|
|
169
169
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
170
170
|
static getConfig() {
|
|
171
|
-
if (
|
|
171
|
+
if (Pr(E.config))
|
|
172
172
|
throw new Error("Config is undefined. Please set config by AppConfigProvider.init().");
|
|
173
|
-
return
|
|
173
|
+
return E.config;
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
176
176
|
* Выполняет загрузку конфигурации по указанному пути.
|
|
@@ -189,11 +189,17 @@ const W = class W {
|
|
|
189
189
|
/**
|
|
190
190
|
* Конфигурация приложения.
|
|
191
191
|
*/
|
|
192
|
-
t(
|
|
193
|
-
let
|
|
194
|
-
const
|
|
195
|
-
var
|
|
196
|
-
const n =
|
|
192
|
+
t(E, "config");
|
|
193
|
+
let T = E;
|
|
194
|
+
const H = re("__auth_state_private", () => {
|
|
195
|
+
var o;
|
|
196
|
+
const n = y(Promise.resolve((o = T.getConfig().devMode) == null ? void 0 : o.initAuthBearerToken)), r = y(void 0), e = y(void 0), s = _r(/* @__PURE__ */ new Map());
|
|
197
|
+
function i() {
|
|
198
|
+
e.value = void 0, $(n.value) || n.value.then((c) => {
|
|
199
|
+
const u = Q.getJwtPayload(c);
|
|
200
|
+
e.value = u.exp * 1e3 > Date.now() ? Xe(u.resourceAccess, (p) => (p == null ? void 0 : p.roles) ?? []) : void 0;
|
|
201
|
+
}).catch(w);
|
|
202
|
+
}
|
|
197
203
|
return {
|
|
198
204
|
/**
|
|
199
205
|
* {@link Promise<string>} для получения jwt-ключа доступа к системам.
|
|
@@ -210,46 +216,55 @@ const ee = Z("__auth_state_private", () => {
|
|
|
210
216
|
/**
|
|
211
217
|
* Список вычисляемых свойств для проверки наличия у пользователя прав доступа.
|
|
212
218
|
*/
|
|
213
|
-
userPermissionsComputedRefs: s
|
|
219
|
+
userPermissionsComputedRefs: s,
|
|
220
|
+
/**
|
|
221
|
+
* Принудительно пересчитывает права доступа пользователя на основе текущего JWT токена.
|
|
222
|
+
*/
|
|
223
|
+
recalculateUserPermissions: i
|
|
214
224
|
};
|
|
215
|
-
}),
|
|
225
|
+
}), $e = re("__auth_state", () => {
|
|
216
226
|
const n = R(() => {
|
|
217
|
-
const
|
|
218
|
-
if ($(
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
227
|
+
const o = H();
|
|
228
|
+
if ($(o.jwtToken) && !$(o.jwtTokenUpdater)) {
|
|
229
|
+
const c = o.jwtTokenUpdater();
|
|
230
|
+
o.jwtToken = c, c.then((u) => {
|
|
231
|
+
o.jwtToken = Promise.resolve(u), o.recalculateUserPermissions();
|
|
222
232
|
}).catch(w);
|
|
223
233
|
}
|
|
224
|
-
return
|
|
234
|
+
return o.jwtToken;
|
|
225
235
|
});
|
|
226
|
-
function r(
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
function e() {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
236
|
+
function r(o) {
|
|
237
|
+
H().jwtTokenUpdater = o;
|
|
238
|
+
}
|
|
239
|
+
function e(o) {
|
|
240
|
+
const c = H();
|
|
241
|
+
c.jwtToken = Promise.resolve(o), c.recalculateUserPermissions();
|
|
242
|
+
}
|
|
243
|
+
function s() {
|
|
244
|
+
const o = H();
|
|
245
|
+
o.jwtToken = void 0, o.userPermissions = void 0;
|
|
246
|
+
}
|
|
247
|
+
function i(o) {
|
|
248
|
+
const c = H();
|
|
249
|
+
!$(c.jwtToken) && $(c.userPermissions) && c.jwtToken.then((f) => {
|
|
250
|
+
const m = Q.getJwtPayload(f);
|
|
251
|
+
c.userPermissions = m.exp * 1e3 > Date.now() ? Xe(m.resourceAccess, (A) => (A == null ? void 0 : A.roles) ?? []) : void 0;
|
|
237
252
|
}).catch(w);
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
return
|
|
253
|
+
const u = K(o) ? o.join(" && ") : o;
|
|
254
|
+
if (c.userPermissionsComputedRefs.has(u))
|
|
255
|
+
return c.userPermissionsComputedRefs.get(u);
|
|
241
256
|
const p = R(() => {
|
|
242
|
-
const
|
|
243
|
-
var
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
257
|
+
const f = (m) => {
|
|
258
|
+
var S;
|
|
259
|
+
const A = ar(m, ".");
|
|
260
|
+
if (A.length < 2)
|
|
246
261
|
return !1;
|
|
247
|
-
const [
|
|
248
|
-
return
|
|
262
|
+
const [d, I] = A, _ = (S = H().userPermissions) == null ? void 0 : S[d];
|
|
263
|
+
return K(_) && _.includes(I);
|
|
249
264
|
};
|
|
250
|
-
return
|
|
265
|
+
return K(o) ? Rr(o, (m) => f(m)) : f(o);
|
|
251
266
|
});
|
|
252
|
-
return
|
|
267
|
+
return c.userPermissionsComputedRefs.set(u, p), p;
|
|
253
268
|
}
|
|
254
269
|
return {
|
|
255
270
|
/**
|
|
@@ -262,16 +277,22 @@ const ee = Z("__auth_state_private", () => {
|
|
|
262
277
|
* @param updater Механизм для обновления jwt-ключа доступа к системам.
|
|
263
278
|
*/
|
|
264
279
|
setJwtTokenUpdater: r,
|
|
280
|
+
/**
|
|
281
|
+
* Устанавливает новый JWT токен и автоматически пересчитывает права доступа.
|
|
282
|
+
*
|
|
283
|
+
* @param token Новый JWT токен.
|
|
284
|
+
*/
|
|
285
|
+
setJwtToken: e,
|
|
265
286
|
/**
|
|
266
287
|
* Выполняет очистку jwt-ключа доступа к системам.
|
|
267
288
|
*/
|
|
268
|
-
invalidateJwtToken:
|
|
289
|
+
invalidateJwtToken: s,
|
|
269
290
|
/**
|
|
270
291
|
* Возвращает вычисляемое поле для проверки наличия указанных прав доступа.
|
|
271
292
|
*
|
|
272
293
|
* @param name Проверяемое право доступа или их список. Должны быть представлены в виде значения: <РЕСУРС>.<РОЛЬ>.
|
|
273
294
|
*/
|
|
274
|
-
hasUserPermission:
|
|
295
|
+
hasUserPermission: i
|
|
275
296
|
};
|
|
276
297
|
});
|
|
277
298
|
class M {
|
|
@@ -299,7 +320,7 @@ class M {
|
|
|
299
320
|
return typeof this.id == "number" ? this.id === -1 : typeof this.id == "string" ? this.id === "" : $(this.id);
|
|
300
321
|
}
|
|
301
322
|
}
|
|
302
|
-
class
|
|
323
|
+
class b extends M {
|
|
303
324
|
/**
|
|
304
325
|
* Инициализирует экземпляр класса {@link NamedIdentity}.
|
|
305
326
|
*
|
|
@@ -314,7 +335,7 @@ class T extends M {
|
|
|
314
335
|
this.name = (e == null ? void 0 : e.name) ?? "";
|
|
315
336
|
}
|
|
316
337
|
}
|
|
317
|
-
class ne extends
|
|
338
|
+
class ne extends b {
|
|
318
339
|
/**
|
|
319
340
|
* Инициализирует экземпляр класса {@link NamedIdentity}.
|
|
320
341
|
*
|
|
@@ -329,7 +350,7 @@ class ne extends T {
|
|
|
329
350
|
this.code = (e == null ? void 0 : e.code) ?? "";
|
|
330
351
|
}
|
|
331
352
|
}
|
|
332
|
-
class
|
|
353
|
+
class tr extends ne {
|
|
333
354
|
/**
|
|
334
355
|
* Инициализирует экземпляр класса {@link CatalogableItem}.
|
|
335
356
|
*
|
|
@@ -348,7 +369,7 @@ class rr extends ne {
|
|
|
348
369
|
this.slug = (e == null ? void 0 : e.slug) ?? "";
|
|
349
370
|
}
|
|
350
371
|
}
|
|
351
|
-
class
|
|
372
|
+
class ke extends tr {
|
|
352
373
|
/**
|
|
353
374
|
* Инициализирует экземпляр класса {@link PrimaryCatalogableItem}.
|
|
354
375
|
*
|
|
@@ -363,7 +384,7 @@ class de extends rr {
|
|
|
363
384
|
this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1;
|
|
364
385
|
}
|
|
365
386
|
}
|
|
366
|
-
class
|
|
387
|
+
class pe extends ke {
|
|
367
388
|
/**
|
|
368
389
|
* Инициализирует экземпляр класса {@link BaseCategory}.
|
|
369
390
|
*
|
|
@@ -387,11 +408,11 @@ class he extends de {
|
|
|
387
408
|
* Список коэффициентов пересчёта из валют в рубли в формате ключ значение.
|
|
388
409
|
*/
|
|
389
410
|
t(this, "currencyRates");
|
|
390
|
-
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]) => [
|
|
411
|
+
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]) => [Ar(s), i])) : void 0;
|
|
391
412
|
}
|
|
392
413
|
}
|
|
393
|
-
var
|
|
394
|
-
class P extends
|
|
414
|
+
var sr = /* @__PURE__ */ ((n) => (n.K0 = "k0", n.K1 = "k1", n.K2 = "k2", n.K3 = "k3", n.K4 = "k4", n.Retail = "retail", n))(sr || {});
|
|
415
|
+
class P extends b {
|
|
395
416
|
/**
|
|
396
417
|
* Инициализирует экземпляр класса {@link Reference}.
|
|
397
418
|
*
|
|
@@ -410,12 +431,12 @@ class P extends T {
|
|
|
410
431
|
this.description = e == null ? void 0 : e.description, this.slug = e == null ? void 0 : e.slug;
|
|
411
432
|
}
|
|
412
433
|
}
|
|
413
|
-
class
|
|
434
|
+
class Re extends P {
|
|
414
435
|
/**
|
|
415
436
|
* Возвращает значение справочника коэффициента розничной цены.
|
|
416
437
|
*/
|
|
417
438
|
static getRetailPriceCoefficient() {
|
|
418
|
-
return { id: -2, slug:
|
|
439
|
+
return { id: -2, slug: sr.Retail, name: "Розн. цена", guid: "", isNewRec: Dr(!0) };
|
|
419
440
|
}
|
|
420
441
|
}
|
|
421
442
|
class qe {
|
|
@@ -445,10 +466,10 @@ class qe {
|
|
|
445
466
|
* Признак того, что указанный коэффициент доступен текущему пользователю только для просмотра.
|
|
446
467
|
*/
|
|
447
468
|
t(this, "readOnly");
|
|
448
|
-
this.coefficient = new
|
|
469
|
+
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;
|
|
449
470
|
}
|
|
450
471
|
}
|
|
451
|
-
class
|
|
472
|
+
class ir {
|
|
452
473
|
/**
|
|
453
474
|
* Инициализирует экземпляр класса {@link GeoCoordinates}.
|
|
454
475
|
*
|
|
@@ -466,9 +487,9 @@ class sr {
|
|
|
466
487
|
this.lat = (r == null ? void 0 : r.lat) ?? 0, this.long = (r == null ? void 0 : r.long) ?? 0;
|
|
467
488
|
}
|
|
468
489
|
}
|
|
469
|
-
class
|
|
490
|
+
class Y extends P {
|
|
470
491
|
}
|
|
471
|
-
class
|
|
492
|
+
class ae extends P {
|
|
472
493
|
/**
|
|
473
494
|
* Инициализирует экземпляр класса {@link Warehouse}.
|
|
474
495
|
*
|
|
@@ -497,10 +518,10 @@ class Re extends P {
|
|
|
497
518
|
* Координаты склада.
|
|
498
519
|
*/
|
|
499
520
|
t(this, "coordinates");
|
|
500
|
-
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
|
|
521
|
+
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 Y(i))) ?? [], this.regions = (e == null ? void 0 : e.regions) ?? [], this.coordinates = new ir(e == null ? void 0 : e.coordinates);
|
|
501
522
|
}
|
|
502
523
|
}
|
|
503
|
-
class
|
|
524
|
+
class jr {
|
|
504
525
|
/**
|
|
505
526
|
* Инициализирует экземпляр класса {@link StockCount}.
|
|
506
527
|
*
|
|
@@ -515,10 +536,10 @@ class Fr {
|
|
|
515
536
|
* Количество остатков товара на складе.
|
|
516
537
|
*/
|
|
517
538
|
t(this, "count");
|
|
518
|
-
this.warehouse = new
|
|
539
|
+
this.warehouse = new ae(r == null ? void 0 : r.warehouse), this.count = (r == null ? void 0 : r.count) ?? 0;
|
|
519
540
|
}
|
|
520
541
|
}
|
|
521
|
-
class
|
|
542
|
+
class Fr extends tr {
|
|
522
543
|
/**
|
|
523
544
|
* Инициализирует экземпляр класса {@link HiddenCatalogableItem}.
|
|
524
545
|
*
|
|
@@ -556,14 +577,14 @@ class Mr {
|
|
|
556
577
|
this.image = `${e ?? ""}${r.image}`, this.preview = `${e ?? ""}${r.preview}`, this.isDefault = r.isDefault;
|
|
557
578
|
}
|
|
558
579
|
}
|
|
559
|
-
class
|
|
580
|
+
class x extends Fr {
|
|
560
581
|
/**
|
|
561
582
|
* Инициализирует экземпляр класса {@link Product}.
|
|
562
583
|
*
|
|
563
584
|
* @param data Данные для первоначальной инициализации.
|
|
564
585
|
*/
|
|
565
586
|
constructor(e) {
|
|
566
|
-
var i, o, c,
|
|
587
|
+
var i, o, c, u;
|
|
567
588
|
super(e);
|
|
568
589
|
/**
|
|
569
590
|
* Артикул производителя/поставщика.
|
|
@@ -641,16 +662,16 @@ class k extends jr {
|
|
|
641
662
|
* Список коэффициентов цен на продукт.
|
|
642
663
|
*/
|
|
643
664
|
t(this, "priceCoefficients");
|
|
644
|
-
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = (e == null ? void 0 : e.unit) ?? "", this.pack = e == null ? void 0 : e.pack, this.minCount = e == null ? void 0 : e.minCount, this.quantityUnit = e == null ? void 0 : e.quantityUnit, this.currency = (e == null ? void 0 : e.currency) ?? "", this.cost = (e == null ? void 0 : e.cost) ?? 0, this.costRub = (e == null ? void 0 : e.costRub) ?? 0, this.costDate =
|
|
645
|
-
const s = (e == null ? void 0 : e.category) ?? ((o = e == null ? void 0 : e.categories) == null ? void 0 : o.find((
|
|
646
|
-
s && (this.category = new
|
|
665
|
+
this.supplierSku = e == null ? void 0 : e.supplierSku, this.unit = (e == null ? void 0 : e.unit) ?? "", this.pack = e == null ? void 0 : e.pack, this.minCount = e == null ? void 0 : e.minCount, this.quantityUnit = e == null ? void 0 : e.quantityUnit, this.currency = (e == null ? void 0 : e.currency) ?? "", 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) ? v(e.costDate) : e == null ? void 0 : e.costDate, this.onOrder = (e == null ? void 0 : e.onOrder) ?? !1, this.stockCount = ((i = e == null ? void 0 : e.stockCount) == null ? void 0 : i.map((p) => new jr(p))) ?? [], this.currencySignature = (e == null ? void 0 : e.currencySignature) ?? "", this.type = "product";
|
|
666
|
+
const s = (e == null ? void 0 : e.category) ?? ((o = e == null ? void 0 : e.categories) == null ? void 0 : o.find((p) => p.isPrimary));
|
|
667
|
+
s && (this.category = new ke({ ...s, isPrimary: !0 }), this.categories = [this.category]), e != null && e.categories && (this.categories = e.categories.map((p) => new ke(p))), this.images = ((c = e == null ? void 0 : e.images) == null ? void 0 : c.map((p) => new Mr(p, T.getConfig().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((p) => new qe(p))) ?? [], e && "codeNumber" in e && !e.code && (this.code = e == null ? void 0 : e.codeNumber);
|
|
647
668
|
}
|
|
648
669
|
/**
|
|
649
670
|
* Возвращает признак, что это измеряемый товар.
|
|
650
671
|
*/
|
|
651
672
|
getIsMeasurable() {
|
|
652
673
|
var s;
|
|
653
|
-
const e = (s =
|
|
674
|
+
const e = (s = T.getConfig().catalog) == null ? void 0 : s.products.units;
|
|
654
675
|
return [...(e == null ? void 0 : e.linear) ?? ["пог.м.", "м."], ...(e == null ? void 0 : e.square) ?? ["м2"]].includes(this.unit);
|
|
655
676
|
}
|
|
656
677
|
/**
|
|
@@ -718,7 +739,7 @@ class Hr extends M {
|
|
|
718
739
|
* Признак того, что позиция является дополнительной продажей.
|
|
719
740
|
*/
|
|
720
741
|
t(this, "isAdditionalSale");
|
|
721
|
-
this.product = new
|
|
742
|
+
this.product = new x(e == null ? void 0 : e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new pe(), this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && $r(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale;
|
|
722
743
|
}
|
|
723
744
|
}
|
|
724
745
|
class Br extends Hr {
|
|
@@ -771,7 +792,7 @@ class Br extends Hr {
|
|
|
771
792
|
this.currency = 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;
|
|
772
793
|
}
|
|
773
794
|
}
|
|
774
|
-
class
|
|
795
|
+
class ge {
|
|
775
796
|
/**
|
|
776
797
|
* Инициализирует экземпляр класса {@link Cart}.
|
|
777
798
|
*
|
|
@@ -824,7 +845,7 @@ const L = class L {
|
|
|
824
845
|
/**
|
|
825
846
|
* Базовый URL путь для выполнения запросов.
|
|
826
847
|
*/
|
|
827
|
-
t(this, "baseUrl", `${
|
|
848
|
+
t(this, "baseUrl", `${T.getConfig().http.portalApiUrl}/api`);
|
|
828
849
|
/**
|
|
829
850
|
* Обработчик ошибок выполнения запросов текущего экземпляра класса.
|
|
830
851
|
*
|
|
@@ -851,7 +872,7 @@ const L = class L {
|
|
|
851
872
|
// eslint-disable-next-line class-methods-use-this
|
|
852
873
|
t(this, "authRequestInterceptor", async (r) => {
|
|
853
874
|
let e;
|
|
854
|
-
return $(
|
|
875
|
+
return $($e().jwtToken) || (e = await $e().jwtToken), e && r.headers.set("Authorization", `Bearer ${e}`), r;
|
|
855
876
|
});
|
|
856
877
|
/**
|
|
857
878
|
* Перехватчик запроса для преобразования данных запроса.
|
|
@@ -868,7 +889,7 @@ const L = class L {
|
|
|
868
889
|
t(this, "authErrorsResponseInterceptors", (r) => {
|
|
869
890
|
var s;
|
|
870
891
|
const e = r.rawError ? (s = r.rawError) == null ? void 0 : s.config : void 0;
|
|
871
|
-
return r.status === 401 ? !e || e.__isRetryRequest ? Promise.reject(r) : (
|
|
892
|
+
return r.status === 401 ? !e || e.__isRetryRequest ? Promise.reject(r) : ($e().invalidateJwtToken(), e.__isRetryRequest = !0, this.httpClient(e)) : Promise.reject(r);
|
|
872
893
|
});
|
|
873
894
|
/**
|
|
874
895
|
* Перехватчик ответа для преобразования данных ответа на запрос.
|
|
@@ -877,10 +898,10 @@ const L = class L {
|
|
|
877
898
|
*/
|
|
878
899
|
// eslint-disable-next-line class-methods-use-this
|
|
879
900
|
t(this, "dataConverterResponseInterceptor", (r) => (r.data && (r.data = Oe(r.data)), r));
|
|
880
|
-
const r =
|
|
901
|
+
const r = T.getConfig().version;
|
|
881
902
|
this.errorResponseHandler = L.defaultErrorsResponseHandler, this.httpClient = Gr.create({
|
|
882
903
|
headers: {
|
|
883
|
-
"APP-VERSION": `${r.name} (${r.version}, ${q(r.date,
|
|
904
|
+
"APP-VERSION": `${r.name} (${r.version}, ${q(r.date, T.getConfig().dateFormats.uiDate)})`,
|
|
884
905
|
Accept: "application/json",
|
|
885
906
|
"Content-Type": "application/json"
|
|
886
907
|
}
|
|
@@ -1025,7 +1046,7 @@ class xt extends h {
|
|
|
1025
1046
|
* @see /doc/api/internal#/Корзина/api_internal_client_cart_get
|
|
1026
1047
|
*/
|
|
1027
1048
|
getCart(r) {
|
|
1028
|
-
return this.get(`internal/clients/${r.id}/cart`, {}, (e) => new
|
|
1049
|
+
return this.get(`internal/clients/${r.id}/cart`, {}, (e) => new ge(e.data));
|
|
1029
1050
|
}
|
|
1030
1051
|
/**
|
|
1031
1052
|
* Удаляет всё содержимое корзины.
|
|
@@ -1063,7 +1084,7 @@ class xt extends h {
|
|
|
1063
1084
|
isAdditionalSale: e.isAdditionalSale,
|
|
1064
1085
|
...e.configuratorParams
|
|
1065
1086
|
},
|
|
1066
|
-
(i) => new
|
|
1087
|
+
(i) => new ge(i.data),
|
|
1067
1088
|
s
|
|
1068
1089
|
);
|
|
1069
1090
|
}
|
|
@@ -1093,7 +1114,7 @@ class xt extends h {
|
|
|
1093
1114
|
isAdditionalSale: e.isAdditionalSale,
|
|
1094
1115
|
...e.configuratorParams
|
|
1095
1116
|
},
|
|
1096
|
-
(i) => new
|
|
1117
|
+
(i) => new ge(i.data),
|
|
1097
1118
|
s
|
|
1098
1119
|
);
|
|
1099
1120
|
}
|
|
@@ -1117,7 +1138,7 @@ class xt extends h {
|
|
|
1117
1138
|
* @see /doc/api/internal#/Корзина/api_internal_client_cart_add_products_from_csv
|
|
1118
1139
|
*/
|
|
1119
1140
|
addCartItemFromCSV(r, e) {
|
|
1120
|
-
return this.post(`internal/clients/${r.id}/cart/add-products-from-csv`, e, (s) => new
|
|
1141
|
+
return this.post(`internal/clients/${r.id}/cart/add-products-from-csv`, e, (s) => new ge(s.data));
|
|
1121
1142
|
}
|
|
1122
1143
|
/**
|
|
1123
1144
|
* Возвращает пример CSV файла для добавления продуктов в корзину.
|
|
@@ -1131,7 +1152,7 @@ class xt extends h {
|
|
|
1131
1152
|
}
|
|
1132
1153
|
}
|
|
1133
1154
|
var zr = /* @__PURE__ */ ((n) => (n.m2Cost = "m2Cost", n.percent = "percent", n.value = "value", n))(zr || {}), Ge = /* @__PURE__ */ ((n) => (n.Discount = "discount", n.PriceTemplate = "price_template", n.ClientPrice = "client_price", n.Product = "product", n))(Ge || {}), Wr = /* @__PURE__ */ ((n) => (n.Unknown = "unknown", n.Bool = "bool", n.Integer = "integer", n.Float = "float", n.String = "string", n.Range = "range", n.Json = "json", n.Object = "object", n))(Wr || {});
|
|
1134
|
-
class
|
|
1155
|
+
class z extends pe {
|
|
1135
1156
|
/**
|
|
1136
1157
|
* Инициализирует экземпляр класса {@link Category}.
|
|
1137
1158
|
*
|
|
@@ -1148,10 +1169,10 @@ class B extends he {
|
|
|
1148
1169
|
* Список продуктов категории.
|
|
1149
1170
|
*/
|
|
1150
1171
|
t(this, "products");
|
|
1151
|
-
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new
|
|
1172
|
+
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 x(o));
|
|
1152
1173
|
}
|
|
1153
1174
|
}
|
|
1154
|
-
class
|
|
1175
|
+
class nr extends b {
|
|
1155
1176
|
/**
|
|
1156
1177
|
* Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
|
|
1157
1178
|
*
|
|
@@ -1163,10 +1184,10 @@ class ir extends T {
|
|
|
1163
1184
|
* Дата и время последнего изменения.
|
|
1164
1185
|
*/
|
|
1165
1186
|
t(this, "updatedAt");
|
|
1166
|
-
this.updatedAt =
|
|
1187
|
+
this.updatedAt = C(e == null ? void 0 : e.updatedAt) ? v(e.updatedAt) : e == null ? void 0 : e.updatedAt;
|
|
1167
1188
|
}
|
|
1168
1189
|
}
|
|
1169
|
-
class Er extends
|
|
1190
|
+
class Er extends nr {
|
|
1170
1191
|
/**
|
|
1171
1192
|
* Инициализирует экземпляр класса {@link UpdatableNamedIdentity}.
|
|
1172
1193
|
*
|
|
@@ -1178,7 +1199,7 @@ class Er extends ir {
|
|
|
1178
1199
|
* Дата и время последнего удаления.
|
|
1179
1200
|
*/
|
|
1180
1201
|
t(this, "deletedAt");
|
|
1181
|
-
this.deletedAt =
|
|
1202
|
+
this.deletedAt = C(e == null ? void 0 : e.deletedAt) ? v(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
1182
1203
|
}
|
|
1183
1204
|
}
|
|
1184
1205
|
class Nt {
|
|
@@ -1192,7 +1213,7 @@ class Nt {
|
|
|
1192
1213
|
if (e)
|
|
1193
1214
|
try {
|
|
1194
1215
|
const s = JSON.parse(e);
|
|
1195
|
-
if (Sr(
|
|
1216
|
+
if (Sr(v(s.availableFor) || rr(), /* @__PURE__ */ new Date()))
|
|
1196
1217
|
return s.data ?? {};
|
|
1197
1218
|
} catch {
|
|
1198
1219
|
localStorage.removeItem(r);
|
|
@@ -1215,7 +1236,7 @@ class Nt {
|
|
|
1215
1236
|
);
|
|
1216
1237
|
}
|
|
1217
1238
|
}
|
|
1218
|
-
class G extends
|
|
1239
|
+
class G extends b {
|
|
1219
1240
|
/**
|
|
1220
1241
|
* Инициализирует экземпляр класса {@link UserShortInfo}.
|
|
1221
1242
|
*
|
|
@@ -1230,7 +1251,7 @@ class G extends T {
|
|
|
1230
1251
|
this.type = e == null ? void 0 : e.type;
|
|
1231
1252
|
}
|
|
1232
1253
|
}
|
|
1233
|
-
class
|
|
1254
|
+
class Jr extends b {
|
|
1234
1255
|
/**
|
|
1235
1256
|
* Инициализирует экземпляр класса {@link DiscountShortInfo}.
|
|
1236
1257
|
*
|
|
@@ -1266,10 +1287,10 @@ class Vr extends T {
|
|
|
1266
1287
|
* Дата и время удаления.
|
|
1267
1288
|
*/
|
|
1268
1289
|
t(this, "deletedAt");
|
|
1269
|
-
this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt =
|
|
1290
|
+
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 G(e == null ? void 0 : e.owner), this.deletedAt = C(e == null ? void 0 : e.deletedAt) ? v(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
1270
1291
|
}
|
|
1271
1292
|
}
|
|
1272
|
-
class
|
|
1293
|
+
class W extends nr {
|
|
1273
1294
|
/**
|
|
1274
1295
|
* Инициализирует экземпляр класса {@link PriceTemplate}.
|
|
1275
1296
|
*
|
|
@@ -1285,10 +1306,10 @@ class z extends ir {
|
|
|
1285
1306
|
* Дата и время создания шаблона.
|
|
1286
1307
|
*/
|
|
1287
1308
|
t(this, "createdAt");
|
|
1288
|
-
this.description = (e == null ? void 0 : e.description) ?? "", this.createdAt =
|
|
1309
|
+
this.description = (e == null ? void 0 : e.description) ?? "", this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date();
|
|
1289
1310
|
}
|
|
1290
1311
|
}
|
|
1291
|
-
class
|
|
1312
|
+
class X extends x {
|
|
1292
1313
|
/**
|
|
1293
1314
|
* Инициализирует экземпляр класса {@link ClientProduct}.
|
|
1294
1315
|
*
|
|
@@ -1324,10 +1345,10 @@ class Q extends k {
|
|
|
1324
1345
|
* Признак того, что указанный продукт входит в список избранных продуктов клиента.
|
|
1325
1346
|
*/
|
|
1326
1347
|
t(this, "isFavorite");
|
|
1327
|
-
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
|
|
1348
|
+
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 Jr(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;
|
|
1328
1349
|
}
|
|
1329
1350
|
}
|
|
1330
|
-
class
|
|
1351
|
+
class Vr {
|
|
1331
1352
|
/**
|
|
1332
1353
|
* Инициализирует экземпляр класса {@link ContactLinks}.
|
|
1333
1354
|
*
|
|
@@ -1345,9 +1366,9 @@ class Jr {
|
|
|
1345
1366
|
this.phone = /^\d+$/.test(r.phone ?? "") ? `+${r.phone}` : r.phone, this.email = r.email;
|
|
1346
1367
|
}
|
|
1347
1368
|
}
|
|
1348
|
-
class
|
|
1369
|
+
class N extends P {
|
|
1349
1370
|
}
|
|
1350
|
-
class oe extends
|
|
1371
|
+
class oe extends b {
|
|
1351
1372
|
/**
|
|
1352
1373
|
* Инициализирует экземпляр класса {@link ManagerCommon}.
|
|
1353
1374
|
*
|
|
@@ -1358,7 +1379,7 @@ class oe extends T {
|
|
|
1358
1379
|
/**
|
|
1359
1380
|
* Направление продаж.
|
|
1360
1381
|
*/
|
|
1361
|
-
t(this, "salesDirection", new
|
|
1382
|
+
t(this, "salesDirection", new N());
|
|
1362
1383
|
/**
|
|
1363
1384
|
* URI путь к фотографии пользователя.
|
|
1364
1385
|
*/
|
|
@@ -1371,10 +1392,10 @@ class oe extends T {
|
|
|
1371
1392
|
* Признак того, что менеджер является основным для клиента.
|
|
1372
1393
|
*/
|
|
1373
1394
|
t(this, "isDefault");
|
|
1374
|
-
e && (this.salesDirection = new
|
|
1395
|
+
e && (this.salesDirection = new N(e.salesDirection), this.photo = e.photo, e.contacts && (this.contacts = new Vr(e.contacts)), e.isDefault !== void 0 && (this.isDefault = e.isDefault));
|
|
1375
1396
|
}
|
|
1376
1397
|
}
|
|
1377
|
-
class Kr extends
|
|
1398
|
+
class Kr extends b {
|
|
1378
1399
|
/**
|
|
1379
1400
|
* Инициализирует экземпляр класса {@link IUserPricingRole}.
|
|
1380
1401
|
*
|
|
@@ -1432,7 +1453,7 @@ class Ae extends oe {
|
|
|
1432
1453
|
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 Kr(e.pricingRole) : void 0;
|
|
1433
1454
|
}
|
|
1434
1455
|
}
|
|
1435
|
-
class Qr extends
|
|
1456
|
+
class Qr extends pe {
|
|
1436
1457
|
/**
|
|
1437
1458
|
* Инициализирует экземпляр класса {@link BaseClientCategory}.
|
|
1438
1459
|
*
|
|
@@ -1480,10 +1501,10 @@ class fe extends Qr {
|
|
|
1480
1501
|
* Список продуктов категории.
|
|
1481
1502
|
*/
|
|
1482
1503
|
t(this, "products");
|
|
1483
|
-
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new fe(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new
|
|
1504
|
+
this.categories = (s = e == null ? void 0 : e.categories) == null ? void 0 : s.map((o) => new fe(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new X(o));
|
|
1484
1505
|
}
|
|
1485
1506
|
}
|
|
1486
|
-
class
|
|
1507
|
+
class or {
|
|
1487
1508
|
/**
|
|
1488
1509
|
* Инициализирует экземпляр класса {@link PriceTemplateICatalogableItem}.
|
|
1489
1510
|
*
|
|
@@ -1498,10 +1519,10 @@ class nr {
|
|
|
1498
1519
|
* Процент, который прибавляется к значению выбранного коэффициента.
|
|
1499
1520
|
*/
|
|
1500
1521
|
t(this, "increasePercent");
|
|
1501
|
-
this.priceCoefficient = (r == null ? void 0 : r.priceCoefficient) && new
|
|
1522
|
+
this.priceCoefficient = (r == null ? void 0 : r.priceCoefficient) && new Re(r.priceCoefficient), this.increasePercent = r == null ? void 0 : r.increasePercent;
|
|
1502
1523
|
}
|
|
1503
1524
|
}
|
|
1504
|
-
class
|
|
1525
|
+
class Te extends or {
|
|
1505
1526
|
/**
|
|
1506
1527
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
1507
1528
|
*
|
|
@@ -1513,10 +1534,10 @@ class $e extends nr {
|
|
|
1513
1534
|
* Базовые данные о продукте.
|
|
1514
1535
|
*/
|
|
1515
1536
|
t(this, "productCategory");
|
|
1516
|
-
this.productCategory = new
|
|
1537
|
+
this.productCategory = new pe(e == null ? void 0 : e.productCategory);
|
|
1517
1538
|
}
|
|
1518
1539
|
}
|
|
1519
|
-
class
|
|
1540
|
+
class Z extends P {
|
|
1520
1541
|
}
|
|
1521
1542
|
class ce extends P {
|
|
1522
1543
|
/**
|
|
@@ -1529,11 +1550,11 @@ class ce extends P {
|
|
|
1529
1550
|
/**
|
|
1530
1551
|
* Данные о стране, в которой расположен регион.
|
|
1531
1552
|
*/
|
|
1532
|
-
t(this, "country", new
|
|
1533
|
-
e && (this.country = new
|
|
1553
|
+
t(this, "country", new Z());
|
|
1554
|
+
e && (this.country = new Z(e.country));
|
|
1534
1555
|
}
|
|
1535
1556
|
}
|
|
1536
|
-
class
|
|
1557
|
+
class je extends P {
|
|
1537
1558
|
/**
|
|
1538
1559
|
* Инициализирует экземпляр класса {@link CityWithRegionAndCountry}.
|
|
1539
1560
|
*
|
|
@@ -1548,7 +1569,7 @@ class Fe extends P {
|
|
|
1548
1569
|
e && (this.region = new ce(e.region));
|
|
1549
1570
|
}
|
|
1550
1571
|
}
|
|
1551
|
-
class
|
|
1572
|
+
class cr extends b {
|
|
1552
1573
|
/**
|
|
1553
1574
|
* Инициализирует экземпляр класса {@link UserCommonInfo}.
|
|
1554
1575
|
*
|
|
@@ -1584,10 +1605,10 @@ class or extends T {
|
|
|
1584
1605
|
* Признак активности учетной записи пользователя.
|
|
1585
1606
|
*/
|
|
1586
1607
|
t(this, "isActive");
|
|
1587
|
-
this.phone = /^\d+$/.test((e == null ? void 0 : e.phone) ?? "") ? `+${e == null ? void 0 : e.phone}` : (e == null ? void 0 : e.phone) ?? "", this.email = (e == null ? void 0 : e.email) ?? "", this.getNews = (e == null ? void 0 : e.getNews) ?? !1, this.salesDirection = e != null && e.salesDirection ? new
|
|
1608
|
+
this.phone = /^\d+$/.test((e == null ? void 0 : e.phone) ?? "") ? `+${e == null ? void 0 : e.phone}` : (e == null ? void 0 : e.phone) ?? "", this.email = (e == null ? void 0 : e.email) ?? "", this.getNews = (e == null ? void 0 : e.getNews) ?? !1, this.salesDirection = e != null && e.salesDirection ? new N(e.salesDirection) : void 0, this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : e == null ? void 0 : e.createdAt, this.lastLoginAt = C(e == null ? void 0 : e.lastLoginAt) ? v(e.lastLoginAt) : e == null ? void 0 : e.lastLoginAt, this.isActive = (e == null ? void 0 : e.isActive) ?? !1;
|
|
1588
1609
|
}
|
|
1589
1610
|
}
|
|
1590
|
-
class
|
|
1611
|
+
class he extends cr {
|
|
1591
1612
|
/**
|
|
1592
1613
|
* Инициализирует экземпляр класса {@link Client}.
|
|
1593
1614
|
*
|
|
@@ -1629,10 +1650,10 @@ class ge extends or {
|
|
|
1629
1650
|
* Список менеджеров клиента.
|
|
1630
1651
|
*/
|
|
1631
1652
|
t(this, "managers");
|
|
1632
|
-
this.salesDirection = new
|
|
1653
|
+
this.salesDirection = new N(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 je(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((i) => new oe(i))) ?? [];
|
|
1633
1654
|
}
|
|
1634
1655
|
}
|
|
1635
|
-
class
|
|
1656
|
+
class te extends M {
|
|
1636
1657
|
/**
|
|
1637
1658
|
* Инициализирует новый экземпляр класса.
|
|
1638
1659
|
*
|
|
@@ -1656,10 +1677,10 @@ class re extends M {
|
|
|
1656
1677
|
* Данные шаблона прайс-листа.
|
|
1657
1678
|
*/
|
|
1658
1679
|
t(this, "priceTemplate");
|
|
1659
|
-
this.createdAt =
|
|
1680
|
+
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 he(e == null ? void 0 : e.client), this.priceTemplate = new W(e == null ? void 0 : e.priceTemplate);
|
|
1660
1681
|
}
|
|
1661
1682
|
}
|
|
1662
|
-
class
|
|
1683
|
+
class be extends or {
|
|
1663
1684
|
/**
|
|
1664
1685
|
* Инициализирует экземпляр класса {@link PriceTemplateProduct}.
|
|
1665
1686
|
*
|
|
@@ -1671,12 +1692,12 @@ class Te extends nr {
|
|
|
1671
1692
|
* Базовые данные о продукте.
|
|
1672
1693
|
*/
|
|
1673
1694
|
t(this, "product");
|
|
1674
|
-
this.product = new
|
|
1695
|
+
this.product = new x(e == null ? void 0 : e.product);
|
|
1675
1696
|
}
|
|
1676
1697
|
}
|
|
1677
|
-
class
|
|
1698
|
+
class lr extends P {
|
|
1678
1699
|
}
|
|
1679
|
-
class
|
|
1700
|
+
class se extends b {
|
|
1680
1701
|
/**
|
|
1681
1702
|
* Инициализирует экземпляр класса {@link Property}.
|
|
1682
1703
|
*
|
|
@@ -1696,10 +1717,10 @@ class te extends T {
|
|
|
1696
1717
|
* Дополнительные метаданные свойства.
|
|
1697
1718
|
*/
|
|
1698
1719
|
t(this, "metadata");
|
|
1699
|
-
this.type = new
|
|
1720
|
+
this.type = new lr(e == null ? void 0 : e.type), this.description = (e == null ? void 0 : e.description) ?? "", this.metadata = e == null ? void 0 : e.metadata;
|
|
1700
1721
|
}
|
|
1701
1722
|
}
|
|
1702
|
-
class
|
|
1723
|
+
class B {
|
|
1703
1724
|
/**
|
|
1704
1725
|
* Инициализирует экземпляр класса {@link PropertyValue}.
|
|
1705
1726
|
*
|
|
@@ -1715,7 +1736,7 @@ class H {
|
|
|
1715
1736
|
* Может быть строкой, числом, boolean, диапазоном или JSON объектом.
|
|
1716
1737
|
*/
|
|
1717
1738
|
t(this, "value");
|
|
1718
|
-
this.property = new
|
|
1739
|
+
this.property = new se(r == null ? void 0 : r.property), this.value = (r == null ? void 0 : r.value) ?? "";
|
|
1719
1740
|
}
|
|
1720
1741
|
}
|
|
1721
1742
|
class O {
|
|
@@ -1733,7 +1754,7 @@ class O {
|
|
|
1733
1754
|
* Окончание периода.
|
|
1734
1755
|
*/
|
|
1735
1756
|
t(this, "to");
|
|
1736
|
-
this.from =
|
|
1757
|
+
this.from = C(r == null ? void 0 : r.from) ? v(r.from) : (r == null ? void 0 : r.from) ?? null, this.to = C(r == null ? void 0 : r.to) ? v(r.to) : (r == null ? void 0 : r.to) ?? null;
|
|
1737
1758
|
}
|
|
1738
1759
|
}
|
|
1739
1760
|
class Ot {
|
|
@@ -1794,13 +1815,13 @@ class Ot {
|
|
|
1794
1815
|
var e, s, i, o;
|
|
1795
1816
|
const r = {};
|
|
1796
1817
|
return Object.keys(this).forEach((c) => {
|
|
1797
|
-
const
|
|
1818
|
+
const u = this[c];
|
|
1798
1819
|
// eslint-disable-next-line prettier/prettier
|
|
1799
|
-
$(
|
|
1820
|
+
$(u) || C(u) && u.trim().length === 0 || Ne(u.isNewRec) && u.isNewRec() || (r[c] = u);
|
|
1800
1821
|
}), !((e = r == null ? void 0 : r.createdAt) != null && e.from) && !((s = r == null ? void 0 : r.createdAt) != null && s.to) && delete r.createdAt, !((i = r == null ? void 0 : r.updatedAt) != null && i.from) && !((o = r == null ? void 0 : r.updatedAt) != null && o.to) && delete r.updatedAt, r;
|
|
1801
1822
|
}
|
|
1802
1823
|
}
|
|
1803
|
-
class
|
|
1824
|
+
class ie extends b {
|
|
1804
1825
|
/**
|
|
1805
1826
|
* Инициализирует экземпляр класса {@link PricingRole}.
|
|
1806
1827
|
*
|
|
@@ -1854,7 +1875,7 @@ class He {
|
|
|
1854
1875
|
* Минимальный коэффициент цены.
|
|
1855
1876
|
*/
|
|
1856
1877
|
t(this, "minCoefficient");
|
|
1857
|
-
this.role = new
|
|
1878
|
+
this.role = new ie(r == null ? void 0 : r.role), this.category = new pe(r == null ? void 0 : r.category), this.minCoefficient = new Re(r == null ? void 0 : r.minCoefficient);
|
|
1858
1879
|
}
|
|
1859
1880
|
}
|
|
1860
1881
|
class Yr {
|
|
@@ -1890,14 +1911,6 @@ class Xr {
|
|
|
1890
1911
|
* @inheritDoc
|
|
1891
1912
|
*/
|
|
1892
1913
|
t(this, "portalApiUrl");
|
|
1893
|
-
/**
|
|
1894
|
-
* @inheritDoc
|
|
1895
|
-
*/
|
|
1896
|
-
t(this, "priceHistoryApiUrl");
|
|
1897
|
-
/**
|
|
1898
|
-
* @inheritDoc
|
|
1899
|
-
*/
|
|
1900
|
-
t(this, "recommendationsApiUrl");
|
|
1901
1914
|
/**
|
|
1902
1915
|
* @inheritDoc
|
|
1903
1916
|
*/
|
|
@@ -1906,7 +1919,7 @@ class Xr {
|
|
|
1906
1919
|
* @inheritDoc
|
|
1907
1920
|
*/
|
|
1908
1921
|
t(this, "responseDataCacheTimeout");
|
|
1909
|
-
this.portalApiUrl = (r == null ? void 0 : r.portalApiUrl) ?? "", this.
|
|
1922
|
+
this.portalApiUrl = (r == null ? void 0 : r.portalApiUrl) ?? "", this.mediaUrl = (r == null ? void 0 : r.mediaUrl) ?? "", this.responseDataCacheTimeout = (r == null ? void 0 : r.responseDataCacheTimeout) ?? 3 * 60 * 60;
|
|
1910
1923
|
}
|
|
1911
1924
|
}
|
|
1912
1925
|
class Zr {
|
|
@@ -1973,7 +1986,7 @@ class et {
|
|
|
1973
1986
|
* Текущая версия приложения.
|
|
1974
1987
|
*/
|
|
1975
1988
|
t(this, "version");
|
|
1976
|
-
this.date =
|
|
1989
|
+
this.date = C(r == null ? void 0 : r.date) ? v(r.date) : (r == null ? void 0 : r.date) ?? /* @__PURE__ */ new Date(), this.name = (r == null ? void 0 : r.name) ?? "", this.version = (r == null ? void 0 : r.version) ?? "0.0.0";
|
|
1977
1990
|
}
|
|
1978
1991
|
}
|
|
1979
1992
|
class rt {
|
|
@@ -2096,7 +2109,7 @@ class Ut extends h {
|
|
|
2096
2109
|
*/
|
|
2097
2110
|
// eslint-disable-next-line class-methods-use-this
|
|
2098
2111
|
getPriceExportLink(r = "csv", e = !1, s = void 0, i = void 0) {
|
|
2099
|
-
let c = `${
|
|
2112
|
+
let c = `${T.getConfig().http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;
|
|
2100
2113
|
return s && (c += `&category_id=${s}`), i && (c += `&client_id=${i}`), c;
|
|
2101
2114
|
}
|
|
2102
2115
|
}
|
|
@@ -2224,7 +2237,7 @@ class Gt extends h {
|
|
|
2224
2237
|
price_coefficient_id: (i = s.coefficient) == null ? void 0 : i.id,
|
|
2225
2238
|
increase_percent: s.value
|
|
2226
2239
|
},
|
|
2227
|
-
(o) => new
|
|
2240
|
+
(o) => new X(o.data)
|
|
2228
2241
|
);
|
|
2229
2242
|
}
|
|
2230
2243
|
/**
|
|
@@ -2236,7 +2249,7 @@ class Gt extends h {
|
|
|
2236
2249
|
* @see /doc/api/internal#/operations/api_internal_client_price_products_remove
|
|
2237
2250
|
*/
|
|
2238
2251
|
removeProductPrice(r, e) {
|
|
2239
|
-
return this.delete(`/internal/clients/${r}/price/products/${e}`, (s) => new
|
|
2252
|
+
return this.delete(`/internal/clients/${r}/price/products/${e}`, (s) => new X(s.data));
|
|
2240
2253
|
}
|
|
2241
2254
|
/**
|
|
2242
2255
|
* Добавляет указанный продукт в список товаров для дополнительных продаж.
|
|
@@ -2299,7 +2312,7 @@ class Gt extends h {
|
|
|
2299
2312
|
return this.post(`/internal/clients/${r}/price/commercial-offer/send`, e);
|
|
2300
2313
|
}
|
|
2301
2314
|
}
|
|
2302
|
-
class
|
|
2315
|
+
class jt extends h {
|
|
2303
2316
|
/**
|
|
2304
2317
|
* Возвращает список шаблонов прайс-листа привязанных к клиенту.
|
|
2305
2318
|
*
|
|
@@ -2311,7 +2324,7 @@ class Ft extends h {
|
|
|
2311
2324
|
return this.get(
|
|
2312
2325
|
`/internal/clients/${r}/price/templates`,
|
|
2313
2326
|
{},
|
|
2314
|
-
(e) => e.data.map((s) => new
|
|
2327
|
+
(e) => e.data.map((s) => new te(s))
|
|
2315
2328
|
);
|
|
2316
2329
|
}
|
|
2317
2330
|
/**
|
|
@@ -2322,7 +2335,7 @@ class Ft extends h {
|
|
|
2322
2335
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_get_active
|
|
2323
2336
|
*/
|
|
2324
2337
|
getActiveTemplate(r) {
|
|
2325
|
-
return this.get(`/internal/clients/${r}/price/templates/active`, {}, (e) => new
|
|
2338
|
+
return this.get(`/internal/clients/${r}/price/templates/active`, {}, (e) => new te(e.data));
|
|
2326
2339
|
}
|
|
2327
2340
|
/**
|
|
2328
2341
|
* Добавляет связь между клиентом и шаблоном прайс-листа.
|
|
@@ -2334,14 +2347,14 @@ class Ft extends h {
|
|
|
2334
2347
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_attach
|
|
2335
2348
|
*/
|
|
2336
2349
|
attachTemplate(r, e, s) {
|
|
2337
|
-
const i =
|
|
2350
|
+
const i = T.getConfig().dateFormats.api;
|
|
2338
2351
|
return this.post(
|
|
2339
2352
|
`/internal/clients/${r}/price/templates/${e}`,
|
|
2340
2353
|
s && {
|
|
2341
2354
|
startAt: s.startAt && q(s.startAt, i),
|
|
2342
2355
|
endAt: s.endAt && q(s.endAt, i)
|
|
2343
2356
|
},
|
|
2344
|
-
(o) => new
|
|
2357
|
+
(o) => new te(o.data),
|
|
2345
2358
|
{},
|
|
2346
2359
|
!0
|
|
2347
2360
|
);
|
|
@@ -2368,14 +2381,14 @@ class Ft extends h {
|
|
|
2368
2381
|
* @see /doc/api/internal#/operations/api_internal_client_price_template_change
|
|
2369
2382
|
*/
|
|
2370
2383
|
changeTemplate(r, e, s, i) {
|
|
2371
|
-
const o =
|
|
2384
|
+
const o = T.getConfig().dateFormats.api;
|
|
2372
2385
|
return this.patch(
|
|
2373
2386
|
`/internal/clients/${r}/price/templates/${e}/${s}`,
|
|
2374
2387
|
i && {
|
|
2375
2388
|
startAt: i.startAt && q(i.startAt, o),
|
|
2376
2389
|
endAt: i.endAt && q(i.endAt, o)
|
|
2377
2390
|
},
|
|
2378
|
-
(c) => new
|
|
2391
|
+
(c) => new te(c.data)
|
|
2379
2392
|
);
|
|
2380
2393
|
}
|
|
2381
2394
|
/**
|
|
@@ -2391,7 +2404,7 @@ class Ft extends h {
|
|
|
2391
2404
|
return this.delete(`/internal/clients/${r}/price/templates/${e}/${s}`);
|
|
2392
2405
|
}
|
|
2393
2406
|
}
|
|
2394
|
-
class
|
|
2407
|
+
class Ft extends h {
|
|
2395
2408
|
/**
|
|
2396
2409
|
* Возвращает список данных о корневых категориях.
|
|
2397
2410
|
*
|
|
@@ -2405,7 +2418,7 @@ class jt extends h {
|
|
|
2405
2418
|
{
|
|
2406
2419
|
showHidden: r
|
|
2407
2420
|
},
|
|
2408
|
-
(e) => e.data.map((s) => new
|
|
2421
|
+
(e) => e.data.map((s) => new z(s))
|
|
2409
2422
|
);
|
|
2410
2423
|
}
|
|
2411
2424
|
/**
|
|
@@ -2424,7 +2437,7 @@ class jt extends h {
|
|
|
2424
2437
|
showHidden: e,
|
|
2425
2438
|
withNestedCategories: s
|
|
2426
2439
|
},
|
|
2427
|
-
(i) => new
|
|
2440
|
+
(i) => new z(i.data)
|
|
2428
2441
|
);
|
|
2429
2442
|
}
|
|
2430
2443
|
/**
|
|
@@ -2433,7 +2446,7 @@ class jt extends h {
|
|
|
2433
2446
|
* @param categoryID Идентификатор категории продуктов.
|
|
2434
2447
|
*/
|
|
2435
2448
|
getPublicCategoryData(r) {
|
|
2436
|
-
return this.get(`/public/catalog/categories/${r}`, {}, (e) => new
|
|
2449
|
+
return this.get(`/public/catalog/categories/${r}`, {}, (e) => new z(e.data));
|
|
2437
2450
|
}
|
|
2438
2451
|
/**
|
|
2439
2452
|
* Возвращает список продуктов категории.
|
|
@@ -2451,7 +2464,7 @@ class jt extends h {
|
|
|
2451
2464
|
showHidden: s,
|
|
2452
2465
|
withPriceCoefficients: e
|
|
2453
2466
|
},
|
|
2454
|
-
(i) =>
|
|
2467
|
+
(i) => ve(i.data, (o) => new x(o))
|
|
2455
2468
|
);
|
|
2456
2469
|
}
|
|
2457
2470
|
/**
|
|
@@ -2476,7 +2489,7 @@ class jt extends h {
|
|
|
2476
2489
|
publicSimpleSearch(r, e = 10) {
|
|
2477
2490
|
return new Promise((s, i) => {
|
|
2478
2491
|
this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then((o) => {
|
|
2479
|
-
s(o.categories.map((c) => new
|
|
2492
|
+
s(o.categories.map((c) => new z(c)));
|
|
2480
2493
|
}).catch((o) => {
|
|
2481
2494
|
i(o);
|
|
2482
2495
|
});
|
|
@@ -2493,7 +2506,7 @@ class Mt extends h {
|
|
|
2493
2506
|
* @see /doc/api/internal#/Каталог/api_internal_catalog_products_get
|
|
2494
2507
|
*/
|
|
2495
2508
|
getProductData(r, e = !1) {
|
|
2496
|
-
return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (s) => new
|
|
2509
|
+
return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (s) => new x(s.data));
|
|
2497
2510
|
}
|
|
2498
2511
|
/**
|
|
2499
2512
|
* Возвращает публичные данные об указанном продукте.
|
|
@@ -2501,7 +2514,7 @@ class Mt extends h {
|
|
|
2501
2514
|
* @param productId Идентификатор продукта.
|
|
2502
2515
|
*/
|
|
2503
2516
|
getPublicProductData(r) {
|
|
2504
|
-
return this.get(`/public/catalog/products/${r}`, {}, (e) => new
|
|
2517
|
+
return this.get(`/public/catalog/products/${r}`, {}, (e) => new x(e.data));
|
|
2505
2518
|
}
|
|
2506
2519
|
/**
|
|
2507
2520
|
* Возвращает данные о коэффициентах цен для указанного продукта.
|
|
@@ -2514,7 +2527,7 @@ class Mt extends h {
|
|
|
2514
2527
|
return this.get(
|
|
2515
2528
|
`/internal/catalog/products/${r}/coefficients`,
|
|
2516
2529
|
{},
|
|
2517
|
-
(e) =>
|
|
2530
|
+
(e) => ve(e.data, (s) => new qe(s))
|
|
2518
2531
|
);
|
|
2519
2532
|
}
|
|
2520
2533
|
/**
|
|
@@ -2526,7 +2539,7 @@ class Mt extends h {
|
|
|
2526
2539
|
publicSimpleSearch(r, e = 10) {
|
|
2527
2540
|
return new Promise((s, i) => {
|
|
2528
2541
|
this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then((o) => {
|
|
2529
|
-
s(o.products.map((c) => new
|
|
2542
|
+
s(o.products.map((c) => new x(c)));
|
|
2530
2543
|
}).catch((o) => {
|
|
2531
2544
|
i(o);
|
|
2532
2545
|
});
|
|
@@ -2591,7 +2604,7 @@ class Ht extends h {
|
|
|
2591
2604
|
showHidden: i,
|
|
2592
2605
|
withPriceCoefficients: s
|
|
2593
2606
|
},
|
|
2594
|
-
(o) =>
|
|
2607
|
+
(o) => ve(o.data, (c) => new X(c))
|
|
2595
2608
|
);
|
|
2596
2609
|
}
|
|
2597
2610
|
}
|
|
@@ -2612,11 +2625,11 @@ class Bt extends h {
|
|
|
2612
2625
|
clientId: e,
|
|
2613
2626
|
withPriceCoefficients: s
|
|
2614
2627
|
},
|
|
2615
|
-
(i) => new
|
|
2628
|
+
(i) => new X(i.data)
|
|
2616
2629
|
);
|
|
2617
2630
|
}
|
|
2618
2631
|
}
|
|
2619
|
-
var
|
|
2632
|
+
var Fe = /* @__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))(Fe || {});
|
|
2620
2633
|
class Be {
|
|
2621
2634
|
/**
|
|
2622
2635
|
* Инициализирует экземпляр класса {@link FilterItem}.
|
|
@@ -2636,7 +2649,7 @@ class Be {
|
|
|
2636
2649
|
* Значение с которым сравнивается поле.
|
|
2637
2650
|
*/
|
|
2638
2651
|
t(this, "value");
|
|
2639
|
-
this.field = (r == null ? void 0 : r.field) ?? "", this.op = (r == null ? void 0 : r.op) ??
|
|
2652
|
+
this.field = (r == null ? void 0 : r.field) ?? "", this.op = (r == null ? void 0 : r.op) ?? Fe.Equals, this.value = (r == null ? void 0 : r.value) ?? "";
|
|
2640
2653
|
}
|
|
2641
2654
|
/**
|
|
2642
2655
|
* Преобразует фильтр в примитивное представление для API.
|
|
@@ -2648,7 +2661,7 @@ class Be {
|
|
|
2648
2661
|
field: this.field,
|
|
2649
2662
|
op: this.op
|
|
2650
2663
|
};
|
|
2651
|
-
return r.value = Ie(this.value) ? q(this.value,
|
|
2664
|
+
return r.value = Ie(this.value) ? q(this.value, T.getConfig().dateFormats.api) : this.value, r;
|
|
2652
2665
|
}
|
|
2653
2666
|
}
|
|
2654
2667
|
class le {
|
|
@@ -2686,7 +2699,7 @@ class le {
|
|
|
2686
2699
|
};
|
|
2687
2700
|
}
|
|
2688
2701
|
}
|
|
2689
|
-
class
|
|
2702
|
+
class De extends h {
|
|
2690
2703
|
/**
|
|
2691
2704
|
* Получает пагинированный список данных.
|
|
2692
2705
|
*
|
|
@@ -2698,15 +2711,15 @@ class ae extends h {
|
|
|
2698
2711
|
* @param successHandler Обработчик успешного выполнения запроса.
|
|
2699
2712
|
* @param disableDefaultNotificationErrorResponseHandler Признак отключения стандартного обработчика ошибок.
|
|
2700
2713
|
*/
|
|
2701
|
-
getPaginated(r, e, s, i, o, c,
|
|
2702
|
-
let
|
|
2714
|
+
getPaginated(r, e, s, i, o, c, u) {
|
|
2715
|
+
let p = {
|
|
2703
2716
|
page: (i == null ? void 0 : i.page) ?? 1,
|
|
2704
2717
|
perPage: (i == null ? void 0 : i.pageSize) ?? 10
|
|
2705
2718
|
};
|
|
2706
|
-
return e && (
|
|
2719
|
+
return e && (p.filters = JSON.stringify((e instanceof le ? e : new le(e)).toPrimitive())), Pe(s) || (p.sort = K(s) ? s : [s]), o && (p = { ...p, ...o }), this.get(r, p, c, u);
|
|
2707
2720
|
}
|
|
2708
2721
|
}
|
|
2709
|
-
class zt extends
|
|
2722
|
+
class zt extends De {
|
|
2710
2723
|
/**
|
|
2711
2724
|
* Возвращает список шаблонов прайс-листа.
|
|
2712
2725
|
*
|
|
@@ -2719,7 +2732,7 @@ class zt extends ae {
|
|
|
2719
2732
|
getTemplateList(r, e, s) {
|
|
2720
2733
|
return this.getPaginated("/internal/price/templates", r, e, s, {}, (i) => {
|
|
2721
2734
|
const o = { ...i.data };
|
|
2722
|
-
return o.data = o.data.map((c) => new
|
|
2735
|
+
return o.data = o.data.map((c) => new W(c)), o;
|
|
2723
2736
|
});
|
|
2724
2737
|
}
|
|
2725
2738
|
/**
|
|
@@ -2732,7 +2745,7 @@ class zt extends ae {
|
|
|
2732
2745
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_create
|
|
2733
2746
|
*/
|
|
2734
2747
|
createTemplate(r, e = {}) {
|
|
2735
|
-
return this.post("/internal/price/templates", r, (s) => new
|
|
2748
|
+
return this.post("/internal/price/templates", r, (s) => new W(s.data), e);
|
|
2736
2749
|
}
|
|
2737
2750
|
/**
|
|
2738
2751
|
* Возвращает данные о шаблоне прайс-листа.
|
|
@@ -2742,7 +2755,7 @@ class zt extends ae {
|
|
|
2742
2755
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_get
|
|
2743
2756
|
*/
|
|
2744
2757
|
getTemplate(r) {
|
|
2745
|
-
return this.get(`/internal/price/templates/${r}`, {}, (e) => new
|
|
2758
|
+
return this.get(`/internal/price/templates/${r}`, {}, (e) => new W(e.data));
|
|
2746
2759
|
}
|
|
2747
2760
|
/**
|
|
2748
2761
|
* Изменяет данные о шаблоне прайс-листа.
|
|
@@ -2755,7 +2768,7 @@ class zt extends ae {
|
|
|
2755
2768
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_update
|
|
2756
2769
|
*/
|
|
2757
2770
|
updateTemplate(r, e, s = {}) {
|
|
2758
|
-
return this.patch(`/internal/price/templates/${r}`, e, (i) => new
|
|
2771
|
+
return this.patch(`/internal/price/templates/${r}`, e, (i) => new W(i.data), s);
|
|
2759
2772
|
}
|
|
2760
2773
|
/**
|
|
2761
2774
|
* Удаляет данные о шаблоне прайс-листа.
|
|
@@ -2778,7 +2791,7 @@ class zt extends ae {
|
|
|
2778
2791
|
return this.get(
|
|
2779
2792
|
`/internal/price/templates/${r}/products`,
|
|
2780
2793
|
{},
|
|
2781
|
-
(e) => e.data.map((s) => new
|
|
2794
|
+
(e) => e.data.map((s) => new be(s))
|
|
2782
2795
|
);
|
|
2783
2796
|
}
|
|
2784
2797
|
/**
|
|
@@ -2790,7 +2803,7 @@ class zt extends ae {
|
|
|
2790
2803
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_template_product_get
|
|
2791
2804
|
*/
|
|
2792
2805
|
getProductTemplatePrice(r, e) {
|
|
2793
|
-
return this.get(`/internal/price/templates/${r}/products/${e}`, {}, (s) => new
|
|
2806
|
+
return this.get(`/internal/price/templates/${r}/products/${e}`, {}, (s) => new be(s.data));
|
|
2794
2807
|
}
|
|
2795
2808
|
/**
|
|
2796
2809
|
* Сохраняет цену на продукт в шаблоне прайс-листа.
|
|
@@ -2809,7 +2822,7 @@ class zt extends ae {
|
|
|
2809
2822
|
price_coefficient_id: (i = s.coefficient) == null ? void 0 : i.id,
|
|
2810
2823
|
increase_percent: s.value
|
|
2811
2824
|
},
|
|
2812
|
-
(o) => new
|
|
2825
|
+
(o) => new be(o.data)
|
|
2813
2826
|
);
|
|
2814
2827
|
}
|
|
2815
2828
|
/**
|
|
@@ -2834,7 +2847,7 @@ class zt extends ae {
|
|
|
2834
2847
|
return this.get(
|
|
2835
2848
|
`/internal/price/templates/${r}/categories`,
|
|
2836
2849
|
{},
|
|
2837
|
-
(e) => e.data.map((s) => new
|
|
2850
|
+
(e) => e.data.map((s) => new Te(s))
|
|
2838
2851
|
);
|
|
2839
2852
|
}
|
|
2840
2853
|
/**
|
|
@@ -2849,7 +2862,7 @@ class zt extends ae {
|
|
|
2849
2862
|
return this.get(
|
|
2850
2863
|
`/internal/price/templates/${r}/categories/${e}`,
|
|
2851
2864
|
{},
|
|
2852
|
-
(s) => new
|
|
2865
|
+
(s) => new Te(s.data)
|
|
2853
2866
|
);
|
|
2854
2867
|
}
|
|
2855
2868
|
/**
|
|
@@ -2875,7 +2888,7 @@ class zt extends ae {
|
|
|
2875
2888
|
},
|
|
2876
2889
|
params: i ? { recursively: !0 } : {}
|
|
2877
2890
|
},
|
|
2878
|
-
(c) => new
|
|
2891
|
+
(c) => new Te(c.data)
|
|
2879
2892
|
);
|
|
2880
2893
|
}
|
|
2881
2894
|
/**
|
|
@@ -2906,7 +2919,7 @@ class zt extends ae {
|
|
|
2906
2919
|
return this.get(
|
|
2907
2920
|
`/internal/price/templates/${r}/clients`,
|
|
2908
2921
|
{},
|
|
2909
|
-
(e) => e.data.map((s) => new
|
|
2922
|
+
(e) => e.data.map((s) => new te(s))
|
|
2910
2923
|
);
|
|
2911
2924
|
}
|
|
2912
2925
|
}
|
|
@@ -2917,7 +2930,7 @@ class Wt extends h {
|
|
|
2917
2930
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_get_list
|
|
2918
2931
|
*/
|
|
2919
2932
|
getRoles() {
|
|
2920
|
-
return this.get("/internal/price/roles", {}, (r) => r.data.map((e) => new
|
|
2933
|
+
return this.get("/internal/price/roles", {}, (r) => r.data.map((e) => new ie(e)));
|
|
2921
2934
|
}
|
|
2922
2935
|
/**
|
|
2923
2936
|
* Добавляет новую роль ценообразования.
|
|
@@ -2927,7 +2940,7 @@ class Wt extends h {
|
|
|
2927
2940
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_create
|
|
2928
2941
|
*/
|
|
2929
2942
|
createRole(r) {
|
|
2930
|
-
return this.post("/internal/price/roles", r, (e) => new
|
|
2943
|
+
return this.post("/internal/price/roles", r, (e) => new ie(e.data));
|
|
2931
2944
|
}
|
|
2932
2945
|
/**
|
|
2933
2946
|
* Возвращает данные роли ценообразования.
|
|
@@ -2937,7 +2950,7 @@ class Wt extends h {
|
|
|
2937
2950
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_get
|
|
2938
2951
|
*/
|
|
2939
2952
|
getRole(r) {
|
|
2940
|
-
return this.get(`/internal/price/roles/${r}`, {}, (e) => new
|
|
2953
|
+
return this.get(`/internal/price/roles/${r}`, {}, (e) => new ie(e.data));
|
|
2941
2954
|
}
|
|
2942
2955
|
/**
|
|
2943
2956
|
* Обновляет данные роли ценообразования.
|
|
@@ -2948,7 +2961,7 @@ class Wt extends h {
|
|
|
2948
2961
|
* @see /doc/api/internal#/operations/api_internal_catalog_price_roles_update
|
|
2949
2962
|
*/
|
|
2950
2963
|
updateRole(r, e) {
|
|
2951
|
-
return this.patch(`/internal/price/roles/${r}`, e, (s) => new
|
|
2964
|
+
return this.patch(`/internal/price/roles/${r}`, e, (s) => new ie(s.data));
|
|
2952
2965
|
}
|
|
2953
2966
|
/**
|
|
2954
2967
|
* Удаляет роль ценообразования.
|
|
@@ -2990,7 +3003,7 @@ class Wt extends h {
|
|
|
2990
3003
|
);
|
|
2991
3004
|
}
|
|
2992
3005
|
}
|
|
2993
|
-
class Et extends
|
|
3006
|
+
class Et extends De {
|
|
2994
3007
|
/**
|
|
2995
3008
|
* Возвращает пагинированный список свойств.
|
|
2996
3009
|
*
|
|
@@ -3003,7 +3016,7 @@ class Et extends ae {
|
|
|
3003
3016
|
getProperties(r, e, s) {
|
|
3004
3017
|
return this.getPaginated("/internal/catalog/properties", r, e, s, {}, (i) => {
|
|
3005
3018
|
const o = { ...i.data };
|
|
3006
|
-
return o.data = o.data.map((c) => new
|
|
3019
|
+
return o.data = o.data.map((c) => new se(c)), o;
|
|
3007
3020
|
});
|
|
3008
3021
|
}
|
|
3009
3022
|
/**
|
|
@@ -3020,7 +3033,7 @@ class Et extends ae {
|
|
|
3020
3033
|
...s,
|
|
3021
3034
|
type: e
|
|
3022
3035
|
},
|
|
3023
|
-
(i) => new
|
|
3036
|
+
(i) => new se(i.data)
|
|
3024
3037
|
);
|
|
3025
3038
|
}
|
|
3026
3039
|
/**
|
|
@@ -3030,7 +3043,7 @@ class Et extends ae {
|
|
|
3030
3043
|
* @see /doc/api/internal#/operations/api_internal_catalog_properties_get
|
|
3031
3044
|
*/
|
|
3032
3045
|
getProperty(r) {
|
|
3033
|
-
return this.get(`/internal/catalog/properties/${r}`, {}, (e) => new
|
|
3046
|
+
return this.get(`/internal/catalog/properties/${r}`, {}, (e) => new se(e.data));
|
|
3034
3047
|
}
|
|
3035
3048
|
/**
|
|
3036
3049
|
* Обновляет существующее свойство.
|
|
@@ -3047,7 +3060,7 @@ class Et extends ae {
|
|
|
3047
3060
|
...i,
|
|
3048
3061
|
type: s
|
|
3049
3062
|
},
|
|
3050
|
-
(o) => new
|
|
3063
|
+
(o) => new se(o.data)
|
|
3051
3064
|
);
|
|
3052
3065
|
}
|
|
3053
3066
|
/**
|
|
@@ -3066,7 +3079,7 @@ class Et extends ae {
|
|
|
3066
3079
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_get_list
|
|
3067
3080
|
*/
|
|
3068
3081
|
getProductProperties(r) {
|
|
3069
|
-
return this.get(`/internal/catalog/products/${r}/properties`, {}, (e) => e.data.map((s) => new
|
|
3082
|
+
return this.get(`/internal/catalog/products/${r}/properties`, {}, (e) => e.data.map((s) => new B(s)));
|
|
3070
3083
|
}
|
|
3071
3084
|
/**
|
|
3072
3085
|
* Возвращает значение свойства продукта.
|
|
@@ -3076,7 +3089,7 @@ class Et extends ae {
|
|
|
3076
3089
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_get
|
|
3077
3090
|
*/
|
|
3078
3091
|
getProductProperty(r, e) {
|
|
3079
|
-
return this.get(`/internal/catalog/products/${r}/properties/${e}`, {}, (s) => new
|
|
3092
|
+
return this.get(`/internal/catalog/products/${r}/properties/${e}`, {}, (s) => new B(s.data));
|
|
3080
3093
|
}
|
|
3081
3094
|
/**
|
|
3082
3095
|
* Обновляет значение свойства продукта.
|
|
@@ -3087,7 +3100,7 @@ class Et extends ae {
|
|
|
3087
3100
|
* @see /doc/api/internal#/operations/api_internal_catalog_product_properties_update
|
|
3088
3101
|
*/
|
|
3089
3102
|
updateProductProperty(r, e, s) {
|
|
3090
|
-
return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: s }, (i) => new
|
|
3103
|
+
return this.patch(`/internal/catalog/products/${r}/properties/${e}`, { value: s }, (i) => new B(i.data));
|
|
3091
3104
|
}
|
|
3092
3105
|
/**
|
|
3093
3106
|
* Удаляет значение свойства продукта.
|
|
@@ -3212,7 +3225,7 @@ class Et extends ae {
|
|
|
3212
3225
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_get_list
|
|
3213
3226
|
*/
|
|
3214
3227
|
getCategoryProperties(r) {
|
|
3215
|
-
return this.get(`/internal/catalog/categories/${r}/properties`, {}, (e) => e.data.map((s) => new
|
|
3228
|
+
return this.get(`/internal/catalog/categories/${r}/properties`, {}, (e) => e.data.map((s) => new B(s)));
|
|
3216
3229
|
}
|
|
3217
3230
|
/**
|
|
3218
3231
|
* Возвращает значение свойства категории.
|
|
@@ -3222,7 +3235,7 @@ class Et extends ae {
|
|
|
3222
3235
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_get
|
|
3223
3236
|
*/
|
|
3224
3237
|
getCategoryProperty(r, e) {
|
|
3225
|
-
return this.get(`/internal/catalog/categories/${r}/properties/${e}`, {}, (s) => new
|
|
3238
|
+
return this.get(`/internal/catalog/categories/${r}/properties/${e}`, {}, (s) => new B(s.data));
|
|
3226
3239
|
}
|
|
3227
3240
|
/**
|
|
3228
3241
|
* Обновляет значение свойства категории.
|
|
@@ -3233,7 +3246,7 @@ class Et extends ae {
|
|
|
3233
3246
|
* @see /doc/api/internal#/operations/api_internal_catalog_category_properties_update
|
|
3234
3247
|
*/
|
|
3235
3248
|
updateCategoryProperty(r, e, s) {
|
|
3236
|
-
return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: s }, (i) => new
|
|
3249
|
+
return this.patch(`/internal/catalog/categories/${r}/properties/${e}`, { value: s }, (i) => new B(i.data));
|
|
3237
3250
|
}
|
|
3238
3251
|
/**
|
|
3239
3252
|
* Удаляет значение свойства категории.
|
|
@@ -3392,16 +3405,16 @@ function We(n) {
|
|
|
3392
3405
|
}
|
|
3393
3406
|
}), r;
|
|
3394
3407
|
}
|
|
3395
|
-
var tt = /* @__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))(tt || {}),
|
|
3408
|
+
var tt = /* @__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))(tt || {}), k = /* @__PURE__ */ ((n) => (n.Person = "individual", n.Ic = "entrepreneur", n.UlR = "legal", n.UlNr = "non_resident_legal", n))(k || {});
|
|
3396
3409
|
class st extends P {
|
|
3397
3410
|
}
|
|
3398
|
-
class
|
|
3411
|
+
class ur extends P {
|
|
3399
3412
|
}
|
|
3400
|
-
class
|
|
3413
|
+
class Jt extends P {
|
|
3401
3414
|
}
|
|
3402
3415
|
class it extends P {
|
|
3403
3416
|
}
|
|
3404
|
-
class ye extends
|
|
3417
|
+
class ye extends b {
|
|
3405
3418
|
/**
|
|
3406
3419
|
* Инициализирует экземпляр класса {@link Currency}.
|
|
3407
3420
|
*
|
|
@@ -3420,15 +3433,15 @@ class ye extends T {
|
|
|
3420
3433
|
e && (this.signature = e.signature ?? "", this.symbol = e.symbol ?? "");
|
|
3421
3434
|
}
|
|
3422
3435
|
}
|
|
3423
|
-
class
|
|
3436
|
+
class j extends P {
|
|
3424
3437
|
/**
|
|
3425
3438
|
* Возвращает сгенерированную запись-описание физического лица.
|
|
3426
3439
|
*/
|
|
3427
3440
|
static generatePersonItem() {
|
|
3428
|
-
return new
|
|
3441
|
+
return new j({
|
|
3429
3442
|
id: 1,
|
|
3430
3443
|
guid: "",
|
|
3431
|
-
slug:
|
|
3444
|
+
slug: k.Person,
|
|
3432
3445
|
name: ""
|
|
3433
3446
|
});
|
|
3434
3447
|
}
|
|
@@ -3437,7 +3450,7 @@ class nt extends P {
|
|
|
3437
3450
|
}
|
|
3438
3451
|
class ot extends P {
|
|
3439
3452
|
}
|
|
3440
|
-
class
|
|
3453
|
+
class ee extends P {
|
|
3441
3454
|
}
|
|
3442
3455
|
class ct extends P {
|
|
3443
3456
|
}
|
|
@@ -3445,7 +3458,7 @@ class lt extends P {
|
|
|
3445
3458
|
}
|
|
3446
3459
|
class pr extends P {
|
|
3447
3460
|
}
|
|
3448
|
-
class
|
|
3461
|
+
class hr extends P {
|
|
3449
3462
|
}
|
|
3450
3463
|
class Le extends M {
|
|
3451
3464
|
/**
|
|
@@ -3478,7 +3491,7 @@ class Le extends M {
|
|
|
3478
3491
|
e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new ye(e.currency));
|
|
3479
3492
|
}
|
|
3480
3493
|
}
|
|
3481
|
-
class
|
|
3494
|
+
class xe extends b {
|
|
3482
3495
|
/**
|
|
3483
3496
|
* Инициализирует экземпляр класса {@link Contact}.
|
|
3484
3497
|
*
|
|
@@ -3497,7 +3510,7 @@ class ke extends T {
|
|
|
3497
3510
|
this.email = e == null ? void 0 : e.email, this.phone = /^\d+$/.test((e == null ? void 0 : e.phone) ?? "") ? `+${e == null ? void 0 : e.phone}` : e == null ? void 0 : e.phone;
|
|
3498
3511
|
}
|
|
3499
3512
|
}
|
|
3500
|
-
class
|
|
3513
|
+
class F extends xe {
|
|
3501
3514
|
/**
|
|
3502
3515
|
* Инициализирует экземпляр класса {@link ContactPerson}.
|
|
3503
3516
|
*
|
|
@@ -3529,10 +3542,10 @@ class j extends ke {
|
|
|
3529
3542
|
* Дата и время последнего удаления.
|
|
3530
3543
|
*/
|
|
3531
3544
|
t(this, "deletedAt");
|
|
3532
|
-
this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1, this.position = e == null ? void 0 : e.position, this.notDisturb = (e == null ? void 0 : e.notDisturb) ?? !1, this.comment = e == null ? void 0 : e.comment, this.updatedAt = e == null ? void 0 : e.updatedAt, this.deletedAt =
|
|
3545
|
+
this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1, this.position = e == null ? void 0 : e.position, this.notDisturb = (e == null ? void 0 : e.notDisturb) ?? !1, this.comment = e == null ? void 0 : e.comment, this.updatedAt = e == null ? void 0 : e.updatedAt, this.deletedAt = C(e == null ? void 0 : e.deletedAt) ? v(e.deletedAt) : e == null ? void 0 : e.deletedAt;
|
|
3533
3546
|
}
|
|
3534
3547
|
}
|
|
3535
|
-
class
|
|
3548
|
+
class gr extends b {
|
|
3536
3549
|
/**
|
|
3537
3550
|
* Инициализирует экземпляр класса {@link ContragentBase}.
|
|
3538
3551
|
*
|
|
@@ -3548,15 +3561,15 @@ class hr extends T {
|
|
|
3548
3561
|
/**
|
|
3549
3562
|
* Данные об организационно-правовой форме.
|
|
3550
3563
|
*/
|
|
3551
|
-
t(this, "opf",
|
|
3564
|
+
t(this, "opf", j.generatePersonItem());
|
|
3552
3565
|
/**
|
|
3553
3566
|
* Направление продаж.
|
|
3554
3567
|
*/
|
|
3555
|
-
t(this, "salesDirection", new
|
|
3568
|
+
t(this, "salesDirection", new N());
|
|
3556
3569
|
/**
|
|
3557
3570
|
* Группа партнеров (направление деятельности).
|
|
3558
3571
|
*/
|
|
3559
|
-
t(this, "partnerGroup", new
|
|
3572
|
+
t(this, "partnerGroup", new ee());
|
|
3560
3573
|
/**
|
|
3561
3574
|
* Список контактных лиц контрагента.
|
|
3562
3575
|
*/
|
|
@@ -3590,10 +3603,10 @@ class hr extends T {
|
|
|
3590
3603
|
*/
|
|
3591
3604
|
t(this, "updater");
|
|
3592
3605
|
if (e) {
|
|
3593
|
-
if (this.opf = new
|
|
3606
|
+
if (this.opf = new j(e.opf), this.salesDirection = new N(e.salesDirection), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : e.createdAt, this.creator = e.creator ? new G(e.creator) : void 0, this.updatedAt = C(e == null ? void 0 : e.updatedAt) ? v(e.updatedAt) : e.updatedAt, this.updater = e.updater ? new G(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new ee(e.partnerGroup)), e.manager && (this.manager = new oe(e.manager)), e.contacts) {
|
|
3594
3607
|
const s = [];
|
|
3595
3608
|
e.contacts.forEach((i) => {
|
|
3596
|
-
s.push(new
|
|
3609
|
+
s.push(new F(i));
|
|
3597
3610
|
}), this.contacts = s;
|
|
3598
3611
|
}
|
|
3599
3612
|
if (e.bankAccounts) {
|
|
@@ -3605,7 +3618,7 @@ class hr extends T {
|
|
|
3605
3618
|
}
|
|
3606
3619
|
}
|
|
3607
3620
|
}
|
|
3608
|
-
class
|
|
3621
|
+
class ut extends gr {
|
|
3609
3622
|
/**
|
|
3610
3623
|
* Инициализирует экземпляр класса {@link ContragentPerson}.
|
|
3611
3624
|
*
|
|
@@ -3615,7 +3628,7 @@ class pt extends hr {
|
|
|
3615
3628
|
super(r);
|
|
3616
3629
|
}
|
|
3617
3630
|
}
|
|
3618
|
-
class
|
|
3631
|
+
class mr extends gr {
|
|
3619
3632
|
/**
|
|
3620
3633
|
* Инициализирует экземпляр класса {@link ContragentIc}.
|
|
3621
3634
|
*
|
|
@@ -3658,7 +3671,7 @@ class gr extends hr {
|
|
|
3658
3671
|
e && (this.inn = e.inn ?? "", this.okpo = e.okpo ?? "", this.directorName = e.directorName ?? "", this.directorPosition = e.directorPosition ?? "", this.directorActsOn = e.directorActsOn ?? "", this.legalAddress = e.legalAddress ?? "", this.postalAddress = e.postalAddress ?? "", this.actualAddress = e.actualAddress ?? "");
|
|
3659
3672
|
}
|
|
3660
3673
|
}
|
|
3661
|
-
class
|
|
3674
|
+
class fr extends mr {
|
|
3662
3675
|
/**
|
|
3663
3676
|
* Инициализирует экземпляр класса {@link ContragentUlR}.
|
|
3664
3677
|
*
|
|
@@ -3673,7 +3686,7 @@ class mr extends gr {
|
|
|
3673
3686
|
e && (this.kpp = e.kpp ?? "");
|
|
3674
3687
|
}
|
|
3675
3688
|
}
|
|
3676
|
-
class
|
|
3689
|
+
class pt extends fr {
|
|
3677
3690
|
/**
|
|
3678
3691
|
* Инициализирует экземпляр класса {@link ContragentUlNr}.
|
|
3679
3692
|
*
|
|
@@ -3684,7 +3697,7 @@ class ut extends mr {
|
|
|
3684
3697
|
/**
|
|
3685
3698
|
* Страна регистрации юридического лица нерезидента.
|
|
3686
3699
|
*/
|
|
3687
|
-
t(this, "registrationCountry", new
|
|
3700
|
+
t(this, "registrationCountry", new Z());
|
|
3688
3701
|
/**
|
|
3689
3702
|
* Регистрационный номер юридического лица нерезидента.
|
|
3690
3703
|
*/
|
|
@@ -3693,7 +3706,7 @@ class ut extends mr {
|
|
|
3693
3706
|
* Налоговый номер юридического лица нерезидента.
|
|
3694
3707
|
*/
|
|
3695
3708
|
t(this, "taxNumber", "");
|
|
3696
|
-
e && (this.registrationCountry = new
|
|
3709
|
+
e && (this.registrationCountry = new Z(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
|
|
3697
3710
|
}
|
|
3698
3711
|
}
|
|
3699
3712
|
class we {
|
|
@@ -3704,18 +3717,18 @@ class we {
|
|
|
3704
3717
|
*/
|
|
3705
3718
|
static createInstance(r) {
|
|
3706
3719
|
switch (r.opf.slug) {
|
|
3707
|
-
case
|
|
3708
|
-
return new gr(r);
|
|
3709
|
-
case d.UlR:
|
|
3720
|
+
case k.Ic:
|
|
3710
3721
|
return new mr(r);
|
|
3711
|
-
case
|
|
3712
|
-
return new
|
|
3713
|
-
|
|
3722
|
+
case k.UlR:
|
|
3723
|
+
return new fr(r);
|
|
3724
|
+
case k.UlNr:
|
|
3714
3725
|
return new pt(r);
|
|
3726
|
+
default:
|
|
3727
|
+
return new ut(r);
|
|
3715
3728
|
}
|
|
3716
3729
|
}
|
|
3717
3730
|
}
|
|
3718
|
-
class
|
|
3731
|
+
class _e extends M {
|
|
3719
3732
|
/**
|
|
3720
3733
|
* Инициализирует экземпляр класса {@link ContactRelation}.
|
|
3721
3734
|
*
|
|
@@ -3730,7 +3743,7 @@ class be extends M {
|
|
|
3730
3743
|
this.isPrimary = e.isPrimary;
|
|
3731
3744
|
}
|
|
3732
3745
|
}
|
|
3733
|
-
class ht extends
|
|
3746
|
+
class ht extends F {
|
|
3734
3747
|
/**
|
|
3735
3748
|
* Инициализирует экземпляр класса {@link ContactPersonRelated}.
|
|
3736
3749
|
*
|
|
@@ -3755,7 +3768,7 @@ class ht extends j {
|
|
|
3755
3768
|
*/
|
|
3756
3769
|
addresses: []
|
|
3757
3770
|
});
|
|
3758
|
-
e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((s) => new
|
|
3771
|
+
e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((s) => new _e(s))), e.relations.clients && (this.relations.clients = e.relations.clients.map((s) => new _e(s))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((s) => new _e(s))));
|
|
3759
3772
|
}
|
|
3760
3773
|
}
|
|
3761
3774
|
class Ce extends Er {
|
|
@@ -3795,10 +3808,10 @@ class Ce extends Er {
|
|
|
3795
3808
|
* Признак того, что указанный адрес является адресом транспортной компании.
|
|
3796
3809
|
*/
|
|
3797
3810
|
t(this, "isTransportCompanyAddress");
|
|
3798
|
-
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new
|
|
3811
|
+
this.address = (e == null ? void 0 : e.address) ?? "", this.coordinates = new ir(e == null ? void 0 : e.coordinates), this.contacts = ((s = e == null ? void 0 : e.contacts) == null ? void 0 : s.map((i) => new F(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;
|
|
3799
3812
|
}
|
|
3800
3813
|
}
|
|
3801
|
-
class Ee extends
|
|
3814
|
+
class Ee extends he {
|
|
3802
3815
|
/**
|
|
3803
3816
|
* Инициализирует экземпляр класса {@link Client}.
|
|
3804
3817
|
*
|
|
@@ -3852,10 +3865,10 @@ class Ee extends ge {
|
|
|
3852
3865
|
* Дополнительные данные о клиенте.
|
|
3853
3866
|
*/
|
|
3854
3867
|
t(this, "extraData");
|
|
3855
|
-
this.contragents = ((s = e == null ? void 0 : e.contragents) == null ? void 0 : s.map((
|
|
3868
|
+
this.contragents = ((s = e == null ? void 0 : e.contragents) == null ? void 0 : s.map((u) => we.createInstance(u))) ?? [], this.partnerGroups = ((i = e == null ? void 0 : e.partnerGroups) == null ? void 0 : i.map((u) => new ee(u))) ?? [], this.contacts = ((o = e == null ? void 0 : e.contacts) == null ? void 0 : o.map((u) => new F(u))) ?? [], this.deliveryAddresses = ((c = e == null ? void 0 : e.deliveryAddresses) == null ? void 0 : c.map((u) => new Ce(u))) ?? [], this.channelPrimaryInterest = new ur(e == null ? void 0 : e.channelPrimaryInterest), this.sourcePrimaryInterest = new hr(e == null ? void 0 : e.sourcePrimaryInterest), this.preferredDeliveryType = new Y(e == null ? void 0 : e.preferredDeliveryType), this.primaryDemand = e == null ? void 0 : e.primaryDemand, this.isExcludedFromMsCallsToClients = (e == null ? void 0 : e.isExcludedFromMsCallsToClients) ?? !1, this.preferredWarehouse = e != null && e.preferredWarehouse ? new ae(e.preferredWarehouse) : void 0, this.extraData = (e == null ? void 0 : e.extraData) ?? {};
|
|
3856
3869
|
}
|
|
3857
3870
|
}
|
|
3858
|
-
class
|
|
3871
|
+
class Vt {
|
|
3859
3872
|
/**
|
|
3860
3873
|
* Инициализирует экземпляр класса {@link ClientsListFilters}.
|
|
3861
3874
|
*
|
|
@@ -3950,11 +3963,11 @@ class Jt {
|
|
|
3950
3963
|
* Данные о параметрах поиска последнего заказа который сделал пользователь.
|
|
3951
3964
|
*/
|
|
3952
3965
|
t(this, "lastOrder");
|
|
3953
|
-
var e, s, i, o, c,
|
|
3954
|
-
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((
|
|
3966
|
+
var e, s, i, o, c, u;
|
|
3967
|
+
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((p) => new je(p)), this.region = new ce(r == null ? void 0 : r.region), this.country = new Z(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 O(r == null ? void 0 : r.createdAt), this.lastLoginDate = new O(r == null ? void 0 : r.lastLoginDate), this.lastLoginDateHasOrder = (r == null ? void 0 : r.lastLoginDateHasOrder) ?? void 0, this.managers = r != null && r.managers && r.managers.length > 0 ? r.managers.map((p) => new Ae(p)) : [], this.salesDirections = (s = r == null ? void 0 : r.salesDirections) == null ? void 0 : s.map((p) => new N(p)), this.contragentInn = r == null ? void 0 : r.contragentInn, this.contragentType = new j(r == null ? void 0 : r.contragentType), this.preferredDeliveryType = new Y(r == null ? void 0 : r.preferredDeliveryType), this.partnerGroups = (i = r == null ? void 0 : r.partnerGroups) == null ? void 0 : i.map((p) => new ee(p)), this.contact = new xe(r == null ? void 0 : r.contact), this.lastOrder = {
|
|
3955
3968
|
createdAt: new O((o = r == null ? void 0 : r.lastOrder) == null ? void 0 : o.createdAt),
|
|
3956
3969
|
creator: (c = r == null ? void 0 : r.lastOrder) == null ? void 0 : c.creator,
|
|
3957
|
-
isApproved: (
|
|
3970
|
+
isApproved: (u = r == null ? void 0 : r.lastOrder) == null ? void 0 : u.isApproved
|
|
3958
3971
|
};
|
|
3959
3972
|
}
|
|
3960
3973
|
/**
|
|
@@ -4001,16 +4014,16 @@ class Jt {
|
|
|
4001
4014
|
this.salesDirections = [];
|
|
4002
4015
|
break;
|
|
4003
4016
|
case "contragentType":
|
|
4004
|
-
this.contragentType = new
|
|
4017
|
+
this.contragentType = new j();
|
|
4005
4018
|
break;
|
|
4006
4019
|
case "preferredDeliveryType":
|
|
4007
|
-
this.preferredDeliveryType = new
|
|
4020
|
+
this.preferredDeliveryType = new Y();
|
|
4008
4021
|
break;
|
|
4009
4022
|
case "partnerGroups":
|
|
4010
4023
|
this.partnerGroups = [];
|
|
4011
4024
|
break;
|
|
4012
4025
|
case "contact":
|
|
4013
|
-
this.contact = new
|
|
4026
|
+
this.contact = new xe();
|
|
4014
4027
|
break;
|
|
4015
4028
|
}
|
|
4016
4029
|
return this;
|
|
@@ -4023,13 +4036,13 @@ class Jt {
|
|
|
4023
4036
|
var e, s, i, o;
|
|
4024
4037
|
const r = {};
|
|
4025
4038
|
return Object.keys(this).forEach((c) => {
|
|
4026
|
-
const
|
|
4039
|
+
const u = this[c];
|
|
4027
4040
|
// eslint-disable-next-line prettier/prettier
|
|
4028
|
-
$(
|
|
4041
|
+
$(u) || C(u) && u.trim().length === 0 || Ne(u.isNewRec) && u.isNewRec() || (r[c] = u);
|
|
4029
4042
|
}), !((e = r == null ? void 0 : r.createdAt) != null && e.from) && !((s = r == null ? void 0 : r.createdAt) != null && s.to) && delete r.createdAt, !((i = r == null ? void 0 : r.lastLoginDate) != null && i.from) && !((o = r == null ? void 0 : r.lastLoginDate) != null && o.to) && delete r.lastLoginDate, r;
|
|
4030
4043
|
}
|
|
4031
4044
|
}
|
|
4032
|
-
class
|
|
4045
|
+
class yr extends M {
|
|
4033
4046
|
/**
|
|
4034
4047
|
* Инициализирует экземпляр класса {@link OrderShortInfo}.
|
|
4035
4048
|
*
|
|
@@ -4049,10 +4062,10 @@ class fr extends M {
|
|
|
4049
4062
|
* Признак того, что заказ подтвержден в 1С.
|
|
4050
4063
|
*/
|
|
4051
4064
|
t(this, "isApproved1c");
|
|
4052
|
-
this.createdAt =
|
|
4065
|
+
this.createdAt = C(e == null ? void 0 : e.createdAt) ? v(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new G(e == null ? void 0 : e.creator), this.isApproved1c = (e == null ? void 0 : e.isApproved1c) ?? !1;
|
|
4053
4066
|
}
|
|
4054
4067
|
}
|
|
4055
|
-
class gt extends
|
|
4068
|
+
class gt extends b {
|
|
4056
4069
|
/**
|
|
4057
4070
|
* Инициализирует экземпляр класса {@link ClientAdditionalData}.
|
|
4058
4071
|
*
|
|
@@ -4085,7 +4098,7 @@ class gt extends T {
|
|
|
4085
4098
|
* Список менеджеров.
|
|
4086
4099
|
*/
|
|
4087
4100
|
t(this, "managers");
|
|
4088
|
-
(s = e.contacts) != null && s.length && (this.contacts = e.contacts.map((o) => new
|
|
4101
|
+
(s = e.contacts) != null && s.length && (this.contacts = e.contacts.map((o) => new F(o))), e.lastOrder && (this.lastOrder = new yr(e.lastOrder)), (i = e.partnerGroups) != null && i.length && (this.partnerGroups = e.partnerGroups.map((o) => new ee(o))), e.preferredDeliveryType && (this.preferredDeliveryType = new Y(e.preferredDeliveryType)), e.salesDirection && (this.salesDirection = new N(e.salesDirection)), e.managers && (this.managers = e.managers.map((o) => new oe(o)));
|
|
4089
4102
|
}
|
|
4090
4103
|
}
|
|
4091
4104
|
class mt {
|
|
@@ -4155,7 +4168,7 @@ class Qt {
|
|
|
4155
4168
|
this.field = (r == null ? void 0 : r.field) ?? "", this.direction = (r == null ? void 0 : r.direction) ?? "asc";
|
|
4156
4169
|
}
|
|
4157
4170
|
}
|
|
4158
|
-
class Yt extends
|
|
4171
|
+
class Yt extends De {
|
|
4159
4172
|
/**
|
|
4160
4173
|
* Возвращает данные об указанном клиенте.
|
|
4161
4174
|
*
|
|
@@ -4178,7 +4191,7 @@ class Yt extends ae {
|
|
|
4178
4191
|
getClientsList(r, e, s, i) {
|
|
4179
4192
|
return this.getPaginated("/internal/clients", r, e, s, i, (o) => {
|
|
4180
4193
|
const c = { ...o.data };
|
|
4181
|
-
return c.data = c.data.map((
|
|
4194
|
+
return c.data = c.data.map((u) => new he(u)), c;
|
|
4182
4195
|
});
|
|
4183
4196
|
}
|
|
4184
4197
|
/**
|
|
@@ -4191,7 +4204,7 @@ class Yt extends ae {
|
|
|
4191
4204
|
return this.getClientsList({
|
|
4192
4205
|
groupOp: "and",
|
|
4193
4206
|
groups: [],
|
|
4194
|
-
filters: [{ field: "phone", op:
|
|
4207
|
+
filters: [{ field: "phone", op: Fe.Contains, value: r }]
|
|
4195
4208
|
});
|
|
4196
4209
|
}
|
|
4197
4210
|
/**
|
|
@@ -4357,17 +4370,17 @@ class Yt extends ae {
|
|
|
4357
4370
|
* @see /doc/api/internal#/Контрагенты/api_internal_client_contragent_create
|
|
4358
4371
|
*/
|
|
4359
4372
|
createContragentClientData(r, e, s = {}) {
|
|
4360
|
-
var
|
|
4373
|
+
var p, f, m, A, d, I, _, S;
|
|
4361
4374
|
let i;
|
|
4362
|
-
const o = e, c = e,
|
|
4375
|
+
const o = e, c = e, u = e;
|
|
4363
4376
|
switch (e.opf.slug) {
|
|
4364
|
-
case
|
|
4377
|
+
case k.Ic:
|
|
4365
4378
|
i = {
|
|
4366
4379
|
opf: o.opf.slug,
|
|
4367
4380
|
name: o.name,
|
|
4368
4381
|
alternative_name: o.alternativeName,
|
|
4369
|
-
partner_group_id: (
|
|
4370
|
-
manager_id: (
|
|
4382
|
+
partner_group_id: (p = o.partnerGroup) == null ? void 0 : p.id,
|
|
4383
|
+
manager_id: (f = o.manager) == null ? void 0 : f.id,
|
|
4371
4384
|
comment: o.comment,
|
|
4372
4385
|
inn: o.inn,
|
|
4373
4386
|
okpo: o.okpo,
|
|
@@ -4379,13 +4392,13 @@ class Yt extends ae {
|
|
|
4379
4392
|
actual_address: o.actualAddress
|
|
4380
4393
|
};
|
|
4381
4394
|
break;
|
|
4382
|
-
case
|
|
4395
|
+
case k.UlR:
|
|
4383
4396
|
i = {
|
|
4384
4397
|
opf: c.opf.slug,
|
|
4385
4398
|
name: c.name,
|
|
4386
4399
|
alternative_name: c.alternativeName,
|
|
4387
|
-
partner_group_id: (
|
|
4388
|
-
manager_id: (
|
|
4400
|
+
partner_group_id: (m = c.partnerGroup) == null ? void 0 : m.id,
|
|
4401
|
+
manager_id: (A = c.manager) == null ? void 0 : A.id,
|
|
4389
4402
|
comment: c.comment,
|
|
4390
4403
|
inn: c.inn,
|
|
4391
4404
|
kpp: c.kpp,
|
|
@@ -4398,23 +4411,23 @@ class Yt extends ae {
|
|
|
4398
4411
|
actual_address: c.actualAddress
|
|
4399
4412
|
};
|
|
4400
4413
|
break;
|
|
4401
|
-
case
|
|
4414
|
+
case k.UlNr:
|
|
4402
4415
|
i = {
|
|
4403
|
-
opf:
|
|
4404
|
-
name:
|
|
4405
|
-
alternative_name:
|
|
4406
|
-
partner_group_id: (
|
|
4407
|
-
manager_id: (
|
|
4408
|
-
comment:
|
|
4409
|
-
director_name:
|
|
4410
|
-
director_position:
|
|
4411
|
-
director_acts_on:
|
|
4412
|
-
legal_address:
|
|
4413
|
-
postal_address:
|
|
4414
|
-
actual_address:
|
|
4415
|
-
registration_country_id:
|
|
4416
|
-
registration_number:
|
|
4417
|
-
tax_number:
|
|
4416
|
+
opf: u.opf.slug,
|
|
4417
|
+
name: u.name,
|
|
4418
|
+
alternative_name: u.alternativeName,
|
|
4419
|
+
partner_group_id: (d = u.partnerGroup) == null ? void 0 : d.id,
|
|
4420
|
+
manager_id: (I = u.manager) == null ? void 0 : I.id,
|
|
4421
|
+
comment: u.comment,
|
|
4422
|
+
director_name: u.directorName,
|
|
4423
|
+
director_position: u.directorPosition,
|
|
4424
|
+
director_acts_on: u.directorActsOn,
|
|
4425
|
+
legal_address: u.legalAddress,
|
|
4426
|
+
postal_address: u.postalAddress,
|
|
4427
|
+
actual_address: u.actualAddress,
|
|
4428
|
+
registration_country_id: u.registrationCountry.id,
|
|
4429
|
+
registration_number: u.registrationNumber,
|
|
4430
|
+
tax_number: u.taxNumber || void 0
|
|
4418
4431
|
};
|
|
4419
4432
|
break;
|
|
4420
4433
|
default:
|
|
@@ -4423,7 +4436,7 @@ class Yt extends ae {
|
|
|
4423
4436
|
name: e.name,
|
|
4424
4437
|
alternative_name: e.alternativeName,
|
|
4425
4438
|
partner_group_id: (_ = e.partnerGroup) == null ? void 0 : _.id,
|
|
4426
|
-
manager_id: (
|
|
4439
|
+
manager_id: (S = e.manager) == null ? void 0 : S.id,
|
|
4427
4440
|
comment: e.comment
|
|
4428
4441
|
};
|
|
4429
4442
|
break;
|
|
@@ -4446,17 +4459,17 @@ class Yt extends ae {
|
|
|
4446
4459
|
* @see /doc/api/internal#/Контрагенты/api_internal_client_contragent_update
|
|
4447
4460
|
*/
|
|
4448
4461
|
updateContragentClientData(r, e, s = {}) {
|
|
4449
|
-
var
|
|
4462
|
+
var p, f, m, A, d, I, _, S;
|
|
4450
4463
|
let i;
|
|
4451
|
-
const o = e, c = e,
|
|
4464
|
+
const o = e, c = e, u = e;
|
|
4452
4465
|
switch (e.opf.slug) {
|
|
4453
|
-
case
|
|
4466
|
+
case k.Ic:
|
|
4454
4467
|
i = {
|
|
4455
4468
|
opf: o.opf.slug,
|
|
4456
4469
|
name: o.name,
|
|
4457
4470
|
alternative_name: o.alternativeName,
|
|
4458
|
-
partner_group_id: (
|
|
4459
|
-
manager_id: (
|
|
4471
|
+
partner_group_id: (p = o.partnerGroup) == null ? void 0 : p.id,
|
|
4472
|
+
manager_id: (f = o.manager) == null ? void 0 : f.id,
|
|
4460
4473
|
comment: o.comment,
|
|
4461
4474
|
inn: o.inn,
|
|
4462
4475
|
okpo: o.okpo,
|
|
@@ -4468,13 +4481,13 @@ class Yt extends ae {
|
|
|
4468
4481
|
actual_address: o.actualAddress
|
|
4469
4482
|
};
|
|
4470
4483
|
break;
|
|
4471
|
-
case
|
|
4484
|
+
case k.UlR:
|
|
4472
4485
|
i = {
|
|
4473
4486
|
opf: c.opf.slug,
|
|
4474
4487
|
name: c.name,
|
|
4475
4488
|
alternative_name: c.alternativeName,
|
|
4476
|
-
partner_group_id: (
|
|
4477
|
-
manager_id: (
|
|
4489
|
+
partner_group_id: (m = c.partnerGroup) == null ? void 0 : m.id,
|
|
4490
|
+
manager_id: (A = c.manager) == null ? void 0 : A.id,
|
|
4478
4491
|
comment: c.comment,
|
|
4479
4492
|
inn: c.inn,
|
|
4480
4493
|
kpp: c.kpp,
|
|
@@ -4487,23 +4500,23 @@ class Yt extends ae {
|
|
|
4487
4500
|
actual_address: c.actualAddress
|
|
4488
4501
|
};
|
|
4489
4502
|
break;
|
|
4490
|
-
case
|
|
4503
|
+
case k.UlNr:
|
|
4491
4504
|
i = {
|
|
4492
|
-
opf:
|
|
4493
|
-
name:
|
|
4494
|
-
alternative_name:
|
|
4495
|
-
partner_group_id: (
|
|
4496
|
-
manager_id: (
|
|
4497
|
-
comment:
|
|
4498
|
-
director_name:
|
|
4499
|
-
director_position:
|
|
4500
|
-
director_acts_on:
|
|
4501
|
-
legal_address:
|
|
4502
|
-
postal_address:
|
|
4503
|
-
actual_address:
|
|
4504
|
-
registration_country_id:
|
|
4505
|
-
registration_number:
|
|
4506
|
-
tax_number:
|
|
4505
|
+
opf: u.opf.slug,
|
|
4506
|
+
name: u.name,
|
|
4507
|
+
alternative_name: u.alternativeName,
|
|
4508
|
+
partner_group_id: (d = u.partnerGroup) == null ? void 0 : d.id,
|
|
4509
|
+
manager_id: (I = u.manager) == null ? void 0 : I.id,
|
|
4510
|
+
comment: u.comment,
|
|
4511
|
+
director_name: u.directorName,
|
|
4512
|
+
director_position: u.directorPosition,
|
|
4513
|
+
director_acts_on: u.directorActsOn,
|
|
4514
|
+
legal_address: u.legalAddress,
|
|
4515
|
+
postal_address: u.postalAddress,
|
|
4516
|
+
actual_address: u.actualAddress,
|
|
4517
|
+
registration_country_id: u.registrationCountry.id,
|
|
4518
|
+
registration_number: u.registrationNumber,
|
|
4519
|
+
tax_number: u.taxNumber || void 0
|
|
4507
4520
|
};
|
|
4508
4521
|
break;
|
|
4509
4522
|
default:
|
|
@@ -4512,7 +4525,7 @@ class Yt extends ae {
|
|
|
4512
4525
|
name: e.name,
|
|
4513
4526
|
alternative_name: e.alternativeName,
|
|
4514
4527
|
partner_group_id: (_ = e.partnerGroup) == null ? void 0 : _.id,
|
|
4515
|
-
manager_id: (
|
|
4528
|
+
manager_id: (S = e.manager) == null ? void 0 : S.id,
|
|
4516
4529
|
comment: e.comment
|
|
4517
4530
|
};
|
|
4518
4531
|
break;
|
|
@@ -4558,7 +4571,7 @@ class Yt extends ae {
|
|
|
4558
4571
|
}), e.operatingHours && (i.operating_hours = {
|
|
4559
4572
|
from: e.operatingHours.from,
|
|
4560
4573
|
to: e.operatingHours.to
|
|
4561
|
-
}), this.post(`/internal/clients/${r}/delivery-addresses`, i, (
|
|
4574
|
+
}), this.post(`/internal/clients/${r}/delivery-addresses`, i, (u) => new Ce(u.data), s);
|
|
4562
4575
|
}
|
|
4563
4576
|
/**
|
|
4564
4577
|
* Обновляет данные об адресе доставки клиента.
|
|
@@ -4587,7 +4600,7 @@ class Yt extends ae {
|
|
|
4587
4600
|
}), this.patch(
|
|
4588
4601
|
`/internal/clients/${r}/delivery-addresses/${e.id}`,
|
|
4589
4602
|
i,
|
|
4590
|
-
(
|
|
4603
|
+
(u) => new Ce(u.data),
|
|
4591
4604
|
s
|
|
4592
4605
|
);
|
|
4593
4606
|
}
|
|
@@ -4710,7 +4723,7 @@ class Yt extends ae {
|
|
|
4710
4723
|
comment: e.comment,
|
|
4711
4724
|
not_disturb: e.notDisturb
|
|
4712
4725
|
},
|
|
4713
|
-
(i) => new
|
|
4726
|
+
(i) => new F(i.data),
|
|
4714
4727
|
s
|
|
4715
4728
|
);
|
|
4716
4729
|
}
|
|
@@ -4846,14 +4859,14 @@ class Yt extends ae {
|
|
|
4846
4859
|
* в случае ошибок в запросах.
|
|
4847
4860
|
*/
|
|
4848
4861
|
createContact(r, e, s, i = {}) {
|
|
4849
|
-
var c,
|
|
4862
|
+
var c, u;
|
|
4850
4863
|
const o = {
|
|
4851
4864
|
name: e.name,
|
|
4852
4865
|
position: e.position,
|
|
4853
4866
|
comment: e.comment,
|
|
4854
4867
|
...s
|
|
4855
4868
|
};
|
|
4856
|
-
return (c = e.phone) != null && c.length && (o.phone = e.phone), (
|
|
4869
|
+
return (c = e.phone) != null && c.length && (o.phone = e.phone), (u = e.email) != null && u.length && (o.email = e.email), this.post(`/internal/clients/${r}/contacts`, o, (p) => new F(p.data), i);
|
|
4857
4870
|
}
|
|
4858
4871
|
/**
|
|
4859
4872
|
* Устанавливает признак основного контактного лица.
|
|
@@ -4882,7 +4895,7 @@ class Yt extends ae {
|
|
|
4882
4895
|
return this.get(`/internal/clients/${r.id}/verification/email?email=${r.email}`);
|
|
4883
4896
|
}
|
|
4884
4897
|
}
|
|
4885
|
-
const
|
|
4898
|
+
const J = class J extends h {
|
|
4886
4899
|
/**
|
|
4887
4900
|
* Инициализирует экземпляр класса {@link HttpCachedRequester}.
|
|
4888
4901
|
*/
|
|
@@ -4892,7 +4905,7 @@ const E = class E extends h {
|
|
|
4892
4905
|
* Время кэширования данных ответов на запросы (секунд).
|
|
4893
4906
|
*/
|
|
4894
4907
|
t(this, "responseDataCacheTimeout");
|
|
4895
|
-
this.responseDataCacheTimeout =
|
|
4908
|
+
this.responseDataCacheTimeout = T.getConfig().http.responseDataCacheTimeout;
|
|
4896
4909
|
}
|
|
4897
4910
|
/**
|
|
4898
4911
|
* Возвращает кэшированные данные.
|
|
@@ -4902,7 +4915,7 @@ const E = class E extends h {
|
|
|
4902
4915
|
*/
|
|
4903
4916
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
4904
4917
|
static getCachedResponse(e) {
|
|
4905
|
-
const s =
|
|
4918
|
+
const s = J.responseDataCache.get(e);
|
|
4906
4919
|
if (s && s.validTo > /* @__PURE__ */ new Date())
|
|
4907
4920
|
return s.val;
|
|
4908
4921
|
}
|
|
@@ -4913,8 +4926,8 @@ const E = class E extends h {
|
|
|
4913
4926
|
* @param data Данные для кэширования.
|
|
4914
4927
|
*/
|
|
4915
4928
|
cacheResponse(e, s) {
|
|
4916
|
-
|
|
4917
|
-
validTo:
|
|
4929
|
+
J.responseDataCache.set(e, {
|
|
4930
|
+
validTo: dr(/* @__PURE__ */ new Date(), this.responseDataCacheTimeout),
|
|
4918
4931
|
val: s
|
|
4919
4932
|
});
|
|
4920
4933
|
}
|
|
@@ -4929,18 +4942,18 @@ const E = class E extends h {
|
|
|
4929
4942
|
*/
|
|
4930
4943
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
4931
4944
|
getTypedDataArrayRequester(e, s, i = !1, o = {}) {
|
|
4932
|
-
const c = s + (
|
|
4933
|
-
return
|
|
4934
|
-
const
|
|
4935
|
-
return i &&
|
|
4945
|
+
const c = s + (Pe(o) ? "" : ` >>> ${JSON.stringify(o)}`), u = i ? J.getCachedResponse(c) : void 0;
|
|
4946
|
+
return u ? Promise.resolve(u) : this.get(s, o).then((p) => {
|
|
4947
|
+
const f = p.map((m) => Ue.instanceInitializer(e, m));
|
|
4948
|
+
return i && f && this.cacheResponse(s, f), f;
|
|
4936
4949
|
});
|
|
4937
4950
|
}
|
|
4938
4951
|
};
|
|
4939
4952
|
/**
|
|
4940
4953
|
* Кэш результатов запросов.
|
|
4941
4954
|
*/
|
|
4942
|
-
t(
|
|
4943
|
-
let
|
|
4955
|
+
t(J, "responseDataCache", /* @__PURE__ */ new Map());
|
|
4956
|
+
let ue = J;
|
|
4944
4957
|
class Xt extends h {
|
|
4945
4958
|
/**
|
|
4946
4959
|
* Выполняет проверку занят ли указанный номер телефона.
|
|
@@ -4983,7 +4996,7 @@ class Zt extends h {
|
|
|
4983
4996
|
const i = this.get(
|
|
4984
4997
|
`internal/catalog/categories/${r.id}/configurators/${(o = r.properties) == null ? void 0 : o.configurator}/product`,
|
|
4985
4998
|
{ params: e },
|
|
4986
|
-
(c) => new
|
|
4999
|
+
(c) => new x(c.data)
|
|
4987
5000
|
);
|
|
4988
5001
|
return i.catch((c) => {
|
|
4989
5002
|
this.errorResponseHandler(c, s);
|
|
@@ -5031,13 +5044,13 @@ class es {
|
|
|
5031
5044
|
* Возвращает диапазон дат по умолчанию.
|
|
5032
5045
|
*/
|
|
5033
5046
|
static defaultDateRanges() {
|
|
5034
|
-
const r =
|
|
5047
|
+
const r = Ir(/* @__PURE__ */ new Date(), 1);
|
|
5035
5048
|
return {
|
|
5036
5049
|
// 'Следующий рабочий день' - это значение по-умолчанию
|
|
5037
5050
|
nextWorkingDay: { label: "Следующий рабочий день", from: Ur(r), to: qr(r) },
|
|
5038
|
-
today: { label: "Сегодня", from:
|
|
5051
|
+
today: { label: "Сегодня", from: rr(), to: Or() },
|
|
5039
5052
|
yesterday: { label: "Вчера", from: Nr(), to: xr() },
|
|
5040
|
-
tomorrow: { label: "Завтра", from:
|
|
5053
|
+
tomorrow: { label: "Завтра", from: Lr(), to: kr() }
|
|
5041
5054
|
};
|
|
5042
5055
|
}
|
|
5043
5056
|
}
|
|
@@ -5081,7 +5094,7 @@ const V = class V {
|
|
|
5081
5094
|
* Список единиц измерения линейной величины.
|
|
5082
5095
|
*/
|
|
5083
5096
|
t(V, "linearValues", ["пог.м.", "м.", "м2"]);
|
|
5084
|
-
let
|
|
5097
|
+
let Je = V;
|
|
5085
5098
|
class rs {
|
|
5086
5099
|
/**
|
|
5087
5100
|
* Генерирует и возвращает данные-заглушку неопределённого менеджера.
|
|
@@ -5098,26 +5111,26 @@ class rs {
|
|
|
5098
5111
|
return r.id === 0 && r.guid === "-undefined-";
|
|
5099
5112
|
}
|
|
5100
5113
|
}
|
|
5101
|
-
class ft extends
|
|
5114
|
+
class ft extends ue {
|
|
5102
5115
|
/**
|
|
5103
5116
|
* Возвращает {@link Promise} для получения справочника списка менеджеров.
|
|
5104
5117
|
*/
|
|
5105
5118
|
async getManagers() {
|
|
5106
|
-
const r = "/internal/managers", e =
|
|
5119
|
+
const r = "/internal/managers", e = ue.getCachedResponse(r);
|
|
5107
5120
|
if (e)
|
|
5108
5121
|
return e;
|
|
5109
5122
|
const i = (await this.get(r)).data.map((o) => Ue.instanceInitializer(Ae, o));
|
|
5110
5123
|
return this.cacheResponse(r, i), i;
|
|
5111
5124
|
}
|
|
5112
5125
|
}
|
|
5113
|
-
class
|
|
5126
|
+
class wr extends yr {
|
|
5114
5127
|
/**
|
|
5115
5128
|
* Инициализирует экземпляр класса {@link OrderInfo}.
|
|
5116
5129
|
*
|
|
5117
5130
|
* @param data Данные для первоначальной инициализации.
|
|
5118
5131
|
*/
|
|
5119
5132
|
constructor(e) {
|
|
5120
|
-
var s, i, o, c, p,
|
|
5133
|
+
var s, i, o, c, u, p, f, m;
|
|
5121
5134
|
super(e);
|
|
5122
5135
|
/**
|
|
5123
5136
|
* Краткие данные о клиенте.
|
|
@@ -5159,16 +5172,16 @@ class yr extends fr {
|
|
|
5159
5172
|
* Признак того, что заказ создан из товаров, которые имеют признак "Нет в наличии".
|
|
5160
5173
|
*/
|
|
5161
5174
|
t(this, "isNotInStock");
|
|
5162
|
-
this.client = new
|
|
5175
|
+
this.client = new he(e == null ? void 0 : e.client), this.payment = {
|
|
5163
5176
|
type: ((s = e == null ? void 0 : e.payment) == null ? void 0 : s.type) ?? -1,
|
|
5164
5177
|
status: ((i = e == null ? void 0 : e.payment) == null ? void 0 : i.status) ?? -1,
|
|
5165
5178
|
onlinePaymentLink: (o = e == null ? void 0 : e.payment) == null ? void 0 : o.onlinePaymentLink
|
|
5166
5179
|
}, this.delivery = {
|
|
5167
5180
|
type: ((c = e == null ? void 0 : e.delivery) == null ? void 0 : c.type) ?? -1,
|
|
5168
|
-
date:
|
|
5169
|
-
address: (
|
|
5170
|
-
warehouse: (
|
|
5171
|
-
}, this.attachedUser = new G(e == null ? void 0 : e.attachedUser), this.status = (e == null ? void 0 : e.status) ?? 0, this.salesDirection = new
|
|
5181
|
+
date: C((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? v(e.delivery.date) : ((p = e == null ? void 0 : e.delivery) == null ? void 0 : p.date) ?? /* @__PURE__ */ new Date(),
|
|
5182
|
+
address: (f = e == null ? void 0 : e.delivery) != null && f.address ? new Ce(e.delivery.address) : void 0,
|
|
5183
|
+
warehouse: (m = e == null ? void 0 : e.delivery) != null && m.warehouse ? new ae(e.delivery.warehouse) : void 0
|
|
5184
|
+
}, this.attachedUser = new G(e == null ? void 0 : e.attachedUser), this.status = (e == null ? void 0 : e.status) ?? 0, this.salesDirection = new N(e == null ? void 0 : e.salesDirection), this.pendingAt = C(e == null ? void 0 : e.pendingAt) ? v(e.pendingAt) : e == null ? void 0 : e.pendingAt, this.processedAt = C(e == null ? void 0 : e.processedAt) ? v(e.processedAt) : e == null ? void 0 : e.processedAt, this.isOnOrder = (e == null ? void 0 : e.isOnOrder) ?? !1, this.isNotInStock = (e == null ? void 0 : e.isNotInStock) ?? !1;
|
|
5172
5185
|
}
|
|
5173
5186
|
}
|
|
5174
5187
|
class yt extends M {
|
|
@@ -5251,10 +5264,10 @@ class yt extends M {
|
|
|
5251
5264
|
* который соответствует указанной ширине. Количество не ограничено.
|
|
5252
5265
|
*/
|
|
5253
5266
|
t(this, "sawing");
|
|
5254
|
-
this.product = new
|
|
5267
|
+
this.product = new X(e.product), this.quantity = e.quantity, this.currency = e.currency, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.cost = e.cost, this.costRub = e.costRub, this.marker = e.marker, this.height = e.height, this.length = e.length, this.width = e.width, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams, this.sawing = e.sawing;
|
|
5255
5268
|
}
|
|
5256
5269
|
}
|
|
5257
|
-
class wt extends
|
|
5270
|
+
class wt extends wr {
|
|
5258
5271
|
/**
|
|
5259
5272
|
* Инициализирует экземпляр класса {@link Order}.
|
|
5260
5273
|
*
|
|
@@ -5297,7 +5310,7 @@ class wt extends yr {
|
|
|
5297
5310
|
this.products = (e.products ?? []).map((s) => new yt(s)), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ? we.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new P(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment;
|
|
5298
5311
|
}
|
|
5299
5312
|
}
|
|
5300
|
-
class ts extends
|
|
5313
|
+
class ts extends De {
|
|
5301
5314
|
/**
|
|
5302
5315
|
* Возвращает данные о заказах, удовлетворяющих указанным параметрам поиска.
|
|
5303
5316
|
*
|
|
@@ -5310,7 +5323,7 @@ class ts extends ae {
|
|
|
5310
5323
|
getOrders(r, e, s) {
|
|
5311
5324
|
return this.getPaginated("/internal/orders", r, e ? [e] : void 0, s, {}, (i) => {
|
|
5312
5325
|
const o = { ...i.data };
|
|
5313
|
-
return o.data = o.data.map((c) => new
|
|
5326
|
+
return o.data = o.data.map((c) => new wr(c)), o;
|
|
5314
5327
|
});
|
|
5315
5328
|
}
|
|
5316
5329
|
/**
|
|
@@ -5331,7 +5344,7 @@ class ts extends ae {
|
|
|
5331
5344
|
return this.get(`/internal/orders/${r}`, {}, (e) => new wt(e.data));
|
|
5332
5345
|
}
|
|
5333
5346
|
}
|
|
5334
|
-
class
|
|
5347
|
+
class Se {
|
|
5335
5348
|
/**
|
|
5336
5349
|
* Инициализирует экземпляр класса {@link PriceAnalyze}.
|
|
5337
5350
|
*
|
|
@@ -5358,12 +5371,12 @@ class _e {
|
|
|
5358
5371
|
* Источник клиентской цены.
|
|
5359
5372
|
*/
|
|
5360
5373
|
t(this, "source");
|
|
5361
|
-
this.client = new
|
|
5374
|
+
this.client = new he(r == null ? void 0 : r.client), this.product = new x(r == null ? void 0 : r.product), this.cost = (r == null ? void 0 : r.cost) ?? 0, this.costCoefficient = (r == null ? void 0 : r.costCoefficient) ?? 0, this.source = (r == null ? void 0 : r.source) ?? Ge.Product;
|
|
5362
5375
|
}
|
|
5363
5376
|
}
|
|
5364
|
-
const
|
|
5377
|
+
const de = (n) => {
|
|
5365
5378
|
var r, e, s, i, o;
|
|
5366
|
-
return n ?
|
|
5379
|
+
return n ? Ze(
|
|
5367
5380
|
{
|
|
5368
5381
|
cities: (r = n.cities) == null ? void 0 : r.map((c) => c.id),
|
|
5369
5382
|
clients: (e = n.clients) == null ? void 0 : e.map((c) => c.id),
|
|
@@ -5372,9 +5385,9 @@ const Se = (n) => {
|
|
|
5372
5385
|
salesDirections: (o = n.salesDirections) == null ? void 0 : o.map((c) => c.id),
|
|
5373
5386
|
hideNotActive: n.hideNotActive
|
|
5374
5387
|
},
|
|
5375
|
-
(c) => $(c) || (
|
|
5388
|
+
(c) => $(c) || (K(c) || er(c)) && Pe(c)
|
|
5376
5389
|
) : {};
|
|
5377
|
-
},
|
|
5390
|
+
}, Ve = (n) => {
|
|
5378
5391
|
const r = {};
|
|
5379
5392
|
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;
|
|
5380
5393
|
};
|
|
@@ -5392,10 +5405,10 @@ class ss extends h {
|
|
|
5392
5405
|
return this.get(
|
|
5393
5406
|
`/internal/price/products/${r}/analyze`,
|
|
5394
5407
|
{
|
|
5395
|
-
...
|
|
5396
|
-
filters:
|
|
5408
|
+
...Ve(e),
|
|
5409
|
+
filters: de(s)
|
|
5397
5410
|
},
|
|
5398
|
-
(i) => i.data.map((o) => new
|
|
5411
|
+
(i) => i.data.map((o) => new Se(o))
|
|
5399
5412
|
);
|
|
5400
5413
|
}
|
|
5401
5414
|
/**
|
|
@@ -5411,10 +5424,10 @@ class ss extends h {
|
|
|
5411
5424
|
return this.get(
|
|
5412
5425
|
`/internal/price/categories/${r}/analyze`,
|
|
5413
5426
|
{
|
|
5414
|
-
...
|
|
5415
|
-
filters:
|
|
5427
|
+
...Ve(e),
|
|
5428
|
+
filters: de(s)
|
|
5416
5429
|
},
|
|
5417
|
-
(i) => i.data.map((o) => new
|
|
5430
|
+
(i) => i.data.map((o) => new Se(o))
|
|
5418
5431
|
);
|
|
5419
5432
|
}
|
|
5420
5433
|
/**
|
|
@@ -5433,9 +5446,9 @@ class ss extends h {
|
|
|
5433
5446
|
`/internal/price/categories/${r}/analyze/square`,
|
|
5434
5447
|
{
|
|
5435
5448
|
...e,
|
|
5436
|
-
filters:
|
|
5449
|
+
filters: de(s)
|
|
5437
5450
|
},
|
|
5438
|
-
(i) => i.data.map((o) => new
|
|
5451
|
+
(i) => i.data.map((o) => new Se(o))
|
|
5439
5452
|
);
|
|
5440
5453
|
}
|
|
5441
5454
|
}
|
|
@@ -5486,7 +5499,7 @@ class Ct {
|
|
|
5486
5499
|
* @inheritDoc
|
|
5487
5500
|
*/
|
|
5488
5501
|
t(this, "currency");
|
|
5489
|
-
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate =
|
|
5502
|
+
this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = C(r.costDate) ? v(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new ne(r.product) : void 0, this.client = r.client ? new G(r.client) : void 0, this.executor = r.executor ? new G(r.executor) : void 0, this.currency = r.currency ? new ye(r.currency) : void 0;
|
|
5490
5503
|
}
|
|
5491
5504
|
}
|
|
5492
5505
|
class vt extends ne {
|
|
@@ -5501,16 +5514,10 @@ class vt extends ne {
|
|
|
5501
5514
|
* @inheritDoc
|
|
5502
5515
|
*/
|
|
5503
5516
|
t(this, "history");
|
|
5504
|
-
this.history =
|
|
5517
|
+
this.history = ve(e.history, (s) => new Ct(s));
|
|
5505
5518
|
}
|
|
5506
5519
|
}
|
|
5507
5520
|
class is extends h {
|
|
5508
|
-
/**
|
|
5509
|
-
* Инициализирует экземпляр класса {@link UserAuthDataProvider}.
|
|
5510
|
-
*/
|
|
5511
|
-
constructor() {
|
|
5512
|
-
super(), this.baseUrl = `${a.getConfig().http.priceHistoryApiUrl ?? ""}/api`;
|
|
5513
|
-
}
|
|
5514
5521
|
/**
|
|
5515
5522
|
* Возвращает данные об истории изменения цен.
|
|
5516
5523
|
*
|
|
@@ -5519,17 +5526,19 @@ class is extends h {
|
|
|
5519
5526
|
* @see /docs/api#/operations/api_internal_price_history_get
|
|
5520
5527
|
*/
|
|
5521
5528
|
getProductPriceHistory(r) {
|
|
5522
|
-
var
|
|
5523
|
-
const e =
|
|
5524
|
-
|
|
5529
|
+
var o, c, u, p, f;
|
|
5530
|
+
const e = T.getConfig().dateFormats.api, s = Ze(
|
|
5531
|
+
me(r, {
|
|
5525
5532
|
costDate: {
|
|
5526
|
-
from: Ie((
|
|
5527
|
-
to: Ie((
|
|
5533
|
+
from: Ie((o = r.costDate) == null ? void 0 : o.from) ? q(r.costDate.from, e) : (c = r.costDate) == null ? void 0 : c.from,
|
|
5534
|
+
to: Ie((u = r.costDate) == null ? void 0 : u.to) ? q(r.costDate.to, e) : (p = r.costDate) == null ? void 0 : p.to
|
|
5528
5535
|
}
|
|
5529
5536
|
}),
|
|
5530
|
-
(
|
|
5531
|
-
);
|
|
5532
|
-
return this.get(
|
|
5537
|
+
(m) => $(m) || (K(m) || er(m)) && Pe(m)
|
|
5538
|
+
), i = ((f = r.product) == null ? void 0 : f[0]) ?? 0;
|
|
5539
|
+
return delete s.product, this.get(`/internal/price/products/${i}/history`, s).then((m) => [
|
|
5540
|
+
new vt(me(m[0], { history: m }))
|
|
5541
|
+
]);
|
|
5533
5542
|
}
|
|
5534
5543
|
}
|
|
5535
5544
|
class Ke {
|
|
@@ -5551,12 +5560,6 @@ class Ke {
|
|
|
5551
5560
|
}
|
|
5552
5561
|
}
|
|
5553
5562
|
class ns extends h {
|
|
5554
|
-
/**
|
|
5555
|
-
* Инициализирует экземпляр класса {@link UserAuthDataProvider}.
|
|
5556
|
-
*/
|
|
5557
|
-
constructor() {
|
|
5558
|
-
super(), this.baseUrl = `${a.getConfig().http.recommendationsApiUrl ?? ""}/api`;
|
|
5559
|
-
}
|
|
5560
5563
|
/**
|
|
5561
5564
|
* Возвращает данные о рекомендациях указанной категории продуктов.
|
|
5562
5565
|
*
|
|
@@ -5564,7 +5567,7 @@ class ns extends h {
|
|
|
5564
5567
|
* @see /docs/api#/operations/api_internal_recommendations_product_category_get
|
|
5565
5568
|
*/
|
|
5566
5569
|
getProductCategoryRecommendations(r) {
|
|
5567
|
-
return this.get(`/internal/recommendations/categories/${r.id}`, {}, (e) => new Ke(e.data));
|
|
5570
|
+
return this.get(`/internal/catalog/recommendations/categories/${r.id}`, {}, (e) => new Ke(e.data));
|
|
5568
5571
|
}
|
|
5569
5572
|
/**
|
|
5570
5573
|
* Возвращает данные о рекомендациях указанного продукта.
|
|
@@ -5573,7 +5576,7 @@ class ns extends h {
|
|
|
5573
5576
|
* @see /docs/api#/operations/api_internal_recommendations_product_get
|
|
5574
5577
|
*/
|
|
5575
5578
|
getProductRecommendations(r) {
|
|
5576
|
-
return this.get(`/internal/recommendations/products/${r.id}`, {}, (e) => new Ke(e.data));
|
|
5579
|
+
return this.get(`/internal/catalog/recommendations/products/${r.id}`, {}, (e) => new Ke(e.data));
|
|
5577
5580
|
}
|
|
5578
5581
|
/**
|
|
5579
5582
|
* Выполняет сохранение данных о рекомендуемых категориях продуктов.
|
|
@@ -5583,7 +5586,7 @@ class ns extends h {
|
|
|
5583
5586
|
* @see /docs/api#/operations/api_internal_recommendations_product_category_save
|
|
5584
5587
|
*/
|
|
5585
5588
|
saveProductCategoryRecommendations(r, e) {
|
|
5586
|
-
return this.post(`/internal/recommendations/categories/${r.id}`, {
|
|
5589
|
+
return this.post(`/internal/catalog/recommendations/categories/${r.id}`, {
|
|
5587
5590
|
product_categories: e.productCategories.map((s) => s.id),
|
|
5588
5591
|
products: e.products.map((s) => s.id)
|
|
5589
5592
|
});
|
|
@@ -5596,13 +5599,13 @@ class ns extends h {
|
|
|
5596
5599
|
* @see /docs/api#/operations/api_internal_recommendations_product_save
|
|
5597
5600
|
*/
|
|
5598
5601
|
saveProductRecommendations(r, e) {
|
|
5599
|
-
return this.post(`/internal/recommendations/products/${r.id}`, {
|
|
5602
|
+
return this.post(`/internal/catalog/recommendations/products/${r.id}`, {
|
|
5600
5603
|
product_categories: e.productCategories.map((s) => s.id),
|
|
5601
5604
|
products: e.products.map((s) => s.id)
|
|
5602
5605
|
});
|
|
5603
5606
|
}
|
|
5604
5607
|
}
|
|
5605
|
-
class D extends
|
|
5608
|
+
class D extends ue {
|
|
5606
5609
|
/**
|
|
5607
5610
|
* Возвращает {@link Promise} для получения данных указанного справочника.
|
|
5608
5611
|
*
|
|
@@ -5618,7 +5621,7 @@ class D extends pe {
|
|
|
5618
5621
|
* первичного интереса.
|
|
5619
5622
|
*/
|
|
5620
5623
|
getChannelPrimaryInterest() {
|
|
5621
|
-
return this.getTypedDataArrayRequester(
|
|
5624
|
+
return this.getTypedDataArrayRequester(ur, "/internal/references/channel-primary-interest", !0);
|
|
5622
5625
|
}
|
|
5623
5626
|
/**
|
|
5624
5627
|
* Возвращает {@link Promise} для получения справочника должностей контактных лиц.
|
|
@@ -5637,13 +5640,13 @@ class D extends pe {
|
|
|
5637
5640
|
* групп партнеров (направлений деятельности).
|
|
5638
5641
|
*/
|
|
5639
5642
|
getPartnerGroup() {
|
|
5640
|
-
return this.getTypedDataArrayRequester(
|
|
5643
|
+
return this.getTypedDataArrayRequester(ee, "/internal/references/partner-group", !0);
|
|
5641
5644
|
}
|
|
5642
5645
|
/**
|
|
5643
5646
|
* Возвращает {@link Promise} для получения справочника данных организационно-правовых форм.
|
|
5644
5647
|
*/
|
|
5645
5648
|
getOpf() {
|
|
5646
|
-
return this.getTypedDataArrayRequester(
|
|
5649
|
+
return this.getTypedDataArrayRequester(j, "/public/references/opf", !0);
|
|
5647
5650
|
}
|
|
5648
5651
|
/**
|
|
5649
5652
|
* Возвращает {@link Promise} для получения справочника данных статусов оплаты заказов.
|
|
@@ -5673,13 +5676,13 @@ class D extends pe {
|
|
|
5673
5676
|
* Возвращает {@link Promise} для получения справочника данных направлений продаж.
|
|
5674
5677
|
*/
|
|
5675
5678
|
getSalesDirections() {
|
|
5676
|
-
return this.getTypedDataArrayRequester(
|
|
5679
|
+
return this.getTypedDataArrayRequester(N, "/public/references/sales-direction", !0);
|
|
5677
5680
|
}
|
|
5678
5681
|
/**
|
|
5679
5682
|
* Возвращает {@link Promise} для получения справочника данных об источнике первичного интереса.
|
|
5680
5683
|
*/
|
|
5681
5684
|
getSourcePrimaryInterest() {
|
|
5682
|
-
return this.getTypedDataArrayRequester(
|
|
5685
|
+
return this.getTypedDataArrayRequester(hr, "/internal/references/source-primary-interest", !0);
|
|
5683
5686
|
}
|
|
5684
5687
|
/**
|
|
5685
5688
|
* Выполняет поиск данных о городах по терму в названии.
|
|
@@ -5687,7 +5690,7 @@ class D extends pe {
|
|
|
5687
5690
|
* @param term Терм поиска.
|
|
5688
5691
|
*/
|
|
5689
5692
|
searchCity(r) {
|
|
5690
|
-
return this.getTypedDataArrayRequester(
|
|
5693
|
+
return this.getTypedDataArrayRequester(je, `/internal/references/city-with-region-and-country/search?term=${r}`);
|
|
5691
5694
|
}
|
|
5692
5695
|
/**
|
|
5693
5696
|
* Выполняет поиск данных о регионах по терму в названии.
|
|
@@ -5703,31 +5706,31 @@ class D extends pe {
|
|
|
5703
5706
|
* @param term Терм поиска.
|
|
5704
5707
|
*/
|
|
5705
5708
|
searchCountry(r) {
|
|
5706
|
-
return this.getTypedDataArrayRequester(
|
|
5709
|
+
return this.getTypedDataArrayRequester(Z, `/internal/references/country/search?term=${r}`);
|
|
5707
5710
|
}
|
|
5708
5711
|
/**
|
|
5709
5712
|
* Возвращает {@link Promise} для получения справочника типов доставки.
|
|
5710
5713
|
*/
|
|
5711
5714
|
getDeliveryTypes() {
|
|
5712
|
-
return this.getTypedDataArrayRequester(
|
|
5715
|
+
return this.getTypedDataArrayRequester(Y, "/internal/references/delivery-type", !0);
|
|
5713
5716
|
}
|
|
5714
5717
|
/**
|
|
5715
5718
|
* Возвращает {@link Promise} для получения справочника складов.
|
|
5716
5719
|
*/
|
|
5717
5720
|
getWarehouses() {
|
|
5718
|
-
return this.getTypedDataArrayRequester(
|
|
5721
|
+
return this.getTypedDataArrayRequester(ae, "/public/references/warehouse", !0);
|
|
5719
5722
|
}
|
|
5720
5723
|
/**
|
|
5721
5724
|
* Возвращает {@link Promise} для получения справочника типов свойств.
|
|
5722
5725
|
*/
|
|
5723
5726
|
getPropertyTypes() {
|
|
5724
|
-
return this.getTypedDataArrayRequester(
|
|
5727
|
+
return this.getTypedDataArrayRequester(lr, "/internal/references/property-type", !0);
|
|
5725
5728
|
}
|
|
5726
5729
|
/**
|
|
5727
5730
|
* Возвращает {@link Promise} для получения справочника коэффициентов цен.
|
|
5728
5731
|
*/
|
|
5729
5732
|
getPriceCoefficients() {
|
|
5730
|
-
return this.getTypedDataArrayRequester(
|
|
5733
|
+
return this.getTypedDataArrayRequester(Re, "/internal/references/price-coefficient", !0);
|
|
5731
5734
|
}
|
|
5732
5735
|
/**
|
|
5733
5736
|
* Возвращает {@link Promise} для получения справочника типов файлов продуктов/категорий.
|
|
@@ -5736,8 +5739,8 @@ class D extends pe {
|
|
|
5736
5739
|
return this.getTypedDataArrayRequester(lt, "/public/references/product-file-type", !0);
|
|
5737
5740
|
}
|
|
5738
5741
|
}
|
|
5739
|
-
const
|
|
5740
|
-
const n =
|
|
5742
|
+
const a = re("__references_private", () => {
|
|
5743
|
+
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), d = y(void 0), I = y(void 0), _ = y(void 0), S = y(void 0), U = y(void 0), l = y(void 0);
|
|
5741
5744
|
return {
|
|
5742
5745
|
/**
|
|
5743
5746
|
* Список загружаемых/загруженных на данный момент значений.
|
|
@@ -5770,31 +5773,31 @@ const A = Z("__references_private", () => {
|
|
|
5770
5773
|
/**
|
|
5771
5774
|
* Справочник статусов оплаты заказа.
|
|
5772
5775
|
*/
|
|
5773
|
-
orderPaymentStatusReference:
|
|
5776
|
+
orderPaymentStatusReference: u,
|
|
5774
5777
|
/**
|
|
5775
5778
|
* Справочник статусов заказов.
|
|
5776
5779
|
*/
|
|
5777
|
-
orderStatusReference:
|
|
5780
|
+
orderStatusReference: p,
|
|
5778
5781
|
/**
|
|
5779
5782
|
* Справочник типов оплаты заказов.
|
|
5780
5783
|
*/
|
|
5781
|
-
paymentTypeReference:
|
|
5784
|
+
paymentTypeReference: f,
|
|
5782
5785
|
/**
|
|
5783
5786
|
* Справочник групп партнеров.
|
|
5784
5787
|
*/
|
|
5785
|
-
partnerGroupReference:
|
|
5788
|
+
partnerGroupReference: m,
|
|
5786
5789
|
/**
|
|
5787
5790
|
* Справочник типов файлов продукктов/категорий.
|
|
5788
5791
|
*/
|
|
5789
|
-
productFileTypeReference:
|
|
5792
|
+
productFileTypeReference: A,
|
|
5790
5793
|
/**
|
|
5791
5794
|
* Справочник типов ресурсов.
|
|
5792
5795
|
*/
|
|
5793
|
-
resourceTypesReference:
|
|
5796
|
+
resourceTypesReference: d,
|
|
5794
5797
|
/**
|
|
5795
5798
|
* Справочник направлений продаж.
|
|
5796
5799
|
*/
|
|
5797
|
-
salesDirectionsReference:
|
|
5800
|
+
salesDirectionsReference: I,
|
|
5798
5801
|
/**
|
|
5799
5802
|
* Справочник источников первичного интереса.
|
|
5800
5803
|
*/
|
|
@@ -5802,7 +5805,7 @@ const A = Z("__references_private", () => {
|
|
|
5802
5805
|
/**
|
|
5803
5806
|
* Справочник складов.
|
|
5804
5807
|
*/
|
|
5805
|
-
warehousesReference:
|
|
5808
|
+
warehousesReference: S,
|
|
5806
5809
|
/**
|
|
5807
5810
|
* Справочник типов свойств.
|
|
5808
5811
|
*/
|
|
@@ -5812,89 +5815,89 @@ const A = Z("__references_private", () => {
|
|
|
5812
5815
|
*/
|
|
5813
5816
|
priceCoefficientsReference: l
|
|
5814
5817
|
};
|
|
5815
|
-
}), os =
|
|
5818
|
+
}), os = re("references", () => {
|
|
5816
5819
|
const n = R(() => {
|
|
5817
|
-
const l =
|
|
5820
|
+
const l = a();
|
|
5818
5821
|
return !l.channelPrimaryInterestReference && !l.dataLoaderList.channelPrimaryInterestReference && (l.dataLoaderList.channelPrimaryInterestReference = !0, h.getInstance(D).getChannelPrimaryInterest().then((g) => {
|
|
5819
5822
|
l.channelPrimaryInterestReference = g;
|
|
5820
5823
|
}).catch(w)), l.channelPrimaryInterestReference;
|
|
5821
5824
|
}), r = R(() => {
|
|
5822
|
-
const l =
|
|
5825
|
+
const l = a();
|
|
5823
5826
|
return !l.contactPositionsReference && !l.dataLoaderList.contactPositionsReference && (l.dataLoaderList.contactPositionsReference = !0, h.getInstance(D).getContactPositions().then((g) => {
|
|
5824
5827
|
l.contactPositionsReference = g;
|
|
5825
5828
|
}).catch(w)), l.contactPositionsReference;
|
|
5826
5829
|
}), e = R(() => {
|
|
5827
|
-
const l =
|
|
5830
|
+
const l = a();
|
|
5828
5831
|
return !l.currencyReference && !l.dataLoaderList.currencyReference && (l.dataLoaderList.currencyReference = !0, h.getInstance(D).getCurrency().then((g) => {
|
|
5829
5832
|
l.currencyReference = g;
|
|
5830
5833
|
}).catch(w)), l.currencyReference;
|
|
5831
5834
|
}), s = R(() => {
|
|
5832
|
-
const l =
|
|
5835
|
+
const l = a();
|
|
5833
5836
|
return !l.opfReference && !l.dataLoaderList.opfReference && (l.dataLoaderList.opfReference = !0, h.getInstance(D).getOpf().then((g) => {
|
|
5834
5837
|
l.opfReference = g;
|
|
5835
5838
|
}).catch(w)), l.opfReference;
|
|
5836
5839
|
}), i = R(() => {
|
|
5837
|
-
const l =
|
|
5840
|
+
const l = a();
|
|
5838
5841
|
return !l.orderPaymentStatusReference && !l.dataLoaderList.orderPaymentStatusReference && (l.dataLoaderList.orderPaymentStatusReference = !0, h.getInstance(D).getOrderPaymentStatuses().then((g) => {
|
|
5839
5842
|
l.orderPaymentStatusReference = g;
|
|
5840
5843
|
}).catch(w)), l.orderPaymentStatusReference;
|
|
5841
5844
|
}), o = R(() => {
|
|
5842
|
-
const l =
|
|
5845
|
+
const l = a();
|
|
5843
5846
|
return !l.orderStatusReference && !l.dataLoaderList.orderStatusReference && (l.dataLoaderList.orderStatusReference = !0, h.getInstance(D).getOrderStatuses().then((g) => {
|
|
5844
5847
|
l.orderStatusReference = g;
|
|
5845
5848
|
}).catch(w)), l.orderStatusReference;
|
|
5846
5849
|
}), c = R(() => {
|
|
5847
|
-
const l =
|
|
5850
|
+
const l = a();
|
|
5848
5851
|
return !l.paymentTypeReference && !l.dataLoaderList.paymentTypeReference && (l.dataLoaderList.paymentTypeReference = !0, h.getInstance(D).getPaymentTypes().then((g) => {
|
|
5849
5852
|
l.paymentTypeReference = g;
|
|
5850
5853
|
}).catch(w)), l.paymentTypeReference;
|
|
5851
|
-
}),
|
|
5852
|
-
const l =
|
|
5854
|
+
}), u = R(() => {
|
|
5855
|
+
const l = a();
|
|
5853
5856
|
return !l.partnerGroupReference && !l.dataLoaderList.partnerGroupReference && (l.dataLoaderList.partnerGroupReference = !0, h.getInstance(D).getPartnerGroup().then((g) => {
|
|
5854
5857
|
l.partnerGroupReference = g;
|
|
5855
5858
|
}).catch(w)), l.partnerGroupReference;
|
|
5856
|
-
}),
|
|
5857
|
-
const l =
|
|
5859
|
+
}), p = R(() => {
|
|
5860
|
+
const l = a();
|
|
5858
5861
|
return !l.productFileTypeReference && !l.dataLoaderList.productFileTypeReference && (l.dataLoaderList.productFileTypeReference = !0, h.getInstance(D).getProductFileType().then((g) => {
|
|
5859
5862
|
l.productFileTypeReference = g;
|
|
5860
5863
|
}).catch(w)), l.productFileTypeReference;
|
|
5861
|
-
}),
|
|
5862
|
-
const l =
|
|
5864
|
+
}), f = R(() => {
|
|
5865
|
+
const l = a();
|
|
5863
5866
|
return !l.resourceTypesReference && !l.dataLoaderList.resourceTypesReference && (l.dataLoaderList.resourceTypesReference = !0, h.getInstance(D).getResourceTypes().then((g) => {
|
|
5864
5867
|
l.resourceTypesReference = g;
|
|
5865
5868
|
}).catch(w)), l.resourceTypesReference;
|
|
5866
|
-
}),
|
|
5867
|
-
const l =
|
|
5869
|
+
}), m = R(() => {
|
|
5870
|
+
const l = a();
|
|
5868
5871
|
return !l.salesDirectionsReference && !l.dataLoaderList.salesDirectionsReference && (l.dataLoaderList.salesDirectionsReference = !0, h.getInstance(D).getSalesDirections().then((g) => {
|
|
5869
5872
|
l.salesDirectionsReference = g;
|
|
5870
5873
|
}).catch(w)), l.salesDirectionsReference;
|
|
5871
|
-
}),
|
|
5872
|
-
const l =
|
|
5874
|
+
}), A = R(() => {
|
|
5875
|
+
const l = a();
|
|
5873
5876
|
return !l.sourcePrimaryInterestReference && !l.dataLoaderList.sourcePrimaryInterestReference && (l.dataLoaderList.sourcePrimaryInterestReference = !0, h.getInstance(D).getSourcePrimaryInterest().then((g) => {
|
|
5874
5877
|
l.sourcePrimaryInterestReference = g;
|
|
5875
5878
|
}).catch(w)), l.sourcePrimaryInterestReference;
|
|
5876
|
-
}),
|
|
5877
|
-
const l =
|
|
5879
|
+
}), d = R(() => {
|
|
5880
|
+
const l = a();
|
|
5878
5881
|
return !l.deliveryTypeReference && !l.dataLoaderList.deliveryTypeReference && (l.dataLoaderList.deliveryTypeReference = !0, h.getInstance(D).getDeliveryTypes().then((g) => {
|
|
5879
5882
|
l.deliveryTypeReference = g;
|
|
5880
5883
|
}).catch(w)), l.deliveryTypeReference;
|
|
5881
|
-
}),
|
|
5882
|
-
const l =
|
|
5884
|
+
}), I = R(() => {
|
|
5885
|
+
const l = a();
|
|
5883
5886
|
return !l.managersList && !l.dataLoaderList.managersList && (l.dataLoaderList.managersList = !0, h.getInstance(ft).getManagers().then((g) => {
|
|
5884
5887
|
l.managersList = g;
|
|
5885
5888
|
}).catch(w)), l.managersList;
|
|
5886
5889
|
}), _ = R(() => {
|
|
5887
|
-
const l =
|
|
5890
|
+
const l = a();
|
|
5888
5891
|
return !l.warehousesReference && !l.dataLoaderList.warehousesReference && (l.dataLoaderList.warehousesReference = !0, h.getInstance(D).getWarehouses().then((g) => {
|
|
5889
5892
|
l.warehousesReference = g;
|
|
5890
5893
|
}).catch(w)), l.warehousesReference;
|
|
5891
|
-
}),
|
|
5892
|
-
const l =
|
|
5894
|
+
}), S = R(() => {
|
|
5895
|
+
const l = a();
|
|
5893
5896
|
return !l.propertyTypesReference && !l.dataLoaderList.propertyTypesReference && (l.dataLoaderList.propertyTypesReference = !0, h.getInstance(D).getPropertyTypes().then((g) => {
|
|
5894
5897
|
l.propertyTypesReference = g;
|
|
5895
5898
|
}).catch(w)), l.propertyTypesReference;
|
|
5896
5899
|
}), U = R(() => {
|
|
5897
|
-
const l =
|
|
5900
|
+
const l = a();
|
|
5898
5901
|
return !l.priceCoefficientsReference && !l.dataLoaderList.priceCoefficientsReference && (l.dataLoaderList.priceCoefficientsReference = !0, h.getInstance(D).getPriceCoefficients().then((g) => {
|
|
5899
5902
|
l.priceCoefficientsReference = g;
|
|
5900
5903
|
}).catch(w)), l.priceCoefficientsReference;
|
|
@@ -5931,31 +5934,31 @@ const A = Z("__references_private", () => {
|
|
|
5931
5934
|
/**
|
|
5932
5935
|
* Справочник групп партнеров.
|
|
5933
5936
|
*/
|
|
5934
|
-
partnerGroupsReference:
|
|
5937
|
+
partnerGroupsReference: u,
|
|
5935
5938
|
/**
|
|
5936
5939
|
* Справочник типов файлов продуктов/категорий.
|
|
5937
5940
|
*/
|
|
5938
|
-
productFilesTypesReference:
|
|
5941
|
+
productFilesTypesReference: p,
|
|
5939
5942
|
/**
|
|
5940
5943
|
* Справочник типов ресурсов.
|
|
5941
5944
|
*/
|
|
5942
|
-
resourceTypesReference:
|
|
5945
|
+
resourceTypesReference: f,
|
|
5943
5946
|
/**
|
|
5944
5947
|
* Справочник направлений продаж.
|
|
5945
5948
|
*/
|
|
5946
|
-
salesDirectionsReference:
|
|
5949
|
+
salesDirectionsReference: m,
|
|
5947
5950
|
/**
|
|
5948
5951
|
* Справочник каналов первичного интереса.
|
|
5949
5952
|
*/
|
|
5950
|
-
sourcePrimaryInterestsReference:
|
|
5953
|
+
sourcePrimaryInterestsReference: A,
|
|
5951
5954
|
/**
|
|
5952
5955
|
* Справочник типов доставки.
|
|
5953
5956
|
*/
|
|
5954
|
-
deliveryTypeReference:
|
|
5957
|
+
deliveryTypeReference: d,
|
|
5955
5958
|
/**
|
|
5956
5959
|
* Список менеджеров.
|
|
5957
5960
|
*/
|
|
5958
|
-
managersList:
|
|
5961
|
+
managersList: I,
|
|
5959
5962
|
/**
|
|
5960
5963
|
* Справочник складов.
|
|
5961
5964
|
*/
|
|
@@ -5963,7 +5966,7 @@ const A = Z("__references_private", () => {
|
|
|
5963
5966
|
/**
|
|
5964
5967
|
* Справочник типов свойств.
|
|
5965
5968
|
*/
|
|
5966
|
-
propertyTypesReference:
|
|
5969
|
+
propertyTypesReference: S,
|
|
5967
5970
|
/**
|
|
5968
5971
|
* Справочник коэффициентов цен.
|
|
5969
5972
|
*/
|
|
@@ -6106,7 +6109,7 @@ class ls extends h {
|
|
|
6106
6109
|
}
|
|
6107
6110
|
}
|
|
6108
6111
|
var Rt = /* @__PURE__ */ ((n) => (n.Admin = "admin", n.Manager = "manager", n.Operator = "operator", n.Client = "client", n.Guest = "guest", n))(Rt || {});
|
|
6109
|
-
class
|
|
6112
|
+
class at extends cr {
|
|
6110
6113
|
/**
|
|
6111
6114
|
* Инициализирует экземпляр класса {@link User}.
|
|
6112
6115
|
*
|
|
@@ -6129,12 +6132,12 @@ class At extends or {
|
|
|
6129
6132
|
this.type = e == null ? void 0 : e.type, this.canDoReclamations = (e == null ? void 0 : e.canDoReclamations) ?? !1, this.photo = e == null ? void 0 : e.photo;
|
|
6130
6133
|
}
|
|
6131
6134
|
}
|
|
6132
|
-
class
|
|
6135
|
+
class us extends h {
|
|
6133
6136
|
/**
|
|
6134
6137
|
* Инициализирует экземпляр класса {@link UserAuthDataProvider}.
|
|
6135
6138
|
*/
|
|
6136
6139
|
constructor() {
|
|
6137
|
-
super(), this.baseUrl = `${
|
|
6140
|
+
super(), this.baseUrl = `${T.getConfig().http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
|
|
6138
6141
|
}
|
|
6139
6142
|
/**
|
|
6140
6143
|
* Функция для получения обновленных токенов доступа.
|
|
@@ -6145,17 +6148,17 @@ class ps extends h {
|
|
|
6145
6148
|
return this.get("internal/users/current-tokens").then((r) => r.accessToken);
|
|
6146
6149
|
}
|
|
6147
6150
|
}
|
|
6148
|
-
class
|
|
6151
|
+
class At extends h {
|
|
6149
6152
|
/**
|
|
6150
6153
|
* Возвращает данные о текущем пользователе.
|
|
6151
6154
|
*/
|
|
6152
6155
|
// eslint-disable-next-line class-methods-use-this
|
|
6153
6156
|
getCurrentUser() {
|
|
6154
|
-
return this.get("/internal/users/info", {}, (r) => new
|
|
6157
|
+
return this.get("/internal/users/info", {}, (r) => new at(r.data));
|
|
6155
6158
|
}
|
|
6156
6159
|
}
|
|
6157
|
-
const Dt =
|
|
6158
|
-
const n =
|
|
6160
|
+
const Dt = re("__user_state_private", () => {
|
|
6161
|
+
const n = y({}), r = y(void 0);
|
|
6159
6162
|
return {
|
|
6160
6163
|
/**
|
|
6161
6164
|
* Список загружаемых/загруженных на данный момент значений.
|
|
@@ -6166,13 +6169,13 @@ const Dt = Z("__user_state_private", () => {
|
|
|
6166
6169
|
*/
|
|
6167
6170
|
currentUser: r
|
|
6168
6171
|
};
|
|
6169
|
-
}),
|
|
6172
|
+
}), ps = re("user_state", () => ({
|
|
6170
6173
|
/**
|
|
6171
6174
|
* Данные о текущем пользователе.
|
|
6172
6175
|
*/
|
|
6173
6176
|
currentUser: R(() => {
|
|
6174
6177
|
const r = Dt();
|
|
6175
|
-
return !r.currentUser && !r.dataLoaderList.currentUser && (r.dataLoaderList.currentUser = !0, h.getInstance(
|
|
6178
|
+
return !r.currentUser && !r.dataLoaderList.currentUser && (r.dataLoaderList.currentUser = !0, h.getInstance(At).getCurrentUser().then((e) => {
|
|
6176
6179
|
r.currentUser = e;
|
|
6177
6180
|
}).catch(w).finally(() => {
|
|
6178
6181
|
r.dataLoaderList.currentUser = !1;
|
|
@@ -6205,49 +6208,49 @@ class hs {
|
|
|
6205
6208
|
export {
|
|
6206
6209
|
st as AnyReference,
|
|
6207
6210
|
qt as AppBaseConfig,
|
|
6208
|
-
|
|
6211
|
+
T as AppConfigProvider,
|
|
6209
6212
|
Le as BankAccount,
|
|
6210
|
-
|
|
6213
|
+
De as BasePaginationProvider,
|
|
6211
6214
|
zr as CalculationTypeEnum,
|
|
6212
|
-
|
|
6215
|
+
ge as Cart,
|
|
6213
6216
|
Br as CartItem,
|
|
6214
6217
|
Hr as CartItemBase,
|
|
6215
6218
|
xt as CartProvider,
|
|
6216
6219
|
Ut as CatalogProvider,
|
|
6217
|
-
|
|
6218
|
-
|
|
6220
|
+
tr as CatalogableItem,
|
|
6221
|
+
z as Category,
|
|
6219
6222
|
He as CategoryPricingRule,
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
+
ur as ChannelPrimaryInterest,
|
|
6224
|
+
Jt as City,
|
|
6225
|
+
je as CityWithRegionAndCountry,
|
|
6223
6226
|
Ee as Client,
|
|
6224
6227
|
gt as ClientAdditionalData,
|
|
6225
6228
|
fe as ClientCategory,
|
|
6226
6229
|
Yt as ClientDataProvider,
|
|
6227
6230
|
Gt as ClientPriceProvider,
|
|
6228
|
-
|
|
6229
|
-
|
|
6231
|
+
jt as ClientPriceTemplateProvider,
|
|
6232
|
+
X as ClientProduct,
|
|
6230
6233
|
Ht as ClientProductCategoryDataProvider,
|
|
6231
6234
|
Bt as ClientProductDataProvider,
|
|
6232
|
-
|
|
6235
|
+
he as ClientShortInfo,
|
|
6233
6236
|
tt as ClientsAdditionalDataRequestTypeEnum,
|
|
6234
|
-
|
|
6237
|
+
Vt as ClientsListFilters,
|
|
6235
6238
|
ne as CodedIdentity,
|
|
6236
6239
|
Zt as ConfiguratorProvider,
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
+
xe as Contact,
|
|
6241
|
+
Vr as ContactLinks,
|
|
6242
|
+
F as ContactPerson,
|
|
6240
6243
|
ht as ContactPersonRelated,
|
|
6241
6244
|
it as ContactPosition,
|
|
6242
|
-
|
|
6243
|
-
|
|
6245
|
+
_e as ContactRelation,
|
|
6246
|
+
gr as ContragentBase,
|
|
6244
6247
|
we as ContragentFactory,
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6248
|
+
mr as ContragentIc,
|
|
6249
|
+
ut as ContragentPerson,
|
|
6250
|
+
pt as ContragentUlNr,
|
|
6251
|
+
fr as ContragentUlR,
|
|
6249
6252
|
Ge as CostSourceEnum,
|
|
6250
|
-
|
|
6253
|
+
Z as Country,
|
|
6251
6254
|
ye as Currency,
|
|
6252
6255
|
ls as DataSuggestionProvider,
|
|
6253
6256
|
Kt as DataTablePagination,
|
|
@@ -6256,97 +6259,97 @@ export {
|
|
|
6256
6259
|
es as DateTimeProvider,
|
|
6257
6260
|
Er as DeletableNamedIdentity,
|
|
6258
6261
|
Ce as DeliveryAddress,
|
|
6259
|
-
|
|
6260
|
-
|
|
6262
|
+
Y as DeliveryType,
|
|
6263
|
+
Lt as DetailedJwtPayload,
|
|
6261
6264
|
Yr as DeviceTypeResolutionConfig,
|
|
6262
|
-
|
|
6265
|
+
Jr as DiscountShortInfo,
|
|
6263
6266
|
hs as FieldValidationResultData,
|
|
6264
6267
|
le as FilterGroup,
|
|
6265
6268
|
Be as FilterItem,
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6269
|
+
Fe as FilterOpEnum,
|
|
6270
|
+
ir as GeoCoordinates,
|
|
6271
|
+
Fr as HiddenCatalogableItem,
|
|
6272
|
+
ue as HttpCachedRequester,
|
|
6270
6273
|
Xr as HttpParamsConfig,
|
|
6271
6274
|
h as HttpRequester,
|
|
6272
6275
|
M as Identity,
|
|
6273
6276
|
Mr as Image,
|
|
6274
|
-
|
|
6277
|
+
Q as JwtPayload,
|
|
6275
6278
|
Ae as Manager,
|
|
6276
6279
|
oe as ManagerCommon,
|
|
6277
6280
|
rs as ManagerDataFactory,
|
|
6278
6281
|
ft as ManagerDataProvider,
|
|
6279
6282
|
Pt as MetaTagItem,
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
+
b as NamedIdentity,
|
|
6284
|
+
j as Opf,
|
|
6285
|
+
k as OpfEnum,
|
|
6283
6286
|
wt as Order,
|
|
6284
|
-
|
|
6287
|
+
wr as OrderInfo,
|
|
6285
6288
|
nt as OrderPaymentStatus,
|
|
6286
6289
|
yt as OrderProduct,
|
|
6287
|
-
|
|
6290
|
+
yr as OrderShortInfo,
|
|
6288
6291
|
ot as OrderStatus,
|
|
6289
6292
|
ts as OrdersDataProvider,
|
|
6290
|
-
|
|
6293
|
+
ee as PartnerGroup,
|
|
6291
6294
|
ct as PaymentType,
|
|
6292
6295
|
Nt as PreferencesStorageProvider,
|
|
6293
|
-
|
|
6296
|
+
Se as PriceAnalyze,
|
|
6294
6297
|
ss as PriceAnalyzeProvider,
|
|
6295
|
-
|
|
6296
|
-
|
|
6298
|
+
Re as PriceCoefficient,
|
|
6299
|
+
sr as PriceCoefficientEnum,
|
|
6297
6300
|
is as PriceHistoryDataProvider,
|
|
6298
6301
|
Ct as PriceHistoryItem,
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6302
|
+
W as PriceTemplate,
|
|
6303
|
+
Te as PriceTemplateCategory,
|
|
6304
|
+
te as PriceTemplateClient,
|
|
6305
|
+
or as PriceTemplateICatalogableItem,
|
|
6306
|
+
be as PriceTemplateProduct,
|
|
6304
6307
|
zt as PriceTemplateProvider,
|
|
6305
|
-
|
|
6308
|
+
ie as PricingRole,
|
|
6306
6309
|
Wt as PricingRoleProvider,
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
+
ke as PrimaryCatalogableItem,
|
|
6311
|
+
x as Product,
|
|
6312
|
+
Ft as ProductCategoryDataProvider,
|
|
6310
6313
|
Mt as ProductDataProvider,
|
|
6311
6314
|
lt as ProductFileType,
|
|
6312
6315
|
qe as ProductPriceCoefficient,
|
|
6313
6316
|
vt as ProductPriceHistory,
|
|
6314
6317
|
Et as PropertiesProvider,
|
|
6315
|
-
|
|
6316
|
-
|
|
6318
|
+
se as Property,
|
|
6319
|
+
lr as PropertyType,
|
|
6317
6320
|
Wr as PropertyTypeEnum,
|
|
6318
|
-
|
|
6321
|
+
B as PropertyValue,
|
|
6319
6322
|
ns as RecommendationsDataProvider,
|
|
6320
6323
|
Ke as RecommendationsList,
|
|
6321
6324
|
P as Reference,
|
|
6322
6325
|
D as ReferenceDataProvider,
|
|
6323
6326
|
ce as Region,
|
|
6324
6327
|
pr as ResourceType,
|
|
6325
|
-
|
|
6328
|
+
N as SalesDirection,
|
|
6326
6329
|
Zr as SentryConfig,
|
|
6327
6330
|
Qe as Seo,
|
|
6328
6331
|
cs as SeoDataProvider,
|
|
6329
|
-
|
|
6330
|
-
|
|
6332
|
+
hr as SourcePrimaryInterest,
|
|
6333
|
+
jr as StockCount,
|
|
6331
6334
|
Ot as TemplatesListFilters,
|
|
6332
6335
|
Ue as TypedInstanceFactory,
|
|
6333
|
-
|
|
6336
|
+
Je as UnitsHelper,
|
|
6334
6337
|
Xt as UnknownClientDataProvider,
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6338
|
+
nr as UpdatableNamedIdentity,
|
|
6339
|
+
at as User,
|
|
6340
|
+
us as UserAuthDataProvider,
|
|
6341
|
+
cr as UserCommonInfo,
|
|
6342
|
+
At as UserDataProvider,
|
|
6340
6343
|
Kr as UserPricingRole,
|
|
6341
6344
|
G as UserShortInfo,
|
|
6342
6345
|
Rt as UserTypeEnum,
|
|
6343
6346
|
et as VersionConfig,
|
|
6344
|
-
|
|
6347
|
+
ae as Warehouse,
|
|
6345
6348
|
rt as WebSocketConfig,
|
|
6346
6349
|
ze as findCatalogItemByIdRecursive,
|
|
6347
6350
|
We as flattenCatalogItems,
|
|
6348
|
-
|
|
6351
|
+
$e as useAuthStateStore,
|
|
6349
6352
|
os as useReferencesStore,
|
|
6350
|
-
|
|
6353
|
+
ps as useUserStateStore
|
|
6351
6354
|
};
|
|
6352
6355
|
//# sourceMappingURL=sc-common-lib.js.map
|