ng-easycommerce-v18 0.3.20-beta.1 → 0.3.20-beta.2

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/esm2022/lib/constants/api.constants.service.mjs +15 -19
  3. package/esm2022/lib/constants/core.constants.service.mjs +5 -5
  4. package/esm2022/lib/ec-components/abstractions-components/menu-ec.component.mjs +1 -17
  5. package/esm2022/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.mjs +16 -26
  6. package/esm2022/lib/ec-components/auth-ec/password-reset-ec/password-reset-ec.component.mjs +21 -25
  7. package/esm2022/lib/ec-components/blocks-ec/block-products-ec/block-products-ec.component.mjs +16 -4
  8. package/esm2022/lib/ec-components/filters-ec/filters-ec.component.mjs +6 -31
  9. package/esm2022/lib/ec-components/header-ec/header-ec.component.mjs +21 -29
  10. package/esm2022/lib/ec-components/product-detail-ec/product-detail-ec.component.mjs +7 -12
  11. package/esm2022/lib/ec-components/stores-ec/stores-ec.component.mjs +9 -18
  12. package/esm2022/lib/ec-components/widgets-ec/decidir-ec/decidir-ec.component.mjs +6 -12
  13. package/esm2022/lib/ec-components/widgets-ec/magnizoom-ec/magnizoom-ec.component.mjs +4 -6
  14. package/esm2022/lib/ec-services/analytics/google-analytics.service.mjs +4 -4
  15. package/esm2022/lib/ec-services/analytics/gtm.service.mjs +6 -10
  16. package/esm2022/lib/ec-services/analytics/metricool-pixel.service.mjs +18 -17
  17. package/esm2022/lib/ec-services/checkout.service.mjs +2 -4
  18. package/esm2022/lib/ec-services/index.mjs +1 -3
  19. package/esm2022/lib/interceptors/index.mjs +1 -2
  20. package/esm2022/lib/interfaces/environment.mjs +1 -1
  21. package/esm2022/lib/interfaces/filter.mjs +1 -1
  22. package/esm2022/lib/interfaces/index.mjs +1 -2
  23. package/esm2022/lib/interfaces/options.mjs +1 -1
  24. package/esm2022/lib/providers/index.mjs +1 -2
  25. package/fesm2022/ng-easycommerce-v18.mjs +208 -694
  26. package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
  27. package/lib/constants/api.constants.service.d.ts +0 -1
  28. package/lib/ec-components/abstractions-components/menu-ec.component.d.ts +0 -12
  29. package/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.d.ts +0 -2
  30. package/lib/ec-components/filters-ec/filters-ec.component.d.ts +4 -12
  31. package/lib/ec-services/analytics/gtm.service.d.ts +1 -1
  32. package/lib/ec-services/index.d.ts +0 -2
  33. package/lib/interceptors/index.d.ts +0 -1
  34. package/lib/interfaces/environment.d.ts +0 -1
  35. package/lib/interfaces/filter.d.ts +0 -1
  36. package/lib/interfaces/index.d.ts +0 -1
  37. package/lib/interfaces/options.d.ts +0 -2
  38. package/lib/providers/index.d.ts +0 -1
  39. package/package.json +1 -1
  40. package/esm2022/lib/ec-services/base-api.service.mjs +0 -148
  41. package/esm2022/lib/ec-services/runtime-config.service.mjs +0 -190
  42. package/esm2022/lib/interceptors/runtime-config.interceptor.mjs +0 -41
  43. package/esm2022/lib/interfaces/runtime-config.mjs +0 -2
  44. package/esm2022/lib/providers/provideRuntimeConfig.mjs +0 -42
  45. package/lib/ec-services/base-api.service.d.ts +0 -64
  46. package/lib/ec-services/runtime-config.service.d.ts +0 -63
  47. package/lib/interceptors/runtime-config.interceptor.d.ts +0 -7
  48. package/lib/interfaces/runtime-config.d.ts +0 -22
  49. package/lib/providers/provideRuntimeConfig.d.ts +0 -13
@@ -1,64 +0,0 @@
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
- }
@@ -1,63 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { RuntimeConfig } from '../interfaces/runtime-config';
4
- import * as i0 from "@angular/core";
5
- export declare class RuntimeConfigService {
6
- private platformId;
7
- private http;
8
- private configSubject;
9
- config$: Observable<RuntimeConfig | null>;
10
- private _config;
11
- private _loadPromise;
12
- private _isLoaded;
13
- constructor(platformId: Object, http: HttpClient);
14
- /**
15
- * Inicialización única - llamada por APP_INITIALIZER
16
- * Garantiza que la configuración se carga solo una vez al inicio
17
- */
18
- initialize(): Promise<RuntimeConfig>;
19
- /**
20
- * Carga la configuración en runtime (optimizada para una sola carga)
21
- * - En SSR: Lee desde el objeto window inyectado por el servidor
22
- * - En Browser: Hace petición HTTP a /runtime-config.json (solo si no está en window)
23
- */
24
- loadConfig(): Observable<RuntimeConfig>;
25
- /**
26
- * Obtiene la configuración actual (síncrono)
27
- */
28
- getConfig(): RuntimeConfig | null;
29
- /**
30
- * Obtiene la API URL actual
31
- */
32
- getApiUrl(): string;
33
- /**
34
- * Obtiene la Frontend URL actual
35
- */
36
- getFrontendUrl(): string | undefined;
37
- /**
38
- * Obtiene el entorno actual
39
- */
40
- getAppEnv(): string;
41
- /**
42
- * Verifica si estamos en producción
43
- */
44
- isProduction(): boolean;
45
- /**
46
- * Obtiene el locale actual
47
- */
48
- getLocale(): string;
49
- /**
50
- * Obtiene el canal actual
51
- */
52
- getChannel(): string;
53
- /**
54
- * Método helper para construir URLs de API
55
- */
56
- buildApiUrl(endpoint: string): string;
57
- /**
58
- * Método helper para construir URLs del frontend
59
- */
60
- buildFrontendUrl(path: string): string;
61
- static ɵfac: i0.ɵɵFactoryDeclaration<RuntimeConfigService, never>;
62
- static ɵprov: i0.ɵɵInjectableDeclaration<RuntimeConfigService>;
63
- }
@@ -1,7 +0,0 @@
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;
@@ -1,22 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
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;