@osovitny/anatoly 3.16.16 → 3.16.17
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/esm2022/lib/anatoly.module.mjs +15 -1
- package/esm2022/lib/core/services/appcontext.service.mjs +14 -2
- package/esm2022/lib/core/services/starter.service.mjs +9 -4
- package/esm2022/lib/iam/b2c/b2c.mjs +43 -0
- package/esm2022/lib/iam/b2c/consts.mjs +25 -0
- package/esm2022/lib/iam/b2c/index.mjs +21 -0
- package/esm2022/lib/iam/configs.mjs +107 -0
- package/esm2022/lib/iam/consts.mjs +23 -0
- package/esm2022/lib/iam/guards/admin.guard.mjs +47 -0
- package/esm2022/lib/iam/guards/authentication.guard.mjs +31 -0
- package/esm2022/lib/iam/guards/index.mjs +20 -0
- package/esm2022/lib/iam/iam-pages.module.mjs +54 -0
- package/esm2022/lib/iam/iam-pages.routes.mjs +45 -0
- package/esm2022/lib/iam/iam.module.mjs +100 -0
- package/esm2022/lib/iam/index.mjs +18 -0
- package/esm2022/lib/iam/pages/signin.page.mjs +40 -0
- package/esm2022/lib/iam/pages/signout.page.mjs +40 -0
- package/esm2022/lib/iam/pages/signup.page.mjs +39 -0
- package/esm2022/lib/iam/redirect.mjs +29 -0
- package/esm2022/lib/iam/services/auth.service.mjs +246 -0
- package/esm2022/lib/iam/storage.mjs +39 -0
- package/esm2022/public-api.mjs +5 -1
- package/fesm2022/osovitny-anatoly.mjs +934 -7
- package/fesm2022/osovitny-anatoly.mjs.map +1 -1
- package/lib/anatoly.module.d.ts +4 -2
- package/lib/core/services/appcontext.service.d.ts +2 -0
- package/lib/iam/b2c/b2c.d.ts +5 -0
- package/lib/iam/b2c/consts.d.ts +6 -0
- package/lib/iam/b2c/index.d.ts +2 -0
- package/lib/iam/configs.d.ts +5 -0
- package/lib/iam/consts.d.ts +3 -0
- package/lib/iam/guards/admin.guard.d.ts +13 -0
- package/lib/iam/guards/authentication.guard.d.ts +13 -0
- package/lib/iam/guards/index.d.ts +2 -0
- package/lib/iam/iam-pages.module.d.ts +12 -0
- package/lib/iam/iam-pages.routes.d.ts +6 -0
- package/lib/iam/iam.module.d.ts +9 -0
- package/lib/iam/index.d.ts +1 -0
- package/lib/iam/pages/signin.page.d.ts +11 -0
- package/lib/iam/pages/signout.page.d.ts +11 -0
- package/lib/iam/pages/signup.page.d.ts +11 -0
- package/lib/iam/redirect.d.ts +3 -0
- package/lib/iam/services/auth.service.d.ts +37 -0
- package/lib/iam/storage.d.ts +8 -0
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
package/lib/anatoly.module.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
import * as i1 from "@angular/common";
|
|
3
3
|
import * as i2 from "./core/core.module";
|
|
4
4
|
import * as i3 from "./data/data.module";
|
|
5
|
-
import * as i4 from "./
|
|
5
|
+
import * as i4 from "./iam/iam.module";
|
|
6
|
+
import * as i5 from "./iam/iam-pages.module";
|
|
7
|
+
import * as i6 from "./ui/ui.module";
|
|
6
8
|
export declare class AnatolyModule {
|
|
7
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<AnatolyModule, never>;
|
|
8
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AnatolyModule, never, [typeof i1.CommonModule, typeof i2.AnatolyCoreModule, typeof i3.AnatolyDataModule, typeof i4.AnatolyUIModule], [typeof i2.AnatolyCoreModule, typeof i3.AnatolyDataModule, typeof i4.AnatolyUIModule]>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AnatolyModule, never, [typeof i1.CommonModule, typeof i2.AnatolyCoreModule, typeof i3.AnatolyDataModule, typeof i4.AnatolyIAMModule, typeof i5.AnatolyIAMPagesModule, typeof i6.AnatolyUIModule], [typeof i2.AnatolyCoreModule, typeof i3.AnatolyDataModule, typeof i4.AnatolyIAMModule, typeof i5.AnatolyIAMPagesModule, typeof i6.AnatolyUIModule]>;
|
|
9
11
|
static ɵinj: i0.ɵɵInjectorDeclaration<AnatolyModule>;
|
|
10
12
|
}
|
|
@@ -27,6 +27,8 @@ export declare class AppContextService extends ApiServiceBase {
|
|
|
27
27
|
clearWebStorage(): void;
|
|
28
28
|
get current(): any;
|
|
29
29
|
set current(value: any);
|
|
30
|
+
get currentUser(): any;
|
|
31
|
+
set currentUser(value: any);
|
|
30
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppContextService, never>;
|
|
31
33
|
static ɵprov: i0.ɵɵInjectableDeclaration<AppContextService>;
|
|
32
34
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MsalGuardConfiguration, MsalInterceptorConfiguration } from '@azure/msal-angular';
|
|
2
|
+
import { IPublicClientApplication } from '@azure/msal-browser';
|
|
3
|
+
export declare function MSALInterceptorConfigFactory(): MsalInterceptorConfiguration;
|
|
4
|
+
export declare function MSALGuardConfigFactory(): MsalGuardConfiguration;
|
|
5
|
+
export declare function MSALInstanceFactory(): IPublicClientApplication;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { AuthService } from '../services/auth.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class AdminGuard implements CanActivate, CanActivateChild {
|
|
6
|
+
private auth;
|
|
7
|
+
constructor(auth: AuthService);
|
|
8
|
+
private isUserAdmin;
|
|
9
|
+
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean>;
|
|
10
|
+
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AdminGuard, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AdminGuard>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Location } from "@angular/common";
|
|
2
|
+
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from "@angular/router";
|
|
3
|
+
import { MsalBroadcastService, MsalGuard, MsalGuardConfiguration, MsalService } from '@azure/msal-angular';
|
|
4
|
+
import { Observable } from "rxjs";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class AuthenticationGuard extends MsalGuard implements CanActivate {
|
|
7
|
+
private _msalGuardConfig;
|
|
8
|
+
constructor(msalGuardConfig: MsalGuardConfiguration, msalBroadcastService: MsalBroadcastService, authService: MsalService, location: Location, router: Router);
|
|
9
|
+
private setInteractionType;
|
|
10
|
+
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthenticationGuard, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthenticationGuard>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./pages/signin.page";
|
|
3
|
+
import * as i2 from "./pages/signup.page";
|
|
4
|
+
import * as i3 from "./pages/signout.page";
|
|
5
|
+
import * as i4 from "@angular/common";
|
|
6
|
+
import * as i5 from "@angular/common/http";
|
|
7
|
+
import * as i6 from "@angular/router";
|
|
8
|
+
export declare class AnatolyIAMPagesModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AnatolyIAMPagesModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AnatolyIAMPagesModule, [typeof i1.SignInPage, typeof i2.SignUpPage, typeof i3.SignOutPage], [typeof i4.CommonModule, typeof i5.HttpClientModule, typeof i6.RouterModule], never>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AnatolyIAMPagesModule>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RouterModule } from "@angular/router";
|
|
2
|
+
import { SignInPage } from "./pages/signin.page";
|
|
3
|
+
import { SignOutPage } from "./pages/signout.page";
|
|
4
|
+
import { SignUpPage } from "./pages/signup.page";
|
|
5
|
+
export declare const IAMRouterModule: import("@angular/core").ModuleWithProviders<RouterModule>;
|
|
6
|
+
export declare const PAGES: (typeof SignInPage | typeof SignOutPage | typeof SignUpPage)[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/common";
|
|
3
|
+
import * as i2 from "@angular/common/http";
|
|
4
|
+
import * as i3 from "@azure/msal-angular";
|
|
5
|
+
export declare class AnatolyIAMModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AnatolyIAMModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AnatolyIAMModule, never, [typeof i1.CommonModule, typeof i2.HttpClientModule, typeof i3.MsalModule], never>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AnatolyIAMModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './services/auth.service';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { AuthService } from '../services/auth.service';
|
|
3
|
+
import { BasePage } from '../../ui/components/base/base.page';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class SignInPage extends BasePage implements OnInit {
|
|
6
|
+
private auth;
|
|
7
|
+
constructor(auth: AuthService);
|
|
8
|
+
ngOnInit(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SignInPage, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SignInPage, "iam-signin-page", never, {}, {}, never, never, false, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { AuthService } from '../services/auth.service';
|
|
3
|
+
import { BasePage } from '../../ui/components/base/base.page';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class SignOutPage extends BasePage implements OnInit {
|
|
6
|
+
private auth;
|
|
7
|
+
constructor(auth: AuthService);
|
|
8
|
+
ngOnInit(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SignOutPage, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SignOutPage, "iam-signout-page", never, {}, {}, never, never, false, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { AuthService } from '../services/auth.service';
|
|
3
|
+
import { BasePage } from '../../ui/components/base/base.page';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class SignUpPage extends BasePage implements OnInit {
|
|
6
|
+
private auth;
|
|
7
|
+
constructor(auth: AuthService);
|
|
8
|
+
ngOnInit(): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SignUpPage, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SignUpPage, "iam-signup-page", never, {}, {}, never, never, false, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { OnDestroy } from '@angular/core';
|
|
3
|
+
import { Router } from '@angular/router';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { MsalBroadcastService, MsalGuardConfiguration, MsalService } from '@azure/msal-angular';
|
|
6
|
+
import { ApiServiceBase } from '../../data/base/api.service';
|
|
7
|
+
import { AppContextService } from '../../core/services/appcontext.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class AuthService extends ApiServiceBase implements OnDestroy {
|
|
10
|
+
protected http: HttpClient;
|
|
11
|
+
private router;
|
|
12
|
+
private appContext;
|
|
13
|
+
private msalGuardConfig;
|
|
14
|
+
private msalService;
|
|
15
|
+
private msalBroadcastService;
|
|
16
|
+
private readonly msalDestroying$;
|
|
17
|
+
private initialized;
|
|
18
|
+
constructor(http: HttpClient, router: Router, appContext: AppContextService, msalGuardConfig: MsalGuardConfiguration, msalService: MsalService, msalBroadcastService: MsalBroadcastService);
|
|
19
|
+
ngOnDestroy(): void;
|
|
20
|
+
private init;
|
|
21
|
+
private setDefaults;
|
|
22
|
+
private initMSAL;
|
|
23
|
+
private getActiveAccount;
|
|
24
|
+
private checkAndSetActiveAccount;
|
|
25
|
+
private isPopup;
|
|
26
|
+
private acquireToken;
|
|
27
|
+
getUserEmail(): any;
|
|
28
|
+
getUserName(): any;
|
|
29
|
+
getAccessToken(requestUrl?: string): Observable<string>;
|
|
30
|
+
login(popup?: boolean): Observable<any>;
|
|
31
|
+
logout(popup?: boolean): Observable<void>;
|
|
32
|
+
isUserAuthenticated(): boolean;
|
|
33
|
+
isUserSignedIn(): boolean;
|
|
34
|
+
isUserAdmin(): boolean;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
|
|
36
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const MSALStorageKeys: {
|
|
2
|
+
redirectTo: string;
|
|
3
|
+
};
|
|
4
|
+
export declare class MSALStorage {
|
|
5
|
+
static saveRedirectState(redirectTo: any, calledBy: string): void;
|
|
6
|
+
static getRedirectState(calledBy: string): string;
|
|
7
|
+
static clearRedirectState(calledBy: string): void;
|
|
8
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './lib/core';
|
|
2
2
|
export * from './lib/data';
|
|
3
|
+
export * from './lib/iam';
|
|
3
4
|
export * from './lib/ui/components';
|
|
4
5
|
export * from './lib/ui/dialogs';
|
|
5
6
|
export * from './lib/ui/directives';
|
|
@@ -8,5 +9,7 @@ export * from './lib/ui/pipes';
|
|
|
8
9
|
export * from './lib/ui/validation';
|
|
9
10
|
export * from './lib/core/core.module';
|
|
10
11
|
export * from './lib/data/data.module';
|
|
12
|
+
export * from './lib/iam/iam.module';
|
|
13
|
+
export * from './lib/iam/iam-pages.module';
|
|
11
14
|
export * from './lib/ui/ui.module';
|
|
12
15
|
export * from './lib/anatoly.module';
|