@snabcentr/client-core 2.66.16 → 2.66.19
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/fesm2022/snabcentr-client-core.mjs +180 -120
- package/fesm2022/snabcentr-client-core.mjs.map +1 -1
- 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
|
getOrderStatusById$(statusId) {
|
|
2601
|
-
return this.orderStatuses$.pipe(map((types) => types.find((type) => type.id === statusId)));
|
|
2644
|
+
return this.orderStatuses$.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 statusId Идентификатор типа статуса.
|
|
2607
2650
|
*/
|
|
2608
2651
|
getReclamationStatusById$(statusId) {
|
|
2609
|
-
return this.reclamationStatuses$.pipe(map((types) => types.find((type) => type.id === statusId)));
|
|
2652
|
+
return this.reclamationStatuses$.pipe(map$1((types) => types.find((type) => type.id === statusId)));
|
|
2610
2653
|
}
|
|
2611
2654
|
/**
|
|
2612
2655
|
* Возвращает {@link Observable} тип оплаты, соответствующий идентификатору на входе.
|
|
@@ -2614,7 +2657,7 @@ class ScReferencesService {
|
|
|
2614
2657
|
* @param typeId Идентификатор типа оплаты.
|
|
2615
2658
|
*/
|
|
2616
2659
|
getPaymentTypeById$(typeId) {
|
|
2617
|
-
return this.paymentTypes$.pipe(map((types) => types.find((type) => type.id === typeId)));
|
|
2660
|
+
return this.paymentTypes$.pipe(map$1((types) => types.find((type) => type.id === typeId)));
|
|
2618
2661
|
}
|
|
2619
2662
|
/**
|
|
2620
2663
|
* Возвращает {@link Observable} организационно-правовой формы, соответствующий символьному обозначению (slug) на входе.
|
|
@@ -2622,7 +2665,7 @@ class ScReferencesService {
|
|
|
2622
2665
|
* @param slug Символьное обозначение (slug).
|
|
2623
2666
|
*/
|
|
2624
2667
|
getOpfBySlug$(slug) {
|
|
2625
|
-
return this.opf$.pipe(map((types) => types.find((type) => type.slug === slug)));
|
|
2668
|
+
return this.opf$.pipe(map$1((types) => types.find((type) => type.slug === slug)));
|
|
2626
2669
|
}
|
|
2627
2670
|
/**
|
|
2628
2671
|
* Возвращает {@link Observable} валюты, соответствующий идентификатору на входе.
|
|
@@ -2630,7 +2673,7 @@ class ScReferencesService {
|
|
|
2630
2673
|
* @param currencyId Идентификатор валюты.
|
|
2631
2674
|
*/
|
|
2632
2675
|
getCurrencyById$(currencyId) {
|
|
2633
|
-
return this.currencies$.pipe(map((types) => types.find((type) => type.id === currencyId)));
|
|
2676
|
+
return this.currencies$.pipe(map$1((types) => types.find((type) => type.id === currencyId)));
|
|
2634
2677
|
}
|
|
2635
2678
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScReferencesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2636
2679
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScReferencesService, providedIn: 'root' }); }
|
|
@@ -2673,7 +2716,7 @@ class ScWarehouseService {
|
|
|
2673
2716
|
*/
|
|
2674
2717
|
initSubscriptionOnUser() {
|
|
2675
2718
|
// Observable данных для обработки сигналов изменения пользователя.
|
|
2676
|
-
const data$ = this.warehouses$.pipe(switchMap((warehouses) => this.user$.pipe(map((user) => ({
|
|
2719
|
+
const data$ = this.warehouses$.pipe(switchMap((warehouses) => this.user$.pipe(map$1((user) => ({
|
|
2677
2720
|
warehouses: warehouses,
|
|
2678
2721
|
selectedIdMetadata: user.metadata.selectedWarehouseId,
|
|
2679
2722
|
city: user.city,
|
|
@@ -2684,7 +2727,7 @@ class ScWarehouseService {
|
|
|
2684
2727
|
data$
|
|
2685
2728
|
.pipe(
|
|
2686
2729
|
// eslint-disable-next-line unicorn/no-negation-in-equality-check
|
|
2687
|
-
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) => {
|
|
2730
|
+
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) => {
|
|
2688
2731
|
this.warehouseIdSelectSubject.next(selectedId);
|
|
2689
2732
|
}))
|
|
2690
2733
|
.subscribe();
|
|
@@ -2694,9 +2737,9 @@ class ScWarehouseService {
|
|
|
2694
2737
|
// eslint-disable-next-line unicorn/no-negation-in-equality-check
|
|
2695
2738
|
distinctUntilChanged((previous, current) => !previous.id !== !current.id || previous.city === current.city), skip(1), // distinctUntilChanged() всегда выдаёт первое значение, поэтому пропускаем его и реагируем только на изменение.
|
|
2696
2739
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
2697
|
-
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),
|
|
2740
|
+
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),
|
|
2698
2741
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2699
|
-
map((selectedId) => selectedId), tap((selectedId) => {
|
|
2742
|
+
map$1((selectedId) => selectedId), tap((selectedId) => {
|
|
2700
2743
|
this.setWarehouseIdSelectChange(selectedId);
|
|
2701
2744
|
}))
|
|
2702
2745
|
.subscribe();
|
|
@@ -2714,13 +2757,13 @@ class ScWarehouseService {
|
|
|
2714
2757
|
* Возвращает {@link Observable} выбранного склада.
|
|
2715
2758
|
*/
|
|
2716
2759
|
getWarehouseSelectChange$() {
|
|
2717
|
-
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));
|
|
2760
|
+
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));
|
|
2718
2761
|
}
|
|
2719
2762
|
/**
|
|
2720
2763
|
* Возвращает {@link Observable} склада для доставки.
|
|
2721
2764
|
*/
|
|
2722
2765
|
getDeliveryWarehouse$() {
|
|
2723
|
-
return this.warehouses$.pipe(map((warehouses) => warehouses.find((item) => item.isMain)), filter(tuiIsPresent));
|
|
2766
|
+
return this.warehouses$.pipe(map$1((warehouses) => warehouses.find((item) => item.isMain)), filter(tuiIsPresent));
|
|
2724
2767
|
}
|
|
2725
2768
|
/**
|
|
2726
2769
|
* Возвращает {@link Observable} склада в зависимости от того, где запущено приложение.
|
|
@@ -2729,7 +2772,7 @@ class ScWarehouseService {
|
|
|
2729
2772
|
* во всех остальных случаях возвращает основной склад.
|
|
2730
2773
|
*/
|
|
2731
2774
|
getCatalogWarehouseChange$() {
|
|
2732
|
-
return this.warehouses$.pipe(map((warehouses) => warehouses.find((w) => w.id === this.terminal.warehouseId) ?? warehouses.find((w) => w.isMain)), filter(tuiIsPresent));
|
|
2775
|
+
return this.warehouses$.pipe(map$1((warehouses) => warehouses.find((w) => w.id === this.terminal.warehouseId) ?? warehouses.find((w) => w.isMain)), filter(tuiIsPresent));
|
|
2733
2776
|
}
|
|
2734
2777
|
/**
|
|
2735
2778
|
* Возвращает {@link Observable} списка складов.
|
|
@@ -2803,9 +2846,9 @@ class ScCartService {
|
|
|
2803
2846
|
* Создаёт запрос получения содержимого корзины и обновляет корзину, возвращая {@link Observable} содержимого корзины.
|
|
2804
2847
|
*/
|
|
2805
2848
|
getCartData$() {
|
|
2806
|
-
return this.user$.pipe(first(), switchMap((user) => this.http.get(`${this.urls.apiUrl}/cart`).pipe(map((cartDTO) => new ScCart(cartDTO)),
|
|
2849
|
+
return this.user$.pipe(first(), switchMap((user) => this.http.get(`${this.urls.apiUrl}/cart`).pipe(map$1((cartDTO) => new ScCart(cartDTO)),
|
|
2807
2850
|
// TODO: Пересмотреть механизмы перехвата HTTP-ошибок 401/403/0 централизованно (с использованием interceptors).
|
|
2808
|
-
catchError((error) => {
|
|
2851
|
+
catchError$1((error) => {
|
|
2809
2852
|
if (user.isGuest && error instanceof HttpErrorResponse && [0, 401, 403].includes(error.status)) {
|
|
2810
2853
|
// Для гостя в неавторизованных/сетевых кейсах отдаём пустую корзину,
|
|
2811
2854
|
// чтобы не пробрасывать ошибку во все подписки UI.
|
|
@@ -2824,7 +2867,7 @@ class ScCartService {
|
|
|
2824
2867
|
* Возвращает список элементов корзины.
|
|
2825
2868
|
*/
|
|
2826
2869
|
getItems$() {
|
|
2827
|
-
return this.get$().pipe(map((cart) => (cart === loadingPlaceholder ? loadingPlaceholder : cart.items)));
|
|
2870
|
+
return this.get$().pipe(map$1((cart) => (cart === loadingPlaceholder ? loadingPlaceholder : cart.items)));
|
|
2828
2871
|
}
|
|
2829
2872
|
/**
|
|
2830
2873
|
* Добавляет продукт в корзину.
|
|
@@ -2832,7 +2875,7 @@ class ScCartService {
|
|
|
2832
2875
|
* @param data Данные добавляемого продукта.
|
|
2833
2876
|
*/
|
|
2834
2877
|
addProduct$(data) {
|
|
2835
|
-
return this.http.patch(`${this.urls.apiUrl}/cart`, data).pipe(map((cartDTO) => new ScCart(cartDTO)), tap(() => {
|
|
2878
|
+
return this.http.patch(`${this.urls.apiUrl}/cart`, data).pipe(map$1((cartDTO) => new ScCart(cartDTO)), tap(() => {
|
|
2836
2879
|
if (data.productId) {
|
|
2837
2880
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
2838
2881
|
target: ScUserMetrikaGoalsEnum.cartItemAdded,
|
|
@@ -2850,7 +2893,7 @@ class ScCartService {
|
|
|
2850
2893
|
* @param patch Частичные данные для обновления.
|
|
2851
2894
|
*/
|
|
2852
2895
|
updateProduct$(id, patch) {
|
|
2853
|
-
return this.http.patch(`${this.urls.apiUrl}/cart/${id}`, patch).pipe(map((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2896
|
+
return this.http.patch(`${this.urls.apiUrl}/cart/${id}`, patch).pipe(map$1((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2854
2897
|
this.cartCachedItem$.setValue(cart);
|
|
2855
2898
|
}));
|
|
2856
2899
|
}
|
|
@@ -2860,7 +2903,7 @@ class ScCartService {
|
|
|
2860
2903
|
* @param item Удаляемая позиция.
|
|
2861
2904
|
*/
|
|
2862
2905
|
deleteProduct$(item) {
|
|
2863
|
-
return this.http.delete(`${this.urls.apiUrl}/cart/${item.id}`).pipe(map((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2906
|
+
return this.http.delete(`${this.urls.apiUrl}/cart/${item.id}`).pipe(map$1((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2864
2907
|
this.cartCachedItem$.setValue(cart);
|
|
2865
2908
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
2866
2909
|
target: ScUserMetrikaGoalsEnum.cartItemDeleted,
|
|
@@ -2893,7 +2936,7 @@ class ScCartService {
|
|
|
2893
2936
|
* @deprecated
|
|
2894
2937
|
*/
|
|
2895
2938
|
getNullCartItems$() {
|
|
2896
|
-
return this.get$().pipe(map((cart) => (cart === loadingPlaceholder ? loadingPlaceholder : cart.items.filter((item) => item.product.isNull || item.product.isHidden))));
|
|
2939
|
+
return this.get$().pipe(map$1((cart) => (cart === loadingPlaceholder ? loadingPlaceholder : cart.items.filter((item) => item.product.isNull || item.product.isHidden))));
|
|
2897
2940
|
}
|
|
2898
2941
|
/**
|
|
2899
2942
|
* Возвращает объект {@link ScCart} корзины, созданный из объекта заказа.
|
|
@@ -2916,7 +2959,7 @@ class ScCartService {
|
|
|
2916
2959
|
.get(`${this.urls.apiUrl}/cart/csv/example`, {
|
|
2917
2960
|
responseType: 'blob',
|
|
2918
2961
|
})
|
|
2919
|
-
.pipe(map((blob) => new Blob([blob], { type: 'text/csv' })));
|
|
2962
|
+
.pipe(map$1((blob) => new Blob([blob], { type: 'text/csv' })));
|
|
2920
2963
|
}
|
|
2921
2964
|
/**
|
|
2922
2965
|
* Добавляет товары в корзину из файла CSV.
|
|
@@ -2924,7 +2967,7 @@ class ScCartService {
|
|
|
2924
2967
|
* @param file Загружаемый файл в формате base64.
|
|
2925
2968
|
*/
|
|
2926
2969
|
addProductsFromCsv$(file) {
|
|
2927
|
-
return this.http.post(`${this.urls.apiUrl}/cart/csv`, { file }).pipe(map((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2970
|
+
return this.http.post(`${this.urls.apiUrl}/cart/csv`, { file }).pipe(map$1((cartDTO) => new ScCart(cartDTO)), tap((cart) => {
|
|
2928
2971
|
this.cartCachedItem$.setValue(cart);
|
|
2929
2972
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
2930
2973
|
target: ScUserMetrikaGoalsEnum.cartCsvUpload,
|
|
@@ -3088,6 +3131,14 @@ class ScCatalogFilterService {
|
|
|
3088
3131
|
* HTTP клиент для выполнения запросов.
|
|
3089
3132
|
*/
|
|
3090
3133
|
this.http = inject(HttpClient);
|
|
3134
|
+
/**
|
|
3135
|
+
* Время жизни кэша фильтров.
|
|
3136
|
+
*/
|
|
3137
|
+
this.cacheLifeTime = inject(SC_CACHE_LIFETIME);
|
|
3138
|
+
/**
|
|
3139
|
+
* Кэш фильтров по ключу `categoryIdOrSlug:recursively`.
|
|
3140
|
+
*/
|
|
3141
|
+
this.filterMap = new Map();
|
|
3091
3142
|
}
|
|
3092
3143
|
/**
|
|
3093
3144
|
* Возвращает список доступных фильтров продуктов в категории.
|
|
@@ -3096,14 +3147,23 @@ class ScCatalogFilterService {
|
|
|
3096
3147
|
* @param recursively Признак того, что необходимо вернуть фильтры с учетом вложенных категорий.
|
|
3097
3148
|
*/
|
|
3098
3149
|
getFilters$(categoryIdOrSlug, recursively) {
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3150
|
+
const key = `${categoryIdOrSlug}:${recursively ?? ''}`;
|
|
3151
|
+
let cachedItem = this.filterMap.get(key);
|
|
3152
|
+
if (!cachedItem) {
|
|
3153
|
+
let params = new HttpParams();
|
|
3154
|
+
if (recursively !== undefined) {
|
|
3155
|
+
params = params.set('recursively', String(recursively));
|
|
3156
|
+
}
|
|
3157
|
+
cachedItem = new ScCachedItem(this.cacheLifeTime.categoryData, this.http.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug}/filters`, {
|
|
3158
|
+
params,
|
|
3159
|
+
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3160
|
+
}));
|
|
3161
|
+
this.filterMap.set(key, cachedItem);
|
|
3102
3162
|
}
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3163
|
+
if (!cachedItem.cachedDataIsActual()) {
|
|
3164
|
+
cachedItem.update();
|
|
3165
|
+
}
|
|
3166
|
+
return cachedItem.item$;
|
|
3107
3167
|
}
|
|
3108
3168
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScCatalogFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3109
3169
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScCatalogFilterService, providedIn: 'root' }); }
|
|
@@ -3228,11 +3288,11 @@ class ScCatalogService {
|
|
|
3228
3288
|
/**
|
|
3229
3289
|
* {@link Observable} изменения списка из первых товаров со скидкой.
|
|
3230
3290
|
*/
|
|
3231
|
-
this.firstDiscountedProducts$ = this.firstDiscounted$.pipe(map((data) => data?.data ?? []));
|
|
3291
|
+
this.firstDiscountedProducts$ = this.firstDiscounted$.pipe(map$1((data) => data?.data ?? []));
|
|
3232
3292
|
/**
|
|
3233
3293
|
* {@link Observable} изменения общего колличества товара со скидкой.
|
|
3234
3294
|
*/
|
|
3235
|
-
this.countDiscountedProducts$ = this.firstDiscounted$.pipe(map((data) => data?.meta.total ?? 0));
|
|
3295
|
+
this.countDiscountedProducts$ = this.firstDiscounted$.pipe(map$1((data) => data?.meta.total ?? 0));
|
|
3236
3296
|
this.userService
|
|
3237
3297
|
.getUserChange$()
|
|
3238
3298
|
.pipe(skip(1))
|
|
@@ -3266,7 +3326,7 @@ class ScCatalogService {
|
|
|
3266
3326
|
* @param categoryIdOrSlug Идентификатор или slug категории товаров.
|
|
3267
3327
|
*/
|
|
3268
3328
|
getCategoryData$(categoryIdOrSlug) {
|
|
3269
|
-
return this.http.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug ?? ''}`).pipe(map((category) => new ScCategory(category)), tap((category) => {
|
|
3329
|
+
return this.http.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug ?? ''}`).pipe(map$1((category) => new ScCategory(category)), tap((category) => {
|
|
3270
3330
|
if (categoryIdOrSlug) {
|
|
3271
3331
|
this.categoryIdOrSlugMap.set(typeof categoryIdOrSlug === 'string' ? category.id : category.slug, categoryIdOrSlug);
|
|
3272
3332
|
}
|
|
@@ -3276,7 +3336,7 @@ class ScCatalogService {
|
|
|
3276
3336
|
* Возвращает {@link Observable} корневых категорий с настройками отображения, чтобы реагировать на изменения.
|
|
3277
3337
|
*/
|
|
3278
3338
|
getFilteredRootCategories$() {
|
|
3279
|
-
return this.uiService.getHiddenCategoriesList$().pipe(switchMap((filters) => this.getRootCategories$().pipe(filter(tuiIsPresent), map((data) => data.filter((category) => category.id && !filters.includes(category.id))))));
|
|
3339
|
+
return this.uiService.getHiddenCategoriesList$().pipe(switchMap((filters) => this.getRootCategories$().pipe(filter(tuiIsPresent), map$1((data) => data.filter((category) => category.id && !filters.includes(category.id))))));
|
|
3280
3340
|
}
|
|
3281
3341
|
/**
|
|
3282
3342
|
* Возвращает {@link Observable} содержимого виртуальной категории.
|
|
@@ -3286,7 +3346,7 @@ class ScCatalogService {
|
|
|
3286
3346
|
getVirtualCategoryCached$(slug) {
|
|
3287
3347
|
let cachedItem = this.virtualCategoryMap.get(slug);
|
|
3288
3348
|
if (!cachedItem) {
|
|
3289
|
-
cachedItem = new ScCachedItem(this.cacheLifeTime.categoryData, this.http.get(`${this.urls.apiUrl}/catalog/v-categories/${slug}`).pipe(map((category) => new ScVirtualCategory(category))), null);
|
|
3349
|
+
cachedItem = new ScCachedItem(this.cacheLifeTime.categoryData, this.http.get(`${this.urls.apiUrl}/catalog/v-categories/${slug}`).pipe(map$1((category) => new ScVirtualCategory(category))), null);
|
|
3290
3350
|
this.virtualCategoryMap.set(slug, cachedItem);
|
|
3291
3351
|
}
|
|
3292
3352
|
if (!cachedItem.cachedDataIsActual()) {
|
|
@@ -3324,7 +3384,7 @@ class ScCatalogService {
|
|
|
3324
3384
|
* Создает запрос получения корневых категорий.
|
|
3325
3385
|
*/
|
|
3326
3386
|
getRootCategories$() {
|
|
3327
|
-
return this.getNullCategory$().pipe(map((nullCategory) => nullCategory?.categories ?? null));
|
|
3387
|
+
return this.getNullCategory$().pipe(map$1((nullCategory) => nullCategory?.categories ?? null));
|
|
3328
3388
|
}
|
|
3329
3389
|
/**
|
|
3330
3390
|
* Раскрывает каталог до указанной категории.
|
|
@@ -3337,7 +3397,7 @@ class ScCatalogService {
|
|
|
3337
3397
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition,sonarjs/different-types-comparison
|
|
3338
3398
|
takeWhile((parentCategory) => parentCategory.parentCategory !== undefined, true), toArray(),
|
|
3339
3399
|
// eslint-disable-next-line sonarjs/no-misleading-array-reverse
|
|
3340
|
-
map((categories) => categories.reverse()));
|
|
3400
|
+
map$1((categories) => categories.reverse()));
|
|
3341
3401
|
}
|
|
3342
3402
|
/**
|
|
3343
3403
|
* Возвращает {@link Observable} получения истории изменения цен на продукт для клиента.
|
|
@@ -3352,7 +3412,7 @@ class ScCatalogService {
|
|
|
3352
3412
|
.get(`${this.urls.apiUrl}/catalog/products/${product.id}/price-history`, {
|
|
3353
3413
|
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3354
3414
|
})
|
|
3355
|
-
.pipe(catchError(() => of({}))), null);
|
|
3415
|
+
.pipe(catchError$1(() => of({}))), null);
|
|
3356
3416
|
this.productHistoryMap.set(product.id.toString(), cachedItem);
|
|
3357
3417
|
}
|
|
3358
3418
|
return cachedItem.item$;
|
|
@@ -3366,7 +3426,7 @@ class ScCatalogService {
|
|
|
3366
3426
|
})
|
|
3367
3427
|
.pipe(
|
|
3368
3428
|
// eslint-disable-next-line sonarjs/function-return-type
|
|
3369
|
-
map((data) => {
|
|
3429
|
+
map$1((data) => {
|
|
3370
3430
|
if ('meta' in data) {
|
|
3371
3431
|
const cloneData = structuredClone(data);
|
|
3372
3432
|
cloneData.data = cloneData.data.map((item) => new ScProduct(item));
|
|
@@ -3405,7 +3465,7 @@ class ScCatalogService {
|
|
|
3405
3465
|
* @param productIdOrSlug Идентификатор или slug товара/услуги.
|
|
3406
3466
|
*/
|
|
3407
3467
|
getProductData$(productIdOrSlug) {
|
|
3408
|
-
return this.http.get(`${this.urls.apiUrl}/catalog/products/${productIdOrSlug}`).pipe(map((productDTO) => new ScProduct(productDTO)), tap((product) => {
|
|
3468
|
+
return this.http.get(`${this.urls.apiUrl}/catalog/products/${productIdOrSlug}`).pipe(map$1((productDTO) => new ScProduct(productDTO)), tap((product) => {
|
|
3409
3469
|
if (productIdOrSlug) {
|
|
3410
3470
|
this.productIdOrSlugMap.set(typeof productIdOrSlug === 'string' ? product.id : product.slug, productIdOrSlug);
|
|
3411
3471
|
}
|
|
@@ -3438,7 +3498,7 @@ class ScCatalogService {
|
|
|
3438
3498
|
format: Object.keys(ScMimeTypes)[Object.values(ScMimeTypes).indexOf(type)],
|
|
3439
3499
|
category_id: categoryId ?? null,
|
|
3440
3500
|
}, { nonNullable: true });
|
|
3441
|
-
return this.http.get(`${this.urls.apiUrl}/catalog/download`, { responseType: 'blob', params: params }).pipe(map((blob) => new Blob([blob], { type: type })), tap(() => {
|
|
3501
|
+
return this.http.get(`${this.urls.apiUrl}/catalog/download`, { responseType: 'blob', params: params }).pipe(map$1((blob) => new Blob([blob], { type: type })), tap(() => {
|
|
3442
3502
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
3443
3503
|
target: ScUserMetrikaGoalsEnum.catalogPriceDownload,
|
|
3444
3504
|
params: {
|
|
@@ -3507,7 +3567,7 @@ class ScFavoriteService {
|
|
|
3507
3567
|
getFavoriteCategories$() {
|
|
3508
3568
|
return this.http
|
|
3509
3569
|
.get(`${this.urls.apiUrl}/favorites/categories`)
|
|
3510
|
-
.pipe(map((categoriesDTO) => categoriesDTO.map((categoryDTO) => new ScCategory(categoryDTO))));
|
|
3570
|
+
.pipe(map$1((categoriesDTO) => categoriesDTO.map((categoryDTO) => new ScCategory(categoryDTO))));
|
|
3511
3571
|
}
|
|
3512
3572
|
/**
|
|
3513
3573
|
* Запрос добавления указанной категории в избранное.
|
|
@@ -3609,8 +3669,8 @@ class ScRecommendationService {
|
|
|
3609
3669
|
.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug}/recommendations`, {
|
|
3610
3670
|
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3611
3671
|
})
|
|
3612
|
-
.pipe(catchError(() => of([])), map((productsDTO) => productsDTO.map((product) => new ScProduct(product))))
|
|
3613
|
-
.pipe(startWith(null)), null);
|
|
3672
|
+
.pipe(catchError$1(() => of([])), map$1((productsDTO) => productsDTO.map((product) => new ScProduct(product))))
|
|
3673
|
+
.pipe(startWith$1(null)), null);
|
|
3614
3674
|
this.productsByCategoryMap.set(categoryIdOrSlug.toString(), cachedItem);
|
|
3615
3675
|
}
|
|
3616
3676
|
return cachedItem.item$;
|
|
@@ -3628,8 +3688,8 @@ class ScRecommendationService {
|
|
|
3628
3688
|
.get(`${this.urls.apiUrl}/catalog/products/${productIdOrSlug}/recommendations`, {
|
|
3629
3689
|
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3630
3690
|
})
|
|
3631
|
-
.pipe(catchError(() => of([])), map((productsDTO) => productsDTO.map((product) => new ScProduct(product))))
|
|
3632
|
-
.pipe(startWith(null)), null);
|
|
3691
|
+
.pipe(catchError$1(() => of([])), map$1((productsDTO) => productsDTO.map((product) => new ScProduct(product))))
|
|
3692
|
+
.pipe(startWith$1(null)), null);
|
|
3633
3693
|
this.productsByProductMap.set(productIdOrSlug.toString(), cachedItem);
|
|
3634
3694
|
}
|
|
3635
3695
|
return cachedItem.item$;
|
|
@@ -3645,16 +3705,16 @@ class ScRecommendationService {
|
|
|
3645
3705
|
params: this.convertersService.toHttpParams({ products: productIds }, { nonNullable: true }),
|
|
3646
3706
|
context: SC_IS_HIDDEN_ERROR_ALERT_HTTP_CONTEXT,
|
|
3647
3707
|
})
|
|
3648
|
-
.pipe(catchError(() => of([])), map((productsDTO) => productsDTO.map((product) => new ScProduct(product))));
|
|
3708
|
+
.pipe(catchError$1(() => of([])), map$1((productsDTO) => productsDTO.map((product) => new ScProduct(product))));
|
|
3649
3709
|
}
|
|
3650
3710
|
/**
|
|
3651
3711
|
* Создает запрос на получение списка рекомендованных товаров для корзины клиента.
|
|
3652
3712
|
*/
|
|
3653
3713
|
getProductsByCart$() {
|
|
3654
|
-
return this.cartService.get$().pipe(map((cart) => (cart !== loadingPlaceholder && 'items' in cart ? cart.items.map((item) => item.product.id) : [])),
|
|
3714
|
+
return this.cartService.get$().pipe(map$1((cart) => (cart !== loadingPlaceholder && 'items' in cart ? cart.items.map((item) => item.product.id) : [])),
|
|
3655
3715
|
// Отфильтровываем повторения. Они возникнут если было изменено количество товара без удаления\добавления новых товаров.
|
|
3656
3716
|
// eslint-disable-next-line sonarjs/no-misleading-array-reverse
|
|
3657
|
-
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))));
|
|
3717
|
+
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))));
|
|
3658
3718
|
}
|
|
3659
3719
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScRecommendationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3660
3720
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScRecommendationService, providedIn: 'root' }); }
|
|
@@ -3875,7 +3935,7 @@ class ScConfiguratorService {
|
|
|
3875
3935
|
}
|
|
3876
3936
|
return this.http.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug}/configurators/${editor}/settings`).pipe(
|
|
3877
3937
|
// eslint-disable-next-line security/detect-object-injection
|
|
3878
|
-
map((settings) => (this.configuratorSettings && editor in this.configuratorSettings ? new this.configuratorSettings[editor](settings) : settings)), tap((settings) => {
|
|
3938
|
+
map$1((settings) => (this.configuratorSettings && editor in this.configuratorSettings ? new this.configuratorSettings[editor](settings) : settings)), tap((settings) => {
|
|
3879
3939
|
if (category) {
|
|
3880
3940
|
category.configuratorSettings = settings;
|
|
3881
3941
|
}
|
|
@@ -3891,7 +3951,7 @@ class ScConfiguratorService {
|
|
|
3891
3951
|
getProduct$(categoryIdOrSlug, editor, params) {
|
|
3892
3952
|
return this.http
|
|
3893
3953
|
.get(`${this.urls.apiUrl}/catalog/categories/${categoryIdOrSlug}/configurators/${editor}/product`, { params: params })
|
|
3894
|
-
.pipe(map((productDTO) => new ScProduct(productDTO)));
|
|
3954
|
+
.pipe(map$1((productDTO) => new ScProduct(productDTO)));
|
|
3895
3955
|
}
|
|
3896
3956
|
/**
|
|
3897
3957
|
* Создаёт пользовательский шаблон конфигуратора.
|
|
@@ -4308,7 +4368,7 @@ const SC_CATEGORY_INFO = new InjectionToken('A stream with current category info
|
|
|
4308
4368
|
* @param catalogService Сервис для работы с каталогом.
|
|
4309
4369
|
*/
|
|
4310
4370
|
function categoryFactory(router, route, catalogService) {
|
|
4311
|
-
return router.events.pipe(filter((event) => event instanceof NavigationEnd)).pipe(startWith(null), switchMap(() => {
|
|
4371
|
+
return router.events.pipe(filter((event) => event instanceof NavigationEnd)).pipe(startWith$1(null), switchMap(() => {
|
|
4312
4372
|
const categoryIdOrSlug = scGetCurrentRoute(route).snapshot.paramMap.get('categoryIdOrSlug');
|
|
4313
4373
|
if (categoryIdOrSlug) {
|
|
4314
4374
|
return catalogService.getCategoryCached$(categoryIdOrSlug);
|
|
@@ -4377,7 +4437,7 @@ class ScSearchService {
|
|
|
4377
4437
|
term: term,
|
|
4378
4438
|
},
|
|
4379
4439
|
});
|
|
4380
|
-
}), map((categories) => categories.map((item) => new ScCategory(item))));
|
|
4440
|
+
}), map$1((categories) => categories.map((item) => new ScCategory(item))));
|
|
4381
4441
|
}
|
|
4382
4442
|
/**
|
|
4383
4443
|
* Выполняет полный поиск по всему прайс-листу.
|
|
@@ -4463,7 +4523,7 @@ const SC_MAX_LENGTH_SEARCH_TERM = new InjectionToken('SC_MAX_LENGTH_SEARCH_TERM'
|
|
|
4463
4523
|
function searchTermFactory(searchService, minLengthSearchTerm, maxLengthSearchTerm) {
|
|
4464
4524
|
return searchService
|
|
4465
4525
|
.getSearchTermChange$()
|
|
4466
|
-
.pipe(map((searchTerm) => (searchTerm && searchTerm.length >= minLengthSearchTerm && searchTerm.length <= maxLengthSearchTerm ? searchTerm : '')));
|
|
4526
|
+
.pipe(map$1((searchTerm) => (searchTerm && searchTerm.length >= minLengthSearchTerm && searchTerm.length <= maxLengthSearchTerm ? searchTerm : '')));
|
|
4467
4527
|
}
|
|
4468
4528
|
/**
|
|
4469
4529
|
* Провайдеры данных о поиске введенного терма.
|
|
@@ -4490,7 +4550,7 @@ const SC_VIRTUAL_CATEGORY_INFO = new InjectionToken('A stream with current virtu
|
|
|
4490
4550
|
* @param catalogService Сервис для работы с каталогом.
|
|
4491
4551
|
*/
|
|
4492
4552
|
function virtualCategoryFactory({ paramMap }, catalogService) {
|
|
4493
|
-
return paramMap.pipe(map((params) => params.get('categorySlug')), filter(tuiIsPresent), switchMap((categorySlug) => catalogService.getVirtualCategoryCached$(categorySlug).pipe(shareReplay())), takeUntilDestroyed());
|
|
4553
|
+
return paramMap.pipe(map$1((params) => params.get('categorySlug')), filter(tuiIsPresent), switchMap((categorySlug) => catalogService.getVirtualCategoryCached$(categorySlug).pipe(shareReplay())), takeUntilDestroyed());
|
|
4494
4554
|
}
|
|
4495
4555
|
/**
|
|
4496
4556
|
* Провайдеры потока данных о виртуальной категории.
|
|
@@ -4546,17 +4606,17 @@ class ScUTMService {
|
|
|
4546
4606
|
/**
|
|
4547
4607
|
* {@link Observable} UTM-метка страницы.
|
|
4548
4608
|
*/
|
|
4549
|
-
this.utm$ = inject(WA_STORAGE_EVENT).pipe(filterByKey('utm'), toValue(), startWith(this.getUTMParams()), map((utmString) => (utmString === null ? utmString : JSON.parse(utmString))));
|
|
4609
|
+
this.utm$ = inject(WA_STORAGE_EVENT).pipe(filterByKey('utm'), toValue(), startWith$1(this.getUTMParams()), map$1((utmString) => (utmString === null ? utmString : JSON.parse(utmString))));
|
|
4550
4610
|
/**
|
|
4551
4611
|
* {@link Observable} timestamp сохранения UTM в {@link Storage}.
|
|
4552
4612
|
*/
|
|
4553
|
-
this.utmTimestamp$ = inject(WA_STORAGE_EVENT).pipe(filterByKey('utmTimestamp'), toValue(), startWith(this.getUTMTimestamp()), map((timestamp) => (isString(timestamp) ? Number(timestamp) : timestamp)));
|
|
4613
|
+
this.utmTimestamp$ = inject(WA_STORAGE_EVENT).pipe(filterByKey('utmTimestamp'), toValue(), startWith$1(this.getUTMTimestamp()), map$1((timestamp) => (isString(timestamp) ? Number(timestamp) : timestamp)));
|
|
4554
4614
|
/**
|
|
4555
4615
|
* {@link Observable} UTM-метки страницы из параметров роутинга.
|
|
4556
4616
|
*/
|
|
4557
|
-
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),
|
|
4617
|
+
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),
|
|
4558
4618
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
4559
|
-
filter((params) => params['utm_source'] && params['utm_medium'] && params['utm_campaign']), map((params) => {
|
|
4619
|
+
filter((params) => params['utm_source'] && params['utm_medium'] && params['utm_campaign']), map$1((params) => {
|
|
4560
4620
|
return {
|
|
4561
4621
|
source: params.utm_source,
|
|
4562
4622
|
medium: params.utm_medium,
|
|
@@ -4612,7 +4672,7 @@ class ScUTMService {
|
|
|
4612
4672
|
return combineLatest({
|
|
4613
4673
|
utm: this.utm$,
|
|
4614
4674
|
timestamp: this.utmTimestamp$,
|
|
4615
|
-
}).pipe(map(({ utm, timestamp }) => (!this.utmLifeTime || (timestamp && timestamp + this.utmLifeTime > Date.now()) ? utm : null)));
|
|
4675
|
+
}).pipe(map$1(({ utm, timestamp }) => (!this.utmLifeTime || (timestamp && timestamp + this.utmLifeTime > Date.now()) ? utm : null)));
|
|
4616
4676
|
}
|
|
4617
4677
|
/**
|
|
4618
4678
|
* Возвращает {@link Observable} сохранения {@link ScUTM}.
|
|
@@ -4687,7 +4747,7 @@ class ScFeedbackService {
|
|
|
4687
4747
|
* @param feedbackMessage Объект сообщения обратной связи.
|
|
4688
4748
|
*/
|
|
4689
4749
|
sendFeedback(formSlug, feedbackMessage) {
|
|
4690
|
-
return this.utmService.getUTM$().pipe(first(), map((utm) => (utm ? { ...feedbackMessage, utm } : feedbackMessage)), switchMap((data) => this.http.post(`${this.feedbackApi.apiUrl}/feedback/${formSlug}`, data, {
|
|
4750
|
+
return this.utmService.getUTM$().pipe(first(), map$1((utm) => (utm ? { ...feedbackMessage, utm } : feedbackMessage)), switchMap((data) => this.http.post(`${this.feedbackApi.apiUrl}/feedback/${formSlug}`, data, {
|
|
4691
4751
|
context: new HttpContext().set(SC_AUTH_ADD_HEADER_REQUIRED, false).set(SC_IS_HEADER_REQUIRED, false),
|
|
4692
4752
|
headers: {
|
|
4693
4753
|
[this.feedbackApi.authTokenName]: this.feedbackApi.authToken,
|
|
@@ -4741,19 +4801,19 @@ class ScRequisitesService {
|
|
|
4741
4801
|
/**
|
|
4742
4802
|
* Создаёт запрос получения списка контактов для решения возникающих вопросов.
|
|
4743
4803
|
*/
|
|
4744
|
-
this.personal$ = this.contacts$.pipe(map((contacts) => contacts.personal));
|
|
4804
|
+
this.personal$ = this.contacts$.pipe(map$1((contacts) => contacts.personal));
|
|
4745
4805
|
/**
|
|
4746
4806
|
* Создаёт запрос получения списка контактов розничных магазинов.
|
|
4747
4807
|
*/
|
|
4748
|
-
this.retail$ = this.contacts$.pipe(map((contacts) => contacts.retail), first(), shareReplay(1));
|
|
4808
|
+
this.retail$ = this.contacts$.pipe(map$1((contacts) => contacts.retail), first(), shareReplay(1));
|
|
4749
4809
|
/**
|
|
4750
4810
|
* Создаёт запрос получения списка ссылок на социальные сети и другие каналы коммуникации.
|
|
4751
4811
|
*/
|
|
4752
|
-
this.socialMedia$ = this.contacts$.pipe(map((contacts) => contacts.socialMedia), first(), shareReplay(1));
|
|
4812
|
+
this.socialMedia$ = this.contacts$.pipe(map$1((contacts) => contacts.socialMedia), first(), shareReplay(1));
|
|
4753
4813
|
/**
|
|
4754
4814
|
* Создаёт запрос получения списка контактов менеджеров по направлениям продаж.
|
|
4755
4815
|
*/
|
|
4756
|
-
this.directions$ = this.contacts$.pipe(map((contacts) => contacts.directions), tap((directions) => {
|
|
4816
|
+
this.directions$ = this.contacts$.pipe(map$1((contacts) => contacts.directions), tap((directions) => {
|
|
4757
4817
|
// eslint-disable-next-line guard-for-in,no-restricted-syntax
|
|
4758
4818
|
for (const key in directions) {
|
|
4759
4819
|
directions[Number.parseFloat(key)]?.forEach((manager) => {
|
|
@@ -4885,7 +4945,7 @@ class ScContragentService {
|
|
|
4885
4945
|
/**
|
|
4886
4946
|
* {@link Observable} данных о контрагентах пользователя.
|
|
4887
4947
|
*/
|
|
4888
|
-
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));
|
|
4948
|
+
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));
|
|
4889
4949
|
this.user$.pipe(filter((user) => user.isGuest)).subscribe(() => {
|
|
4890
4950
|
this.contactsService.contragentContactsMap.clear();
|
|
4891
4951
|
this.contragentBankAccountsMap.clear();
|
|
@@ -4930,7 +4990,7 @@ class ScContragentService {
|
|
|
4930
4990
|
let cachedItem = this.contactsService.contragentContactsMap.get(contragentId);
|
|
4931
4991
|
if (!cachedItem) {
|
|
4932
4992
|
// Устанавливаем время жизни cachedItem равное, потому что нам не важно время жизни. Нам нужен функционал update() в будущем.
|
|
4933
|
-
cachedItem = new ScCachedItem(0, this.http.get(`${this.urls.apiUrl}/user/contragents/${contragentId}/contacts`).pipe(startWith(null)), null);
|
|
4993
|
+
cachedItem = new ScCachedItem(0, this.http.get(`${this.urls.apiUrl}/user/contragents/${contragentId}/contacts`).pipe(startWith$1(null)), null);
|
|
4934
4994
|
this.contactsService.contragentContactsMap.set(contragentId, cachedItem);
|
|
4935
4995
|
}
|
|
4936
4996
|
return cachedItem.item$;
|
|
@@ -4963,7 +5023,7 @@ class ScContragentService {
|
|
|
4963
5023
|
let cachedItem = this.contragentBankAccountsMap.get(contragentId);
|
|
4964
5024
|
if (!cachedItem) {
|
|
4965
5025
|
// Устанавливаем время жизни cachedItem равное, потому что нам не важно время жизни. Нам нужен функционал update().
|
|
4966
|
-
cachedItem = new ScCachedItem(0, this.http.get(`${this.urls.apiUrl}/user/contragents/${contragentId}/bank-accounts`).pipe(startWith(null)), null);
|
|
5026
|
+
cachedItem = new ScCachedItem(0, this.http.get(`${this.urls.apiUrl}/user/contragents/${contragentId}/bank-accounts`).pipe(startWith$1(null)), null);
|
|
4967
5027
|
this.contragentBankAccountsMap.set(contragentId, cachedItem);
|
|
4968
5028
|
}
|
|
4969
5029
|
return cachedItem.item$;
|
|
@@ -5033,7 +5093,7 @@ class ScDeliveryAddressService {
|
|
|
5033
5093
|
/**
|
|
5034
5094
|
* {@link Observable} данных адресов доставки.
|
|
5035
5095
|
*/
|
|
5036
|
-
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));
|
|
5096
|
+
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));
|
|
5037
5097
|
}
|
|
5038
5098
|
/**
|
|
5039
5099
|
* Создаёт запрос создания нового адреса доставки.
|
|
@@ -5077,7 +5137,7 @@ class ScDeliveryAddressService {
|
|
|
5077
5137
|
// Устанавливаем время жизни cachedItem равное, потому что нам не важно время жизни. Нам нужен функционал update().
|
|
5078
5138
|
cachedItem = new ScCachedItem(0, this.http
|
|
5079
5139
|
.get(`${this.urls.apiUrl}/user/delivery-addresses/${addressId}/contacts`)
|
|
5080
|
-
.pipe(startWith(null)), null);
|
|
5140
|
+
.pipe(startWith$1(null)), null);
|
|
5081
5141
|
this.contactsService.deliveryAddressContactsMap.set(addressId, cachedItem);
|
|
5082
5142
|
}
|
|
5083
5143
|
return cachedItem.item$;
|
|
@@ -5337,7 +5397,7 @@ class ScAuthAsClientGuard {
|
|
|
5337
5397
|
canActivate(route) {
|
|
5338
5398
|
const expiredAt = new Date();
|
|
5339
5399
|
expiredAt.setMinutes(new Date().getMinutes() + this.options.expiredAtMinute);
|
|
5340
|
-
return this.authService.getAuthChange().pipe(
|
|
5400
|
+
return this.authService.getAuthChange().pipe(take(1), defaultIfEmpty(false),
|
|
5341
5401
|
// Если пользователь авторизирован, то завершаем сеанс.
|
|
5342
5402
|
concatMap((state) => (state ? this.authService.getSignOut$(false) : of(null))),
|
|
5343
5403
|
// Обновляем полученные ключи, чтобы они перестали действовать. getRefreshTokenObservable() запишет новые ключи в систему, после чего проложение само запросит нового пользователя.
|
|
@@ -5350,7 +5410,7 @@ class ScAuthAsClientGuard {
|
|
|
5350
5410
|
token: route.paramMap.get('rtoken') ?? '',
|
|
5351
5411
|
expiredAt: expiredAt,
|
|
5352
5412
|
},
|
|
5353
|
-
})),
|
|
5413
|
+
})), take(1), defaultIfEmpty(null), map$1(() => this.router.createUrlTree(this.options.urlTree)));
|
|
5354
5414
|
}
|
|
5355
5415
|
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 }); }
|
|
5356
5416
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScAuthAsClientGuard }); }
|
|
@@ -5379,14 +5439,14 @@ const ScIdOrSlugGuard = (route) => {
|
|
|
5379
5439
|
.getCategoryCached$(categoryIdOrSlug)
|
|
5380
5440
|
.pipe(filter(tuiIsPresent),
|
|
5381
5441
|
// eslint-disable-next-line security/detect-object-injection
|
|
5382
|
-
map((category) => router.createUrlTree(['/catalog', category[idOrSlug]])), catchError(() => of(TUI_TRUE_HANDLER())));
|
|
5442
|
+
map$1((category) => router.createUrlTree(['/catalog', category[idOrSlug]])), catchError$1(() => of(TUI_TRUE_HANDLER())));
|
|
5383
5443
|
}
|
|
5384
5444
|
if (productIdOrSlug && /^\d+$/.test(productIdOrSlug) !== (idOrSlug === 'id')) {
|
|
5385
5445
|
return inject(ScCatalogService)
|
|
5386
5446
|
.getProductData$(productIdOrSlug)
|
|
5387
5447
|
.pipe(filter(tuiIsPresent),
|
|
5388
5448
|
// eslint-disable-next-line security/detect-object-injection
|
|
5389
|
-
map((product) => router.createUrlTree(['/catalog', 'product', product[idOrSlug]])), catchError(() => of(TUI_TRUE_HANDLER())));
|
|
5449
|
+
map$1((product) => router.createUrlTree(['/catalog', 'product', product[idOrSlug]])), catchError$1(() => of(TUI_TRUE_HANDLER())));
|
|
5390
5450
|
}
|
|
5391
5451
|
return true;
|
|
5392
5452
|
};
|
|
@@ -5523,14 +5583,14 @@ class ScConvertInterceptor {
|
|
|
5523
5583
|
if (request.responseType !== 'json' || !request.url.includes(this.urls.apiUrl)) {
|
|
5524
5584
|
return next.handle(request);
|
|
5525
5585
|
}
|
|
5526
|
-
return next.handle(request.clone({ params: this.httpParamsToSnake(request.params), body: objectToSnake(request.body) })).pipe(map((event) => {
|
|
5586
|
+
return next.handle(request.clone({ params: this.httpParamsToSnake(request.params), body: objectToSnake(request.body) })).pipe(map$1((event) => {
|
|
5527
5587
|
if (event instanceof HttpResponse) {
|
|
5528
5588
|
return event.clone({
|
|
5529
5589
|
body: objectToCamel(event.body),
|
|
5530
5590
|
});
|
|
5531
5591
|
}
|
|
5532
5592
|
return event;
|
|
5533
|
-
}), catchError((error) => throwError(() => new HttpErrorResponse({
|
|
5593
|
+
}), catchError$1((error) => throwError(() => new HttpErrorResponse({
|
|
5534
5594
|
error: objectToCamel(error.error),
|
|
5535
5595
|
headers: error.headers,
|
|
5536
5596
|
status: error.status,
|
|
@@ -5585,7 +5645,7 @@ class ScErrorsInterceptor {
|
|
|
5585
5645
|
/** @inheritDoc */
|
|
5586
5646
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5587
5647
|
intercept(request, next) {
|
|
5588
|
-
return next.handle(request).pipe(catchError((error) => {
|
|
5648
|
+
return next.handle(request).pipe(catchError$1((error) => {
|
|
5589
5649
|
// TODO: TASK[#4511]: Обработка и вывод ошибок работы с API.
|
|
5590
5650
|
// eslint-disable-next-line sonarjs/no-small-switch
|
|
5591
5651
|
switch (error.status) {
|
|
@@ -5622,7 +5682,7 @@ class ScErrorsInterceptor {
|
|
|
5622
5682
|
return this.authService.getRefreshToken$().pipe(switchMap(() => {
|
|
5623
5683
|
this.isTokenRefreshing$.next(false);
|
|
5624
5684
|
return next.handle(request.clone(this.tokenService.addAuthHeader(request)));
|
|
5625
|
-
}), catchError((error) => {
|
|
5685
|
+
}), catchError$1((error) => {
|
|
5626
5686
|
if (error.status === 401) {
|
|
5627
5687
|
this.tokenService.removeAuthToken();
|
|
5628
5688
|
return of();
|
|
@@ -5728,7 +5788,7 @@ class ScDateFormatInterceptor {
|
|
|
5728
5788
|
}
|
|
5729
5789
|
/** @inheritDoc */
|
|
5730
5790
|
intercept(request, next) {
|
|
5731
|
-
return next.handle(request).pipe(catchError((error) => {
|
|
5791
|
+
return next.handle(request).pipe(catchError$1((error) => {
|
|
5732
5792
|
const errorData = error.error;
|
|
5733
5793
|
this.formatDatesInErrors(errorData);
|
|
5734
5794
|
return throwError(() => error);
|
|
@@ -6119,7 +6179,7 @@ class ScNewsService {
|
|
|
6119
6179
|
* @param newsId Идентификатор новости.
|
|
6120
6180
|
*/
|
|
6121
6181
|
getNews$(newsId) {
|
|
6122
|
-
return this.http.get(`${this.urls.apiUrl}/news/${newsId}`).pipe(map((category) => new ScNews(category)));
|
|
6182
|
+
return this.http.get(`${this.urls.apiUrl}/news/${newsId}`).pipe(map$1((category) => new ScNews(category)));
|
|
6123
6183
|
}
|
|
6124
6184
|
/**
|
|
6125
6185
|
* Возвращает {@link Observable} получения списка последних новостей.
|
|
@@ -6698,7 +6758,7 @@ class ScOrderDraftsService {
|
|
|
6698
6758
|
* @param params Параметры запроса получения списка.
|
|
6699
6759
|
*/
|
|
6700
6760
|
getList$(params) {
|
|
6701
|
-
return this.http.get(`${this.urls.apiUrl}/orders/offers`, { params: params }).pipe(map((offersPaginateDTO) => {
|
|
6761
|
+
return this.http.get(`${this.urls.apiUrl}/orders/offers`, { params: params }).pipe(map$1((offersPaginateDTO) => {
|
|
6702
6762
|
offersPaginateDTO.data = offersPaginateDTO.data.map((item) => new ScOrderDraftShort(item));
|
|
6703
6763
|
return offersPaginateDTO;
|
|
6704
6764
|
}));
|
|
@@ -6709,7 +6769,7 @@ class ScOrderDraftsService {
|
|
|
6709
6769
|
* @param data Данные для создания.
|
|
6710
6770
|
*/
|
|
6711
6771
|
create$(data) {
|
|
6712
|
-
return this.http.post(`${this.urls.apiUrl}/orders/offers`, data).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6772
|
+
return this.http.post(`${this.urls.apiUrl}/orders/offers`, data).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6713
6773
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
6714
6774
|
target: ScUserMetrikaGoalsEnum.orderDraftCreated,
|
|
6715
6775
|
params: { offer_id: offer.id },
|
|
@@ -6727,7 +6787,7 @@ class ScOrderDraftsService {
|
|
|
6727
6787
|
get$(draftId, cacheable = true) {
|
|
6728
6788
|
let cachedItem = this.offerMap.get(draftId);
|
|
6729
6789
|
if (!cachedItem) {
|
|
6730
|
-
cachedItem = new ScCachedItem(this.updateInterval.orderData, this.http.get(`${this.urls.apiUrl}/orders/offers/${draftId}`).pipe(map((data) => new ScOrderDraft(data))), loadingPlaceholder);
|
|
6790
|
+
cachedItem = new ScCachedItem(this.updateInterval.orderData, this.http.get(`${this.urls.apiUrl}/orders/offers/${draftId}`).pipe(map$1((data) => new ScOrderDraft(data))), loadingPlaceholder);
|
|
6731
6791
|
if (cacheable) {
|
|
6732
6792
|
this.offerMap.set(draftId, cachedItem);
|
|
6733
6793
|
}
|
|
@@ -6743,7 +6803,7 @@ class ScOrderDraftsService {
|
|
|
6743
6803
|
* @param id Идентификатор коммерческого предложения/черновика.
|
|
6744
6804
|
*/
|
|
6745
6805
|
getItems$(id) {
|
|
6746
|
-
return this.get$(id).pipe(map((draft) => (draft === loadingPlaceholder ? loadingPlaceholder : draft.products)));
|
|
6806
|
+
return this.get$(id).pipe(map$1((draft) => (draft === loadingPlaceholder ? loadingPlaceholder : draft.products)));
|
|
6747
6807
|
}
|
|
6748
6808
|
/**
|
|
6749
6809
|
* Обновляет данные коммерческого предложения/черновика.
|
|
@@ -6753,7 +6813,7 @@ class ScOrderDraftsService {
|
|
|
6753
6813
|
*/
|
|
6754
6814
|
update$(draftId, patch) {
|
|
6755
6815
|
const cachedItem = this.offerMap.get(draftId);
|
|
6756
|
-
return this.http.patch(`${this.urls.apiUrl}/orders/offers/${draftId}`, patch).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6816
|
+
return this.http.patch(`${this.urls.apiUrl}/orders/offers/${draftId}`, patch).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6757
6817
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
6758
6818
|
target: ScUserMetrikaGoalsEnum.orderDraftUpdated,
|
|
6759
6819
|
params: { offer_id: draftId },
|
|
@@ -6782,7 +6842,7 @@ class ScOrderDraftsService {
|
|
|
6782
6842
|
* @param data Данные заказа.
|
|
6783
6843
|
*/
|
|
6784
6844
|
createOrder$(offerId, data) {
|
|
6785
|
-
return this.http.post(`${this.urls.apiUrl}/orders/offers/${offerId}/create-order`, data).pipe(map((orders) => orders.map((item) => new ScOrderShort(item))), tap((orders) => {
|
|
6845
|
+
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) => {
|
|
6786
6846
|
orders.forEach((order) => {
|
|
6787
6847
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
6788
6848
|
target: ScUserMetrikaGoalsEnum.orderCreatedFromDraft,
|
|
@@ -6799,7 +6859,7 @@ class ScOrderDraftsService {
|
|
|
6799
6859
|
* @param offerId Идентификатор коммерческого предложения/черновика.
|
|
6800
6860
|
*/
|
|
6801
6861
|
addProduct$(productData, offerId) {
|
|
6802
|
-
return this.http.post(`${this.urls.apiUrl}/orders/offers/${offerId}/products`, productData).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6862
|
+
return this.http.post(`${this.urls.apiUrl}/orders/offers/${offerId}/products`, productData).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6803
6863
|
if (this.offerMap.has(offerId)) {
|
|
6804
6864
|
this.offerMap.get(offerId)?.setValue(offer);
|
|
6805
6865
|
}
|
|
@@ -6813,7 +6873,7 @@ class ScOrderDraftsService {
|
|
|
6813
6873
|
* @param offerId Идентификатор коммерческого предложения/черновика.
|
|
6814
6874
|
*/
|
|
6815
6875
|
updateProduct$(productId, patch, offerId) {
|
|
6816
|
-
return this.http.patch(`${this.urls.apiUrl}/orders/offers/${offerId}/products/${productId}`, patch).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6876
|
+
return this.http.patch(`${this.urls.apiUrl}/orders/offers/${offerId}/products/${productId}`, patch).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6817
6877
|
if (this.offerMap.has(offerId)) {
|
|
6818
6878
|
this.offerMap.get(offerId)?.setValue(offer);
|
|
6819
6879
|
}
|
|
@@ -6826,7 +6886,7 @@ class ScOrderDraftsService {
|
|
|
6826
6886
|
* @param offerId Идентификатор коммерческого предложения/черновика.
|
|
6827
6887
|
*/
|
|
6828
6888
|
deleteProduct$(item, offerId) {
|
|
6829
|
-
return this.http.delete(`${this.urls.apiUrl}/orders/offers/${offerId}/products/${item.id}`).pipe(map((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6889
|
+
return this.http.delete(`${this.urls.apiUrl}/orders/offers/${offerId}/products/${item.id}`).pipe(map$1((offerDTO) => new ScOrderDraft(offerDTO)), tap((offer) => {
|
|
6830
6890
|
if (this.offerMap.has(offerId)) {
|
|
6831
6891
|
this.offerMap.get(offerId)?.setValue(offer);
|
|
6832
6892
|
}
|
|
@@ -6898,7 +6958,7 @@ class ScOrdersService {
|
|
|
6898
6958
|
* @param newOrder Данные нового заказа.
|
|
6899
6959
|
*/
|
|
6900
6960
|
createOrder$(directionId, newOrder) {
|
|
6901
|
-
return this.http.post(`${this.urls.apiUrl}/orders/${directionId}`, newOrder).pipe(map((orders) => orders.map((item) => new ScOrderShort(item))), tap((orders) => {
|
|
6961
|
+
return this.http.post(`${this.urls.apiUrl}/orders/${directionId}`, newOrder).pipe(map$1((orders) => orders.map((item) => new ScOrderShort(item))), tap((orders) => {
|
|
6902
6962
|
orders.forEach((order) => {
|
|
6903
6963
|
this.userMetrikaService.emitUserMetrikaEvent({
|
|
6904
6964
|
target: ScUserMetrikaGoalsEnum.orderCreated,
|
|
@@ -6931,7 +6991,7 @@ class ScOrdersService {
|
|
|
6931
6991
|
* @param params Параметры запроса получения заказов.
|
|
6932
6992
|
*/
|
|
6933
6993
|
getOrders$(params) {
|
|
6934
|
-
return this.http.get(`${this.urls.apiUrl}/orders`, { params: params }).pipe(map((ordersPaginateDTO) => {
|
|
6994
|
+
return this.http.get(`${this.urls.apiUrl}/orders`, { params: params }).pipe(map$1((ordersPaginateDTO) => {
|
|
6935
6995
|
ordersPaginateDTO.data = ordersPaginateDTO.data.map((item) => new ScOrderShort(item));
|
|
6936
6996
|
return ordersPaginateDTO;
|
|
6937
6997
|
}));
|
|
@@ -6945,7 +7005,7 @@ class ScOrdersService {
|
|
|
6945
7005
|
get$(orderId, cacheable = true) {
|
|
6946
7006
|
let cachedItem = this.orderMap.get(orderId);
|
|
6947
7007
|
if (!cachedItem) {
|
|
6948
|
-
cachedItem = new ScCachedItem(this.updateInterval.orderData, this.http.get(`${this.urls.apiUrl}/orders/${orderId}`).pipe(map((data) => new ScOrder(data))), loadingPlaceholder);
|
|
7008
|
+
cachedItem = new ScCachedItem(this.updateInterval.orderData, this.http.get(`${this.urls.apiUrl}/orders/${orderId}`).pipe(map$1((data) => new ScOrder(data))), loadingPlaceholder);
|
|
6949
7009
|
if (cacheable) {
|
|
6950
7010
|
this.orderMap.set(orderId, cachedItem);
|
|
6951
7011
|
}
|
|
@@ -6962,7 +7022,7 @@ class ScOrdersService {
|
|
|
6962
7022
|
* @param cacheable Признак возможности получения списка элементов заказа из кэшированных данных.
|
|
6963
7023
|
*/
|
|
6964
7024
|
getItems$(id, cacheable = true) {
|
|
6965
|
-
return this.get$(id, cacheable).pipe(map((order) => (order === loadingPlaceholder ? loadingPlaceholder : order.products)));
|
|
7025
|
+
return this.get$(id, cacheable).pipe(map$1((order) => (order === loadingPlaceholder ? loadingPlaceholder : order.products)));
|
|
6966
7026
|
}
|
|
6967
7027
|
/**
|
|
6968
7028
|
* Копирует товары заказа в корзину текущего пользователя.
|
|
@@ -7007,7 +7067,7 @@ class ScOrdersService {
|
|
|
7007
7067
|
date: date,
|
|
7008
7068
|
},
|
|
7009
7069
|
})
|
|
7010
|
-
.pipe(map((ordersPaginateDTO) => {
|
|
7070
|
+
.pipe(map$1((ordersPaginateDTO) => {
|
|
7011
7071
|
const formattedDate = format(parse(date, this.dateFormats.api, new Date()), this.dateFormats.uiDate);
|
|
7012
7072
|
return new ScDeliveryCost(ordersPaginateDTO, formattedDate);
|
|
7013
7073
|
}));
|
|
@@ -7045,7 +7105,7 @@ class ScPaginationService {
|
|
|
7045
7105
|
/**
|
|
7046
7106
|
* {@link Observable} изменения статуса аутентификации.
|
|
7047
7107
|
*/
|
|
7048
|
-
this.authStatus$ = inject(SC_USER_INFO).pipe(map((user) => user.isGuest));
|
|
7108
|
+
this.authStatus$ = inject(SC_USER_INFO).pipe(map$1((user) => user.isGuest));
|
|
7049
7109
|
/**
|
|
7050
7110
|
* Сервис работы с каталогом.
|
|
7051
7111
|
*/
|
|
@@ -7057,18 +7117,18 @@ class ScPaginationService {
|
|
|
7057
7117
|
// Избегаем множественных сигналов при одновременном изменении фильтров page$ и others$.
|
|
7058
7118
|
debounceTime(0),
|
|
7059
7119
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
7060
|
-
map((page) => ({ ...params, ...page })),
|
|
7120
|
+
map$1((page) => ({ ...params, ...page })),
|
|
7061
7121
|
// TODO: Заменить this.catalogService.getProducts$ на абстрактный метод сервиса по примеру `TuiTreeLoader`.
|
|
7062
|
-
switchMap((paginationParams) => this.authStatus$.pipe(switchMap(() => this.catalogService.getProducts$(paginationParams).pipe(startWith(null))))))), share());
|
|
7122
|
+
switchMap((paginationParams) => this.authStatus$.pipe(switchMap(() => this.catalogService.getProducts$(paginationParams).pipe(startWith$1(null))))))), share());
|
|
7063
7123
|
/**
|
|
7064
7124
|
* Объект данных пагинации с сохранением предыдущих значений для "разворачивания" списка товаров.
|
|
7065
7125
|
* Список сохраняется при переходе по страницам, до тех пор пока не будет получен сигнал `others$`.
|
|
7066
7126
|
*/
|
|
7067
|
-
this.dataAccumulated$ = this.others$.pipe(filter(tuiIsPresent), switchMap((params) => this.authStatus$.pipe(map(() => params))), switchMap((params) => this.page$.pipe(
|
|
7127
|
+
this.dataAccumulated$ = this.others$.pipe(filter(tuiIsPresent), switchMap((params) => this.authStatus$.pipe(map$1(() => params))), switchMap((params) => this.page$.pipe(
|
|
7068
7128
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
|
|
7069
|
-
map((page) => ({ ...params, ...page })),
|
|
7129
|
+
map$1((page) => ({ ...params, ...page })),
|
|
7070
7130
|
// TODO: Заменить this.catalogService.getProducts$ на абстрактный метод сервиса по примеру `TuiTreeLoader`.
|
|
7071
|
-
concatMap((paginationParams) => this.catalogService.getProducts$(paginationParams).pipe(startWith(null))),
|
|
7131
|
+
concatMap((paginationParams) => this.catalogService.getProducts$(paginationParams).pipe(startWith$1(null))),
|
|
7072
7132
|
// TODO: Заменить `ScProduct` на T тип.
|
|
7073
7133
|
scan(
|
|
7074
7134
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -7080,9 +7140,9 @@ class ScPaginationService {
|
|
|
7080
7140
|
value.data.unshift(...accumulator.data);
|
|
7081
7141
|
}
|
|
7082
7142
|
return [value, value];
|
|
7083
|
-
}, [null, null]), map(([paginate]) => paginate), takeWhile((paginate) => paginate === null || paginate.meta.currentPage < paginate.meta.lastPage, true))), share());
|
|
7143
|
+
}, [null, null]), map$1(([paginate]) => paginate), takeWhile((paginate) => paginate === null || paginate.meta.currentPage < paginate.meta.lastPage, true))), share());
|
|
7084
7144
|
this.others$
|
|
7085
|
-
.pipe(filter(tuiIsPresent), switchMap(() => this.nextPageClickEvent.pipe(scan((accumulator) => accumulator + 1, 1), startWith(1))), takeUntilDestroyed())
|
|
7145
|
+
.pipe(filter(tuiIsPresent), switchMap(() => this.nextPageClickEvent.pipe(scan((accumulator) => accumulator + 1, 1), startWith$1(1))), takeUntilDestroyed())
|
|
7086
7146
|
.subscribe((page) => {
|
|
7087
7147
|
this.patchPage({ page: page });
|
|
7088
7148
|
});
|
|
@@ -7315,7 +7375,7 @@ class ScReclamationService {
|
|
|
7315
7375
|
downloadReclamation$(reclamationId) {
|
|
7316
7376
|
return this.http
|
|
7317
7377
|
.get(`${this.urls.apiUrl}/reclamations/${reclamationId}/download`, { responseType: 'blob' })
|
|
7318
|
-
.pipe(map((reclamation) => new Blob([reclamation], { type: 'application/pdf' })));
|
|
7378
|
+
.pipe(map$1((reclamation) => new Blob([reclamation], { type: 'application/pdf' })));
|
|
7319
7379
|
}
|
|
7320
7380
|
/**
|
|
7321
7381
|
* Отправляет новое сообщение рекламации.
|
|
@@ -8074,7 +8134,7 @@ class ScVacanciesService {
|
|
|
8074
8134
|
.get(`${this.vacanciesData.apiUrl}?employer_id=${this.vacanciesData.employerId}&per_page=${perPage}&page=${page}`, {
|
|
8075
8135
|
context: new HttpContext().set(SC_IS_HEADER_REQUIRED, false).set(SC_CACHE_SETTINGS, new ScCacheSettings(true, this.cacheLifeTime.vacanciesData)),
|
|
8076
8136
|
})
|
|
8077
|
-
.pipe(map((result) => new ScVacanciesList(result)));
|
|
8137
|
+
.pipe(map$1((result) => new ScVacanciesList(result)));
|
|
8078
8138
|
}
|
|
8079
8139
|
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 }); }
|
|
8080
8140
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScVacanciesService, providedIn: 'root' }); }
|
|
@@ -8258,5 +8318,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
8258
8318
|
* Generated bundle index. Do not edit.
|
|
8259
8319
|
*/
|
|
8260
8320
|
|
|
8261
|
-
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 };
|
|
8321
|
+
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 };
|
|
8262
8322
|
//# sourceMappingURL=snabcentr-client-core.mjs.map
|