witspry-auth-ng-client 1.2.1 → 1.3.0

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 (33) hide show
  1. package/README.md +3 -0
  2. package/fesm2022/witspry-auth-ng-client.mjs +17 -17
  3. package/fesm2022/witspry-auth-ng-client.mjs.map +1 -1
  4. package/package.json +7 -9
  5. package/types/witspry-auth-ng-client.d.ts +509 -0
  6. package/esm2022/lib/components/oauth2-callback/oauth2-callback.component.mjs +0 -189
  7. package/esm2022/lib/guards/oauth2-auth.guard.mjs +0 -159
  8. package/esm2022/lib/interceptors/oauth2.interceptor.mjs +0 -192
  9. package/esm2022/lib/models/index.mjs +0 -4
  10. package/esm2022/lib/models/oauth2-config.model.mjs +0 -2
  11. package/esm2022/lib/models/oauth2-types.model.mjs +0 -15
  12. package/esm2022/lib/models/witsauth-types.model.mjs +0 -10
  13. package/esm2022/lib/ng-oauth2-pkce.service.mjs +0 -64
  14. package/esm2022/lib/services/oauth2-storage.service.mjs +0 -213
  15. package/esm2022/lib/services/oauth2.service.mjs +0 -881
  16. package/esm2022/lib/tokens/index.mjs +0 -2
  17. package/esm2022/lib/tokens/oauth2-config.token.mjs +0 -6
  18. package/esm2022/public-api.mjs +0 -20
  19. package/esm2022/witspry-auth-ng-client.mjs +0 -5
  20. package/index.d.ts +0 -5
  21. package/lib/components/oauth2-callback/oauth2-callback.component.d.ts +0 -26
  22. package/lib/guards/oauth2-auth.guard.d.ts +0 -34
  23. package/lib/interceptors/oauth2.interceptor.d.ts +0 -6
  24. package/lib/models/index.d.ts +0 -3
  25. package/lib/models/oauth2-config.model.d.ts +0 -52
  26. package/lib/models/oauth2-types.model.d.ts +0 -132
  27. package/lib/models/witsauth-types.model.d.ts +0 -8
  28. package/lib/ng-oauth2-pkce.service.d.ts +0 -25
  29. package/lib/services/oauth2-storage.service.d.ts +0 -67
  30. package/lib/services/oauth2.service.d.ts +0 -173
  31. package/lib/tokens/index.d.ts +0 -1
  32. package/lib/tokens/oauth2-config.token.d.ts +0 -6
  33. package/public-api.d.ts +0 -9
package/README.md CHANGED
@@ -304,3 +304,6 @@ MIT License - see LICENSE file for details.
304
304
 
305
305
  ### 1.2.0
306
306
  - Automatic token refresh with intervals based on access token expiry
307
+
308
+ ### 1.3.0
309
+ - Updated Angular dependencies to Angular v21
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, PLATFORM_ID, Injectable, Inject, signal, inject, Component, makeEnvironmentProviders, NgModule } from '@angular/core';
2
+ import { InjectionToken, PLATFORM_ID, Inject, Injectable, signal, inject, Component, makeEnvironmentProviders, NgModule } from '@angular/core';
3
3
  import * as i3 from '@angular/common';
4
4
  import { isPlatformBrowser, CommonModule } from '@angular/common';
5
5
  import { BehaviorSubject, throwError } from 'rxjs';
@@ -231,10 +231,10 @@ class OAuth2StorageService {
231
231
  console.error(`[OAuth2StorageService] ${message}`, error);
232
232
  }
233
233
  }
234
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OAuth2StorageService, deps: [{ token: OAUTH2_CONFIG_TOKEN }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
235
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OAuth2StorageService, providedIn: 'root' });
234
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: OAuth2StorageService, deps: [{ token: OAUTH2_CONFIG_TOKEN }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
235
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: OAuth2StorageService, providedIn: 'root' });
236
236
  }
237
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OAuth2StorageService, decorators: [{
237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: OAuth2StorageService, decorators: [{
238
238
  type: Injectable,
239
239
  args: [{
240
240
  providedIn: 'root'
@@ -260,7 +260,7 @@ class OAuth2Service {
260
260
  _authState = signal({
261
261
  isAuthenticated: false,
262
262
  isLoading: false
263
- });
263
+ }, { ...(ngDevMode ? { debugName: "_authState" } : {}) });
264
264
  _authStateSubject = new BehaviorSubject({
265
265
  isAuthenticated: false,
266
266
  isLoading: false
@@ -1102,10 +1102,10 @@ class OAuth2Service {
1102
1102
  ngOnDestroy() {
1103
1103
  this.clearAutoRefreshTimer();
1104
1104
  }
1105
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OAuth2Service, deps: [{ token: OAUTH2_CONFIG_TOKEN }, { token: PLATFORM_ID }, { token: i1.HttpClient }, { token: i2.Router }, { token: OAuth2StorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1106
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OAuth2Service, providedIn: 'root' });
1105
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: OAuth2Service, deps: [{ token: OAUTH2_CONFIG_TOKEN }, { token: PLATFORM_ID }, { token: i1.HttpClient }, { token: i2.Router }, { token: OAuth2StorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1106
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: OAuth2Service, providedIn: 'root' });
1107
1107
  }
1108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OAuth2Service, decorators: [{
1108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: OAuth2Service, decorators: [{
1109
1109
  type: Injectable,
1110
1110
  args: [{
1111
1111
  providedIn: 'root'
@@ -1390,8 +1390,8 @@ class OAuth2CallbackComponent {
1390
1390
  const redirectRoute = this.config.redirectRoute || '/';
1391
1391
  this.router.navigate([redirectRoute]);
1392
1392
  }
1393
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OAuth2CallbackComponent, deps: [{ token: OAuth2Service }, { token: i2.Router }, { token: PLATFORM_ID }, { token: OAUTH2_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
1394
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: OAuth2CallbackComponent, isStandalone: true, selector: "lib-oauth2-callback", ngImport: i0, template: `
1393
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: OAuth2CallbackComponent, deps: [{ token: OAuth2Service }, { token: i2.Router }, { token: PLATFORM_ID }, { token: OAUTH2_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
1394
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.2", type: OAuth2CallbackComponent, isStandalone: true, selector: "lib-oauth2-callback", ngImport: i0, template: `
1395
1395
  <div class="oauth2-callback-container">
1396
1396
  <div class="oauth2-callback-content">
1397
1397
  <div *ngIf="isLoading" class="loading-section">
@@ -1431,9 +1431,9 @@ class OAuth2CallbackComponent {
1431
1431
  </div>
1432
1432
  </div>
1433
1433
  </div>
1434
- `, isInline: true, styles: [".oauth2-callback-container{display:flex;justify-content:center;align-items:center;min-height:100vh;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.oauth2-callback-content{background:#fff;border-radius:8px;padding:2rem;box-shadow:0 4px 6px #0000001a;text-align:center;max-width:400px;width:100%;margin:1rem}.loading-section h2,.success-section h2,.error-section h2{margin:1rem 0 .5rem;color:#333}.loading-section p,.success-section p{color:#666;margin-bottom:0}.spinner{border:3px solid #f3f3f3;border-top:3px solid #007bff;border-radius:50%;width:40px;height:40px;animation:spin 1s linear infinite;margin:0 auto 1rem}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.success-icon{width:60px;height:60px;border-radius:50%;background-color:#28a745;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:700;margin:0 auto 1rem}.error-icon{width:60px;height:60px;border-radius:50%;background-color:#dc3545;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:700;margin:0 auto 1rem}.error-message{color:#dc3545;margin:1rem 0;padding:.5rem;background-color:#f8d7da;border:1px solid #f5c6cb;border-radius:4px;font-size:.9rem}.error-actions{display:flex;gap:1rem;justify-content:center;margin-top:1.5rem}.retry-button,.home-button{padding:.75rem 1.5rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;font-weight:500;transition:background-color .2s}.retry-button{background-color:#007bff;color:#fff}.retry-button:hover{background-color:#0056b3}.home-button{background-color:#6c757d;color:#fff}.home-button:hover{background-color:#545b62}@media (max-width: 480px){.oauth2-callback-content{margin:.5rem;padding:1.5rem}.error-actions{flex-direction:column}.retry-button,.home-button{width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1434
+ `, isInline: true, styles: [".oauth2-callback-container{display:flex;justify-content:center;align-items:center;min-height:100vh;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.oauth2-callback-content{background:#fff;border-radius:8px;padding:2rem;box-shadow:0 4px 6px #0000001a;text-align:center;max-width:400px;width:100%;margin:1rem}.loading-section h2,.success-section h2,.error-section h2{margin:1rem 0 .5rem;color:#333}.loading-section p,.success-section p{color:#666;margin-bottom:0}.spinner{border:3px solid #f3f3f3;border-top:3px solid #007bff;border-radius:50%;width:40px;height:40px;animation:spin 1s linear infinite;margin:0 auto 1rem}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.success-icon{width:60px;height:60px;border-radius:50%;background-color:#28a745;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:700;margin:0 auto 1rem}.error-icon{width:60px;height:60px;border-radius:50%;background-color:#dc3545;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:700;margin:0 auto 1rem}.error-message{color:#dc3545;margin:1rem 0;padding:.5rem;background-color:#f8d7da;border:1px solid #f5c6cb;border-radius:4px;font-size:.9rem}.error-actions{display:flex;gap:1rem;justify-content:center;margin-top:1.5rem}.retry-button,.home-button{padding:.75rem 1.5rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;font-weight:500;transition:background-color .2s}.retry-button{background-color:#007bff;color:#fff}.retry-button:hover{background-color:#0056b3}.home-button{background-color:#6c757d;color:#fff}.home-button:hover{background-color:#545b62}@media(max-width:480px){.oauth2-callback-content{margin:.5rem;padding:1.5rem}.error-actions{flex-direction:column}.retry-button,.home-button{width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1435
1435
  }
1436
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OAuth2CallbackComponent, decorators: [{
1436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: OAuth2CallbackComponent, decorators: [{
1437
1437
  type: Component,
1438
1438
  args: [{ selector: 'lib-oauth2-callback', standalone: true, imports: [CommonModule], template: `
1439
1439
  <div class="oauth2-callback-container">
@@ -1475,7 +1475,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1475
1475
  </div>
1476
1476
  </div>
1477
1477
  </div>
1478
- `, styles: [".oauth2-callback-container{display:flex;justify-content:center;align-items:center;min-height:100vh;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.oauth2-callback-content{background:#fff;border-radius:8px;padding:2rem;box-shadow:0 4px 6px #0000001a;text-align:center;max-width:400px;width:100%;margin:1rem}.loading-section h2,.success-section h2,.error-section h2{margin:1rem 0 .5rem;color:#333}.loading-section p,.success-section p{color:#666;margin-bottom:0}.spinner{border:3px solid #f3f3f3;border-top:3px solid #007bff;border-radius:50%;width:40px;height:40px;animation:spin 1s linear infinite;margin:0 auto 1rem}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.success-icon{width:60px;height:60px;border-radius:50%;background-color:#28a745;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:700;margin:0 auto 1rem}.error-icon{width:60px;height:60px;border-radius:50%;background-color:#dc3545;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:700;margin:0 auto 1rem}.error-message{color:#dc3545;margin:1rem 0;padding:.5rem;background-color:#f8d7da;border:1px solid #f5c6cb;border-radius:4px;font-size:.9rem}.error-actions{display:flex;gap:1rem;justify-content:center;margin-top:1.5rem}.retry-button,.home-button{padding:.75rem 1.5rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;font-weight:500;transition:background-color .2s}.retry-button{background-color:#007bff;color:#fff}.retry-button:hover{background-color:#0056b3}.home-button{background-color:#6c757d;color:#fff}.home-button:hover{background-color:#545b62}@media (max-width: 480px){.oauth2-callback-content{margin:.5rem;padding:1.5rem}.error-actions{flex-direction:column}.retry-button,.home-button{width:100%}}\n"] }]
1478
+ `, styles: [".oauth2-callback-container{display:flex;justify-content:center;align-items:center;min-height:100vh;background-color:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.oauth2-callback-content{background:#fff;border-radius:8px;padding:2rem;box-shadow:0 4px 6px #0000001a;text-align:center;max-width:400px;width:100%;margin:1rem}.loading-section h2,.success-section h2,.error-section h2{margin:1rem 0 .5rem;color:#333}.loading-section p,.success-section p{color:#666;margin-bottom:0}.spinner{border:3px solid #f3f3f3;border-top:3px solid #007bff;border-radius:50%;width:40px;height:40px;animation:spin 1s linear infinite;margin:0 auto 1rem}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.success-icon{width:60px;height:60px;border-radius:50%;background-color:#28a745;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:700;margin:0 auto 1rem}.error-icon{width:60px;height:60px;border-radius:50%;background-color:#dc3545;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:700;margin:0 auto 1rem}.error-message{color:#dc3545;margin:1rem 0;padding:.5rem;background-color:#f8d7da;border:1px solid #f5c6cb;border-radius:4px;font-size:.9rem}.error-actions{display:flex;gap:1rem;justify-content:center;margin-top:1.5rem}.retry-button,.home-button{padding:.75rem 1.5rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;font-weight:500;transition:background-color .2s}.retry-button{background-color:#007bff;color:#fff}.retry-button:hover{background-color:#0056b3}.home-button{background-color:#6c757d;color:#fff}.home-button:hover{background-color:#545b62}@media(max-width:480px){.oauth2-callback-content{margin:.5rem;padding:1.5rem}.error-actions{flex-direction:column}.retry-button,.home-button{width:100%}}\n"] }]
1479
1479
  }], ctorParameters: () => [{ type: OAuth2Service }, { type: i2.Router }, { type: Object, decorators: [{
1480
1480
  type: Inject,
1481
1481
  args: [PLATFORM_ID]
@@ -1677,11 +1677,11 @@ class NgOAuth2PkceModule {
1677
1677
  ]
1678
1678
  };
1679
1679
  }
1680
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgOAuth2PkceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1681
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: NgOAuth2PkceModule, imports: [CommonModule] });
1682
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgOAuth2PkceModule, imports: [CommonModule] });
1680
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgOAuth2PkceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1681
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.2", ngImport: i0, type: NgOAuth2PkceModule, imports: [CommonModule] });
1682
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgOAuth2PkceModule, imports: [CommonModule] });
1683
1683
  }
1684
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgOAuth2PkceModule, decorators: [{
1684
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: NgOAuth2PkceModule, decorators: [{
1685
1685
  type: NgModule,
1686
1686
  args: [{
1687
1687
  imports: [CommonModule],