@luizleon/sf.prefeiturasp.vuecomponents 4.1.11 → 4.1.13

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.
@@ -1,6 +1,10 @@
1
- import { default as Keycloak, KeycloakInitOptions } from '../keycloak';
1
+ import { default as Keycloak, KeycloakConfig, KeycloakInitOptions } from '../keycloak';
2
+ export declare class KeycloakInstance extends Keycloak {
3
+ constructor(config: KeycloakConfig);
4
+ GetAccessTokenAsync(): any;
5
+ }
2
6
  interface IAuthService {
3
- Instance: Keycloak;
7
+ Instance: KeycloakInstance;
4
8
  InitAsync: (initOptions?: KeycloakInitOptions) => Promise<boolean>;
5
9
  isAuthenticated: boolean;
6
10
  userinfo: Record<string, any> | null;
@@ -1,15 +1,13 @@
1
- import { AxiosInstance, AxiosResponse } from 'axios';
1
+ import { AxiosInstance, AxiosResponse, CreateAxiosDefaults } from 'axios';
2
2
  import { AppResult } from '../common/appResult';
3
+ interface ApiClientOptions {
4
+ config?: CreateAxiosDefaults;
5
+ anonymous?: boolean;
6
+ }
3
7
  declare class ApiClient {
4
- constructor(baseUrl?: string);
5
- private axios;
6
- private authService;
7
- /**
8
- * Retorna a instância do axios.
9
- * @param idempotent Se 'true', retorna sempre a mesma instância, com todas as configurações. Este é o valor padrão. Se 'false', retorna uma nova instância.
10
- */
11
- GetAxios(idempotent?: boolean): AxiosInstance;
12
- GetAccessToken(): Promise<any>;
8
+ constructor(options?: ApiClientOptions);
9
+ axios: AxiosInstance;
10
+ GetAccessTokenAsync(): Promise<any>;
13
11
  GetAsync<T>(url: string): Promise<AppResult<T>>;
14
12
  PostAsync<T>(url: string, data: any): Promise<AppResult<T>>;
15
13
  PutAsync<T>(url: string, data: any): Promise<AppResult<T>>;
@@ -28,12 +26,5 @@ declare class ApiClient {
28
26
  HandleCatch<T>(e: any): AppResult<T>;
29
27
  private ParsedResponse;
30
28
  }
31
- /**
32
- * Retorna uma instância de ApiClient.
33
- * Por padrão, a URL base é a URL onde a aplicação está hospedada + '/api'.
34
- * Para alterar a URL base, passe a URL como parâmetro.
35
- * @param baseURL
36
- * @returns
37
- */
38
- declare const UseApiClient: (baseURL?: string) => ApiClient;
29
+ declare const UseApiClient: (options?: ApiClientOptions) => ApiClient;
39
30
  export { ApiClient, UseApiClient };
@@ -2,6 +2,7 @@ import { KeycloakConfig, KeycloakInitOptions } from '../keycloak';
2
2
  import { IAuthService } from '../common/auth';
3
3
  declare const UseAuthService: () => {
4
4
  Instance: {
5
+ GetAccessTokenAsync: () => any;
5
6
  authenticated?: boolean | undefined;
6
7
  subject?: string | undefined;
7
8
  responseMode?: import('../keycloak').KeycloakResponseMode | undefined;