@infrab4a/connect-angular 4.14.0 → 4.14.1-beta.0

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.
Files changed (121) hide show
  1. package/angular-connect.module.d.ts +29 -29
  2. package/angular-elastic-search.module.d.ts +9 -9
  3. package/angular-firebase-auth.module.d.ts +11 -11
  4. package/angular-firestore.module.d.ts +17 -17
  5. package/angular-hasura-graphql.module.d.ts +16 -16
  6. package/angular-vertex-search.module.d.ts +9 -9
  7. package/consts/backend-url.const.d.ts +1 -1
  8. package/consts/category-structure.d.ts +1 -1
  9. package/consts/default-shop.const.d.ts +1 -1
  10. package/consts/es-config.const.d.ts +1 -1
  11. package/consts/firebase-const.d.ts +3 -3
  12. package/consts/hasura-options.const.d.ts +1 -1
  13. package/consts/index.d.ts +8 -8
  14. package/consts/persistence.const.d.ts +1 -1
  15. package/consts/storage-base-url.const.d.ts +1 -1
  16. package/consts/vertex-config.const.d.ts +1 -1
  17. package/esm2022/angular-connect.module.mjs +146 -0
  18. package/esm2022/angular-elastic-search.module.mjs +34 -0
  19. package/esm2022/angular-firebase-auth.module.mjs +115 -0
  20. package/esm2022/angular-firestore.module.mjs +513 -0
  21. package/esm2022/angular-hasura-graphql.module.mjs +287 -0
  22. package/esm2022/angular-vertex-search.module.mjs +34 -0
  23. package/{esm2020 → esm2022}/consts/backend-url.const.mjs +1 -1
  24. package/{esm2020 → esm2022}/consts/category-structure.mjs +2 -2
  25. package/{esm2020 → esm2022}/consts/default-shop.const.mjs +2 -2
  26. package/{esm2020 → esm2022}/consts/es-config.const.mjs +2 -2
  27. package/{esm2020 → esm2022}/consts/firebase-const.mjs +4 -4
  28. package/{esm2020 → esm2022}/consts/hasura-options.const.mjs +2 -2
  29. package/{esm2020 → esm2022}/consts/index.mjs +9 -9
  30. package/{esm2020 → esm2022}/consts/persistence.const.mjs +2 -2
  31. package/{esm2020 → esm2022}/consts/storage-base-url.const.mjs +2 -2
  32. package/{esm2020 → esm2022}/consts/vertex-config.const.mjs +2 -2
  33. package/{esm2020 → esm2022}/helpers/index.mjs +2 -2
  34. package/{esm2020 → esm2022}/helpers/mobile-operation-system-checker.helper.mjs +7 -7
  35. package/{esm2020 → esm2022}/index.mjs +7 -7
  36. package/{esm2020 → esm2022}/infrab4a-connect-angular.mjs +4 -4
  37. package/{esm2020 → esm2022}/persistence/cookie-data-persistence.mjs +22 -22
  38. package/{esm2020 → esm2022}/persistence/data-persistence.mjs +2 -2
  39. package/{esm2020 → esm2022}/persistence/index.mjs +3 -3
  40. package/{esm2020 → esm2022}/services/auth.service.mjs +37 -37
  41. package/esm2022/services/cart.service.mjs +293 -0
  42. package/{esm2020 → esm2022}/services/catalog/adapters/category-structure.adapter.mjs +2 -2
  43. package/{esm2020 → esm2022}/services/catalog/adapters/index.mjs +4 -4
  44. package/{esm2020 → esm2022}/services/catalog/adapters/new-category-structure.adapter.mjs +43 -43
  45. package/{esm2020 → esm2022}/services/catalog/adapters/old-category-structure.adapter.mjs +23 -23
  46. package/{esm2020 → esm2022}/services/catalog/catalog.service.mjs +241 -241
  47. package/{esm2020 → esm2022}/services/catalog/category.service.mjs +51 -51
  48. package/{esm2020 → esm2022}/services/catalog/enums/index.mjs +2 -2
  49. package/{esm2020 → esm2022}/services/catalog/enums/product-sorts.enum.mjs +11 -11
  50. package/{esm2020 → esm2022}/services/catalog/index.mjs +8 -8
  51. package/{esm2020 → esm2022}/services/catalog/models/category-with-tree.model.mjs +10 -10
  52. package/{esm2020 → esm2022}/services/catalog/models/index.mjs +2 -2
  53. package/{esm2020 → esm2022}/services/catalog/types/index.mjs +2 -2
  54. package/{esm2020 → esm2022}/services/catalog/types/product-sort.type.mjs +2 -2
  55. package/{esm2020 → esm2022}/services/catalog/wishlist.service.mjs +237 -237
  56. package/{esm2020 → esm2022}/services/checkout-subscription.service.mjs +50 -50
  57. package/{esm2020 → esm2022}/services/checkout.service.mjs +68 -68
  58. package/{esm2020 → esm2022}/services/coupon.service.mjs +274 -274
  59. package/{esm2020 → esm2022}/services/helpers/index.mjs +2 -2
  60. package/{esm2020 → esm2022}/services/helpers/util.helper.mjs +18 -18
  61. package/{esm2020 → esm2022}/services/home-shop.service.mjs +125 -125
  62. package/{esm2020 → esm2022}/services/index.mjs +11 -11
  63. package/{esm2020 → esm2022}/services/order.service.mjs +30 -30
  64. package/{esm2020 → esm2022}/services/shipping.service.mjs +96 -96
  65. package/{esm2020 → esm2022}/services/types/index.mjs +3 -3
  66. package/{esm2020 → esm2022}/services/types/required-checkout-data.type.mjs +2 -2
  67. package/{esm2020 → esm2022}/services/types/required-checkout-subscription-data.type.mjs +2 -2
  68. package/esm2022/services/types/shipping-methods.type.mjs +2 -0
  69. package/{esm2020 → esm2022}/types/firebase-app-config.type.mjs +2 -2
  70. package/{esm2020 → esm2022}/types/index.mjs +2 -2
  71. package/{fesm2020 → fesm2022}/infrab4a-connect-angular.mjs +2589 -2593
  72. package/fesm2022/infrab4a-connect-angular.mjs.map +1 -0
  73. package/helpers/index.d.ts +1 -1
  74. package/helpers/mobile-operation-system-checker.helper.d.ts +3 -3
  75. package/index.d.ts +6 -6
  76. package/package.json +6 -12
  77. package/persistence/cookie-data-persistence.d.ts +10 -10
  78. package/persistence/data-persistence.d.ts +6 -6
  79. package/persistence/index.d.ts +2 -2
  80. package/services/auth.service.d.ts +18 -18
  81. package/services/cart.service.d.ts +43 -43
  82. package/services/catalog/adapters/category-structure.adapter.d.ts +4 -4
  83. package/services/catalog/adapters/index.d.ts +3 -3
  84. package/services/catalog/adapters/new-category-structure.adapter.d.ts +12 -12
  85. package/services/catalog/adapters/old-category-structure.adapter.d.ts +10 -10
  86. package/services/catalog/catalog.service.d.ts +89 -89
  87. package/services/catalog/category.service.d.ts +20 -20
  88. package/services/catalog/enums/index.d.ts +1 -1
  89. package/services/catalog/enums/product-sorts.enum.d.ts +9 -9
  90. package/services/catalog/index.d.ts +7 -7
  91. package/services/catalog/models/category-with-tree.model.d.ts +4 -4
  92. package/services/catalog/models/index.d.ts +1 -1
  93. package/services/catalog/types/index.d.ts +1 -1
  94. package/services/catalog/types/product-sort.type.d.ts +2 -2
  95. package/services/catalog/wishlist.service.d.ts +50 -50
  96. package/services/checkout-subscription.service.d.ts +19 -19
  97. package/services/checkout.service.d.ts +27 -27
  98. package/services/coupon.service.d.ts +33 -33
  99. package/services/helpers/index.d.ts +1 -1
  100. package/services/helpers/util.helper.d.ts +3 -3
  101. package/services/home-shop.service.d.ts +26 -26
  102. package/services/index.d.ts +10 -10
  103. package/services/order.service.d.ts +13 -13
  104. package/services/shipping.service.d.ts +19 -19
  105. package/services/types/index.d.ts +2 -2
  106. package/services/types/required-checkout-data.type.d.ts +2 -2
  107. package/services/types/required-checkout-subscription-data.type.d.ts +2 -2
  108. package/services/types/shipping-methods.type.d.ts +12 -12
  109. package/types/firebase-app-config.type.d.ts +1 -1
  110. package/types/index.d.ts +1 -1
  111. package/esm2020/angular-connect.module.mjs +0 -146
  112. package/esm2020/angular-elastic-search.module.mjs +0 -34
  113. package/esm2020/angular-firebase-auth.module.mjs +0 -115
  114. package/esm2020/angular-firestore.module.mjs +0 -513
  115. package/esm2020/angular-hasura-graphql.module.mjs +0 -287
  116. package/esm2020/angular-vertex-search.module.mjs +0 -34
  117. package/esm2020/services/cart.service.mjs +0 -297
  118. package/esm2020/services/types/shipping-methods.type.mjs +0 -2
  119. package/fesm2015/infrab4a-connect-angular.mjs +0 -2740
  120. package/fesm2015/infrab4a-connect-angular.mjs.map +0 -1
  121. package/fesm2020/infrab4a-connect-angular.mjs.map +0 -1
@@ -1,2 +1,2 @@
1
- export * from './cookie-data-persistence';
2
- export * from './data-persistence';
1
+ export * from './cookie-data-persistence';
2
+ export * from './data-persistence';
@@ -1,18 +1,18 @@
1
- import { Auth, User as FirebaseUser } from '@angular/fire/auth';
2
- import { User, UserRepository } from '@infrab4a/connect';
3
- import { Observable } from 'rxjs';
4
- import * as i0 from "@angular/core";
5
- export declare class AuthService {
6
- private readonly angularFireAuth;
7
- private readonly userRepository;
8
- constructor(angularFireAuth: Auth, userRepository: UserRepository);
9
- getAuthstate(): Observable<{
10
- user: User;
11
- isAnonymous: boolean;
12
- }>;
13
- getUser(): Observable<User>;
14
- getTokenId(): Observable<string>;
15
- getFireUser(): Observable<FirebaseUser>;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
18
- }
1
+ import { Auth, User as FirebaseUser } from '@angular/fire/auth';
2
+ import { User, UserRepository } from '@infrab4a/connect';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class AuthService {
6
+ private readonly angularFireAuth;
7
+ private readonly userRepository;
8
+ constructor(angularFireAuth: Auth, userRepository: UserRepository);
9
+ getAuthstate(): Observable<{
10
+ user: User;
11
+ isAnonymous: boolean;
12
+ }>;
13
+ getUser(): Observable<User>;
14
+ getTokenId(): Observable<string>;
15
+ getFireUser(): Observable<FirebaseUser>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
18
+ }
@@ -1,43 +1,43 @@
1
- import { Buy2WinFirestoreRepository, CategoryRepository, LineItem, ProductRepository, Shops, User, VariantRepository } from '@infrab4a/connect';
2
- import { Observable } from 'rxjs';
3
- import { AuthService } from './auth.service';
4
- import { CheckoutService } from './checkout.service';
5
- import { RequiredCheckoutData } from './types';
6
- import * as i0 from "@angular/core";
7
- export type Cart = {
8
- [id: string]: LineItem;
9
- };
10
- export declare class CartService {
11
- private readonly authService;
12
- private readonly checkoutService;
13
- private readonly defaultShop;
14
- private readonly productRepository;
15
- private readonly categoryRepository;
16
- private readonly variantRepository;
17
- private readonly buy2WinRepository;
18
- private cartSubject;
19
- private user;
20
- constructor(authService: AuthService, checkoutService: CheckoutService, defaultShop: Shops, productRepository: ProductRepository, categoryRepository: CategoryRepository, variantRepository: VariantRepository, buy2WinRepository: Buy2WinFirestoreRepository);
21
- addItem(item: LineItem, quantity?: number): Observable<Cart>;
22
- decreaseItem(item: LineItem): Observable<Cart>;
23
- getCart(checkout?: RequiredCheckoutData): Observable<Cart>;
24
- /**
25
- * @deprecated The method should not be used
26
- */
27
- getVariantPriceDiscount(item: LineItem): Observable<number>;
28
- removeItem(item: LineItem): Observable<Cart>;
29
- updateUserCart(user: User): Observable<Cart>;
30
- clearCart(): Observable<Cart>;
31
- private buildCartFromCheckout;
32
- private updateLineItemInCart;
33
- private generateCartObject;
34
- private buildLineItem;
35
- private roundPrice;
36
- private getProductData;
37
- private getProductPrice;
38
- private checkMaxStock;
39
- getGifts(): Observable<Cart>;
40
- private giftToLineItems;
41
- static ɵfac: i0.ɵɵFactoryDeclaration<CartService, never>;
42
- static ɵprov: i0.ɵɵInjectableDeclaration<CartService>;
43
- }
1
+ import { Buy2WinFirestoreRepository, CategoryRepository, LineItem, ProductRepository, Shops, User, VariantRepository } from '@infrab4a/connect';
2
+ import { Observable } from 'rxjs';
3
+ import { AuthService } from './auth.service';
4
+ import { CheckoutService } from './checkout.service';
5
+ import { RequiredCheckoutData } from './types';
6
+ import * as i0 from "@angular/core";
7
+ export type Cart = {
8
+ [id: string]: LineItem;
9
+ };
10
+ export declare class CartService {
11
+ private readonly authService;
12
+ private readonly checkoutService;
13
+ private readonly defaultShop;
14
+ private readonly productRepository;
15
+ private readonly categoryRepository;
16
+ private readonly variantRepository;
17
+ private readonly buy2WinRepository;
18
+ private cartSubject;
19
+ private user;
20
+ constructor(authService: AuthService, checkoutService: CheckoutService, defaultShop: Shops, productRepository: ProductRepository, categoryRepository: CategoryRepository, variantRepository: VariantRepository, buy2WinRepository: Buy2WinFirestoreRepository);
21
+ addItem(item: LineItem, quantity?: number): Observable<Cart>;
22
+ decreaseItem(item: LineItem): Observable<Cart>;
23
+ getCart(checkout?: RequiredCheckoutData): Observable<Cart>;
24
+ /**
25
+ * @deprecated The method should not be used
26
+ */
27
+ getVariantPriceDiscount(item: LineItem): Observable<number>;
28
+ removeItem(item: LineItem): Observable<Cart>;
29
+ updateUserCart(user: User): Observable<Cart>;
30
+ clearCart(): Observable<Cart>;
31
+ private buildCartFromCheckout;
32
+ private updateLineItemInCart;
33
+ private generateCartObject;
34
+ private buildLineItem;
35
+ private roundPrice;
36
+ private getProductData;
37
+ private getProductPrice;
38
+ private checkMaxStock;
39
+ getGifts(): Observable<Cart>;
40
+ private giftToLineItems;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<CartService, never>;
42
+ static ɵprov: i0.ɵɵInjectableDeclaration<CartService>;
43
+ }
@@ -1,4 +1,4 @@
1
- import { Category, Product, RepositoryFindFielters } from '@infrab4a/connect/';
2
- export interface CategoryStructureAdapter {
3
- buildProductFilterByCategory(category: Category): Promise<RepositoryFindFielters<Product>>;
4
- }
1
+ import { Category, Product, RepositoryFindFielters } from '@infrab4a/connect/';
2
+ export interface CategoryStructureAdapter {
3
+ buildProductFilterByCategory(category: Category): Promise<RepositoryFindFielters<Product>>;
4
+ }
@@ -1,3 +1,3 @@
1
- export * from './category-structure.adapter';
2
- export * from './new-category-structure.adapter';
3
- export * from './old-category-structure.adapter';
1
+ export * from './category-structure.adapter';
2
+ export * from './new-category-structure.adapter';
3
+ export * from './old-category-structure.adapter';
@@ -1,12 +1,12 @@
1
- import { Category, CategoryRepository, Product, RepositoryFindFielters } from '@infrab4a/connect';
2
- import { CategoryStructureAdapter } from './category-structure.adapter';
3
- import * as i0 from "@angular/core";
4
- export declare class NewCategoryStructureAdapter implements CategoryStructureAdapter {
5
- private readonly categoryRepository;
6
- constructor(categoryRepository: CategoryRepository);
7
- buildProductFilterByCategory(category: Category): Promise<RepositoryFindFielters<Product>>;
8
- private getAllCategoriesIdFromCategory;
9
- private getCategory;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<NewCategoryStructureAdapter, never>;
11
- static ɵprov: i0.ɵɵInjectableDeclaration<NewCategoryStructureAdapter>;
12
- }
1
+ import { Category, CategoryRepository, Product, RepositoryFindFielters } from '@infrab4a/connect';
2
+ import { CategoryStructureAdapter } from './category-structure.adapter';
3
+ import * as i0 from "@angular/core";
4
+ export declare class NewCategoryStructureAdapter implements CategoryStructureAdapter {
5
+ private readonly categoryRepository;
6
+ constructor(categoryRepository: CategoryRepository);
7
+ buildProductFilterByCategory(category: Category): Promise<RepositoryFindFielters<Product>>;
8
+ private getAllCategoriesIdFromCategory;
9
+ private getCategory;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<NewCategoryStructureAdapter, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<NewCategoryStructureAdapter>;
12
+ }
@@ -1,10 +1,10 @@
1
- import { Category, CategoryRepository, Product, RepositoryFindFielters } from '@infrab4a/connect';
2
- import { CategoryStructureAdapter } from './category-structure.adapter';
3
- import * as i0 from "@angular/core";
4
- export declare class OldCategoryStructureAdapter implements CategoryStructureAdapter {
5
- private readonly categoryRepository;
6
- constructor(categoryRepository: CategoryRepository);
7
- buildProductFilterByCategory(category: Category): Promise<RepositoryFindFielters<Product>>;
8
- static ɵfac: i0.ɵɵFactoryDeclaration<OldCategoryStructureAdapter, never>;
9
- static ɵprov: i0.ɵɵInjectableDeclaration<OldCategoryStructureAdapter>;
10
- }
1
+ import { Category, CategoryRepository, Product, RepositoryFindFielters } from '@infrab4a/connect';
2
+ import { CategoryStructureAdapter } from './category-structure.adapter';
3
+ import * as i0 from "@angular/core";
4
+ export declare class OldCategoryStructureAdapter implements CategoryStructureAdapter {
5
+ private readonly categoryRepository;
6
+ constructor(categoryRepository: CategoryRepository);
7
+ buildProductFilterByCategory(category: Category): Promise<RepositoryFindFielters<Product>>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<OldCategoryStructureAdapter, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<OldCategoryStructureAdapter>;
10
+ }
@@ -1,89 +1,89 @@
1
- import { Category, CategoryRepository, Product, ProductGender, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops } from '@infrab4a/connect';
2
- import { CategoryStructureAdapter } from './adapters';
3
- import { ProductSort } from './types/product-sort.type';
4
- 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
- export declare class CatalogService<T extends Category = Category> {
65
- private readonly productRepository;
66
- private readonly productStockNotificationRepository;
67
- private readonly categoryRepository;
68
- private readonly categoryStructureAdapter;
69
- private readonly shop;
70
- private readonly productSearch;
71
- private productsByTerm;
72
- constructor(productRepository: ProductRepository, productStockNotificationRepository: ProductStockNotificationRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops, productSearch: ProductSearchIndex);
73
- fetchProducts(options: FetchProductsParams<T>): Promise<FetchProductsResponse>;
74
- addCustomerToStockNotification(shop: Shops, productId: string, name: string, email: string): Promise<void>;
75
- private findCatalog;
76
- private buildMainFilter;
77
- private findCatalogAndSortByMostRevelant;
78
- private findCatalogAndSortByMostRevelantByTerm;
79
- private findCatalogIdsBySearch;
80
- private buildFilterQuery;
81
- private buildSortQuery;
82
- private buildLimitQuery;
83
- private hasProfile;
84
- private hasTerm;
85
- private hasCategory;
86
- static ɵfac: i0.ɵɵFactoryDeclaration<CatalogService<any>, never>;
87
- static ɵprov: i0.ɵɵInjectableDeclaration<CatalogService<any>>;
88
- }
89
- export {};
1
+ import { Category, CategoryRepository, Product, ProductGender, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops } from '@infrab4a/connect';
2
+ import { CategoryStructureAdapter } from './adapters';
3
+ import { ProductSort } from './types/product-sort.type';
4
+ 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
+ export declare class CatalogService<T extends Category = Category> {
65
+ private readonly productRepository;
66
+ private readonly productStockNotificationRepository;
67
+ private readonly categoryRepository;
68
+ private readonly categoryStructureAdapter;
69
+ private readonly shop;
70
+ private readonly productSearch;
71
+ private productsByTerm;
72
+ constructor(productRepository: ProductRepository, productStockNotificationRepository: ProductStockNotificationRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops, productSearch: ProductSearchIndex);
73
+ fetchProducts(options: FetchProductsParams<T>): Promise<FetchProductsResponse>;
74
+ addCustomerToStockNotification(shop: Shops, productId: string, name: string, email: string): Promise<void>;
75
+ private findCatalog;
76
+ private buildMainFilter;
77
+ private findCatalogAndSortByMostRevelant;
78
+ private findCatalogAndSortByMostRevelantByTerm;
79
+ private findCatalogIdsBySearch;
80
+ private buildFilterQuery;
81
+ private buildSortQuery;
82
+ private buildLimitQuery;
83
+ private hasProfile;
84
+ private hasTerm;
85
+ private hasCategory;
86
+ static ɵfac: i0.ɵɵFactoryDeclaration<CatalogService<any>, never>;
87
+ static ɵprov: i0.ɵɵInjectableDeclaration<CatalogService<any>>;
88
+ }
89
+ export {};
@@ -1,20 +1,20 @@
1
- import { Category, CategoryFilterRepository, CategoryRepository, Filter, ProductGender, ProductRepository, Shops } from '@infrab4a/connect';
2
- import { CategoryStructureAdapter } from './adapters';
3
- import * as i0 from "@angular/core";
4
- type FetchBrandsOptions = {
5
- mainGender?: ProductGender;
6
- shop?: Shops;
7
- };
8
- export declare class CategoryService {
9
- private readonly productRepository;
10
- private readonly categoryRepository;
11
- private readonly categoryFilterRepository;
12
- private readonly categoryStructureAdapter;
13
- private readonly shop;
14
- constructor(productRepository: ProductRepository, categoryRepository: CategoryRepository, categoryFilterRepository: CategoryFilterRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops);
15
- fetchBrands(category: Category, options?: FetchBrandsOptions): Promise<Category[]>;
16
- fetchFilterOptions(category: Category): Promise<Filter[]>;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<CategoryService, never>;
18
- static ɵprov: i0.ɵɵInjectableDeclaration<CategoryService>;
19
- }
20
- export {};
1
+ import { Category, CategoryFilterRepository, CategoryRepository, Filter, ProductGender, ProductRepository, Shops } from '@infrab4a/connect';
2
+ import { CategoryStructureAdapter } from './adapters';
3
+ import * as i0 from "@angular/core";
4
+ type FetchBrandsOptions = {
5
+ mainGender?: ProductGender;
6
+ shop?: Shops;
7
+ };
8
+ export declare class CategoryService {
9
+ private readonly productRepository;
10
+ private readonly categoryRepository;
11
+ private readonly categoryFilterRepository;
12
+ private readonly categoryStructureAdapter;
13
+ private readonly shop;
14
+ constructor(productRepository: ProductRepository, categoryRepository: CategoryRepository, categoryFilterRepository: CategoryFilterRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops);
15
+ fetchBrands(category: Category, options?: FetchBrandsOptions): Promise<Category[]>;
16
+ fetchFilterOptions(category: Category): Promise<Filter[]>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<CategoryService, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<CategoryService>;
19
+ }
20
+ export {};
@@ -1 +1 @@
1
- export * from './product-sorts.enum';
1
+ export * from './product-sorts.enum';
@@ -1,9 +1,9 @@
1
- export declare enum ProductSorts {
2
- MOST_RELEVANT = "most-relevant",
3
- BEST_SELLER = "best-sellers",
4
- BIGGEST_PRICE = "biggest-price",
5
- LOWEST_PRICE = "lowest-price",
6
- BIGGEST_DISCOUNT = "biggest-discount",
7
- BEST_RATING = "best-rating",
8
- NEWS = "news"
9
- }
1
+ export declare enum ProductSorts {
2
+ MOST_RELEVANT = "most-relevant",
3
+ BEST_SELLER = "best-sellers",
4
+ BIGGEST_PRICE = "biggest-price",
5
+ LOWEST_PRICE = "lowest-price",
6
+ BIGGEST_DISCOUNT = "biggest-discount",
7
+ BEST_RATING = "best-rating",
8
+ NEWS = "news"
9
+ }
@@ -1,7 +1,7 @@
1
- export * from './adapters';
2
- export * from './catalog.service';
3
- export * from './category.service';
4
- export * from './enums';
5
- export * from './models';
6
- export * from './types';
7
- export * from './wishlist.service';
1
+ export * from './adapters';
2
+ export * from './catalog.service';
3
+ export * from './category.service';
4
+ export * from './enums';
5
+ export * from './models';
6
+ export * from './types';
7
+ export * from './wishlist.service';
@@ -1,4 +1,4 @@
1
- import { Category } from '@infrab4a/connect';
2
- export declare class CategoryWithTree extends Category {
3
- children?: CategoryWithTree[];
4
- }
1
+ import { Category } from '@infrab4a/connect';
2
+ export declare class CategoryWithTree extends Category {
3
+ children?: CategoryWithTree[];
4
+ }
@@ -1 +1 @@
1
- export * from './category-with-tree.model';
1
+ export * from './category-with-tree.model';
@@ -1 +1 @@
1
- export * from './product-sort.type';
1
+ export * from './product-sort.type';
@@ -1,2 +1,2 @@
1
- import { ProductSorts } from '../enums';
2
- export type ProductSort = `${ProductSorts}`;
1
+ import { ProductSorts } from '../enums';
2
+ export type ProductSort = `${ProductSorts}`;
@@ -1,50 +1,50 @@
1
- import { CategoryFilterRepository, CategoryRepository, LogRepository, PersonType, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops, Wishlist, WishlistRepository } from '@infrab4a/connect';
2
- import { CatalogService } from './catalog.service';
3
- import { CategoryService } from './category.service';
4
- import * as i0 from "@angular/core";
5
- export declare class WishlistService {
6
- private readonly wishlistRepository;
7
- private readonly shop;
8
- productRepository: ProductRepository;
9
- private readonly productSearch;
10
- private readonly logRepository;
11
- private catalogService;
12
- private categoryService;
13
- constructor(wishlistRepository: WishlistRepository, shop: Shops, productRepository: ProductRepository, categoryFilterRepository: CategoryFilterRepository, categoryRepository: CategoryRepository, productStockNotificationRepository: ProductStockNotificationRepository, productSearch: ProductSearchIndex, logRepository: LogRepository);
14
- getCatalogService(): CatalogService<import("@infrab4a/connect").Category>;
15
- getCategoryService(): CategoryService;
16
- create({ personId, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
17
- personId: string;
18
- title: string;
19
- description: string;
20
- published: boolean;
21
- userFullName: string;
22
- userPhoto?: string;
23
- theme?: string;
24
- bannerUrl?: string;
25
- personType?: PersonType;
26
- personIsSubscriber?: boolean;
27
- }): Promise<Wishlist>;
28
- update({ id, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
29
- id: string;
30
- title: string;
31
- description: string;
32
- published: boolean;
33
- userFullName: string;
34
- userPhoto?: string;
35
- theme?: string;
36
- bannerUrl?: string;
37
- personType?: PersonType;
38
- personIsSubscriber?: boolean;
39
- }): Promise<Wishlist>;
40
- delete(wishlistId: string): Promise<void>;
41
- getWishlistBySlug(slug: string): Promise<Wishlist>;
42
- getWishlistsByPerson(personId: string): Promise<Wishlist[]>;
43
- addProduct(wishlistId: string, productId: string): Promise<Wishlist>;
44
- removeProduct(wishlistId: string, productId: string): Promise<Wishlist>;
45
- private findById;
46
- private findProductById;
47
- private createWishlistLog;
48
- static ɵfac: i0.ɵɵFactoryDeclaration<WishlistService, never>;
49
- static ɵprov: i0.ɵɵInjectableDeclaration<WishlistService>;
50
- }
1
+ import { CategoryFilterRepository, CategoryRepository, LogRepository, PersonType, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops, Wishlist, WishlistRepository } from '@infrab4a/connect';
2
+ import { CatalogService } from './catalog.service';
3
+ import { CategoryService } from './category.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class WishlistService {
6
+ private readonly wishlistRepository;
7
+ private readonly shop;
8
+ productRepository: ProductRepository;
9
+ private readonly productSearch;
10
+ private readonly logRepository;
11
+ private catalogService;
12
+ private categoryService;
13
+ constructor(wishlistRepository: WishlistRepository, shop: Shops, productRepository: ProductRepository, categoryFilterRepository: CategoryFilterRepository, categoryRepository: CategoryRepository, productStockNotificationRepository: ProductStockNotificationRepository, productSearch: ProductSearchIndex, logRepository: LogRepository);
14
+ getCatalogService(): CatalogService<import("@infrab4a/connect").Category>;
15
+ getCategoryService(): CategoryService;
16
+ create({ personId, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
17
+ personId: string;
18
+ title: string;
19
+ description: string;
20
+ published: boolean;
21
+ userFullName: string;
22
+ userPhoto?: string;
23
+ theme?: string;
24
+ bannerUrl?: string;
25
+ personType?: PersonType;
26
+ personIsSubscriber?: boolean;
27
+ }): Promise<Wishlist>;
28
+ update({ id, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
29
+ id: string;
30
+ title: string;
31
+ description: string;
32
+ published: boolean;
33
+ userFullName: string;
34
+ userPhoto?: string;
35
+ theme?: string;
36
+ bannerUrl?: string;
37
+ personType?: PersonType;
38
+ personIsSubscriber?: boolean;
39
+ }): Promise<Wishlist>;
40
+ delete(wishlistId: string): Promise<void>;
41
+ getWishlistBySlug(slug: string): Promise<Wishlist>;
42
+ getWishlistsByPerson(personId: string): Promise<Wishlist[]>;
43
+ addProduct(wishlistId: string, productId: string): Promise<Wishlist>;
44
+ removeProduct(wishlistId: string, productId: string): Promise<Wishlist>;
45
+ private findById;
46
+ private findProductById;
47
+ private createWishlistLog;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<WishlistService, never>;
49
+ static ɵprov: i0.ɵɵInjectableDeclaration<WishlistService>;
50
+ }
@@ -1,19 +1,19 @@
1
- import { CheckoutSubscription, CheckoutSubscriptionRepository, Coupon } from '@infrab4a/connect';
2
- import { Observable } from 'rxjs';
3
- import { RequiredCheckoutSubscriptionData } from './types';
4
- import { DataPersistence } from '../persistence';
5
- import { CouponService } from './coupon.service';
6
- import * as i0 from "@angular/core";
7
- export declare class CheckoutSubscriptionService {
8
- private readonly checkoutSubscriptionRepository;
9
- private readonly dataPersistence;
10
- private readonly couponService;
11
- constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository, dataPersistence: DataPersistence, couponService: CouponService);
12
- getCheckoutSubscription(checkoutData?: RequiredCheckoutSubscriptionData): Observable<CheckoutSubscription>;
13
- clearCheckoutSubscriptionFromSession(): Observable<void>;
14
- checkCoupon(nickname: string, userEmail: string): Observable<Coupon>;
15
- calcDiscountSubscription(coupon: Coupon): Observable<number>;
16
- private createCheckoutSubscription;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutSubscriptionService, never>;
18
- static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutSubscriptionService>;
19
- }
1
+ import { CheckoutSubscription, CheckoutSubscriptionRepository, Coupon } from '@infrab4a/connect';
2
+ import { Observable } from 'rxjs';
3
+ import { RequiredCheckoutSubscriptionData } from './types';
4
+ import { DataPersistence } from '../persistence';
5
+ import { CouponService } from './coupon.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare class CheckoutSubscriptionService {
8
+ private readonly checkoutSubscriptionRepository;
9
+ private readonly dataPersistence;
10
+ private readonly couponService;
11
+ constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository, dataPersistence: DataPersistence, couponService: CouponService);
12
+ getCheckoutSubscription(checkoutData?: RequiredCheckoutSubscriptionData): Observable<CheckoutSubscription>;
13
+ clearCheckoutSubscriptionFromSession(): Observable<void>;
14
+ checkCoupon(nickname: string, userEmail: string): Observable<Coupon>;
15
+ calcDiscountSubscription(coupon: Coupon): Observable<number>;
16
+ private createCheckoutSubscription;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutSubscriptionService, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutSubscriptionService>;
19
+ }