ng-easycommerce 1.1.2 → 1.1.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/README.md +10 -0
- package/assets/ec-i18n/ct.json +2 -0
- package/assets/ec-i18n/en.json +2 -0
- package/assets/ec-i18n/es.json +2 -0
- package/assets/ec-i18n/fr.json +2 -0
- package/assets/ec-i18n/gl.json +2 -0
- package/assets/ec-i18n/pr.json +2 -0
- package/bundles/ng-easycommerce.umd.js +5663 -4057
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/api/connection.service.js +2 -2
- package/esm2015/lib/core.consts.js +4 -5
- package/esm2015/lib/ec-component/cart-bootstrap-navigation.js +27 -0
- package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +11 -1
- package/esm2015/lib/ec-component/checkout-ec/checkout-ec.component.js +23 -2
- package/esm2015/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +185 -13
- package/esm2015/lib/ec-component/checkout-ec/payment-ec/payment-ec.component.js +3 -1
- package/esm2015/lib/ec-component/checkout-ec/shipment-ec/shipment-ec.component.js +4 -2
- package/esm2015/lib/ec-component/coupon-ec/coupon-ec.component.js +6 -1
- package/esm2015/lib/guards/able-buyer-guard.service.js +2 -2
- package/esm2015/lib/guards/auth-guard.service.js +2 -2
- package/esm2015/lib/guards/checkout-ready.service.js +3 -3
- package/esm2015/lib/guards/loggedin-guard.service.js +2 -2
- package/esm2015/lib/guards/user-role-guard.service.js +2 -2
- package/esm2015/lib/services/account/orders.service.js +6 -4
- package/esm2015/lib/services/auth.service.js +4 -3
- package/esm2015/lib/services/captcha.service.js +6 -4
- package/esm2015/lib/services/cart.service.js +1186 -74
- package/esm2015/lib/services/channel-config.service.js +4 -6
- package/esm2015/lib/services/checkout/addressing.service.js +65 -9
- package/esm2015/lib/services/checkout/checkout.service.js +56 -9
- package/esm2015/lib/services/checkout/error-handler.service.js +4 -3
- package/esm2015/lib/services/checkout/payment.service.js +35 -15
- package/esm2015/lib/services/checkout/shipment.service.js +54 -3
- package/esm2015/lib/services/concatenated-associations.service.js +4 -3
- package/esm2015/lib/services/currency.service.js +5 -3
- package/esm2015/lib/services/filters.service.js +2 -2
- package/esm2015/lib/services/footer/footer.service.js +4 -3
- package/esm2015/lib/services/gift-card.service.js +56 -5
- package/esm2015/lib/services/parameters.service.js +5 -3
- package/esm2015/lib/services/reviews.service.js +5 -4
- package/esm2015/lib/services/seo.service.js +4 -5
- package/esm2015/lib/services/stores.service.js +4 -3
- package/esm2015/lib/services/wishlist.service.js +3 -4
- package/esm2015/lib/utils/analytics/google-analytics.service.js +1 -1
- package/esm2015/lib/utils/price-presentation.service.js +2 -3
- package/esm2015/lib/utils/shipping-price-display.service.js +2 -3
- package/esm5/lib/api/connection.service.js +2 -2
- package/esm5/lib/core.consts.js +4 -5
- package/esm5/lib/ec-component/cart-bootstrap-navigation.js +27 -0
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +11 -1
- package/esm5/lib/ec-component/checkout-ec/checkout-ec.component.js +23 -2
- package/esm5/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +206 -12
- package/esm5/lib/ec-component/checkout-ec/payment-ec/payment-ec.component.js +3 -1
- package/esm5/lib/ec-component/checkout-ec/shipment-ec/shipment-ec.component.js +5 -3
- package/esm5/lib/ec-component/coupon-ec/coupon-ec.component.js +6 -1
- package/esm5/lib/guards/able-buyer-guard.service.js +2 -2
- package/esm5/lib/guards/auth-guard.service.js +2 -2
- package/esm5/lib/guards/checkout-ready.service.js +3 -3
- package/esm5/lib/guards/loggedin-guard.service.js +2 -2
- package/esm5/lib/guards/user-role-guard.service.js +2 -2
- package/esm5/lib/services/account/orders.service.js +6 -4
- package/esm5/lib/services/auth.service.js +4 -3
- package/esm5/lib/services/captcha.service.js +6 -4
- package/esm5/lib/services/cart.service.js +1231 -94
- package/esm5/lib/services/channel-config.service.js +4 -6
- package/esm5/lib/services/checkout/addressing.service.js +65 -9
- package/esm5/lib/services/checkout/checkout.service.js +63 -12
- package/esm5/lib/services/checkout/error-handler.service.js +4 -3
- package/esm5/lib/services/checkout/payment.service.js +29 -11
- package/esm5/lib/services/checkout/shipment.service.js +58 -7
- package/esm5/lib/services/concatenated-associations.service.js +4 -3
- package/esm5/lib/services/currency.service.js +5 -3
- package/esm5/lib/services/filters.service.js +2 -2
- package/esm5/lib/services/footer/footer.service.js +4 -3
- package/esm5/lib/services/gift-card.service.js +59 -5
- package/esm5/lib/services/parameters.service.js +5 -3
- package/esm5/lib/services/reviews.service.js +5 -4
- package/esm5/lib/services/seo.service.js +4 -5
- package/esm5/lib/services/stores.service.js +4 -3
- package/esm5/lib/services/wishlist.service.js +3 -4
- package/esm5/lib/utils/analytics/google-analytics.service.js +1 -1
- package/esm5/lib/utils/price-presentation.service.js +2 -3
- package/esm5/lib/utils/shipping-price-display.service.js +2 -3
- package/fesm2015/ng-easycommerce.js +3966 -2412
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +5667 -4061
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/cart-bootstrap-navigation.d.ts +7 -0
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +5 -2
- package/lib/ec-component/checkout-ec/checkout-ec.component.d.ts +5 -0
- package/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.d.ts +27 -3
- package/lib/services/cart.service.d.ts +120 -7
- package/lib/services/checkout/addressing.service.d.ts +1 -1
- package/lib/services/checkout/checkout.service.d.ts +3 -0
- package/lib/services/checkout/shipment.service.d.ts +2 -2
- package/lib/services/gift-card.service.d.ts +1 -0
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type CartBootstrapRecoveryRoute = 'cart' | 'checkout' | null;
|
|
2
|
+
/** Identifica las rutas del core que deben salir al inicio tras reemplazar un token inactivo. */
|
|
3
|
+
export declare const cartBootstrapRecoveryRoute: (url: string) => CartBootstrapRecoveryRoute;
|
|
4
|
+
/** Ejecuta la navegación solo desde la ruta core correspondiente al consumidor. */
|
|
5
|
+
export declare const navigateHomeAfterCartBootstrapRecovery: (url: string, expectedRoute: CartBootstrapRecoveryRoute, consumeRecovery: () => boolean, navigateHome: () => any) => boolean;
|
|
6
|
+
/** Invalida el estado local y sale únicamente de una ruta de checkout. */
|
|
7
|
+
export declare const handleInvalidatedCheckoutNavigation: (url: string, invalidateCheckout: () => void, navigateHome: () => any) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit, TemplateRef } from "@angular/core";
|
|
1
|
+
import { OnInit, OnDestroy, TemplateRef } from "@angular/core";
|
|
2
2
|
import { Router } from "@angular/router";
|
|
3
3
|
import { BsModalService } from "ngx-bootstrap/modal";
|
|
4
4
|
import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';
|
|
@@ -12,7 +12,7 @@ import { Observable } from "rxjs";
|
|
|
12
12
|
import { AddressingService } from '../../services/checkout/addressing.service';
|
|
13
13
|
import { ChannelConfigService } from '../../services/channel-config.service';
|
|
14
14
|
import { SeoService } from '../../services/seo.service';
|
|
15
|
-
export declare class CartEcComponent extends ComponentHelper implements OnInit {
|
|
15
|
+
export declare class CartEcComponent extends ComponentHelper implements OnInit, OnDestroy {
|
|
16
16
|
cartService: CartService;
|
|
17
17
|
authService: AuthService;
|
|
18
18
|
protected consts: Constants;
|
|
@@ -48,10 +48,13 @@ export declare class CartEcComponent extends ComponentHelper implements OnInit {
|
|
|
48
48
|
[key: string]: string;
|
|
49
49
|
};
|
|
50
50
|
supportsUnitPromotionHover: boolean;
|
|
51
|
+
private cartBootstrapRecoverySubscription;
|
|
52
|
+
private handleCartBootstrapRecovery;
|
|
51
53
|
constructor(cartService: CartService, authService: AuthService, consts: Constants, productsService: ProductsService, router: Router, modalService: BsModalService, toastrService: ToastService, addressingService: AddressingService, channelConfigService: ChannelConfigService, seo: SeoService);
|
|
52
54
|
ngOnChanges(): void;
|
|
53
55
|
updateLoggedIn(): void;
|
|
54
56
|
ngOnInit(): void;
|
|
57
|
+
ngOnDestroy(): void;
|
|
55
58
|
private updateCartSeo;
|
|
56
59
|
/**
|
|
57
60
|
* Convierte un monto crudo al formato decimal esperado por la UI.
|
|
@@ -44,6 +44,11 @@ export declare class CheckoutEcComponent extends ComponentHelper implements OnIn
|
|
|
44
44
|
private paymentAutoOpened;
|
|
45
45
|
private autoClosedSteps;
|
|
46
46
|
private manuallyOpenedSteps;
|
|
47
|
+
private cartBootstrapRecoverySubscription;
|
|
48
|
+
private cartCheckoutInvalidationSubscription;
|
|
49
|
+
private checkoutInvalidationHandled;
|
|
50
|
+
private handleCartBootstrapRecovery;
|
|
51
|
+
private handleCartCheckoutInvalidation;
|
|
47
52
|
hideTaxes: boolean;
|
|
48
53
|
showTaxLegend: boolean;
|
|
49
54
|
shipmentSummary: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnInit, OnDestroy, TemplateRef } from '@angular/core';
|
|
2
2
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
3
|
import { BehaviorSubject } from 'rxjs';
|
|
4
4
|
import { ComponentHelper } from '../../../classes/component-helper';
|
|
@@ -13,7 +13,7 @@ import { ParametersService } from '../../../services/parameters.service';
|
|
|
13
13
|
import { ChannelConfigService } from '../../../services/channel-config.service';
|
|
14
14
|
import { CheckoutService } from '../../../services/checkout/checkout.service';
|
|
15
15
|
import { OrderUtilityService } from '../../../utils/order-util.service';
|
|
16
|
-
export declare class DataFormEcComponent extends ComponentHelper implements OnInit {
|
|
16
|
+
export declare class DataFormEcComponent extends ComponentHelper implements OnInit, OnDestroy {
|
|
17
17
|
authService: AuthService;
|
|
18
18
|
fb: FormBuilder;
|
|
19
19
|
toast: ToastService;
|
|
@@ -78,15 +78,36 @@ export declare class DataFormEcComponent extends ComponentHelper implements OnIn
|
|
|
78
78
|
documentErrorMessage: string;
|
|
79
79
|
documentErrorMessageFacturacion: string;
|
|
80
80
|
customerHasCustomerTaxRate: boolean;
|
|
81
|
+
checkoutLoginPending: boolean;
|
|
82
|
+
checkoutLoginAddressSelectionRequired: boolean;
|
|
83
|
+
checkoutLoginAddressBookLoading: boolean;
|
|
84
|
+
checkoutLoginAddressBookLoadFailed: boolean;
|
|
81
85
|
documentTypeDropdownOpen: boolean;
|
|
82
86
|
documentTypeFactDropdownOpen: boolean;
|
|
83
87
|
private lastSavedState;
|
|
84
88
|
private isDirty;
|
|
85
89
|
private suppressDirty;
|
|
86
90
|
private addressSyncedForCompletion;
|
|
91
|
+
private checkoutLoginAttemptId;
|
|
92
|
+
private checkoutLoginSessionToken;
|
|
93
|
+
private checkoutLoginSessionEmail;
|
|
94
|
+
private checkoutLoginSubscription;
|
|
95
|
+
private checkoutLoginAuthSubscription;
|
|
96
|
+
private addressBookRequestId;
|
|
97
|
+
private destroyed$;
|
|
87
98
|
private lastSummaryTotalsSnapshot;
|
|
88
99
|
constructor(authService: AuthService, fb: FormBuilder, toast: ToastService, addressingService: AddressingService, cartService: CartService, checkoutService: CheckoutService, orderUtils: OrderUtilityService, modalService: BsModalService, paramsService: ParametersService, consts: Constants, channelConfig: ChannelConfigService);
|
|
89
100
|
ngOnInit(): void;
|
|
101
|
+
ngOnDestroy(): void;
|
|
102
|
+
/** Espera el resumen autenticado antes de reutilizar una dirección ingresada como invitado. */
|
|
103
|
+
handleCheckoutLogin: (email: string) => void;
|
|
104
|
+
showNewAddressOptionDuringLogin: () => boolean;
|
|
105
|
+
private isNewAddressCreationBlocked;
|
|
106
|
+
retryCheckoutLoginAddressBook: () => void;
|
|
107
|
+
private getAuthenticatedEmail;
|
|
108
|
+
private isCheckoutLoginSessionCurrent;
|
|
109
|
+
private cancelCheckoutLoginWait;
|
|
110
|
+
private loadCheckoutLoginAddressBook;
|
|
90
111
|
/**
|
|
91
112
|
* @description filtra los paises de acuerdo al a los codigos retornados en la funcion getCountries.
|
|
92
113
|
* Casos de usos: Si getCountries es vacio, retorna el arreglo que ingresa por parametro.
|
|
@@ -132,7 +153,7 @@ export declare class DataFormEcComponent extends ComponentHelper implements OnIn
|
|
|
132
153
|
updatePostalCodeValidationFacturacion(selectedCountry: any): void;
|
|
133
154
|
updateDocumentValidation(selectedDocumentType: any): void;
|
|
134
155
|
updateDocumentValidationFacturacion(selectedDocumentType: any): void;
|
|
135
|
-
selectAddress: (items: any, showNotesError?: boolean) => Promise<void>;
|
|
156
|
+
selectAddress: (items: any, showNotesError?: boolean, explicitConfirmation?: boolean) => Promise<void>;
|
|
136
157
|
getMode: () => boolean;
|
|
137
158
|
setMode: (mode: any) => void;
|
|
138
159
|
getModeFacturacion: () => boolean;
|
|
@@ -146,6 +167,8 @@ export declare class DataFormEcComponent extends ComponentHelper implements OnIn
|
|
|
146
167
|
toggleAddressDropdown: () => void;
|
|
147
168
|
selectAddressFromDropdown: (address: any) => void;
|
|
148
169
|
onSelectionNotesChange: () => void;
|
|
170
|
+
requiresExplicitAddressConfirmation: () => boolean;
|
|
171
|
+
confirmAddressStep: () => Promise<void>;
|
|
149
172
|
getSelectedAddressLabel: () => any;
|
|
150
173
|
getAddressOptionLabel: (address: any) => string;
|
|
151
174
|
getDefaultSelectedLabel: () => any;
|
|
@@ -160,6 +183,7 @@ export declare class DataFormEcComponent extends ComponentHelper implements OnIn
|
|
|
160
183
|
private applySelectedAddress;
|
|
161
184
|
private setCheckoutFormReadonly;
|
|
162
185
|
private shouldAutoSelectAddress;
|
|
186
|
+
private isAddressSelectionNotesRequired;
|
|
163
187
|
private addTemporaryAddressFromForm;
|
|
164
188
|
private removeTemporaryAddress;
|
|
165
189
|
private buildCurrentState;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
1
2
|
import { Product } from '../interfaces/product';
|
|
2
3
|
import { CartItem, CartItemPricing } from '../interfaces/cart-item';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
+
import { Observable, Subscription } from 'rxjs';
|
|
4
5
|
import { ConnectionService } from '../api/connection.service';
|
|
5
6
|
import { Constants } from '../core.consts';
|
|
6
7
|
import { AuthService } from './auth.service';
|
|
@@ -9,11 +10,26 @@ import { OrderUtilityService } from '../utils/order-util.service';
|
|
|
9
10
|
import { CheckoutData } from '../interfaces/checkout-data';
|
|
10
11
|
import { CartAffordable } from '../interfaces/cart/cart-affordable';
|
|
11
12
|
import { ChannelConfigService } from './channel-config.service';
|
|
12
|
-
import { AnalyticsService } from '
|
|
13
|
+
import { AnalyticsService } from './analytics.service';
|
|
13
14
|
import { Router } from '@angular/router';
|
|
14
15
|
import { Channel } from '../interfaces/channel';
|
|
15
16
|
import { CartItemPricePresentation, CartSummaryPricePresentation, PricePresentationService } from '../utils/price-presentation.service';
|
|
16
|
-
export
|
|
17
|
+
export interface CartResponseContext {
|
|
18
|
+
token: string | null;
|
|
19
|
+
generation: number;
|
|
20
|
+
requestId: number;
|
|
21
|
+
allowTokenChange: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare type CartSyncStatus = 'ready' | 'syncing' | 'invalidated' | 'error' | 'authentication-changed';
|
|
24
|
+
export interface CartSyncState {
|
|
25
|
+
status: CartSyncStatus;
|
|
26
|
+
reason?: 'checkout-interrupted' | 'network' | 'server' | 'token-unavailable' | 'authentication' | 'invalid-response' | 'cart-not-active';
|
|
27
|
+
}
|
|
28
|
+
export interface CartCheckoutInvalidation {
|
|
29
|
+
transitionId: string;
|
|
30
|
+
reason: 'checkout-completed' | 'cart-not-active';
|
|
31
|
+
}
|
|
32
|
+
export declare class CartService implements OnDestroy {
|
|
17
33
|
private connection;
|
|
18
34
|
private toastrService;
|
|
19
35
|
private consts;
|
|
@@ -27,9 +43,17 @@ export declare class CartService {
|
|
|
27
43
|
private couponSubject;
|
|
28
44
|
private cartSubject;
|
|
29
45
|
private requestInProcess;
|
|
46
|
+
private cartSyncStateSubject;
|
|
30
47
|
private promotionsSubject;
|
|
48
|
+
private cartBootstrapRecoverySubject;
|
|
49
|
+
private cartCheckoutInvalidationSubject;
|
|
31
50
|
private balanceCustomerSubject;
|
|
32
51
|
private items;
|
|
52
|
+
private pendingBootstrapCartAdds;
|
|
53
|
+
private readonly maxPendingBootstrapCartAdds;
|
|
54
|
+
private pendingBootstrapCartAddsLimitNotified;
|
|
55
|
+
private pendingBootstrapCartAddInFlight;
|
|
56
|
+
private pendingBootstrapCartQueueGeneration;
|
|
33
57
|
private count;
|
|
34
58
|
private locale;
|
|
35
59
|
private logged_in;
|
|
@@ -45,9 +69,53 @@ export declare class CartService {
|
|
|
45
69
|
addressBookApi: () => string;
|
|
46
70
|
taxesApi: () => string;
|
|
47
71
|
cart_token: any;
|
|
72
|
+
private cartLifecycleGeneration;
|
|
73
|
+
private cartRequestId;
|
|
74
|
+
private lastAppliedCartRequestId;
|
|
75
|
+
private readonly cartSyncKey;
|
|
76
|
+
private readonly tabId;
|
|
77
|
+
private readonly seenCartSyncEvents;
|
|
78
|
+
private cartSyncBlocked;
|
|
79
|
+
private cartSyncReading;
|
|
80
|
+
private cartSyncReadAgain;
|
|
81
|
+
private cartSyncTimer;
|
|
82
|
+
private pendingCheckoutRecovery;
|
|
83
|
+
private cartNotActiveRecovery;
|
|
84
|
+
private cartNotActiveTransitionId;
|
|
85
|
+
private cartNotActiveToken;
|
|
86
|
+
private cartNotActiveRecoveryTimer;
|
|
87
|
+
private cartBootstrapLookupInFlight;
|
|
88
|
+
private cartBootstrapPickup;
|
|
89
|
+
private cartBootstrapAllowsPendingAdds;
|
|
90
|
+
private cartBootstrapLookupRequiredForRetry;
|
|
91
|
+
private cartBootstrapPickupRequiredForRetry;
|
|
92
|
+
private cartBootstrapRecoveryNavigation;
|
|
93
|
+
private lastRouterNavigationId;
|
|
94
|
+
private routerNavigationSubscription;
|
|
95
|
+
private activeCheckoutTransitionId;
|
|
96
|
+
private completedCheckoutTransitionId;
|
|
97
|
+
private authContextBlocked;
|
|
98
|
+
private checkoutRecoveryTimer;
|
|
99
|
+
private checkoutInvalidatedAt;
|
|
100
|
+
private readonly checkoutRecoveryTimeoutMs;
|
|
101
|
+
private readonly cartRequestTimeoutMs;
|
|
102
|
+
private authRetryAllowed;
|
|
103
|
+
private authContext;
|
|
104
|
+
private pendingGuestCartAssociationToken;
|
|
105
|
+
private readonly storageListener;
|
|
106
|
+
private readonly visibilityListener;
|
|
107
|
+
private readonly pageshowListener;
|
|
48
108
|
cartItems: Observable<CartItem[]>;
|
|
49
109
|
coupon: Observable<any>;
|
|
50
110
|
loading: Observable<boolean>;
|
|
111
|
+
/** Estado que permite a los consumidores diferenciar el carrito listo de una recuperación pendiente o fallida. */
|
|
112
|
+
cartSyncState: Observable<CartSyncState>;
|
|
113
|
+
/** Emite únicamente si el bootstrap descartó un token inactivo y recuperó otro carrito correctamente. */
|
|
114
|
+
cartBootstrapRecovery: Observable<{
|
|
115
|
+
reason: "inactive-token-replaced";
|
|
116
|
+
}>;
|
|
117
|
+
/** Notifica al checkout montado cuando se invalida el token que su CartService estaba usando. */
|
|
118
|
+
cartCheckoutInvalidation: Observable<CartCheckoutInvalidation>;
|
|
51
119
|
cart: Observable<any>;
|
|
52
120
|
promotions: Observable<CheckoutData[]>;
|
|
53
121
|
deleting: Boolean;
|
|
@@ -67,10 +135,49 @@ export declare class CartService {
|
|
|
67
135
|
showMax$: Observable<boolean>;
|
|
68
136
|
showPrice$: Observable<boolean>;
|
|
69
137
|
constructor(connection: ConnectionService, toastrService: ToastService, consts: Constants, authService: AuthService, orderUtils: OrderUtilityService, analyticsService: AnalyticsService, channelConfigService: ChannelConfigService, router: Router, pricePresentationService: PricePresentationService);
|
|
138
|
+
ngOnDestroy(): void;
|
|
139
|
+
/** Consume el evento de bootstrap una sola vez y solo durante la navegación que inició la recuperación. */
|
|
140
|
+
consumeCartBootstrapRecovery(): boolean;
|
|
141
|
+
private getCurrentRouterNavigationId;
|
|
142
|
+
private markCartBootstrapRecoveryPending;
|
|
143
|
+
private completeCartBootstrapRecovery;
|
|
144
|
+
private createCartSyncId;
|
|
145
|
+
private getAuthContext;
|
|
146
|
+
private cartTransitionIdForToken;
|
|
147
|
+
private notifyCheckoutInvalidation;
|
|
148
|
+
private publishCartSync;
|
|
149
|
+
private handleStorageEvent;
|
|
150
|
+
private receiveCartSync;
|
|
151
|
+
private checkPendingCartSync;
|
|
152
|
+
private scheduleCartRefresh;
|
|
153
|
+
private refreshCartFromBackend;
|
|
154
|
+
private setCartSyncState;
|
|
155
|
+
private startCheckoutRecoveryWatchdog;
|
|
156
|
+
private markInterruptedCheckoutIfExpired;
|
|
157
|
+
private invalidateLocalCart;
|
|
158
|
+
/** Reintenta una lectura fallida. Si el token ya fue invalidado, no crea otro carrito. */
|
|
159
|
+
retryCartSync: () => boolean;
|
|
160
|
+
/** Reanuda explícitamente un checkout interrumpido consultando /carts sin token. */
|
|
161
|
+
recoverInterruptedCheckout: () => boolean;
|
|
162
|
+
/** Impide enviar nuevas mutaciones mientras la pestaña reconcilia una invalidación remota. */
|
|
163
|
+
canMutateCart: () => boolean;
|
|
164
|
+
/** Confirma que el resumen listo ya pertenece al contexto de autenticación vigente. */
|
|
165
|
+
isCartReadyForCurrentAuthContext: () => boolean;
|
|
166
|
+
private discardPendingBootstrapCartAdds;
|
|
167
|
+
private flushPendingBootstrapCartAdds;
|
|
168
|
+
/** Detecta el contrato de carrito finalizado sin tratar otros conflictos HTTP como invalidez del carrito. */
|
|
169
|
+
isCartNotActiveError: (error: any) => boolean;
|
|
170
|
+
/** Consume un CART_NOT_ACTIVE, invalida solo el token de esa solicitud e inicia una recuperación única. */
|
|
171
|
+
handleCartMutationError: (error: any, requestToken?: string) => boolean;
|
|
172
|
+
private startCartNotActiveRecovery;
|
|
173
|
+
private startCartNotActiveRecoveryWatchdog;
|
|
70
174
|
getCart2(): CartItem[];
|
|
71
175
|
getAddressBook: () => Promise<any>;
|
|
72
|
-
getTaxes: () => Promise<
|
|
176
|
+
getTaxes: () => Promise<Subscription>;
|
|
73
177
|
private getCart;
|
|
178
|
+
private startCartBootstrapPickup;
|
|
179
|
+
private resumeCartBootstrapIfInvalidated;
|
|
180
|
+
private finishCheckoutCartRecovery;
|
|
74
181
|
private getCartByToken;
|
|
75
182
|
private getCartByCustomer;
|
|
76
183
|
/**
|
|
@@ -78,6 +185,12 @@ export declare class CartService {
|
|
|
78
185
|
* CART CRUD SERVER'S SYNCRONIZED
|
|
79
186
|
*/
|
|
80
187
|
private initializeCart;
|
|
188
|
+
/** Captura la generación del ciclo del carrito y el orden de inicio de la petición. */
|
|
189
|
+
captureCartResponseContext: (allowTokenChange?: boolean) => CartResponseContext;
|
|
190
|
+
isCartResponseContextCurrent: (context: CartResponseContext) => boolean;
|
|
191
|
+
isCartBusinessError: (response: any) => boolean;
|
|
192
|
+
/** Adopta y sincroniza un resumen exitoso si todavía pertenece a la versión vigente del carrito. */
|
|
193
|
+
applyCartResponse: (response: any, context: CartResponseContext, emitEvent?: boolean, publishInvalidation?: boolean, flushPendingAdds?: boolean) => boolean;
|
|
81
194
|
/**
|
|
82
195
|
* Reasigna `product.price` al precio base legacy que espera el template histórico del carrito.
|
|
83
196
|
*
|
|
@@ -115,7 +228,7 @@ export declare class CartService {
|
|
|
115
228
|
* @public
|
|
116
229
|
* CART CRUD
|
|
117
230
|
*/
|
|
118
|
-
addToCart: (product: Product, quantity: number, variant_id: any, comments?: string) => void;
|
|
231
|
+
addToCart: (product: Product, quantity: number, variant_id: any, comments?: string, fromBootstrapQueue?: boolean, queueGeneration?: number) => void;
|
|
119
232
|
addToLot: (product: Product, quantity: number, variant_id: any, id?: any, order_item_id?: any, lot_quantity?: any, unit_price?: any, unit_total?: any, ajustement_total?: any, total_lot?: any, lot_status?: any, date_request?: any, notes?: any, shipping_address_id?: any, shipping_address_name?: any, action?: any) => void;
|
|
120
233
|
addToCartPromise: (product: Product, quantity: number, variant_id: any, comments?: string) => Promise<{
|
|
121
234
|
error: boolean;
|
|
@@ -134,7 +247,7 @@ export declare class CartService {
|
|
|
134
247
|
clearAndResetCustomerCart(): void;
|
|
135
248
|
handleError: (error: {
|
|
136
249
|
error: string;
|
|
137
|
-
}) => void;
|
|
250
|
+
}, requestToken?: string) => void;
|
|
138
251
|
getCountFromItemInCart: (codeVariant: any) => number;
|
|
139
252
|
findItemByIdVariant: (variant_id: any) => any;
|
|
140
253
|
findItem: (product_id: any) => any;
|
|
@@ -212,7 +325,7 @@ export declare class CartService {
|
|
|
212
325
|
changeHaveToUpdate: (value: any) => any;
|
|
213
326
|
readyForCheckout: (successCallback?: Function, errorCallback?: Function) => CartAffordable;
|
|
214
327
|
updateItemsOnError: (itemsWithError: any[], code: string) => void;
|
|
215
|
-
loadCartByToken: (token: string) => Promise<
|
|
328
|
+
loadCartByToken: (token: string) => Promise<Subscription>;
|
|
216
329
|
/**
|
|
217
330
|
* UTILS
|
|
218
331
|
*/
|
|
@@ -241,7 +241,7 @@ export declare class AddressingService extends StepService {
|
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
};
|
|
244
|
-
setTypeSelectAddress: (type:
|
|
244
|
+
setTypeSelectAddress: (type: boolean | "ONLY_LOAD_ADDRESS" | "ONLY_ADDRESS_SELECTION" | "LOAD_ADDRESS_AND_SELECTION") => void;
|
|
245
245
|
setTypeForms: (type: typeForms) => void;
|
|
246
246
|
}
|
|
247
247
|
export {};
|
|
@@ -40,6 +40,7 @@ export declare class CheckoutService implements OnInit {
|
|
|
40
40
|
private asociatedDataSubject;
|
|
41
41
|
private order;
|
|
42
42
|
private checkout_data;
|
|
43
|
+
private checkoutStateGeneration;
|
|
43
44
|
total: any;
|
|
44
45
|
private cartLocal;
|
|
45
46
|
private user;
|
|
@@ -61,6 +62,8 @@ export declare class CheckoutService implements OnInit {
|
|
|
61
62
|
setSteps: (steps: StepI[], autohandle?: boolean) => void;
|
|
62
63
|
setStepReady: (step_number: any, data: any, order?: any, automatic?: any) => Promise<boolean>;
|
|
63
64
|
setStepDoing: (step_number: any) => Promise<boolean>;
|
|
65
|
+
/** Invalida de inmediato los datos y pasos del checkout asociado a un carrito finalizado. */
|
|
66
|
+
invalidateCheckoutState: () => void;
|
|
64
67
|
restartAllStepsFrom: (step_number: any, included?: boolean, update?: boolean) => Step[];
|
|
65
68
|
isCheckoutReady: () => boolean;
|
|
66
69
|
isStepReady: (step_name: any) => any;
|
|
@@ -44,8 +44,8 @@ export declare class ShipmentService extends StepService {
|
|
|
44
44
|
constructor(connection: ConnectionService, transformer: ShipmentDataTransformer, shippingPriceDisplay: ShippingPriceDisplayService, analyticsService: AnalyticsService, consts: Constants, cartService: CartService, storesService: StoresService, checkoutService: CheckoutService);
|
|
45
45
|
getShipmentMethods: () => Promise<any[]>;
|
|
46
46
|
getShippingOptions: () => Promise<any[]>;
|
|
47
|
-
setMethod: (method: any) => Promise<
|
|
48
|
-
setMethodOnly: (method: any) => Promise<
|
|
47
|
+
setMethod: (method: any) => Promise<boolean>;
|
|
48
|
+
setMethodOnly: (method: any) => Promise<boolean>;
|
|
49
49
|
setShippingOption: (payload: {
|
|
50
50
|
method: string;
|
|
51
51
|
option: string;
|