@dontdrinkandroot/ngx-extensions 0.7.0 → 0.20.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 (39) hide show
  1. package/fesm2022/dontdrinkandroot-ngx-extensions.mjs +174 -749
  2. package/fesm2022/dontdrinkandroot-ngx-extensions.mjs.map +1 -1
  3. package/index.d.ts +161 -5
  4. package/package.json +4 -3
  5. package/public-api.d.ts +0 -25
  6. package/src/cookie/cookie.service.d.ts +0 -41
  7. package/src/ddr-extensions.module.d.ts +0 -11
  8. package/src/http/redirect-to-login-interceptor.service.d.ts +0 -15
  9. package/src/http/url-info.d.ts +0 -13
  10. package/src/http/with-credentials-interceptor.service.d.ts +0 -11
  11. package/src/image/lazy-image.directive.d.ts +0 -29
  12. package/src/jwt/jwt-interceptor.service.d.ts +0 -14
  13. package/src/jwt/jwt-refresh-token-interceptor.service.d.ts +0 -18
  14. package/src/jwt/jwt-token-response.d.ts +0 -4
  15. package/src/jwt/jwt.service.d.ts +0 -48
  16. package/src/logger/console-logger.service.d.ts +0 -22
  17. package/src/logger/logger.service.d.ts +0 -10
  18. package/src/methoddecorator/debounce.d.ts +0 -1
  19. package/src/methoddecorator/limit.d.ts +0 -1
  20. package/src/oauth/json-web-token.d.ts +0 -30
  21. package/src/oauth/oauth2-access-token-interceptor.service.d.ts +0 -14
  22. package/src/oauth/oauth2-config.d.ts +0 -9
  23. package/src/oauth/oauth2-error.d.ts +0 -5
  24. package/src/oauth/oauth2-refresh-token-interceptor.service.d.ts +0 -14
  25. package/src/oauth/oauth2.module.d.ts +0 -9
  26. package/src/oauth/oauth2.service.d.ts +0 -35
  27. package/src/oauth/redirect-to-oauth2-login-interceptor.service.d.ts +0 -18
  28. package/src/oauth/token-response.d.ts +0 -6
  29. package/src/scroll/bottom-hit.directive.d.ts +0 -13
  30. package/src/scroll/scroll.service.d.ts +0 -12
  31. package/src/storage/local-storage.service.d.ts +0 -23
  32. package/src/storage/storage.service.d.ts +0 -7
  33. package/src/typeguard/is-non-null.d.ts +0 -1
  34. package/src/util/collection-utils.d.ts +0 -10
  35. package/src/util/number-utils.d.ts +0 -3
  36. package/src/util/object-utils.d.ts +0 -4
  37. package/src/util/string-utils.d.ts +0 -6
  38. package/src/util/type-utils.d.ts +0 -3
  39. package/src/visibility/visibility.service.d.ts +0 -9
@@ -1,14 +0,0 @@
1
- import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { JwtService } from './jwt.service';
4
- import * as i0 from "@angular/core";
5
- export declare class JwtInterceptor implements HttpInterceptor {
6
- private jwtService;
7
- constructor(jwtService: JwtService);
8
- /**
9
- * @override
10
- */
11
- intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<JwtInterceptor, never>;
13
- static ɵprov: i0.ɵɵInjectableDeclaration<JwtInterceptor>;
14
- }
@@ -1,18 +0,0 @@
1
- import { HttpClient, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { JwtService } from './jwt.service';
4
- import * as i0 from "@angular/core";
5
- export declare class JwtRefreshTokenInterceptor implements HttpInterceptor {
6
- private jwtService;
7
- private httpClient;
8
- private jwtRefreshTokenUrl;
9
- private refreshTokenRequest$;
10
- constructor(jwtService: JwtService, httpClient: HttpClient, jwtRefreshTokenUrl: string);
11
- /**
12
- * @override
13
- */
14
- intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
15
- private getRefreshTokenRequest;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<JwtRefreshTokenInterceptor, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<JwtRefreshTokenInterceptor>;
18
- }
@@ -1,4 +0,0 @@
1
- export interface JwtTokenResponse {
2
- token: string;
3
- refresh_token: string;
4
- }
@@ -1,48 +0,0 @@
1
- import { StorageService } from '../storage/storage.service';
2
- import { Logger } from '../logger/logger.service';
3
- import * as i0 from "@angular/core";
4
- export declare class JwtService {
5
- private storageService;
6
- private loggerService;
7
- /**
8
- * The current token.
9
- */
10
- private token;
11
- /**
12
- * The expiry of the current token.
13
- */
14
- private tokenExpiry;
15
- constructor(storageService: StorageService, loggerService: Logger);
16
- /**
17
- * Sets the current token and a refresh token.
18
- */
19
- setTokens(token: string, refreshToken: string): void;
20
- /**
21
- * Sets the current token.
22
- */
23
- setToken(token: string): void;
24
- /**
25
- * Gets the current token.
26
- */
27
- getToken(): string | null;
28
- /**
29
- * Gets the refresh token.
30
- */
31
- getRefreshToken(): string | null;
32
- /**
33
- * Checks if the current token expired.
34
- */
35
- isExpired(): boolean;
36
- /**
37
- * Checks if the current token is about to expire.
38
- * @param expiryMs
39
- */
40
- isAboutToExpire(expiryMs?: number): boolean;
41
- /**
42
- * Clears all token information.
43
- */
44
- clear(): void;
45
- private getRefreshTokenStorageKey;
46
- static ɵfac: i0.ɵɵFactoryDeclaration<JwtService, never>;
47
- static ɵprov: i0.ɵɵInjectableDeclaration<JwtService>;
48
- }
@@ -1,22 +0,0 @@
1
- import { Logger } from './logger.service';
2
- import * as i0 from "@angular/core";
3
- export declare class ConsoleLogger extends Logger {
4
- /**
5
- * @override
6
- */
7
- debug(...data: unknown[]): void;
8
- /**
9
- * @override
10
- */
11
- info(...data: unknown[]): void;
12
- /**
13
- * @override
14
- */
15
- warn(...data: unknown[]): void;
16
- /**
17
- * @override
18
- */
19
- error(...data: unknown[]): void;
20
- static ɵfac: i0.ɵɵFactoryDeclaration<ConsoleLogger, never>;
21
- static ɵprov: i0.ɵɵInjectableDeclaration<ConsoleLogger>;
22
- }
@@ -1,10 +0,0 @@
1
- export declare abstract class Logger {
2
- debugEnabled: boolean;
3
- infoEnabled: boolean;
4
- warnEnabled: boolean;
5
- errorEnabled: boolean;
6
- abstract debug(...data: unknown[]): void;
7
- abstract info(...data: unknown[]): void;
8
- abstract warn(...data: unknown[]): void;
9
- abstract error(...data: unknown[]): void;
10
- }
@@ -1 +0,0 @@
1
- export declare function Debounce(delay?: number): MethodDecorator;
@@ -1 +0,0 @@
1
- export declare function Limit(rate?: number): MethodDecorator;
@@ -1,30 +0,0 @@
1
- export interface JsonWebToken {
2
- /**
3
- * Audience
4
- */
5
- aud: string;
6
- /**
7
- * Expiration Time
8
- */
9
- exp: number;
10
- /**
11
- * Issued At
12
- */
13
- iat: number;
14
- /**
15
- * JWT ID
16
- */
17
- jti: string;
18
- /**
19
- * Not Before
20
- */
21
- nbf: number;
22
- /**
23
- * Scopes
24
- */
25
- scopes: string[];
26
- /**
27
- * Subject
28
- */
29
- sub: string;
30
- }
@@ -1,14 +0,0 @@
1
- import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { OAuth2Service } from './oauth2.service';
4
- import * as i0 from "@angular/core";
5
- export declare class OAuth2AccessTokenInterceptor implements HttpInterceptor {
6
- private oAuth2Service;
7
- constructor(oAuth2Service: OAuth2Service);
8
- /**
9
- * @override
10
- */
11
- intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<OAuth2AccessTokenInterceptor, never>;
13
- static ɵprov: i0.ɵɵInjectableDeclaration<OAuth2AccessTokenInterceptor>;
14
- }
@@ -1,9 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export declare const DDR_OAUTH2_CONFIG: InjectionToken<OAuth2Config>;
3
- export declare class OAuth2Config {
4
- readonly clientId: string;
5
- readonly redirectUri: string;
6
- readonly authorizeUri: string;
7
- readonly tokenUri: string;
8
- constructor(clientId: string, redirectUri: string, authorizeUri: string, tokenUri: string);
9
- }
@@ -1,5 +0,0 @@
1
- export declare class OAuth2Error extends Error {
2
- static readonly CODE_NOT_FOUND = "code_not_found";
3
- static readonly ACCESS_DENIED = "access_denied";
4
- constructor(error: string);
5
- }
@@ -1,14 +0,0 @@
1
- import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { OAuth2Service } from './oauth2.service';
4
- import * as i0 from "@angular/core";
5
- export declare class OAuth2RefreshTokenInterceptor implements HttpInterceptor {
6
- private oAuth2Service;
7
- constructor(oAuth2Service: OAuth2Service);
8
- /**
9
- * @override
10
- */
11
- intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<OAuth2RefreshTokenInterceptor, never>;
13
- static ɵprov: i0.ɵɵInjectableDeclaration<OAuth2RefreshTokenInterceptor>;
14
- }
@@ -1,9 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { OAuth2Config } from './oauth2-config';
3
- import * as i0 from "@angular/core";
4
- export declare class OAuth2Module {
5
- static forRoot(config: OAuth2Config): ModuleWithProviders<OAuth2Module>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<OAuth2Module, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<OAuth2Module, never, never, never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<OAuth2Module>;
9
- }
@@ -1,35 +0,0 @@
1
- import { ActivatedRoute } from '@angular/router';
2
- import { Observable } from 'rxjs';
3
- import { HttpClient, HttpRequest } from '@angular/common/http';
4
- import { JsonWebToken } from './json-web-token';
5
- import { OAuth2Config } from './oauth2-config';
6
- import { Logger } from '../logger/logger.service';
7
- import * as i0 from "@angular/core";
8
- export declare class OAuth2Service {
9
- private route;
10
- private httpClient;
11
- private loggerService;
12
- private config;
13
- private static STORAGE_KEY_CHALLENGE;
14
- private static STORAGE_KEY_REFRESH_TOKEN;
15
- static STORAGE_KEY_RETURN_URL: string;
16
- private accessTokenString;
17
- private accessToken;
18
- private readonly REFRESH_MARGIN_SECONDS;
19
- private refreshTokenRequest$;
20
- constructor(route: ActivatedRoute, httpClient: HttpClient, loggerService: Logger, config: OAuth2Config);
21
- redirectToLogin(): void;
22
- handleCode(): Observable<JsonWebToken>;
23
- private createChallenge;
24
- private getRefreshToken;
25
- getAccessTokenString(): string | null;
26
- isAccessTokenExpired(): boolean;
27
- isRefreshPossibleAndRequired(req?: HttpRequest<unknown> | null): boolean;
28
- performRefresh(): Observable<JsonWebToken>;
29
- private processTokenResponse;
30
- clear(): void;
31
- setReturnUrl(url: string): void;
32
- getReturnUrl(): string | null;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<OAuth2Service, never>;
34
- static ɵprov: i0.ɵɵInjectableDeclaration<OAuth2Service>;
35
- }
@@ -1,18 +0,0 @@
1
- import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { Router } from '@angular/router';
4
- import { OAuth2Service } from './oauth2.service';
5
- import { OAuth2Config } from './oauth2-config';
6
- import * as i0 from "@angular/core";
7
- export declare class RedirectToOAuth2LoginInterceptor implements HttpInterceptor {
8
- private oAuth2Service;
9
- private router;
10
- private oAuth2Config;
11
- constructor(oAuth2Service: OAuth2Service, router: Router, oAuth2Config: OAuth2Config);
12
- /**
13
- * @override
14
- */
15
- intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<RedirectToOAuth2LoginInterceptor, never>;
17
- static ɵprov: i0.ɵɵInjectableDeclaration<RedirectToOAuth2LoginInterceptor>;
18
- }
@@ -1,6 +0,0 @@
1
- export interface TokenResponse {
2
- token_type: string;
3
- expires_in: number;
4
- access_token: string;
5
- refresh_token: string;
6
- }
@@ -1,13 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class BottomHitDirective {
4
- offset: number;
5
- windowBottomHit: EventEmitter<any>;
6
- private elementBottomHit;
7
- scrolled($event: Event): void;
8
- windowScrolled(): void;
9
- protected windowScrollEvent(): void;
10
- protected elementScrollEvent($event: Event): void;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<BottomHitDirective, never>;
12
- static ɵdir: i0.ɵɵDirectiveDeclaration<BottomHitDirective, "[ddrBottomHit]", never, {}, { "windowBottomHit": "windowBottomHit"; "elementBottomHit": "elementBottomHit"; }, never, never, false, never>;
13
- }
@@ -1,12 +0,0 @@
1
- import { Router } from '@angular/router';
2
- import { ViewportScroller } from '@angular/common';
3
- import * as i0 from "@angular/core";
4
- export declare class ScrollService {
5
- private router;
6
- private viewportScroller;
7
- private scrollPositionMap;
8
- constructor(router: Router, viewportScroller: ViewportScroller);
9
- restore(): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<ScrollService, never>;
11
- static ɵprov: i0.ɵɵInjectableDeclaration<ScrollService>;
12
- }
@@ -1,23 +0,0 @@
1
- import { StorageService } from './storage.service';
2
- import { Logger } from '../logger/logger.service';
3
- import * as i0 from "@angular/core";
4
- export declare class LocalStorageService extends StorageService {
5
- protected storagePrefix: string;
6
- protected logger: Logger;
7
- constructor(storagePrefix: string, logger: Logger);
8
- /**
9
- * @override
10
- */
11
- retrieve<T>(key: string, defaultValue?: T | null): T | null;
12
- /**
13
- * @override
14
- */
15
- store<T>(key: string, value: T): void;
16
- /**
17
- * @override
18
- */
19
- remove(key: string): void;
20
- protected getFullKey(key: string): string;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<LocalStorageService, never>;
22
- static ɵprov: i0.ɵɵInjectableDeclaration<LocalStorageService>;
23
- }
@@ -1,7 +0,0 @@
1
- import { InjectionToken } from "@angular/core";
2
- export declare const DDR_STORAGE_PREFIX: InjectionToken<string>;
3
- export declare abstract class StorageService {
4
- abstract store<T>(key: string, value: T): void;
5
- abstract retrieve<T>(key: string, defaultValue?: T): T | null;
6
- abstract remove(key: string): void;
7
- }
@@ -1 +0,0 @@
1
- export declare function isNonNull<T>(value: T): value is NonNullable<T>;
@@ -1,10 +0,0 @@
1
- export declare class CollectionUtils {
2
- /**
3
- * Maps an array into a Map by a specific property which should be unique.
4
- */
5
- static mapByProperty<V extends object, K extends keyof V>(entries: V[], property: K): Map<V[K], V>;
6
- /**
7
- * Maps an array into a Map by a specified property and aggregates them into an array.
8
- */
9
- static mapArrayByProperty<V extends object, K extends keyof V>(entries: V[], property: K): Map<V[K], V[]>;
10
- }
@@ -1,3 +0,0 @@
1
- export declare class NumberUtils {
2
- static getNextPowerOfTwo(value: number): number;
3
- }
@@ -1,4 +0,0 @@
1
- export declare class ObjectUtils {
2
- static deepCopy<T>(value: T): T;
3
- static getProperty<T, K extends keyof T>(o: T, propertyName: K): T[K];
4
- }
@@ -1,6 +0,0 @@
1
- export declare class StringUtils {
2
- static capitalizeFirstLetter(text: string): string;
3
- static stripTrailingSlash(text: string): string;
4
- static updateUrlParameter(uri: string, key: string, value: string): string;
5
- static createRandomString(lengthOfCode: number, possible: string): string;
6
- }
@@ -1,3 +0,0 @@
1
- export declare class TypeUtils {
2
- static notNull<T>(value: T | null | undefined, message?: string): T;
3
- }
@@ -1,9 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import * as i0 from "@angular/core";
3
- export declare class VisibilityService {
4
- private readonly visibility$;
5
- constructor();
6
- getVisibilityObservable(): Observable<boolean>;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<VisibilityService, never>;
8
- static ɵprov: i0.ɵɵInjectableDeclaration<VisibilityService>;
9
- }