@rxap/oauth 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.
Files changed (38) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +5 -3
  3. package/compodoc/changelog.html +16 -0
  4. package/compodoc/dependencies.html +2 -2
  5. package/compodoc/index.html +4 -3
  6. package/compodoc/js/search/search_index.js +2 -2
  7. package/compodoc/llms.txt +3 -1
  8. package/compodoc/miscellaneous/functions.html +81 -0
  9. package/compodoc/properties.html +1 -1
  10. package/docs/documentation.json +48 -24
  11. package/docs/html/classes/AuthenticationService.html +11 -11
  12. package/docs/html/functions/AuthenticationGuard.html +4 -4
  13. package/docs/html/functions/ProvideAuth.html +4 -4
  14. package/docs/html/functions/withAuthConfig.html +4 -4
  15. package/docs/html/hierarchy.html +4 -4
  16. package/docs/html/index.html +8 -7
  17. package/docs/html/modules.html +4 -4
  18. package/docs/markdown/README.md +6 -4
  19. package/docs/markdown/classes/AuthenticationService.md +9 -9
  20. package/docs/markdown/functions/AuthenticationGuard.md +2 -2
  21. package/docs/markdown/functions/ProvideAuth.md +2 -2
  22. package/docs/markdown/functions/withAuthConfig.md +2 -2
  23. package/docs/markdown/globals.md +2 -2
  24. package/docs/wiki/Class.AuthenticationService.md +8 -8
  25. package/docs/wiki/Function.AuthenticationGuard.md +1 -1
  26. package/docs/wiki/Function.ProvideAuth.md +1 -1
  27. package/docs/wiki/Function.withAuthConfig.md +1 -1
  28. package/docs/wiki/Home.md +5 -3
  29. package/docs/wiki/globals.md +1 -1
  30. package/generators.json +16 -0
  31. package/package.json +9 -11
  32. package/src/generators/init/generator.js +120 -0
  33. package/src/generators/init/index.js +6 -0
  34. package/src/generators/init/schema.json +8 -0
  35. package/src/generators/package.json +3 -0
  36. package/compodoc/js/libs/vis.min.js +0 -47
  37. package/compodoc/js/menu-wc_es5.js +0 -40
  38. package/theme.css +0 -1
@@ -1,5 +1,5 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="./"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@rxap/oauth - v22.0.0-dev.1</title><meta name="description" content="Documentation for @rxap/oauth"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
- <div class="tsd-toolbar-contents container"><a href="index.html" class="title">@rxap/oauth - v22.0.0-dev.1</a>
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="./"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@rxap/oauth - v22.0.0-dev.2</title><meta name="description" content="Documentation for @rxap/oauth"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container"><a href="index.html" class="title">@rxap/oauth - v22.0.0-dev.2</a>
3
3
  <div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
4
4
  <ul role="listbox" id="tsd-search-results"></ul>
5
5
  <div id="tsd-search-status" aria-live="polite" aria-atomic="true">
@@ -7,7 +7,7 @@
7
7
  <div class="container container-main">
8
8
  <div class="col-content">
9
9
  <div class="tsd-page-title">
10
- <h1>@rxap/oauth - v22.0.0-dev.1</h1></div>
10
+ <h1>@rxap/oauth - v22.0.0-dev.2</h1></div>
11
11
  <div class="tsd-panel tsd-typography"><p>This package provides an authentication guard and service for Angular applications using OAuth 2.0 and OpenID Connect. It simplifies the integration of authentication flows, including sign-in, sign-out, and token management, with support for disabled authentication scenarios. The package also includes a provider function to streamline configuration.</p>
12
12
  <p><a href="https://www.npmjs.com/package/@rxap/oauth"><img src="https://img.shields.io/npm/v/@rxap/oauth?style=flat-square" alt="npm version"></a>
13
13
  <a href="https://commitizen.github.io/cz-cli/"><img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square" alt="commitizen friendly"></a>
@@ -25,15 +25,16 @@
25
25
  </ul>
26
26
  <h1 id="installation" class="tsd-anchor-link">Installation<a href="#installation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1>
27
27
  <p><strong>Add the package to your workspace:</strong></p>
28
- <pre><code class="bash"><span class="hl-0">yarn</span><span class="hl-1"> </span><span class="hl-2">add</span><span class="hl-1"> </span><span class="hl-2">@rxap/oauth</span>
28
+ <pre><code class="bash"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-2">@rxap/oauth</span>
29
29
  </code><button type="button">Copy</button></pre>
30
30
 
31
+ <p>With pnpm or yarn use <code>pnpm add</code> or <code>yarn add</code> instead of <code>npm install</code>.</p>
31
32
  <p><strong>Install peer dependencies:</strong></p>
32
- <pre><code class="bash"><span class="hl-0">yarn</span><span class="hl-1"> </span><span class="hl-2">add</span><span class="hl-1"> </span><span class="hl-2">@angular/core</span><span class="hl-1"> </span><span class="hl-2">@angular/router</span><span class="hl-1"> </span><span class="hl-2">@rxap/authentication</span><span class="hl-1"> </span><span class="hl-2">@rxap/rxjs</span><span class="hl-1"> </span><span class="hl-2">angular-oauth2-oidc</span><span class="hl-1"> </span><span class="hl-2">angular-oauth2-oidc-jwks</span><span class="hl-1"> </span><span class="hl-2">rxjs</span><span class="hl-1"> </span>
33
+ <pre><code class="bash"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-2">@angular/core</span><span class="hl-1"> </span><span class="hl-2">@angular/router</span><span class="hl-1"> </span><span class="hl-2">@rxap/authentication</span><span class="hl-1"> </span><span class="hl-2">@rxap/rxjs</span><span class="hl-1"> </span><span class="hl-2">angular-oauth2-oidc</span><span class="hl-1"> </span><span class="hl-2">angular-oauth2-oidc-jwks</span><span class="hl-1"> </span><span class="hl-2">rxjs</span><span class="hl-1"> </span>
33
34
  </code><button type="button">Copy</button></pre>
34
35
 
35
36
  <p><strong>Execute the init generator:</strong></p>
36
- <pre><code class="bash"><span class="hl-0">yarn</span><span class="hl-1"> </span><span class="hl-2">nx</span><span class="hl-1"> </span><span class="hl-2">g</span><span class="hl-1"> </span><span class="hl-2">@rxap/oauth:init</span>
37
+ <pre><code class="bash"><span class="hl-0">nx</span><span class="hl-1"> </span><span class="hl-2">g</span><span class="hl-1"> </span><span class="hl-2">@rxap/oauth:init</span>
37
38
  </code><button type="button">Copy</button></pre>
38
39
 
39
40
  <h1 id="generators" class="tsd-anchor-link">Generators<a href="#generators" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1>
@@ -63,7 +64,7 @@
63
64
  <ul>
64
65
  <li><a href="#init"><span>init</span></a></li></ul></div></details></div>
65
66
  <div class="site-menu">
66
- <nav class="tsd-navigation"><a href="modules.html">@rxap/oauth - v22.0.0-dev.1</a>
67
+ <nav class="tsd-navigation"><a href="modules.html">@rxap/oauth - v22.0.0-dev.2</a>
67
68
  <ul class="tsd-small-nested-navigation" id="tsd-nav-container">
68
69
  <li>Loading...</li></ul></nav></div></div></div><footer>
69
70
  <p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
@@ -1,5 +1,5 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="./"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@rxap/oauth - v22.0.0-dev.1</title><meta name="description" content="Documentation for @rxap/oauth"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
- <div class="tsd-toolbar-contents container"><a href="index.html" class="title">@rxap/oauth - v22.0.0-dev.1</a>
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="./"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@rxap/oauth - v22.0.0-dev.2</title><meta name="description" content="Documentation for @rxap/oauth"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container"><a href="index.html" class="title">@rxap/oauth - v22.0.0-dev.2</a>
3
3
  <div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/>
4
4
  <ul role="listbox" id="tsd-search-results"></ul>
5
5
  <div id="tsd-search-status" aria-live="polite" aria-atomic="true">
@@ -8,7 +8,7 @@
8
8
  <div class="col-content">
9
9
  <div class="tsd-page-title">
10
10
  <ul class="tsd-breadcrumb" aria-label="Breadcrumb"></ul>
11
- <h1>@rxap/oauth - v22.0.0-dev.1</h1></div>
11
+ <h1>@rxap/oauth - v22.0.0-dev.2</h1></div>
12
12
  <details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Classes"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>
13
13
  <h2 class="tsd-anchor-link" id="classes">Classes<a href="#classes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2></summary><dl class="tsd-member-summaries"><dt class="tsd-member-summary" id="authenticationservice"><span class="tsd-member-summary-name"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Class"><use href="assets/icons.svg#icon-128"></use></svg><a href="classes/AuthenticationService.html">AuthenticationService</a><a href="#authenticationservice" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></span></dt><dd class="tsd-member-summary"></dd></dl></details>
14
14
  <details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Functions"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>
@@ -33,7 +33,7 @@
33
33
  <details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Functions"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Functions</summary>
34
34
  <div><a href="#authenticationguard"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="assets/icons.svg#icon-64"></use></svg><span>Authentication<wbr/>Guard</span></a><a href="#provideauth"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="assets/icons.svg#icon-64"></use></svg><span>Provide<wbr/>Auth</span></a><a href="#withauthconfig"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Function"><use href="assets/icons.svg#icon-64"></use></svg><span>with<wbr/>Auth<wbr/>Config</span></a></div></details></div></details></div>
35
35
  <div class="site-menu">
36
- <nav class="tsd-navigation"><a href="modules.html" class="current">@rxap/oauth - v22.0.0-dev.1</a>
36
+ <nav class="tsd-navigation"><a href="modules.html" class="current">@rxap/oauth - v22.0.0-dev.2</a>
37
37
  <ul class="tsd-small-nested-navigation" id="tsd-nav-container">
38
38
  <li>Loading...</li></ul></nav></div></div></div><footer>
39
39
  <p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer>
@@ -1,4 +1,4 @@
1
- **@rxap/oauth v22.0.0-dev.1**
1
+ **@rxap/oauth v22.0.0-dev.2**
2
2
 
3
3
  ***
4
4
 
@@ -19,15 +19,17 @@ This package provides an authentication guard and service for Angular applicatio
19
19
 
20
20
  **Add the package to your workspace:**
21
21
  ```bash
22
- yarn add @rxap/oauth
22
+ npm install @rxap/oauth
23
23
  ```
24
+ With pnpm or yarn use `pnpm add` or `yarn add` instead of `npm install`.
25
+
24
26
  **Install peer dependencies:**
25
27
  ```bash
26
- yarn add @angular/core @angular/router @rxap/authentication @rxap/rxjs angular-oauth2-oidc angular-oauth2-oidc-jwks rxjs
28
+ npm install @angular/core @angular/router @rxap/authentication @rxap/rxjs angular-oauth2-oidc angular-oauth2-oidc-jwks rxjs
27
29
  ```
28
30
  **Execute the init generator:**
29
31
  ```bash
30
- yarn nx g @rxap/oauth:init
32
+ nx g @rxap/oauth:init
31
33
  ```
32
34
  # Generators
33
35
 
@@ -1,4 +1,4 @@
1
- [**@rxap/oauth v22.0.0-dev.1**](../README.md)
1
+ [**@rxap/oauth v22.0.0-dev.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: AuthenticationService
8
8
 
9
- Defined in: [authentication.service.ts:31](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L31)
9
+ Defined in: [authentication.service.ts:31](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L31)
10
10
 
11
11
  ## Implements
12
12
 
@@ -18,7 +18,7 @@ Defined in: [authentication.service.ts:31](https://gitlab.com/rxap/packages/-/bl
18
18
 
19
19
  > **new AuthenticationService**(): `AuthenticationService`
20
20
 
21
- Defined in: [authentication.service.ts:46](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L46)
21
+ Defined in: [authentication.service.ts:46](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L46)
22
22
 
23
23
  #### Returns
24
24
 
@@ -30,7 +30,7 @@ Defined in: [authentication.service.ts:46](https://gitlab.com/rxap/packages/-/bl
30
30
 
31
31
  > **events$**: `Observable`\<`AuthenticationEvent`\> = `EMPTY`
32
32
 
33
- Defined in: [authentication.service.ts:37](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L37)
33
+ Defined in: [authentication.service.ts:37](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L37)
34
34
 
35
35
  #### Implementation of
36
36
 
@@ -42,7 +42,7 @@ Defined in: [authentication.service.ts:37](https://gitlab.com/rxap/packages/-/bl
42
42
 
43
43
  > `readonly` **isAuthenticated$**: `BehaviorSubject`\<`boolean` \| `null`\>
44
44
 
45
- Defined in: [authentication.service.ts:38](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L38)
45
+ Defined in: [authentication.service.ts:38](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L38)
46
46
 
47
47
  #### Implementation of
48
48
 
@@ -54,7 +54,7 @@ Defined in: [authentication.service.ts:38](https://gitlab.com/rxap/packages/-/bl
54
54
 
55
55
  > **init**(): `void`
56
56
 
57
- Defined in: [authentication.service.ts:63](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L63)
57
+ Defined in: [authentication.service.ts:63](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L63)
58
58
 
59
59
  #### Returns
60
60
 
@@ -66,7 +66,7 @@ Defined in: [authentication.service.ts:63](https://gitlab.com/rxap/packages/-/bl
66
66
 
67
67
  > **isAuthenticated**(): `Promise`\<`boolean`\>
68
68
 
69
- Defined in: [authentication.service.ts:145](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L145)
69
+ Defined in: [authentication.service.ts:145](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L145)
70
70
 
71
71
  #### Returns
72
72
 
@@ -82,7 +82,7 @@ Defined in: [authentication.service.ts:145](https://gitlab.com/rxap/packages/-/b
82
82
 
83
83
  > **signIn**(): `void`
84
84
 
85
- Defined in: [authentication.service.ts:126](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L126)
85
+ Defined in: [authentication.service.ts:126](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L126)
86
86
 
87
87
  #### Returns
88
88
 
@@ -94,7 +94,7 @@ Defined in: [authentication.service.ts:126](https://gitlab.com/rxap/packages/-/b
94
94
 
95
95
  > **signOut**(): `Promise`\<`void`\>
96
96
 
97
- Defined in: [authentication.service.ts:115](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L115)
97
+ Defined in: [authentication.service.ts:115](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L115)
98
98
 
99
99
  #### Returns
100
100
 
@@ -1,4 +1,4 @@
1
- [**@rxap/oauth v22.0.0-dev.1**](../README.md)
1
+ [**@rxap/oauth v22.0.0-dev.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **AuthenticationGuard**(`route`, `state`): `Promise`\<`boolean`\>
10
10
 
11
- Defined in: [authentication-guard.ts:12](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication-guard.ts#L12)
11
+ Defined in: [authentication-guard.ts:12](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication-guard.ts#L12)
12
12
 
13
13
  ## Parameters
14
14
 
@@ -1,4 +1,4 @@
1
- [**@rxap/oauth v22.0.0-dev.1**](../README.md)
1
+ [**@rxap/oauth v22.0.0-dev.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **ProvideAuth**(...`withConfigs`): `Provider`[]
10
10
 
11
- Defined in: [provide-auth.ts:9](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/provide-auth.ts#L9)
11
+ Defined in: [provide-auth.ts:9](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/provide-auth.ts#L9)
12
12
 
13
13
  ## Parameters
14
14
 
@@ -1,4 +1,4 @@
1
- [**@rxap/oauth v22.0.0-dev.1**](../README.md)
1
+ [**@rxap/oauth v22.0.0-dev.2**](../README.md)
2
2
 
3
3
  ***
4
4
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **withAuthConfig**(`config`): `Provider`
10
10
 
11
- Defined in: [provide-auth.ts:20](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/provide-auth.ts#L20)
11
+ Defined in: [provide-auth.ts:20](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/provide-auth.ts#L20)
12
12
 
13
13
  ## Parameters
14
14
 
@@ -1,8 +1,8 @@
1
- [**@rxap/oauth v22.0.0-dev.1**](README.md)
1
+ [**@rxap/oauth v22.0.0-dev.2**](README.md)
2
2
 
3
3
  ***
4
4
 
5
- # @rxap/oauth v22.0.0-dev.1
5
+ # @rxap/oauth v22.0.0-dev.2
6
6
 
7
7
  ## Classes
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Class: AuthenticationService
4
4
 
5
- Defined in: [authentication.service.ts:31](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L31)
5
+ Defined in: [authentication.service.ts:31](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/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 AuthenticationService**(): `AuthenticationService`
16
16
 
17
- Defined in: [authentication.service.ts:46](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L46)
17
+ Defined in: [authentication.service.ts:46](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L46)
18
18
 
19
19
  #### Returns
20
20
 
@@ -26,7 +26,7 @@ Defined in: [authentication.service.ts:46](https://gitlab.com/rxap/packages/-/bl
26
26
 
27
27
  > **events$**: `Observable`\<`AuthenticationEvent`\> = `EMPTY`
28
28
 
29
- Defined in: [authentication.service.ts:37](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L37)
29
+ Defined in: [authentication.service.ts:37](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L37)
30
30
 
31
31
  #### Implementation of
32
32
 
@@ -38,7 +38,7 @@ Defined in: [authentication.service.ts:37](https://gitlab.com/rxap/packages/-/bl
38
38
 
39
39
  > `readonly` **isAuthenticated$**: `BehaviorSubject`\<`boolean` \| `null`\>
40
40
 
41
- Defined in: [authentication.service.ts:38](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L38)
41
+ Defined in: [authentication.service.ts:38](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L38)
42
42
 
43
43
  #### Implementation of
44
44
 
@@ -50,7 +50,7 @@ Defined in: [authentication.service.ts:38](https://gitlab.com/rxap/packages/-/bl
50
50
 
51
51
  > **init**(): `void`
52
52
 
53
- Defined in: [authentication.service.ts:63](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L63)
53
+ Defined in: [authentication.service.ts:63](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L63)
54
54
 
55
55
  #### Returns
56
56
 
@@ -62,7 +62,7 @@ Defined in: [authentication.service.ts:63](https://gitlab.com/rxap/packages/-/bl
62
62
 
63
63
  > **isAuthenticated**(): `Promise`\<`boolean`\>
64
64
 
65
- Defined in: [authentication.service.ts:145](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L145)
65
+ Defined in: [authentication.service.ts:145](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L145)
66
66
 
67
67
  #### Returns
68
68
 
@@ -78,7 +78,7 @@ Defined in: [authentication.service.ts:145](https://gitlab.com/rxap/packages/-/b
78
78
 
79
79
  > **signIn**(): `void`
80
80
 
81
- Defined in: [authentication.service.ts:126](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L126)
81
+ Defined in: [authentication.service.ts:126](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L126)
82
82
 
83
83
  #### Returns
84
84
 
@@ -90,7 +90,7 @@ Defined in: [authentication.service.ts:126](https://gitlab.com/rxap/packages/-/b
90
90
 
91
91
  > **signOut**(): `Promise`\<`void`\>
92
92
 
93
- Defined in: [authentication.service.ts:115](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication.service.ts#L115)
93
+ Defined in: [authentication.service.ts:115](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication.service.ts#L115)
94
94
 
95
95
  #### Returns
96
96
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **AuthenticationGuard**(`route`, `state`): `Promise`\<`boolean`\>
6
6
 
7
- Defined in: [authentication-guard.ts:12](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/authentication-guard.ts#L12)
7
+ Defined in: [authentication-guard.ts:12](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/authentication-guard.ts#L12)
8
8
 
9
9
  ## Parameters
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **ProvideAuth**(...`withConfigs`): `Provider`[]
6
6
 
7
- Defined in: [provide-auth.ts:9](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/provide-auth.ts#L9)
7
+ Defined in: [provide-auth.ts:9](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/provide-auth.ts#L9)
8
8
 
9
9
  ## Parameters
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **withAuthConfig**(`config`): `Provider`
6
6
 
7
- Defined in: [provide-auth.ts:20](https://gitlab.com/rxap/packages/-/blob/947fa470d880611063dad4f2b0b1c759b5b07f1b/packages/angular/oauth/src/lib/provide-auth.ts#L20)
7
+ Defined in: [provide-auth.ts:20](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/oauth/src/lib/provide-auth.ts#L20)
8
8
 
9
9
  ## Parameters
10
10
 
package/docs/wiki/Home.md CHANGED
@@ -15,15 +15,17 @@ This package provides an authentication guard and service for Angular applicatio
15
15
 
16
16
  **Add the package to your workspace:**
17
17
  ```bash
18
- yarn add @rxap/oauth
18
+ npm install @rxap/oauth
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
- yarn add @angular/core @angular/router @rxap/authentication @rxap/rxjs angular-oauth2-oidc angular-oauth2-oidc-jwks rxjs
24
+ npm install @angular/core @angular/router @rxap/authentication @rxap/rxjs angular-oauth2-oidc angular-oauth2-oidc-jwks rxjs
23
25
  ```
24
26
  **Execute the init generator:**
25
27
  ```bash
26
- yarn nx g @rxap/oauth:init
28
+ nx g @rxap/oauth:init
27
29
  ```
28
30
  # Generators
29
31
 
@@ -1,4 +1,4 @@
1
- # @rxap/oauth v22.0.0-dev.1
1
+ # @rxap/oauth v22.0.0-dev.2
2
2
 
3
3
  ## Classes
4
4
 
@@ -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.1",
2
+ "version": "22.0.0-dev.2",
3
3
  "name": "@rxap/oauth",
4
4
  "description": "This package provides an authentication guard and service for Angular applications using OAuth 2.0 and OpenID Connect. It simplifies the integration of authentication flows, including sign-in, sign-out, and token management, with support for disabled authentication scenarios. The package also includes a provider function to streamline configuration.\n",
5
5
  "license": "GPL-3.0-or-later",
@@ -10,8 +10,8 @@
10
10
  "peerDependencies": {
11
11
  "@angular/core": "^22.0.0",
12
12
  "@angular/router": "^22.0.0",
13
- "@rxap/authentication": "^22.0.0-dev.1",
14
- "@rxap/rxjs": "^1.1.19-dev.0",
13
+ "@rxap/authentication": "^22.0.0-dev.2",
14
+ "@rxap/rxjs": "^1.1.19-dev.1",
15
15
  "angular-oauth2-oidc": "^22.0.0",
16
16
  "angular-oauth2-oidc-jwks": "^22.0.0",
17
17
  "rxjs": "^7.0.0"
@@ -59,21 +59,20 @@
59
59
  },
60
60
  {
61
61
  "package": "@rxap/authentication",
62
- "version": "22.0.0-dev.1"
62
+ "version": "22.0.0-dev.2"
63
63
  },
64
64
  {
65
65
  "package": "@rxap/rxjs",
66
- "version": "1.1.19-dev.0"
66
+ "version": "1.1.19-dev.1"
67
67
  },
68
68
  {
69
69
  "package": "@rxap/utilities",
70
- "version": "16.5.3-dev.0"
70
+ "version": "16.5.3-dev.1"
71
71
  }
72
72
  ]
73
73
  },
74
74
  "publishConfig": {
75
- "access": "public",
76
- "directory": "../../../dist/packages/angular/oauth"
75
+ "access": "public"
77
76
  },
78
77
  "repository": {
79
78
  "type": "git",
@@ -91,8 +90,7 @@
91
90
  ".": {
92
91
  "types": "./types/rxap-oauth.d.ts",
93
92
  "default": "./fesm2022/rxap-oauth.mjs"
94
- },
95
- "./theme": "./theme.css"
93
+ }
96
94
  },
97
95
  "type": "module"
98
- }
96
+ }
@@ -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;
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "Init",
4
+ "title": "",
5
+ "type": "object",
6
+ "properties": {},
7
+ "required": []
8
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }