ngx-sp-auth 2.2.0 → 3.0.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/fesm2022/ngx-sp-auth.mjs +1629 -809
- package/fesm2022/ngx-sp-auth.mjs.map +1 -1
- package/lib/auth-config.d.ts +2 -0
- package/lib/auth.module.d.ts +1 -9
- package/lib/auth.routes.d.ts +2 -0
- package/lib/auth.service.d.ts +36 -8
- package/lib/components/login/login.component.d.ts +49 -21
- package/lib/components/login-os/login-os.component.d.ts +27 -0
- package/lib/components/menu-lateral/dropdown/primary-dropdown/primary-dropdown.component.d.ts +4 -2
- package/lib/components/menu-lateral/dropdown/secondary-dropdown/secondary-dropdown.component.d.ts +3 -1
- package/lib/components/menu-lateral/menu/menu-lateral.component.d.ts +31 -18
- package/lib/components/menu-lateral/menu/selecao-estabelecimentos-modal/selecao-estabelecimentos-modal.component.d.ts +4 -2
- package/lib/components/menu-lateral/menu-services.service.d.ts +21 -4
- package/lib/components/menu-lateral/model/dynamic-menu.d.ts +18 -0
- package/lib/components/menu-lateral/model/infrausuarioimg.d.ts +7 -7
- package/lib/components/menu-lateral/model/navsubmenu-searchitem.d.ts +5 -0
- package/lib/components/menu-lateral/model/ret-navsubmenu.d.ts +11 -0
- package/lib/components/menu-lateral/submenus/dynamic-menu/dynamic-menu.component.d.ts +3 -1
- package/lib/components/nova-senha/nova-senhacomponent.d.ts +7 -5
- package/lib/custom/{custom-menu.service.d.ts → lib-custom-menu.service.d.ts} +10 -14
- package/lib/custom/{custom-storage.service.d.ts → lib-custom-storage.service.d.ts} +1 -4
- package/lib/custom/{menu-config.service.d.ts → lib-menu-config.service.d.ts} +11 -16
- package/lib/custom/models/icustom-login-service.d.ts +2 -0
- package/lib/custom/models/icustom-menu-service.d.ts +2 -0
- package/lib/custom/models/icustom-storage-service.d.ts +0 -1
- package/lib/custom/models/imenu-config.d.ts +2 -2
- package/lib/environments/environments.service.d.ts +8 -1
- package/lib/environments/models/ienvironments.d.ts +9 -0
- package/lib/guards/external-login-guard.d.ts +3 -5
- package/lib/interceptors/auth-aplic.interceptor.d.ts +4 -4
- package/lib/interceptors/auth-infra.interceptor.d.ts +1 -1
- package/lib/models/infraIn2FaTypeId.d.ts +5 -0
- package/lib/models/infraInAuthTypeId.d.ts +5 -0
- package/lib/models/login-os.model.d.ts +7 -0
- package/lib/models/ret-autenthication.d.ts +14 -0
- package/lib/models/ret-login.d.ts +1 -4
- package/lib/project/project-utils.service.d.ts +18 -0
- package/lib/storage/auth-storage.service.d.ts +21 -4
- package/package.json +3 -1
- package/public-api.d.ts +10 -10
- package/README.md +0 -207
- package/lib/components/menu-lateral/menu/list-estab.service.d.ts +0 -19
- package/lib/components/menu-lateral/model/iestabelecimento.model.d.ts +0 -4
- package/lib/models/custom-propriedades-login.d.ts +0 -11
- package/lib/server/ret-server-config.d.ts +0 -7
- package/lib/server/server.service.d.ts +0 -14
- package/src/assets/imgs/Property1-cadeado.png +0 -0
- package/src/assets/imgs/Property1-calendariofino.png +0 -0
- package/src/assets/imgs/Property1-mao.png +0 -0
- /package/lib/custom/{custom-login.service.d.ts → lib-custom-login.service.d.ts} +0 -0
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { IMenuItemStructure } from '
|
|
1
|
+
import { IMenuItemStructure } from '../components/menu-lateral/model/imenu-item-structure.model';
|
|
2
2
|
import { IMenuConfig } from "./models/imenu-config";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class
|
|
5
|
-
private _menuOptions;
|
|
6
|
-
/** Indica se o menu é estático ou dinâmico. */
|
|
7
|
-
_isMenuStatic: boolean;
|
|
8
|
-
/** Obtém as opções do menu. */
|
|
9
|
-
get menuOptions(): IMenuItemStructure[];
|
|
10
|
-
set menuOptions(value: IMenuItemStructure[]);
|
|
4
|
+
export declare class LibMenuConfigService {
|
|
11
5
|
storedInitializeMenu: (currentRoute: string, customList?: IMenuItemStructure[]) => IMenuItemStructure[];
|
|
12
|
-
storedUpdateRouteSelection: (currentRoute: string, currentList: IMenuItemStructure[]) => IMenuItemStructure[];
|
|
13
6
|
storedInitializeMenuDropdown: (primaryDropdownList: Array<any>) => any[];
|
|
7
|
+
storedSetMenuType: (isStaticMenu: boolean) => void;
|
|
8
|
+
storedUpdateRouteSelection: (currentRoute: string, currentList: IMenuItemStructure[]) => IMenuItemStructure[];
|
|
14
9
|
menu: IMenuItemStructure[];
|
|
15
10
|
menuDropdown: any[];
|
|
16
11
|
/** Inicializa as opções do menu com base na rota atual e em uma lista personalizada (opcional).
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
setMenuStatic(isStaticMenu: boolean): void;
|
|
12
|
+
* @param currentRoute A rota atual da aplicação
|
|
13
|
+
* @param customList Uma lista personalizada de opções de menu (opcional).
|
|
14
|
+
* @returns As opções do menu inicializadas.
|
|
15
|
+
*/
|
|
22
16
|
initializeMenu(currentRoute: string, customList?: IMenuItemStructure[]): IMenuItemStructure[];
|
|
17
|
+
setMenuType(isStaticMenu: boolean): void;
|
|
23
18
|
updateRouteSelection(currentRoute: string, currentList: IMenuItemStructure[]): IMenuItemStructure[];
|
|
24
19
|
/** Inicializa as opções do menu dropdown com base em uma lista personalizada (opcional).
|
|
25
20
|
* @param primaryDropdownList Uma lista personalizada de opções do dropdown (opcional).
|
|
@@ -27,6 +22,6 @@ export declare class MenuConfigService {
|
|
|
27
22
|
*/
|
|
28
23
|
initializeMenuDropdown(primaryDropdownList: Array<any>): any[];
|
|
29
24
|
ConfigurarMenuConfig(menuConfig: IMenuConfig): void;
|
|
30
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
31
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LibMenuConfigService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LibMenuConfigService>;
|
|
32
27
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Router } from "@angular/router";
|
|
1
2
|
export interface ICustomLoginService {
|
|
2
3
|
loginTitle: string;
|
|
3
4
|
loginSubtitle: string;
|
|
@@ -10,4 +11,5 @@ export interface ICustomLoginService {
|
|
|
10
11
|
loginDesenvPassword: string;
|
|
11
12
|
authLogin(): void;
|
|
12
13
|
authLogout(): void;
|
|
14
|
+
authNavigateToPage(router: Router): void;
|
|
13
15
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export interface ICustomMenuService {
|
|
2
2
|
menuDynamic: boolean;
|
|
3
|
+
menuDynamicCustom: false;
|
|
3
4
|
moduleName: string;
|
|
4
5
|
moduleImg: string;
|
|
5
6
|
moduleSvg: string;
|
|
6
7
|
themeColor: string;
|
|
8
|
+
menuDynamicGetModuloId(): number;
|
|
7
9
|
menuDynamicOnInit(): void;
|
|
8
10
|
menuStaticOnInit(): void;
|
|
9
11
|
menuopenExpansibleMenu(ref: HTMLDivElement): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IMenuItemStructure } from "../../components/menu-lateral/model/imenu-item-structure.model";
|
|
2
2
|
export interface IMenuConfig {
|
|
3
|
-
menuOptions: IMenuItemStructure[];
|
|
4
|
-
isMenuStatic: boolean;
|
|
5
3
|
initializeMenu(currentRoute: string, customList?: IMenuItemStructure[]): IMenuItemStructure[];
|
|
6
4
|
initializeMenuDropdown(primaryDropdownList: Array<any>): Array<any>[];
|
|
5
|
+
setMenuType(isStaticMenu: boolean): void;
|
|
6
|
+
updateRouteSelection(currentRoute: string, currentList: IMenuItemStructure[]): IMenuItemStructure[];
|
|
7
7
|
}
|
|
@@ -5,7 +5,14 @@ export declare class EnvironmentService {
|
|
|
5
5
|
needsAuthAplic: Map<string, string[]>;
|
|
6
6
|
production: boolean;
|
|
7
7
|
hostName: string;
|
|
8
|
-
|
|
8
|
+
product: string;
|
|
9
|
+
Sp2LocalhostInfra2AuthWS: string;
|
|
10
|
+
Sp2LocalhostInfra2LoginWS: string;
|
|
11
|
+
Sp2Localhost: string;
|
|
12
|
+
SpInfra2AuthWS: string;
|
|
13
|
+
SpInfra2LoginWS: string;
|
|
14
|
+
SpInfra2ErpWS: string;
|
|
15
|
+
ConfigurarEnvironments(properties: IEnvironments): void;
|
|
9
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<EnvironmentService, never>;
|
|
10
17
|
static ɵprov: i0.ɵɵInjectableDeclaration<EnvironmentService>;
|
|
11
18
|
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
export interface IEnvironments {
|
|
2
|
+
production: boolean;
|
|
3
|
+
hostName: string;
|
|
4
|
+
product: string;
|
|
5
|
+
Sp2LocalhostInfra2AuthWS: string;
|
|
6
|
+
Sp2LocalhostInfra2LoginWS: string;
|
|
7
|
+
Sp2LocalhostWS: string;
|
|
8
|
+
SpInfra2AuthWS: string;
|
|
9
|
+
SpInfra2LoginWS: string;
|
|
10
|
+
SpInfra2ErpWS: string;
|
|
2
11
|
needsAuthInfra: Map<string, string[]>;
|
|
3
12
|
needsAuthAplic: Map<string, string[]>;
|
|
4
13
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Router, RouterStateSnapshot, ActivatedRouteSnapshot, UrlTree } from '@angular/router';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { ServerService } from '../server/server.service';
|
|
4
3
|
import { AuthStorageService } from '../storage/auth-storage.service';
|
|
5
4
|
import { AuthService } from '../auth.service';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
@@ -8,14 +7,13 @@ export declare class ExternaLoginlGuard {
|
|
|
8
7
|
private router;
|
|
9
8
|
private authService;
|
|
10
9
|
private authStorageService;
|
|
11
|
-
|
|
12
|
-
constructor(router: Router, authService: AuthService, authStorageService: AuthStorageService, serverService: ServerService);
|
|
10
|
+
constructor(router: Router, authService: AuthService, authStorageService: AuthStorageService);
|
|
13
11
|
canActivate(_route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
|
14
12
|
private navigateToError;
|
|
15
13
|
private IsUserAuth;
|
|
16
14
|
private logOnExternal;
|
|
17
|
-
private
|
|
18
|
-
private
|
|
15
|
+
private getAuthentication;
|
|
16
|
+
private handleGetAuthentication;
|
|
19
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<ExternaLoginlGuard, never>;
|
|
20
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<ExternaLoginlGuard>;
|
|
21
19
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
|
2
|
-
import { EnvironmentService } from './../environments/environments.service';
|
|
3
2
|
import { Observable } from 'rxjs';
|
|
4
|
-
import { CheckUrlAndMethodService } from 'ngx-sp-infra';
|
|
5
3
|
import { AuthStorageService } from '../storage/auth-storage.service';
|
|
4
|
+
import { CheckUrlAndMethodService } from 'ngx-sp-infra';
|
|
5
|
+
import { EnvironmentService } from './../environments/environments.service';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* \brief Intercepta uma chamada HTTP para inserir o usuário logado no header em conjunto
|
|
@@ -12,9 +12,9 @@ import * as i0 from "@angular/core";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class AuthAplicInterceptor implements HttpInterceptor {
|
|
14
14
|
private authCheckService;
|
|
15
|
-
private _environmentService;
|
|
16
15
|
private token;
|
|
17
|
-
|
|
16
|
+
private _environmentService;
|
|
17
|
+
constructor(authCheckService: CheckUrlAndMethodService, token: AuthStorageService, _environmentService: EnvironmentService);
|
|
18
18
|
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
19
19
|
handle(req: HttpRequest<any>, next: HttpHandler): Promise<HttpEvent<any>>;
|
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<AuthAplicInterceptor, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from "@angular/common/http";
|
|
2
|
-
import { EnvironmentService } from './../environments/environments.service';
|
|
3
2
|
import { Observable } from "rxjs";
|
|
4
3
|
import { CheckUrlAndMethodService } from "ngx-sp-infra";
|
|
4
|
+
import { EnvironmentService } from './../environments/environments.service';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* \brief Intercepta uma chamada HTTP para inserir a autenticação da Sispro.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IError } from "ngx-sp-infra";
|
|
2
|
+
export declare class RetAutenthication implements IError {
|
|
3
|
+
Error: boolean;
|
|
4
|
+
ErrorMessage: string;
|
|
5
|
+
User: string;
|
|
6
|
+
Password: string;
|
|
7
|
+
TenantId: number;
|
|
8
|
+
Domain: string;
|
|
9
|
+
InfraInAuthTypeId: number;
|
|
10
|
+
InfraIn2FaTypeId?: number | null | undefined;
|
|
11
|
+
Is2FaEnabled: boolean;
|
|
12
|
+
AzureTenantId: string;
|
|
13
|
+
AzureClientId: string;
|
|
14
|
+
}
|
|
@@ -12,9 +12,6 @@ export declare class RetLogin implements IError {
|
|
|
12
12
|
Token: string;
|
|
13
13
|
Dominio: string;
|
|
14
14
|
InitializePassword: boolean;
|
|
15
|
-
InfraInAuthTypeId: number;
|
|
16
|
-
InfraIn2FaTypeId?: number | null;
|
|
17
|
-
Is2FaEnabled: boolean;
|
|
18
15
|
FeedbackMessage: string;
|
|
19
|
-
|
|
16
|
+
StatusSenha: number;
|
|
20
17
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Router } from '@angular/router';
|
|
2
|
+
import { CheckUrlAndMethodService, MessageService } from 'ngx-sp-infra';
|
|
3
|
+
import { AuthStorageService } from '../storage/auth-storage.service';
|
|
4
|
+
import { EnvironmentService } from '../environments/environments.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class ProjectUtilservice {
|
|
7
|
+
private router;
|
|
8
|
+
private authStorageService;
|
|
9
|
+
private checkUrlAndMethodService;
|
|
10
|
+
private messageService;
|
|
11
|
+
private _environmentService;
|
|
12
|
+
constructor(router: Router, authStorageService: AuthStorageService, checkUrlAndMethodService: CheckUrlAndMethodService, messageService: MessageService, _environmentService: EnvironmentService);
|
|
13
|
+
showHttpError(error: any): void;
|
|
14
|
+
private showExpiredAccess;
|
|
15
|
+
getHostName(): string;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProjectUtilservice, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ProjectUtilservice>;
|
|
18
|
+
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { HttpBackend } from '@angular/common/http';
|
|
2
|
-
import { Payload } from './../models/payload';
|
|
3
2
|
import { BehaviorSubject } from 'rxjs';
|
|
4
|
-
import {
|
|
3
|
+
import { Payload } from './../models/payload';
|
|
4
|
+
import { LibCustomStorageService } from '../custom/lib-custom-storage.service';
|
|
5
|
+
import { EnvironmentService } from '../environments/environments.service';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class AuthStorageService {
|
|
7
8
|
private _httpBackend;
|
|
8
9
|
private _customStorageService;
|
|
9
|
-
private
|
|
10
|
+
private _environmentService;
|
|
10
11
|
private readonly _BASE_URL;
|
|
11
12
|
private readonly __local_key;
|
|
12
13
|
private __isSaving;
|
|
13
14
|
/** Se ainda estamos com uma função rodando para verificar o login do usuário */
|
|
14
15
|
private __isCheckingAuth;
|
|
15
16
|
private _httpClient;
|
|
16
|
-
constructor(_httpBackend: HttpBackend, _customStorageService: LibCustomStorageService);
|
|
17
|
+
constructor(_httpBackend: HttpBackend, _customStorageService: LibCustomStorageService, _environmentService: EnvironmentService);
|
|
17
18
|
isLoggedInSub: BehaviorSubject<boolean>;
|
|
18
19
|
private __ip;
|
|
19
20
|
get ip(): string;
|
|
@@ -44,6 +45,7 @@ export declare class AuthStorageService {
|
|
|
44
45
|
set userName(value: string);
|
|
45
46
|
private __tokenPayload;
|
|
46
47
|
get tokenPayload(): Payload;
|
|
48
|
+
set tokenPayload(value: Payload);
|
|
47
49
|
private __authToken;
|
|
48
50
|
get authToken(): string;
|
|
49
51
|
set authToken(value: string);
|
|
@@ -61,6 +63,21 @@ export declare class AuthStorageService {
|
|
|
61
63
|
private __ignoreCheckLogin;
|
|
62
64
|
get ignoreCheckLogin(): boolean;
|
|
63
65
|
set ignoreCheckLogin(value: boolean);
|
|
66
|
+
private __infraInAuthTypeId;
|
|
67
|
+
get infraInAuthTypeId(): number;
|
|
68
|
+
set infraInAuthTypeId(value: number);
|
|
69
|
+
private __infraIn2FaTypeId;
|
|
70
|
+
get infraIn2FaTypeId(): number | null | undefined;
|
|
71
|
+
set infraIn2FaTypeId(value: number | null | undefined);
|
|
72
|
+
private __is2FaEnabled;
|
|
73
|
+
get is2FaEnabled(): boolean;
|
|
74
|
+
set is2FaEnabled(value: boolean);
|
|
75
|
+
private __azureTenantId;
|
|
76
|
+
get azureTenantId(): string;
|
|
77
|
+
set azureTenantId(value: string);
|
|
78
|
+
private __azureClientId;
|
|
79
|
+
get azureClientId(): string;
|
|
80
|
+
set azureClientId(value: string);
|
|
64
81
|
private __saveLocalInstance;
|
|
65
82
|
private __notSaving;
|
|
66
83
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-sp-auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Biblioteca de utilitários da Infra.",
|
|
5
5
|
"author": "P&D",
|
|
6
6
|
"keywords": [
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"url": "https://github.com/SISPROV6/infra-code-libs"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
+
"@azure/msal-angular": "^4.0.16",
|
|
24
|
+
"@azure/msal-browser": "^4.18.0",
|
|
23
25
|
"ngx-sp-infra": "^5.8.0",
|
|
24
26
|
"ngx-toastr": "^19.0.0"
|
|
25
27
|
},
|
package/public-api.d.ts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
export * from './lib/auth.module';
|
|
2
2
|
/** Services */
|
|
3
|
-
export * from './lib/
|
|
4
|
-
export * from './lib/
|
|
5
|
-
export * from './lib/
|
|
6
|
-
export * from './lib/custom/
|
|
7
|
-
export * from './lib/custom/custom-menu.service';
|
|
8
|
-
export * from './lib/custom/custom-storage.service';
|
|
9
|
-
export * from './lib/custom/menu-config.service';
|
|
3
|
+
export * from './lib/custom/lib-custom-login.service';
|
|
4
|
+
export * from './lib/custom/lib-custom-menu.service';
|
|
5
|
+
export * from './lib/custom/lib-custom-storage.service';
|
|
6
|
+
export * from './lib/custom/lib-menu-config.service';
|
|
10
7
|
export * from './lib/environments/environments.service';
|
|
11
|
-
export * from './lib/server/server.service';
|
|
12
8
|
export * from './lib/storage/auth-storage.service';
|
|
13
9
|
/** Components */
|
|
14
10
|
export * from './lib/components/login/login.component';
|
|
11
|
+
export * from './lib/components/login-os/login-os.component';
|
|
15
12
|
export * from './lib/components/menu-lateral/dropdown/primary-dropdown/primary-dropdown.component';
|
|
16
13
|
export * from './lib/components/menu-lateral/dropdown/secondary-dropdown/secondary-dropdown.component';
|
|
17
14
|
export * from './lib/components/menu-lateral/menu/menu-lateral.component';
|
|
@@ -26,9 +23,8 @@ export * from './lib/components/menu-lateral/model/infrausuarioimg';
|
|
|
26
23
|
export * from './lib/custom/models/icustom-login-service';
|
|
27
24
|
export * from './lib/custom/models/icustom-menu-service';
|
|
28
25
|
export * from './lib/custom/models/imenu-config';
|
|
29
|
-
export * from './lib/environments/models/ienvironments';
|
|
30
|
-
export * from './lib/models/custom-propriedades-login';
|
|
31
26
|
export * from './lib/custom/models/icustom-storage-service';
|
|
27
|
+
export * from './lib/environments/models/ienvironments';
|
|
32
28
|
/** Guards */
|
|
33
29
|
export * from './lib/guards/auth-guard';
|
|
34
30
|
export * from './lib/guards/external-login-guard';
|
|
@@ -36,3 +32,7 @@ export * from './lib/guards/login-guard';
|
|
|
36
32
|
/** Interceptors */
|
|
37
33
|
export * from './lib/interceptors/auth-aplic.interceptor';
|
|
38
34
|
export * from './lib/interceptors/auth-infra.interceptor';
|
|
35
|
+
/** Routes */
|
|
36
|
+
export * from './lib/auth.routes';
|
|
37
|
+
/** Modules */
|
|
38
|
+
export * from './lib/auth.module';
|
package/README.md
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
# NgxSpAuth - Biblioteca de Login 🔐
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
# Introdução 📝
|
|
8
|
-
|
|
9
|
-
Esta biblioteca fornece componentes de telas relacionadas a autenticação.
|
|
10
|
-
|
|
11
|
-
# Recursos 🚀
|
|
12
|
-
|
|
13
|
-
✅ Autenticação de usuários com tenant, usuario e senha;
|
|
14
|
-
|
|
15
|
-
✅ Recuperação de senha;
|
|
16
|
-
|
|
17
|
-
✅ Menu Lateral liberado após Login.
|
|
18
|
-
|
|
19
|
-
# Instalação e configuração 📥
|
|
20
|
-
|
|
21
|
-
1️⃣ Instalar a biblioteca - utilizando o comando "npm install ngx-sp-auth";
|
|
22
|
-
|
|
23
|
-
2️⃣ Configurar o sistema para utilizar os componentes (somente para projetos que nunca utilizaram essa biblioteca);
|
|
24
|
-
|
|
25
|
-
2.1. Substituir referência do import { AuthStorageService } from 'src/app/auth/storage/auth-storage.service'
|
|
26
|
-
para import { AuthStorageService } from 'ngx-sp-auth';
|
|
27
|
-
|
|
28
|
-
2.2. Verificar se existe mais alguma referência para algum arquivo dentro do diretório "src/app/auth/" e substitua a importação para "ngx-sp-auth",
|
|
29
|
-
isso depende de cada projeto.
|
|
30
|
-
|
|
31
|
-
2.3. Adicionar/Alterar os seguintes trechos de código do projeto.
|
|
32
|
-
|
|
33
|
-
- import { AuthGuard, LoginComponent, NovaSenhaComponent } from "ngx-sp-auth";
|
|
34
|
-
|
|
35
|
-
- No seu APP_ROUTES colocar as rotas abaixo.
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
{
|
|
39
|
-
path: "auth/login",
|
|
40
|
-
component: LoginComponent,
|
|
41
|
-
canLoad: [LoginGuard]
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
path: 'auth/login/novaSenha/:param',
|
|
45
|
-
component: NovaSenhaComponent,
|
|
46
|
-
canLoad: [LoginGuard]
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
- No seu app-component.ts adicionar o seguinte código abaixo.
|
|
51
|
-
(Serve principalmente para adicionar propriedades e métodos customizados ou não para a biblioteca).
|
|
52
|
-
|
|
53
|
-
```typescript
|
|
54
|
-
import { AuthStorageService, EnvironmentService, ICustomLoginService, ICustomMenuService, ICustomStorageService, IEnvironments, IMenuConfig, LibCustomLoginService, LibCustomMenuService, LibCustomStorageService, MenuConfigService } from 'ngx-sp-auth';
|
|
55
|
-
import { CustomMenuService } from './project/custom/menu/custom-menu.service';
|
|
56
|
-
import { CustomLoginService } from './project/custom/login/custom-login.service';
|
|
57
|
-
import { CustomStorageService } from './project/custom/storage/custom-storage.service';
|
|
58
|
-
|
|
59
|
-
export class AppComponent {
|
|
60
|
-
|
|
61
|
-
private _menuConfig = new MenuConfig(false);
|
|
62
|
-
|
|
63
|
-
public configCustomLogin: ICustomLoginService = {
|
|
64
|
-
// passando propriedades customizadas para o componente de Login
|
|
65
|
-
loginTitle: "",
|
|
66
|
-
loginSubtitle: "",
|
|
67
|
-
loginBackground: "",
|
|
68
|
-
loginLogotipo: "",
|
|
69
|
-
loginAltLogotipo: "",
|
|
70
|
-
loginPageTitle: "",
|
|
71
|
-
loginDesenvDomain: "",
|
|
72
|
-
loginDesenvUser: "",
|
|
73
|
-
loginDesenvPassword: "",
|
|
74
|
-
// passando métodos customizados para o componente de Login
|
|
75
|
-
authLogin: (): void => { },
|
|
76
|
-
authLogout: (): void => { }
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public mapsEnvironment: IEnvironments = {
|
|
80
|
-
needsAuthAplic: environment.needsAuthAplic,
|
|
81
|
-
needsAuthInfra: environment.needsAuthInfra
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
public configMenuProduto: IMenuConfig = {
|
|
85
|
-
isMenuStatic: this._menuConfig._isMenuStatic,
|
|
86
|
-
initializeMenu: this._menuConfig.initializeMenu,
|
|
87
|
-
menuOptions: this._menuConfig.menuOptions,
|
|
88
|
-
initializeMenuDropdown: this._menuConfig.initializeMenuDropdown
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
public configCustomMenuService: ICustomMenuService = {
|
|
92
|
-
menuDynamic: false,
|
|
93
|
-
moduleName: '',
|
|
94
|
-
moduleImg: '',
|
|
95
|
-
moduleSvg: "",
|
|
96
|
-
themeColor: "",
|
|
97
|
-
menuDynamicOnInit: (): void => { },
|
|
98
|
-
menuStaticOnInit: (): void => { },
|
|
99
|
-
menuopenExpansibleMenu: (ref: HTMLDivElement): void => { },
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
public configCustomStorageService: ICustomStorageService = {
|
|
103
|
-
isSaving: false,
|
|
104
|
-
storageConstructor: (): void => { },
|
|
105
|
-
storageLogout: (): void => { },
|
|
106
|
-
storageSaveLocalInstance: (): void => { },
|
|
107
|
-
storageInitializeAutoStorage: (): void => { }
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
constructor(
|
|
111
|
-
private _environmentService: EnvironmentService,
|
|
112
|
-
private _menuConfigService: MenuConfigService,
|
|
113
|
-
private _customMenuService: CustomMenuService,
|
|
114
|
-
private _customLoginService: CustomLoginService,
|
|
115
|
-
private _customStorageService: CustomStorageService,
|
|
116
|
-
private _libCusomLoginService: LibCustomLoginService,
|
|
117
|
-
private _libCustomMenuService: LibCustomMenuService,
|
|
118
|
-
private _libCustomStorageService: LibCustomStorageService,
|
|
119
|
-
) {
|
|
120
|
-
|
|
121
|
-
this.configCustomMenuService.menuDynamic = this._customMenuService.menuDynamic;
|
|
122
|
-
this.configCustomMenuService.moduleName = this._customMenuService.moduleName;
|
|
123
|
-
this.configCustomMenuService.moduleImg = this._customMenuService.moduleImg;
|
|
124
|
-
this.configCustomMenuService.moduleSvg = this._customMenuService.moduleSvg;
|
|
125
|
-
this.configCustomMenuService.themeColor = this._customMenuService.themeColor;
|
|
126
|
-
|
|
127
|
-
this.configCustomStorageService.storageConstructor = this._customStorageService.storageConstructor;
|
|
128
|
-
this.configCustomStorageService.storageInitializeAutoStorage = this._customStorageService.storageInitializeAutoStorage;
|
|
129
|
-
this.configCustomStorageService.storageLogout = this._customStorageService.storageLogout;
|
|
130
|
-
this.configCustomStorageService.storageSaveLocalInstance = this._customStorageService.storageSaveLocalInstance;
|
|
131
|
-
|
|
132
|
-
this.configCustomLogin.loginAltLogotipo = this._customLoginService.loginAltLogotipo;
|
|
133
|
-
this.configCustomLogin.loginTitle = this._customLoginService.loginTitle;
|
|
134
|
-
this.configCustomLogin.loginSubtitle = this._customLoginService.loginSubtitle;
|
|
135
|
-
this.configCustomLogin.loginPageTitle = this._customLoginService.loginPageTitle;
|
|
136
|
-
this.configCustomLogin.loginLogotipo = this._customLoginService.loginLogotipo;
|
|
137
|
-
this.configCustomLogin.loginDesenvUser = this._customLoginService.loginDesenvUser;
|
|
138
|
-
this.configCustomLogin.loginDesenvDomain = this._customLoginService.loginDesenvDomain;
|
|
139
|
-
this.configCustomLogin.loginDesenvPassword = this._customLoginService.loginDesenvPassword;
|
|
140
|
-
this.configCustomLogin.loginBackground = this._customLoginService.loginBackground;
|
|
141
|
-
this.configCustomLogin.authLogin = this._customLoginService.authLogin;
|
|
142
|
-
this.configCustomLogin.authLogout = this._customLoginService.authLogout;
|
|
143
|
-
|
|
144
|
-
this.configCustomMenuService.menuDynamicOnInit = this._customMenuService.menuDynamicOnInit;
|
|
145
|
-
this.configCustomMenuService.menuStaticOnInit = this._customMenuService.menuStaticOnInit;
|
|
146
|
-
this.configCustomMenuService.menuopenExpansibleMenu = this._customMenuService.menuopenExpansibleMenu;
|
|
147
|
-
|
|
148
|
-
_libCustomStorageService.ConfigurarCustomStorage(this.configCustomStorageService);
|
|
149
|
-
_libCusomLoginService.ConfigurarCustomLogin(this.configCustomLogin);
|
|
150
|
-
_environmentService.ConfigurarEnvironments(this.mapsEnvironment);
|
|
151
|
-
_menuConfigService.ConfigurarMenuConfig(this.configMenuProduto);
|
|
152
|
-
_libCustomMenuService.ConfigurarCustomMenuService(this.configCustomMenuService);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
- Remover o AUTH_ROUTES do main.ts
|
|
158
|
-
|
|
159
|
-
Antes:
|
|
160
|
-
```typescript
|
|
161
|
-
provideRouter([
|
|
162
|
-
...APP_ROUTES,
|
|
163
|
-
...PROJECT_ROUTES,
|
|
164
|
-
...AUTH_ROUTES
|
|
165
|
-
]),
|
|
166
|
-
|
|
167
|
-
```
|
|
168
|
-
Depois:
|
|
169
|
-
|
|
170
|
-
```typescript
|
|
171
|
-
provideRouter([
|
|
172
|
-
...APP_ROUTES,
|
|
173
|
-
...PROJECT_ROUTES,
|
|
174
|
-
]),
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
- Verificar o hostname do environments.ts, mudar tudo para minúsculo se tiver algo escrito em maiúsculo.
|
|
178
|
-
|
|
179
|
-
# Customização de Estilos (SCSS) 🎨
|
|
180
|
-
|
|
181
|
-
Para realizar as customizações de SCSS na biblioteca é necessario implementar o código nos seguintes arquivos do seu projeto.
|
|
182
|
-
|
|
183
|
-
- custom-login-styles.scss
|
|
184
|
-
- custom-menu-styles.scss
|
|
185
|
-
- custom-styles.scss
|
|
186
|
-
|
|
187
|
-
Classes possiveis de estilização no componente de Login:
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
//Ainda sendo validado.
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
# Publicar no NPM 🚀
|
|
194
|
-
|
|
195
|
-
1️⃣ Mudar a propriedade "version" do no package.json para o número da nova versão que se deseja publicar no NPM.
|
|
196
|
-
|
|
197
|
-
nova versão PATCH (0.0.1);
|
|
198
|
-
|
|
199
|
-
nova versão MINOR (0.1.0);
|
|
200
|
-
|
|
201
|
-
nova versão MAJOR (1.0.0) *Somente para grandes mudanças biblioteca*.
|
|
202
|
-
|
|
203
|
-
2️⃣ Comandos para publicação:
|
|
204
|
-
|
|
205
|
-
- `cd dist/ngx-sp-auth`
|
|
206
|
-
- `npm adduser` OU `npm login` _- depende se você já possui conta no NPM ou não_
|
|
207
|
-
- `npm publish --access public --tag latest`
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { IEstabelecimento } from '../model/iestabelecimento.model';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ListEstabService {
|
|
6
|
-
private http;
|
|
7
|
-
private storage;
|
|
8
|
-
cacheName: string;
|
|
9
|
-
readonly menuKey: string;
|
|
10
|
-
baseUrl: string;
|
|
11
|
-
constructor(http: HttpClient);
|
|
12
|
-
getList(): Observable<IEstabelecimento[]>;
|
|
13
|
-
set(value: IEstabelecimento[]): void;
|
|
14
|
-
get(): IEstabelecimento[] | null;
|
|
15
|
-
remove(): void;
|
|
16
|
-
getCacheName(cacheName: string): void;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ListEstabService, never>;
|
|
18
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ListEstabService>;
|
|
19
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare class CustomPropriedadesLogin {
|
|
2
|
-
loginTitle: string;
|
|
3
|
-
loginSubtitle: string;
|
|
4
|
-
loginBackground: string;
|
|
5
|
-
loginLogotipo: string;
|
|
6
|
-
loginAltLogotipo: string;
|
|
7
|
-
loginPageTitle: string;
|
|
8
|
-
loginDesenvDomain: string;
|
|
9
|
-
loginDesenvUser: string;
|
|
10
|
-
loginDesenvPassword: string;
|
|
11
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RetServerConfig } from './ret-server-config';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ServerService {
|
|
6
|
-
private _httpClient;
|
|
7
|
-
private readonly _HOSTNAME;
|
|
8
|
-
private readonly _BASE_URL;
|
|
9
|
-
private readonly _HTTP_HEADERS;
|
|
10
|
-
constructor(_httpClient: HttpClient);
|
|
11
|
-
getServer(): Observable<RetServerConfig>;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ServerService, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ServerService>;
|
|
14
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|