@dangl/angular-dangl-identity-client 6.2.0-beta0010 → 6.2.1-beta0010

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.
Files changed (31) hide show
  1. package/README.md +25 -0
  2. package/api-client.d.ts +178 -178
  3. package/dangl-identity.module.d.ts +6 -7
  4. package/{esm2020 → esm2022}/api-client.mjs +551 -551
  5. package/{esm2020 → esm2022}/dangl-angular-dangl-identity-client.mjs +4 -4
  6. package/esm2022/dangl-identity.module.mjs +30 -0
  7. package/{esm2020 → esm2022}/interceptors/dangl-identity-request-validator.mjs +1 -1
  8. package/{esm2020 → esm2022}/interceptors/jwt-interceptor.service.mjs +47 -47
  9. package/esm2022/messengers/authentication.messenger.mjs +170 -0
  10. package/{esm2020 → esm2022}/models/jwt-storage.mjs +1 -1
  11. package/{esm2020 → esm2022}/models/user-info.mjs +1 -1
  12. package/{esm2020 → esm2022}/public_api.mjs +11 -11
  13. package/{esm2020 → esm2022}/services/authentication.service.mjs +39 -39
  14. package/{esm2020 → esm2022}/services/jwt-token.service.mjs +101 -101
  15. package/{fesm2020 → fesm2022}/dangl-angular-dangl-identity-client.mjs +905 -873
  16. package/fesm2022/dangl-angular-dangl-identity-client.mjs.map +1 -0
  17. package/index.d.ts +5 -5
  18. package/interceptors/dangl-identity-request-validator.d.ts +4 -4
  19. package/interceptors/jwt-interceptor.service.d.ts +16 -16
  20. package/messengers/authentication.messenger.d.ts +28 -26
  21. package/models/jwt-storage.d.ts +5 -5
  22. package/models/user-info.d.ts +11 -11
  23. package/package.json +7 -13
  24. package/public_api.d.ts +8 -8
  25. package/services/authentication.service.d.ts +14 -14
  26. package/services/jwt-token.service.d.ts +28 -28
  27. package/esm2020/dangl-identity.module.mjs +0 -29
  28. package/esm2020/messengers/authentication.messenger.mjs +0 -146
  29. package/fesm2015/dangl-angular-dangl-identity-client.mjs +0 -896
  30. package/fesm2015/dangl-angular-dangl-identity-client.mjs.map +0 -1
  31. package/fesm2020/dangl-angular-dangl-identity-client.mjs.map +0 -1
package/README.md CHANGED
@@ -72,6 +72,31 @@ import { DanglIdentityModule } from '@dangl/angular-dangl-identity-client';
72
72
  export class AppModule { }
73
73
  ```
74
74
 
75
+ Other case we use configuration with DI-based approach and avoid module
76
+
77
+ Just provide the interceptor in your config file.
78
+ We use provider ```provideHttpClient()``` instead of ```HttpClientModule```
79
+ ```typescript
80
+ import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
81
+ import { JwtInterceptorService } from '@dangl/angular-dangl-identity-client';
82
+
83
+ export const appConfig: ApplicationConfig = {
84
+ providers: [
85
+ ...
86
+ provideHttpClient(withInterceptorsFromDi()),
87
+ {
88
+ provide: HTTP_INTERCEPTORS,
89
+ useClass: JwtInterceptorService,
90
+ multi: true
91
+ }
92
+ ]
93
+ };
94
+ ```
95
+ Then, in main.ts:
96
+ ```typescript
97
+ bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err));
98
+ ```
99
+
75
100
  ### Validate Requests for Including JWT Authorization Header
76
101
 
77
102
  By default, the provided `JwtInterceptorService` will attach JWT bearer tokens to all requests, if tokens are present.
package/api-client.d.ts CHANGED
@@ -1,178 +1,178 @@
1
- import { Observable } from 'rxjs';
2
- import { InjectionToken } from '@angular/core';
3
- import { HttpClient, HttpResponseBase } from '@angular/common/http';
4
- import * as i0 from "@angular/core";
5
- export declare const DANGL_IDENTITY_CLIENT_API_BASE_URL: InjectionToken<string>;
6
- export declare class DanglIdentityClient {
7
- private http;
8
- private baseUrl;
9
- protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
10
- constructor(http: HttpClient, baseUrl?: string);
11
- loginWithCookie(model: LoginPost, redirectUrl: string | null | undefined): Observable<void>;
12
- protected processLoginWithCookie(response: HttpResponseBase): Observable<void>;
13
- signOutWithSignInManager(): Observable<void>;
14
- protected processSignOutWithSignInManager(response: HttpResponseBase): Observable<void>;
15
- loginAndReturnToken(model: TokenLoginPost): Observable<TokenResponseGet>;
16
- protected processLoginAndReturnToken(response: HttpResponseBase): Observable<TokenResponseGet>;
17
- refreshToken(model: TokenRefreshPost): Observable<TokenResponseGet>;
18
- protected processRefreshToken(response: HttpResponseBase): Observable<TokenResponseGet>;
19
- register(registerModel: RegisterPost): Observable<void>;
20
- protected processRegister(response: HttpResponseBase): Observable<void>;
21
- requestPasswordReset(forgotPasswordModel: ForgotPasswordPost): Observable<void>;
22
- protected processRequestPasswordReset(response: HttpResponseBase): Observable<void>;
23
- getUserInfo(): Observable<UserInfoGet>;
24
- protected processGetUserInfo(response: HttpResponseBase): Observable<UserInfoGet>;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<DanglIdentityClient, [null, { optional: true; }]>;
26
- static ɵprov: i0.ɵɵInjectableDeclaration<DanglIdentityClient>;
27
- }
28
- export interface LoginPost {
29
- identifier: string;
30
- password: string;
31
- staySignedIn: boolean;
32
- }
33
- export interface TokenResponseGet {
34
- accessToken?: string | null;
35
- error?: string | null;
36
- errorDescription?: string | null;
37
- expiresIn: number;
38
- httpErrorReason?: string | null;
39
- httpStatusCode: HttpStatusCode;
40
- identityToken?: string | null;
41
- isError: boolean;
42
- refreshToken?: string | null;
43
- tokenType?: string | null;
44
- errorType: ResponseErrorType;
45
- }
46
- export declare enum HttpStatusCode {
47
- Continue = "Continue",
48
- SwitchingProtocols = "SwitchingProtocols",
49
- Processing = "Processing",
50
- EarlyHints = "EarlyHints",
51
- OK = "OK",
52
- Created = "Created",
53
- Accepted = "Accepted",
54
- NonAuthoritativeInformation = "NonAuthoritativeInformation",
55
- NoContent = "NoContent",
56
- ResetContent = "ResetContent",
57
- PartialContent = "PartialContent",
58
- MultiStatus = "MultiStatus",
59
- AlreadyReported = "AlreadyReported",
60
- IMUsed = "IMUsed",
61
- MultipleChoices = "MultipleChoices",
62
- Ambiguous = "MultipleChoices",
63
- MovedPermanently = "MovedPermanently",
64
- Moved = "MovedPermanently",
65
- Found = "Found",
66
- Redirect = "Found",
67
- SeeOther = "SeeOther",
68
- RedirectMethod = "SeeOther",
69
- NotModified = "NotModified",
70
- UseProxy = "UseProxy",
71
- Unused = "Unused",
72
- TemporaryRedirect = "TemporaryRedirect",
73
- RedirectKeepVerb = "TemporaryRedirect",
74
- PermanentRedirect = "PermanentRedirect",
75
- BadRequest = "BadRequest",
76
- Unauthorized = "Unauthorized",
77
- PaymentRequired = "PaymentRequired",
78
- Forbidden = "Forbidden",
79
- NotFound = "NotFound",
80
- MethodNotAllowed = "MethodNotAllowed",
81
- NotAcceptable = "NotAcceptable",
82
- ProxyAuthenticationRequired = "ProxyAuthenticationRequired",
83
- RequestTimeout = "RequestTimeout",
84
- Conflict = "Conflict",
85
- Gone = "Gone",
86
- LengthRequired = "LengthRequired",
87
- PreconditionFailed = "PreconditionFailed",
88
- RequestEntityTooLarge = "RequestEntityTooLarge",
89
- RequestUriTooLong = "RequestUriTooLong",
90
- UnsupportedMediaType = "UnsupportedMediaType",
91
- RequestedRangeNotSatisfiable = "RequestedRangeNotSatisfiable",
92
- ExpectationFailed = "ExpectationFailed",
93
- MisdirectedRequest = "MisdirectedRequest",
94
- UnprocessableEntity = "UnprocessableEntity",
95
- UnprocessableContent = "UnprocessableEntity",
96
- Locked = "Locked",
97
- FailedDependency = "FailedDependency",
98
- UpgradeRequired = "UpgradeRequired",
99
- PreconditionRequired = "PreconditionRequired",
100
- TooManyRequests = "TooManyRequests",
101
- RequestHeaderFieldsTooLarge = "RequestHeaderFieldsTooLarge",
102
- UnavailableForLegalReasons = "UnavailableForLegalReasons",
103
- InternalServerError = "InternalServerError",
104
- NotImplemented = "NotImplemented",
105
- BadGateway = "BadGateway",
106
- ServiceUnavailable = "ServiceUnavailable",
107
- GatewayTimeout = "GatewayTimeout",
108
- HttpVersionNotSupported = "HttpVersionNotSupported",
109
- VariantAlsoNegotiates = "VariantAlsoNegotiates",
110
- InsufficientStorage = "InsufficientStorage",
111
- LoopDetected = "LoopDetected",
112
- NotExtended = "NotExtended",
113
- NetworkAuthenticationRequired = "NetworkAuthenticationRequired"
114
- }
115
- /** Various reasons for a protocol endpoint error */
116
- export declare enum ResponseErrorType {
117
- None = "None",
118
- Protocol = "Protocol",
119
- Http = "Http",
120
- Exception = "Exception",
121
- PolicyViolation = "PolicyViolation"
122
- }
123
- export interface TokenLoginPost {
124
- identifier: string;
125
- password: string;
126
- }
127
- export interface TokenRefreshPost {
128
- refreshToken: string;
129
- }
130
- /** Data transfer class to convey api errors */
131
- export interface ApiError {
132
- /** This dictionary contains a set of all errors and their messages */
133
- errors?: {
134
- [key: string]: string[];
135
- } | null;
136
- }
137
- export interface RegisterPost {
138
- username: string;
139
- email: string;
140
- password: string;
141
- preferredLanguages?: string[] | null;
142
- serviceLoginRedirectUri?: string | null;
143
- }
144
- export interface ForgotPasswordPost {
145
- identifier: string;
146
- preferredLanguages?: string[] | null;
147
- serviceLoginRedirectUri?: string | null;
148
- }
149
- export interface UserInfoGet {
150
- userIsAuthenticated: boolean;
151
- clientIsAuthenticated: boolean;
152
- currentUserId?: string | null;
153
- currentUserIdenticonId?: string | null;
154
- currentUserName?: string | null;
155
- currentUserEmail?: string | null;
156
- currentClientId?: string | null;
157
- userClaims?: ClaimGet[] | null;
158
- clientClaims?: ClaimGet[] | null;
159
- }
160
- export interface ClaimGet {
161
- issuer?: string | null;
162
- type?: string | null;
163
- value?: string | null;
164
- }
165
- export declare class SwaggerException extends Error {
166
- message: string;
167
- status: number;
168
- response: string;
169
- headers: {
170
- [key: string]: any;
171
- };
172
- result: any;
173
- constructor(message: string, status: number, response: string, headers: {
174
- [key: string]: any;
175
- }, result: any);
176
- protected isSwaggerException: boolean;
177
- static isSwaggerException(obj: any): obj is SwaggerException;
178
- }
1
+ import { Observable } from 'rxjs';
2
+ import { InjectionToken } from '@angular/core';
3
+ import { HttpClient, HttpResponseBase } from '@angular/common/http';
4
+ import * as i0 from "@angular/core";
5
+ export declare const DANGL_IDENTITY_CLIENT_API_BASE_URL: InjectionToken<string>;
6
+ export declare class DanglIdentityClient {
7
+ private http;
8
+ private baseUrl;
9
+ protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
10
+ constructor(http: HttpClient, baseUrl?: string);
11
+ loginWithCookie(model: LoginPost, redirectUrl: string | null | undefined): Observable<void>;
12
+ protected processLoginWithCookie(response: HttpResponseBase): Observable<void>;
13
+ signOutWithSignInManager(): Observable<void>;
14
+ protected processSignOutWithSignInManager(response: HttpResponseBase): Observable<void>;
15
+ loginAndReturnToken(model: TokenLoginPost): Observable<TokenResponseGet>;
16
+ protected processLoginAndReturnToken(response: HttpResponseBase): Observable<TokenResponseGet>;
17
+ refreshToken(model: TokenRefreshPost): Observable<TokenResponseGet>;
18
+ protected processRefreshToken(response: HttpResponseBase): Observable<TokenResponseGet>;
19
+ register(registerModel: RegisterPost): Observable<void>;
20
+ protected processRegister(response: HttpResponseBase): Observable<void>;
21
+ requestPasswordReset(forgotPasswordModel: ForgotPasswordPost): Observable<void>;
22
+ protected processRequestPasswordReset(response: HttpResponseBase): Observable<void>;
23
+ getUserInfo(): Observable<UserInfoGet>;
24
+ protected processGetUserInfo(response: HttpResponseBase): Observable<UserInfoGet>;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DanglIdentityClient, [null, { optional: true; }]>;
26
+ static ɵprov: i0.ɵɵInjectableDeclaration<DanglIdentityClient>;
27
+ }
28
+ export interface LoginPost {
29
+ identifier: string;
30
+ password: string;
31
+ staySignedIn: boolean;
32
+ }
33
+ export interface TokenResponseGet {
34
+ accessToken?: string | null;
35
+ error?: string | null;
36
+ errorDescription?: string | null;
37
+ expiresIn: number;
38
+ httpErrorReason?: string | null;
39
+ httpStatusCode: HttpStatusCode;
40
+ identityToken?: string | null;
41
+ isError: boolean;
42
+ refreshToken?: string | null;
43
+ tokenType?: string | null;
44
+ errorType: ResponseErrorType;
45
+ }
46
+ export declare enum HttpStatusCode {
47
+ Continue = "Continue",
48
+ SwitchingProtocols = "SwitchingProtocols",
49
+ Processing = "Processing",
50
+ EarlyHints = "EarlyHints",
51
+ OK = "OK",
52
+ Created = "Created",
53
+ Accepted = "Accepted",
54
+ NonAuthoritativeInformation = "NonAuthoritativeInformation",
55
+ NoContent = "NoContent",
56
+ ResetContent = "ResetContent",
57
+ PartialContent = "PartialContent",
58
+ MultiStatus = "MultiStatus",
59
+ AlreadyReported = "AlreadyReported",
60
+ IMUsed = "IMUsed",
61
+ MultipleChoices = "MultipleChoices",
62
+ Ambiguous = "MultipleChoices",
63
+ MovedPermanently = "MovedPermanently",
64
+ Moved = "MovedPermanently",
65
+ Found = "Found",
66
+ Redirect = "Found",
67
+ SeeOther = "SeeOther",
68
+ RedirectMethod = "SeeOther",
69
+ NotModified = "NotModified",
70
+ UseProxy = "UseProxy",
71
+ Unused = "Unused",
72
+ TemporaryRedirect = "TemporaryRedirect",
73
+ RedirectKeepVerb = "TemporaryRedirect",
74
+ PermanentRedirect = "PermanentRedirect",
75
+ BadRequest = "BadRequest",
76
+ Unauthorized = "Unauthorized",
77
+ PaymentRequired = "PaymentRequired",
78
+ Forbidden = "Forbidden",
79
+ NotFound = "NotFound",
80
+ MethodNotAllowed = "MethodNotAllowed",
81
+ NotAcceptable = "NotAcceptable",
82
+ ProxyAuthenticationRequired = "ProxyAuthenticationRequired",
83
+ RequestTimeout = "RequestTimeout",
84
+ Conflict = "Conflict",
85
+ Gone = "Gone",
86
+ LengthRequired = "LengthRequired",
87
+ PreconditionFailed = "PreconditionFailed",
88
+ RequestEntityTooLarge = "RequestEntityTooLarge",
89
+ RequestUriTooLong = "RequestUriTooLong",
90
+ UnsupportedMediaType = "UnsupportedMediaType",
91
+ RequestedRangeNotSatisfiable = "RequestedRangeNotSatisfiable",
92
+ ExpectationFailed = "ExpectationFailed",
93
+ MisdirectedRequest = "MisdirectedRequest",
94
+ UnprocessableEntity = "UnprocessableEntity",
95
+ UnprocessableContent = "UnprocessableEntity",
96
+ Locked = "Locked",
97
+ FailedDependency = "FailedDependency",
98
+ UpgradeRequired = "UpgradeRequired",
99
+ PreconditionRequired = "PreconditionRequired",
100
+ TooManyRequests = "TooManyRequests",
101
+ RequestHeaderFieldsTooLarge = "RequestHeaderFieldsTooLarge",
102
+ UnavailableForLegalReasons = "UnavailableForLegalReasons",
103
+ InternalServerError = "InternalServerError",
104
+ NotImplemented = "NotImplemented",
105
+ BadGateway = "BadGateway",
106
+ ServiceUnavailable = "ServiceUnavailable",
107
+ GatewayTimeout = "GatewayTimeout",
108
+ HttpVersionNotSupported = "HttpVersionNotSupported",
109
+ VariantAlsoNegotiates = "VariantAlsoNegotiates",
110
+ InsufficientStorage = "InsufficientStorage",
111
+ LoopDetected = "LoopDetected",
112
+ NotExtended = "NotExtended",
113
+ NetworkAuthenticationRequired = "NetworkAuthenticationRequired"
114
+ }
115
+ /** Various reasons for a protocol endpoint error */
116
+ export declare enum ResponseErrorType {
117
+ None = "None",
118
+ Protocol = "Protocol",
119
+ Http = "Http",
120
+ Exception = "Exception",
121
+ PolicyViolation = "PolicyViolation"
122
+ }
123
+ export interface TokenLoginPost {
124
+ identifier: string;
125
+ password: string;
126
+ }
127
+ export interface TokenRefreshPost {
128
+ refreshToken: string;
129
+ }
130
+ /** Data transfer class to convey api errors */
131
+ export interface ApiError {
132
+ /** This dictionary contains a set of all errors and their messages */
133
+ errors?: {
134
+ [key: string]: string[];
135
+ } | null;
136
+ }
137
+ export interface RegisterPost {
138
+ username: string;
139
+ email: string;
140
+ password: string;
141
+ preferredLanguages?: string[] | null;
142
+ serviceLoginRedirectUri?: string | null;
143
+ }
144
+ export interface ForgotPasswordPost {
145
+ identifier: string;
146
+ preferredLanguages?: string[] | null;
147
+ serviceLoginRedirectUri?: string | null;
148
+ }
149
+ export interface UserInfoGet {
150
+ userIsAuthenticated: boolean;
151
+ clientIsAuthenticated: boolean;
152
+ currentUserId?: string | null;
153
+ currentUserIdenticonId?: string | null;
154
+ currentUserName?: string | null;
155
+ currentUserEmail?: string | null;
156
+ currentClientId?: string | null;
157
+ userClaims?: ClaimGet[] | null;
158
+ clientClaims?: ClaimGet[] | null;
159
+ }
160
+ export interface ClaimGet {
161
+ issuer?: string | null;
162
+ type?: string | null;
163
+ value?: string | null;
164
+ }
165
+ export declare class SwaggerException extends Error {
166
+ message: string;
167
+ status: number;
168
+ response: string;
169
+ headers: {
170
+ [key: string]: any;
171
+ };
172
+ result: any;
173
+ constructor(message: string, status: number, response: string, headers: {
174
+ [key: string]: any;
175
+ }, result: any);
176
+ protected isSwaggerException: boolean;
177
+ static isSwaggerException(obj: any): obj is SwaggerException;
178
+ }
@@ -1,7 +1,6 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/common/http";
3
- export declare class DanglIdentityModule {
4
- static ɵfac: i0.ɵɵFactoryDeclaration<DanglIdentityModule, never>;
5
- static ɵmod: i0.ɵɵNgModuleDeclaration<DanglIdentityModule, never, [typeof i1.HttpClientModule], never>;
6
- static ɵinj: i0.ɵɵInjectorDeclaration<DanglIdentityModule>;
7
- }
1
+ import * as i0 from "@angular/core";
2
+ export declare class DanglIdentityModule {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<DanglIdentityModule, never>;
4
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DanglIdentityModule, never, never, never>;
5
+ static ɵinj: i0.ɵɵInjectorDeclaration<DanglIdentityModule>;
6
+ }