@adatechnology/auth-keycloak 0.0.1 → 0.0.2

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,7 +1,10 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ import { AxiosRequestConfig, AxiosInstance } from 'axios';
3
+
1
4
  /**
2
5
  * Keycloak token response
3
6
  */
4
- export interface KeycloakTokenResponse {
7
+ interface KeycloakTokenResponse {
5
8
  access_token: string;
6
9
  expires_in: number;
7
10
  refresh_expires_in: number;
@@ -14,7 +17,7 @@ export interface KeycloakTokenResponse {
14
17
  /**
15
18
  * Keycloak client credentials
16
19
  */
17
- export interface KeycloakCredentials {
20
+ interface KeycloakCredentials {
18
21
  clientId: string;
19
22
  clientSecret: string;
20
23
  username?: string;
@@ -24,7 +27,7 @@ export interface KeycloakCredentials {
24
27
  /**
25
28
  * Keycloak configuration
26
29
  */
27
- export interface KeycloakConfig {
30
+ interface KeycloakConfig {
28
31
  baseUrl: string;
29
32
  realm: string;
30
33
  credentials: KeycloakCredentials;
@@ -32,7 +35,7 @@ export interface KeycloakConfig {
32
35
  /**
33
36
  * Keycloak client interface
34
37
  */
35
- export interface KeycloakClientInterface {
38
+ interface KeycloakClientInterface {
36
39
  /**
37
40
  * Get access token
38
41
  */
@@ -50,3 +53,13 @@ export interface KeycloakClientInterface {
50
53
  */
51
54
  getUserInfo(token: string): Promise<any>;
52
55
  }
56
+
57
+ declare class KeycloakModule {
58
+ static forRoot(config: KeycloakConfig, httpConfig?: AxiosRequestConfig | AxiosInstance): DynamicModule;
59
+ }
60
+
61
+ declare const KEYCLOAK_CONFIG = "KEYCLOAK_CONFIG";
62
+ declare const KEYCLOAK_CLIENT = "KEYCLOAK_CLIENT";
63
+ declare const KEYCLOAK_HTTP_INTERCEPTOR = "KEYCLOAK_HTTP_INTERCEPTOR";
64
+
65
+ export { KEYCLOAK_CLIENT, KEYCLOAK_CONFIG, KEYCLOAK_HTTP_INTERCEPTOR, type KeycloakClientInterface, type KeycloakConfig, KeycloakModule, type KeycloakTokenResponse };
package/dist/index.d.ts CHANGED
@@ -62,4 +62,4 @@ declare const KEYCLOAK_CONFIG = "KEYCLOAK_CONFIG";
62
62
  declare const KEYCLOAK_CLIENT = "KEYCLOAK_CLIENT";
63
63
  declare const KEYCLOAK_HTTP_INTERCEPTOR = "KEYCLOAK_HTTP_INTERCEPTOR";
64
64
 
65
- export { KEYCLOAK_CLIENT, KEYCLOAK_CONFIG, KEYCLOAK_HTTP_INTERCEPTOR, KeycloakClientInterface, KeycloakConfig, KeycloakModule, KeycloakTokenResponse };
65
+ export { KEYCLOAK_CLIENT, KEYCLOAK_CONFIG, KEYCLOAK_HTTP_INTERCEPTOR, type KeycloakClientInterface, type KeycloakConfig, KeycloakModule, type KeycloakTokenResponse };