@infrab4a/connect-angular 4.0.0-beta.3 → 4.0.0-beta.30
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 +1 -0
- package/angular-firestore.module.d.ts +2 -1
- package/consts/backend-url.const.d.ts +1 -0
- package/consts/index.d.ts +1 -0
- package/esm2020/angular-connect.module.mjs +10 -3
- package/esm2020/angular-elastic-search.module.mjs +3 -7
- package/esm2020/angular-firestore.module.mjs +226 -137
- package/esm2020/angular-hasura-graphql.module.mjs +105 -24
- package/esm2020/consts/backend-url.const.mjs +2 -0
- package/esm2020/consts/index.mjs +2 -1
- package/esm2020/index.mjs +3 -3
- package/esm2020/services/auth.service.mjs +3 -3
- package/esm2020/services/cart.service.mjs +161 -23
- package/esm2020/services/catalog/catalog.service.mjs +51 -0
- package/esm2020/services/catalog/category.service.mjs +29 -0
- package/esm2020/services/catalog/enums/index.mjs +2 -0
- package/esm2020/services/catalog/enums/product-sorts.enum.mjs +10 -0
- package/esm2020/services/catalog/index.mjs +6 -0
- package/esm2020/services/catalog/models/category-with-tree.model.mjs +10 -0
- package/esm2020/services/catalog/models/index.mjs +2 -0
- package/esm2020/services/catalog/types/index.mjs +2 -0
- package/esm2020/services/catalog/types/product-sort.type.mjs +2 -0
- package/esm2020/services/checkout-subscription.service.mjs +5 -3
- package/esm2020/services/checkout.service.mjs +2 -2
- package/esm2020/services/coupon.service.mjs +21 -37
- package/esm2020/services/index.mjs +5 -3
- package/esm2020/services/shipping.service.mjs +96 -0
- package/esm2020/services/types/shipping-methods.type.mjs +2 -0
- package/fesm2015/infrab4a-connect-angular.mjs +1455 -978
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +1445 -966
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/package.json +2 -3
- package/services/cart.service.d.ts +9 -2
- package/services/catalog/catalog.service.d.ts +23 -0
- package/services/catalog/category.service.d.ts +11 -0
- package/services/catalog/enums/index.d.ts +1 -0
- package/services/catalog/enums/product-sorts.enum.d.ts +8 -0
- package/services/catalog/index.d.ts +5 -0
- package/services/catalog/models/category-with-tree.model.d.ts +4 -0
- package/services/catalog/models/index.d.ts +1 -0
- package/services/catalog/types/index.d.ts +1 -0
- package/services/catalog/types/product-sort.type.d.ts +2 -0
- package/services/coupon.service.d.ts +2 -3
- package/services/index.d.ts +4 -2
- package/services/shipping.service.d.ts +19 -0
- package/services/types/shipping-methods.type.d.ts +12 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LineItem, ProductRepository, Shops, User } from '@infrab4a/connect';
|
|
1
|
+
import { Buy2WinFirestoreRepository, CategoryRepository, LineItem, ProductRepository, Shops, User, VariantRepository } from '@infrab4a/connect';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { AuthService } from './auth.service';
|
|
4
4
|
import { CheckoutService } from './checkout.service';
|
|
@@ -12,8 +12,11 @@ export declare class CartService {
|
|
|
12
12
|
private readonly checkoutService;
|
|
13
13
|
private readonly defaultShop;
|
|
14
14
|
private readonly productRepository;
|
|
15
|
+
private readonly categoryRepository;
|
|
16
|
+
private readonly variantRepository;
|
|
17
|
+
private readonly buy2WinRepository;
|
|
15
18
|
private cartSubject;
|
|
16
|
-
constructor(authService: AuthService, checkoutService: CheckoutService, defaultShop: Shops, productRepository: ProductRepository);
|
|
19
|
+
constructor(authService: AuthService, checkoutService: CheckoutService, defaultShop: Shops, productRepository: ProductRepository, categoryRepository: CategoryRepository, variantRepository: VariantRepository, buy2WinRepository: Buy2WinFirestoreRepository);
|
|
17
20
|
addItem(item: LineItem, quantity?: number): Observable<Cart>;
|
|
18
21
|
decreaseItem(item: LineItem): Observable<Cart>;
|
|
19
22
|
getCart(checkout?: RequiredCheckoutData): Observable<Cart>;
|
|
@@ -28,8 +31,12 @@ export declare class CartService {
|
|
|
28
31
|
private updateLineItemInCart;
|
|
29
32
|
private generateCartObject;
|
|
30
33
|
private buildLineItem;
|
|
34
|
+
private roundPrice;
|
|
35
|
+
private getProductData;
|
|
31
36
|
private getProductPrice;
|
|
32
37
|
private checkMaxStock;
|
|
38
|
+
getGifts(): Observable<Cart>;
|
|
39
|
+
private giftToLineItems;
|
|
33
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<CartService, never>;
|
|
34
41
|
static ɵprov: i0.ɵɵInjectableDeclaration<CartService>;
|
|
35
42
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Category, CategoryRepository, Product, ProductRepository } from '@infrab4a/connect';
|
|
2
|
+
import { ProductSort } from './types/product-sort.type';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CatalogService {
|
|
5
|
+
private readonly productRepository;
|
|
6
|
+
private readonly categoryRepository;
|
|
7
|
+
constructor(productRepository: ProductRepository, categoryRepository: CategoryRepository);
|
|
8
|
+
fetchProducts(category: Category, options?: {
|
|
9
|
+
page?: number;
|
|
10
|
+
perPage?: number;
|
|
11
|
+
filters?: string[];
|
|
12
|
+
sort?: ProductSort;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
products: Product[];
|
|
15
|
+
pages: number;
|
|
16
|
+
total: number;
|
|
17
|
+
}>;
|
|
18
|
+
private buildFilterQuery;
|
|
19
|
+
private buildSortQuery;
|
|
20
|
+
private buildLimitQuery;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CatalogService, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CatalogService>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Category, CategoryFilterRepository, Filter } from '@infrab4a/connect';
|
|
2
|
+
import { CategoryWithTree } from './models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class CategoryService {
|
|
5
|
+
private readonly categoryFilterRepository;
|
|
6
|
+
constructor(categoryFilterRepository: CategoryFilterRepository);
|
|
7
|
+
fetchSubCategories(category: Category): Promise<CategoryWithTree[]>;
|
|
8
|
+
fetchFilterOptions(category: Category, filters?: string[]): Promise<Filter[]>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CategoryService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CategoryService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './product-sorts.enum';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './category-with-tree.model';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './product-sort.type';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { CategoryRepository, Checkout, CheckoutSubscription, CheckoutTypes, Coupon, CouponRepository, OrderRepository, Shops
|
|
1
|
+
import { CategoryRepository, Checkout, CheckoutSubscription, CheckoutTypes, Coupon, CouponRepository, 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 {
|
|
5
5
|
private readonly couponRepository;
|
|
6
6
|
private readonly defaultShop;
|
|
7
7
|
private readonly orderRepository;
|
|
8
|
-
private readonly subscriptionRepository;
|
|
9
8
|
private readonly categoryRepository;
|
|
10
|
-
constructor(couponRepository: CouponRepository, defaultShop: Shops, orderRepository: OrderRepository,
|
|
9
|
+
constructor(couponRepository: CouponRepository, defaultShop: Shops, orderRepository: OrderRepository, categoryRepository: CategoryRepository);
|
|
11
10
|
checkCoupon(nickname: string, userEmail: string, checkoutType: CheckoutTypes, plan?: string, checkout?: Partial<Checkout>, isSubscription?: boolean): Observable<Coupon>;
|
|
12
11
|
private emailIsFromCollaborator;
|
|
13
12
|
private checkCouponRules;
|
package/services/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './auth.service';
|
|
2
2
|
export * from './cart.service';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './catalog';
|
|
4
4
|
export * from './checkout-subscription.service';
|
|
5
|
-
export * from './
|
|
5
|
+
export * from './checkout.service';
|
|
6
6
|
export * from './coupon.service';
|
|
7
7
|
export * from './home-shop.service';
|
|
8
|
+
export * from './order.service';
|
|
9
|
+
export * from './shipping.service';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { HomeShopService } from './home-shop.service';
|
|
4
|
+
import { ShippingMethodResponse } from './types/shipping-methods.type';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class ShippingService {
|
|
7
|
+
private http;
|
|
8
|
+
private apiUrl;
|
|
9
|
+
private homeService;
|
|
10
|
+
constructor(http: HttpClient, apiUrl: string, homeService: HomeShopService);
|
|
11
|
+
getShippingMethods(shop: string, zip: string, weightGrams: number, totalPrice: number, personId: string, subscriptionPlan?: string): Observable<Array<ShippingMethodResponse & {
|
|
12
|
+
ShippingCompanyName?: string;
|
|
13
|
+
}>>;
|
|
14
|
+
private isFreeShippingBySubscription;
|
|
15
|
+
private isHalfShippingBySubscription;
|
|
16
|
+
private isHolidays;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShippingService, never>;
|
|
18
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ShippingService>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ShippingMethodResponse {
|
|
2
|
+
daysToDelivery: number;
|
|
3
|
+
currency: string;
|
|
4
|
+
description: string;
|
|
5
|
+
maxDeliveryDate: string;
|
|
6
|
+
minDeliveryDate: string;
|
|
7
|
+
serviceCode: string;
|
|
8
|
+
serviceName: string;
|
|
9
|
+
totalPrice: number;
|
|
10
|
+
additionalDescription: string;
|
|
11
|
+
cnpj: string;
|
|
12
|
+
}
|