@rxap/authentication 22.0.0-dev.1 → 22.0.0-dev.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.
- package/CHANGELOG.md +16 -0
- package/README.md +5 -3
- package/compodoc/changelog.html +15 -0
- package/compodoc/dependencies.html +1 -1
- package/compodoc/index.html +4 -3
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/llms.txt +3 -1
- package/compodoc/miscellaneous/functions.html +81 -0
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +93 -69
- package/docs/html/classes/AuthenticationRoutingService.html +5 -5
- package/docs/html/classes/DisabledAuthenticationService.html +8 -8
- package/docs/html/classes/RegisterService.html +6 -6
- package/docs/html/classes/RxapAuthenticationGuard.html +9 -9
- package/docs/html/classes/RxapAuthenticationService.html +9 -9
- package/docs/html/classes/SignOutDirective.html +7 -7
- package/docs/html/enums/AuthenticationEventType.html +7 -7
- package/docs/html/functions/BearerTokenInterceptor.html +4 -4
- package/docs/html/functions/provideAuthentication.html +4 -4
- package/docs/html/functions/withDisabledAuthentication.html +4 -4
- package/docs/html/functions/withInitialAuthenticationState.html +4 -4
- package/docs/html/hierarchy.html +4 -4
- package/docs/html/index.html +8 -7
- package/docs/html/interfaces/AuthenticationAccessToken.html +6 -6
- package/docs/html/interfaces/AuthenticationEvent.html +5 -5
- package/docs/html/interfaces/IAuthenticationService.html +8 -8
- package/docs/html/modules.html +4 -4
- package/docs/html/variables/RXAP_AUTHENTICATION_ACCESS_TOKEN.html +4 -4
- package/docs/html/variables/RXAP_AUTHENTICATION_DEACTIVATED.html +4 -4
- package/docs/html/variables/RXAP_INITIAL_AUTHENTICATION_STATE.html +4 -4
- package/docs/markdown/README.md +6 -4
- package/docs/markdown/classes/AuthenticationRoutingService.md +3 -3
- package/docs/markdown/classes/DisabledAuthenticationService.md +6 -6
- package/docs/markdown/classes/RegisterService.md +4 -4
- package/docs/markdown/classes/RxapAuthenticationGuard.md +7 -7
- package/docs/markdown/classes/RxapAuthenticationService.md +7 -7
- package/docs/markdown/classes/SignOutDirective.md +5 -5
- package/docs/markdown/enumerations/AuthenticationEventType.md +5 -5
- package/docs/markdown/functions/BearerTokenInterceptor.md +2 -2
- package/docs/markdown/functions/provideAuthentication.md +2 -2
- package/docs/markdown/functions/withDisabledAuthentication.md +2 -2
- package/docs/markdown/functions/withInitialAuthenticationState.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/interfaces/AuthenticationAccessToken.md +4 -4
- package/docs/markdown/interfaces/AuthenticationEvent.md +3 -3
- package/docs/markdown/interfaces/IAuthenticationService.md +6 -6
- package/docs/markdown/variables/RXAP_AUTHENTICATION_ACCESS_TOKEN.md +2 -2
- package/docs/markdown/variables/RXAP_AUTHENTICATION_DEACTIVATED.md +2 -2
- package/docs/markdown/variables/RXAP_INITIAL_AUTHENTICATION_STATE.md +2 -2
- package/docs/wiki/Class.AuthenticationRoutingService.md +2 -2
- package/docs/wiki/Class.DisabledAuthenticationService.md +5 -5
- package/docs/wiki/Class.RegisterService.md +3 -3
- package/docs/wiki/Class.RxapAuthenticationGuard.md +6 -6
- package/docs/wiki/Class.RxapAuthenticationService.md +6 -6
- package/docs/wiki/Class.SignOutDirective.md +4 -4
- package/docs/wiki/Enumeration.AuthenticationEventType.md +4 -4
- package/docs/wiki/Function.BearerTokenInterceptor.md +1 -1
- package/docs/wiki/Function.provideAuthentication.md +1 -1
- package/docs/wiki/Function.withDisabledAuthentication.md +1 -1
- package/docs/wiki/Function.withInitialAuthenticationState.md +1 -1
- package/docs/wiki/Home.md +5 -3
- package/docs/wiki/Interface.AuthenticationAccessToken.md +3 -3
- package/docs/wiki/Interface.AuthenticationEvent.md +2 -2
- package/docs/wiki/Interface.IAuthenticationService.md +5 -5
- package/docs/wiki/Variable.RXAP_AUTHENTICATION_ACCESS_TOKEN.md +1 -1
- package/docs/wiki/Variable.RXAP_AUTHENTICATION_DEACTIVATED.md +1 -1
- package/docs/wiki/Variable.RXAP_INITIAL_AUTHENTICATION_STATE.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/generators.json +16 -0
- package/package.json +6 -8
- package/src/generators/init/generator.js +120 -0
- package/src/generators/init/index.js +6 -0
- package/src/generators/init/schema.json +8 -0
- package/src/generators/package.json +3 -0
- package/compodoc/js/libs/vis.min.js +0 -47
- package/compodoc/js/menu-wc_es5.js +0 -40
- package/theme.css +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: RegisterService
|
|
4
4
|
|
|
5
|
-
Defined in: [register.service.ts:5](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [register.service.ts:5](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/register.service.ts#L5)
|
|
6
6
|
|
|
7
7
|
## Constructors
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Defined in: [register.service.ts:5](https://gitlab.com/rxap/packages/-/blob/947f
|
|
|
10
10
|
|
|
11
11
|
> **new RegisterService**(): `RegisterService`
|
|
12
12
|
|
|
13
|
-
Defined in: [register.service.ts:7](https://gitlab.com/rxap/packages/-/blob/
|
|
13
|
+
Defined in: [register.service.ts:7](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/register.service.ts#L7)
|
|
14
14
|
|
|
15
15
|
#### Returns
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@ Defined in: [register.service.ts:7](https://gitlab.com/rxap/packages/-/blob/947f
|
|
|
22
22
|
|
|
23
23
|
> **register**(`email`, `password`): `Promise`\<`boolean`\>
|
|
24
24
|
|
|
25
|
-
Defined in: [register.service.ts:11](https://gitlab.com/rxap/packages/-/blob/
|
|
25
|
+
Defined in: [register.service.ts:11](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/register.service.ts#L11)
|
|
26
26
|
|
|
27
27
|
#### Parameters
|
|
28
28
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: RxapAuthenticationGuard
|
|
4
4
|
|
|
5
|
-
Defined in: [authentication.guard.ts:12](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [authentication.guard.ts:12](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.guard.ts#L12)
|
|
6
6
|
|
|
7
7
|
## Constructors
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ Defined in: [authentication.guard.ts:12](https://gitlab.com/rxap/packages/-/blob
|
|
|
20
20
|
|
|
21
21
|
> **authentication**: [`RxapAuthenticationService`](../wiki/Class.RxapAuthenticationService)
|
|
22
22
|
|
|
23
|
-
Defined in: [authentication.guard.ts:13](https://gitlab.com/rxap/packages/-/blob/
|
|
23
|
+
Defined in: [authentication.guard.ts:13](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.guard.ts#L13)
|
|
24
24
|
|
|
25
25
|
***
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ Defined in: [authentication.guard.ts:13](https://gitlab.com/rxap/packages/-/blob
|
|
|
28
28
|
|
|
29
29
|
> **lastUrl**: `string` \| `null` = `null`
|
|
30
30
|
|
|
31
|
-
Defined in: [authentication.guard.ts:18](https://gitlab.com/rxap/packages/-/blob/
|
|
31
|
+
Defined in: [authentication.guard.ts:18](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.guard.ts#L18)
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ Defined in: [authentication.guard.ts:18](https://gitlab.com/rxap/packages/-/blob
|
|
|
36
36
|
|
|
37
37
|
> **router**: `Router`
|
|
38
38
|
|
|
39
|
-
Defined in: [authentication.guard.ts:14](https://gitlab.com/rxap/packages/-/blob/
|
|
39
|
+
Defined in: [authentication.guard.ts:14](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.guard.ts#L14)
|
|
40
40
|
|
|
41
41
|
## Methods
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ Defined in: [authentication.guard.ts:14](https://gitlab.com/rxap/packages/-/blob
|
|
|
44
44
|
|
|
45
45
|
> **canActivate**(`route`, `state`): `Promise`\<`boolean` \| `UrlTree`\>
|
|
46
46
|
|
|
47
|
-
Defined in: [authentication.guard.ts:20](https://gitlab.com/rxap/packages/-/blob/
|
|
47
|
+
Defined in: [authentication.guard.ts:20](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.guard.ts#L20)
|
|
48
48
|
|
|
49
49
|
#### Parameters
|
|
50
50
|
|
|
@@ -66,7 +66,7 @@ Defined in: [authentication.guard.ts:20](https://gitlab.com/rxap/packages/-/blob
|
|
|
66
66
|
|
|
67
67
|
> **canActivateChild**(`childRoute`, `state`): `Promise`\<`boolean` \| `UrlTree`\>
|
|
68
68
|
|
|
69
|
-
Defined in: [authentication.guard.ts:28](https://gitlab.com/rxap/packages/-/blob/
|
|
69
|
+
Defined in: [authentication.guard.ts:28](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.guard.ts#L28)
|
|
70
70
|
|
|
71
71
|
#### Parameters
|
|
72
72
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: RxapAuthenticationService
|
|
4
4
|
|
|
5
|
-
Defined in: [authentication.service.ts:31](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [authentication.service.ts:31](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L31)
|
|
6
6
|
|
|
7
7
|
## Implements
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ Defined in: [authentication.service.ts:31](https://gitlab.com/rxap/packages/-/bl
|
|
|
14
14
|
|
|
15
15
|
> **new RxapAuthenticationService**(): `RxapAuthenticationService`
|
|
16
16
|
|
|
17
|
-
Defined in: [authentication.service.ts:39](https://gitlab.com/rxap/packages/-/blob/
|
|
17
|
+
Defined in: [authentication.service.ts:39](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L39)
|
|
18
18
|
|
|
19
19
|
#### Returns
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ Defined in: [authentication.service.ts:39](https://gitlab.com/rxap/packages/-/bl
|
|
|
26
26
|
|
|
27
27
|
> `readonly` **events$**: `ReplaySubject`\<[`AuthenticationEvent`](../wiki/Interface.AuthenticationEvent)\>
|
|
28
28
|
|
|
29
|
-
Defined in: [authentication.service.ts:35](https://gitlab.com/rxap/packages/-/blob/
|
|
29
|
+
Defined in: [authentication.service.ts:35](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L35)
|
|
30
30
|
|
|
31
31
|
#### Implementation of
|
|
32
32
|
|
|
@@ -38,7 +38,7 @@ Defined in: [authentication.service.ts:35](https://gitlab.com/rxap/packages/-/bl
|
|
|
38
38
|
|
|
39
39
|
> **isAuthenticated$**: `BehaviorSubject`\<`boolean` \| `null`\>
|
|
40
40
|
|
|
41
|
-
Defined in: [authentication.service.ts:33](https://gitlab.com/rxap/packages/-/blob/
|
|
41
|
+
Defined in: [authentication.service.ts:33](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L33)
|
|
42
42
|
|
|
43
43
|
#### Implementation of
|
|
44
44
|
|
|
@@ -50,7 +50,7 @@ Defined in: [authentication.service.ts:33](https://gitlab.com/rxap/packages/-/bl
|
|
|
50
50
|
|
|
51
51
|
> **isAuthenticated**(): `Promise`\<`boolean`\>
|
|
52
52
|
|
|
53
|
-
Defined in: [authentication.service.ts:49](https://gitlab.com/rxap/packages/-/blob/
|
|
53
|
+
Defined in: [authentication.service.ts:49](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L49)
|
|
54
54
|
|
|
55
55
|
#### Returns
|
|
56
56
|
|
|
@@ -66,7 +66,7 @@ Defined in: [authentication.service.ts:49](https://gitlab.com/rxap/packages/-/bl
|
|
|
66
66
|
|
|
67
67
|
> **signOut**(): `Promise`\<`void`\>
|
|
68
68
|
|
|
69
|
-
Defined in: [authentication.service.ts:43](https://gitlab.com/rxap/packages/-/blob/
|
|
69
|
+
Defined in: [authentication.service.ts:43](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L43)
|
|
70
70
|
|
|
71
71
|
#### Returns
|
|
72
72
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: SignOutDirective
|
|
4
4
|
|
|
5
|
-
Defined in: [sign-out.directive.ts:22](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [sign-out.directive.ts:22](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/sign-out.directive.ts#L22)
|
|
6
6
|
|
|
7
7
|
## Constructors
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@ Defined in: [sign-out.directive.ts:22](https://gitlab.com/rxap/packages/-/blob/9
|
|
|
20
20
|
|
|
21
21
|
> `readonly` **failure**: `OutputEmitterRef`\<`Error`\>
|
|
22
22
|
|
|
23
|
-
Defined in: [sign-out.directive.ts:28](https://gitlab.com/rxap/packages/-/blob/
|
|
23
|
+
Defined in: [sign-out.directive.ts:28](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/sign-out.directive.ts#L28)
|
|
24
24
|
|
|
25
25
|
***
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ Defined in: [sign-out.directive.ts:28](https://gitlab.com/rxap/packages/-/blob/9
|
|
|
28
28
|
|
|
29
29
|
> `readonly` **successful**: `OutputEmitterRef`\<`void`\>
|
|
30
30
|
|
|
31
|
-
Defined in: [sign-out.directive.ts:26](https://gitlab.com/rxap/packages/-/blob/
|
|
31
|
+
Defined in: [sign-out.directive.ts:26](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/sign-out.directive.ts#L26)
|
|
32
32
|
|
|
33
33
|
## Methods
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ Defined in: [sign-out.directive.ts:26](https://gitlab.com/rxap/packages/-/blob/9
|
|
|
36
36
|
|
|
37
37
|
> **onClick**(): `Promise`\<`void`\>
|
|
38
38
|
|
|
39
|
-
Defined in: [sign-out.directive.ts:30](https://gitlab.com/rxap/packages/-/blob/
|
|
39
|
+
Defined in: [sign-out.directive.ts:30](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/sign-out.directive.ts#L30)
|
|
40
40
|
|
|
41
41
|
#### Returns
|
|
42
42
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Enumeration: AuthenticationEventType
|
|
4
4
|
|
|
5
|
-
Defined in: [authentication.service.ts:20](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [authentication.service.ts:20](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L20)
|
|
6
6
|
|
|
7
7
|
## Enumeration Members
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Defined in: [authentication.service.ts:20](https://gitlab.com/rxap/packages/-/bl
|
|
|
10
10
|
|
|
11
11
|
> **OnAuthError**: `"on-auth-error"`
|
|
12
12
|
|
|
13
|
-
Defined in: [authentication.service.ts:22](https://gitlab.com/rxap/packages/-/blob/
|
|
13
|
+
Defined in: [authentication.service.ts:22](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L22)
|
|
14
14
|
|
|
15
15
|
***
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ Defined in: [authentication.service.ts:22](https://gitlab.com/rxap/packages/-/bl
|
|
|
18
18
|
|
|
19
19
|
> **OnAuthSuccess**: `"on-auth-success"`
|
|
20
20
|
|
|
21
|
-
Defined in: [authentication.service.ts:21](https://gitlab.com/rxap/packages/-/blob/
|
|
21
|
+
Defined in: [authentication.service.ts:21](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L21)
|
|
22
22
|
|
|
23
23
|
***
|
|
24
24
|
|
|
@@ -26,4 +26,4 @@ Defined in: [authentication.service.ts:21](https://gitlab.com/rxap/packages/-/bl
|
|
|
26
26
|
|
|
27
27
|
> **OnLogout**: `"on-logout"`
|
|
28
28
|
|
|
29
|
-
Defined in: [authentication.service.ts:23](https://gitlab.com/rxap/packages/-/blob/
|
|
29
|
+
Defined in: [authentication.service.ts:23](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L23)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **BearerTokenInterceptor**(`req`, `next`): `Observable`\<`HttpEvent`\<`unknown`\>\>
|
|
6
6
|
|
|
7
|
-
Defined in: [bearer-token.interceptor.ts:10](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [bearer-token.interceptor.ts:10](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/bearer-token.interceptor.ts#L10)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **provideAuthentication**(`service`, ...`additionalProviders`): `Provider`[]
|
|
6
6
|
|
|
7
|
-
Defined in: [provide.ts:9](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [provide.ts:9](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/provide.ts#L9)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **withDisabledAuthentication**(`disabled?`): `Provider`
|
|
6
6
|
|
|
7
|
-
Defined in: [tokens.ts:27](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [tokens.ts:27](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/tokens.ts#L27)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **withInitialAuthenticationState**(`state`): `Provider`
|
|
6
6
|
|
|
7
|
-
Defined in: [provide.ts:22](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [provide.ts:22](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/provide.ts#L22)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
package/docs/wiki/Home.md
CHANGED
|
@@ -15,15 +15,17 @@ Provides authentication services, guards, and interceptors for Angular applicati
|
|
|
15
15
|
|
|
16
16
|
**Add the package to your workspace:**
|
|
17
17
|
```bash
|
|
18
|
-
|
|
18
|
+
npm install @rxap/authentication
|
|
19
19
|
```
|
|
20
|
+
With pnpm or yarn use `pnpm add` or `yarn add` instead of `npm install`.
|
|
21
|
+
|
|
20
22
|
**Install peer dependencies:**
|
|
21
23
|
```bash
|
|
22
|
-
|
|
24
|
+
npm install @angular/common @angular/core @angular/router @rxap/utilities rxjs
|
|
23
25
|
```
|
|
24
26
|
**Execute the init generator:**
|
|
25
27
|
```bash
|
|
26
|
-
|
|
28
|
+
nx g @rxap/authentication:init
|
|
27
29
|
```
|
|
28
30
|
# Generators
|
|
29
31
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: AuthenticationAccessToken
|
|
4
4
|
|
|
5
|
-
Defined in: [tokens.ts:9](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [tokens.ts:9](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/tokens.ts#L9)
|
|
6
6
|
|
|
7
7
|
## Extends
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ Defined in: [tokens.ts:9](https://gitlab.com/rxap/packages/-/blob/947fa470d88061
|
|
|
18
18
|
|
|
19
19
|
> **token**: `string`
|
|
20
20
|
|
|
21
|
-
Defined in: [tokens.ts:10](https://gitlab.com/rxap/packages/-/blob/
|
|
21
|
+
Defined in: [tokens.ts:10](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/tokens.ts#L10)
|
|
22
22
|
|
|
23
23
|
***
|
|
24
24
|
|
|
@@ -26,4 +26,4 @@ Defined in: [tokens.ts:10](https://gitlab.com/rxap/packages/-/blob/947fa470d8806
|
|
|
26
26
|
|
|
27
27
|
> `optional` **valid?**: `boolean`
|
|
28
28
|
|
|
29
|
-
Defined in: [tokens.ts:11](https://gitlab.com/rxap/packages/-/blob/
|
|
29
|
+
Defined in: [tokens.ts:11](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/tokens.ts#L11)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: AuthenticationEvent
|
|
4
4
|
|
|
5
|
-
Defined in: [authentication.service.ts:26](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [authentication.service.ts:26](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L26)
|
|
6
6
|
|
|
7
7
|
## Extends
|
|
8
8
|
|
|
@@ -18,4 +18,4 @@ Defined in: [authentication.service.ts:26](https://gitlab.com/rxap/packages/-/bl
|
|
|
18
18
|
|
|
19
19
|
> **type**: [`AuthenticationEventType`](../wiki/Enumeration.AuthenticationEventType)
|
|
20
20
|
|
|
21
|
-
Defined in: [authentication.service.ts:27](https://gitlab.com/rxap/packages/-/blob/
|
|
21
|
+
Defined in: [authentication.service.ts:27](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L27)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: IAuthenticationService
|
|
4
4
|
|
|
5
|
-
Defined in: [authentication.service.ts:12](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [authentication.service.ts:12](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L12)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Defined in: [authentication.service.ts:12](https://gitlab.com/rxap/packages/-/bl
|
|
|
10
10
|
|
|
11
11
|
> **events$**: `Observable`\<[`AuthenticationEvent`](../wiki/Interface.AuthenticationEvent)\>
|
|
12
12
|
|
|
13
|
-
Defined in: [authentication.service.ts:14](https://gitlab.com/rxap/packages/-/blob/
|
|
13
|
+
Defined in: [authentication.service.ts:14](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L14)
|
|
14
14
|
|
|
15
15
|
***
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ Defined in: [authentication.service.ts:14](https://gitlab.com/rxap/packages/-/bl
|
|
|
18
18
|
|
|
19
19
|
> **isAuthenticated$**: `Observable`\<`boolean` \| `null`\>
|
|
20
20
|
|
|
21
|
-
Defined in: [authentication.service.ts:13](https://gitlab.com/rxap/packages/-/blob/
|
|
21
|
+
Defined in: [authentication.service.ts:13](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L13)
|
|
22
22
|
|
|
23
23
|
## Methods
|
|
24
24
|
|
|
@@ -26,7 +26,7 @@ Defined in: [authentication.service.ts:13](https://gitlab.com/rxap/packages/-/bl
|
|
|
26
26
|
|
|
27
27
|
> **isAuthenticated**(): `Promise`\<`boolean`\>
|
|
28
28
|
|
|
29
|
-
Defined in: [authentication.service.ts:17](https://gitlab.com/rxap/packages/-/blob/
|
|
29
|
+
Defined in: [authentication.service.ts:17](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L17)
|
|
30
30
|
|
|
31
31
|
#### Returns
|
|
32
32
|
|
|
@@ -38,7 +38,7 @@ Defined in: [authentication.service.ts:17](https://gitlab.com/rxap/packages/-/bl
|
|
|
38
38
|
|
|
39
39
|
> **signOut**(): `Promise`\<`void`\>
|
|
40
40
|
|
|
41
|
-
Defined in: [authentication.service.ts:15](https://gitlab.com/rxap/packages/-/blob/
|
|
41
|
+
Defined in: [authentication.service.ts:15](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/authentication.service.ts#L15)
|
|
42
42
|
|
|
43
43
|
#### Returns
|
|
44
44
|
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
> `const` **RXAP\_AUTHENTICATION\_ACCESS\_TOKEN**: `InjectionToken`\<`BehaviorSubject`\<[`AuthenticationAccessToken`](../wiki/Interface.AuthenticationAccessToken) \| `null`\>\>
|
|
6
6
|
|
|
7
|
-
Defined in: [tokens.ts:14](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [tokens.ts:14](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/tokens.ts#L14)
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
> `const` **RXAP\_AUTHENTICATION\_DEACTIVATED**: `InjectionToken`\<`boolean`\>
|
|
6
6
|
|
|
7
|
-
Defined in: [tokens.ts:7](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [tokens.ts:7](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/tokens.ts#L7)
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
> `const` **RXAP\_INITIAL\_AUTHENTICATION\_STATE**: `InjectionToken`\<`boolean`\>
|
|
6
6
|
|
|
7
|
-
Defined in: [tokens.ts:22](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [tokens.ts:22](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/authentication/src/lib/tokens.ts#L22)
|
package/docs/wiki/globals.md
CHANGED
package/generators.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"init": {
|
|
4
|
+
"factory": "./src/generators/init/generator",
|
|
5
|
+
"schema": "./src/generators/init/schema.json",
|
|
6
|
+
"description": "Initialize the package in the workspace"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"schematics": {
|
|
10
|
+
"init": {
|
|
11
|
+
"factory": "./src/generators/init/index",
|
|
12
|
+
"schema": "./src/generators/init/schema.json",
|
|
13
|
+
"description": "Initialize the package in the workspace"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "22.0.0-dev.
|
|
2
|
+
"version": "22.0.0-dev.2",
|
|
3
3
|
"name": "@rxap/authentication",
|
|
4
4
|
"description": "Provides authentication services, guards, and interceptors for Angular applications. It supports token-based authentication and provides features such as sign-out functionality and routing based on authentication status. This package also includes utilities for disabling authentication in certain environments and managing access tokens.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@angular/common": "^22.0.0",
|
|
12
12
|
"@angular/core": "^22.0.0",
|
|
13
13
|
"@angular/router": "^22.0.0",
|
|
14
|
-
"@rxap/utilities": "^16.5.3-dev.
|
|
14
|
+
"@rxap/utilities": "^16.5.3-dev.1",
|
|
15
15
|
"rxjs": "^7.0.0"
|
|
16
16
|
},
|
|
17
17
|
"author": {
|
|
@@ -53,13 +53,12 @@
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"package": "@rxap/utilities",
|
|
56
|
-
"version": "16.5.3-dev.
|
|
56
|
+
"version": "16.5.3-dev.1"
|
|
57
57
|
}
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
|
-
"access": "public"
|
|
62
|
-
"directory": "../../../dist/packages/angular/authentication"
|
|
61
|
+
"access": "public"
|
|
63
62
|
},
|
|
64
63
|
"repository": {
|
|
65
64
|
"type": "git",
|
|
@@ -77,8 +76,7 @@
|
|
|
77
76
|
".": {
|
|
78
77
|
"types": "./types/rxap-authentication.d.ts",
|
|
79
78
|
"default": "./fesm2022/rxap-authentication.mjs"
|
|
80
|
-
}
|
|
81
|
-
"./theme": "./theme.css"
|
|
79
|
+
}
|
|
82
80
|
},
|
|
83
81
|
"type": "module"
|
|
84
|
-
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initGenerator = initGenerator;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the directory of a package installed in the workspace. The lookup starts at the
|
|
9
|
+
* workspace root, not at this package: with an isolated node_modules layout (pnpm) or Yarn PnP
|
|
10
|
+
* the peer is not resolvable from here. The plain node_modules path is the fallback for packages
|
|
11
|
+
* whose `exports` map hides their package.json.
|
|
12
|
+
*/
|
|
13
|
+
function resolvePackageDir(root, packageName) {
|
|
14
|
+
try {
|
|
15
|
+
return (0, path_1.dirname)(require.resolve(`${packageName}/package.json`, { paths: [root] }));
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return (0, path_1.join)(root, 'node_modules', ...packageName.split('/'));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function initGenerator(tree, options) {
|
|
22
|
+
// The package's own package.json lives on disk next to the compiled generator
|
|
23
|
+
// (inside node_modules when installed), which the virtual Tree does not track.
|
|
24
|
+
// Read it directly from the physical filesystem.
|
|
25
|
+
const packageJsonFilePath = (0, path_1.join)(__dirname, '..', '..', '..', 'package.json');
|
|
26
|
+
if (!(0, fs_1.existsSync)(packageJsonFilePath)) {
|
|
27
|
+
console.error('package.json not found in: ' + packageJsonFilePath);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const { peerDependencies, name: packageName } = JSON.parse((0, fs_1.readFileSync)(packageJsonFilePath, 'utf-8'));
|
|
31
|
+
console.log(`Coerce peer dependencies for package: ${packageName}`);
|
|
32
|
+
if (!peerDependencies || !Object.keys(peerDependencies).length) {
|
|
33
|
+
console.log('No peer dependencies found');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
console.log(`Peer dependencies: ${Object.keys(peerDependencies).join(', ')}`);
|
|
37
|
+
const rootPackageJson = JSON.parse(tree.read('package.json', 'utf-8'));
|
|
38
|
+
let isDevDependency = !!rootPackageJson.devDependencies?.[packageName];
|
|
39
|
+
if (isDevDependency &&
|
|
40
|
+
[/^@rxap\/ngx/, /^@rxap\/nest/].some((rx) => rx.test(packageName))) {
|
|
41
|
+
rootPackageJson.dependencies ??= {};
|
|
42
|
+
rootPackageJson.dependencies[packageName] =
|
|
43
|
+
rootPackageJson.devDependencies[packageName];
|
|
44
|
+
delete rootPackageJson.devDependencies[packageName];
|
|
45
|
+
isDevDependency = false;
|
|
46
|
+
tree.write('package.json', JSON.stringify(rootPackageJson, null, 2));
|
|
47
|
+
}
|
|
48
|
+
if (!isDevDependency &&
|
|
49
|
+
[
|
|
50
|
+
/^@rxap\/plugin/,
|
|
51
|
+
/^@rxap\/workspace/,
|
|
52
|
+
/@rxap\/schematic/,
|
|
53
|
+
].some((rx) => rx.test(packageName))) {
|
|
54
|
+
rootPackageJson.devDependencies ??= {};
|
|
55
|
+
rootPackageJson.devDependencies[packageName] =
|
|
56
|
+
rootPackageJson.dependencies[packageName];
|
|
57
|
+
delete rootPackageJson.dependencies[packageName];
|
|
58
|
+
isDevDependency = true;
|
|
59
|
+
tree.write('package.json', JSON.stringify(rootPackageJson, null, 2));
|
|
60
|
+
}
|
|
61
|
+
const missingPeerDependencies = Object.entries(peerDependencies)
|
|
62
|
+
.filter(([dep]) => !rootPackageJson.dependencies?.[dep] &&
|
|
63
|
+
!rootPackageJson.devDependencies?.[dep])
|
|
64
|
+
.reduce((acc, [dep, version]) => ({ ...acc, [dep]: version }), {});
|
|
65
|
+
if (!Object.keys(missingPeerDependencies).length) {
|
|
66
|
+
console.log('No missing peer dependencies');
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (isDevDependency) {
|
|
70
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, missingPeerDependencies);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, missingPeerDependencies, {});
|
|
74
|
+
}
|
|
75
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
76
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
77
|
+
for (const peer of Object.keys(missingPeerDependencies)) {
|
|
78
|
+
console.log(`Peer dependency ${peer} added to package.json`);
|
|
79
|
+
// node_modules is physical and excluded from the virtual Tree, so read the
|
|
80
|
+
// peer files from disk.
|
|
81
|
+
const peerPackageDir = resolvePackageDir(tree.root, peer);
|
|
82
|
+
const peerPackageJsonFilePath = (0, path_1.join)(peerPackageDir, 'package.json');
|
|
83
|
+
if (!(0, fs_1.existsSync)(peerPackageJsonFilePath)) {
|
|
84
|
+
console.log(`Peer dependency ${peer} has no package.json`);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const { generators, schematics } = JSON.parse((0, fs_1.readFileSync)(peerPackageJsonFilePath, 'utf-8'));
|
|
88
|
+
if (!generators && !schematics) {
|
|
89
|
+
console.log(`Peer dependency ${peer} has no generators or schematics`);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const configFile = generators || schematics;
|
|
93
|
+
const configFilePath = (0, path_1.join)(peerPackageDir, configFile);
|
|
94
|
+
if (!(0, fs_1.existsSync)(configFilePath)) {
|
|
95
|
+
console.log(`Peer dependency ${peer} has no generators or schematics file`);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const config = JSON.parse((0, fs_1.readFileSync)(configFilePath, 'utf-8'));
|
|
99
|
+
if (!config.generators?.init) {
|
|
100
|
+
console.log(`Peer dependency ${peer} has no init generator`);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const initGeneratorFilePath = config.generators.init.factory;
|
|
104
|
+
const fullInitGeneratorFilePath = (0, path_1.join)(peerPackageDir, initGeneratorFilePath) + '.js';
|
|
105
|
+
if (!(0, fs_1.existsSync)(fullInitGeneratorFilePath)) {
|
|
106
|
+
console.log(`Peer dependency ${peer} has no init generator file: ` +
|
|
107
|
+
fullInitGeneratorFilePath);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
111
|
+
const initGenerator = require((0, path_1.join)(peerPackageDir, initGeneratorFilePath))?.default;
|
|
112
|
+
if (typeof initGenerator !== 'function') {
|
|
113
|
+
console.log(`Peer dependency ${peer} has no init generator function`);
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
console.log(`Run init generator for peer dependency ${peer}`);
|
|
117
|
+
await initGenerator(tree, options);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.default = initGenerator;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const generator_1 = require("./generator");
|
|
5
|
+
const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
6
|
+
exports.default = schematic;
|