ngx-sp-auth 4.22.5 → 4.22.7

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.
@@ -23,9 +23,10 @@ export declare class AuthService {
23
23
  private _customEnvironmentService;
24
24
  private _indexedDBService;
25
25
  private _pendingWarning;
26
- private readonly _BASE_URL;
27
26
  private readonly _AUTH_BASE_URL;
27
+ private readonly _BASE_URL;
28
28
  private readonly _BASE_OS_URL;
29
+ private readonly _LOGOUT_BASE_URL;
29
30
  private readonly _HTTP_HEADERS;
30
31
  private ip;
31
32
  private city;
@@ -59,8 +60,6 @@ export declare class AuthService {
59
60
  * @returns Observable com os dados do login realizado, seja erro ou sucesso
60
61
  */
61
62
  loginOS(parmsLogin: LoginForm, serialV6: string): Observable<RetLogin>;
62
- /** Realiza o logout do sistema, removendo tokens do localStorage e limpando cache */
63
- logout(): void;
64
63
  validateAuthentication2Fa(code: string): Observable<RetLogin>;
65
64
  GetNewCode2Fa(): Observable<RetError>;
66
65
  forgottenPassword(parms: ForgottenPasswordForm): Observable<RetError>;
@@ -53,6 +53,8 @@ export declare class MenuServicesService {
53
53
  getProjects(): Observable<RetDropDown>;
54
54
  /** Método executado para pegar o HostName de direcionamento para OS. */
55
55
  GetHostServerOutSystems(): Observable<RetString>;
56
+ /** Método executado para pegar o HostName de direcionamento para a V6. */
57
+ GetHostServerV6(): Observable<RetString>;
56
58
  /**
57
59
  * **ESTE MÉTODO FOI DUPLICADO DO MÉTODO `GetHostServerOutSystems` PARA SER UTILIZADO DE FORMA ASSÍNCRONA, SEM *OBSERVABLE*, PARA EVITAR PROBLEMAS DE SINCRONIA NA CONSTRUÇÃO DO MENU DINÂMICO.**
58
60
  *
@@ -1,20 +1,18 @@
1
1
  import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
- import { AuthStorageService } from '../storage/auth-storage.service';
4
3
  import { CheckUrlAndMethodService } from 'ngx-sp-infra';
5
4
  import { LibCustomEnvironmentService } from '../custom/lib-custom-environment.service';
5
+ import { AuthStorageService } from '../storage/auth-storage.service';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
- * \brief Intercepta uma chamada HTTP para inserir o usuário logado no header em conjunto
9
- * com o login para uso da API.
10
- *
8
+ * Intercepta uma chamada HTTP para inserir o usuário logado nos cookies (e header, para compatibilidade) em conjunto com o login para uso da API.
11
9
  * Depende do serviço de autenticação.
12
- */
10
+ */
13
11
  export declare class AuthAplicInterceptor implements HttpInterceptor {
14
- private authCheckService;
15
- private token;
12
+ private _authCheckService;
13
+ private _authStorage;
16
14
  private _customEnvironmentService;
17
- constructor(authCheckService: CheckUrlAndMethodService, token: AuthStorageService, _customEnvironmentService: LibCustomEnvironmentService);
15
+ constructor(_authCheckService: CheckUrlAndMethodService, _authStorage: AuthStorageService, _customEnvironmentService: LibCustomEnvironmentService);
18
16
  intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
19
17
  handle(req: HttpRequest<any>, next: HttpHandler): Promise<HttpEvent<any>>;
20
18
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthAplicInterceptor, never>;
@@ -3,13 +3,11 @@ import { Observable } from "rxjs";
3
3
  import { CheckUrlAndMethodService } from "ngx-sp-infra";
4
4
  import { LibCustomEnvironmentService } from '../custom/lib-custom-environment.service';
5
5
  import * as i0 from "@angular/core";
6
- /**
7
- * \brief Intercepta uma chamada HTTP para inserir a autenticação da Sispro.
8
- */
6
+ /** Intercepta uma chamada HTTP para inserir a autenticação da básica das APIs nos Cookies (e no header, para compatibilidade) */
9
7
  export declare class AuthInfraInterceptor implements HttpInterceptor {
10
- private authCheckService;
8
+ private _authCheckService;
11
9
  private _customEnvironmentService;
12
- constructor(authCheckService: CheckUrlAndMethodService, _customEnvironmentService: LibCustomEnvironmentService);
10
+ constructor(_authCheckService: CheckUrlAndMethodService, _customEnvironmentService: LibCustomEnvironmentService);
13
11
  intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
14
12
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthInfraInterceptor, never>;
15
13
  static ɵprov: i0.ɵɵInjectableDeclaration<AuthInfraInterceptor>;
@@ -1,5 +1,5 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
- import { ApplicationRef, ComponentFactoryResolver, Injector } from '@angular/core';
2
+ import { ApplicationRef, Injector } from '@angular/core';
3
3
  import { Observable } from 'rxjs';
4
4
  import { LibCustomEnvironmentService } from '../custom/lib-custom-environment.service';
5
5
  import { RetTelasPesquisa } from '../models/ret-telas-pesquisa.model';
@@ -27,12 +27,12 @@ import * as i0 from "@angular/core";
27
27
  * }
28
28
  */
29
29
  export declare class PesquisaTelasGlobalService {
30
- private _componentFactoryResolver;
31
30
  private _appRef;
32
31
  private _injector;
33
32
  private _httpClient;
34
33
  private _customEnvironmentService;
35
34
  private _authUtils;
35
+ private _container;
36
36
  /**
37
37
  * Referência ao componente dinâmico criado.
38
38
  * Usado para gerenciar o ciclo de vida e estado do componente.
@@ -68,7 +68,7 @@ export declare class PesquisaTelasGlobalService {
68
68
  private _componentSearchSub;
69
69
  private readonly _BASE_URL;
70
70
  private readonly _HTTP_HEADERS;
71
- constructor(_componentFactoryResolver: ComponentFactoryResolver, _appRef: ApplicationRef, _injector: Injector, _httpClient: HttpClient, _customEnvironmentService: LibCustomEnvironmentService, _authUtils: AuthUtilService);
71
+ constructor(_appRef: ApplicationRef, _injector: Injector, _httpClient: HttpClient, _customEnvironmentService: LibCustomEnvironmentService, _authUtils: AuthUtilService);
72
72
  /**
73
73
  * Lifecycle hook do Angular chamado quando o serviço é destruído.
74
74
  *
@@ -94,7 +94,7 @@ export declare class PesquisaTelasGlobalService {
94
94
  *
95
95
  * Este método utiliza a API baixo nível do Angular para criar um componente dinamicamente e anexá-lo ao DOM. O processo envolve:
96
96
  *
97
- * 1. Criar o componente via ComponentFactoryResolver
97
+ * 1. Criar o componente via `container.createComponent()`
98
98
  * 2. Configurar suas propriedades iniciais
99
99
  * 3. Registrá-lo no mecanismo de detecção de mudanças do Angular
100
100
  * 4. Anexá-lo ao DOM (fora da hierarquia normal de componentes)
@@ -1,7 +1,9 @@
1
1
  import { HttpBackend } from '@angular/common/http';
2
2
  import { BehaviorSubject } from 'rxjs';
3
3
  import { Payload } from './../models/payload';
4
+ import { Router } from '@angular/router';
4
5
  import { LibCustomEnvironmentService } from '../custom/lib-custom-environment.service';
6
+ import { LibCustomLoginService } from '../custom/lib-custom-login.service';
5
7
  import { LibCustomStorageService } from '../custom/lib-custom-storage.service';
6
8
  import { IndexedDBService } from '../services/indexed-db.service';
7
9
  import * as i0 from "@angular/core";
@@ -10,13 +12,17 @@ export declare class AuthStorageService {
10
12
  private _customStorageService;
11
13
  private _indexedDBService;
12
14
  private _customEnvironmentService;
15
+ private _customLoginService;
16
+ private _router;
13
17
  private readonly _BASE_URL;
18
+ private readonly _LOGOUT_BASE_URL;
19
+ private readonly _HTTP_HEADERS;
14
20
  private readonly __local_key;
15
21
  private __isSaving;
16
22
  /** Se ainda estamos com uma função rodando para verificar o login do usuário */
17
23
  private __isCheckingAuth;
18
24
  private _httpClient;
19
- constructor(_httpBackend: HttpBackend, _customStorageService: LibCustomStorageService, _indexedDBService: IndexedDBService, _customEnvironmentService: LibCustomEnvironmentService);
25
+ constructor(_httpBackend: HttpBackend, _customStorageService: LibCustomStorageService, _indexedDBService: IndexedDBService, _customEnvironmentService: LibCustomEnvironmentService, _customLoginService: LibCustomLoginService, _router: Router);
20
26
  isLoggedInSub: BehaviorSubject<boolean>;
21
27
  private __ip;
22
28
  get ip(): string;
@@ -90,13 +96,18 @@ export declare class AuthStorageService {
90
96
  startLoginCheck(): void;
91
97
  /** Verifica a cada diferença de tempo entre a data atual e a data do token. */
92
98
  reCheckLogin(renew: boolean): Promise<void>;
93
- logout(): void;
99
+ /**
100
+ * Realiza o logout do sistema, consumindo o endpoint de logout para remover os cookies e limpando as informações de autenticação armazenadas no localStorage.
101
+ * @returns Promise<boolean> indicando navegação para a tela de login após o logout.
102
+ */
103
+ logout(): Promise<boolean>;
94
104
  private getNewTokenBack;
95
105
  private getNewToken;
96
106
  /**
97
107
  * Renova o Token quando este estiver vencido.
98
108
  */
99
109
  renewToken(): Promise<void>;
110
+ private onLogout;
100
111
  private isPrePortal;
101
112
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthStorageService, never>;
102
113
  static ɵprov: i0.ɵɵInjectableDeclaration<AuthStorageService>;
@@ -4,12 +4,12 @@ import { LibCustomEnvironmentService } from '../custom/lib-custom-environment.se
4
4
  import { AuthStorageService } from '../storage/auth-storage.service';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class AuthUtilService {
7
- private router;
8
- private authStorageService;
9
- private checkUrlAndMethodService;
10
- private messageService;
7
+ private _authStorageService;
8
+ private _checkUrlAndMethodService;
11
9
  private _customEnvironmentService;
12
- constructor(router: Router, authStorageService: AuthStorageService, checkUrlAndMethodService: CheckUrlAndMethodService, messageService: MessageService, _customEnvironmentService: LibCustomEnvironmentService);
10
+ private _message;
11
+ private _router;
12
+ constructor(_authStorageService: AuthStorageService, _checkUrlAndMethodService: CheckUrlAndMethodService, _customEnvironmentService: LibCustomEnvironmentService, _message: MessageService, _router: Router);
13
13
  showHttpError(error: any): void;
14
14
  showHTTPErrorOS(error: any): void;
15
15
  private showExpiredAccess;
@@ -16,11 +16,14 @@ export declare class SubMenuCardComponent implements OnInit {
16
16
  private _authUtilService;
17
17
  private _customEnv;
18
18
  subMenuCards: NavSubmenuCards[];
19
- hostName: string;
20
- getExternalUrl: (url: string, isOutroModulo: boolean) => string;
19
+ hostnameOS: string;
20
+ hostnameV6: string;
21
+ getOutroModuloUrl: (url: string) => string;
22
+ getOutsystemsUrl: (url: string, isOutroModulo: boolean) => string;
21
23
  constructor(_menuService: MenuServicesService, _authUtilService: AuthUtilService, _customEnv: LibCustomEnvironmentService);
22
24
  ngOnInit(): void;
23
- GetHostName(): void;
25
+ GetHostNameOS(): void;
26
+ GetHostNameV6(): void;
24
27
  static ɵfac: i0.ɵɵFactoryDeclaration<SubMenuCardComponent, never>;
25
28
  static ɵcmp: i0.ɵɵComponentDeclaration<SubMenuCardComponent, "sub-menu-card, lib-submenu-card", never, { "subMenuCards": { "alias": "subMenuCards"; "required": false; }; }, {}, never, never, true, never>;
26
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-sp-auth",
3
- "version": "4.22.5",
3
+ "version": "4.22.7",
4
4
  "description": "Biblioteca de utilitários de autenticação.",
5
5
  "author": "P&D",
6
6
  "keywords": [