@infrab4a/connect-angular 5.7.5-beta.0 → 5.7.5-beta.10
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.10",
|
|
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": "
|
|
15
|
+
"@infrab4a/connect": "5.5.6-beta.10",
|
|
16
16
|
"class-transformer": "^0.5.1",
|
|
17
17
|
"js-cookie": "^3.0.1",
|
|
18
18
|
"rxjs": "^7.5.0",
|
|
@@ -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, CheckoutRepository, Checkout, 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, HomeRepository, Home, Banner, ShippingThresholds, OrderFirestoreRepository, ProductReviewRepository, VariantRepository, ProductReview, ShoppingRecurrenceFirestoreRepository, ShoppingRecurrence, CreateShoppingRecurrencyPayload, UpdateShoppingRecurrencePaymentMethodPayload, GetShoppingRecurrenceAvailableShippingPayload, UpdateShoppingRecurrenceShippingAddressPayload, CancelShoppingRecurrencePayload, ShoppingRecurrenceCycle, LineItemRecurrence, 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,6 +107,32 @@ 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
|
+
|
|
110
136
|
type PendingProductReview = {
|
|
111
137
|
id: string;
|
|
112
138
|
isEdition: boolean;
|
|
@@ -136,34 +162,6 @@ type ProductReviewCreate = {
|
|
|
136
162
|
|
|
137
163
|
type RequiredCheckoutData = Partial<Pick<Checkout, 'id' | 'user' | 'shop' | 'lineItems'>>;
|
|
138
164
|
|
|
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
|
-
|
|
167
165
|
declare class CheckoutService {
|
|
168
166
|
private readonly repositoriesFacade;
|
|
169
167
|
private readonly dependenciesFacade;
|
|
@@ -178,8 +176,11 @@ declare class CheckoutService {
|
|
|
178
176
|
resetCheckoutValues(): Observable<Checkout>;
|
|
179
177
|
applyCouponDiscount(nickname: string, checkoutType: CheckoutTypes): Observable<Coupon>;
|
|
180
178
|
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;
|
|
183
184
|
getAvailableShippingForProduct(productShipping: ShippingProductRequest): Observable<ShippingMethodResponse[]>;
|
|
184
185
|
getAvailableShippingForCheckout(): Observable<ShippingMethodResponse[]>;
|
|
185
186
|
selectShipping(option: string): Observable<Checkout>;
|
|
@@ -207,7 +208,8 @@ declare class CartService {
|
|
|
207
208
|
private cartSubject;
|
|
208
209
|
private checkoutUrl;
|
|
209
210
|
constructor(servicesFacade: CartServicesFacade, configurationFacade: ConfigurationFacade);
|
|
210
|
-
addItem(item: LineItem, quantity?: number): Observable<Cart>;
|
|
211
|
+
addItem(item: LineItem, quantity?: number, recurrence?: boolean, recurrenceCycle?: string): Observable<Cart>;
|
|
212
|
+
updateItemRecurrence(item: LineItem, recurrence?: boolean, recurrenceCycle?: string): Observable<Cart>;
|
|
211
213
|
decreaseItem(item: LineItem): Observable<Cart>;
|
|
212
214
|
removeItem(item: LineItem): Observable<Cart>;
|
|
213
215
|
updateUserCart(user: User): Observable<Cart>;
|
|
@@ -633,67 +635,6 @@ declare class WishlistService {
|
|
|
633
635
|
static ɵprov: i0.ɵɵInjectableDeclaration<WishlistService>;
|
|
634
636
|
}
|
|
635
637
|
|
|
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
|
-
|
|
697
638
|
declare class UtilHelper {
|
|
698
639
|
static createSlug(name: string): string;
|
|
699
640
|
}
|
|
@@ -717,6 +658,14 @@ declare class HomeShopService {
|
|
|
717
658
|
getHomeData(): Observable<Home>;
|
|
718
659
|
getBanners(type: BannerType): Observable<Banner[]>;
|
|
719
660
|
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>;
|
|
720
669
|
private getDiscoverProducts;
|
|
721
670
|
private getFeaturedProducts;
|
|
722
671
|
private getVerticalProducts;
|
|
@@ -744,6 +693,27 @@ declare class OrderProductReviewService {
|
|
|
744
693
|
static ɵprov: i0.ɵɵInjectableDeclaration<OrderProductReviewService>;
|
|
745
694
|
}
|
|
746
695
|
|
|
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
|
+
|
|
747
717
|
declare class OrderService {
|
|
748
718
|
private readonly angularFirestore;
|
|
749
719
|
private readonly orderRepository;
|
|
@@ -754,5 +724,5 @@ declare class OrderService {
|
|
|
754
724
|
static ɵprov: i0.ɵɵInjectableDeclaration<OrderService>;
|
|
755
725
|
}
|
|
756
726
|
|
|
757
|
-
export { AngularConnectModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule, AuthService, CartService, CatalogService, CategoryService, CategoryWithTree, CheckoutService,
|
|
727
|
+
export { AngularConnectModule, AngularFirebaseAuthModule, AngularFirestoreModule, AngularHasuraGraphQLModule, AuthService, CartService, CatalogService, CategoryService, CategoryWithTree, CheckoutService, CookieDataPersistence, HomeShopService, NewCategoryStructureAdapter, OldCategoryStructureAdapter, OrderProductReviewService, OrderRecurrenceService, OrderService, ProductSorts, UtilHelper, WishlistService };
|
|
758
728
|
export type { BuildResponseParams, Cart, CategoryStructureAdapter, DataPersistence, FetchProductsMainParams, FetchProductsOptions, FetchProductsParams, FetchProductsResponse, FirestoreOptions, HasuraGraphQLOptions, ProductSort, StockNotificationParams };
|