ngx-dsxlibrary 1.0.58 → 1.0.60
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/fesm2022/ngx-dsxlibrary.mjs +216 -79
- package/fesm2022/ngx-dsxlibrary.mjs.map +1 -1
- package/index.d.ts +85 -8
- package/ngx-dsxlibrary-1.0.60.tgz +0 -0
- package/package.json +1 -1
- package/src/lib/models/index.d.ts +1 -19
- package/ngx-dsxlibrary-1.0.58.tgz +0 -0
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i3 from '@angular/forms';
|
|
2
2
|
import { AbstractControl, FormGroup, FormBuilder, ValidatorFn, ValidationErrors } from '@angular/forms';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { OnInit, ElementRef, InjectionToken, PipeTransform } from '@angular/core';
|
|
4
|
+
import { OnInit, ElementRef, InjectionToken, PipeTransform, Provider } from '@angular/core';
|
|
5
5
|
import { SweetAlertIcon, SweetAlertResult } from 'sweetalert2';
|
|
6
6
|
import { Observable } from 'rxjs';
|
|
7
7
|
import { HttpInterceptorFn } from '@angular/common/http';
|
|
@@ -207,6 +207,7 @@ declare class AlertaService {
|
|
|
207
207
|
static ɵprov: i0.ɵɵInjectableDeclaration<AlertaService>;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
declare const INITIAL_PARAMETERS_FOR_TYPE: readonly ["pCreate", "pRead", "pUpdate", "pDelete"];
|
|
210
211
|
interface ParameterValue {
|
|
211
212
|
value: number;
|
|
212
213
|
}
|
|
@@ -222,15 +223,86 @@ interface SeguridadITParameter {
|
|
|
222
223
|
}
|
|
223
224
|
interface MyParameterValues {
|
|
224
225
|
parameterName: string;
|
|
225
|
-
values: number[];
|
|
226
|
+
values: (string | number | boolean)[];
|
|
226
227
|
}
|
|
228
|
+
type ParameterName = (typeof INITIAL_PARAMETERS_FOR_TYPE)[number];
|
|
227
229
|
|
|
228
230
|
declare class ParameterValuesService {
|
|
231
|
+
/** Parámetros iniciales inyectados mediante INITIAL_PARAMETERS */
|
|
229
232
|
private initialParameters;
|
|
233
|
+
/** Servicio que contiene el método getParameterSecurity() */
|
|
234
|
+
private apiService;
|
|
235
|
+
/** Señal que contiene los parámetros cargados */
|
|
230
236
|
private _dataParameter;
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
237
|
+
/** Flag que indica si ya se cargaron los parámetros desde la API */
|
|
238
|
+
private _loaded;
|
|
239
|
+
/** ===================== GETTERS/SETTERS ===================== */
|
|
240
|
+
/**
|
|
241
|
+
* Devuelve los parámetros actuales como un array de solo lectura.
|
|
242
|
+
*/
|
|
243
|
+
get dataParameter(): Readonly<MyParameterValues[]>;
|
|
244
|
+
/**
|
|
245
|
+
* Setter privado para actualizar los parámetros.
|
|
246
|
+
* Solo puede ser usado dentro del servicio para mantener la integridad de los datos.
|
|
247
|
+
* @param values Array de parámetros a almacenar
|
|
248
|
+
*/
|
|
249
|
+
private setDataParameter;
|
|
250
|
+
/** ===================== MÉTODOS PRINCIPALES ===================== */
|
|
251
|
+
/**
|
|
252
|
+
* Carga los parámetros desde la API.
|
|
253
|
+
* Si ya se cargaron y force=false, devuelve la copia en memoria.
|
|
254
|
+
* @param force Indica si se debe forzar la recarga desde la API (default: false)
|
|
255
|
+
* @returns Observable que emite los parámetros cargados como MyParameterValues[]
|
|
256
|
+
*/
|
|
257
|
+
loadParameters(force?: boolean): Observable<MyParameterValues[]>;
|
|
258
|
+
/**
|
|
259
|
+
* Fuerza la recarga de los parámetros desde la API.
|
|
260
|
+
* @returns Observable que emite los parámetros actualizados
|
|
261
|
+
*/
|
|
262
|
+
refreshParameters(): Observable<MyParameterValues[]>;
|
|
263
|
+
/** ===================== MÉTODOS PRIVADOS ===================== */
|
|
264
|
+
/**
|
|
265
|
+
* Valida que los parámetros devueltos por la API coincidan con los iniciales.
|
|
266
|
+
* Muestra errores o advertencias en consola si existen diferencias.
|
|
267
|
+
* @param apiParameters Parámetros recibidos desde la API
|
|
268
|
+
*/
|
|
269
|
+
private validateParameters;
|
|
270
|
+
/**
|
|
271
|
+
* Transforma un array de ParameterSecurity en MyParameterValues
|
|
272
|
+
* @param apiParameters Parámetros recibidos desde la API
|
|
273
|
+
* @returns Array de MyParameterValues
|
|
274
|
+
*/
|
|
275
|
+
private mapToMyParameterValues;
|
|
276
|
+
/** ===================== HELPERS SEGUROS ===================== */
|
|
277
|
+
/**
|
|
278
|
+
* Obtiene un valor específico de un parámetro.
|
|
279
|
+
* Devuelve `defaultValue` si no existe o el índice es inválido.
|
|
280
|
+
* @param parameterName Nombre del parámetro
|
|
281
|
+
* @param index Índice del valor dentro del array (default: 0)
|
|
282
|
+
* @param defaultValue Valor por defecto si no existe
|
|
283
|
+
* @returns Valor del parámetro o defaultValue
|
|
284
|
+
*/
|
|
285
|
+
getValue<T = any>(parameterName: ParameterName, index?: number, defaultValue?: T | null): T;
|
|
286
|
+
/**
|
|
287
|
+
* Compara un valor específico con un valor esperado.
|
|
288
|
+
* @param parameterName Nombre del parámetro
|
|
289
|
+
* @param expectedValue Valor esperado
|
|
290
|
+
* @param index Índice del valor dentro del array (default: 0)
|
|
291
|
+
* @returns true si coincide, false en caso contrario
|
|
292
|
+
*/
|
|
293
|
+
isParameterValue<T = any>(parameterName: ParameterName, expectedValue: T, index?: number): boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Verifica si un parámetro tiene al menos un valor.
|
|
296
|
+
* @param parameterName Nombre del parámetro
|
|
297
|
+
* @returns true si tiene al menos un valor, false si no tiene
|
|
298
|
+
*/
|
|
299
|
+
hasAnyValue(parameterName: ParameterName): boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Devuelve todos los valores de un parámetro.
|
|
302
|
+
* @param parameterName Nombre del parámetro
|
|
303
|
+
* @returns Array de valores
|
|
304
|
+
*/
|
|
305
|
+
getAllValues<T = any>(parameterName: ParameterName): T[];
|
|
234
306
|
static ɵfac: i0.ɵɵFactoryDeclaration<ParameterValuesService, never>;
|
|
235
307
|
static ɵprov: i0.ɵɵInjectableDeclaration<ParameterValuesService>;
|
|
236
308
|
}
|
|
@@ -442,7 +514,7 @@ declare class AuthorizeService {
|
|
|
442
514
|
static ɵprov: i0.ɵɵInjectableDeclaration<AuthorizeService>;
|
|
443
515
|
}
|
|
444
516
|
|
|
445
|
-
declare class CacheService<T extends Record<string, string>> {
|
|
517
|
+
declare class CacheService<T extends Record<string, string> = Record<string, string>> {
|
|
446
518
|
/**
|
|
447
519
|
* Mapa de claves simbólicas a claves reales de caché.
|
|
448
520
|
* Se inyecta desde el proyecto consumidor mediante `CACHE_KEYS`.
|
|
@@ -481,6 +553,11 @@ declare class CacheService<T extends Record<string, string>> {
|
|
|
481
553
|
static ɵprov: i0.ɵɵInjectableDeclaration<CacheService<any>>;
|
|
482
554
|
}
|
|
483
555
|
|
|
556
|
+
declare function createTypedCacheProvider<T extends Record<string, string>>(tokenName: string): {
|
|
557
|
+
token: InjectionToken<CacheService<T>>;
|
|
558
|
+
provider: Provider;
|
|
559
|
+
};
|
|
560
|
+
|
|
484
561
|
declare class EndpointService<T> {
|
|
485
562
|
private http;
|
|
486
563
|
private environment;
|
|
@@ -689,5 +766,5 @@ declare function nitValidator(control: AbstractControl): ValidationErrors | null
|
|
|
689
766
|
*/
|
|
690
767
|
declare function cuiValidator(control: AbstractControl): ValidationErrors | null;
|
|
691
768
|
|
|
692
|
-
export { AlertaService, AppMessageErrorComponent, AuthorizeService, CACHE_KEYS, CacheService, DsxAddToolsModule, ENVIRONMENT, EndpointService, INITIAL_PARAMETERS, JsonHighlightPipe, JsonValuesDebujComponent, KpicardComponent, LoadingComponent, NavbarDsxComponent, OnlyRangoPatternDirective, ParameterValuesService, PrimeNgModule, SecurityService, SelectAllOnFocusDirective, TruncatePipe, UtilityAddService, atLeastOneFieldRequiredValidator, createInitialCache, cuiValidator, dateMinMaxValidator, dateRangeValidator, httpAuthorizeInterceptor, nitValidator };
|
|
693
|
-
export type { Column, EnvironmentConfig, ExportColumn, FechasConversion, FieldConfig, FilterOption, InferCacheKeyType, InferCacheOptions, MyParameterValues, ParameterSecurity, ParameterValue, ResponseHttpModel, SeguridadITParameter, T, TipoFechaConversion, typeModel };
|
|
769
|
+
export { AlertaService, AppMessageErrorComponent, AuthorizeService, CACHE_KEYS, CacheService, DsxAddToolsModule, ENVIRONMENT, EndpointService, INITIAL_PARAMETERS, JsonHighlightPipe, JsonValuesDebujComponent, KpicardComponent, LoadingComponent, NavbarDsxComponent, OnlyRangoPatternDirective, ParameterValuesService, PrimeNgModule, SecurityService, SelectAllOnFocusDirective, TruncatePipe, UtilityAddService, atLeastOneFieldRequiredValidator, createInitialCache, createTypedCacheProvider, cuiValidator, dateMinMaxValidator, dateRangeValidator, httpAuthorizeInterceptor, nitValidator };
|
|
770
|
+
export type { Column, EnvironmentConfig, ExportColumn, FechasConversion, FieldConfig, FilterOption, InferCacheKeyType, InferCacheOptions, MyParameterValues, ParameterName, ParameterSecurity, ParameterValue, ResponseHttpModel, SeguridadITParameter, T, TipoFechaConversion, typeModel };
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -59,23 +59,5 @@ interface ResponseHttpModel {
|
|
|
59
59
|
isAdmin: boolean;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
interface ParameterValue {
|
|
63
|
-
value: number;
|
|
64
|
-
}
|
|
65
|
-
interface ParameterSecurity {
|
|
66
|
-
parameterName: string;
|
|
67
|
-
parameterValues: ParameterValue[];
|
|
68
|
-
}
|
|
69
|
-
interface SeguridadITParameter {
|
|
70
|
-
sistemaId: number;
|
|
71
|
-
sistema: string;
|
|
72
|
-
parameterBase: string | null;
|
|
73
|
-
parameterSecurity: ParameterSecurity[];
|
|
74
|
-
}
|
|
75
|
-
interface MyParameterValues {
|
|
76
|
-
parameterName: string;
|
|
77
|
-
values: number[];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
62
|
export { createInitialCache };
|
|
81
|
-
export type { Column, ExportColumn, FechasConversion, FieldConfig, FilterOption, InferCacheKeyType, InferCacheOptions,
|
|
63
|
+
export type { Column, ExportColumn, FechasConversion, FieldConfig, FilterOption, InferCacheKeyType, InferCacheOptions, ResponseHttpModel, T, TipoFechaConversion, typeModel };
|
|
Binary file
|