intelica-library-ui 0.1.63 → 0.1.65

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,62 @@ 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
+ ProfileReady = signal(false);
2928
+ Initialize() {
2929
+ this.AuthenticationService.GetPrivateValue().subscribe(response => {
2930
+ this.PrivateKey = response;
2931
+ this.SetProfile();
2932
+ });
2933
+ }
2934
+ SetProfile() {
2935
+ const profileCookie = getCookie("profile");
2936
+ if (profileCookie) {
2937
+ const decrypted = decryptData(profileCookie, this.PrivateKey);
2938
+ this.Profile = decrypted ? JSON.parse(decrypted) : null;
2939
+ }
2940
+ else
2941
+ this.Profile = null;
2942
+ this.ProfileReady.set(true);
2943
+ }
2944
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ProfileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2945
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ProfileService, providedIn: "root" });
2946
+ }
2947
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ProfileService, decorators: [{
2948
+ type: Injectable,
2949
+ args: [{ providedIn: "root" }]
2950
+ }] });
2951
+
2896
2952
  /**
2897
2953
  * Función de comparación genérica para ordenar objetos por un campo específico.
2898
2954
  *
@@ -2971,17 +3027,6 @@ function EmailInputValidation(event) {
2971
3027
  }
2972
3028
  }
2973
3029
 
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
3030
  const IntelicaTheme = definePreset(Aura, {
2986
3031
  primitive: {
2987
3032
  blue: {
@@ -5271,5 +5316,5 @@ const IntelicaTheme = definePreset(Aura, {
5271
5316
  * Generated bundle index. Do not edit.
5272
5317
  */
5273
5318
 
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 };
5319
+ 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
5320
  //# sourceMappingURL=intelica-library-ui.mjs.map