ng-easycommerce-v18 0.3.23-beta.2 → 0.4.1-beta.1
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 +126 -111
- package/assets/decidirFormEc.html +514 -514
- package/assets/ec-i18n/ct.json +286 -282
- package/assets/ec-i18n/en.json +12 -1
- package/assets/ec-i18n/es.json +445 -434
- package/assets/ec-i18n/fr.json +4 -0
- package/assets/ec-i18n/gl.json +286 -282
- package/assets/ec-i18n/pr.json +286 -282
- package/assets/images/cards-occasional.svg +21 -21
- package/assets/recaptcha/recaptcha-site-keys.json +3 -3
- package/assets/recaptcha/recaptcha-sites-prod.json +38 -38
- package/assets/recaptcha/recaptcha-sites.json +52 -52
- package/esm2022/lib/api/connection.service.mjs +1 -1
- package/esm2022/lib/classes/checkout/steps.mjs +1 -1
- package/esm2022/lib/classes/component-helper.mjs +1 -1
- package/esm2022/lib/classes/filters/attributes-filter.mjs +1 -1
- package/esm2022/lib/classes/filters/category-filter.mjs +1 -1
- package/esm2022/lib/classes/filters/dynamics-filter.mjs +1 -1
- package/esm2022/lib/classes/filters/filter-factory.mjs +1 -1
- package/esm2022/lib/classes/filters/filter.mjs +1 -1
- package/esm2022/lib/classes/filters/index.mjs +1 -1
- package/esm2022/lib/classes/filters/price_range-filter.mjs +1 -1
- package/esm2022/lib/classes/filters/sort-filter.mjs +1 -1
- package/esm2022/lib/classes/index.mjs +1 -1
- package/esm2022/lib/classes/user.mjs +1 -1
- package/esm2022/lib/constants/api.constants.service.mjs +19 -15
- package/esm2022/lib/constants/core.constants.service.mjs +9 -3
- package/esm2022/lib/constants/index.mjs +1 -1
- package/esm2022/lib/ec-components/abstractions-components/block-ec.component.mjs +1 -1
- package/esm2022/lib/ec-components/abstractions-components/index.mjs +1 -1
- package/esm2022/lib/ec-components/abstractions-components/menu-ec.component.mjs +17 -1
- package/esm2022/lib/ec-components/account-ec/account-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/account-ec/index.mjs +1 -1
- package/esm2022/lib/ec-components/account-ec/order-ec/order-ec.component.mjs +5 -9
- package/esm2022/lib/ec-components/account-ec/orders-list-ec/orders-list-ec.component.mjs +11 -5
- package/esm2022/lib/ec-components/auth-ec/auth-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/auth-ec/confirm-account-ec/confirm-account-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/auth-ec/forgot-password-ec/forgot-password-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/auth-ec/index.mjs +1 -1
- package/esm2022/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.mjs +28 -18
- package/esm2022/lib/ec-components/auth-ec/password-reset-ec/password-reset-ec.component.mjs +27 -23
- package/esm2022/lib/ec-components/auth-ec/register-form-ec/register-form-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/auth-ec/register-wholesaler-form-ec/register-wholesaler-form-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/blocks-ec/block-banner-box-ec/block-banner-box-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/blocks-ec/block-banner-full-ec/block-banner-full-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/blocks-ec/block-form-contact-ec/block-form-contact-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/blocks-ec/block-html-ec/block-html-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/blocks-ec/block-newsletter-ec/block-newsletter-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/blocks-ec/block-products-ec/block-products-ec.component.mjs +7 -4
- package/esm2022/lib/ec-components/blocks-ec/blocks-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/blocks-ec/index.mjs +1 -1
- package/esm2022/lib/ec-components/breadcrumb-ec/breadcrumb-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/cart-ec/cart-ec.component.mjs +12 -3
- package/esm2022/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/cart-ec/index.mjs +1 -1
- package/esm2022/lib/ec-components/checkout-ec/checkout-ec.component.mjs +10 -3
- package/esm2022/lib/ec-components/checkout-ec/dataform-ec/dataform-ec.component.mjs +4 -11
- package/esm2022/lib/ec-components/checkout-ec/dataform-ec/input-ec/input-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/checkout-ec/detail-checkout-block-ec/detail-checkout-block-ec.component.mjs +5 -3
- package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-ec.component.mjs +49 -5
- package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/bank-transfer-ec/bank-transfer-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/index.mjs +1 -1
- package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/mp-redirect-ec/mp-redirect-ec.component.mjs +55 -46
- package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/offline-ec/offline-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/checkout-ec/shipment-ec/shipment-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/checkout-ec/step-container-ec/step-container-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/checkout-ec/success-ec/success-ec.component.mjs +4 -3
- package/esm2022/lib/ec-components/collection-ec/collection-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/contact-ec/contact-ec.component.mjs +1 -1
- package/esm2022/lib/ec-components/coupon-ec/coupon-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/credit-account-banner-ec/credit-account-banner-ec.component.mjs +79 -0
- package/esm2022/lib/ec-components/faqs-ec/faqs-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/filters-ec/filters-ec.component.mjs +30 -7
- package/esm2022/lib/ec-components/filters-sort-ec/filters-sort-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/footer-ec/footer-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/header-ec/header-ec.component.mjs +37 -17
- package/esm2022/lib/ec-components/home-ec/home-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/index.mjs +2 -1
- package/esm2022/lib/ec-components/price-range-filter/price-range-filter.component.mjs +3 -3
- package/esm2022/lib/ec-components/product-detail-ec/product-detail-ec.component.mjs +12 -7
- package/esm2022/lib/ec-components/product-ec/product-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/related-products-ec/related-products-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/reviews-ec/reviews-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/reviews-form-ec/reviews-form-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/section-container-ec/section-container-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/index.mjs +1 -1
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-email-ec/share-email-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-facebook-ec/share-facebook-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-pinterest-ec/share-pinterest-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-twitter-ec/share-twitter-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-whatsapp-ec/share-whatsapp-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/share-ec/share-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/sidebar-ec/sidebar-ec.component.mjs +5 -7
- package/esm2022/lib/ec-components/stores-ec/stores-ec.component.mjs +20 -11
- package/esm2022/lib/ec-components/variants-ec/variants-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/widgets-ec/decidir-ec/decidir-ec.component.mjs +14 -8
- package/esm2022/lib/ec-components/widgets-ec/index.mjs +1 -1
- package/esm2022/lib/ec-components/widgets-ec/loading/index.mjs +1 -1
- package/esm2022/lib/ec-components/widgets-ec/loading/loading-full-ec/loading-full-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/widgets-ec/loading/loading-inline-ec/loading-inline-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/widgets-ec/loading/loading-section-ec/loading-section-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/widgets-ec/magnizoom-ec/magnizoom-ec.component.mjs +9 -9
- package/esm2022/lib/ec-components/widgets-ec/price-ec/price-ec.component.mjs +5 -11
- package/esm2022/lib/ec-components/widgets-ec/rating-ec/rating-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/widgets-ec/re-captcha-ec/re-captcha-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/widgets-ec/redsys-catch-ec/redsys-catch-ec.component.mjs +19 -9
- package/esm2022/lib/ec-directive/index.mjs +1 -1
- package/esm2022/lib/ec-directive/product-off.directive.mjs +1 -1
- package/esm2022/lib/ec-directive/product-stock.directive.mjs +1 -1
- package/esm2022/lib/ec-guards/auth.guard.mjs +1 -1
- package/esm2022/lib/ec-pipe/ec-currency-symbol.pipe.mjs +1 -1
- package/esm2022/lib/ec-pipe/ec-safe-html.pipe.mjs +1 -1
- package/esm2022/lib/ec-pipe/index.mjs +1 -1
- package/esm2022/lib/ec-services/addressing.service.mjs +1 -1
- package/esm2022/lib/ec-services/analytics/analytics.service.mjs +1 -1
- package/esm2022/lib/ec-services/analytics/doppler.service.mjs +1 -1
- package/esm2022/lib/ec-services/analytics/facebook-pixel.service.mjs +1 -1
- package/esm2022/lib/ec-services/analytics/google-analytics.service.mjs +4 -4
- package/esm2022/lib/ec-services/analytics/gtm.service.mjs +3 -2
- package/esm2022/lib/ec-services/analytics/index.mjs +1 -1
- package/esm2022/lib/ec-services/analytics/metricool-pixel.service.mjs +11 -11
- package/esm2022/lib/ec-services/auth.service.mjs +1 -1
- package/esm2022/lib/ec-services/auth.storage.service.mjs +1 -1
- package/esm2022/lib/ec-services/base-api.service.mjs +148 -0
- package/esm2022/lib/ec-services/blocks-repository.service.mjs +1 -1
- package/esm2022/lib/ec-services/blocks.service.mjs +1 -1
- package/esm2022/lib/ec-services/cart.service.mjs +42 -7
- package/esm2022/lib/ec-services/channel.service.mjs +1 -1
- package/esm2022/lib/ec-services/checkout.service.mjs +4 -2
- package/esm2022/lib/ec-services/currency.service.mjs +1 -1
- package/esm2022/lib/ec-services/filters.service.mjs +1 -1
- package/esm2022/lib/ec-services/form.service.mjs +1 -1
- package/esm2022/lib/ec-services/index.mjs +4 -1
- package/esm2022/lib/ec-services/local-storage.service.mjs +1 -1
- package/esm2022/lib/ec-services/ngx-local-storage.service.mjs +1 -1
- package/esm2022/lib/ec-services/options.service.mjs +1 -1
- package/esm2022/lib/ec-services/order-utility.service.mjs +1 -1
- package/esm2022/lib/ec-services/orders.service.mjs +1 -1
- package/esm2022/lib/ec-services/pagination.service.mjs +1 -1
- package/esm2022/lib/ec-services/parameters.service.mjs +1 -1
- package/esm2022/lib/ec-services/payment.service.mjs +1 -1
- package/esm2022/lib/ec-services/price-visibility.service.mjs +40 -0
- package/esm2022/lib/ec-services/product-detail.service.mjs +45 -7
- package/esm2022/lib/ec-services/products.service.mjs +1 -1
- package/esm2022/lib/ec-services/re-captcha.service.mjs +1 -1
- package/esm2022/lib/ec-services/reviews.service.mjs +1 -1
- package/esm2022/lib/ec-services/runtime-config.service.mjs +219 -0
- package/esm2022/lib/ec-services/shipment.service.mjs +1 -1
- package/esm2022/lib/ec-services/stores.service.mjs +1 -1
- package/esm2022/lib/ec-services/test.service.mjs +1 -1
- package/esm2022/lib/ec-services/toast.service.mjs +1 -1
- package/esm2022/lib/interceptors/auth.interceptor.mjs +1 -1
- package/esm2022/lib/interceptors/index.mjs +2 -1
- package/esm2022/lib/interceptors/runtime-config.interceptor.mjs +41 -0
- package/esm2022/lib/interfaces/analytics/event-key.mjs +1 -1
- package/esm2022/lib/interfaces/analytics/facebook-pixel-data.mjs +1 -1
- package/esm2022/lib/interfaces/analytics/gtm-config.mjs +1 -1
- package/esm2022/lib/interfaces/analytics/index.mjs +1 -1
- package/esm2022/lib/interfaces/blocks.mjs +1 -1
- package/esm2022/lib/interfaces/checkout.mjs +1 -1
- package/esm2022/lib/interfaces/connection.mjs +1 -1
- package/esm2022/lib/interfaces/coupon.mjs +1 -1
- package/esm2022/lib/interfaces/currency.mjs +1 -1
- package/esm2022/lib/interfaces/deserializable.mjs +1 -1
- package/esm2022/lib/interfaces/environment.mjs +1 -1
- package/esm2022/lib/interfaces/faqs.mjs +1 -1
- package/esm2022/lib/interfaces/filter.mjs +1 -1
- package/esm2022/lib/interfaces/index.mjs +2 -1
- package/esm2022/lib/interfaces/options.mjs +1 -1
- package/esm2022/lib/interfaces/pagination.mjs +1 -1
- package/esm2022/lib/interfaces/parameter.mjs +1 -1
- package/esm2022/lib/interfaces/product.mjs +1 -1
- package/esm2022/lib/interfaces/runtime-config.mjs +2 -0
- package/esm2022/lib/interfaces/step.mjs +1 -1
- package/esm2022/lib/interfaces/storage.mjs +1 -1
- package/esm2022/lib/interfaces/store.mjs +1 -1
- package/esm2022/lib/interfaces/types/user.type.mjs +1 -1
- package/esm2022/lib/providers/index.mjs +2 -1
- package/esm2022/lib/providers/provideEnvironment.mjs +1 -1
- package/esm2022/lib/providers/provideRuntimeConfig.mjs +36 -0
- package/esm2022/lib/stores/currency.store.mjs +1 -1
- package/esm2022/public-api.mjs +1 -1
- package/fesm2022/ng-easycommerce-v18.mjs +1125 -354
- package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
- package/lib/constants/api.constants.service.d.ts +1 -0
- package/lib/constants/core.constants.service.d.ts +5 -1
- package/lib/ec-components/abstractions-components/menu-ec.component.d.ts +12 -0
- package/lib/ec-components/account-ec/order-ec/order-ec.component.d.ts +2 -2
- package/lib/ec-components/account-ec/orders-list-ec/orders-list-ec.component.d.ts +3 -0
- package/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.d.ts +2 -0
- package/lib/ec-components/cart-ec/cart-ec.component.d.ts +4 -2
- package/lib/ec-components/checkout-ec/checkout-ec.component.d.ts +2 -0
- package/lib/ec-components/checkout-ec/detail-checkout-block-ec/detail-checkout-block-ec.component.d.ts +2 -0
- package/lib/ec-components/checkout-ec/payment-ec/payment-ec.component.d.ts +7 -1
- package/lib/ec-components/checkout-ec/payment-ec/payment-methods/mp-redirect-ec/mp-redirect-ec.component.d.ts +1 -0
- package/lib/ec-components/checkout-ec/success-ec/success-ec.component.d.ts +1 -0
- package/lib/ec-components/credit-account-banner-ec/credit-account-banner-ec.component.d.ts +27 -0
- package/lib/ec-components/filters-ec/filters-ec.component.d.ts +12 -4
- package/lib/ec-components/header-ec/header-ec.component.d.ts +12 -4
- package/lib/ec-components/index.d.ts +1 -0
- package/lib/ec-components/sidebar-ec/sidebar-ec.component.d.ts +2 -1
- package/lib/ec-components/widgets-ec/price-ec/price-ec.component.d.ts +2 -4
- package/lib/ec-services/base-api.service.d.ts +64 -0
- package/lib/ec-services/cart.service.d.ts +1 -0
- package/lib/ec-services/index.d.ts +3 -0
- package/lib/ec-services/price-visibility.service.d.ts +23 -0
- package/lib/ec-services/product-detail.service.d.ts +3 -0
- package/lib/ec-services/runtime-config.service.d.ts +69 -0
- package/lib/interceptors/index.d.ts +1 -0
- package/lib/interceptors/runtime-config.interceptor.d.ts +7 -0
- package/lib/interfaces/environment.d.ts +1 -0
- package/lib/interfaces/filter.d.ts +1 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/interfaces/options.d.ts +2 -0
- package/lib/interfaces/runtime-config.d.ts +22 -0
- package/lib/providers/index.d.ts +1 -0
- package/lib/providers/provideRuntimeConfig.d.ts +13 -0
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ export declare class CoreConstantsService {
|
|
|
18
18
|
/**
|
|
19
19
|
* Document token para acceso SSR-compatible al documento
|
|
20
20
|
*/
|
|
21
|
-
private
|
|
21
|
+
private _document;
|
|
22
22
|
/**
|
|
23
23
|
* Contiene los datos provisto por el frontend en el archivo environment.ts
|
|
24
24
|
*/
|
|
@@ -32,6 +32,10 @@ export declare class CoreConstantsService {
|
|
|
32
32
|
* Lo usamos para que PaginationService sepa qué filtro esperar.
|
|
33
33
|
*/
|
|
34
34
|
currentRouteType: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Getter seguro para document que verifica la plataforma
|
|
37
|
+
*/
|
|
38
|
+
private get document();
|
|
35
39
|
constructor();
|
|
36
40
|
/**
|
|
37
41
|
* Path usado en las colecciones de productos.
|
|
@@ -75,6 +75,18 @@ export declare class MenuEcComponent {
|
|
|
75
75
|
* @returns true si la categoría es visible, false en caso contrario
|
|
76
76
|
*/
|
|
77
77
|
hasVisibleProperty(category: Category): boolean;
|
|
78
|
+
private filterVisibleTree;
|
|
79
|
+
categoriesVisible$: Observable<Category[]>;
|
|
80
|
+
sectionsVisible$: Observable<Section[]>;
|
|
81
|
+
attributesVisible$: Observable<Attribute[]>;
|
|
82
|
+
getVisibleChildren<T extends {
|
|
83
|
+
isVisible?: boolean;
|
|
84
|
+
children?: T[];
|
|
85
|
+
}>(node?: T): T[];
|
|
86
|
+
hasVisibleChildren<T extends {
|
|
87
|
+
isVisible?: boolean;
|
|
88
|
+
children?: T[];
|
|
89
|
+
}>(node?: T): boolean;
|
|
78
90
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuEcComponent, never>;
|
|
79
91
|
static ɵcmp: i0.ɵɵComponentDeclaration<MenuEcComponent, "lib-footer-ec", never, {}, {}, never, never, true, never>;
|
|
80
92
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
+
import { PriceVisibilityService } from '../../../ec-services/price-visibility.service';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class OrderEcComponent implements OnInit {
|
|
@@ -9,11 +10,10 @@ export declare class OrderEcComponent implements OnInit {
|
|
|
9
10
|
private _cartService;
|
|
10
11
|
private _channelConfigService;
|
|
11
12
|
private _activedRoute;
|
|
13
|
+
readonly priceVisibility: PriceVisibilityService;
|
|
12
14
|
order$: Observable<any>;
|
|
13
15
|
allowRepeatOrders: boolean;
|
|
14
16
|
loading: boolean;
|
|
15
|
-
creditAccountShowPrices: boolean | null;
|
|
16
|
-
hidePrices: boolean;
|
|
17
17
|
hideDiscounts: boolean;
|
|
18
18
|
hideTaxes: boolean;
|
|
19
19
|
channelConfig: any;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
|
+
import { PriceVisibilityService } from '../../../ec-services/price-visibility.service';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class OrdersListEcComponent implements OnInit {
|
|
4
5
|
private _ordersService;
|
|
5
6
|
private _router;
|
|
7
|
+
private _cartService;
|
|
8
|
+
readonly priceVisibility: PriceVisibilityService;
|
|
6
9
|
loading: boolean;
|
|
7
10
|
orders: any[];
|
|
8
11
|
private error;
|
|
@@ -2,10 +2,12 @@ import { EventEmitter } from '@angular/core';
|
|
|
2
2
|
import { UserRoleType } from '../../../interfaces';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class LoginFormEcComponent {
|
|
5
|
+
private platformId;
|
|
5
6
|
private _authService;
|
|
6
7
|
private _formBuilder;
|
|
7
8
|
private _toastService;
|
|
8
9
|
private _router;
|
|
10
|
+
constructor(platformId: Object);
|
|
9
11
|
showPassword: boolean;
|
|
10
12
|
/**
|
|
11
13
|
* Parametro para indicar si tras loguear
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Injector } from '@angular/core';
|
|
1
|
+
import { Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CartEcComponent {
|
|
4
|
+
export declare class CartEcComponent implements OnInit {
|
|
5
5
|
private _channelService;
|
|
6
6
|
channel: any;
|
|
7
7
|
private _toastrService;
|
|
@@ -12,6 +12,7 @@ export declare class CartEcComponent {
|
|
|
12
12
|
totalPromotionAmount$: import("rxjs").Observable<number>;
|
|
13
13
|
taxesAmount$: import("rxjs").Observable<number>;
|
|
14
14
|
totalAmount$: import("rxjs").Observable<any>;
|
|
15
|
+
creditAccountShowPrices$: import("rxjs").Observable<boolean | null>;
|
|
15
16
|
private _authService;
|
|
16
17
|
isAuthenticated$: boolean;
|
|
17
18
|
getTotalAmount: import("rxjs").Observable<any>;
|
|
@@ -19,6 +20,7 @@ export declare class CartEcComponent {
|
|
|
19
20
|
hideTaxes: boolean;
|
|
20
21
|
injector: Injector;
|
|
21
22
|
constructor();
|
|
23
|
+
ngOnInit(): void;
|
|
22
24
|
removeCoupon(): void;
|
|
23
25
|
redirectCheckout(): boolean;
|
|
24
26
|
getMinimumPurchaseAmount: () => any;
|
|
@@ -4,6 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class CheckoutEcComponent implements OnInit {
|
|
5
5
|
private _channelService;
|
|
6
6
|
private _checkoutService;
|
|
7
|
+
private _router;
|
|
7
8
|
readonly ADDRESS: StepType;
|
|
8
9
|
readonly SHIPMENT: StepType;
|
|
9
10
|
readonly PAYMENT: StepType;
|
|
@@ -11,6 +12,7 @@ export declare class CheckoutEcComponent implements OnInit {
|
|
|
11
12
|
channel: any;
|
|
12
13
|
subCan: any;
|
|
13
14
|
canCheckout: boolean;
|
|
15
|
+
hidePrices: boolean;
|
|
14
16
|
constructor();
|
|
15
17
|
ngOnInit(): void;
|
|
16
18
|
initializeCheckout(): void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { PriceVisibilityService } from '../../../ec-services/price-visibility.service';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class DetailCheckoutBlockEcComponent {
|
|
3
4
|
private _checkoutService;
|
|
5
|
+
readonly priceVisibility: PriceVisibilityService;
|
|
4
6
|
data$: import("rxjs").Observable<any>;
|
|
5
7
|
data: any;
|
|
6
8
|
getIcon: (data_type: string) => "fas fa-ticket-alt fa-3x" | "fas fa-tags fa-3x" | "fas fa-shipping-fast fa-3x" | "fas fa-boxes fa-3x" | "fas fa-file-invoice-dollar fa-3x" | "fas fa-shopping-basket fa-3x";
|
|
@@ -5,6 +5,7 @@ export declare class PaymentEcComponent implements OnInit {
|
|
|
5
5
|
_paymentService: PaymentService;
|
|
6
6
|
private _checkoutService;
|
|
7
7
|
private _cartService;
|
|
8
|
+
private _toastService;
|
|
8
9
|
private _methodDataSubject;
|
|
9
10
|
private _loadingSubject;
|
|
10
11
|
methods$: import("rxjs").Observable<any[]>;
|
|
@@ -12,10 +13,14 @@ export declare class PaymentEcComponent implements OnInit {
|
|
|
12
13
|
methodData$: import("rxjs").Observable<any>;
|
|
13
14
|
loadingInternal: boolean;
|
|
14
15
|
total_amount: number;
|
|
16
|
+
allowAnyPaymentMethod: boolean | null;
|
|
17
|
+
balanceMethodRejected: boolean;
|
|
18
|
+
showMethodError: boolean;
|
|
15
19
|
constructor();
|
|
16
20
|
ngOnInit(): void;
|
|
17
21
|
setActive($event: any): void;
|
|
18
22
|
setMethod(method: any): Promise<void>;
|
|
23
|
+
private handleMethodError;
|
|
19
24
|
isRedirectRedsys: (code: string) => boolean;
|
|
20
25
|
isRedirectCecaBank: (code: string) => boolean;
|
|
21
26
|
isMP: (code: string) => boolean;
|
|
@@ -29,10 +34,11 @@ export declare class PaymentEcComponent implements OnInit {
|
|
|
29
34
|
isBankTransfer: (code: string) => boolean;
|
|
30
35
|
isCatastro: (code: string) => boolean;
|
|
31
36
|
isBamboo: (code: string) => boolean;
|
|
37
|
+
isBalanceInAccount: (code: string) => boolean;
|
|
32
38
|
allData(): any;
|
|
33
39
|
emitResult: () => Promise<void>;
|
|
34
40
|
setLoading: (estado?: boolean) => boolean;
|
|
35
|
-
verifyValidate: ($event
|
|
41
|
+
verifyValidate: ($event?: any) => void;
|
|
36
42
|
next: () => void;
|
|
37
43
|
goBack: () => void;
|
|
38
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaymentEcComponent, never>;
|
|
@@ -25,6 +25,7 @@ export declare class SuccessEcComponent implements OnInit {
|
|
|
25
25
|
* @returns el bloque si lo encontro.
|
|
26
26
|
*/
|
|
27
27
|
containsBlock(codeBlock: string): any;
|
|
28
|
+
isBalanceInAccount: (code: string) => boolean | "";
|
|
28
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<SuccessEcComponent, never>;
|
|
29
30
|
static ɵcmp: i0.ɵɵComponentDeclaration<SuccessEcComponent, "app-order-success-ec", never, {}, {}, never, never, true, never>;
|
|
30
31
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export type CreditAccountBannerLayout = 'inline' | 'mobile';
|
|
3
|
+
export declare class CreditAccountBannerEcComponent {
|
|
4
|
+
private readonly cartService;
|
|
5
|
+
private readonly authService;
|
|
6
|
+
layout: CreditAccountBannerLayout;
|
|
7
|
+
title?: string;
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
availableLabel?: string;
|
|
10
|
+
limitLabel?: string;
|
|
11
|
+
titleKey: string;
|
|
12
|
+
subtitleKey: string;
|
|
13
|
+
availableLabelKey: string;
|
|
14
|
+
limitLabelKey: string;
|
|
15
|
+
requireLogged: boolean;
|
|
16
|
+
private readonly balance;
|
|
17
|
+
private readonly loggedIn;
|
|
18
|
+
readonly showMax: import("@angular/core").Signal<boolean>;
|
|
19
|
+
readonly canShowAmounts: import("@angular/core").Signal<boolean>;
|
|
20
|
+
readonly remainingCredits: import("@angular/core").Signal<number>;
|
|
21
|
+
readonly creditAmount: import("@angular/core").Signal<number>;
|
|
22
|
+
readonly progress: import("@angular/core").Signal<number>;
|
|
23
|
+
readonly barColor: import("@angular/core").Signal<"#6c757d" | "#198754" | "#ffc107" | "#dc3545">;
|
|
24
|
+
shouldRender(): boolean;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CreditAccountBannerEcComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CreditAccountBannerEcComponent, "app-credit-account-banner-ec", never, { "layout": { "alias": "layout"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "availableLabel": { "alias": "availableLabel"; "required": false; }; "limitLabel": { "alias": "limitLabel"; "required": false; }; "titleKey": { "alias": "titleKey"; "required": false; }; "subtitleKey": { "alias": "subtitleKey"; "required": false; }; "availableLabelKey": { "alias": "availableLabelKey"; "required": false; }; "limitLabelKey": { "alias": "limitLabelKey"; "required": false; }; "requireLogged": { "alias": "requireLogged"; "required": false; }; }, {}, never, never, true, never>;
|
|
27
|
+
}
|
|
@@ -44,11 +44,19 @@ export declare class FiltersEcComponent {
|
|
|
44
44
|
scrollUp: () => boolean;
|
|
45
45
|
hasAppliedFilters(): boolean;
|
|
46
46
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
* Verifica si una categoría tiene la propiedad isVisible y está marcada como visible
|
|
48
|
+
* @param category - La categoría a verificar
|
|
49
|
+
* @returns true si la categoría es visible, false en caso contrario
|
|
50
|
+
*/
|
|
51
51
|
hasVisibleProperty(category: FilterElement): boolean;
|
|
52
|
+
/** Lista visible (filtra recursivo por isVisible) */
|
|
53
|
+
getVisibleData(filter: Filter | null): FilterElement[];
|
|
54
|
+
/** Children visibles de un nodo */
|
|
55
|
+
getVisibleChildren(node?: FilterElement): FilterElement[];
|
|
56
|
+
/** Tiene hijos visibles? */
|
|
57
|
+
hasVisibleChildren(node?: FilterElement): boolean;
|
|
58
|
+
/** Utilidad recursiva */
|
|
59
|
+
private filterVisibleTree;
|
|
52
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<FiltersEcComponent, never>;
|
|
53
61
|
static ɵcmp: i0.ɵɵComponentDeclaration<FiltersEcComponent, "lib-filters-ec", never, { "setSelect": { "alias": "setSelect"; "required": false; }; }, {}, never, never, true, never>;
|
|
54
62
|
}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { ChangeDetectorRef } from '@angular/core';
|
|
1
|
+
import { OnInit, ChangeDetectorRef, OnDestroy } from '@angular/core';
|
|
2
2
|
import { MenuEcComponent } from '../abstractions-components';
|
|
3
|
+
import { PriceVisibilityService } from '../../ec-services/price-visibility.service';
|
|
3
4
|
import { Observable } from 'rxjs';
|
|
4
5
|
import { AuthService } from '../../ec-services';
|
|
5
6
|
import { Router } from '@angular/router';
|
|
7
|
+
import { BalanceCustomer } from '../../interfaces';
|
|
6
8
|
import { ChannelService } from '../../ec-services';
|
|
7
9
|
import * as i0 from "@angular/core";
|
|
8
10
|
/**
|
|
9
11
|
* Componente que se encarga de manejar la funcionalidad del Header.
|
|
10
12
|
*/
|
|
11
|
-
export declare class HeaderEcComponent extends MenuEcComponent {
|
|
13
|
+
export declare class HeaderEcComponent extends MenuEcComponent implements OnInit, OnDestroy {
|
|
12
14
|
channel: string | undefined;
|
|
13
15
|
searchValue: string;
|
|
14
16
|
transparent: boolean;
|
|
15
17
|
isHome: boolean;
|
|
16
18
|
isScrolled: boolean;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
balanceAttributes: BalanceCustomer | null;
|
|
20
|
+
private subscriptions;
|
|
19
21
|
__authService: AuthService;
|
|
20
22
|
_channelService: ChannelService;
|
|
23
|
+
readonly priceVisibility: PriceVisibilityService;
|
|
21
24
|
changeDetector: ChangeDetectorRef;
|
|
22
25
|
appRouter: Router;
|
|
23
26
|
platformId: Object;
|
|
27
|
+
private _cartService;
|
|
28
|
+
balanceAttributes$: Observable<BalanceCustomer | null>;
|
|
24
29
|
mobileDropdownOpen: import("@angular/core").WritableSignal<boolean>;
|
|
25
30
|
isMenuOpen: import("@angular/core").WritableSignal<boolean>;
|
|
26
31
|
logged$: Observable<boolean>;
|
|
@@ -46,6 +51,9 @@ export declare class HeaderEcComponent extends MenuEcComponent {
|
|
|
46
51
|
togglePanel(id: string): void;
|
|
47
52
|
openPanels: import("@angular/core").WritableSignal<Record<string, boolean>>;
|
|
48
53
|
collapseAllMenus(): void;
|
|
54
|
+
get canShowPrices(): boolean;
|
|
55
|
+
ngOnDestroy(): void;
|
|
56
|
+
private subscribeToBalance;
|
|
49
57
|
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderEcComponent, never>;
|
|
50
58
|
static ɵcmp: i0.ɵɵComponentDeclaration<HeaderEcComponent, "lib-header-ec", never, {}, {}, never, never, true, never>;
|
|
51
59
|
}
|
|
@@ -32,3 +32,4 @@ export * from './reviews-form-ec/reviews-form-ec.component';
|
|
|
32
32
|
export * from './section-container-ec/section-container-ec.component';
|
|
33
33
|
export * from './stores-ec/stores-ec.component';
|
|
34
34
|
export * from './price-range-filter/price-range-filter.component';
|
|
35
|
+
export * from './credit-account-banner-ec/credit-account-banner-ec.component';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { User } from '../../classes';
|
|
2
|
+
import { PriceVisibilityService } from '../../ec-services/price-visibility.service';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class SidebarEcComponent {
|
|
4
5
|
private _cartService;
|
|
@@ -7,13 +8,13 @@ export declare class SidebarEcComponent {
|
|
|
7
8
|
private _router;
|
|
8
9
|
private _toastrService;
|
|
9
10
|
private _channelService;
|
|
11
|
+
readonly priceVisibility: PriceVisibilityService;
|
|
10
12
|
user: User | null;
|
|
11
13
|
mediaUrl: string;
|
|
12
14
|
promotions: never[];
|
|
13
15
|
variantsToShow: string[];
|
|
14
16
|
hideDiscounts: boolean;
|
|
15
17
|
hideTaxes: boolean;
|
|
16
|
-
creditAccountShowPrices: boolean | null;
|
|
17
18
|
cartItems$: import("rxjs").Observable<any[]>;
|
|
18
19
|
subTotalAmount$: import("rxjs").Observable<number>;
|
|
19
20
|
totalPromotionAmount$: import("rxjs").Observable<number>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OnInit, TemplateRef } from '@angular/core';
|
|
2
|
+
import { PriceVisibilityService } from '../../../ec-services/price-visibility.service';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
/**
|
|
4
5
|
* Componente para manejar la vista del precio de un producto.
|
|
@@ -22,12 +23,9 @@ export declare class PriceEcComponent implements OnInit {
|
|
|
22
23
|
customTaxTemplate: TemplateRef<any> | null;
|
|
23
24
|
customOnlyTaxLabelTemplate: TemplateRef<any> | null;
|
|
24
25
|
private _channelService;
|
|
25
|
-
|
|
26
|
+
readonly priceVisibility: PriceVisibilityService;
|
|
26
27
|
showTaxLegend: boolean;
|
|
27
28
|
hideTaxes: boolean;
|
|
28
|
-
showPricesOnlyToLoggedUsers: boolean;
|
|
29
|
-
logged: boolean;
|
|
30
|
-
hidePrices: boolean;
|
|
31
29
|
ngOnInit(): void;
|
|
32
30
|
/** Determina si mostrar la sección de impuestos */
|
|
33
31
|
get shouldShowTaxes(): boolean;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RuntimeConfigService } from './runtime-config.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface ApiRequestOptions {
|
|
6
|
+
headers?: HttpHeaders | {
|
|
7
|
+
[header: string]: string | string[];
|
|
8
|
+
};
|
|
9
|
+
params?: HttpParams | {
|
|
10
|
+
[param: string]: string | string[];
|
|
11
|
+
};
|
|
12
|
+
withCredentials?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Servicio base para realizar peticiones HTTP usando configuración dinámica
|
|
16
|
+
* Todos los servicios de la aplicación deben extender este servicio o usar sus métodos
|
|
17
|
+
*/
|
|
18
|
+
export declare class BaseApiService {
|
|
19
|
+
protected http: HttpClient;
|
|
20
|
+
protected runtimeConfigService: RuntimeConfigService;
|
|
21
|
+
constructor(http: HttpClient, runtimeConfigService: RuntimeConfigService);
|
|
22
|
+
/**
|
|
23
|
+
* Construye una URL completa usando la API_URL del runtime
|
|
24
|
+
*/
|
|
25
|
+
protected buildApiUrl(endpoint: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Obtiene headers comunes que incluyen información del runtime
|
|
28
|
+
*/
|
|
29
|
+
protected getCommonHeaders(): HttpHeaders;
|
|
30
|
+
/**
|
|
31
|
+
* Método GET genérico
|
|
32
|
+
*/
|
|
33
|
+
get<T>(endpoint: string, options?: ApiRequestOptions): Observable<T>;
|
|
34
|
+
/**
|
|
35
|
+
* Método POST genérico
|
|
36
|
+
*/
|
|
37
|
+
post<T>(endpoint: string, data: any, options?: ApiRequestOptions): Observable<T>;
|
|
38
|
+
/**
|
|
39
|
+
* Método PUT genérico
|
|
40
|
+
*/
|
|
41
|
+
put<T>(endpoint: string, data: any, options?: ApiRequestOptions): Observable<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Método PATCH genérico
|
|
44
|
+
*/
|
|
45
|
+
patch<T>(endpoint: string, data: any, options?: ApiRequestOptions): Observable<T>;
|
|
46
|
+
/**
|
|
47
|
+
* Método DELETE genérico
|
|
48
|
+
*/
|
|
49
|
+
delete<T>(endpoint: string, options?: ApiRequestOptions): Observable<T>;
|
|
50
|
+
/**
|
|
51
|
+
* Método para peticiones que necesitan esperar a que la config esté cargada
|
|
52
|
+
*/
|
|
53
|
+
getWithConfig<T>(endpoint: string, options?: ApiRequestOptions): Observable<T>;
|
|
54
|
+
/**
|
|
55
|
+
* Método para POST que necesitan esperar a que la config esté cargada
|
|
56
|
+
*/
|
|
57
|
+
postWithConfig<T>(endpoint: string, data: any, options?: ApiRequestOptions): Observable<T>;
|
|
58
|
+
/**
|
|
59
|
+
* Combina headers personalizados con los headers comunes
|
|
60
|
+
*/
|
|
61
|
+
private mergeHeaders;
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseApiService, never>;
|
|
63
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseApiService>;
|
|
64
|
+
}
|
|
@@ -222,6 +222,7 @@ export declare class CartService {
|
|
|
222
222
|
getRemainingCredits: () => Observable<number | undefined>;
|
|
223
223
|
hasSufficientCreditsForCartTotal: () => boolean;
|
|
224
224
|
private validatePriceAndCredits;
|
|
225
|
+
private hasCreditsForNewItem;
|
|
225
226
|
addRepeatOrderToCart(items: any[]): void;
|
|
226
227
|
static ɵfac: i0.ɵɵFactoryDeclaration<CartService, never>;
|
|
227
228
|
static ɵprov: i0.ɵɵInjectableDeclaration<CartService>;
|
|
@@ -24,3 +24,6 @@ export * from './order-utility.service';
|
|
|
24
24
|
export * from './payment.service';
|
|
25
25
|
export * from './test.service';
|
|
26
26
|
export * from './orders.service';
|
|
27
|
+
export * from './runtime-config.service';
|
|
28
|
+
export * from './base-api.service';
|
|
29
|
+
export * from './price-visibility.service';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Gestiona la visibilidad global de precios según:
|
|
4
|
+
* - configuración del canal (hidePrices, showPricesOnlyToLoggedUsers)
|
|
5
|
+
* - estado de autenticación
|
|
6
|
+
* - restricciones por cuenta corriente (showPrice desde balance)
|
|
7
|
+
*
|
|
8
|
+
* Nota: este servicio no contempla reglas por producto (shouldShowPrice, etc.).
|
|
9
|
+
*/
|
|
10
|
+
export declare class PriceVisibilityService {
|
|
11
|
+
private readonly channelService;
|
|
12
|
+
private readonly authService;
|
|
13
|
+
private readonly cartService;
|
|
14
|
+
private readonly channelConfig;
|
|
15
|
+
private readonly loggedIn;
|
|
16
|
+
private readonly creditAccountShowPrices;
|
|
17
|
+
readonly hidePrices: import("@angular/core").Signal<boolean>;
|
|
18
|
+
readonly showPricesOnlyToLoggedUsers: import("@angular/core").Signal<boolean>;
|
|
19
|
+
readonly canShowPrices: import("@angular/core").Signal<boolean>;
|
|
20
|
+
readonly canShowPrices$: import("rxjs").Observable<boolean>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PriceVisibilityService, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PriceVisibilityService>;
|
|
23
|
+
}
|
|
@@ -11,6 +11,8 @@ export declare class ProductDetailService {
|
|
|
11
11
|
options$: import("rxjs").Observable<any>;
|
|
12
12
|
associatedData$: import("rxjs").Observable<any>;
|
|
13
13
|
private variants;
|
|
14
|
+
private _currentTotalAmount;
|
|
15
|
+
private _balanceCustomer;
|
|
14
16
|
constructor();
|
|
15
17
|
/**
|
|
16
18
|
* Obtengo el producto a traves de su codigo e inicializo la configuración
|
|
@@ -92,6 +94,7 @@ export declare class ProductDetailService {
|
|
|
92
94
|
* @returns
|
|
93
95
|
*/
|
|
94
96
|
private validateQuantity;
|
|
97
|
+
private validatePriceAndCredits;
|
|
95
98
|
static ɵfac: i0.ɵɵFactoryDeclaration<ProductDetailService, never>;
|
|
96
99
|
static ɵprov: i0.ɵɵInjectableDeclaration<ProductDetailService>;
|
|
97
100
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RuntimeConfig } from '../interfaces/runtime-config';
|
|
4
|
+
import { Environment } from '../interfaces';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class RuntimeConfigService {
|
|
7
|
+
private platformId;
|
|
8
|
+
private http;
|
|
9
|
+
private environment;
|
|
10
|
+
private configSubject;
|
|
11
|
+
config$: Observable<RuntimeConfig | null>;
|
|
12
|
+
private _config;
|
|
13
|
+
private _loadPromise;
|
|
14
|
+
private _isLoaded;
|
|
15
|
+
constructor(platformId: Object, http: HttpClient, environment: Environment | null);
|
|
16
|
+
/**
|
|
17
|
+
* Obtiene configuración de fallback desde environment.ts
|
|
18
|
+
*/
|
|
19
|
+
private getFallbackConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Inicialización única - llamada por APP_INITIALIZER
|
|
22
|
+
* Garantiza que la configuración se carga solo una vez al inicio
|
|
23
|
+
*/
|
|
24
|
+
initialize(): Promise<RuntimeConfig>;
|
|
25
|
+
/**
|
|
26
|
+
* Carga la configuración en runtime (optimizada para una sola carga)
|
|
27
|
+
* - En SSR: Lee desde el objeto window inyectado por el servidor
|
|
28
|
+
* - En Browser: Hace petición HTTP a /runtime-config.json (solo si no está en window)
|
|
29
|
+
*/
|
|
30
|
+
loadConfig(): Observable<RuntimeConfig>;
|
|
31
|
+
/**
|
|
32
|
+
* Obtiene la configuración actual (síncrono)
|
|
33
|
+
*/
|
|
34
|
+
getConfig(): RuntimeConfig | null;
|
|
35
|
+
/**
|
|
36
|
+
* Obtiene la API URL actual
|
|
37
|
+
*/
|
|
38
|
+
getApiUrl(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Obtiene la Frontend URL actual
|
|
41
|
+
*/
|
|
42
|
+
getFrontendUrl(): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Obtiene el entorno actual
|
|
45
|
+
*/
|
|
46
|
+
getAppEnv(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Verifica si estamos en producción
|
|
49
|
+
*/
|
|
50
|
+
isProduction(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Obtiene el locale actual
|
|
53
|
+
*/
|
|
54
|
+
getLocale(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Obtiene el canal actual
|
|
57
|
+
*/
|
|
58
|
+
getChannel(): string;
|
|
59
|
+
/**
|
|
60
|
+
* Método helper para construir URLs de API
|
|
61
|
+
*/
|
|
62
|
+
buildApiUrl(endpoint: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Método helper para construir URLs del frontend
|
|
65
|
+
*/
|
|
66
|
+
buildFrontendUrl(path: string): string;
|
|
67
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RuntimeConfigService, [null, null, { optional: true; }]>;
|
|
68
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RuntimeConfigService>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpInterceptorFn } from '@angular/common/http';
|
|
2
|
+
/**
|
|
3
|
+
* Interceptor que garantiza que las peticiones HTTP no se hagan hasta que
|
|
4
|
+
* el runtime config esté completamente cargado
|
|
5
|
+
* Evita que se hagan peticiones con URLs incorrectas
|
|
6
|
+
*/
|
|
7
|
+
export declare const runtimeConfigInterceptor: HttpInterceptorFn;
|
|
@@ -4,6 +4,7 @@ export interface Category {
|
|
|
4
4
|
slug: string;
|
|
5
5
|
position: number;
|
|
6
6
|
path: string;
|
|
7
|
+
isVisible?: boolean;
|
|
7
8
|
children?: Category[];
|
|
8
9
|
images?: any[];
|
|
9
10
|
}
|
|
@@ -23,4 +24,5 @@ export interface Attribute {
|
|
|
23
24
|
slug: string;
|
|
24
25
|
useToFilter: boolean;
|
|
25
26
|
styles?: any[];
|
|
27
|
+
isVisible?: boolean;
|
|
26
28
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface RuntimeConfig {
|
|
2
|
+
apiUrl: string;
|
|
3
|
+
frontendUrl?: string;
|
|
4
|
+
/** Ambiente de la aplicación. Valores válidos: 'prod', 'preprod', 'test' */
|
|
5
|
+
appEnv: 'prod' | 'preprod' | 'test';
|
|
6
|
+
production: boolean;
|
|
7
|
+
locale: string;
|
|
8
|
+
channel: string;
|
|
9
|
+
port?: number;
|
|
10
|
+
host?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ServerEnvironmentVariables {
|
|
13
|
+
API_URL?: string;
|
|
14
|
+
FRONTEND_URL?: string;
|
|
15
|
+
/** Ambiente de la aplicación. Valores válidos: 'prod', 'preprod', 'test' */
|
|
16
|
+
APP_ENV?: 'prod' | 'preprod' | 'test';
|
|
17
|
+
PORT?: string;
|
|
18
|
+
HOST?: string;
|
|
19
|
+
NODE_ENV?: 'development' | 'production';
|
|
20
|
+
LOCALE?: string;
|
|
21
|
+
CHANNEL?: string;
|
|
22
|
+
}
|
package/lib/providers/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { RuntimeConfigService } from '../ec-services/runtime-config.service';
|
|
3
|
+
/**
|
|
4
|
+
* Factory function para APP_INITIALIZER (OPTIMIZADA)
|
|
5
|
+
* Carga la configuración runtime UNA SOLA VEZ antes de que Angular bootstrap la aplicación
|
|
6
|
+
* Evita múltiples cargas y mejora el rendimiento
|
|
7
|
+
*/
|
|
8
|
+
export declare function initializeRuntimeConfig(runtimeConfigService: RuntimeConfigService): () => Promise<any>;
|
|
9
|
+
/**
|
|
10
|
+
* Función que configura el RuntimeConfigService y su inicialización
|
|
11
|
+
* Debe ser usado en app.config.ts junto con provideEnvironment
|
|
12
|
+
*/
|
|
13
|
+
export declare function provideRuntimeConfig(): EnvironmentProviders;
|