intelica-library-ui 0.1.62 → 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.
- package/fesm2022/intelica-library-ui.mjs +55 -1
- package/fesm2022/intelica-library-ui.mjs.map +1 -1
- package/lib/functions/decryptRSA.d.ts +1 -0
- package/lib/services/authentication.service.d.ts +9 -0
- package/lib/services/profile.service.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -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
|
*
|
|
@@ -5260,5 +5314,5 @@ const IntelicaTheme = definePreset(Aura, {
|
|
|
5260
5314
|
* Generated bundle index. Do not edit.
|
|
5261
5315
|
*/
|
|
5262
5316
|
|
|
5263
|
-
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, 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 };
|
|
5264
5318
|
//# sourceMappingURL=intelica-library-ui.mjs.map
|