@infrab4a/connect-angular 4.21.0 → 4.21.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular-connect.module.d.ts +4 -0
- package/esm2020/angular-connect.module.mjs +119 -17
- package/esm2020/angular-hasura-graphql.module.mjs +1 -1
- package/esm2020/consts/backend-url.const.mjs +1 -1
- package/esm2020/interfaces/catalog-strategies.interface.mjs +2 -0
- package/esm2020/interfaces/category-facades.interface.mjs +2 -0
- package/esm2020/interfaces/index.mjs +3 -0
- package/esm2020/persistence/cookie-data-persistence.mjs +1 -1
- package/esm2020/services/cart/cart-services.facade.mjs +21 -0
- package/esm2020/services/cart/index.mjs +2 -0
- package/esm2020/services/cart.service.mjs +25 -38
- package/esm2020/services/catalog/adapters/new-category-structure.adapter.mjs +1 -1
- package/esm2020/services/catalog/adapters/old-category-structure.adapter.mjs +1 -1
- package/esm2020/services/catalog/catalog.service.mjs +80 -294
- package/esm2020/services/catalog/category.service.mjs +15 -27
- package/esm2020/services/catalog/context/catalog-search.context.mjs +40 -0
- package/esm2020/services/catalog/facades/catalog-service.facade.mjs +32 -0
- package/esm2020/services/catalog/facades/catalog-strategies.facade.mjs +17 -0
- package/esm2020/services/catalog/facades/category-repository.facade.mjs +20 -0
- package/esm2020/services/catalog/facades/category-service.facade.mjs +30 -0
- package/esm2020/services/catalog/facades/index.mjs +6 -0
- package/esm2020/services/catalog/facades/product-catalog.facade.mjs +21 -0
- package/esm2020/services/catalog/helpers/brand-manager.helper.mjs +57 -0
- package/esm2020/services/catalog/helpers/catalog-filter.helper.mjs +44 -0
- package/esm2020/services/catalog/helpers/catalog-sort.helper.mjs +52 -0
- package/esm2020/services/catalog/helpers/index.mjs +5 -0
- package/esm2020/services/catalog/helpers/product-fields.helper.mjs +39 -0
- package/esm2020/services/catalog/models/category-with-tree.model.mjs +1 -1
- package/esm2020/services/catalog/services/catalog-helpers.service.mjs +33 -0
- package/esm2020/services/catalog/services/catalog-operations.facade.mjs +26 -0
- package/esm2020/services/catalog/services/catalog-repository.service.mjs +25 -0
- package/esm2020/services/catalog/services/index.mjs +5 -0
- package/esm2020/services/catalog/services/product-management.facade.mjs +25 -0
- package/esm2020/services/catalog/strategies/category-search.strategy.mjs +133 -0
- package/esm2020/services/catalog/strategies/index.mjs +4 -0
- package/esm2020/services/catalog/strategies/profile-search.strategy.mjs +42 -0
- package/esm2020/services/catalog/strategies/term-search.strategy.mjs +126 -0
- package/esm2020/services/catalog/strategies/types/strategy-params.type.mjs +2 -0
- package/esm2020/services/catalog/types/fetch-products-options.type.mjs +2 -0
- package/esm2020/services/catalog/types/fetch-products-params.type.mjs +2 -0
- package/esm2020/services/catalog/types/fetch-products-response.type.mjs +2 -0
- package/esm2020/services/catalog/types/index.mjs +5 -1
- package/esm2020/services/catalog/types/method-params.type.mjs +2 -0
- package/esm2020/services/catalog/wishlist.service.mjs +92 -72
- package/esm2020/services/checkout/checkout-dependencies.facade.mjs +20 -0
- package/esm2020/services/checkout/checkout-repositories.facade.mjs +20 -0
- package/esm2020/services/checkout/index.mjs +3 -0
- package/esm2020/services/checkout-subscription.service.mjs +8 -3
- package/esm2020/services/checkout.service.mjs +34 -50
- package/esm2020/services/coupon/coupon-repositories.facade.mjs +24 -0
- package/esm2020/services/coupon/index.mjs +2 -0
- package/esm2020/services/coupon/types/coupon-params.type.mjs +2 -0
- package/esm2020/services/coupon.service.mjs +79 -59
- package/esm2020/services/helpers/util.helper.mjs +12 -12
- package/esm2020/services/home-shop/home-shop-repositories.facade.mjs +24 -0
- package/esm2020/services/home-shop/index.mjs +2 -0
- package/esm2020/services/home-shop.service.mjs +27 -33
- package/esm2020/services/shared/configuration.facade.mjs +29 -0
- package/esm2020/services/shared/index.mjs +2 -0
- package/fesm2015/infrab4a-connect-angular.mjs +1287 -566
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +1207 -533
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/interfaces/catalog-strategies.interface.d.ts +31 -0
- package/interfaces/category-facades.interface.d.ts +6 -0
- package/interfaces/index.d.ts +2 -0
- package/package.json +5 -3
- package/services/cart/cart-services.facade.d.ts +12 -0
- package/services/cart/index.d.ts +1 -0
- package/services/cart.service.d.ts +6 -11
- package/services/catalog/catalog.service.d.ts +11 -83
- package/services/catalog/category.service.d.ts +5 -7
- package/services/catalog/context/catalog-search.context.d.ts +14 -0
- package/services/catalog/facades/catalog-service.facade.d.ts +15 -0
- package/services/catalog/facades/catalog-strategies.facade.d.ts +10 -0
- package/services/catalog/facades/category-repository.facade.d.ts +9 -0
- package/services/catalog/facades/category-service.facade.d.ts +15 -0
- package/services/catalog/facades/index.d.ts +5 -0
- package/services/catalog/facades/product-catalog.facade.d.ts +10 -0
- package/services/catalog/helpers/brand-manager.helper.d.ts +14 -0
- package/services/catalog/helpers/catalog-filter.helper.d.ts +8 -0
- package/services/catalog/helpers/catalog-sort.helper.d.ts +7 -0
- package/services/catalog/helpers/index.d.ts +4 -0
- package/services/catalog/helpers/product-fields.helper.d.ts +7 -0
- package/services/catalog/services/catalog-helpers.service.d.ts +17 -0
- package/services/catalog/services/catalog-operations.facade.d.ts +13 -0
- package/services/catalog/services/catalog-repository.service.d.ts +12 -0
- package/services/catalog/services/index.d.ts +4 -0
- package/services/catalog/services/product-management.facade.d.ts +12 -0
- package/services/catalog/strategies/category-search.strategy.d.ts +19 -0
- package/services/catalog/strategies/index.d.ts +3 -0
- package/services/catalog/strategies/profile-search.strategy.d.ts +14 -0
- package/services/catalog/strategies/term-search.strategy.d.ts +20 -0
- package/services/catalog/strategies/types/strategy-params.type.d.ts +58 -0
- package/services/catalog/types/fetch-products-options.type.d.ts +8 -0
- package/services/catalog/types/fetch-products-params.type.d.ts +25 -0
- package/services/catalog/types/fetch-products-response.type.d.ts +19 -0
- package/services/catalog/types/index.d.ts +4 -0
- package/services/catalog/types/method-params.type.d.ts +17 -0
- package/services/catalog/wishlist.service.d.ts +12 -4
- package/services/checkout/checkout-dependencies.facade.d.ts +10 -0
- package/services/checkout/checkout-repositories.facade.d.ts +9 -0
- package/services/checkout/index.d.ts +2 -0
- package/services/checkout-subscription.service.d.ts +2 -2
- package/services/checkout.service.d.ts +7 -11
- package/services/coupon/coupon-repositories.facade.d.ts +10 -0
- package/services/coupon/index.d.ts +1 -0
- package/services/coupon/types/coupon-params.type.d.ts +13 -0
- package/services/coupon.service.d.ts +16 -7
- package/services/home-shop/home-shop-repositories.facade.d.ts +10 -0
- package/services/home-shop/index.d.ts +1 -0
- package/services/home-shop.service.d.ts +6 -6
- package/services/shared/configuration.facade.d.ts +12 -0
- package/services/shared/index.d.ts +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Category, Product, ProductGender, RepositoryCacheOptions, RepositoryFindResult, Shops } from '@infrab4a/connect';
|
|
2
|
+
export interface CatalogSearchParams {
|
|
3
|
+
category?: Category;
|
|
4
|
+
profile?: string[];
|
|
5
|
+
term?: string;
|
|
6
|
+
filters?: CatalogFilters;
|
|
7
|
+
mainGender?: ProductGender;
|
|
8
|
+
limits: {
|
|
9
|
+
limit?: number;
|
|
10
|
+
offset?: number;
|
|
11
|
+
};
|
|
12
|
+
sort?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CatalogFilters {
|
|
15
|
+
clubDiscount?: number[];
|
|
16
|
+
brands?: string[];
|
|
17
|
+
prices?: {
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
subscriberPrice?: boolean;
|
|
21
|
+
};
|
|
22
|
+
gender?: ProductGender[];
|
|
23
|
+
rate?: number;
|
|
24
|
+
customOptions?: string[];
|
|
25
|
+
tags?: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface CatalogSearchStrategy {
|
|
28
|
+
search(params: CatalogSearchParams, shop: Shops, optionsCache?: {
|
|
29
|
+
cache?: RepositoryCacheOptions;
|
|
30
|
+
}): Promise<RepositoryFindResult<Product>>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CategoryRepository, ProductSearchIndex, ProductStockNotificationRepository } from '@infrab4a/connect';
|
|
2
|
+
export interface ProductServicesFacade {
|
|
3
|
+
productStockNotificationRepository: ProductStockNotificationRepository;
|
|
4
|
+
categoryRepository: CategoryRepository;
|
|
5
|
+
productSearch: ProductSearchIndex;
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect-angular",
|
|
3
|
-
"version": "4.21.
|
|
3
|
+
"version": "4.21.1-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
"@angular/common": "^15.1.4",
|
|
13
13
|
"@angular/core": "^15.1.4",
|
|
14
14
|
"@angular/fire": "7.5.0",
|
|
15
|
-
"@infrab4a/connect": "4.
|
|
15
|
+
"@infrab4a/connect": "4.29.1-alpha.1",
|
|
16
|
+
"class-transformer": "^0.5.1",
|
|
16
17
|
"js-cookie": "^3.0.1",
|
|
17
|
-
"rxjs": "^6.6.7"
|
|
18
|
+
"rxjs": "^6.6.7",
|
|
19
|
+
"ts-custom-error": "^3.3.1"
|
|
18
20
|
},
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"js-cookie": "^3.0.1",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { AuthService } from '../auth.service';
|
|
3
|
+
import { CheckoutService } from '../checkout.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class CartServicesFacade {
|
|
6
|
+
readonly authService: AuthService;
|
|
7
|
+
readonly checkoutService: CheckoutService;
|
|
8
|
+
readonly httpClient: HttpClient;
|
|
9
|
+
constructor(authService: AuthService, checkoutService: CheckoutService, httpClient: HttpClient);
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CartServicesFacade, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CartServicesFacade>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CartServicesFacade } from './cart-services.facade';
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FirebaseOptions } from '@angular/fire/app';
|
|
3
|
-
import { LineItem, Shops, User } from '@infrab4a/connect';
|
|
1
|
+
import { LineItem, User } from '@infrab4a/connect';
|
|
4
2
|
import { Observable } from 'rxjs';
|
|
5
|
-
import { AuthService } from './auth.service';
|
|
6
|
-
import { CheckoutService } from './checkout.service';
|
|
7
3
|
import { RequiredCheckoutData } from './types';
|
|
4
|
+
import { CartServicesFacade } from './cart';
|
|
5
|
+
import { ConfigurationFacade } from './shared';
|
|
8
6
|
import * as i0 from "@angular/core";
|
|
9
7
|
export type Cart = {
|
|
10
8
|
[id: string]: LineItem;
|
|
11
9
|
};
|
|
12
10
|
export declare class CartService {
|
|
13
|
-
private readonly
|
|
14
|
-
private readonly
|
|
15
|
-
private readonly defaultShop;
|
|
16
|
-
private readonly firebaseOptions;
|
|
17
|
-
private http;
|
|
11
|
+
private readonly servicesFacade;
|
|
12
|
+
private readonly configurationFacade;
|
|
18
13
|
private cartSubject;
|
|
19
14
|
private checkoutUrl;
|
|
20
|
-
constructor(
|
|
15
|
+
constructor(servicesFacade: CartServicesFacade, configurationFacade: ConfigurationFacade);
|
|
21
16
|
addItem(item: LineItem, quantity?: number): Observable<Cart>;
|
|
22
17
|
decreaseItem(item: LineItem): Observable<Cart>;
|
|
23
18
|
removeItem(item: LineItem): Observable<Cart>;
|
|
@@ -1,96 +1,24 @@
|
|
|
1
|
-
import { Category,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Category, RepositoryCacheOptions, Shops } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogSearchContext } from './context/catalog-search.context';
|
|
3
|
+
import { CatalogHelpersService } from './services';
|
|
4
|
+
import { FetchProductsParams, FetchProductsResponse, StockNotificationParams } from './types';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
|
-
type FetchProductsFilters = {
|
|
6
|
-
clubDiscount?: number[];
|
|
7
|
-
brands?: string[];
|
|
8
|
-
prices?: {
|
|
9
|
-
min?: number;
|
|
10
|
-
max?: number;
|
|
11
|
-
subscriberPrice?: boolean;
|
|
12
|
-
};
|
|
13
|
-
gender?: ProductGender[];
|
|
14
|
-
rate?: number;
|
|
15
|
-
customOptions?: string[];
|
|
16
|
-
tags?: string[];
|
|
17
|
-
};
|
|
18
|
-
type FetchProductsOptions = {
|
|
19
|
-
page?: number;
|
|
20
|
-
perPage?: number;
|
|
21
|
-
sort?: ProductSort;
|
|
22
|
-
mainGender?: ProductGender;
|
|
23
|
-
};
|
|
24
|
-
type FetchProductsMainParams<T extends Category> = {
|
|
25
|
-
category?: T;
|
|
26
|
-
profile?: string[];
|
|
27
|
-
term?: string;
|
|
28
|
-
};
|
|
29
|
-
type FetchProductsParams<T extends Category> = FetchProductsOptions & ({
|
|
30
|
-
category: FetchProductsMainParams<T>['category'];
|
|
31
|
-
filters?: FetchProductsFilters & {
|
|
32
|
-
customOptions?: never;
|
|
33
|
-
};
|
|
34
|
-
} | {
|
|
35
|
-
profile: FetchProductsMainParams<T>['profile'];
|
|
36
|
-
filters?: FetchProductsFilters & {
|
|
37
|
-
customOptions?: never;
|
|
38
|
-
tags?: never;
|
|
39
|
-
};
|
|
40
|
-
} | {
|
|
41
|
-
term: FetchProductsMainParams<T>['term'];
|
|
42
|
-
filters?: FetchProductsFilters & {
|
|
43
|
-
customOptions?: never;
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
type FetchProductsResponse = {
|
|
47
|
-
products: {
|
|
48
|
-
data: Product[];
|
|
49
|
-
total: number;
|
|
50
|
-
};
|
|
51
|
-
pages: number;
|
|
52
|
-
prices: {
|
|
53
|
-
price: {
|
|
54
|
-
min: number;
|
|
55
|
-
max: number;
|
|
56
|
-
};
|
|
57
|
-
subscriberPrice: {
|
|
58
|
-
min: number;
|
|
59
|
-
max: number;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
brands?: string[];
|
|
63
|
-
};
|
|
64
6
|
export declare class CatalogService<T extends Category = Category> {
|
|
65
|
-
private readonly
|
|
66
|
-
private readonly
|
|
67
|
-
private readonly categoryRepository;
|
|
68
|
-
private readonly categoryStructureAdapter;
|
|
7
|
+
private readonly searchContext;
|
|
8
|
+
private readonly helpersService;
|
|
69
9
|
private readonly shop;
|
|
70
|
-
|
|
71
|
-
private productsByTerm;
|
|
72
|
-
private brandsList;
|
|
73
|
-
private fields;
|
|
74
|
-
constructor(productRepository: ProductRepository, productStockNotificationRepository: ProductStockNotificationRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops, productSearch: ProductSearchIndex);
|
|
10
|
+
constructor(searchContext: CatalogSearchContext, helpersService: CatalogHelpersService, shop: Shops);
|
|
75
11
|
fetchProducts(options: FetchProductsParams<T>, optionsCache?: {
|
|
76
12
|
cache?: RepositoryCacheOptions;
|
|
77
13
|
}): Promise<FetchProductsResponse>;
|
|
78
|
-
addCustomerToStockNotification(
|
|
79
|
-
private
|
|
80
|
-
private
|
|
81
|
-
private
|
|
82
|
-
private findCatalogAndSortByMostRevelantByTerm;
|
|
83
|
-
private findCatalogIdsBySearch;
|
|
84
|
-
private fetchBrandsOnly;
|
|
85
|
-
private setBrandsList;
|
|
86
|
-
private buildFilterQuery;
|
|
87
|
-
private buildSortQuery;
|
|
14
|
+
addCustomerToStockNotification(params: StockNotificationParams): Promise<void>;
|
|
15
|
+
private validateRequest;
|
|
16
|
+
private buildSearchParams;
|
|
17
|
+
private buildResponse;
|
|
88
18
|
private buildLimitQuery;
|
|
89
19
|
private hasProfile;
|
|
90
20
|
private hasTerm;
|
|
91
21
|
private hasCategory;
|
|
92
|
-
private buildIndexBrands;
|
|
93
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogService<any>, never>;
|
|
94
23
|
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogService<any>>;
|
|
95
24
|
}
|
|
96
|
-
export {};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { Category,
|
|
2
|
-
import {
|
|
1
|
+
import { Category, Filter, ProductGender, RepositoryCacheOptions, Shops } from '@infrab4a/connect';
|
|
2
|
+
import { CategoryRepositoryFacade, ProductCatalogFacade } from './facades';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
type FetchBrandsOptions = {
|
|
5
5
|
mainGender?: ProductGender;
|
|
6
6
|
shop?: Shops;
|
|
7
7
|
};
|
|
8
8
|
export declare class CategoryService {
|
|
9
|
-
private readonly
|
|
10
|
-
private readonly
|
|
11
|
-
private readonly categoryFilterRepository;
|
|
12
|
-
private readonly categoryStructureAdapter;
|
|
9
|
+
private readonly categoryFacade;
|
|
10
|
+
private readonly productCatalog;
|
|
13
11
|
private readonly shop;
|
|
14
|
-
constructor(
|
|
12
|
+
constructor(categoryFacade: CategoryRepositoryFacade, productCatalog: ProductCatalogFacade, shop: Shops);
|
|
15
13
|
fetchBrands(category: Category, options?: FetchBrandsOptions, optionsCache?: {
|
|
16
14
|
cache?: RepositoryCacheOptions;
|
|
17
15
|
}): Promise<Category[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Product, RepositoryCacheOptions, RepositoryFindResult, Shops } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogSearchParams, CatalogSearchStrategy } from '../../../interfaces';
|
|
3
|
+
export declare class CatalogSearchContext {
|
|
4
|
+
private readonly categoryStrategy;
|
|
5
|
+
private readonly termStrategy;
|
|
6
|
+
private readonly profileStrategy;
|
|
7
|
+
private strategies;
|
|
8
|
+
constructor(categoryStrategy: CatalogSearchStrategy, termStrategy: CatalogSearchStrategy, profileStrategy: CatalogSearchStrategy);
|
|
9
|
+
executeSearch(params: CatalogSearchParams, shop: Shops, optionsCache?: {
|
|
10
|
+
cache?: RepositoryCacheOptions;
|
|
11
|
+
}): Promise<RepositoryFindResult<Product>>;
|
|
12
|
+
private initializeStrategies;
|
|
13
|
+
private selectStrategy;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Shops } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogService } from '../catalog.service';
|
|
3
|
+
import { CatalogHelpersService } from '../services';
|
|
4
|
+
import { CatalogStrategiesFacade } from './catalog-strategies.facade';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class CatalogServiceFacade {
|
|
7
|
+
private readonly helpersService;
|
|
8
|
+
private readonly strategiesFacade;
|
|
9
|
+
private readonly shop;
|
|
10
|
+
private catalogService;
|
|
11
|
+
constructor(helpersService: CatalogHelpersService, strategiesFacade: CatalogStrategiesFacade, shop: Shops);
|
|
12
|
+
getCatalogService(): CatalogService;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogServiceFacade, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogServiceFacade>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CategorySearchStrategy, ProfileSearchStrategy, TermSearchStrategy } from '../strategies';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class CatalogStrategiesFacade {
|
|
4
|
+
readonly categoryStrategy: CategorySearchStrategy;
|
|
5
|
+
readonly termStrategy: TermSearchStrategy;
|
|
6
|
+
readonly profileStrategy: ProfileSearchStrategy;
|
|
7
|
+
constructor(categoryStrategy: CategorySearchStrategy, termStrategy: TermSearchStrategy, profileStrategy: ProfileSearchStrategy);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogStrategiesFacade, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogStrategiesFacade>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CategoryFilterRepository, CategoryRepository } from '@infrab4a/connect';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class CategoryRepositoryFacade {
|
|
4
|
+
readonly categoryRepository: CategoryRepository;
|
|
5
|
+
readonly categoryFilterRepository: CategoryFilterRepository;
|
|
6
|
+
constructor(categoryRepository: CategoryRepository, categoryFilterRepository: CategoryFilterRepository);
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CategoryRepositoryFacade, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CategoryRepositoryFacade>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Shops } from '@infrab4a/connect';
|
|
2
|
+
import { CategoryService } from '../category.service';
|
|
3
|
+
import { CategoryRepositoryFacade } from './category-repository.facade';
|
|
4
|
+
import { ProductCatalogFacade } from './product-catalog.facade';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class CategoryServiceFacade {
|
|
7
|
+
private readonly categoryRepositoryFacade;
|
|
8
|
+
private readonly productCatalogFacade;
|
|
9
|
+
private readonly shop;
|
|
10
|
+
private categoryService;
|
|
11
|
+
constructor(categoryRepositoryFacade: CategoryRepositoryFacade, productCatalogFacade: ProductCatalogFacade, shop: Shops);
|
|
12
|
+
getCategoryService(): CategoryService;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CategoryServiceFacade, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CategoryServiceFacade>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CatalogServiceFacade } from './catalog-service.facade';
|
|
2
|
+
export { CatalogStrategiesFacade } from './catalog-strategies.facade';
|
|
3
|
+
export { CategoryRepositoryFacade } from './category-repository.facade';
|
|
4
|
+
export { CategoryServiceFacade } from './category-service.facade';
|
|
5
|
+
export { ProductCatalogFacade } from './product-catalog.facade';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProductRepository } from '@infrab4a/connect';
|
|
2
|
+
import { CategoryStructureAdapter } from '../adapters';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ProductCatalogFacade {
|
|
5
|
+
readonly productRepository: ProductRepository;
|
|
6
|
+
readonly categoryStructureAdapter: CategoryStructureAdapter;
|
|
7
|
+
constructor(productRepository: ProductRepository, categoryStructureAdapter: CategoryStructureAdapter);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProductCatalogFacade, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ProductCatalogFacade>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CatalogSearchParams } from '../../../interfaces';
|
|
2
|
+
import { ProductCatalogFacade } from '../facades';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class BrandManagerHelper {
|
|
5
|
+
private readonly productCatalog;
|
|
6
|
+
private brandsList;
|
|
7
|
+
constructor(productCatalog: ProductCatalogFacade);
|
|
8
|
+
setBrandsList(options: CatalogSearchParams, brands: string[]): Promise<void>;
|
|
9
|
+
getBrandsList(indexKey: string): string[];
|
|
10
|
+
buildIndexBrands(options: CatalogSearchParams): string;
|
|
11
|
+
private fetchBrandsOnly;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrandManagerHelper, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BrandManagerHelper>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Product, RepositoryFindFielters } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogFilters } from '../../../interfaces';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CatalogFilterHelper {
|
|
5
|
+
buildFilterQuery(filters: CatalogFilters): RepositoryFindFielters<Product>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogFilterHelper, never>;
|
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogFilterHelper>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Product, RepositoryOrderBy } from '@infrab4a/connect';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class CatalogSortHelper {
|
|
4
|
+
buildSortQuery(sort: string): RepositoryOrderBy<Product>;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogSortHelper, never>;
|
|
6
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogSortHelper>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NonFunctionPropertyNames, Product } from '@infrab4a/connect';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ProductFieldsHelper {
|
|
4
|
+
getStandardFields(): NonFunctionPropertyNames<Product>[];
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProductFieldsHelper, never>;
|
|
6
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ProductFieldsHelper>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ProductServicesFacade } from '../../../interfaces';
|
|
2
|
+
import { BrandManagerHelper, CatalogFilterHelper, CatalogSortHelper, ProductFieldsHelper } from '../helpers';
|
|
3
|
+
import { CatalogOperationsFacade } from './catalog-operations.facade';
|
|
4
|
+
import { ProductManagementFacade } from './product-management.facade';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class CatalogHelpersService {
|
|
7
|
+
private readonly catalogOperations;
|
|
8
|
+
private readonly productManagement;
|
|
9
|
+
constructor(catalogOperations: CatalogOperationsFacade, productManagement: ProductManagementFacade);
|
|
10
|
+
getFilterHelper(): CatalogFilterHelper;
|
|
11
|
+
getSortHelper(): CatalogSortHelper;
|
|
12
|
+
getFieldsHelper(): ProductFieldsHelper;
|
|
13
|
+
getBrandManager(): BrandManagerHelper;
|
|
14
|
+
getProductServices(): ProductServicesFacade;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogHelpersService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogHelpersService>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CatalogFilterHelper, CatalogSortHelper, ProductFieldsHelper } from '../helpers';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class CatalogOperationsFacade {
|
|
4
|
+
private readonly filterHelper;
|
|
5
|
+
private readonly sortHelper;
|
|
6
|
+
private readonly fieldsHelper;
|
|
7
|
+
constructor(filterHelper: CatalogFilterHelper, sortHelper: CatalogSortHelper, fieldsHelper: ProductFieldsHelper);
|
|
8
|
+
getFilterHelper(): CatalogFilterHelper;
|
|
9
|
+
getSortHelper(): CatalogSortHelper;
|
|
10
|
+
getFieldsHelper(): ProductFieldsHelper;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogOperationsFacade, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogOperationsFacade>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProductServicesFacade } from '../../../interfaces';
|
|
2
|
+
import { ProductCatalogFacade } from '../facades';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CatalogRepositoryService {
|
|
5
|
+
private readonly productCatalog;
|
|
6
|
+
private readonly productServices;
|
|
7
|
+
constructor(productCatalog: ProductCatalogFacade, productServices: ProductServicesFacade);
|
|
8
|
+
getProductCatalog(): ProductCatalogFacade;
|
|
9
|
+
getProductServices(): ProductServicesFacade;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogRepositoryService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogRepositoryService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProductServicesFacade } from '../../../interfaces';
|
|
2
|
+
import { BrandManagerHelper } from '../helpers';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ProductManagementFacade {
|
|
5
|
+
private readonly brandManager;
|
|
6
|
+
private readonly productServices;
|
|
7
|
+
constructor(brandManager: BrandManagerHelper, productServices: ProductServicesFacade);
|
|
8
|
+
getBrandManager(): BrandManagerHelper;
|
|
9
|
+
getProductServices(): ProductServicesFacade;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProductManagementFacade, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ProductManagementFacade>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Product, RepositoryCacheOptions, RepositoryFindResult, Shops } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogSearchParams, CatalogSearchStrategy } from '../../../interfaces';
|
|
3
|
+
import { CatalogHelpersService, CatalogRepositoryService } from '../services';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class CategorySearchStrategy implements CatalogSearchStrategy {
|
|
6
|
+
private readonly repositoryService;
|
|
7
|
+
private readonly helpersService;
|
|
8
|
+
constructor(repositoryService: CatalogRepositoryService, helpersService: CatalogHelpersService);
|
|
9
|
+
search(params: CatalogSearchParams, shop: Shops, optionsCache?: {
|
|
10
|
+
cache?: RepositoryCacheOptions;
|
|
11
|
+
}): Promise<RepositoryFindResult<Product>>;
|
|
12
|
+
private searchWithMostRelevant;
|
|
13
|
+
private searchDefault;
|
|
14
|
+
private getProductIds;
|
|
15
|
+
private findAndSortByMostRelevant;
|
|
16
|
+
private sortProductsByRelevance;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CategorySearchStrategy, never>;
|
|
18
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CategorySearchStrategy>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Product, RepositoryCacheOptions, RepositoryFindResult, Shops } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogSearchParams, CatalogSearchStrategy } from '../../../interfaces';
|
|
3
|
+
import { CatalogHelpersService, CatalogRepositoryService } from '../services';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ProfileSearchStrategy implements CatalogSearchStrategy {
|
|
6
|
+
private readonly repositoryService;
|
|
7
|
+
private readonly helpersService;
|
|
8
|
+
constructor(repositoryService: CatalogRepositoryService, helpersService: CatalogHelpersService);
|
|
9
|
+
search(params: CatalogSearchParams, shop: Shops, optionsCache?: {
|
|
10
|
+
cache?: RepositoryCacheOptions;
|
|
11
|
+
}): Promise<RepositoryFindResult<Product>>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProfileSearchStrategy, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ProfileSearchStrategy>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Product, RepositoryCacheOptions, RepositoryFindResult, Shops } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogSearchParams, CatalogSearchStrategy } from '../../../interfaces';
|
|
3
|
+
import { CatalogHelpersService, CatalogRepositoryService } from '../services';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TermSearchStrategy implements CatalogSearchStrategy {
|
|
6
|
+
private readonly repositoryService;
|
|
7
|
+
private readonly helpersService;
|
|
8
|
+
private productsByTerm;
|
|
9
|
+
constructor(repositoryService: CatalogRepositoryService, helpersService: CatalogHelpersService);
|
|
10
|
+
search(params: CatalogSearchParams, shop: Shops, _optionsCache?: {
|
|
11
|
+
cache?: RepositoryCacheOptions;
|
|
12
|
+
}): Promise<RepositoryFindResult<Product>>;
|
|
13
|
+
private searchWithMostRelevant;
|
|
14
|
+
private searchDefault;
|
|
15
|
+
private sortByTermRelevance;
|
|
16
|
+
private getDetailedProducts;
|
|
17
|
+
private findCatalogIdsBySearch;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TermSearchStrategy, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TermSearchStrategy>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { RepositoryCacheOptions, Shops } from '@infrab4a/connect';
|
|
2
|
+
export type SearchWithMostRelevantParams = {
|
|
3
|
+
category: any;
|
|
4
|
+
filters: any;
|
|
5
|
+
limits: any;
|
|
6
|
+
shop: Shops;
|
|
7
|
+
mainGender: any;
|
|
8
|
+
optionsCache: {
|
|
9
|
+
cache?: RepositoryCacheOptions;
|
|
10
|
+
} | undefined;
|
|
11
|
+
fields: any;
|
|
12
|
+
};
|
|
13
|
+
export type SearchDefaultParams = {
|
|
14
|
+
category: any;
|
|
15
|
+
filters: any;
|
|
16
|
+
limits: any;
|
|
17
|
+
shop: Shops;
|
|
18
|
+
mainGender: any;
|
|
19
|
+
sort: any;
|
|
20
|
+
optionsCache: {
|
|
21
|
+
cache?: RepositoryCacheOptions;
|
|
22
|
+
} | undefined;
|
|
23
|
+
fields: any;
|
|
24
|
+
};
|
|
25
|
+
export type FindAndSortByMostRelevantParams = {
|
|
26
|
+
mostRelevants: string[];
|
|
27
|
+
productIds: string[];
|
|
28
|
+
filters: any;
|
|
29
|
+
limits: any;
|
|
30
|
+
shop: Shops;
|
|
31
|
+
mainGender: any;
|
|
32
|
+
optionsCache: {
|
|
33
|
+
cache?: RepositoryCacheOptions;
|
|
34
|
+
} | undefined;
|
|
35
|
+
fields: any;
|
|
36
|
+
};
|
|
37
|
+
export type TermSearchMostRelevantParams = {
|
|
38
|
+
productIds: string[];
|
|
39
|
+
filters: any;
|
|
40
|
+
limits: any;
|
|
41
|
+
mainGender: any;
|
|
42
|
+
shop: Shops;
|
|
43
|
+
};
|
|
44
|
+
export type TermSearchDefaultParams = {
|
|
45
|
+
productIds: string[];
|
|
46
|
+
filters: any;
|
|
47
|
+
limits: any;
|
|
48
|
+
mainGender: any;
|
|
49
|
+
shop: Shops;
|
|
50
|
+
fields: any;
|
|
51
|
+
};
|
|
52
|
+
export type SortByTermRelevanceParams = {
|
|
53
|
+
productIds: string[];
|
|
54
|
+
totalResult: any;
|
|
55
|
+
limits: any;
|
|
56
|
+
filters: any;
|
|
57
|
+
fieldsHelper: any;
|
|
58
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Category } from '@infrab4a/connect';
|
|
2
|
+
import { CatalogFilters } from '../../../interfaces';
|
|
3
|
+
import { FetchProductsOptions } from './fetch-products-options.type';
|
|
4
|
+
export type FetchProductsMainParams<T extends Category> = {
|
|
5
|
+
category?: T;
|
|
6
|
+
profile?: string[];
|
|
7
|
+
term?: string;
|
|
8
|
+
};
|
|
9
|
+
export type FetchProductsParams<T extends Category> = FetchProductsOptions & ({
|
|
10
|
+
category: FetchProductsMainParams<T>['category'];
|
|
11
|
+
filters?: CatalogFilters & {
|
|
12
|
+
customOptions?: never;
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
profile: FetchProductsMainParams<T>['profile'];
|
|
16
|
+
filters?: CatalogFilters & {
|
|
17
|
+
customOptions?: never;
|
|
18
|
+
tags?: never;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
term: FetchProductsMainParams<T>['term'];
|
|
22
|
+
filters?: CatalogFilters & {
|
|
23
|
+
customOptions?: never;
|
|
24
|
+
};
|
|
25
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Product } from '@infrab4a/connect';
|
|
2
|
+
export type FetchProductsResponse = {
|
|
3
|
+
products: {
|
|
4
|
+
data: Product[];
|
|
5
|
+
total: number;
|
|
6
|
+
};
|
|
7
|
+
pages: number;
|
|
8
|
+
prices: {
|
|
9
|
+
price: {
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
};
|
|
13
|
+
subscriberPrice: {
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
brands?: string[];
|
|
19
|
+
};
|