ngx-dsxlibrary 1.21.22 → 1.21.25

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-dsxlibrary",
3
- "version": "1.21.22",
3
+ "version": "1.21.25",
4
4
  "description": "Libreria para control de código automatizado.",
5
5
  "author": "DevSoftXela",
6
6
  "dependencies": {
@@ -1039,6 +1039,21 @@ declare function createTypedCacheProvider<T extends Record<string, string>>(toke
1039
1039
  provider: Provider;
1040
1040
  };
1041
1041
 
1042
+ declare class DteService {
1043
+ /** Servicio HttpClient para realizar peticiones HTTP */
1044
+ private http;
1045
+ /**
1046
+ * Configuración del entorno inyectada mediante el token ENVIRONMENT.
1047
+ * La validación se realiza automáticamente al usar provideEnvironment().
1048
+ */
1049
+ private environment;
1050
+ /** URL base de la API JWT construida desde la configuración del entorno */
1051
+ private SeguridadITApi;
1052
+ pdfDTE(UUID: string): Observable<Blob>;
1053
+ static ɵfac: i0.ɵɵFactoryDeclaration<DteService, never>;
1054
+ static ɵprov: i0.ɵɵInjectableDeclaration<DteService>;
1055
+ }
1056
+
1042
1057
  declare class EndpointService<T> {
1043
1058
  private http;
1044
1059
  private environment;
@@ -1404,10 +1419,47 @@ declare class UtilityAddService {
1404
1419
  * @param actionId 0 para abrir en nueva ventana, 1 para descargar
1405
1420
  * @param fileName Nombre del archivo sin extensión
1406
1421
  */
1407
- handleFileResponse(fileObservable: Observable<Blob>, actionId: number, fileName: string): void;
1422
+ handleFileResponse(fileObservable: Observable<Blob>, actionId: number | undefined, fileName: string): void;
1408
1423
  private isExcelFile;
1409
1424
  private getFileExtension;
1410
1425
  private handleNonExcelFiles;
1426
+ /**
1427
+ * Abre un archivo PDF en una nueva pestaña del navegador.
1428
+ *
1429
+ * @param blob - Objeto Blob que contiene los datos del archivo PDF.
1430
+ *
1431
+ * @example
1432
+ * // Uso típico con respuesta de servicio HTTP
1433
+ * this.pdfService.getPdf(id).subscribe(blob => {
1434
+ * this.utilityAddService.PdfView(blob);
1435
+ * });
1436
+ *
1437
+ * @description
1438
+ * Este método crea un URL temporal para el Blob del PDF y lo abre en una nueva
1439
+ * pestaña del navegador. El URL se revoca automáticamente después de 100ms para
1440
+ * liberar memoria.
1441
+ */
1442
+ PdfView(blob: Blob): any;
1443
+ /**
1444
+ * Descarga un archivo PDF con un nombre personalizado que incluye el prefijo "DTE_".
1445
+ *
1446
+ * @param blob - Objeto Blob que contiene los datos del archivo PDF a descargar.
1447
+ * @param filename - Nombre base del archivo sin extensión (se agregará automáticamente ".pdf" y el prefijo "DTE_").
1448
+ *
1449
+ * @example
1450
+ * // Uso típico con respuesta de servicio HTTP
1451
+ * this.dteService.getDTE(operacionId).subscribe(blob => {
1452
+ * this.utilityAddService.downloadPdfFile(blob, '12345');
1453
+ * // Descarga el archivo como: DTE_12345.pdf
1454
+ * });
1455
+ *
1456
+ * @description
1457
+ * Este método crea un URL temporal para el Blob y simula un clic en un enlace de
1458
+ * descarga para iniciar la descarga automática del archivo. El nombre del archivo
1459
+ * sigue el formato: DTE_{filename}.pdf. El URL se revoca después de 100ms para
1460
+ * liberar memoria.
1461
+ */
1462
+ downloadPdfFile(blob: Blob, filename: string): void;
1411
1463
  private forceDownload;
1412
1464
  private revokeObjectUrl;
1413
1465
  /**
@@ -1531,21 +1583,9 @@ declare class UtilityAddService {
1531
1583
  declare function dateRangeValidator(control: AbstractControl): ValidationErrors | null;
1532
1584
  /**
1533
1585
  * Valida que una fecha única esté dentro de un rango mínimo y máximo.
1534
- * Este validador es compatible con fechas en formato string ('YYYY-MM-DD') y objetos Date.
1535
- * Convierte correctamente las fechas string a fechas locales para evitar desfases por zona horaria.
1536
- *
1537
- * @param minDate Fecha mínima permitida (tipo Date, debe ser creada correctamente en local).
1538
- * @param maxDate Fecha máxima permitida (tipo Date, debe ser creada correctamente en local).
1539
- * @returns Una función validadora para Angular Reactive Forms.
1540
- *
1541
- * Ejemplo de uso:
1542
- * myControl = new FormControl('', [dateMinMaxValidator(new Date(2025, 2, 1), new Date(2025, 2, 15))]);
1543
- *
1544
- * Notas de depuración:
1545
- * - Si recibes fechas string, se convierten a local usando parseLocalDate.
1546
- * - Si recibes objetos Date, se usan directamente.
1547
- * - Si la fecha está fuera del rango, se retorna un error con detalles.
1548
- * - Si la fecha es inválida o vacía, no retorna error (null).
1586
+ * Las fechas deben utilizar la función de convertirFechaISOString para asegurar el formato correcto y que funcione con el componente primeNg.
1587
+ * @param minDate Fecha mínima permitida.
1588
+ * @param maxDate Fecha máxima permitida.
1549
1589
  */
1550
1590
  declare function dateMinMaxValidator(minDate: Date, maxDate: Date): (control: AbstractControl) => ValidationErrors | null;
1551
1591
  /**
@@ -1570,5 +1610,5 @@ declare function nitValidator(control: AbstractControl): ValidationErrors | null
1570
1610
  */
1571
1611
  declare function cuiValidator(control: AbstractControl): ValidationErrors | null;
1572
1612
 
1573
- export { AlertaService, AppMessageErrorComponent, AuthorizeService, CACHE_KEYS, CacheService, CssV2Component, DsxAddToolsModule, ENVIRONMENT, EndpointService, ErrorHandlerService, INITIAL_PARAMETERS, IconDsxComponent, JsonHighlightPipe, JsonValuesDebujComponent, KpicardComponent, LoadingComponent, LoadingLottieComponent, NavbarDsxComponent, OnlyRangoPatternDirective, ParameterValuesService, PrimeNgModule, SWEET_ALERT_THEMES, SecurityService, SelectAllOnFocusDirective, TruncatePipe, UtilityAddService, atLeastOneFieldRequiredValidator, createInitialCache, createTypedCacheProvider, cuiValidator, dateMinMaxValidator, dateRangeValidator, httpAuthorizeInterceptor, nitValidator, provideEnvironment, validateEnvironmentConfig };
1613
+ export { AlertaService, AppMessageErrorComponent, AuthorizeService, CACHE_KEYS, CacheService, CssV2Component, DsxAddToolsModule, DteService, ENVIRONMENT, EndpointService, ErrorHandlerService, INITIAL_PARAMETERS, IconDsxComponent, JsonHighlightPipe, JsonValuesDebujComponent, KpicardComponent, LoadingComponent, LoadingLottieComponent, NavbarDsxComponent, OnlyRangoPatternDirective, ParameterValuesService, PrimeNgModule, SWEET_ALERT_THEMES, SecurityService, SelectAllOnFocusDirective, TruncatePipe, UtilityAddService, atLeastOneFieldRequiredValidator, createInitialCache, createTypedCacheProvider, cuiValidator, dateMinMaxValidator, dateRangeValidator, httpAuthorizeInterceptor, nitValidator, provideEnvironment, validateEnvironmentConfig };
1574
1614
  export type { Certificacion, Column, Complemento, Complementos, DatosEmision, DatosGenerales, Direccion, DocumentoFelResponse, Dte, Emisor, EnvironmentConfig, ExportColumn, FechasConversion, FieldConfig, FilterOption, Frase, Frases, Impuesto, Impuestos, InferCacheKeyType, InferCacheOptions, Item, Items, MyParameterValues, NITResponse, NumeroAutorizacion, ParameterSecurity, ParameterValue, Receptor, ResponseHttpModel, Sat, SeguridadITParameter, ServiceResult, ServiceResultVoid, SweetAlertThemeType, T, TipoFechaConversion, TotalImpuesto, Totales, typeModel };
Binary file