@infrab4a/connect-angular 5.7.5-beta.10 → 5.7.5-beta.12
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect-angular",
|
|
3
|
-
"version": "5.7.5-beta.
|
|
3
|
+
"version": "5.7.5-beta.12",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@angular/common": ">=21.0.0 <22.0.0",
|
|
13
13
|
"@angular/core": ">=21.0.0 <22.0.0",
|
|
14
14
|
"@angular/fire": ">=21.0.0-rc.0 <22.0.0",
|
|
15
|
-
"@infrab4a/connect": "5.5.
|
|
15
|
+
"@infrab4a/connect": "^5.5.3",
|
|
16
16
|
"class-transformer": "^0.5.1",
|
|
17
17
|
"js-cookie": "^3.0.1",
|
|
18
18
|
"rxjs": "^7.5.0",
|
|
@@ -35,4 +35,4 @@
|
|
|
35
35
|
},
|
|
36
36
|
"sideEffects": false,
|
|
37
37
|
"type": "module"
|
|
38
|
-
}
|
|
38
|
+
}
|
|
@@ -3,7 +3,7 @@ import { ModuleWithProviders, Type } from '@angular/core';
|
|
|
3
3
|
import { FirebaseOptions } from '@angular/fire/app';
|
|
4
4
|
import { AppCheckOptions } from '@angular/fire/app-check';
|
|
5
5
|
import * as _infrab4a_connect from '@infrab4a/connect';
|
|
6
|
-
import { HasuraGraphQLAuthOptions, CacheConfig, AxiosElasticSearchConfig, VertexSearchConfig, FirestoreConstructorParams, Shops, UserRepository, User,
|
|
6
|
+
import { HasuraGraphQLAuthOptions, CacheConfig, AxiosElasticSearchConfig, VertexSearchConfig, FirestoreConstructorParams, Shops, UserRepository, User, Checkout, CheckoutSubscription, CheckoutRepository, CheckoutTypes, Coupon, CheckoutStockValidation, UserAddress, ShippingProductRequest, ShippingMethodResponse, CheckoutPayloadRequest, CheckoutResponse, LineItem, CategoryRepository, Category as Category$1, RepositoryFindFielters as RepositoryFindFielters$1, Product as Product$1, ProductGender, RepositoryCacheOptions, RepositoryFindResult, ProductStockNotificationRepository, ProductSearchIndex, CategoryFilterRepository, Filter, ProductCatalogRepository, RepositoryOrderBy, NonFunctionPropertyNames, WishlistRepository, ProductRepository, LogRepository, PersonType, Wishlist, CouponRepository, OrderRepository, CheckoutSubscriptionRepository, HomeRepository, Home, Banner, OrderFirestoreRepository, ProductReviewRepository, VariantRepository, ProductReview, Order } from '@infrab4a/connect';
|
|
7
7
|
import { Observable, Subject } from 'rxjs';
|
|
8
8
|
import { Auth, User as User$1 } from '@angular/fire/auth';
|
|
9
9
|
import { HttpClient } from '@angular/common/http';
|
|
@@ -107,32 +107,6 @@ declare class AuthService {
|
|
|
107
107
|
static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
declare class CheckoutRepositoriesFacade {
|
|
111
|
-
readonly checkoutRepository: CheckoutRepository;
|
|
112
|
-
readonly userRepository: UserRepository;
|
|
113
|
-
constructor(checkoutRepository: CheckoutRepository, userRepository: UserRepository);
|
|
114
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutRepositoriesFacade, never>;
|
|
115
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutRepositoriesFacade>;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
declare class CheckoutDependenciesFacade {
|
|
119
|
-
readonly dataPersistence: DataPersistence;
|
|
120
|
-
readonly httpClient: HttpClient;
|
|
121
|
-
constructor(dataPersistence: DataPersistence, httpClient: HttpClient);
|
|
122
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutDependenciesFacade, never>;
|
|
123
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutDependenciesFacade>;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
declare class ConfigurationFacade {
|
|
127
|
-
readonly defaultShop: Shops;
|
|
128
|
-
readonly firebaseOptions: FirebaseOptions;
|
|
129
|
-
constructor(defaultShop: Shops, firebaseOptions: FirebaseOptions);
|
|
130
|
-
getCheckoutUrl(): string;
|
|
131
|
-
getProjectId(): string;
|
|
132
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigurationFacade, never>;
|
|
133
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ConfigurationFacade>;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
110
|
type PendingProductReview = {
|
|
137
111
|
id: string;
|
|
138
112
|
isEdition: boolean;
|
|
@@ -162,6 +136,34 @@ type ProductReviewCreate = {
|
|
|
162
136
|
|
|
163
137
|
type RequiredCheckoutData = Partial<Pick<Checkout, 'id' | 'user' | 'shop' | 'lineItems'>>;
|
|
164
138
|
|
|
139
|
+
type RequiredCheckoutSubscriptionData = Partial<Pick<CheckoutSubscription, 'id'>>;
|
|
140
|
+
|
|
141
|
+
declare class CheckoutRepositoriesFacade {
|
|
142
|
+
readonly checkoutRepository: CheckoutRepository;
|
|
143
|
+
readonly userRepository: UserRepository;
|
|
144
|
+
constructor(checkoutRepository: CheckoutRepository, userRepository: UserRepository);
|
|
145
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutRepositoriesFacade, never>;
|
|
146
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutRepositoriesFacade>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare class CheckoutDependenciesFacade {
|
|
150
|
+
readonly dataPersistence: DataPersistence;
|
|
151
|
+
readonly httpClient: HttpClient;
|
|
152
|
+
constructor(dataPersistence: DataPersistence, httpClient: HttpClient);
|
|
153
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutDependenciesFacade, never>;
|
|
154
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutDependenciesFacade>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare class ConfigurationFacade {
|
|
158
|
+
readonly defaultShop: Shops;
|
|
159
|
+
readonly firebaseOptions: FirebaseOptions;
|
|
160
|
+
constructor(defaultShop: Shops, firebaseOptions: FirebaseOptions);
|
|
161
|
+
getCheckoutUrl(): string;
|
|
162
|
+
getProjectId(): string;
|
|
163
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigurationFacade, never>;
|
|
164
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ConfigurationFacade>;
|
|
165
|
+
}
|
|
166
|
+
|
|
165
167
|
declare class CheckoutService {
|
|
166
168
|
private readonly repositoriesFacade;
|
|
167
169
|
private readonly dependenciesFacade;
|
|
@@ -176,11 +178,8 @@ declare class CheckoutService {
|
|
|
176
178
|
resetCheckoutValues(): Observable<Checkout>;
|
|
177
179
|
applyCouponDiscount(nickname: string, checkoutType: CheckoutTypes): Observable<Coupon>;
|
|
178
180
|
removeCouponDiscount(): Observable<Checkout>;
|
|
179
|
-
applyPointsDiscount(points: number): Observable<Checkout>;
|
|
180
|
-
removePointsDiscount(): Observable<Checkout>;
|
|
181
181
|
validateStockProducts(): Observable<CheckoutStockValidation>;
|
|
182
182
|
selectShippingAddress(address: UserAddress): Observable<Checkout>;
|
|
183
|
-
private formatZip;
|
|
184
183
|
getAvailableShippingForProduct(productShipping: ShippingProductRequest): Observable<ShippingMethodResponse[]>;
|
|
185
184
|
getAvailableShippingForCheckout(): Observable<ShippingMethodResponse[]>;
|
|
186
185
|
selectShipping(option: string): Observable<Checkout>;
|
|
@@ -208,8 +207,7 @@ declare class CartService {
|
|
|
208
207
|
private cartSubject;
|
|
209
208
|
private checkoutUrl;
|
|
210
209
|
constructor(servicesFacade: CartServicesFacade, configurationFacade: ConfigurationFacade);
|
|
211
|
-
addItem(item: LineItem, quantity?: number
|
|
212
|
-
updateItemRecurrence(item: LineItem, recurrence?: boolean, recurrenceCycle?: string): Observable<Cart>;
|
|
210
|
+
addItem(item: LineItem, quantity?: number): Observable<Cart>;
|
|
213
211
|
decreaseItem(item: LineItem): Observable<Cart>;
|
|
214
212
|
removeItem(item: LineItem): Observable<Cart>;
|
|
215
213
|
updateUserCart(user: User): Observable<Cart>;
|
|
@@ -635,6 +633,67 @@ declare class WishlistService {
|
|
|
635
633
|
static ɵprov: i0.ɵɵInjectableDeclaration<WishlistService>;
|
|
636
634
|
}
|
|
637
635
|
|
|
636
|
+
declare class CouponRepositoriesFacade {
|
|
637
|
+
readonly couponRepository: CouponRepository;
|
|
638
|
+
readonly orderRepository: OrderRepository;
|
|
639
|
+
readonly categoryRepository: CategoryRepository;
|
|
640
|
+
constructor(couponRepository: CouponRepository, orderRepository: OrderRepository, categoryRepository: CategoryRepository);
|
|
641
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CouponRepositoriesFacade, never>;
|
|
642
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CouponRepositoriesFacade>;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
type CheckCouponParams = {
|
|
646
|
+
nickname: string;
|
|
647
|
+
checkoutType: CheckoutTypes;
|
|
648
|
+
checkout: Partial<Checkout>;
|
|
649
|
+
plan: string;
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
declare class CouponService {
|
|
653
|
+
private readonly repositoriesFacade;
|
|
654
|
+
private readonly configurationFacade;
|
|
655
|
+
constructor(repositoriesFacade: CouponRepositoriesFacade, configurationFacade: ConfigurationFacade);
|
|
656
|
+
checkCoupon(params: CheckCouponParams): Observable<Coupon>;
|
|
657
|
+
private couponValidation;
|
|
658
|
+
private couponRulesValidation;
|
|
659
|
+
private validateSubscriptionCoupon;
|
|
660
|
+
private validateEcommerceCoupon;
|
|
661
|
+
private validateUserEligibility;
|
|
662
|
+
private validateUsageLimits;
|
|
663
|
+
private validateFirstOrderLimit;
|
|
664
|
+
private validateCouponUsageLimits;
|
|
665
|
+
private validateProductEligibility;
|
|
666
|
+
private throwMinSubTotalError;
|
|
667
|
+
calcDiscountSubscription(coupon: Coupon, checkout: Partial<CheckoutSubscription>): Observable<number>;
|
|
668
|
+
private hasMinSubTotal;
|
|
669
|
+
private hasProductCategories;
|
|
670
|
+
private coupomUserValidation;
|
|
671
|
+
private getCouponCategoriesId;
|
|
672
|
+
private emailIsFromCollaborator;
|
|
673
|
+
private getLineItensEligebleForDiscount;
|
|
674
|
+
private calcCheckoutSubtotal;
|
|
675
|
+
private getOrdersWithCoupon;
|
|
676
|
+
private getOrdersFromUser;
|
|
677
|
+
private countOrdersWithUser;
|
|
678
|
+
private getCouponUseLimits;
|
|
679
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CouponService, never>;
|
|
680
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CouponService>;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
declare class CheckoutSubscriptionService {
|
|
684
|
+
private readonly checkoutSubscriptionRepository;
|
|
685
|
+
private readonly dataPersistence;
|
|
686
|
+
private readonly couponService;
|
|
687
|
+
constructor(checkoutSubscriptionRepository: CheckoutSubscriptionRepository, dataPersistence: DataPersistence, couponService: CouponService);
|
|
688
|
+
getCheckoutSubscription(checkoutData?: RequiredCheckoutSubscriptionData): Observable<CheckoutSubscription>;
|
|
689
|
+
clearCheckoutSubscriptionFromSession(): Observable<void>;
|
|
690
|
+
checkCoupon(nickname: string, _userEmail: string): Observable<Coupon>;
|
|
691
|
+
calcDiscountSubscription(coupon: Coupon): Observable<number>;
|
|
692
|
+
private createCheckoutSubscription;
|
|
693
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutSubscriptionService, never>;
|
|
694
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CheckoutSubscriptionService>;
|
|
695
|
+
}
|
|
696
|
+
|
|
638
697
|
declare class UtilHelper {
|
|
639
698
|
static createSlug(name: string): string;
|
|
640
699
|
}
|
|
@@ -658,14 +717,6 @@ declare class HomeShopService {
|
|
|
658
717
|
getHomeData(): Observable<Home>;
|
|
659
718
|
getBanners(type: BannerType): Observable<Banner[]>;
|
|
660
719
|
getMinValueForFreeShipping(): Observable<number>;
|
|
661
|
-
/**
|
|
662
|
-
* Retorna os thresholds de frete grátis estruturados configurados no documento
|
|
663
|
-
* Home (`shippingThresholds`). Quando o documento ainda não possui essa
|
|
664
|
-
* estrutura, retorna um default conservador equivalente à regra legada
|
|
665
|
-
* (edition: 50, avulsoSp: 99, avulsoOutro: null) para que consumidores não
|
|
666
|
-
* quebrem durante a migração.
|
|
667
|
-
*/
|
|
668
|
-
getShippingThresholds(): Observable<ShippingThresholds>;
|
|
669
720
|
private getDiscoverProducts;
|
|
670
721
|
private getFeaturedProducts;
|
|
671
722
|
private getVerticalProducts;
|
|
@@ -693,27 +744,6 @@ declare class OrderProductReviewService {
|
|
|
693
744
|
static ɵprov: i0.ɵɵInjectableDeclaration<OrderProductReviewService>;
|
|
694
745
|
}
|
|
695
746
|
|
|
696
|
-
declare class OrderRecurrenceService {
|
|
697
|
-
private readonly shoppingRecurrenceRepository;
|
|
698
|
-
readonly defaultShop: Shops;
|
|
699
|
-
private readonly dependenciesFacade;
|
|
700
|
-
private readonly configurationFacade;
|
|
701
|
-
private checkoutUrl;
|
|
702
|
-
constructor(shoppingRecurrenceRepository: ShoppingRecurrenceFirestoreRepository, defaultShop: Shops, dependenciesFacade: CheckoutDependenciesFacade, configurationFacade: ConfigurationFacade);
|
|
703
|
-
getRecurrenceOrder(recurrenceId: string): Observable<ShoppingRecurrence>;
|
|
704
|
-
createRecurrenceOrder(recurrencePayload: CreateShoppingRecurrencyPayload): Observable<ShoppingRecurrence[]>;
|
|
705
|
-
updatePaymentMethod(data: UpdateShoppingRecurrencePaymentMethodPayload): Observable<ShoppingRecurrence>;
|
|
706
|
-
getRecurrenceAvailableShipping(data: GetShoppingRecurrenceAvailableShippingPayload): Observable<ShippingMethodResponse[]>;
|
|
707
|
-
updateShippingAddress(data: UpdateShoppingRecurrenceShippingAddressPayload): Observable<ShoppingRecurrence>;
|
|
708
|
-
cancelRecurrenceOrder(data: CancelShoppingRecurrencePayload): Observable<ShoppingRecurrence>;
|
|
709
|
-
enableOrDisableRecurrenceOrder(recurrenceId: string, active: boolean): Observable<ShoppingRecurrence>;
|
|
710
|
-
skipRecurrenceOrder(recurrenceEditionId: string): Observable<ShoppingRecurrence>;
|
|
711
|
-
updateFrequency(recurrenceId: string, frequency: ShoppingRecurrenceCycle): Observable<ShoppingRecurrence>;
|
|
712
|
-
updateLineItems(recurrenceId: string, lineItems: LineItemRecurrence[]): Observable<ShoppingRecurrence>;
|
|
713
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<OrderRecurrenceService, never>;
|
|
714
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<OrderRecurrenceService>;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
747
|
declare class OrderService {
|
|
718
748
|
private readonly angularFirestore;
|
|
719
749
|
private readonly orderRepository;
|
|
@@ -724,5 +754,5 @@ declare class OrderService {
|
|
|
724
754
|
static ɵprov: i0.ɵɵInjectableDeclaration<OrderService>;
|
|
725
755
|
}
|
|
726
756
|
|
|
727
|
-
export { AngularConnectModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule, AuthService, CartService, CatalogService, CategoryService, CategoryWithTree, CheckoutService, CookieDataPersistence, HomeShopService, NewCategoryStructureAdapter, OldCategoryStructureAdapter, OrderProductReviewService,
|
|
757
|
+
export { AngularConnectModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule, AuthService, CartService, CatalogService, CategoryService, CategoryWithTree, CheckoutService, CheckoutSubscriptionService, CookieDataPersistence, CouponService, HomeShopService, NewCategoryStructureAdapter, OldCategoryStructureAdapter, OrderProductReviewService, OrderService, ProductSorts, UtilHelper, WishlistService };
|
|
728
758
|
export type { BuildResponseParams, Cart, CategoryStructureAdapter, DataPersistence, FetchProductsMainParams, FetchProductsOptions, FetchProductsParams, FetchProductsResponse, FirestoreOptions, HasuraGraphQLOptions, ProductSort, StockNotificationParams };
|