@snabcentr/client-core 3.5.2 → 3.5.6
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/catalog/services/sc-catalog-filter.service.d.ts +9 -1
- package/common/enums/index.d.ts +1 -0
- package/common/enums/request-state-status-enum.d.ts +17 -0
- package/common/index.d.ts +1 -0
- package/common/interfaces/index.d.ts +1 -0
- package/common/interfaces/sc-i-request-state.d.ts +35 -0
- package/esm2022/catalog/services/sc-catalog-filter.service.mjs +27 -9
- package/esm2022/common/enums/index.mjs +2 -0
- package/esm2022/common/enums/request-state-status-enum.mjs +19 -0
- package/esm2022/common/index.mjs +2 -1
- package/esm2022/common/interfaces/index.mjs +2 -1
- package/esm2022/common/interfaces/sc-i-request-state.mjs +26 -0
- package/esm2022/guards/sc-auth-as-client.guard.mjs +4 -4
- package/esm2022/helpers/sc-units-helper.mjs +17 -36
- package/fesm2022/snabcentr-client-core.mjs +196 -152
- package/fesm2022/snabcentr-client-core.mjs.map +1 -1
- package/helpers/sc-units-helper.d.ts +10 -20
- package/package.json +1 -1
- package/release_notes.tmp +3 -3
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import * as i1 from 'rxjs';
|
|
2
|
+
import { of, startWith as startWith$1, Subject, ReplaySubject, partition, combineLatest, map as map$1, debounceTime, switchMap, tap, filter, shareReplay, distinctUntilChanged, BehaviorSubject, materialize, dematerialize, merge, distinctUntilKeyChanged, skip, first, catchError as catchError$1, throwError, expand, takeWhile, toArray, take, defaultIfEmpty, concatMap, finalize, takeUntil, interval, share, scan } from 'rxjs';
|
|
3
|
+
import { map, startWith, catchError } from 'rxjs/operators';
|
|
1
4
|
import { parseISO, parse, isValid, format } from 'date-fns';
|
|
2
5
|
import { isString, isNil, isMatch, isArray, get } from 'lodash-es';
|
|
3
6
|
import * as i0 from '@angular/core';
|
|
4
7
|
import { InjectionToken, inject, PLATFORM_ID, Injectable, Inject, Optional, EventEmitter, DestroyRef, LOCALE_ID, Pipe, RendererFactory2 } from '@angular/core';
|
|
5
8
|
import { WA_LOCAL_STORAGE, WA_USER_AGENT, WA_WINDOW } from '@ng-web-apis/common';
|
|
6
9
|
import { filterByKey, toValue, WA_STORAGE_EVENT, StorageService } from '@ng-web-apis/storage';
|
|
7
|
-
import * as i1 from 'rxjs';
|
|
8
|
-
import { startWith, Subject, ReplaySubject, partition, combineLatest, map, debounceTime, switchMap, of, tap, filter, shareReplay, distinctUntilChanged, BehaviorSubject, materialize, dematerialize, merge, distinctUntilKeyChanged, skip, first, catchError, throwError, expand, takeWhile, toArray, concatMap, finalize, takeUntil, interval, share, scan } from 'rxjs';
|
|
9
10
|
import { isPlatformBrowser, isPlatformServer, DOCUMENT, formatDate } from '@angular/common';
|
|
10
11
|
import * as i1$1 from '@angular/common/http';
|
|
11
12
|
import { HttpContextToken, HttpContext, HttpHeaders, HttpClient, HttpParams, HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
|
@@ -18,6 +19,48 @@ import { NavigationEnd, Router, ActivatedRoute } from '@angular/router';
|
|
|
18
19
|
import { objectToSnake, objectToCamel, toSnake } from 'ts-case-convert';
|
|
19
20
|
import { Meta, Title } from '@angular/platform-browser';
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Статусы состояния запроса.
|
|
24
|
+
*/
|
|
25
|
+
var ScRequestStateStatusEnum;
|
|
26
|
+
(function (ScRequestStateStatusEnum) {
|
|
27
|
+
/**
|
|
28
|
+
* Статус загрузки.
|
|
29
|
+
*/
|
|
30
|
+
ScRequestStateStatusEnum["Loading"] = "loading";
|
|
31
|
+
/**
|
|
32
|
+
* Статус успешного выполнения запроса.
|
|
33
|
+
*/
|
|
34
|
+
ScRequestStateStatusEnum["Success"] = "success";
|
|
35
|
+
/**
|
|
36
|
+
* Статус ошибки.
|
|
37
|
+
*/
|
|
38
|
+
ScRequestStateStatusEnum["Error"] = "error";
|
|
39
|
+
})(ScRequestStateStatusEnum || (ScRequestStateStatusEnum = {}));
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Состояние загрузки.
|
|
43
|
+
*/
|
|
44
|
+
const ScLoadingRequestState = { status: ScRequestStateStatusEnum.Loading };
|
|
45
|
+
/**
|
|
46
|
+
* Состояние успешного выполнения запроса.
|
|
47
|
+
*
|
|
48
|
+
* @param requestData Данные запроса.
|
|
49
|
+
*/
|
|
50
|
+
const ScSuccessRequestState = (requestData) => ({ status: ScRequestStateStatusEnum.Success, data: requestData });
|
|
51
|
+
/**
|
|
52
|
+
* Состояние ошибки.
|
|
53
|
+
*/
|
|
54
|
+
const ScErrorRequestState = { status: ScRequestStateStatusEnum.Error };
|
|
55
|
+
/**
|
|
56
|
+
* Преобразует поток данных в поток с состояниями запроса.
|
|
57
|
+
*/
|
|
58
|
+
const mapToRequestState = () => (source$) => source$.pipe(map((requestData) => ScSuccessRequestState(requestData)), startWith(ScLoadingRequestState), catchError(() => of(ScErrorRequestState)));
|
|
59
|
+
/**
|
|
60
|
+
* Извлекает данные из потока состояний запроса или возвращает null.
|
|
61
|
+
*/
|
|
62
|
+
const mapRequestStateToDataOrNull = () => (source$) => source$.pipe(map((requestState) => (requestState.status === ScRequestStateStatusEnum.Success ? requestState.data : null)));
|
|
63
|
+
|
|
21
64
|
/**
|
|
22
65
|
* Базовая идентифицируемая сущность.
|
|
23
66
|
*/
|
|
@@ -265,11 +308,11 @@ class ScTokenService {
|
|
|
265
308
|
/**
|
|
266
309
|
* {@link Observable} ключа доступа гостя к API в {@link Storage}.
|
|
267
310
|
*/
|
|
268
|
-
this.guestToken$ = this.event$.pipe(filterByKey(this.guestStorageKey), toValue(), startWith(this.getGuestToken()));
|
|
311
|
+
this.guestToken$ = this.event$.pipe(filterByKey(this.guestStorageKey), toValue(), startWith$1(this.getGuestToken()));
|
|
269
312
|
/**
|
|
270
313
|
* {@link Observable} ключа доступа пользователя к API в {@link Storage}.
|
|
271
314
|
*/
|
|
272
|
-
this.accessAuthToken$ = this.event$.pipe(filterByKey(this.accessAuthStorageKey), toValue(), startWith(this.getAccessToken()));
|
|
315
|
+
this.accessAuthToken$ = this.event$.pipe(filterByKey(this.accessAuthStorageKey), toValue(), startWith$1(this.getAccessToken()));
|
|
273
316
|
this.apiKeys = apiKeys ?? DEFAULT_API_KEYS;
|
|
274
317
|
}
|
|
275
318
|
/**
|
|
@@ -986,8 +1029,8 @@ class ScAuthService {
|
|
|
986
1029
|
*/
|
|
987
1030
|
this.destroyRef = inject(DestroyRef);
|
|
988
1031
|
const [authState$, actions$] = partition(combineLatest({
|
|
989
|
-
access: this.tokenService.accessAuthToken$.pipe(map((token) => token !== null)),
|
|
990
|
-
guest: this.tokenService.guestToken$.pipe(map((token) => token !== null)),
|
|
1032
|
+
access: this.tokenService.accessAuthToken$.pipe(map$1((token) => token !== null)),
|
|
1033
|
+
guest: this.tokenService.guestToken$.pipe(map$1((token) => token !== null)),
|
|
991
1034
|
}).pipe(debounceTime(0)), // Исправляет ошибку одновременного удаления ключа гостя и ключа пользователя. Возникает при очистке Storage.
|
|
992
1035
|
({ access, guest }) => (access && !guest) || (!access && guest));
|
|
993
1036
|
authState$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(({ access }) => {
|
|
@@ -1234,7 +1277,7 @@ class ScUserService {
|
|
|
1234
1277
|
/**
|
|
1235
1278
|
* {@link Observable} ключа доступа пользователя к API в {@link Storage}.
|
|
1236
1279
|
*/
|
|
1237
|
-
this.user$ = this.storageEvent$.pipe(filterByKey('userData'), toValue(), map((userData) => (userData ? new ScUser(JSON.parse(userData)) : null)), startWith(this.storage && this.isBrowser ? null : new ScUser({ metadata: {} })), // Инициализация пользователя при SSR для корректной работы связанных сервисов.
|
|
1280
|
+
this.user$ = this.storageEvent$.pipe(filterByKey('userData'), toValue(), map$1((userData) => (userData ? new ScUser(JSON.parse(userData)) : null)), startWith$1(this.storage && this.isBrowser ? null : new ScUser({ metadata: {} })), // Инициализация пользователя при SSR для корректной работы связанных сервисов.
|
|
1238
1281
|
filter(tuiIsPresent), shareReplay({ refCount: true, bufferSize: 1 }));
|
|
1239
1282
|
/**
|
|
1240
1283
|
* Сервис для работы с токенами.
|
|
@@ -1354,7 +1397,7 @@ class ScUserService {
|
|
|
1354
1397
|
* Возвращает {@link Observable} запроса на получение информации о текущем пользователе.
|
|
1355
1398
|
*/
|
|
1356
1399
|
getUserInfo$() {
|
|
1357
|
-
return this.http.get(`${this.urls.apiUrl}/user`).pipe(map((user) => new ScUser(user)));
|
|
1400
|
+
return this.http.get(`${this.urls.apiUrl}/user`).pipe(map$1((user) => new ScUser(user)));
|
|
1358
1401
|
}
|
|
1359
1402
|
/**
|
|
1360
1403
|
* Обновляет данные {@link Observable} текущего пользователя.
|
|
@@ -1368,7 +1411,7 @@ class ScUserService {
|
|
|
1368
1411
|
* Возвращает {@link Observable} запроса на получение информации о текущем пользователе.
|
|
1369
1412
|
*/
|
|
1370
1413
|
getGuestInfo$() {
|
|
1371
|
-
return this.http.get(`${this.urls.apiUrl}/guest`).pipe(map((user) => new ScUser(user)));
|
|
1414
|
+
return this.http.get(`${this.urls.apiUrl}/guest`).pipe(map$1((user) => new ScUser(user)));
|
|
1372
1415
|
}
|
|
1373
1416
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScUserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1374
1417
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScUserService, providedIn: 'root' }); }
|
|
@@ -1405,7 +1448,7 @@ class ScBannerService {
|
|
|
1405
1448
|
/**
|
|
1406
1449
|
* Список баннеров.
|
|
1407
1450
|
*/
|
|
1408
|
-
this.banners$ = inject(SC_USER_INFO).pipe(switchMap(() => this.http.get(`${this.urls.apiUrl}/banners`)), map((banners) => banners.map((banner) => new ScBanner(banner))), shareReplay(1));
|
|
1451
|
+
this.banners$ = inject(SC_USER_INFO).pipe(switchMap(() => this.http.get(`${this.urls.apiUrl}/banners`)), map$1((banners) => banners.map((banner) => new ScBanner(banner))), shareReplay(1));
|
|
1409
1452
|
}
|
|
1410
1453
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScBannerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1411
1454
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScBannerService, providedIn: 'root' }); }
|
|
@@ -1885,7 +1928,7 @@ class ScCachedItem {
|
|
|
1885
1928
|
this.lifeTime = lifeTime;
|
|
1886
1929
|
const requestData$ = this.update$.pipe(switchMap(() => item$.pipe(tap(() => {
|
|
1887
1930
|
this.updateCacheTime();
|
|
1888
|
-
}), startWith((initialValue ?? null)))), materialize(), shareReplay(1), dematerialize());
|
|
1931
|
+
}), startWith$1((initialValue ?? null)))), materialize(), shareReplay(1), dematerialize());
|
|
1889
1932
|
this.item$ = merge(this.currentValue$, requestData$).pipe(shareReplay(1));
|
|
1890
1933
|
}
|
|
1891
1934
|
/**
|
|
@@ -2050,7 +2093,7 @@ class ScUIService {
|
|
|
2050
2093
|
* @param target Свойство для которого отслеживается изменение.
|
|
2051
2094
|
*/
|
|
2052
2095
|
getMetadataChangeByKey$(target) {
|
|
2053
|
-
return this.userMetadataSubject.pipe(filterChangedByKey(target), map((metadata) => metadata[target]));
|
|
2096
|
+
return this.userMetadataSubject.pipe(filterChangedByKey(target), map$1((metadata) => metadata[target]));
|
|
2054
2097
|
}
|
|
2055
2098
|
/**
|
|
2056
2099
|
* Возвращает {@link Observable} метаданных, когда изменяется значение переданного свойства.
|
|
@@ -2116,7 +2159,7 @@ class ScUIService {
|
|
|
2116
2159
|
*/
|
|
2117
2160
|
getNewOrderMetadata$(directionsId) {
|
|
2118
2161
|
// Данные представлены массивом объектов, поэтому не используется getMetadataChangeByKey$().
|
|
2119
|
-
return this.userMetadataSubject.pipe(map((metadata) => metadata.newOrdersMetadata), distinctUntilChanged(), map((ordersMetadata) => ordersMetadata[directionsId]), distinctUntilChanged());
|
|
2162
|
+
return this.userMetadataSubject.pipe(map$1((metadata) => metadata.newOrdersMetadata), distinctUntilChanged(), map$1((ordersMetadata) => ordersMetadata[directionsId]), distinctUntilChanged());
|
|
2120
2163
|
}
|
|
2121
2164
|
/**
|
|
2122
2165
|
* Устанавливает метаданные неоформленного заказа по направлению продаж.
|
|
@@ -2563,7 +2606,7 @@ class ScReferencesService {
|
|
|
2563
2606
|
* @param directionId Идентификатор направления продаж.
|
|
2564
2607
|
*/
|
|
2565
2608
|
getDirectionById$(directionId) {
|
|
2566
|
-
return this.directions$.pipe(map((directions) => directions.find((direction) => direction.id === directionId)));
|
|
2609
|
+
return this.directions$.pipe(map$1((directions) => directions.find((direction) => direction.id === directionId)));
|
|
2567
2610
|
}
|
|
2568
2611
|
/**
|
|
2569
2612
|
* Возвращает {@link Observable} типа клиента, соответствующий символьному обозначению (slug) на входе.
|
|
@@ -2574,7 +2617,7 @@ class ScReferencesService {
|
|
|
2574
2617
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2575
2618
|
getClientTypesBySlug$(slug) {
|
|
2576
2619
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
|
2577
|
-
return this.clientTypes$.pipe(map((types) => types.find((type) => type.name === slug)));
|
|
2620
|
+
return this.clientTypes$.pipe(map$1((types) => types.find((type) => type.name === slug)));
|
|
2578
2621
|
}
|
|
2579
2622
|
/**
|
|
2580
2623
|
* Возвращает {@link Observable} статус оплаты, соответствующий идентификатору на входе.
|
|
@@ -2582,7 +2625,7 @@ class ScReferencesService {
|
|
|
2582
2625
|
* @param typeId Идентификатор статуса оплаты.
|
|
2583
2626
|
*/
|
|
2584
2627
|
getPaymentStatusById$(typeId) {
|
|
2585
|
-
return this.paymentStatuses$.pipe(map((types) => types.find((type) => type.id === typeId)));
|
|
2628
|
+
return this.paymentStatuses$.pipe(map$1((types) => types.find((type) => type.id === typeId)));
|
|
2586
2629
|
}
|
|
2587
2630
|
/**
|
|
2588
2631
|
* Возвращает {@link Observable} тип доставки, соответствующий идентификатору на входе.
|
|
@@ -2590,7 +2633,7 @@ class ScReferencesService {
|
|
|
2590
2633
|
* @param typeId Идентификатор типа доставки.
|
|
2591
2634
|
*/
|
|
2592
2635
|
getDeliveryTypeById$(typeId) {
|
|
2593
|
-
return this.deliveryTypes$.pipe(map((types) => types.find((type) => type.id === typeId)));
|
|
2636
|
+
return this.deliveryTypes$.pipe(map$1((types) => types.find((type) => type.id === typeId)));
|
|
2594
2637
|
}
|
|
2595
2638
|
/**
|
|
2596
2639
|
* Возвращает {@link Observable} типа статуса рекламаций, соответствующий указанному идентификатору.
|
|
@@ -2598,7 +2641,7 @@ class ScReferencesService {
|
|
|
2598
2641
|
* @param statusId Идентификатор типа статуса.
|
|
2599
2642
|
*/
|
|
2600
2643
|
getReclamationStatusById$(statusId) {
|
|
2601
|
-
return this.reclamationStatuses$.pipe(map((types) => types.find((type) => type.id === statusId)));
|
|
2644
|
+
return this.reclamationStatuses$.pipe(map$1((types) => types.find((type) => type.id === statusId)));
|
|
2602
2645
|
}
|
|
2603
2646
|
/**
|
|
2604
2647
|
* Возвращает {@link Observable} тип оплаты, соответствующий идентификатору на входе.
|
|
@@ -2606,7 +2649,7 @@ class ScReferencesService {
|
|
|
2606
2649
|
* @param typeId Идентификатор типа оплаты.
|
|
2607
2650
|
*/
|
|
2608
2651
|
getPaymentTypeById$(typeId) {
|
|
2609
|
-
return this.paymentTypes$.pipe(map((types) => types.find((type) => type.id === typeId)));
|
|
2652
|
+
return this.paymentTypes$.pipe(map$1((types) => types.find((type) => type.id === typeId)));
|
|
2610
2653
|
}
|
|
2611
2654
|
/**
|
|
2612
2655
|
* Возвращает {@link Observable} организационно-правовой формы, соответствующий символьному обозначению (slug) на входе.
|
|
@@ -2614,7 +2657,7 @@ class ScReferencesService {
|
|
|
2614
2657
|
* @param slug Символьное обозначение (slug).
|
|
2615
2658
|
*/
|
|
2616
2659
|
getOpfBySlug$(slug) {
|
|
2617
|
-
return this.opf$.pipe(map((types) => types.find((type) => type.slug === slug)));
|
|
2660
|
+
return this.opf$.pipe(map$1((types) => types.find((type) => type.slug === slug)));
|
|
2618
2661
|
}
|
|
2619
2662
|
/**
|
|
2620
2663
|
* Возвращает {@link Observable} валюты, соответствующий идентификатору на входе.
|
|
@@ -2622,7 +2665,7 @@ class ScReferencesService {
|
|
|
2622
2665
|
* @param currencyId Идентификатор валюты.
|
|
2623
2666
|
*/
|
|
2624
2667
|
getCurrencyById$(currencyId) {
|
|
2625
|
-
return this.currencies$.pipe(map((types) => types.find((type) => type.id === currencyId)));
|
|
2668
|
+
return this.currencies$.pipe(map$1((types) => types.find((type) => type.id === currencyId)));
|
|
2626
2669
|
}
|
|
2627
2670
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScReferencesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2628
2671
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScReferencesService, providedIn: 'root' }); }
|
|
@@ -2665,7 +2708,7 @@ class ScWarehouseService {
|
|
|
2665
2708
|
*/
|
|
2666
2709
|
initSubscriptionOnUser() {
|
|
2667
2710
|
// Observable данных для обработки сигналов изменения пользователя.
|
|
2668
|
-
const data$ = this.warehouses$.pipe(switchMap((warehouses) => this.user$.pipe(map((user) => ({
|
|
2711
|
+
const data$ = this.warehouses$.pipe(switchMap((warehouses) => this.user$.pipe(map$1((user) => ({
|
|
2669
2712
|
warehouses: warehouses,
|
|
2670
2713
|
selectedIdMetadata: user.metadata.selectedWarehouseId,
|
|
2671
2714
|
city: user.city,
|
|
@@ -2676,7 +2719,7 @@ class ScWarehouseService {
|
|
|
2676
2719
|
data$
|
|
2677
2720
|
.pipe(
|
|
2678
2721
|
// eslint-disable-next-line unicorn/no-negation-in-equality-check
|
|
2679
|
-
distinctUntilChanged((previous, current) => !previous.id === !current.id), map((data) => /** data.selectedIdMetadata || */ data.warehouses.find((warehouse) => data.region && warehouse.regions?.includes(data.region))?.id ?? null), filter((selectedId) => this.warehouseIdSelectSubject.value !== selectedId), tap((selectedId) => {
|
|
2722
|
+
distinctUntilChanged((previous, current) => !previous.id === !current.id), map$1((data) => /** data.selectedIdMetadata || */ data.warehouses.find((warehouse) => data.region && warehouse.regions?.includes(data.region))?.id ?? null), filter((selectedId) => this.warehouseIdSelectSubject.value !== selectedId), tap((selectedId) => {
|
|
2680
2723
|
this.warehouseIdSelectSubject.next(selectedId);
|
|
2681
2724
|
}))
|
|
2682
2725
|
.subscribe();
|
|
@@ -2686,9 +2729,9 @@ class ScWarehouseService {
|
|
|
2686
2729
|
// eslint-disable-next-line unicorn/no-negation-in-equality-check
|
|
2687
2730
|
distinctUntilChanged((previous, current) => !previous.id !== !current.id || previous.city === current.city), skip(1), // distinctUntilChanged() всегда выдаёт первое значение, поэтому пропускаем его и реагируем только на изменение.
|
|
2688
2731
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2689
|
-
map((data) => data.warehouses.find((warehouse) => data.region && warehouse.regions?.includes(data.region))?.id || data.warehouses.find((item) => item.isMain)?.id), filter((selectedId) => selectedId !== undefined && this.warehouseIdSelectSubject.value !== selectedId),
|
|
2732
|
+
map$1((data) => data.warehouses.find((warehouse) => data.region && warehouse.regions?.includes(data.region))?.id || data.warehouses.find((item) => item.isMain)?.id), filter((selectedId) => selectedId !== undefined && this.warehouseIdSelectSubject.value !== selectedId),
|
|
2690
2733
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2691
|
-
map((selectedId) => selectedId), tap((selectedId) => {
|
|
2734
|
+
map$1((selectedId) => selectedId), tap((selectedId) => {
|
|
2692
2735
|
this.setWarehouseIdSelectChange(selectedId);
|
|
2693
2736
|
}))
|
|
2694
2737
|
.subscribe();
|
|
@@ -2706,13 +2749,13 @@ class ScWarehouseService {
|
|
|
2706
2749
|
* Возвращает {@link Observable} выбранного склада.
|
|
2707
2750
|
*/
|
|
2708
2751
|
getWarehouseSelectChange$() {
|
|
2709
|
-
return this.warehouses$.pipe(switchMap((warehouses) => this.warehouseIdSelectSubject.pipe(map((id) => warehouses.find((item) => item.id === id) ?? warehouses.find((item) => item.isMain)), filter((warehouse) => warehouse !== undefined))), map((warehouse) => warehouse));
|
|
2752
|
+
return this.warehouses$.pipe(switchMap((warehouses) => this.warehouseIdSelectSubject.pipe(map$1((id) => warehouses.find((item) => item.id === id) ?? warehouses.find((item) => item.isMain)), filter((warehouse) => warehouse !== undefined))), map$1((warehouse) => warehouse));
|
|
2710
2753
|
}
|
|
2711
2754
|
/**
|
|
2712
2755
|
* Возвращает {@link Observable} склада для доставки.
|
|
2713
2756
|
*/
|
|
2714
2757
|
getDeliveryWarehouse$() {
|
|
2715
|
-
return this.warehouses$.pipe(map((warehouses) => warehouses.find((item) => item.isMain)), filter(tuiIsPresent));
|
|
2758
|
+
return this.warehouses$.pipe(map$1((warehouses) => warehouses.find((item) => item.isMain)), filter(tuiIsPresent));
|
|
2716
2759
|
}
|
|
2717
2760
|
/**
|
|
2718
2761
|
* Возвращает {@link Observable} склада в зависимости от того, где запущено приложение.
|
|
@@ -2721,7 +2764,7 @@ class ScWarehouseService {
|
|
|
2721
2764
|
* во всех остальных случаях возвращает основной склад.
|
|
2722
2765
|
*/
|
|
2723
2766
|
getCatalogWarehouseChange$() {
|
|
2724
|
-
return this.warehouses$.pipe(map((warehouses) => warehouses.find((w) => w.id === this.terminal.warehouseId) ?? warehouses.find((w) => w.isMain)), filter(tuiIsPresent));
|
|
2767
|
+
return this.warehouses$.pipe(map$1((warehouses) => warehouses.find((w) => w.id === this.terminal.warehouseId) ?? warehouses.find((w) => w.isMain)), filter(tuiIsPresent));
|
|
2725
2768
|
}
|
|
2726
2769
|
/**
|
|
2727
2770
|
* Возвращает {@link Observable} списка складов.
|
|
@@ -2795,9 +2838,9 @@ class ScCartService {
|
|
|
2795
2838
|
* Создаёт запрос получения содержимого корзины и обновляет корзину, возвращая {@link Observable} содержимого корзины.
|
|
2796
2839
|
*/
|
|
2797
2840
|
getCartData$() {
|
|
2798
|
-
return this.user$.pipe(first(), switchMap((user) => this.http.get(`${this.urls.apiUrl}/cart`).pipe(map((cartDTO) => new ScCart(cartDTO)),
|
|
2841
|
+
return this.user$.pipe(first(), switchMap((user) => this.http.get(`${this.urls.apiUrl}/cart`).pipe(map$1((cartDTO) => new ScCart(cartDTO)),
|
|
2799
2842
|
// TODO: Пересмотреть механизмы перехвата HTTP-ошибок 401/403/0 централизованно (с использованием interceptors).
|
|
2800
|
-
catchError((error) => {
|
|
2843
|
+
catchError$1((error) => {
|
|
2801
2844
|
if (user.isGuest && error instanceof HttpErrorResponse && [0, 401, 403].includes(error.status)) {
|
|
2802
2845
|
// Для гостя в неавторизованных/сетевых кейсах отдаём пустую корзину,
|
|
2803
2846
|
// чтобы не пробрасывать ошибку во все подписки UI.
|
|
@@ -2816,7 +2859,7 @@ class ScCartService {
|
|
|
2816
2859
|
* Возвращает список элементов корзины.
|
|
2817
2860
|
*/
|
|
2818
2861
|
getItems$() {
|
|
2819
|
-
return this.get$().pipe(map((cart) => (cart === loadingPlaceholder ? loadingPlaceholder : cart.items)));
|
|
2862
|
+
return this.get$().pipe(map$1((cart) => (cart === loadingPlaceholder ? loadingPlaceholder : cart.items)));
|
|
2820
2863
|
}
|
|
2821
2864
|
/**
|
|
2822
2865
|
* Добавляет продукт в корзину.
|
|
@@ -2824,7 +2867,7 @@ class ScCartService {
|
|
|
2824
2867
|
* @param data Данные добавляемого продукта.
|
|
2825
2868
|
*/
|
|
2826
2869
|
addProduct$(data) {
|
|
2827
|
-
return this.http.patch(`${this.urls.apiUrl}/cart`, data).pipe(map((cartDTO) => new ScCart(cartDTO)), tap(() => {
|
|
2870
|
+
return this.http.patch(`${this.urls.apiUrl}/cart`, data).pipe(map$1((cartDTO) => new ScCart(cartDTO)), tap(() => {
|
|
2828
2871
|
if (data.productId) {
|
|
2829
2872
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
2830
2873
|
target: ScUserMetrikaGoalsEnum.cartItemAdded,
|
|
@@ -2842,7 +2885,7 @@ class ScCartService {
|
|
|
2842
2885
|
* @param patch Частичные данные для обновления.
|
|
2843
2886
|
*/
|
|
2844
2887
|
updateProduct$(id, patch) {
|
|
2845
|
-
return this.http.patch(`${this.urls.apiUrl}/cart/${id}`, patch).pipe(map((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2888
|
+
return this.http.patch(`${this.urls.apiUrl}/cart/${id}`, patch).pipe(map$1((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2846
2889
|
this.cartCachedItem$.setValue(cart);
|
|
2847
2890
|
}));
|
|
2848
2891
|
}
|
|
@@ -2852,7 +2895,7 @@ class ScCartService {
|
|
|
2852
2895
|
* @param item Удаляемая позиция.
|
|
2853
2896
|
*/
|
|
2854
2897
|
deleteProduct$(item) {
|
|
2855
|
-
return this.http.delete(`${this.urls.apiUrl}/cart/${item.id}`).pipe(map((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2898
|
+
return this.http.delete(`${this.urls.apiUrl}/cart/${item.id}`).pipe(map$1((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2856
2899
|
this.cartCachedItem$.setValue(cart);
|
|
2857
2900
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
2858
2901
|
target: ScUserMetrikaGoalsEnum.cartItemDeleted,
|
|
@@ -2885,7 +2928,7 @@ class ScCartService {
|
|
|
2885
2928
|
* @deprecated
|
|
2886
2929
|
*/
|
|
2887
2930
|
getNullCartItems$() {
|
|
2888
|
-
return this.get$().pipe(map((cart) => (cart === loadingPlaceholder ? loadingPlaceholder : cart.items.filter((item) => item.product.isNull || item.product.isHidden))));
|
|
2931
|
+
return this.get$().pipe(map$1((cart) => (cart === loadingPlaceholder ? loadingPlaceholder : cart.items.filter((item) => item.product.isNull || item.product.isHidden))));
|
|
2889
2932
|
}
|
|
2890
2933
|
/**
|
|
2891
2934
|
* Возвращает объект {@link ScCart} корзины, созданный из объекта заказа.
|
|
@@ -2908,7 +2951,7 @@ class ScCartService {
|
|
|
2908
2951
|
.get(`${this.urls.apiUrl}/cart/csv/example`, {
|
|
2909
2952
|
responseType: 'blob',
|
|
2910
2953
|
})
|
|
2911
|
-
.pipe(map((blob) => new Blob([blob], { type: 'text/csv' })));
|
|
2954
|
+
.pipe(map$1((blob) => new Blob([blob], { type: 'text/csv' })));
|
|
2912
2955
|
}
|
|
2913
2956
|
/**
|
|
2914
2957
|
* Добавляет товары в корзину из файла CSV.
|
|
@@ -2916,7 +2959,7 @@ class ScCartService {
|
|
|
2916
2959
|
* @param file Загружаемый файл в формате base64.
|
|
2917
2960
|
*/
|
|
2918
2961
|
addProductsFromCsv$(file) {
|
|
2919
|
-
return this.http.post(`${this.urls.apiUrl}/cart/csv`, { file }).pipe(map((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2962
|
+
return this.http.post(`${this.urls.apiUrl}/cart/csv`, { file }).pipe(map$1((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2920
2963
|
this.cartCachedItem$.setValue(cart);
|
|
2921
2964
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
2922
2965
|
target: ScUserMetrikaGoalsEnum.cartCsvUpload,
|
|
@@ -3080,6 +3123,14 @@ class ScCatalogFilterService {
|
|
|
3080
3123
|
* HTTP клиент для выполнения запросов.
|
|
3081
3124
|
*/
|
|
3082
3125
|
this.http = inject(HttpClient);
|
|
3126
|
+
/**
|
|
3127
|
+
* Время жизни кэша фильтров.
|
|
3128
|
+
*/
|
|
3129
|
+
this.cacheLifeTime = inject(SC_CACHE_LIFETIME);
|
|
3130
|
+
/**
|
|
3131
|
+
* Кэш фильтров по ключу `categoryIdOrSlug:recursively`.
|
|
3132
|
+
*/
|
|
3133
|
+
this.filterMap = new Map();
|
|
3083
3134
|
}
|
|
3084
3135
|
/**
|
|
3085
3136
|
* Возвращает список доступных фильтров продуктов в категории.
|
|
@@ -3088,14 +3139,23 @@ class ScCatalogFilterService {
|
|
|
3088
3139
|
* @param recursively Признак того, что необходимо вернуть фильтры с учетом вложенных категорий.
|
|
3089
3140
|
*/
|
|
3090
3141
|
getFilters$(categoryIdOrSlug, recursively) {
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3142
|
+
const key = `${categoryIdOrSlug}:${recursively ?? ''}`;
|
|
3143
|
+
let cachedItem = this.filterMap.get(key);
|
|
3144
|
+
if (!cachedItem) {
|
|
3145
|
+
let params = new HttpParams();
|
|
3146
|
+
if (recursively !== undefined) {
|
|
3147
|
+
params = params.set('recursively', String(recursively));
|
|
3148
|
+
}
|
|
3149
|
+
cachedItem = new ScCachedItem(this.cacheLifeTime.categoryData, this.http.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug}/filters`, {
|
|
3150
|
+
params,
|
|
3151
|
+
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3152
|
+
}));
|
|
3153
|
+
this.filterMap.set(key, cachedItem);
|
|
3094
3154
|
}
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3155
|
+
if (!cachedItem.cachedDataIsActual()) {
|
|
3156
|
+
cachedItem.update();
|
|
3157
|
+
}
|
|
3158
|
+
return cachedItem.item$;
|
|
3099
3159
|
}
|
|
3100
3160
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScCatalogFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3101
3161
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScCatalogFilterService, providedIn: 'root' }); }
|
|
@@ -3220,11 +3280,11 @@ class ScCatalogService {
|
|
|
3220
3280
|
/**
|
|
3221
3281
|
* {@link Observable} изменения списка из первых товаров со скидкой.
|
|
3222
3282
|
*/
|
|
3223
|
-
this.firstDiscountedProducts$ = this.firstDiscounted$.pipe(map((data) => data?.data ?? []));
|
|
3283
|
+
this.firstDiscountedProducts$ = this.firstDiscounted$.pipe(map$1((data) => data?.data ?? []));
|
|
3224
3284
|
/**
|
|
3225
3285
|
* {@link Observable} изменения общего колличества товара со скидкой.
|
|
3226
3286
|
*/
|
|
3227
|
-
this.countDiscountedProducts$ = this.firstDiscounted$.pipe(map((data) => data?.meta.total ?? 0));
|
|
3287
|
+
this.countDiscountedProducts$ = this.firstDiscounted$.pipe(map$1((data) => data?.meta.total ?? 0));
|
|
3228
3288
|
this.userService
|
|
3229
3289
|
.getUserChange$()
|
|
3230
3290
|
.pipe(skip(1))
|
|
@@ -3258,7 +3318,7 @@ class ScCatalogService {
|
|
|
3258
3318
|
* @param categoryIdOrSlug Идентификатор или slug категории товаров.
|
|
3259
3319
|
*/
|
|
3260
3320
|
getCategoryData$(categoryIdOrSlug) {
|
|
3261
|
-
return this.http.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug ?? ''}`).pipe(map((category) => new ScCategory(category)), tap((category) => {
|
|
3321
|
+
return this.http.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug ?? ''}`).pipe(map$1((category) => new ScCategory(category)), tap((category) => {
|
|
3262
3322
|
if (categoryIdOrSlug) {
|
|
3263
3323
|
this.categoryIdOrSlugMap.set(typeof categoryIdOrSlug === 'string' ? category.id : category.slug, categoryIdOrSlug);
|
|
3264
3324
|
}
|
|
@@ -3268,7 +3328,7 @@ class ScCatalogService {
|
|
|
3268
3328
|
* Возвращает {@link Observable} корневых категорий с настройками отображения, чтобы реагировать на изменения.
|
|
3269
3329
|
*/
|
|
3270
3330
|
getFilteredRootCategories$() {
|
|
3271
|
-
return this.uiService.getHiddenCategoriesList$().pipe(switchMap((filters) => this.getRootCategories$().pipe(filter(tuiIsPresent), map((data) => data.filter((category) => category.id && !filters.includes(category.id))))));
|
|
3331
|
+
return this.uiService.getHiddenCategoriesList$().pipe(switchMap((filters) => this.getRootCategories$().pipe(filter(tuiIsPresent), map$1((data) => data.filter((category) => category.id && !filters.includes(category.id))))));
|
|
3272
3332
|
}
|
|
3273
3333
|
/**
|
|
3274
3334
|
* Возвращает {@link Observable} содержимого виртуальной категории.
|
|
@@ -3278,7 +3338,7 @@ class ScCatalogService {
|
|
|
3278
3338
|
getVirtualCategoryCached$(slug) {
|
|
3279
3339
|
let cachedItem = this.virtualCategoryMap.get(slug);
|
|
3280
3340
|
if (!cachedItem) {
|
|
3281
|
-
cachedItem = new ScCachedItem(this.cacheLifeTime.categoryData, this.http.get(`${this.urls.apiUrl}/catalog/v-categories/${slug}`).pipe(map((category) => new ScVirtualCategory(category))), null);
|
|
3341
|
+
cachedItem = new ScCachedItem(this.cacheLifeTime.categoryData, this.http.get(`${this.urls.apiUrl}/catalog/v-categories/${slug}`).pipe(map$1((category) => new ScVirtualCategory(category))), null);
|
|
3282
3342
|
this.virtualCategoryMap.set(slug, cachedItem);
|
|
3283
3343
|
}
|
|
3284
3344
|
if (!cachedItem.cachedDataIsActual()) {
|
|
@@ -3316,7 +3376,7 @@ class ScCatalogService {
|
|
|
3316
3376
|
* Создает запрос получения корневых категорий.
|
|
3317
3377
|
*/
|
|
3318
3378
|
getRootCategories$() {
|
|
3319
|
-
return this.getNullCategory$().pipe(map((nullCategory) => nullCategory?.categories ?? null));
|
|
3379
|
+
return this.getNullCategory$().pipe(map$1((nullCategory) => nullCategory?.categories ?? null));
|
|
3320
3380
|
}
|
|
3321
3381
|
/**
|
|
3322
3382
|
* Раскрывает каталог до указанной категории.
|
|
@@ -3329,7 +3389,7 @@ class ScCatalogService {
|
|
|
3329
3389
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition,sonarjs/different-types-comparison
|
|
3330
3390
|
takeWhile((parentCategory) => parentCategory.parentCategory !== undefined, true), toArray(),
|
|
3331
3391
|
// eslint-disable-next-line sonarjs/no-misleading-array-reverse
|
|
3332
|
-
map((categories) => categories.reverse()));
|
|
3392
|
+
map$1((categories) => categories.reverse()));
|
|
3333
3393
|
}
|
|
3334
3394
|
/**
|
|
3335
3395
|
* Возвращает {@link Observable} получения истории изменения цен на продукт для клиента.
|
|
@@ -3344,7 +3404,7 @@ class ScCatalogService {
|
|
|
3344
3404
|
.get(`${this.urls.apiUrl}/catalog/products/${product.id}/price-history`, {
|
|
3345
3405
|
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3346
3406
|
})
|
|
3347
|
-
.pipe(catchError(() => of({}))), null);
|
|
3407
|
+
.pipe(catchError$1(() => of({}))), null);
|
|
3348
3408
|
this.productHistoryMap.set(product.id.toString(), cachedItem);
|
|
3349
3409
|
}
|
|
3350
3410
|
return cachedItem.item$;
|
|
@@ -3358,7 +3418,7 @@ class ScCatalogService {
|
|
|
3358
3418
|
})
|
|
3359
3419
|
.pipe(
|
|
3360
3420
|
// eslint-disable-next-line sonarjs/function-return-type
|
|
3361
|
-
map((data) => {
|
|
3421
|
+
map$1((data) => {
|
|
3362
3422
|
if ('meta' in data) {
|
|
3363
3423
|
const cloneData = structuredClone(data);
|
|
3364
3424
|
cloneData.data = cloneData.data.map((item) => new ScProduct(item));
|
|
@@ -3397,7 +3457,7 @@ class ScCatalogService {
|
|
|
3397
3457
|
* @param productIdOrSlug Идентификатор или slug товара/услуги.
|
|
3398
3458
|
*/
|
|
3399
3459
|
getProductData$(productIdOrSlug) {
|
|
3400
|
-
return this.http.get(`${this.urls.apiUrl}/catalog/products/${productIdOrSlug}`).pipe(map((productDTO) => new ScProduct(productDTO)), tap((product) => {
|
|
3460
|
+
return this.http.get(`${this.urls.apiUrl}/catalog/products/${productIdOrSlug}`).pipe(map$1((productDTO) => new ScProduct(productDTO)), tap((product) => {
|
|
3401
3461
|
if (productIdOrSlug) {
|
|
3402
3462
|
this.productIdOrSlugMap.set(typeof productIdOrSlug === 'string' ? product.id : product.slug, productIdOrSlug);
|
|
3403
3463
|
}
|
|
@@ -3430,7 +3490,7 @@ class ScCatalogService {
|
|
|
3430
3490
|
format: Object.keys(ScMimeTypes)[Object.values(ScMimeTypes).indexOf(type)],
|
|
3431
3491
|
category_id: categoryId ?? null,
|
|
3432
3492
|
}, { nonNullable: true });
|
|
3433
|
-
return this.http.get(`${this.urls.apiUrl}/catalog/download`, { responseType: 'blob', params: params }).pipe(map((blob) => new Blob([blob], { type: type })), tap(() => {
|
|
3493
|
+
return this.http.get(`${this.urls.apiUrl}/catalog/download`, { responseType: 'blob', params: params }).pipe(map$1((blob) => new Blob([blob], { type: type })), tap(() => {
|
|
3434
3494
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
3435
3495
|
target: ScUserMetrikaGoalsEnum.catalogPriceDownload,
|
|
3436
3496
|
params: {
|
|
@@ -3499,7 +3559,7 @@ class ScFavoriteService {
|
|
|
3499
3559
|
getFavoriteCategories$() {
|
|
3500
3560
|
return this.http
|
|
3501
3561
|
.get(`${this.urls.apiUrl}/favorites/categories`)
|
|
3502
|
-
.pipe(map((categoriesDTO) => categoriesDTO.map((categoryDTO) => new ScCategory(categoryDTO))));
|
|
3562
|
+
.pipe(map$1((categoriesDTO) => categoriesDTO.map((categoryDTO) => new ScCategory(categoryDTO))));
|
|
3503
3563
|
}
|
|
3504
3564
|
/**
|
|
3505
3565
|
* Запрос добавления указанной категории в избранное.
|
|
@@ -3601,8 +3661,8 @@ class ScRecommendationService {
|
|
|
3601
3661
|
.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug}/recommendations`, {
|
|
3602
3662
|
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3603
3663
|
})
|
|
3604
|
-
.pipe(catchError(() => of([])), map((productsDTO) => productsDTO.map((product) => new ScProduct(product))))
|
|
3605
|
-
.pipe(startWith(null)), null);
|
|
3664
|
+
.pipe(catchError$1(() => of([])), map$1((productsDTO) => productsDTO.map((product) => new ScProduct(product))))
|
|
3665
|
+
.pipe(startWith$1(null)), null);
|
|
3606
3666
|
this.productsByCategoryMap.set(categoryIdOrSlug.toString(), cachedItem);
|
|
3607
3667
|
}
|
|
3608
3668
|
return cachedItem.item$;
|
|
@@ -3620,8 +3680,8 @@ class ScRecommendationService {
|
|
|
3620
3680
|
.get(`${this.urls.apiUrl}/catalog/products/${productIdOrSlug}/recommendations`, {
|
|
3621
3681
|
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3622
3682
|
})
|
|
3623
|
-
.pipe(catchError(() => of([])), map((productsDTO) => productsDTO.map((product) => new ScProduct(product))))
|
|
3624
|
-
.pipe(startWith(null)), null);
|
|
3683
|
+
.pipe(catchError$1(() => of([])), map$1((productsDTO) => productsDTO.map((product) => new ScProduct(product))))
|
|
3684
|
+
.pipe(startWith$1(null)), null);
|
|
3625
3685
|
this.productsByProductMap.set(productIdOrSlug.toString(), cachedItem);
|
|
3626
3686
|
}
|
|
3627
3687
|
return cachedItem.item$;
|
|
@@ -3637,16 +3697,16 @@ class ScRecommendationService {
|
|
|
3637
3697
|
params: this.convertersService.toHttpParams({ products: productIds }, { nonNullable: true }),
|
|
3638
3698
|
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3639
3699
|
})
|
|
3640
|
-
.pipe(catchError(() => of([])), map((productsDTO) => productsDTO.map((product) => new ScProduct(product))));
|
|
3700
|
+
.pipe(catchError$1(() => of([])), map$1((productsDTO) => productsDTO.map((product) => new ScProduct(product))));
|
|
3641
3701
|
}
|
|
3642
3702
|
/**
|
|
3643
3703
|
* Создает запрос на получение списка рекомендованных товаров для корзины клиента.
|
|
3644
3704
|
*/
|
|
3645
3705
|
getProductsByCart$() {
|
|
3646
|
-
return this.cartService.get$().pipe(map((cart) => (cart !== loadingPlaceholder && 'items' in cart ? cart.items.map((item) => item.product.id) : [])),
|
|
3706
|
+
return this.cartService.get$().pipe(map$1((cart) => (cart !== loadingPlaceholder && 'items' in cart ? cart.items.map((item) => item.product.id) : [])),
|
|
3647
3707
|
// Отфильтровываем повторения. Они возникнут если было изменено количество товара без удаления\добавления новых товаров.
|
|
3648
3708
|
// eslint-disable-next-line sonarjs/no-misleading-array-reverse
|
|
3649
|
-
distinctUntilChanged((previous, current) => JSON.stringify([...previous].sort((a, b) => a - b)) === JSON.stringify([...current].sort((a, b) => a - b))), switchMap((productIds) => this.getProductsByProductIds$(productIds).pipe(startWith(null))));
|
|
3709
|
+
distinctUntilChanged((previous, current) => JSON.stringify([...previous].sort((a, b) => a - b)) === JSON.stringify([...current].sort((a, b) => a - b))), switchMap((productIds) => this.getProductsByProductIds$(productIds).pipe(startWith$1(null))));
|
|
3650
3710
|
}
|
|
3651
3711
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScRecommendationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3652
3712
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScRecommendationService, providedIn: 'root' }); }
|
|
@@ -3867,7 +3927,7 @@ class ScConfiguratorService {
|
|
|
3867
3927
|
}
|
|
3868
3928
|
return this.http.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug}/configurators/${editor}/settings`).pipe(
|
|
3869
3929
|
// eslint-disable-next-line security/detect-object-injection
|
|
3870
|
-
map((settings) => (this.configuratorSettings && editor in this.configuratorSettings ? new this.configuratorSettings[editor](settings) : settings)), tap((settings) => {
|
|
3930
|
+
map$1((settings) => (this.configuratorSettings && editor in this.configuratorSettings ? new this.configuratorSettings[editor](settings) : settings)), tap((settings) => {
|
|
3871
3931
|
if (category) {
|
|
3872
3932
|
category.configuratorSettings = settings;
|
|
3873
3933
|
}
|
|
@@ -3883,7 +3943,7 @@ class ScConfiguratorService {
|
|
|
3883
3943
|
getProduct$(categoryIdOrSlug, editor, params) {
|
|
3884
3944
|
return this.http
|
|
3885
3945
|
.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug}/configurators/${editor}/product`, { params: params })
|
|
3886
|
-
.pipe(map((productDTO) => new ScProduct(productDTO)));
|
|
3946
|
+
.pipe(map$1((productDTO) => new ScProduct(productDTO)));
|
|
3887
3947
|
}
|
|
3888
3948
|
/**
|
|
3889
3949
|
* Создаёт пользовательский шаблон конфигуратора.
|
|
@@ -4226,53 +4286,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
4226
4286
|
}] });
|
|
4227
4287
|
|
|
4228
4288
|
/**
|
|
4229
|
-
*
|
|
4289
|
+
* Класс-помощник для работы со значениями единиц измерения товара.
|
|
4230
4290
|
*/
|
|
4231
4291
|
class ScUnitsHelper {
|
|
4232
4292
|
/**
|
|
4233
|
-
*
|
|
4293
|
+
* Возвращает признак, что указанный товар имеет линейную единицу измерения.
|
|
4234
4294
|
*
|
|
4235
|
-
* @param
|
|
4295
|
+
* @param product Данные о товаре для которого нужно проверить линейность его единицы измерения.
|
|
4236
4296
|
*/
|
|
4237
|
-
|
|
4238
|
-
|
|
4297
|
+
static productIsMeasurable(product) {
|
|
4298
|
+
return product.unit.isLinear || product.unit.isSquare;
|
|
4239
4299
|
}
|
|
4240
4300
|
/**
|
|
4241
|
-
* Возвращает
|
|
4301
|
+
* Возвращает кратность количества для указанного товара.
|
|
4242
4302
|
*
|
|
4243
|
-
* @param product
|
|
4303
|
+
* @param product Данные о товаре для которого необходимо вернуть кратность количества.
|
|
4244
4304
|
*/
|
|
4245
|
-
|
|
4246
|
-
return
|
|
4305
|
+
static getProductMultiplicity(product) {
|
|
4306
|
+
return !product.properties?.ignoreMinCountCheck && product.minCount && !ScUnitsHelper.productIsMeasurable(product) ? product.minCount : 1;
|
|
4247
4307
|
}
|
|
4248
4308
|
/**
|
|
4249
|
-
* Возвращает кратность
|
|
4309
|
+
* Возвращает кратность длины для указанного товара.
|
|
4250
4310
|
*
|
|
4251
|
-
* @param product
|
|
4311
|
+
* @param product Данные о товаре для которого необходимо вернуть кратность длины.
|
|
4252
4312
|
*/
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
*
|
|
4259
|
-
* @param product Товар для которого нужно вернуть значение кратность.
|
|
4260
|
-
*/
|
|
4261
|
-
productStepForValidator(product) {
|
|
4262
|
-
return product.ignoreMinCountCheck ? 1 : this.productMultiplicity(product);
|
|
4313
|
+
static getProductLengthMultiplicity(product) {
|
|
4314
|
+
if (product.properties?.lengthStep) {
|
|
4315
|
+
return product.properties.lengthStep;
|
|
4316
|
+
}
|
|
4317
|
+
return !product.properties?.ignoreMinCountCheck && product.minCount ? product.minCount : 0.01;
|
|
4263
4318
|
}
|
|
4264
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScUnitsHelper, deps: [{ token: SC_LINEAR_VALUES_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4265
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScUnitsHelper, providedIn: 'root' }); }
|
|
4266
4319
|
}
|
|
4267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScUnitsHelper, decorators: [{
|
|
4268
|
-
type: Injectable,
|
|
4269
|
-
args: [{
|
|
4270
|
-
providedIn: 'root',
|
|
4271
|
-
}]
|
|
4272
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4273
|
-
type: Inject,
|
|
4274
|
-
args: [SC_LINEAR_VALUES_TOKEN]
|
|
4275
|
-
}] }] });
|
|
4276
4320
|
|
|
4277
4321
|
/**
|
|
4278
4322
|
* Возвращает текущий маршрут.
|
|
@@ -4300,7 +4344,7 @@ const SC_CATEGORY_INFO = new InjectionToken('A stream with current category info
|
|
|
4300
4344
|
* @param catalogService Сервис для работы с каталогом.
|
|
4301
4345
|
*/
|
|
4302
4346
|
function categoryFactory(router, route, catalogService) {
|
|
4303
|
-
return router.events.pipe(filter((event) => event instanceof NavigationEnd)).pipe(startWith(null), switchMap(() => {
|
|
4347
|
+
return router.events.pipe(filter((event) => event instanceof NavigationEnd)).pipe(startWith$1(null), switchMap(() => {
|
|
4304
4348
|
const categoryIdOrSlug = scGetCurrentRoute(route).snapshot.paramMap.get('categoryIdOrSlug');
|
|
4305
4349
|
if (categoryIdOrSlug) {
|
|
4306
4350
|
return catalogService.getCategoryCached$(categoryIdOrSlug);
|
|
@@ -4369,7 +4413,7 @@ class ScSearchService {
|
|
|
4369
4413
|
term: term,
|
|
4370
4414
|
},
|
|
4371
4415
|
});
|
|
4372
|
-
}), map((categories) => categories.map((item) => new ScCategory(item))));
|
|
4416
|
+
}), map$1((categories) => categories.map((item) => new ScCategory(item))));
|
|
4373
4417
|
}
|
|
4374
4418
|
/**
|
|
4375
4419
|
* Выполняет полный поиск по всему прайс-листу.
|
|
@@ -4455,7 +4499,7 @@ const SC_MAX_LENGTH_SEARCH_TERM = new InjectionToken('SC_MAX_LENGTH_SEARCH_TERM'
|
|
|
4455
4499
|
function searchTermFactory(searchService, minLengthSearchTerm, maxLengthSearchTerm) {
|
|
4456
4500
|
return searchService
|
|
4457
4501
|
.getSearchTermChange$()
|
|
4458
|
-
.pipe(map((searchTerm) => (searchTerm && searchTerm.length >= minLengthSearchTerm && searchTerm.length <= maxLengthSearchTerm ? searchTerm : '')));
|
|
4502
|
+
.pipe(map$1((searchTerm) => (searchTerm && searchTerm.length >= minLengthSearchTerm && searchTerm.length <= maxLengthSearchTerm ? searchTerm : '')));
|
|
4459
4503
|
}
|
|
4460
4504
|
/**
|
|
4461
4505
|
* Провайдеры данных о поиске введенного терма.
|
|
@@ -4482,7 +4526,7 @@ const SC_VIRTUAL_CATEGORY_INFO = new InjectionToken('A stream with current virtu
|
|
|
4482
4526
|
* @param catalogService Сервис для работы с каталогом.
|
|
4483
4527
|
*/
|
|
4484
4528
|
function virtualCategoryFactory({ paramMap }, catalogService) {
|
|
4485
|
-
return paramMap.pipe(map((params) => params.get('categorySlug')), filter(tuiIsPresent), switchMap((categorySlug) => catalogService.getVirtualCategoryCached$(categorySlug).pipe(shareReplay())), takeUntilDestroyed());
|
|
4529
|
+
return paramMap.pipe(map$1((params) => params.get('categorySlug')), filter(tuiIsPresent), switchMap((categorySlug) => catalogService.getVirtualCategoryCached$(categorySlug).pipe(shareReplay())), takeUntilDestroyed());
|
|
4486
4530
|
}
|
|
4487
4531
|
/**
|
|
4488
4532
|
* Провайдеры потока данных о виртуальной категории.
|
|
@@ -4538,17 +4582,17 @@ class ScUTMService {
|
|
|
4538
4582
|
/**
|
|
4539
4583
|
* {@link Observable} UTM-метка страницы.
|
|
4540
4584
|
*/
|
|
4541
|
-
this.utm$ = inject(WA_STORAGE_EVENT).pipe(filterByKey('utm'), toValue(), startWith(this.getUTMParams()), map((utmString) => (utmString === null ? utmString : JSON.parse(utmString))));
|
|
4585
|
+
this.utm$ = inject(WA_STORAGE_EVENT).pipe(filterByKey('utm'), toValue(), startWith$1(this.getUTMParams()), map$1((utmString) => (utmString === null ? utmString : JSON.parse(utmString))));
|
|
4542
4586
|
/**
|
|
4543
4587
|
* {@link Observable} timestamp сохранения UTM в {@link Storage}.
|
|
4544
4588
|
*/
|
|
4545
|
-
this.utmTimestamp$ = inject(WA_STORAGE_EVENT).pipe(filterByKey('utmTimestamp'), toValue(), startWith(this.getUTMTimestamp()), map((timestamp) => (isString(timestamp) ? Number(timestamp) : timestamp)));
|
|
4589
|
+
this.utmTimestamp$ = inject(WA_STORAGE_EVENT).pipe(filterByKey('utmTimestamp'), toValue(), startWith$1(this.getUTMTimestamp()), map$1((timestamp) => (isString(timestamp) ? Number(timestamp) : timestamp)));
|
|
4546
4590
|
/**
|
|
4547
4591
|
* {@link Observable} UTM-метки страницы из параметров роутинга.
|
|
4548
4592
|
*/
|
|
4549
|
-
this.utmParamsFromRoute$ = this.router.events.pipe(filter((event) => Boolean(this.storage) && this.isBrowser && event instanceof NavigationEnd), map(() => this.activatedRoute), startWith(this.activatedRoute), map((route) => route.snapshot.queryParams),
|
|
4593
|
+
this.utmParamsFromRoute$ = this.router.events.pipe(filter((event) => Boolean(this.storage) && this.isBrowser && event instanceof NavigationEnd), map$1(() => this.activatedRoute), startWith$1(this.activatedRoute), map$1((route) => route.snapshot.queryParams),
|
|
4550
4594
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
4551
|
-
filter((params) => params['utm_source'] && params['utm_medium'] && params['utm_campaign']), map((params) => {
|
|
4595
|
+
filter((params) => params['utm_source'] && params['utm_medium'] && params['utm_campaign']), map$1((params) => {
|
|
4552
4596
|
return {
|
|
4553
4597
|
source: params.utm_source,
|
|
4554
4598
|
medium: params.utm_medium,
|
|
@@ -4604,7 +4648,7 @@ class ScUTMService {
|
|
|
4604
4648
|
return combineLatest({
|
|
4605
4649
|
utm: this.utm$,
|
|
4606
4650
|
timestamp: this.utmTimestamp$,
|
|
4607
|
-
}).pipe(map(({ utm, timestamp }) => (!this.utmLifeTime || (timestamp && timestamp + this.utmLifeTime > Date.now()) ? utm : null)));
|
|
4651
|
+
}).pipe(map$1(({ utm, timestamp }) => (!this.utmLifeTime || (timestamp && timestamp + this.utmLifeTime > Date.now()) ? utm : null)));
|
|
4608
4652
|
}
|
|
4609
4653
|
/**
|
|
4610
4654
|
* Возвращает {@link Observable} сохранения {@link ScUTM}.
|
|
@@ -4679,7 +4723,7 @@ class ScFeedbackService {
|
|
|
4679
4723
|
* @param feedbackMessage Объект сообщения обратной связи.
|
|
4680
4724
|
*/
|
|
4681
4725
|
sendFeedback(formSlug, feedbackMessage) {
|
|
4682
|
-
return this.utmService.getUTM$().pipe(first(), map((utm) => (utm ? { ...feedbackMessage, utm } : feedbackMessage)), switchMap((data) => this.http.post(`${this.feedbackApi.apiUrl}/feedback/${formSlug}`, data, {
|
|
4726
|
+
return this.utmService.getUTM$().pipe(first(), map$1((utm) => (utm ? { ...feedbackMessage, utm } : feedbackMessage)), switchMap((data) => this.http.post(`${this.feedbackApi.apiUrl}/feedback/${formSlug}`, data, {
|
|
4683
4727
|
context: new HttpContext().set(SC_AUTH_ADD_HEADER_REQUIRED, false).set(SC_IS_HEADER_REQUIRED, false),
|
|
4684
4728
|
headers: {
|
|
4685
4729
|
[this.feedbackApi.authTokenName]: this.feedbackApi.authToken,
|
|
@@ -4733,19 +4777,19 @@ class ScRequisitesService {
|
|
|
4733
4777
|
/**
|
|
4734
4778
|
* Создаёт запрос получения списка контактов для решения возникающих вопросов.
|
|
4735
4779
|
*/
|
|
4736
|
-
this.personal$ = this.contacts$.pipe(map((contacts) => contacts.personal));
|
|
4780
|
+
this.personal$ = this.contacts$.pipe(map$1((contacts) => contacts.personal));
|
|
4737
4781
|
/**
|
|
4738
4782
|
* Создаёт запрос получения списка контактов розничных магазинов.
|
|
4739
4783
|
*/
|
|
4740
|
-
this.retail$ = this.contacts$.pipe(map((contacts) => contacts.retail), first(), shareReplay(1));
|
|
4784
|
+
this.retail$ = this.contacts$.pipe(map$1((contacts) => contacts.retail), first(), shareReplay(1));
|
|
4741
4785
|
/**
|
|
4742
4786
|
* Создаёт запрос получения списка ссылок на социальные сети и другие каналы коммуникации.
|
|
4743
4787
|
*/
|
|
4744
|
-
this.socialMedia$ = this.contacts$.pipe(map((contacts) => contacts.socialMedia), first(), shareReplay(1));
|
|
4788
|
+
this.socialMedia$ = this.contacts$.pipe(map$1((contacts) => contacts.socialMedia), first(), shareReplay(1));
|
|
4745
4789
|
/**
|
|
4746
4790
|
* Создаёт запрос получения списка контактов менеджеров по направлениям продаж.
|
|
4747
4791
|
*/
|
|
4748
|
-
this.directions$ = this.contacts$.pipe(map((contacts) => contacts.directions), tap((directions) => {
|
|
4792
|
+
this.directions$ = this.contacts$.pipe(map$1((contacts) => contacts.directions), tap((directions) => {
|
|
4749
4793
|
// eslint-disable-next-line guard-for-in,no-restricted-syntax
|
|
4750
4794
|
for (const key in directions) {
|
|
4751
4795
|
directions[Number.parseFloat(key)]?.forEach((manager) => {
|
|
@@ -4877,7 +4921,7 @@ class ScContragentService {
|
|
|
4877
4921
|
/**
|
|
4878
4922
|
* {@link Observable} данных о контрагентах пользователя.
|
|
4879
4923
|
*/
|
|
4880
|
-
this.contragents$ = this.contragentsUpdate$.pipe(switchMap(() => this.user$), switchMap((user) => (user.isGuest ? of(null) : this.http.get(`${this.urls.apiUrl}/user/contragents`).pipe(startWith(null)))), shareReplay(1));
|
|
4924
|
+
this.contragents$ = this.contragentsUpdate$.pipe(switchMap(() => this.user$), switchMap((user) => (user.isGuest ? of(null) : this.http.get(`${this.urls.apiUrl}/user/contragents`).pipe(startWith$1(null)))), shareReplay(1));
|
|
4881
4925
|
this.user$.pipe(filter((user) => user.isGuest)).subscribe(() => {
|
|
4882
4926
|
this.contactsService.contragentContactsMap.clear();
|
|
4883
4927
|
this.contragentBankAccountsMap.clear();
|
|
@@ -4922,7 +4966,7 @@ class ScContragentService {
|
|
|
4922
4966
|
let cachedItem = this.contactsService.contragentContactsMap.get(contragentId);
|
|
4923
4967
|
if (!cachedItem) {
|
|
4924
4968
|
// Устанавливаем время жизни cachedItem равное, потому что нам не важно время жизни. Нам нужен функционал update() в будущем.
|
|
4925
|
-
cachedItem = new ScCachedItem(0, this.http.get(`${this.urls.apiUrl}/user/contragents/${contragentId}/contacts`).pipe(startWith(null)), null);
|
|
4969
|
+
cachedItem = new ScCachedItem(0, this.http.get(`${this.urls.apiUrl}/user/contragents/${contragentId}/contacts`).pipe(startWith$1(null)), null);
|
|
4926
4970
|
this.contactsService.contragentContactsMap.set(contragentId, cachedItem);
|
|
4927
4971
|
}
|
|
4928
4972
|
return cachedItem.item$;
|
|
@@ -4955,7 +4999,7 @@ class ScContragentService {
|
|
|
4955
4999
|
let cachedItem = this.contragentBankAccountsMap.get(contragentId);
|
|
4956
5000
|
if (!cachedItem) {
|
|
4957
5001
|
// Устанавливаем время жизни cachedItem равное, потому что нам не важно время жизни. Нам нужен функционал update().
|
|
4958
|
-
cachedItem = new ScCachedItem(0, this.http.get(`${this.urls.apiUrl}/user/contragents/${contragentId}/bank-accounts`).pipe(startWith(null)), null);
|
|
5002
|
+
cachedItem = new ScCachedItem(0, this.http.get(`${this.urls.apiUrl}/user/contragents/${contragentId}/bank-accounts`).pipe(startWith$1(null)), null);
|
|
4959
5003
|
this.contragentBankAccountsMap.set(contragentId, cachedItem);
|
|
4960
5004
|
}
|
|
4961
5005
|
return cachedItem.item$;
|
|
@@ -5025,7 +5069,7 @@ class ScDeliveryAddressService {
|
|
|
5025
5069
|
/**
|
|
5026
5070
|
* {@link Observable} данных адресов доставки.
|
|
5027
5071
|
*/
|
|
5028
|
-
this.deliveryAddresses$ = this.deliveryAddressesUpdate$.pipe(switchMap(() => this.user$), switchMap((user) => (user.isGuest ? of(null) : this.http.get(`${this.urls.apiUrl}/user/delivery-addresses`).pipe(startWith(null)))), shareReplay(1));
|
|
5072
|
+
this.deliveryAddresses$ = this.deliveryAddressesUpdate$.pipe(switchMap(() => this.user$), switchMap((user) => (user.isGuest ? of(null) : this.http.get(`${this.urls.apiUrl}/user/delivery-addresses`).pipe(startWith$1(null)))), shareReplay(1));
|
|
5029
5073
|
}
|
|
5030
5074
|
/**
|
|
5031
5075
|
* Создаёт запрос создания нового адреса доставки.
|
|
@@ -5069,7 +5113,7 @@ class ScDeliveryAddressService {
|
|
|
5069
5113
|
// Устанавливаем время жизни cachedItem равное, потому что нам не важно время жизни. Нам нужен функционал update().
|
|
5070
5114
|
cachedItem = new ScCachedItem(0, this.http
|
|
5071
5115
|
.get(`${this.urls.apiUrl}/user/delivery-addresses/${addressId}/contacts`)
|
|
5072
|
-
.pipe(startWith(null)), null);
|
|
5116
|
+
.pipe(startWith$1(null)), null);
|
|
5073
5117
|
this.contactsService.deliveryAddressContactsMap.set(addressId, cachedItem);
|
|
5074
5118
|
}
|
|
5075
5119
|
return cachedItem.item$;
|
|
@@ -5329,7 +5373,7 @@ class ScAuthAsClientGuard {
|
|
|
5329
5373
|
canActivate(route) {
|
|
5330
5374
|
const expiredAt = new Date();
|
|
5331
5375
|
expiredAt.setMinutes(new Date().getMinutes() + this.options.expiredAtMinute);
|
|
5332
|
-
return this.authService.getAuthChange().pipe(
|
|
5376
|
+
return this.authService.getAuthChange().pipe(take(1), defaultIfEmpty(false),
|
|
5333
5377
|
// Если пользователь авторизирован, то завершаем сеанс.
|
|
5334
5378
|
concatMap((state) => (state ? this.authService.getSignOut$(false) : of(null))),
|
|
5335
5379
|
// Обновляем полученные ключи, чтобы они перестали действовать. getRefreshTokenObservable() запишет новые ключи в систему, после чего проложение само запросит нового пользователя.
|
|
@@ -5342,7 +5386,7 @@ class ScAuthAsClientGuard {
|
|
|
5342
5386
|
token: route.paramMap.get('rtoken') ?? '',
|
|
5343
5387
|
expiredAt: expiredAt,
|
|
5344
5388
|
},
|
|
5345
|
-
})),
|
|
5389
|
+
})), take(1), defaultIfEmpty(null), map$1(() => this.router.createUrlTree(this.options.urlTree)));
|
|
5346
5390
|
}
|
|
5347
5391
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScAuthAsClientGuard, deps: [{ token: ScAuthService }, { token: i2.Router }, { token: SC_AUTH_AS_CLIENT_OPTIONS }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5348
5392
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScAuthAsClientGuard }); }
|
|
@@ -5371,14 +5415,14 @@ const ScIdOrSlugGuard = (route) => {
|
|
|
5371
5415
|
.getCategoryCached$(categoryIdOrSlug)
|
|
5372
5416
|
.pipe(filter(tuiIsPresent),
|
|
5373
5417
|
// eslint-disable-next-line security/detect-object-injection
|
|
5374
|
-
map((category) => router.createUrlTree(['/catalog', category[idOrSlug]])), catchError(() => of(TUI_TRUE_HANDLER())));
|
|
5418
|
+
map$1((category) => router.createUrlTree(['/catalog', category[idOrSlug]])), catchError$1(() => of(TUI_TRUE_HANDLER())));
|
|
5375
5419
|
}
|
|
5376
5420
|
if (productIdOrSlug && /^\d+$/.test(productIdOrSlug) !== (idOrSlug === 'id')) {
|
|
5377
5421
|
return inject(ScCatalogService)
|
|
5378
5422
|
.getProductData$(productIdOrSlug)
|
|
5379
5423
|
.pipe(filter(tuiIsPresent),
|
|
5380
5424
|
// eslint-disable-next-line security/detect-object-injection
|
|
5381
|
-
map((product) => router.createUrlTree(['/catalog', 'product', product[idOrSlug]])), catchError(() => of(TUI_TRUE_HANDLER())));
|
|
5425
|
+
map$1((product) => router.createUrlTree(['/catalog', 'product', product[idOrSlug]])), catchError$1(() => of(TUI_TRUE_HANDLER())));
|
|
5382
5426
|
}
|
|
5383
5427
|
return true;
|
|
5384
5428
|
};
|
|
@@ -5515,14 +5559,14 @@ class ScConvertInterceptor {
|
|
|
5515
5559
|
if (request.responseType !== 'json' || !request.url.includes(this.urls.apiUrl)) {
|
|
5516
5560
|
return next.handle(request);
|
|
5517
5561
|
}
|
|
5518
|
-
return next.handle(request.clone({ params: this.httpParamsToSnake(request.params), body: objectToSnake(request.body) })).pipe(map((event) => {
|
|
5562
|
+
return next.handle(request.clone({ params: this.httpParamsToSnake(request.params), body: objectToSnake(request.body) })).pipe(map$1((event) => {
|
|
5519
5563
|
if (event instanceof HttpResponse) {
|
|
5520
5564
|
return event.clone({
|
|
5521
5565
|
body: objectToCamel(event.body),
|
|
5522
5566
|
});
|
|
5523
5567
|
}
|
|
5524
5568
|
return event;
|
|
5525
|
-
}), catchError((error) => throwError(() => new HttpErrorResponse({
|
|
5569
|
+
}), catchError$1((error) => throwError(() => new HttpErrorResponse({
|
|
5526
5570
|
error: objectToCamel(error.error),
|
|
5527
5571
|
headers: error.headers,
|
|
5528
5572
|
status: error.status,
|
|
@@ -5577,7 +5621,7 @@ class ScErrorsInterceptor {
|
|
|
5577
5621
|
/** @inheritDoc */
|
|
5578
5622
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5579
5623
|
intercept(request, next) {
|
|
5580
|
-
return next.handle(request).pipe(catchError((error) => {
|
|
5624
|
+
return next.handle(request).pipe(catchError$1((error) => {
|
|
5581
5625
|
// TODO: TASK[#4511]: Обработка и вывод ошибок работы с API.
|
|
5582
5626
|
// eslint-disable-next-line sonarjs/no-small-switch
|
|
5583
5627
|
switch (error.status) {
|
|
@@ -5614,7 +5658,7 @@ class ScErrorsInterceptor {
|
|
|
5614
5658
|
return this.authService.getRefreshToken$().pipe(switchMap(() => {
|
|
5615
5659
|
this.isTokenRefreshing$.next(false);
|
|
5616
5660
|
return next.handle(request.clone(this.tokenService.addAuthHeader(request)));
|
|
5617
|
-
}), catchError((error) => {
|
|
5661
|
+
}), catchError$1((error) => {
|
|
5618
5662
|
if (error.status === 401) {
|
|
5619
5663
|
this.tokenService.removeAuthToken();
|
|
5620
5664
|
return of();
|
|
@@ -5720,7 +5764,7 @@ class ScDateFormatInterceptor {
|
|
|
5720
5764
|
}
|
|
5721
5765
|
/** @inheritDoc */
|
|
5722
5766
|
intercept(request, next) {
|
|
5723
|
-
return next.handle(request).pipe(catchError((error) => {
|
|
5767
|
+
return next.handle(request).pipe(catchError$1((error) => {
|
|
5724
5768
|
const errorData = error.error;
|
|
5725
5769
|
this.formatDatesInErrors(errorData);
|
|
5726
5770
|
return throwError(() => error);
|
|
@@ -6123,7 +6167,7 @@ class ScNewsService {
|
|
|
6123
6167
|
* @param newsId Идентификатор новости.
|
|
6124
6168
|
*/
|
|
6125
6169
|
getNews$(newsId) {
|
|
6126
|
-
return this.http.get(`${this.urls.apiUrl}/news/${newsId}`).pipe(map((category) => new ScNews(category)));
|
|
6170
|
+
return this.http.get(`${this.urls.apiUrl}/news/${newsId}`).pipe(map$1((category) => new ScNews(category)));
|
|
6127
6171
|
}
|
|
6128
6172
|
/**
|
|
6129
6173
|
* Возвращает {@link Observable} получения списка последних новостей.
|
|
@@ -6705,7 +6749,7 @@ class ScOrderDraftsService {
|
|
|
6705
6749
|
* @param params Параметры запроса получения списка.
|
|
6706
6750
|
*/
|
|
6707
6751
|
getList$(params) {
|
|
6708
|
-
return this.http.get(`${this.urls.apiUrl}/orders/offers`, { params: params }).pipe(map((offersPaginateDTO) => {
|
|
6752
|
+
return this.http.get(`${this.urls.apiUrl}/orders/offers`, { params: params }).pipe(map$1((offersPaginateDTO) => {
|
|
6709
6753
|
offersPaginateDTO.data = offersPaginateDTO.data.map((item) => new ScOrderDraftShort(item));
|
|
6710
6754
|
return offersPaginateDTO;
|
|
6711
6755
|
}));
|
|
@@ -6716,7 +6760,7 @@ class ScOrderDraftsService {
|
|
|
6716
6760
|
* @param data Данные для создания.
|
|
6717
6761
|
*/
|
|
6718
6762
|
create$(data) {
|
|
6719
|
-
return this.http.post(`${this.urls.apiUrl}/orders/offers`, data).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6763
|
+
return this.http.post(`${this.urls.apiUrl}/orders/offers`, data).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6720
6764
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
6721
6765
|
target: ScUserMetrikaGoalsEnum.orderDraftCreated,
|
|
6722
6766
|
params: { offer_id: offer.id },
|
|
@@ -6734,7 +6778,7 @@ class ScOrderDraftsService {
|
|
|
6734
6778
|
get$(draftId, cacheable = true) {
|
|
6735
6779
|
let cachedItem = this.offerMap.get(draftId);
|
|
6736
6780
|
if (!cachedItem) {
|
|
6737
|
-
cachedItem = new ScCachedItem(this.updateInterval.orderData, this.http.get(`${this.urls.apiUrl}/orders/offers/${draftId}`).pipe(map((data) => new ScOrderDraft(data))), loadingPlaceholder);
|
|
6781
|
+
cachedItem = new ScCachedItem(this.updateInterval.orderData, this.http.get(`${this.urls.apiUrl}/orders/offers/${draftId}`).pipe(map$1((data) => new ScOrderDraft(data))), loadingPlaceholder);
|
|
6738
6782
|
if (cacheable) {
|
|
6739
6783
|
this.offerMap.set(draftId, cachedItem);
|
|
6740
6784
|
}
|
|
@@ -6750,7 +6794,7 @@ class ScOrderDraftsService {
|
|
|
6750
6794
|
* @param id Идентификатор коммерческого предложения/черновика.
|
|
6751
6795
|
*/
|
|
6752
6796
|
getItems$(id) {
|
|
6753
|
-
return this.get$(id).pipe(map((draft) => (draft === loadingPlaceholder ? loadingPlaceholder : draft.products)));
|
|
6797
|
+
return this.get$(id).pipe(map$1((draft) => (draft === loadingPlaceholder ? loadingPlaceholder : draft.products)));
|
|
6754
6798
|
}
|
|
6755
6799
|
/**
|
|
6756
6800
|
* Обновляет данные коммерческого предложения/черновика.
|
|
@@ -6760,7 +6804,7 @@ class ScOrderDraftsService {
|
|
|
6760
6804
|
*/
|
|
6761
6805
|
update$(draftId, patch) {
|
|
6762
6806
|
const cachedItem = this.offerMap.get(draftId);
|
|
6763
|
-
return this.http.patch(`${this.urls.apiUrl}/orders/offers/${draftId}`, patch).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6807
|
+
return this.http.patch(`${this.urls.apiUrl}/orders/offers/${draftId}`, patch).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6764
6808
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
6765
6809
|
target: ScUserMetrikaGoalsEnum.orderDraftUpdated,
|
|
6766
6810
|
params: { offer_id: draftId },
|
|
@@ -6789,7 +6833,7 @@ class ScOrderDraftsService {
|
|
|
6789
6833
|
* @param data Данные заказа.
|
|
6790
6834
|
*/
|
|
6791
6835
|
createOrder$(offerId, data) {
|
|
6792
|
-
return this.http.post(`${this.urls.apiUrl}/orders/offers/${offerId}/create-order`, data).pipe(map((orders) => orders.map((item) => new ScOrderShort(item))), tap((orders) => {
|
|
6836
|
+
return this.http.post(`${this.urls.apiUrl}/orders/offers/${offerId}/create-order`, data).pipe(map$1((orders) => orders.map((item) => new ScOrderShort(item))), tap((orders) => {
|
|
6793
6837
|
orders.forEach((order) => {
|
|
6794
6838
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
6795
6839
|
target: ScUserMetrikaGoalsEnum.orderCreatedFromDraft,
|
|
@@ -6806,7 +6850,7 @@ class ScOrderDraftsService {
|
|
|
6806
6850
|
* @param offerId Идентификатор коммерческого предложения/черновика.
|
|
6807
6851
|
*/
|
|
6808
6852
|
addProduct$(productData, offerId) {
|
|
6809
|
-
return this.http.post(`${this.urls.apiUrl}/orders/offers/${offerId}/products`, productData).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6853
|
+
return this.http.post(`${this.urls.apiUrl}/orders/offers/${offerId}/products`, productData).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6810
6854
|
if (this.offerMap.has(offerId)) {
|
|
6811
6855
|
this.offerMap.get(offerId)?.setValue(offer);
|
|
6812
6856
|
}
|
|
@@ -6820,7 +6864,7 @@ class ScOrderDraftsService {
|
|
|
6820
6864
|
* @param offerId Идентификатор коммерческого предложения/черновика.
|
|
6821
6865
|
*/
|
|
6822
6866
|
updateProduct$(productId, patch, offerId) {
|
|
6823
|
-
return this.http.patch(`${this.urls.apiUrl}/orders/offers/${offerId}/products/${productId}`, patch).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6867
|
+
return this.http.patch(`${this.urls.apiUrl}/orders/offers/${offerId}/products/${productId}`, patch).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6824
6868
|
if (this.offerMap.has(offerId)) {
|
|
6825
6869
|
this.offerMap.get(offerId)?.setValue(offer);
|
|
6826
6870
|
}
|
|
@@ -6833,7 +6877,7 @@ class ScOrderDraftsService {
|
|
|
6833
6877
|
* @param offerId Идентификатор коммерческого предложения/черновика.
|
|
6834
6878
|
*/
|
|
6835
6879
|
deleteProduct$(item, offerId) {
|
|
6836
|
-
return this.http.delete(`${this.urls.apiUrl}/orders/offers/${offerId}/products/${item.id}`).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6880
|
+
return this.http.delete(`${this.urls.apiUrl}/orders/offers/${offerId}/products/${item.id}`).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6837
6881
|
if (this.offerMap.has(offerId)) {
|
|
6838
6882
|
this.offerMap.get(offerId)?.setValue(offer);
|
|
6839
6883
|
}
|
|
@@ -6905,7 +6949,7 @@ class ScOrdersService {
|
|
|
6905
6949
|
* @param newOrder Данные нового заказа.
|
|
6906
6950
|
*/
|
|
6907
6951
|
createOrder$(directionId, newOrder) {
|
|
6908
|
-
return this.http.post(`${this.urls.apiUrl}/orders/${directionId}`, newOrder).pipe(map((orders) => orders.map((item) => new ScOrderShort(item))), tap((orders) => {
|
|
6952
|
+
return this.http.post(`${this.urls.apiUrl}/orders/${directionId}`, newOrder).pipe(map$1((orders) => orders.map((item) => new ScOrderShort(item))), tap((orders) => {
|
|
6909
6953
|
orders.forEach((order) => {
|
|
6910
6954
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
6911
6955
|
target: ScUserMetrikaGoalsEnum.orderCreated,
|
|
@@ -6938,7 +6982,7 @@ class ScOrdersService {
|
|
|
6938
6982
|
* @param params Параметры запроса получения заказов.
|
|
6939
6983
|
*/
|
|
6940
6984
|
getOrders$(params) {
|
|
6941
|
-
return this.http.get(`${this.urls.apiUrl}/orders`, { params: params }).pipe(map((ordersPaginateDTO) => {
|
|
6985
|
+
return this.http.get(`${this.urls.apiUrl}/orders`, { params: params }).pipe(map$1((ordersPaginateDTO) => {
|
|
6942
6986
|
ordersPaginateDTO.data = ordersPaginateDTO.data.map((item) => new ScOrderShort(item));
|
|
6943
6987
|
return ordersPaginateDTO;
|
|
6944
6988
|
}));
|
|
@@ -6952,7 +6996,7 @@ class ScOrdersService {
|
|
|
6952
6996
|
get$(orderId, cacheable = true) {
|
|
6953
6997
|
let cachedItem = this.orderMap.get(orderId);
|
|
6954
6998
|
if (!cachedItem) {
|
|
6955
|
-
cachedItem = new ScCachedItem(this.updateInterval.orderData, this.http.get(`${this.urls.apiUrl}/orders/${orderId}`).pipe(map((data) => new ScOrder(data))), loadingPlaceholder);
|
|
6999
|
+
cachedItem = new ScCachedItem(this.updateInterval.orderData, this.http.get(`${this.urls.apiUrl}/orders/${orderId}`).pipe(map$1((data) => new ScOrder(data))), loadingPlaceholder);
|
|
6956
7000
|
if (cacheable) {
|
|
6957
7001
|
this.orderMap.set(orderId, cachedItem);
|
|
6958
7002
|
}
|
|
@@ -6969,7 +7013,7 @@ class ScOrdersService {
|
|
|
6969
7013
|
* @param cacheable Признак возможности получения списка элементов заказа из кэшированных данных.
|
|
6970
7014
|
*/
|
|
6971
7015
|
getItems$(id, cacheable = true) {
|
|
6972
|
-
return this.get$(id, cacheable).pipe(map((order) => (order === loadingPlaceholder ? loadingPlaceholder : order.products)));
|
|
7016
|
+
return this.get$(id, cacheable).pipe(map$1((order) => (order === loadingPlaceholder ? loadingPlaceholder : order.products)));
|
|
6973
7017
|
}
|
|
6974
7018
|
/**
|
|
6975
7019
|
* Копирует товары заказа в корзину текущего пользователя.
|
|
@@ -6999,7 +7043,7 @@ class ScOrdersService {
|
|
|
6999
7043
|
status,
|
|
7000
7044
|
statusDetail,
|
|
7001
7045
|
})
|
|
7002
|
-
.pipe(map((dto) => new ScOrder(dto)), tap((order) => {
|
|
7046
|
+
.pipe(map$1((dto) => new ScOrder(dto)), tap((order) => {
|
|
7003
7047
|
this.syncOrderCache(orderId, order);
|
|
7004
7048
|
}));
|
|
7005
7049
|
}
|
|
@@ -7026,7 +7070,7 @@ class ScOrdersService {
|
|
|
7026
7070
|
date: date,
|
|
7027
7071
|
},
|
|
7028
7072
|
})
|
|
7029
|
-
.pipe(map((ordersPaginateDTO) => {
|
|
7073
|
+
.pipe(map$1((ordersPaginateDTO) => {
|
|
7030
7074
|
const formattedDate = format(parse(date, this.dateFormats.api, new Date()), this.dateFormats.uiDate);
|
|
7031
7075
|
return new ScDeliveryCost(ordersPaginateDTO, formattedDate);
|
|
7032
7076
|
}));
|
|
@@ -7076,7 +7120,7 @@ class ScPaginationService {
|
|
|
7076
7120
|
/**
|
|
7077
7121
|
* {@link Observable} изменения статуса аутентификации.
|
|
7078
7122
|
*/
|
|
7079
|
-
this.authStatus$ = inject(SC_USER_INFO).pipe(map((user) => user.isGuest));
|
|
7123
|
+
this.authStatus$ = inject(SC_USER_INFO).pipe(map$1((user) => user.isGuest));
|
|
7080
7124
|
/**
|
|
7081
7125
|
* Сервис работы с каталогом.
|
|
7082
7126
|
*/
|
|
@@ -7088,18 +7132,18 @@ class ScPaginationService {
|
|
|
7088
7132
|
// Избегаем множественных сигналов при одновременном изменении фильтров page$ и others$.
|
|
7089
7133
|
debounceTime(0),
|
|
7090
7134
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
7091
|
-
map((page) => ({ ...params, ...page })),
|
|
7135
|
+
map$1((page) => ({ ...params, ...page })),
|
|
7092
7136
|
// TODO: Заменить this.catalogService.getProducts$ на абстрактный метод сервиса по примеру `TuiTreeLoader`.
|
|
7093
|
-
switchMap((paginationParams) => this.authStatus$.pipe(switchMap(() => this.catalogService.getProducts$(paginationParams).pipe(startWith(null))))))), share());
|
|
7137
|
+
switchMap((paginationParams) => this.authStatus$.pipe(switchMap(() => this.catalogService.getProducts$(paginationParams).pipe(startWith$1(null))))))), share());
|
|
7094
7138
|
/**
|
|
7095
7139
|
* Объект данных пагинации с сохранением предыдущих значений для "разворачивания" списка товаров.
|
|
7096
7140
|
* Список сохраняется при переходе по страницам, до тех пор пока не будет получен сигнал `others$`.
|
|
7097
7141
|
*/
|
|
7098
|
-
this.dataAccumulated$ = this.others$.pipe(filter(tuiIsPresent), switchMap((params) => this.authStatus$.pipe(map(() => params))), switchMap((params) => this.page$.pipe(
|
|
7142
|
+
this.dataAccumulated$ = this.others$.pipe(filter(tuiIsPresent), switchMap((params) => this.authStatus$.pipe(map$1(() => params))), switchMap((params) => this.page$.pipe(
|
|
7099
7143
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
|
|
7100
|
-
map((page) => ({ ...params, ...page })),
|
|
7144
|
+
map$1((page) => ({ ...params, ...page })),
|
|
7101
7145
|
// TODO: Заменить this.catalogService.getProducts$ на абстрактный метод сервиса по примеру `TuiTreeLoader`.
|
|
7102
|
-
concatMap((paginationParams) => this.catalogService.getProducts$(paginationParams).pipe(startWith(null))),
|
|
7146
|
+
concatMap((paginationParams) => this.catalogService.getProducts$(paginationParams).pipe(startWith$1(null))),
|
|
7103
7147
|
// TODO: Заменить `ScProduct` на T тип.
|
|
7104
7148
|
scan(
|
|
7105
7149
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -7111,9 +7155,9 @@ class ScPaginationService {
|
|
|
7111
7155
|
value.data.unshift(...accumulator.data);
|
|
7112
7156
|
}
|
|
7113
7157
|
return [value, value];
|
|
7114
|
-
}, [null, null]), map(([paginate]) => paginate), takeWhile((paginate) => paginate === null || paginate.meta.currentPage < paginate.meta.lastPage, true))), share());
|
|
7158
|
+
}, [null, null]), map$1(([paginate]) => paginate), takeWhile((paginate) => paginate === null || paginate.meta.currentPage < paginate.meta.lastPage, true))), share());
|
|
7115
7159
|
this.others$
|
|
7116
|
-
.pipe(filter(tuiIsPresent), switchMap(() => this.nextPageClickEvent.pipe(scan((accumulator) => accumulator + 1, 1), startWith(1))), takeUntilDestroyed())
|
|
7160
|
+
.pipe(filter(tuiIsPresent), switchMap(() => this.nextPageClickEvent.pipe(scan((accumulator) => accumulator + 1, 1), startWith$1(1))), takeUntilDestroyed())
|
|
7117
7161
|
.subscribe((page) => {
|
|
7118
7162
|
this.patchPage({ page: page });
|
|
7119
7163
|
});
|
|
@@ -7346,7 +7390,7 @@ class ScReclamationService {
|
|
|
7346
7390
|
downloadReclamation$(reclamationId) {
|
|
7347
7391
|
return this.http
|
|
7348
7392
|
.get(`${this.urls.apiUrl}/reclamations/${reclamationId}/download`, { responseType: 'blob' })
|
|
7349
|
-
.pipe(map((reclamation) => new Blob([reclamation], { type: 'application/pdf' })));
|
|
7393
|
+
.pipe(map$1((reclamation) => new Blob([reclamation], { type: 'application/pdf' })));
|
|
7350
7394
|
}
|
|
7351
7395
|
/**
|
|
7352
7396
|
* Отправляет новое сообщение рекламации.
|
|
@@ -8105,7 +8149,7 @@ class ScVacanciesService {
|
|
|
8105
8149
|
.get(`${this.vacanciesData.apiUrl}?employer_id=${this.vacanciesData.employerId}&per_page=${perPage}&page=${page}`, {
|
|
8106
8150
|
context: new HttpContext().set(SC_IS_HEADER_REQUIRED, false).set(SC_CACHE_SETTINGS, new ScCacheSettings(true, this.cacheLifeTime.vacanciesData)),
|
|
8107
8151
|
})
|
|
8108
|
-
.pipe(map((result) => new ScVacanciesList(result)));
|
|
8152
|
+
.pipe(map$1((result) => new ScVacanciesList(result)));
|
|
8109
8153
|
}
|
|
8110
8154
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScVacanciesService, deps: [{ token: i1$1.HttpClient }, { token: SC_VACANCIES_DATA_SOURCE }, { token: SC_CACHE_LIFETIME }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
8111
8155
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScVacanciesService, providedIn: 'root' }); }
|
|
@@ -8289,5 +8333,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
8289
8333
|
* Generated bundle index. Do not edit.
|
|
8290
8334
|
*/
|
|
8291
8335
|
|
|
8292
|
-
export { CATEGORY_PROVIDERS, EMPTY_CART, IS_BROWSER, IS_RUNNING_ON_TERMINAL, IS_SERVER, RESPONSE, SC_ACCESS_AUTH_TOKEN_STORAGE_KEY, SC_API_KEYS, SC_AUTH_ADD_HEADER_REQUIRED, SC_AUTH_AS_CLIENT_DEFAULT_OPTIONS, SC_AUTH_AS_CLIENT_OPTIONS, SC_CACHE_LIFETIME, SC_CACHE_SETTINGS, SC_CATALOG_ITEM_PAGE_META, SC_CATALOG_ROOT_PAGE_META, SC_CATEGORY_INFO, SC_COMPANY_INFO, SC_COMPANY_NAME, SC_CONFIGURATOR_COMPONENTS, SC_CONFIGURATOR_SETTINGS, SC_COUNT_FIRST_DISCOUNTED_PRODUCTS, SC_COUNT_LAST_NEWS, SC_DATE_FORMAT, SC_DEFAULT_PAGE_META, SC_FEEDBACK_API, SC_GUEST_ENDPOINTS_TOKEN, SC_GUEST_PARAMETER_NAME_TOKEN, SC_GUEST_TOKEN_STORAGE_KEY, SC_ID_OR_SLUG_IN_ROUTE, SC_IS_HEADER_REQUIRED, SC_IS_HIDDEN_ERROR_ALERT, SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT, SC_IS_LOGOUT_REQUEST, SC_IS_REFRESH_REQUIRED, SC_LINEAR_VALUES, SC_LINEAR_VALUES_TOKEN, SC_MAX_LENGTH_SEARCH_TERM, SC_MIN_LENGTH_SEARCH_TERM, SC_NEXT_PAGE_PAGINATION_CLICK, SC_ORDER_LOADER, SC_ORDER_LOADING, SC_PATH_IMAGE_NOT_FOUND, SC_PRODUCT_PAGINATION_DEFAULT_OPTIONS, SC_PRODUCT_PAGINATION_OPTIONS, SC_REFRESH_AUTH_TOKEN_STORAGE_KEY, SC_RELEASE, SC_UPDATE_INTERVAL, SC_URLS, SC_USER_INFO, SC_VACANCIES_DATA_SOURCE, SC_VIRTUAL_CATEGORY_INFO, SC_VIRTUAL_CATEGORY_PROVIDERS, SEARCH_TERM, SEARCH_TERM_PROVIDERS, ScAuthAsClientGuard, ScAuthInterceptor, ScAuthService, ScBanner, ScBannerService, ScCacheInterceptor, ScCacheSettings, ScCachedData, ScCachedItem, ScCart, ScCartService, ScCatalogFilterService, ScCatalogFormat, ScCatalogItem, ScCatalogService, ScCatalogableItem, ScCategory, ScClientType, ScCodedIdentity, ScConfiguratorService, ScContactsService, ScContragentService, ScConvertInterceptor, ScConvertersService, ScDateFormatInterceptor, ScDeletableNamedIdentity, ScDeliveryAddressService, ScDeliveryCost, ScDeliveryType, ScDocumentInfoNode, ScDocumentInfoTypesEnum, ScErrorsInterceptor, ScFavoriteService, ScFeedbackForms, ScFeedbackService, ScFilesService, ScFrequentlyAskedQuestionsService, ScGuestInterceptor, ScHiddenCatalogableItem, ScIBreadcrumbItem, ScISuggestionType, ScIconTypesEnum, ScIdOrSlugGuard, ScIdOrSlugPipe, ScIdentity, ScImage, ScImageHelper, ScLocationsService, ScMediaImageTransformerPipe, ScMimeTypes, ScNamedIdentity, ScNews, ScNewsService, ScNotificationActionTypes, ScNotificationLevelNames, ScNotificationsService, ScOpfList, ScOptionsInterceptor, ScOrder, ScOrderBase, ScOrderDraft, ScOrderDraftShort, ScOrderDraftType, ScOrderDraftsService, ScOrderItem, ScOrderShort, ScOrderStateStatus, ScOrdersService, ScPaginationService, ScPaymentStatus, ScPaymentType, ScPhoneService, ScPrimaryCatalogableItem, ScProduct, ScProductTileType, ScQuestionnaireService, ScQuestionnaireStatusEnum, ScReclamationService, ScReclamationStatus, ScRecommendationService, ScReference, ScReferenceName, ScReferencesService, ScRequisitesService, ScRouteKeys, ScSearchService, ScSeoService, ScSocialType, ScSuggestionService, ScSum, ScTokenService, ScUIService, ScUTMService, ScUnitsHelper, ScUpdatableNamedIdentity, ScUploadedFile, ScUser, ScUserMetadata, ScUserMetrikaGoalsEnum, ScUserMetrikaService, ScUserService, ScUserType, ScVCardService, ScVacanciesList, ScVacanciesService, ScVacancy, ScVerificationService, ScVirtualCategory, ScWarehouseService, SchemaOrgFactory, TERMINAL_PROVIDERS, USER_AGENT_TERMINAL, filterChangedByKey, loadingPlaceholder, runningOnTerminalFactory, scGetCurrentRoute, scOrderIsLoaded, searchTermFactory };
|
|
8336
|
+
export { CATEGORY_PROVIDERS, EMPTY_CART, IS_BROWSER, IS_RUNNING_ON_TERMINAL, IS_SERVER, RESPONSE, SC_ACCESS_AUTH_TOKEN_STORAGE_KEY, SC_API_KEYS, SC_AUTH_ADD_HEADER_REQUIRED, SC_AUTH_AS_CLIENT_DEFAULT_OPTIONS, SC_AUTH_AS_CLIENT_OPTIONS, SC_CACHE_LIFETIME, SC_CACHE_SETTINGS, SC_CATALOG_ITEM_PAGE_META, SC_CATALOG_ROOT_PAGE_META, SC_CATEGORY_INFO, SC_COMPANY_INFO, SC_COMPANY_NAME, SC_CONFIGURATOR_COMPONENTS, SC_CONFIGURATOR_SETTINGS, SC_COUNT_FIRST_DISCOUNTED_PRODUCTS, SC_COUNT_LAST_NEWS, SC_DATE_FORMAT, SC_DEFAULT_PAGE_META, SC_FEEDBACK_API, SC_GUEST_ENDPOINTS_TOKEN, SC_GUEST_PARAMETER_NAME_TOKEN, SC_GUEST_TOKEN_STORAGE_KEY, SC_ID_OR_SLUG_IN_ROUTE, SC_IS_HEADER_REQUIRED, SC_IS_HIDDEN_ERROR_ALERT, SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT, SC_IS_LOGOUT_REQUEST, SC_IS_REFRESH_REQUIRED, SC_LINEAR_VALUES, SC_LINEAR_VALUES_TOKEN, SC_MAX_LENGTH_SEARCH_TERM, SC_MIN_LENGTH_SEARCH_TERM, SC_NEXT_PAGE_PAGINATION_CLICK, SC_ORDER_LOADER, SC_ORDER_LOADING, SC_PATH_IMAGE_NOT_FOUND, SC_PRODUCT_PAGINATION_DEFAULT_OPTIONS, SC_PRODUCT_PAGINATION_OPTIONS, SC_REFRESH_AUTH_TOKEN_STORAGE_KEY, SC_RELEASE, SC_UPDATE_INTERVAL, SC_URLS, SC_USER_INFO, SC_VACANCIES_DATA_SOURCE, SC_VIRTUAL_CATEGORY_INFO, SC_VIRTUAL_CATEGORY_PROVIDERS, SEARCH_TERM, SEARCH_TERM_PROVIDERS, ScAuthAsClientGuard, ScAuthInterceptor, ScAuthService, ScBanner, ScBannerService, ScCacheInterceptor, ScCacheSettings, ScCachedData, ScCachedItem, ScCart, ScCartService, ScCatalogFilterService, ScCatalogFormat, ScCatalogItem, ScCatalogService, ScCatalogableItem, ScCategory, ScClientType, ScCodedIdentity, ScConfiguratorService, ScContactsService, ScContragentService, ScConvertInterceptor, ScConvertersService, ScDateFormatInterceptor, ScDeletableNamedIdentity, ScDeliveryAddressService, ScDeliveryCost, ScDeliveryType, ScDocumentInfoNode, ScDocumentInfoTypesEnum, ScErrorRequestState, ScErrorsInterceptor, ScFavoriteService, ScFeedbackForms, ScFeedbackService, ScFilesService, ScFrequentlyAskedQuestionsService, ScGuestInterceptor, ScHiddenCatalogableItem, ScIBreadcrumbItem, ScISuggestionType, ScIconTypesEnum, ScIdOrSlugGuard, ScIdOrSlugPipe, ScIdentity, ScImage, ScImageHelper, ScLoadingRequestState, ScLocationsService, ScMediaImageTransformerPipe, ScMimeTypes, ScNamedIdentity, ScNews, ScNewsService, ScNotificationActionTypes, ScNotificationLevelNames, ScNotificationsService, ScOpfList, ScOptionsInterceptor, ScOrder, ScOrderBase, ScOrderDraft, ScOrderDraftShort, ScOrderDraftType, ScOrderDraftsService, ScOrderItem, ScOrderShort, ScOrderStateStatus, ScOrdersService, ScPaginationService, ScPaymentStatus, ScPaymentType, ScPhoneService, ScPrimaryCatalogableItem, ScProduct, ScProductTileType, ScQuestionnaireService, ScQuestionnaireStatusEnum, ScReclamationService, ScReclamationStatus, ScRecommendationService, ScReference, ScReferenceName, ScReferencesService, ScRequestStateStatusEnum, ScRequisitesService, ScRouteKeys, ScSearchService, ScSeoService, ScSocialType, ScSuccessRequestState, ScSuggestionService, ScSum, ScTokenService, ScUIService, ScUTMService, ScUnitsHelper, ScUpdatableNamedIdentity, ScUploadedFile, ScUser, ScUserMetadata, ScUserMetrikaGoalsEnum, ScUserMetrikaService, ScUserService, ScUserType, ScVCardService, ScVacanciesList, ScVacanciesService, ScVacancy, ScVerificationService, ScVirtualCategory, ScWarehouseService, SchemaOrgFactory, TERMINAL_PROVIDERS, USER_AGENT_TERMINAL, filterChangedByKey, loadingPlaceholder, mapRequestStateToDataOrNull, mapToRequestState, runningOnTerminalFactory, scGetCurrentRoute, scOrderIsLoaded, searchTermFactory };
|
|
8293
8337
|
//# sourceMappingURL=snabcentr-client-core.mjs.map
|