@smartbit4all/ng-client 2.0.10 → 2.0.12
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/esm2020/lib/session/smart-error-catching.interceptor.mjs +51 -27
- package/esm2020/lib/session/smart-session-handler.service.mjs +1 -1
- package/esm2020/lib/session/smart-session.service.mjs +31 -26
- package/esm2020/lib/smart-client/smart-component-api-client.mjs +6 -2
- package/esm2020/lib/smart-client/smart.component.mjs +5 -2
- package/esm2020/lib/smart-client/smart.service.mjs +5 -2
- package/fesm2015/smartbit4all-ng-client.mjs +89 -50
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +88 -50
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/session/smart-error-catching.interceptor.d.ts +8 -4
- package/lib/session/smart-session-handler.service.d.ts +10 -0
- package/lib/session/smart-session.service.d.ts +2 -0
- package/lib/smart-client/smart-component-api-client.d.ts +3 -1
- package/lib/smart-client/smart.component.d.ts +3 -2
- package/lib/smart-client/smart.service.d.ts +3 -2
- package/package.json +3 -3
- package/smartbit4all-ng-client-2.0.12.tgz +0 -0
- package/smartbit4all-ng-client-2.0.10.tgz +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from
|
|
2
|
-
import { Observable } from
|
|
3
|
-
import { SessionError, SmartSessionService } from
|
|
1
|
+
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { SessionError, SmartSessionService } from './projects';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class SmartErrorCatchingInterceptor implements HttpInterceptor {
|
|
6
6
|
private session;
|
|
7
7
|
sessionErrorCodes: SessionError[];
|
|
8
8
|
constructor(session: SmartSessionService);
|
|
9
9
|
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
|
|
10
|
-
|
|
10
|
+
private handleError;
|
|
11
|
+
private isSessionError;
|
|
12
|
+
private getSessionError;
|
|
13
|
+
private resolveError;
|
|
14
|
+
private updateRequestHeaders;
|
|
11
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartErrorCatchingInterceptor, never>;
|
|
12
16
|
static ɵprov: i0.ɵɵInjectableDeclaration<SmartErrorCatchingInterceptor>;
|
|
13
17
|
}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
export interface SmartSessionHandlerService {
|
|
2
|
+
/**
|
|
3
|
+
* Handles SessionErrors with RESTART behaviour. With this method it is possible to add application
|
|
4
|
+
* specific logic to the session restart mechanism.
|
|
5
|
+
* E.g.: navigate to the login page when the session can not be refreshed.
|
|
6
|
+
*
|
|
7
|
+
* By default when the session can not be refreshed, the smart-session.service clears and starts a new session.
|
|
8
|
+
* By throwing an exception in this method it is possible to avoid this default functionality,
|
|
9
|
+
* and handle the session recreation completely here in the application level.
|
|
10
|
+
* @param sessionError the SessionError with RESTART behaviour cached in the http interceptor
|
|
11
|
+
*/
|
|
2
12
|
handleSessionError(sessionError: SessionError): Promise<void>;
|
|
3
13
|
}
|
|
4
14
|
export interface SessionError {
|
|
@@ -44,6 +44,8 @@ export declare class SmartSessionService implements OnDestroy {
|
|
|
44
44
|
private startSession;
|
|
45
45
|
getSession(): Promise<SessionInfoData>;
|
|
46
46
|
refreshSession(): Promise<SessionInfoData>;
|
|
47
|
+
private updateSessionInfo;
|
|
48
|
+
private isInvalidRefreshTokenError;
|
|
47
49
|
getAuthenticationProviders(): Promise<Array<AuthenticationProviderData>>;
|
|
48
50
|
getIsAuthenticated(): Promise<boolean>;
|
|
49
51
|
clearAndStartNewSession(): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Injector } from '@angular/core';
|
|
1
|
+
import { ChangeDetectorRef, Injector } from '@angular/core';
|
|
2
2
|
import { SmartForm, SmartformComponent } from '@smartbit4all/form';
|
|
3
3
|
import { GridOptions, SmartGrid, SmartGridComponent } from '@smartbit4all/grid';
|
|
4
4
|
import { SmarttreeGenericService } from '../smart-tree/projects';
|
|
@@ -41,9 +41,11 @@ export declare abstract class SmartComponentApiClient<T> implements UseUiAction
|
|
|
41
41
|
set smartTreeService(smartTreeService: SmarttreeGenericService | undefined);
|
|
42
42
|
widgets: WidgetMap<SmartGridComponent | SmarttreeGenericService | undefined>;
|
|
43
43
|
formWidgets: WidgetMap<SmartformComponent | undefined>;
|
|
44
|
+
protected changeDetector?: ChangeDetectorRef;
|
|
44
45
|
constructor(inject: Injector, auth: SmartAuthenticationServiceInterface, pageName: string);
|
|
45
46
|
_ngOnInit(): void;
|
|
46
47
|
_ngOnDestroy(): void;
|
|
48
|
+
_ngAfterViewInit(): void;
|
|
47
49
|
initComponentByModel(): void;
|
|
48
50
|
initData(): void;
|
|
49
51
|
initActions(): void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Injector, OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { SmartAuthenticationServiceInterface } from './smart-authentication.service';
|
|
3
3
|
import { SmartComponentApiClient } from './smart-component-api-client';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare abstract class SmartComponent<T> extends SmartComponentApiClient<T> implements OnInit, OnDestroy {
|
|
5
|
+
export declare abstract class SmartComponent<T> extends SmartComponentApiClient<T> implements OnInit, OnDestroy, AfterViewInit {
|
|
6
6
|
constructor(inject: Injector, auth: SmartAuthenticationServiceInterface, pageName: string);
|
|
7
7
|
ngOnInit(): void;
|
|
8
8
|
ngOnDestroy(): void;
|
|
9
|
+
ngAfterViewInit(): void;
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartComponent<any>, never>;
|
|
10
11
|
static ɵcmp: i0.ɵɵComponentDeclaration<SmartComponent<any>, "ng-component", never, {}, {}, never, never>;
|
|
11
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Injector, OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { SmartAuthenticationServiceInterface } from './smart-authentication.service';
|
|
3
3
|
import { SmartComponentApiClient } from './smart-component-api-client';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare abstract class SmartService<T> extends SmartComponentApiClient<T> implements OnInit, OnDestroy {
|
|
5
|
+
export declare abstract class SmartService<T> extends SmartComponentApiClient<T> implements OnInit, OnDestroy, AfterViewInit {
|
|
6
6
|
constructor(inject: Injector, auth: SmartAuthenticationServiceInterface, pageName: string);
|
|
7
7
|
ngOnInit(): void;
|
|
8
8
|
ngOnDestroy(): void;
|
|
9
|
+
ngAfterViewInit(): void;
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<SmartService<any>, never>;
|
|
10
11
|
static ɵprov: i0.ɵɵInjectableDeclaration<SmartService<any>>;
|
|
11
12
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartbit4all/ng-client",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^13.2.0",
|
|
6
6
|
"@angular/core": "^13.2.0",
|
|
7
7
|
"@openapitools/openapi-generator-cli": "^2.5.1",
|
|
8
8
|
"@smartbit4all/dialog": "^1.0.5",
|
|
9
|
-
"@smartbit4all/form": "^1.7.
|
|
10
|
-
"@smartbit4all/icon": "^1.0.
|
|
9
|
+
"@smartbit4all/form": "^1.7.15",
|
|
10
|
+
"@smartbit4all/icon": "^1.0.2",
|
|
11
11
|
"rxjs": "^7.5.7",
|
|
12
12
|
"copyfiles": "^2.4.1"
|
|
13
13
|
},
|
|
Binary file
|
|
Binary file
|