@mintplayer/ng-spark-auth 0.0.8 → 0.2.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 (40) hide show
  1. package/fesm2022/mintplayer-ng-spark-auth-auth-bar.mjs +29 -0
  2. package/fesm2022/mintplayer-ng-spark-auth-auth-bar.mjs.map +1 -0
  3. package/fesm2022/mintplayer-ng-spark-auth-core.mjs +106 -0
  4. package/fesm2022/mintplayer-ng-spark-auth-core.mjs.map +1 -0
  5. package/fesm2022/mintplayer-ng-spark-auth-forgot-password.mjs +58 -0
  6. package/fesm2022/mintplayer-ng-spark-auth-forgot-password.mjs.map +1 -0
  7. package/fesm2022/mintplayer-ng-spark-auth-guards.mjs +23 -0
  8. package/fesm2022/mintplayer-ng-spark-auth-guards.mjs.map +1 -0
  9. package/fesm2022/mintplayer-ng-spark-auth-interceptors.mjs +26 -0
  10. package/fesm2022/mintplayer-ng-spark-auth-interceptors.mjs.map +1 -0
  11. package/fesm2022/mintplayer-ng-spark-auth-login.mjs +72 -0
  12. package/fesm2022/mintplayer-ng-spark-auth-login.mjs.map +1 -0
  13. package/fesm2022/mintplayer-ng-spark-auth-models.mjs +17 -0
  14. package/fesm2022/mintplayer-ng-spark-auth-models.mjs.map +1 -0
  15. package/fesm2022/mintplayer-ng-spark-auth-pipes.mjs +23 -0
  16. package/fesm2022/mintplayer-ng-spark-auth-pipes.mjs.map +1 -0
  17. package/fesm2022/mintplayer-ng-spark-auth-register.mjs +86 -0
  18. package/fesm2022/mintplayer-ng-spark-auth-register.mjs.map +1 -0
  19. package/fesm2022/mintplayer-ng-spark-auth-reset-password.mjs +90 -0
  20. package/fesm2022/mintplayer-ng-spark-auth-reset-password.mjs.map +1 -0
  21. package/fesm2022/mintplayer-ng-spark-auth-routes.mjs +52 -0
  22. package/fesm2022/mintplayer-ng-spark-auth-routes.mjs.map +1 -0
  23. package/fesm2022/mintplayer-ng-spark-auth-two-factor.mjs +73 -0
  24. package/fesm2022/mintplayer-ng-spark-auth-two-factor.mjs.map +1 -0
  25. package/fesm2022/mintplayer-ng-spark-auth.mjs +16 -521
  26. package/fesm2022/mintplayer-ng-spark-auth.mjs.map +1 -1
  27. package/package.json +50 -2
  28. package/types/mintplayer-ng-spark-auth-auth-bar.d.ts +14 -0
  29. package/types/mintplayer-ng-spark-auth-core.d.ts +33 -0
  30. package/types/mintplayer-ng-spark-auth-forgot-password.d.ts +23 -0
  31. package/types/mintplayer-ng-spark-auth-guards.d.ts +5 -0
  32. package/types/mintplayer-ng-spark-auth-interceptors.d.ts +5 -0
  33. package/types/mintplayer-ng-spark-auth-login.d.ts +27 -0
  34. package/types/mintplayer-ng-spark-auth-models.d.ts +33 -0
  35. package/types/mintplayer-ng-spark-auth-pipes.d.ts +11 -0
  36. package/types/mintplayer-ng-spark-auth-register.d.ts +25 -0
  37. package/types/mintplayer-ng-spark-auth-reset-password.d.ts +30 -0
  38. package/types/mintplayer-ng-spark-auth-routes.d.ts +5 -0
  39. package/types/mintplayer-ng-spark-auth-two-factor.d.ts +28 -0
  40. package/types/mintplayer-ng-spark-auth.d.ts +5 -191
@@ -1,195 +1,9 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, Type, PipeTransform, EnvironmentProviders, OnInit } from '@angular/core';
3
- import { HttpInterceptorFn, HttpFeature, HttpFeatureKind } from '@angular/common/http';
4
- import { CanActivateFn } from '@angular/router';
5
- import * as _mintplayer_ng_spark_auth from '@mintplayer/ng-spark-auth';
6
- import * as _angular_forms from '@angular/forms';
7
- import { Color } from '@mintplayer/ng-bootstrap';
8
-
9
- interface AuthUser {
10
- isAuthenticated: boolean;
11
- userName: string;
12
- email: string;
13
- roles: string[];
14
- }
15
-
16
- interface SparkAuthConfig {
17
- apiBasePath: string;
18
- defaultRedirectUrl: string;
19
- loginUrl: string;
20
- }
21
- declare const SPARK_AUTH_CONFIG: InjectionToken<SparkAuthConfig>;
22
- declare const defaultSparkAuthConfig: SparkAuthConfig;
23
-
24
- type SparkAuthRouteEntry = string | {
25
- path: string;
26
- component?: Type<unknown>;
27
- };
28
- interface SparkAuthRouteConfig {
29
- login?: SparkAuthRouteEntry;
30
- twoFactor?: SparkAuthRouteEntry;
31
- register?: SparkAuthRouteEntry;
32
- forgotPassword?: SparkAuthRouteEntry;
33
- resetPassword?: SparkAuthRouteEntry;
34
- }
35
- type SparkAuthRoutePaths = Required<Record<keyof SparkAuthRouteConfig, string>>;
36
- declare const SPARK_AUTH_ROUTE_PATHS: InjectionToken<Required<Record<keyof SparkAuthRouteConfig, string>>>;
37
-
38
- declare class SparkAuthService {
39
- private readonly http;
40
- private readonly config;
41
- private readonly currentUser;
42
- readonly user: i0.Signal<AuthUser>;
43
- readonly isAuthenticated: i0.Signal<boolean>;
44
- constructor();
45
- login(email: string, password: string): Promise<void>;
46
- loginTwoFactor(twoFactorCode: string, twoFactorRecoveryCode?: string): Promise<void>;
47
- register(email: string, password: string): Promise<void>;
48
- logout(): Promise<void>;
49
- csrfRefresh(): Promise<void>;
50
- checkAuth(): Promise<AuthUser | null>;
51
- forgotPassword(email: string): Promise<void>;
52
- resetPassword(email: string, resetCode: string, newPassword: string): Promise<void>;
53
- static ɵfac: i0.ɵɵFactoryDeclaration<SparkAuthService, never>;
54
- static ɵprov: i0.ɵɵInjectableDeclaration<SparkAuthService>;
55
- }
56
-
57
- declare class SparkAuthTranslationService {
58
- private readonly http;
59
- private readonly translationsMap;
60
- constructor();
61
- private loadTranslations;
62
- t(key: string): string;
63
- static ɵfac: i0.ɵɵFactoryDeclaration<SparkAuthTranslationService, never>;
64
- static ɵprov: i0.ɵɵInjectableDeclaration<SparkAuthTranslationService>;
65
- }
66
-
67
- declare class TranslateKeyPipe implements PipeTransform {
68
- private readonly translation;
69
- transform(key: string): string;
70
- static ɵfac: i0.ɵɵFactoryDeclaration<TranslateKeyPipe, never>;
71
- static ɵpipe: i0.ɵɵPipeDeclaration<TranslateKeyPipe, "t", true>;
72
- }
73
-
74
- declare const sparkAuthInterceptor: HttpInterceptorFn;
75
-
76
- declare const sparkAuthGuard: CanActivateFn;
1
+ import { SparkAuthConfig } from '@mintplayer/ng-spark-auth/models';
2
+ export { SPARK_AUTH_CONFIG, SparkAuthConfig, defaultSparkAuthConfig } from '@mintplayer/ng-spark-auth/models';
3
+ import { EnvironmentProviders } from '@angular/core';
4
+ import { HttpFeature, HttpFeatureKind } from '@angular/common/http';
77
5
 
78
6
  declare function provideSparkAuth(config?: Partial<SparkAuthConfig>): EnvironmentProviders;
79
7
  declare function withSparkAuth(): HttpFeature<HttpFeatureKind>[];
80
8
 
81
- declare function sparkAuthRoutes(config?: SparkAuthRouteConfig): any[];
82
-
83
- declare class SparkAuthBarComponent {
84
- readonly authService: SparkAuthService;
85
- readonly config: _mintplayer_ng_spark_auth.SparkAuthConfig;
86
- private readonly router;
87
- onLogout(): Promise<void>;
88
- static ɵfac: i0.ɵɵFactoryDeclaration<SparkAuthBarComponent, never>;
89
- static ɵcmp: i0.ɵɵComponentDeclaration<SparkAuthBarComponent, "spark-auth-bar", never, {}, {}, never, never, true, never>;
90
- }
91
-
92
- declare class SparkLoginComponent {
93
- private readonly fb;
94
- private readonly authService;
95
- private readonly router;
96
- private readonly route;
97
- private readonly config;
98
- private readonly translation;
99
- readonly routePaths: Required<Record<keyof _mintplayer_ng_spark_auth.SparkAuthRouteConfig, string>>;
100
- colors: typeof Color;
101
- readonly loading: i0.WritableSignal<boolean>;
102
- readonly errorMessage: i0.WritableSignal<string>;
103
- readonly form: _angular_forms.FormGroup<{
104
- email: _angular_forms.FormControl<string>;
105
- password: _angular_forms.FormControl<string>;
106
- rememberMe: _angular_forms.FormControl<boolean>;
107
- }>;
108
- onSubmit(): Promise<void>;
109
- static ɵfac: i0.ɵɵFactoryDeclaration<SparkLoginComponent, never>;
110
- static ɵcmp: i0.ɵɵComponentDeclaration<SparkLoginComponent, "spark-login", never, {}, {}, never, never, true, never>;
111
- }
112
-
113
- declare class SparkTwoFactorComponent {
114
- private readonly fb;
115
- private readonly authService;
116
- private readonly router;
117
- private readonly route;
118
- private readonly config;
119
- private readonly translation;
120
- readonly routePaths: Required<Record<keyof _mintplayer_ng_spark_auth.SparkAuthRouteConfig, string>>;
121
- colors: typeof Color;
122
- readonly loading: i0.WritableSignal<boolean>;
123
- readonly errorMessage: i0.WritableSignal<string>;
124
- readonly useRecoveryCode: i0.WritableSignal<boolean>;
125
- readonly form: _angular_forms.FormGroup<{
126
- code: _angular_forms.FormControl<string>;
127
- recoveryCode: _angular_forms.FormControl<string>;
128
- }>;
129
- toggleRecoveryCode(): void;
130
- onSubmit(): Promise<void>;
131
- static ɵfac: i0.ɵɵFactoryDeclaration<SparkTwoFactorComponent, never>;
132
- static ɵcmp: i0.ɵɵComponentDeclaration<SparkTwoFactorComponent, "spark-two-factor", never, {}, {}, never, never, true, never>;
133
- }
134
-
135
- declare class SparkRegisterComponent {
136
- private readonly fb;
137
- private readonly authService;
138
- private readonly router;
139
- private readonly translation;
140
- readonly routePaths: Required<Record<keyof _mintplayer_ng_spark_auth.SparkAuthRouteConfig, string>>;
141
- colors: typeof Color;
142
- readonly loading: i0.WritableSignal<boolean>;
143
- readonly errorMessage: i0.WritableSignal<string>;
144
- readonly form: _angular_forms.FormGroup<{
145
- email: _angular_forms.FormControl<string>;
146
- password: _angular_forms.FormControl<string>;
147
- confirmPassword: _angular_forms.FormControl<string>;
148
- }>;
149
- onSubmit(): Promise<void>;
150
- static ɵfac: i0.ɵɵFactoryDeclaration<SparkRegisterComponent, never>;
151
- static ɵcmp: i0.ɵɵComponentDeclaration<SparkRegisterComponent, "spark-register", never, {}, {}, never, never, true, never>;
152
- }
153
-
154
- declare class SparkForgotPasswordComponent {
155
- private readonly fb;
156
- private readonly authService;
157
- private readonly translation;
158
- readonly routePaths: Required<Record<keyof _mintplayer_ng_spark_auth.SparkAuthRouteConfig, string>>;
159
- colors: typeof Color;
160
- readonly loading: i0.WritableSignal<boolean>;
161
- readonly errorMessage: i0.WritableSignal<string>;
162
- readonly successMessage: i0.WritableSignal<string>;
163
- readonly form: _angular_forms.FormGroup<{
164
- email: _angular_forms.FormControl<string>;
165
- }>;
166
- onSubmit(): Promise<void>;
167
- static ɵfac: i0.ɵɵFactoryDeclaration<SparkForgotPasswordComponent, never>;
168
- static ɵcmp: i0.ɵɵComponentDeclaration<SparkForgotPasswordComponent, "spark-forgot-password", never, {}, {}, never, never, true, never>;
169
- }
170
-
171
- declare class SparkResetPasswordComponent implements OnInit {
172
- private readonly fb;
173
- private readonly authService;
174
- private readonly router;
175
- private readonly route;
176
- private readonly translation;
177
- readonly routePaths: Required<Record<keyof _mintplayer_ng_spark_auth.SparkAuthRouteConfig, string>>;
178
- colors: typeof Color;
179
- readonly loading: i0.WritableSignal<boolean>;
180
- readonly errorMessage: i0.WritableSignal<string>;
181
- readonly successMessage: i0.WritableSignal<string>;
182
- private email;
183
- private code;
184
- readonly form: _angular_forms.FormGroup<{
185
- newPassword: _angular_forms.FormControl<string>;
186
- confirmPassword: _angular_forms.FormControl<string>;
187
- }>;
188
- ngOnInit(): void;
189
- onSubmit(): Promise<void>;
190
- static ɵfac: i0.ɵɵFactoryDeclaration<SparkResetPasswordComponent, never>;
191
- static ɵcmp: i0.ɵɵComponentDeclaration<SparkResetPasswordComponent, "spark-reset-password", never, {}, {}, never, never, true, never>;
192
- }
193
-
194
- export { SPARK_AUTH_CONFIG, SPARK_AUTH_ROUTE_PATHS, SparkAuthBarComponent, SparkAuthService, SparkAuthTranslationService, SparkForgotPasswordComponent, SparkLoginComponent, SparkRegisterComponent, SparkResetPasswordComponent, SparkTwoFactorComponent, TranslateKeyPipe, defaultSparkAuthConfig, provideSparkAuth, sparkAuthGuard, sparkAuthInterceptor, sparkAuthRoutes, withSparkAuth };
195
- export type { AuthUser, SparkAuthConfig, SparkAuthRouteConfig, SparkAuthRouteEntry, SparkAuthRoutePaths };
9
+ export { provideSparkAuth, withSparkAuth };