@bnsights/bbsf-utilities 1.2.5 → 1.2.8-beta.1
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/README.md +22 -0
- package/fesm2022/bnsights-bbsf-utilities.mjs +361 -101
- package/fesm2022/bnsights-bbsf-utilities.mjs.map +1 -1
- package/lib/shared/authentication/auth.service.d.ts +10 -0
- package/lib/shared/services/master-layout.service.d.ts +9 -5
- package/lib/shared/services/preload.service.d.ts +5 -0
- package/lib/shared/services/service-worker-helper.service.d.ts +6 -0
- package/package.json +1 -1
|
@@ -24,6 +24,9 @@ export declare class AuthService {
|
|
|
24
24
|
isAuthenticate$: import("rxjs").Observable<boolean>;
|
|
25
25
|
static timers: any[];
|
|
26
26
|
static seconds: number;
|
|
27
|
+
private static isLoginInProgress;
|
|
28
|
+
private _userCache;
|
|
29
|
+
private USER_CACHE_TTL;
|
|
27
30
|
constructor(injector: Injector, http: HttpClient, environmentService: EnvironmentService, translateService: BBSFTranslateService, router: Router, cookieService: CookieService, utilityService: UtilityService);
|
|
28
31
|
private _TOKEN_KEY;
|
|
29
32
|
get TOKEN_KEY(): string;
|
|
@@ -60,6 +63,13 @@ export declare class AuthService {
|
|
|
60
63
|
checkRefreshToken(): NodeJS.Timeout;
|
|
61
64
|
setTokenSeconds(): void;
|
|
62
65
|
refresh(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Handles navigation after successful token refresh.
|
|
68
|
+
* If user is on login page and has a stored redirect URL, navigates to that URL.
|
|
69
|
+
* This resolves the issue where users remain on login page after token refresh.
|
|
70
|
+
* NOTE: This is not used anymore because we are using the async guard to wait for the refresh to complete before navigating to the protected route.
|
|
71
|
+
*/
|
|
72
|
+
private handlePostRefreshNavigation;
|
|
63
73
|
loginWithUAEPass(): void;
|
|
64
74
|
logoutFromUAEPass(): void;
|
|
65
75
|
static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
1
2
|
import { Router } from '@angular/router';
|
|
2
3
|
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
-
import {
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { FileLoaderService, RequestHandlerService, StylesBundleService } from '.';
|
|
4
6
|
import { AuthService } from '../authentication';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class MasterLayoutService {
|
|
8
|
+
export declare class MasterLayoutService implements OnDestroy {
|
|
7
9
|
private router;
|
|
8
10
|
private http;
|
|
9
11
|
private authService;
|
|
10
12
|
private stylesBundleService;
|
|
11
13
|
private translate;
|
|
12
|
-
private
|
|
14
|
+
private fileLoaderService;
|
|
13
15
|
apiUrl: string;
|
|
14
|
-
|
|
16
|
+
private readonly destroy$;
|
|
17
|
+
constructor(router: Router, http: RequestHandlerService, authService: AuthService, stylesBundleService: StylesBundleService, translate: TranslateService, fileLoaderService: FileLoaderService);
|
|
15
18
|
switchLang(lang: string, bundleEnglishName: string, bundleArabicName: string): void;
|
|
16
19
|
reloadComponent(): void;
|
|
17
20
|
private changeLanguage;
|
|
18
|
-
logError(error: string):
|
|
21
|
+
logError(error: string): Observable<unknown>;
|
|
19
22
|
private updateUserInfo;
|
|
20
23
|
switchRole(permissionSetID: string): void;
|
|
21
24
|
private updateRole;
|
|
25
|
+
ngOnDestroy(): void;
|
|
22
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<MasterLayoutService, never>;
|
|
23
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<MasterLayoutService>;
|
|
24
28
|
}
|
|
@@ -5,8 +5,13 @@ export declare class FileLoaderService {
|
|
|
5
5
|
private translate;
|
|
6
6
|
private http;
|
|
7
7
|
private availableLanguages;
|
|
8
|
+
private loadedLanguages;
|
|
8
9
|
constructor(translate: BBSFTranslateService, http: HttpClient);
|
|
10
|
+
preloadAll(): Promise<void>;
|
|
9
11
|
loadEnvironment(): Promise<void>;
|
|
12
|
+
private loadConfigurations;
|
|
13
|
+
private getDefaultLanguage;
|
|
14
|
+
loadLanguage(lang: string): Promise<void>;
|
|
10
15
|
preloadTranslations(): Promise<void>;
|
|
11
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileLoaderService, never>;
|
|
12
17
|
static ɵprov: i0.ɵɵInjectableDeclaration<FileLoaderService>;
|
|
@@ -4,6 +4,10 @@ export declare class ServiceWorkerHelperService {
|
|
|
4
4
|
updates: SwUpdate;
|
|
5
5
|
private swRegistration;
|
|
6
6
|
private updateCheckInProgress;
|
|
7
|
+
private chunkHandlersRegistered;
|
|
8
|
+
private chunkRecoveryInFlight;
|
|
9
|
+
private readonly sessionRecoveryAttemptsKey;
|
|
10
|
+
private readonly maxChunkRecoveryAttempts;
|
|
7
11
|
constructor(updates: SwUpdate);
|
|
8
12
|
checkForUpdates(): void;
|
|
9
13
|
private setupUpdateListeners;
|
|
@@ -12,6 +16,8 @@ export declare class ServiceWorkerHelperService {
|
|
|
12
16
|
private initializeServiceWorker;
|
|
13
17
|
private skipWaiting;
|
|
14
18
|
private setupChunkErrorHandler;
|
|
19
|
+
private isChunkErrorEvent;
|
|
20
|
+
private isChunkLoadFailure;
|
|
15
21
|
private handleChunkLoadError;
|
|
16
22
|
private clearCacheAndReload;
|
|
17
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<ServiceWorkerHelperService, never>;
|