@infrab4a/connect-angular 4.18.2 → 4.18.3
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 +32 -32
- package/angular-elastic-search.module.d.ts +9 -9
- package/angular-firebase-auth.module.d.ts +11 -11
- package/angular-firestore.module.d.ts +17 -17
- package/angular-hasura-graphql.module.d.ts +16 -16
- package/angular-vertex-search.module.d.ts +9 -9
- package/consts/backend-url.const.d.ts +1 -1
- package/consts/category-structure.d.ts +1 -1
- package/consts/default-shop.const.d.ts +1 -1
- package/consts/es-config.const.d.ts +1 -1
- package/consts/firebase-const.d.ts +4 -4
- package/consts/hasura-options.const.d.ts +1 -1
- package/consts/index.d.ts +8 -8
- package/consts/persistence.const.d.ts +1 -1
- package/consts/storage-base-url.const.d.ts +1 -1
- package/consts/vertex-config.const.d.ts +1 -1
- package/esm2020/angular-connect.module.mjs +187 -187
- package/esm2020/angular-elastic-search.module.mjs +34 -34
- package/esm2020/angular-firebase-auth.module.mjs +141 -141
- package/esm2020/angular-firestore.module.mjs +527 -527
- package/esm2020/angular-hasura-graphql.module.mjs +331 -331
- package/esm2020/angular-vertex-search.module.mjs +34 -34
- package/esm2020/consts/backend-url.const.mjs +1 -1
- package/esm2020/consts/category-structure.mjs +2 -2
- package/esm2020/consts/default-shop.const.mjs +2 -2
- package/esm2020/consts/es-config.const.mjs +2 -2
- package/esm2020/consts/firebase-const.mjs +5 -5
- package/esm2020/consts/hasura-options.const.mjs +2 -2
- package/esm2020/consts/index.mjs +9 -9
- package/esm2020/consts/persistence.const.mjs +2 -2
- package/esm2020/consts/storage-base-url.const.mjs +2 -2
- package/esm2020/consts/vertex-config.const.mjs +2 -2
- package/esm2020/helpers/index.mjs +2 -2
- package/esm2020/helpers/mobile-operation-system-checker.helper.mjs +7 -7
- package/esm2020/index.mjs +7 -7
- package/esm2020/infrab4a-connect-angular.mjs +4 -4
- package/esm2020/persistence/cookie-data-persistence.mjs +22 -22
- package/esm2020/persistence/data-persistence.mjs +2 -2
- package/esm2020/persistence/index.mjs +3 -3
- package/esm2020/services/auth.service.mjs +37 -37
- package/esm2020/services/cart.service.mjs +86 -86
- package/esm2020/services/catalog/adapters/category-structure.adapter.mjs +2 -2
- package/esm2020/services/catalog/adapters/index.mjs +4 -4
- package/esm2020/services/catalog/adapters/new-category-structure.adapter.mjs +43 -43
- package/esm2020/services/catalog/adapters/old-category-structure.adapter.mjs +23 -23
- package/esm2020/services/catalog/catalog.service.mjs +295 -295
- package/esm2020/services/catalog/category.service.mjs +51 -51
- package/esm2020/services/catalog/enums/index.mjs +2 -2
- package/esm2020/services/catalog/enums/product-sorts.enum.mjs +11 -11
- package/esm2020/services/catalog/index.mjs +8 -8
- package/esm2020/services/catalog/models/category-with-tree.model.mjs +10 -10
- package/esm2020/services/catalog/models/index.mjs +2 -2
- package/esm2020/services/catalog/types/index.mjs +2 -2
- package/esm2020/services/catalog/types/product-sort.type.mjs +2 -2
- package/esm2020/services/catalog/wishlist.service.mjs +235 -235
- package/esm2020/services/checkout-subscription.service.mjs +50 -50
- package/esm2020/services/checkout.service.mjs +122 -122
- package/esm2020/services/coupon.service.mjs +228 -228
- package/esm2020/services/helpers/index.mjs +2 -2
- package/esm2020/services/helpers/util.helper.mjs +18 -18
- package/esm2020/services/home-shop.service.mjs +125 -125
- package/esm2020/services/index.mjs +10 -10
- package/esm2020/services/order.service.mjs +30 -30
- package/esm2020/services/types/index.mjs +3 -3
- package/esm2020/services/types/required-checkout-data.type.mjs +2 -2
- package/esm2020/services/types/required-checkout-subscription-data.type.mjs +2 -2
- package/esm2020/types/firebase-app-config.type.mjs +2 -2
- package/esm2020/types/index.mjs +2 -2
- package/fesm2015/infrab4a-connect-angular.mjs +2516 -2516
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +2467 -2467
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/helpers/index.d.ts +1 -1
- package/helpers/mobile-operation-system-checker.helper.d.ts +3 -3
- package/index.d.ts +6 -6
- package/package.json +2 -2
- package/persistence/cookie-data-persistence.d.ts +10 -10
- package/persistence/data-persistence.d.ts +6 -6
- package/persistence/index.d.ts +2 -2
- package/services/auth.service.d.ts +18 -18
- package/services/cart.service.d.ts +31 -31
- package/services/catalog/adapters/category-structure.adapter.d.ts +4 -4
- package/services/catalog/adapters/index.d.ts +3 -3
- package/services/catalog/adapters/new-category-structure.adapter.d.ts +12 -12
- package/services/catalog/adapters/old-category-structure.adapter.d.ts +10 -10
- package/services/catalog/catalog.service.d.ts +93 -93
- package/services/catalog/category.service.d.ts +20 -20
- package/services/catalog/enums/index.d.ts +1 -1
- package/services/catalog/enums/product-sorts.enum.d.ts +9 -9
- package/services/catalog/index.d.ts +7 -7
- package/services/catalog/models/category-with-tree.model.d.ts +4 -4
- package/services/catalog/models/index.d.ts +1 -1
- package/services/catalog/types/index.d.ts +1 -1
- package/services/catalog/types/product-sort.type.d.ts +2 -2
- package/services/catalog/wishlist.service.d.ts +50 -50
- package/services/checkout-subscription.service.d.ts +19 -19
- package/services/checkout.service.d.ts +34 -34
- package/services/coupon.service.d.ts +27 -27
- package/services/helpers/index.d.ts +1 -1
- package/services/helpers/util.helper.d.ts +3 -3
- package/services/home-shop.service.d.ts +26 -26
- package/services/index.d.ts +9 -9
- package/services/order.service.d.ts +13 -13
- package/services/types/index.d.ts +2 -2
- package/services/types/required-checkout-data.type.d.ts +2 -2
- package/services/types/required-checkout-subscription-data.type.d.ts +2 -2
- package/types/firebase-app-config.type.d.ts +1 -1
- package/types/index.d.ts +1 -1
package/helpers/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './mobile-operation-system-checker.helper';
|
|
1
|
+
export * from './mobile-operation-system-checker.helper';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class MobileOperationSystemCheckerHelper {
|
|
2
|
-
static isAppleDevice(): boolean;
|
|
3
|
-
}
|
|
1
|
+
export declare class MobileOperationSystemCheckerHelper {
|
|
2
|
+
static isAppleDevice(): boolean;
|
|
3
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './angular-connect.module';
|
|
2
|
-
export * from './angular-firebase-auth.module';
|
|
3
|
-
export * from './angular-firestore.module';
|
|
4
|
-
export * from './angular-hasura-graphql.module';
|
|
5
|
-
export * from './persistence';
|
|
6
|
-
export * from './services';
|
|
1
|
+
export * from './angular-connect.module';
|
|
2
|
+
export * from './angular-firebase-auth.module';
|
|
3
|
+
export * from './angular-firestore.module';
|
|
4
|
+
export * from './angular-hasura-graphql.module';
|
|
5
|
+
export * from './persistence';
|
|
6
|
+
export * from './services';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect-angular",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -12,7 +12,7 @@
|
|
|
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.23.
|
|
15
|
+
"@infrab4a/connect": "4.23.2",
|
|
16
16
|
"js-cookie": "^3.0.1",
|
|
17
17
|
"rxjs": "^6.6.7"
|
|
18
18
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { DataPersistence } from './data-persistence';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CookieDataPersistence implements DataPersistence {
|
|
5
|
-
get(key: string): Observable<string>;
|
|
6
|
-
remove(key: string): Observable<void>;
|
|
7
|
-
set(key: string, value: string): Observable<void>;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CookieDataPersistence, never>;
|
|
9
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CookieDataPersistence>;
|
|
10
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DataPersistence } from './data-persistence';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CookieDataPersistence implements DataPersistence {
|
|
5
|
+
get(key: string): Observable<string>;
|
|
6
|
+
remove(key: string): Observable<void>;
|
|
7
|
+
set(key: string, value: string): Observable<void>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CookieDataPersistence, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CookieDataPersistence>;
|
|
10
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
export interface DataPersistence {
|
|
3
|
-
get(key: string): Observable<string>;
|
|
4
|
-
remove(key: string): Observable<void>;
|
|
5
|
-
set(key: string, value: string): Observable<void>;
|
|
6
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export interface DataPersistence {
|
|
3
|
+
get(key: string): Observable<string>;
|
|
4
|
+
remove(key: string): Observable<void>;
|
|
5
|
+
set(key: string, value: string): Observable<void>;
|
|
6
|
+
}
|
package/persistence/index.d.ts
CHANGED
|
@@ -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,31 +1,31 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { FirebaseOptions } from '@angular/fire/app';
|
|
3
|
-
import { LineItem, Shops, User } from '@infrab4a/connect';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
import { AuthService } from './auth.service';
|
|
6
|
-
import { CheckoutService } from './checkout.service';
|
|
7
|
-
import { RequiredCheckoutData } from './types';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
export type Cart = {
|
|
10
|
-
[id: string]: LineItem;
|
|
11
|
-
};
|
|
12
|
-
export declare class CartService {
|
|
13
|
-
private readonly authService;
|
|
14
|
-
private readonly checkoutService;
|
|
15
|
-
private readonly defaultShop;
|
|
16
|
-
private readonly firebaseOptions;
|
|
17
|
-
private http;
|
|
18
|
-
private cartSubject;
|
|
19
|
-
private checkoutUrl;
|
|
20
|
-
constructor(authService: AuthService, checkoutService: CheckoutService, defaultShop: Shops, firebaseOptions: FirebaseOptions, http: HttpClient);
|
|
21
|
-
addItem(item: LineItem, quantity?: number): Observable<Cart>;
|
|
22
|
-
decreaseItem(item: LineItem): Observable<Cart>;
|
|
23
|
-
removeItem(item: LineItem): Observable<Cart>;
|
|
24
|
-
updateUserCart(user: User): Observable<Cart>;
|
|
25
|
-
getCart(checkout?: RequiredCheckoutData): Observable<Cart>;
|
|
26
|
-
clearCart(): Observable<Cart>;
|
|
27
|
-
private buildCartFromCheckout;
|
|
28
|
-
private generateCartObject;
|
|
29
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CartService, never>;
|
|
30
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CartService>;
|
|
31
|
-
}
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { FirebaseOptions } from '@angular/fire/app';
|
|
3
|
+
import { LineItem, Shops, User } from '@infrab4a/connect';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { AuthService } from './auth.service';
|
|
6
|
+
import { CheckoutService } from './checkout.service';
|
|
7
|
+
import { RequiredCheckoutData } from './types';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export type Cart = {
|
|
10
|
+
[id: string]: LineItem;
|
|
11
|
+
};
|
|
12
|
+
export declare class CartService {
|
|
13
|
+
private readonly authService;
|
|
14
|
+
private readonly checkoutService;
|
|
15
|
+
private readonly defaultShop;
|
|
16
|
+
private readonly firebaseOptions;
|
|
17
|
+
private http;
|
|
18
|
+
private cartSubject;
|
|
19
|
+
private checkoutUrl;
|
|
20
|
+
constructor(authService: AuthService, checkoutService: CheckoutService, defaultShop: Shops, firebaseOptions: FirebaseOptions, http: HttpClient);
|
|
21
|
+
addItem(item: LineItem, quantity?: number): Observable<Cart>;
|
|
22
|
+
decreaseItem(item: LineItem): Observable<Cart>;
|
|
23
|
+
removeItem(item: LineItem): Observable<Cart>;
|
|
24
|
+
updateUserCart(user: User): Observable<Cart>;
|
|
25
|
+
getCart(checkout?: RequiredCheckoutData): Observable<Cart>;
|
|
26
|
+
clearCart(): Observable<Cart>;
|
|
27
|
+
private buildCartFromCheckout;
|
|
28
|
+
private generateCartObject;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CartService, never>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CartService>;
|
|
31
|
+
}
|
|
@@ -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,93 +1,93 @@
|
|
|
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
|
-
private brandsList;
|
|
73
|
-
constructor(productRepository: ProductRepository, productStockNotificationRepository: ProductStockNotificationRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops, productSearch: ProductSearchIndex);
|
|
74
|
-
fetchProducts(options: FetchProductsParams<T>): Promise<FetchProductsResponse>;
|
|
75
|
-
addCustomerToStockNotification(shop: Shops, productId: string, name: string, email: string): Promise<void>;
|
|
76
|
-
private findCatalog;
|
|
77
|
-
private buildMainFilter;
|
|
78
|
-
private findCatalogAndSortByMostRevelant;
|
|
79
|
-
private findCatalogAndSortByMostRevelantByTerm;
|
|
80
|
-
private findCatalogIdsBySearch;
|
|
81
|
-
private fetchBrandsOnly;
|
|
82
|
-
private setBrandsList;
|
|
83
|
-
private buildFilterQuery;
|
|
84
|
-
private buildSortQuery;
|
|
85
|
-
private buildLimitQuery;
|
|
86
|
-
private hasProfile;
|
|
87
|
-
private hasTerm;
|
|
88
|
-
private hasCategory;
|
|
89
|
-
private buildIndexBrands;
|
|
90
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogService<any>, never>;
|
|
91
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogService<any>>;
|
|
92
|
-
}
|
|
93
|
-
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
|
+
private brandsList;
|
|
73
|
+
constructor(productRepository: ProductRepository, productStockNotificationRepository: ProductStockNotificationRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops, productSearch: ProductSearchIndex);
|
|
74
|
+
fetchProducts(options: FetchProductsParams<T>): Promise<FetchProductsResponse>;
|
|
75
|
+
addCustomerToStockNotification(shop: Shops, productId: string, name: string, email: string): Promise<void>;
|
|
76
|
+
private findCatalog;
|
|
77
|
+
private buildMainFilter;
|
|
78
|
+
private findCatalogAndSortByMostRevelant;
|
|
79
|
+
private findCatalogAndSortByMostRevelantByTerm;
|
|
80
|
+
private findCatalogIdsBySearch;
|
|
81
|
+
private fetchBrandsOnly;
|
|
82
|
+
private setBrandsList;
|
|
83
|
+
private buildFilterQuery;
|
|
84
|
+
private buildSortQuery;
|
|
85
|
+
private buildLimitQuery;
|
|
86
|
+
private hasProfile;
|
|
87
|
+
private hasTerm;
|
|
88
|
+
private hasCategory;
|
|
89
|
+
private buildIndexBrands;
|
|
90
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogService<any>, never>;
|
|
91
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogService<any>>;
|
|
92
|
+
}
|
|
93
|
+
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}`;
|