intelica-library-ui 0.1.63 → 0.1.64
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.
|
@@ -2893,6 +2893,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
2893
2893
|
}]
|
|
2894
2894
|
}] });
|
|
2895
2895
|
|
|
2896
|
+
class AuthenticationService {
|
|
2897
|
+
_http = inject(HttpClient);
|
|
2898
|
+
_configService = inject(ConfigService);
|
|
2899
|
+
GetPrivateValue() {
|
|
2900
|
+
return this._http.get(`${this._configService.environment?.authenticationPath}/Authenticate/GetPrivateValue`);
|
|
2901
|
+
}
|
|
2902
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AuthenticationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2903
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AuthenticationService, providedIn: "root" });
|
|
2904
|
+
}
|
|
2905
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AuthenticationService, decorators: [{
|
|
2906
|
+
type: Injectable,
|
|
2907
|
+
args: [{
|
|
2908
|
+
providedIn: "root",
|
|
2909
|
+
}]
|
|
2910
|
+
}] });
|
|
2911
|
+
|
|
2912
|
+
function decryptData(encryptedData, privateKey) {
|
|
2913
|
+
const decryptor = new JSEncrypt();
|
|
2914
|
+
decryptor.setPrivateKey(privateKey);
|
|
2915
|
+
const decryptedText = decryptor.decrypt(encryptedData);
|
|
2916
|
+
if (!decryptedText) {
|
|
2917
|
+
console.error("Error al descifrar los datos con RSA");
|
|
2918
|
+
return null;
|
|
2919
|
+
}
|
|
2920
|
+
return decryptedText;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
class ProfileService {
|
|
2924
|
+
AuthenticationService = inject(AuthenticationService);
|
|
2925
|
+
Profile = null;
|
|
2926
|
+
PrivateKey = "";
|
|
2927
|
+
Initialize() {
|
|
2928
|
+
this.AuthenticationService.GetPrivateValue().subscribe(response => {
|
|
2929
|
+
this.PrivateKey = response;
|
|
2930
|
+
this.SetProfile();
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
SetProfile() {
|
|
2934
|
+
const profileCookie = getCookie("profile");
|
|
2935
|
+
if (profileCookie) {
|
|
2936
|
+
const decrypted = decryptData(profileCookie, this.PrivateKey);
|
|
2937
|
+
this.Profile = decrypted ? JSON.parse(decrypted) : null;
|
|
2938
|
+
}
|
|
2939
|
+
else
|
|
2940
|
+
this.Profile = null;
|
|
2941
|
+
}
|
|
2942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ProfileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2943
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ProfileService, providedIn: "root" });
|
|
2944
|
+
}
|
|
2945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ProfileService, decorators: [{
|
|
2946
|
+
type: Injectable,
|
|
2947
|
+
args: [{ providedIn: "root" }]
|
|
2948
|
+
}] });
|
|
2949
|
+
|
|
2896
2950
|
/**
|
|
2897
2951
|
* Función de comparación genérica para ordenar objetos por un campo específico.
|
|
2898
2952
|
*
|
|
@@ -2971,17 +3025,6 @@ function EmailInputValidation(event) {
|
|
|
2971
3025
|
}
|
|
2972
3026
|
}
|
|
2973
3027
|
|
|
2974
|
-
function decryptData(encryptedData, privateKey) {
|
|
2975
|
-
const decryptor = new JSEncrypt();
|
|
2976
|
-
decryptor.setPrivateKey(privateKey);
|
|
2977
|
-
const decryptedText = decryptor.decrypt(encryptedData);
|
|
2978
|
-
if (!decryptedText) {
|
|
2979
|
-
console.error("Error al descifrar los datos con RSA");
|
|
2980
|
-
return null;
|
|
2981
|
-
}
|
|
2982
|
-
return decryptedText;
|
|
2983
|
-
}
|
|
2984
|
-
|
|
2985
3028
|
const IntelicaTheme = definePreset(Aura, {
|
|
2986
3029
|
primitive: {
|
|
2987
3030
|
blue: {
|
|
@@ -5271,5 +5314,5 @@ const IntelicaTheme = definePreset(Aura, {
|
|
|
5271
5314
|
* Generated bundle index. Do not edit.
|
|
5272
5315
|
*/
|
|
5273
5316
|
|
|
5274
|
-
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, ModalDialogComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, RecordPerPageComponent, RefreshTokenInterceptor, RowResumenComponent, SearchComponent, SharedService, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TermGuard, TermPipe, TermService, decryptData, encryptData };
|
|
5317
|
+
export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, ModalDialogComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RowResumenComponent, SearchComponent, SharedService, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TermGuard, TermPipe, TermService, decryptData, encryptData };
|
|
5275
5318
|
//# sourceMappingURL=intelica-library-ui.mjs.map
|