@infrab4a/connect-angular 5.0.0-beta.6 → 5.0.0-beta.60
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 +13 -8
- package/angular-firestore.module.d.ts +1 -2
- package/angular-vertex-search.module.d.ts +9 -0
- package/consts/index.d.ts +2 -0
- package/consts/persistence.const.d.ts +1 -0
- package/consts/vertex-config.const.d.ts +1 -0
- package/esm2022/angular-connect.module.mjs +38 -5
- package/esm2022/angular-elastic-search.module.mjs +1 -1
- package/esm2022/angular-firebase-auth.module.mjs +1 -1
- package/esm2022/angular-firestore.module.mjs +25 -28
- package/esm2022/angular-hasura-graphql.module.mjs +24 -2
- package/esm2022/angular-vertex-search.module.mjs +34 -0
- package/esm2022/consts/category-structure.mjs +1 -1
- package/esm2022/consts/default-shop.const.mjs +1 -1
- package/esm2022/consts/es-config.const.mjs +1 -1
- package/esm2022/consts/firebase-const.mjs +1 -1
- package/esm2022/consts/hasura-options.const.mjs +1 -1
- package/esm2022/consts/index.mjs +3 -1
- package/esm2022/consts/persistence.const.mjs +2 -0
- package/esm2022/consts/storage-base-url.const.mjs +1 -1
- package/esm2022/consts/vertex-config.const.mjs +2 -0
- package/esm2022/helpers/index.mjs +1 -1
- package/esm2022/helpers/mobile-operation-system-checker.helper.mjs +1 -1
- package/esm2022/index.mjs +2 -1
- package/esm2022/persistence/cookie-data-persistence.mjs +22 -0
- package/esm2022/persistence/data-persistence.mjs +2 -0
- package/esm2022/persistence/index.mjs +3 -0
- package/esm2022/services/auth.service.mjs +1 -1
- package/esm2022/services/cart.service.mjs +14 -11
- package/esm2022/services/catalog/adapters/category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/adapters/index.mjs +1 -1
- package/esm2022/services/catalog/adapters/new-category-structure.adapter.mjs +6 -4
- package/esm2022/services/catalog/adapters/old-category-structure.adapter.mjs +1 -1
- package/esm2022/services/catalog/catalog.service.mjs +89 -33
- package/esm2022/services/catalog/category.service.mjs +1 -1
- package/esm2022/services/catalog/enums/index.mjs +1 -1
- package/esm2022/services/catalog/enums/product-sorts.enum.mjs +1 -1
- package/esm2022/services/catalog/index.mjs +1 -1
- package/esm2022/services/catalog/models/category-with-tree.model.mjs +1 -1
- package/esm2022/services/catalog/models/index.mjs +1 -1
- package/esm2022/services/catalog/types/index.mjs +1 -1
- package/esm2022/services/catalog/types/product-sort.type.mjs +1 -1
- package/esm2022/services/catalog/wishlist.service.mjs +50 -17
- package/esm2022/services/checkout-subscription.service.mjs +18 -21
- package/esm2022/services/checkout.service.mjs +13 -16
- package/esm2022/services/coupon.service.mjs +54 -19
- package/esm2022/services/helpers/index.mjs +1 -1
- package/esm2022/services/helpers/util.helper.mjs +1 -1
- package/esm2022/services/home-shop.service.mjs +1 -1
- package/esm2022/services/index.mjs +1 -1
- package/esm2022/services/order.service.mjs +1 -1
- package/esm2022/services/shipping.service.mjs +1 -1
- package/esm2022/services/types/index.mjs +1 -1
- package/esm2022/services/types/required-checkout-data.type.mjs +1 -1
- package/esm2022/services/types/required-checkout-subscription-data.type.mjs +1 -1
- package/esm2022/services/types/shipping-methods.type.mjs +1 -1
- package/esm2022/types/firebase-app-config.type.mjs +1 -1
- package/esm2022/types/index.mjs +1 -1
- package/fesm2022/infrab4a-connect-angular.mjs +366 -139
- package/fesm2022/infrab4a-connect-angular.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +5 -5
- package/persistence/cookie-data-persistence.d.ts +10 -0
- package/persistence/data-persistence.d.ts +6 -0
- package/persistence/index.d.ts +2 -0
- package/services/catalog/catalog.service.d.ts +7 -4
- package/services/catalog/wishlist.service.d.ts +11 -4
- package/services/checkout-subscription.service.d.ts +5 -4
- package/services/checkout.service.d.ts +8 -4
- package/services/coupon.service.d.ts +6 -2
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect-angular",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.60",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"url": "https://github.com/B4AGroup/b4a-firebase-libs"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@angular/common": "
|
|
13
|
-
"@angular/core": "
|
|
14
|
-
"@angular/fire": "
|
|
15
|
-
"@infrab4a/connect": "
|
|
12
|
+
"@angular/common": "17.2.3",
|
|
13
|
+
"@angular/core": "17.2.3",
|
|
14
|
+
"@angular/fire": "17.0.1",
|
|
15
|
+
"@infrab4a/connect": "4.9.7-beta.25",
|
|
16
16
|
"js-cookie": "^3.0.1",
|
|
17
17
|
"rxjs": "^7.8.1"
|
|
18
18
|
},
|
|
@@ -0,0 +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,4 +1,4 @@
|
|
|
1
|
-
import { Category, CategoryRepository, Product, ProductGender, ProductRepository,
|
|
1
|
+
import { Category, CategoryRepository, Product, ProductGender, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops } from '@infrab4a/connect';
|
|
2
2
|
import { CategoryStructureAdapter } from './adapters';
|
|
3
3
|
import { ProductSort } from './types/product-sort.type';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -63,17 +63,20 @@ type FetchProductsResponse = {
|
|
|
63
63
|
};
|
|
64
64
|
export declare class CatalogService<T extends Category = Category> {
|
|
65
65
|
private readonly productRepository;
|
|
66
|
+
private readonly productStockNotificationRepository;
|
|
66
67
|
private readonly categoryRepository;
|
|
67
68
|
private readonly categoryStructureAdapter;
|
|
68
69
|
private readonly shop;
|
|
69
|
-
private readonly
|
|
70
|
+
private readonly productSearch;
|
|
70
71
|
private productsByTerm;
|
|
71
|
-
constructor(productRepository: ProductRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops,
|
|
72
|
+
constructor(productRepository: ProductRepository, productStockNotificationRepository: ProductStockNotificationRepository, categoryRepository: CategoryRepository, categoryStructureAdapter: CategoryStructureAdapter, shop: Shops, productSearch: ProductSearchIndex);
|
|
72
73
|
fetchProducts(options: FetchProductsParams<T>): Promise<FetchProductsResponse>;
|
|
74
|
+
addCustomerToStockNotification(shop: Shops, productId: string, name: string, email: string): Promise<void>;
|
|
73
75
|
private findCatalog;
|
|
74
76
|
private buildMainFilter;
|
|
75
77
|
private findCatalogAndSortByMostRevelant;
|
|
76
|
-
private
|
|
78
|
+
private findCatalogAndSortByMostRevelantByTerm;
|
|
79
|
+
private findCatalogIdsBySearch;
|
|
77
80
|
private buildFilterQuery;
|
|
78
81
|
private buildSortQuery;
|
|
79
82
|
private buildLimitQuery;
|
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
import { CategoryFilterRepository, CategoryRepository, ProductRepository,
|
|
1
|
+
import { CategoryFilterRepository, CategoryRepository, PersonType, ProductRepository, ProductSearchIndex, ProductStockNotificationRepository, Shops, Wishlist, WishlistRepository } from '@infrab4a/connect';
|
|
2
2
|
import { CatalogService } from './catalog.service';
|
|
3
3
|
import { CategoryService } from './category.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class WishlistService {
|
|
6
6
|
private readonly wishlistRepository;
|
|
7
7
|
private readonly shop;
|
|
8
|
+
private readonly productSearch;
|
|
8
9
|
private catalogService;
|
|
9
10
|
private categoryService;
|
|
10
|
-
constructor(wishlistRepository: WishlistRepository, shop: Shops, productRepository: ProductRepository, categoryFilterRepository: CategoryFilterRepository, categoryRepository: CategoryRepository,
|
|
11
|
+
constructor(wishlistRepository: WishlistRepository, shop: Shops, productRepository: ProductRepository, categoryFilterRepository: CategoryFilterRepository, categoryRepository: CategoryRepository, productStockNotificationRepository: ProductStockNotificationRepository, productSearch: ProductSearchIndex);
|
|
11
12
|
getCatalogService(): CatalogService<import("@infrab4a/connect").Category>;
|
|
12
13
|
getCategoryService(): CategoryService;
|
|
13
|
-
create({ personId, title, description, userFullName, userPhoto, theme, bannerUrl, }: {
|
|
14
|
+
create({ personId, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
|
|
14
15
|
personId: string;
|
|
15
16
|
title: string;
|
|
16
17
|
description: string;
|
|
18
|
+
published: boolean;
|
|
17
19
|
userFullName: string;
|
|
18
20
|
userPhoto?: string;
|
|
19
21
|
theme?: string;
|
|
20
22
|
bannerUrl?: string;
|
|
23
|
+
personType?: PersonType;
|
|
24
|
+
personIsSubscriber?: boolean;
|
|
21
25
|
}): Promise<Wishlist>;
|
|
22
|
-
update({ id, title, description, userFullName, userPhoto, theme, bannerUrl, }: {
|
|
26
|
+
update({ id, title, description, published, userFullName, userPhoto, theme, bannerUrl, personType, personIsSubscriber, }: {
|
|
23
27
|
id: string;
|
|
24
28
|
title: string;
|
|
25
29
|
description: string;
|
|
30
|
+
published: boolean;
|
|
26
31
|
userFullName: string;
|
|
27
32
|
userPhoto?: string;
|
|
28
33
|
theme?: string;
|
|
29
34
|
bannerUrl?: string;
|
|
35
|
+
personType?: PersonType;
|
|
36
|
+
personIsSubscriber?: boolean;
|
|
30
37
|
}): Promise<Wishlist>;
|
|
31
38
|
delete(wishlistId: string): Promise<void>;
|
|
32
39
|
getWishlistBySlug(slug: string): Promise<Wishlist>;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { CheckoutSubscription, CheckoutSubscriptionRepository, Coupon
|
|
1
|
+
import { CheckoutSubscription, CheckoutSubscriptionRepository, Coupon } from '@infrab4a/connect';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RequiredCheckoutSubscriptionData } from './types';
|
|
4
|
+
import { DataPersistence } from '../persistence';
|
|
4
5
|
import { CouponService } from './coupon.service';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class CheckoutSubscriptionService {
|
|
7
8
|
private readonly checkoutSubscriptionRepository;
|
|
8
|
-
private readonly
|
|
9
|
+
private readonly dataPersistence;
|
|
9
10
|
private readonly couponService;
|
|
10
|
-
constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository,
|
|
11
|
+
constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository, dataPersistence: DataPersistence, couponService: CouponService);
|
|
11
12
|
getCheckoutSubscription(checkoutData?: RequiredCheckoutSubscriptionData): Observable<CheckoutSubscription>;
|
|
12
|
-
private createCheckoutSubscription;
|
|
13
13
|
clearCheckoutSubscriptionFromSession(): Observable<void>;
|
|
14
14
|
checkCoupon(nickname: string, userEmail: string): Observable<Coupon>;
|
|
15
15
|
calcDiscountSubscription(coupon: Coupon): Observable<number>;
|
|
16
|
+
private createCheckoutSubscription;
|
|
16
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutSubscriptionService, never>;
|
|
17
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutSubscriptionService>;
|
|
18
19
|
}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { Checkout, CheckoutRepository, CheckoutTypes, Coupon,
|
|
1
|
+
import { Checkout, CheckoutRepository, CheckoutTypes, Coupon, Shops, User, UserRepository } from '@infrab4a/connect';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { DataPersistence } from '../persistence';
|
|
3
4
|
import { CouponService } from './coupon.service';
|
|
4
5
|
import { RequiredCheckoutData } from './types';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class CheckoutService {
|
|
7
8
|
private readonly couponService;
|
|
8
9
|
private readonly checkoutRepository;
|
|
9
|
-
private readonly orderRepository;
|
|
10
10
|
private readonly userRepository;
|
|
11
11
|
private readonly defaultShop;
|
|
12
|
-
|
|
12
|
+
private readonly dataPersistence;
|
|
13
|
+
constructor(couponService: CouponService, checkoutRepository: CheckoutRepository, userRepository: UserRepository, defaultShop: Shops, dataPersistence: DataPersistence);
|
|
13
14
|
getCheckout(checkoutData?: RequiredCheckoutData): Observable<Checkout>;
|
|
14
15
|
getUserByCheckout(checkoutId: string): Observable<User>;
|
|
15
16
|
updateCheckoutLineItems(checkout: Partial<Checkout>): Observable<Checkout>;
|
|
16
17
|
updateCheckoutUser(checkout: Partial<Checkout>): Observable<Checkout>;
|
|
17
18
|
clearCheckoutFromSession(): Observable<void>;
|
|
18
|
-
calcDiscount(coupon: Coupon): Observable<
|
|
19
|
+
calcDiscount(coupon: Coupon): Observable<{
|
|
20
|
+
discount: number;
|
|
21
|
+
lineItems: import("@infrab4a/connect").LineItem[];
|
|
22
|
+
}>;
|
|
19
23
|
checkCoupon(nickname: string, checkoutType: CheckoutTypes): Observable<Coupon>;
|
|
20
24
|
private createCheckout;
|
|
21
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutService, never>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CategoryRepository, Checkout, CheckoutSubscription, CheckoutTypes, Coupon, CouponRepository, OrderRepository, Shops } from '@infrab4a/connect';
|
|
1
|
+
import { CategoryRepository, Checkout, CheckoutSubscription, CheckoutTypes, Coupon, CouponRepository, LineItem, OrderRepository, Shops } from '@infrab4a/connect';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class CouponService {
|
|
@@ -11,7 +11,10 @@ export declare class CouponService {
|
|
|
11
11
|
private couponValidation;
|
|
12
12
|
private couponRulesValidation;
|
|
13
13
|
calcDiscountSubscription(coupon: Coupon, checkout: Partial<CheckoutSubscription>): Observable<number>;
|
|
14
|
-
calcDiscountShopping(coupon: Coupon, checkout: Partial<Checkout>): Promise<
|
|
14
|
+
calcDiscountShopping(coupon: Coupon, checkout: Partial<Checkout>): Promise<{
|
|
15
|
+
discount: number;
|
|
16
|
+
lineItems: LineItem[];
|
|
17
|
+
}>;
|
|
15
18
|
private calcDiscountByType;
|
|
16
19
|
private hasMinSubTotal;
|
|
17
20
|
private hasProductCategories;
|
|
@@ -24,6 +27,7 @@ export declare class CouponService {
|
|
|
24
27
|
private getOrdersFromUser;
|
|
25
28
|
private countOrdersWithUser;
|
|
26
29
|
private getCouponUseLimits;
|
|
30
|
+
private calcLineItenDiscount;
|
|
27
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<CouponService, never>;
|
|
28
32
|
static ɵprov: i0.ɵɵInjectableDeclaration<CouponService>;
|
|
29
33
|
}
|