oip-common 0.0.12 → 0.0.14
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/oip-common.mjs +188 -181
- package/fesm2022/oip-common.mjs.map +1 -1
- package/index.d.ts +21 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { MessageService, ToastMessageOptions, MenuItem, SelectItem, Confirmation
|
|
|
4
4
|
import { ActivatedRoute, QueryParamsHandling, IsActiveMatchOptions, Params, Router, UrlTree } from '@angular/router';
|
|
5
5
|
import { TranslateService } from '@ngx-translate/core';
|
|
6
6
|
import * as rxjs from 'rxjs';
|
|
7
|
-
import { Subject,
|
|
8
|
-
import {
|
|
7
|
+
import { Subject, Observable, Subscription } from 'rxjs';
|
|
8
|
+
import { LoginResponse, AuthOptions, OidcSecurityService, LogoutAuthOptions, AbstractSecurityStorage, StsConfigHttpLoader } from 'angular-auth-oidc-client';
|
|
9
9
|
import { ContextMenu } from 'primeng/contextmenu';
|
|
10
10
|
import { PrimeNG } from 'primeng/config';
|
|
11
11
|
import { HttpInterceptorFn, HttpClient as HttpClient$1 } from '@angular/common/http';
|
|
@@ -315,6 +315,17 @@ declare class LayoutService {
|
|
|
315
315
|
static ɵprov: i0.ɵɵInjectableDeclaration<LayoutService>;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
+
declare abstract class SecurityService {
|
|
319
|
+
abstract auth(): void;
|
|
320
|
+
abstract logout(): void;
|
|
321
|
+
abstract isAuthenticated(): Observable<boolean>;
|
|
322
|
+
abstract getAccessToken(): Observable<string>;
|
|
323
|
+
abstract isTokenExpired(): Observable<boolean>;
|
|
324
|
+
abstract getCurrentUser(): any;
|
|
325
|
+
abstract forceRefreshSession(): Observable<LoginResponse>;
|
|
326
|
+
abstract isAdmin(): boolean;
|
|
327
|
+
abstract authorize(configId?: string, authOptions?: AuthOptions): void;
|
|
328
|
+
}
|
|
318
329
|
/**
|
|
319
330
|
* SecurityService extends OidcSecurityService to manage authentication,
|
|
320
331
|
* token handling, and user role access in an Angular application.
|
|
@@ -322,7 +333,7 @@ declare class LayoutService {
|
|
|
322
333
|
* It provides helper methods for checking authentication, managing tokens,
|
|
323
334
|
* determining user roles, and performing logout and refresh operations.
|
|
324
335
|
*/
|
|
325
|
-
declare class
|
|
336
|
+
declare class KeycloakSecurityService extends OidcSecurityService implements OnDestroy, SecurityService {
|
|
326
337
|
/**
|
|
327
338
|
* Handles angular OIDC events.
|
|
328
339
|
*/
|
|
@@ -330,11 +341,11 @@ declare class SecurityService extends OidcSecurityService implements OnDestroy {
|
|
|
330
341
|
/**
|
|
331
342
|
* Stores the latest login response from checkAuth().
|
|
332
343
|
*/
|
|
333
|
-
loginResponse
|
|
344
|
+
private loginResponse;
|
|
334
345
|
/**
|
|
335
346
|
* Stores the decoded access token payload.
|
|
336
347
|
*/
|
|
337
|
-
payload
|
|
348
|
+
private payload;
|
|
338
349
|
/**
|
|
339
350
|
* Stores user-specific data from the login response.
|
|
340
351
|
*/
|
|
@@ -344,6 +355,7 @@ declare class SecurityService extends OidcSecurityService implements OnDestroy {
|
|
|
344
355
|
* When a 'NewAuthenticationResult' event is received, the `auth` method is called.
|
|
345
356
|
*/
|
|
346
357
|
constructor();
|
|
358
|
+
getCurrentUser(): any;
|
|
347
359
|
/**
|
|
348
360
|
* Returns the ID token for the sign-in.
|
|
349
361
|
* @returns A string with the id token.
|
|
@@ -354,7 +366,7 @@ declare class SecurityService extends OidcSecurityService implements OnDestroy {
|
|
|
354
366
|
*
|
|
355
367
|
* @returns {boolean} True if the user is an admin, false otherwise.
|
|
356
368
|
*/
|
|
357
|
-
|
|
369
|
+
isAdmin(): boolean;
|
|
358
370
|
/**
|
|
359
371
|
* Initiates authentication check and updates login response, user data,
|
|
360
372
|
* and decoded token payload if authenticated.
|
|
@@ -377,8 +389,8 @@ declare class SecurityService extends OidcSecurityService implements OnDestroy {
|
|
|
377
389
|
* @returns {Observable<boolean>} Observable that emits true if the token is expired.
|
|
378
390
|
*/
|
|
379
391
|
isTokenExpired(): Observable<boolean>;
|
|
380
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
381
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
392
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakSecurityService, never>;
|
|
393
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakSecurityService>;
|
|
382
394
|
}
|
|
383
395
|
|
|
384
396
|
/**
|
|
@@ -1122,5 +1134,5 @@ declare class SecurePipe implements PipeTransform {
|
|
|
1122
1134
|
*/
|
|
1123
1135
|
declare const httpLoaderAuthFactory: (httpClient: HttpClient$1) => StsConfigHttpLoader;
|
|
1124
1136
|
|
|
1125
|
-
export { AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppLayoutComponent, AppModulesComponent, AppTopbar, AuthGuardService, BaseDataService, BaseModuleComponent, ConfigComponent, DbMigrationComponent, ErrorComponent, FooterComponent, LayoutService, LogoComponent, MenuComponent, MenuService, MsgService, NotfoundComponent, ProfileComponent, SecurePipe, SecurityComponent, SecurityDataService, SecurityService, SecurityStorageService, SidebarComponent, TopBarService, UnauthorizedComponent, UserService, httpLoaderAuthFactory, langIntercept };
|
|
1137
|
+
export { AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppLayoutComponent, AppModulesComponent, AppTopbar, AuthGuardService, BaseDataService, BaseModuleComponent, ConfigComponent, DbMigrationComponent, ErrorComponent, FooterComponent, KeycloakSecurityService, LayoutService, LogoComponent, MenuComponent, MenuService, MsgService, NotfoundComponent, ProfileComponent, SecurePipe, SecurityComponent, SecurityDataService, SecurityService, SecurityStorageService, SidebarComponent, TopBarService, UnauthorizedComponent, UserService, httpLoaderAuthFactory, langIntercept };
|
|
1126
1138
|
export type { AppConfig, MenuChangeEvent, NoSettingsDto, PutSecurityDto, SecurityDto, TopBarDto };
|