@myrmidon/auth-jwt-admin 1.0.6 → 2.0.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/esm2022/lib/auth-jwt-admin.module.mjs +120 -0
  2. package/esm2022/lib/components/auth-jwt-registration/auth-jwt-registration.component.mjs +165 -0
  3. package/esm2022/lib/components/confirm-dialog/confirm-dialog.component.mjs +30 -0
  4. package/esm2022/lib/components/password-strength-bar/password-strength-bar.component.mjs +81 -0
  5. package/esm2022/lib/components/state/user-list.repository.mjs +145 -0
  6. package/esm2022/lib/components/user-editor/user-editor.component.mjs +113 -0
  7. package/esm2022/lib/components/user-filter/user-filter.component.mjs +56 -0
  8. package/{esm2020 → esm2022}/lib/components/user-list/user-list.component.mjs +71 -70
  9. package/esm2022/lib/services/auth-jwt-account.service.mjs +182 -0
  10. package/esm2022/lib/services/dialog.service.mjs +38 -0
  11. package/{esm2020 → esm2022}/lib/validators/password.validators.mjs +48 -48
  12. package/{esm2020 → esm2022}/myrmidon-auth-jwt-admin.mjs +4 -4
  13. package/{esm2020 → esm2022}/public-api.mjs +11 -11
  14. package/{fesm2020 → fesm2022}/myrmidon-auth-jwt-admin.mjs +919 -919
  15. package/{fesm2020 → fesm2022}/myrmidon-auth-jwt-admin.mjs.map +1 -1
  16. package/index.d.ts +5 -5
  17. package/lib/auth-jwt-admin.module.d.ts +30 -30
  18. package/lib/components/auth-jwt-registration/auth-jwt-registration.component.d.ts +37 -37
  19. package/lib/components/confirm-dialog/confirm-dialog.component.d.ts +15 -15
  20. package/lib/components/password-strength-bar/password-strength-bar.component.d.ts +17 -17
  21. package/lib/components/state/user-list.repository.d.ts +36 -36
  22. package/lib/components/user-editor/user-editor.component.d.ts +29 -29
  23. package/lib/components/user-filter/user-filter.component.d.ts +21 -21
  24. package/lib/components/user-list/user-list.component.d.ts +29 -29
  25. package/lib/services/auth-jwt-account.service.d.ts +114 -114
  26. package/lib/services/dialog.service.d.ts +19 -19
  27. package/lib/validators/password.validators.d.ts +6 -6
  28. package/package.json +24 -17
  29. package/public-api.d.ts +8 -8
  30. package/esm2020/lib/auth-jwt-admin.module.mjs +0 -119
  31. package/esm2020/lib/components/auth-jwt-registration/auth-jwt-registration.component.mjs +0 -164
  32. package/esm2020/lib/components/confirm-dialog/confirm-dialog.component.mjs +0 -29
  33. package/esm2020/lib/components/password-strength-bar/password-strength-bar.component.mjs +0 -80
  34. package/esm2020/lib/components/state/user-list.repository.mjs +0 -144
  35. package/esm2020/lib/components/user-editor/user-editor.component.mjs +0 -112
  36. package/esm2020/lib/components/user-filter/user-filter.component.mjs +0 -55
  37. package/esm2020/lib/services/auth-jwt-account.service.mjs +0 -181
  38. package/esm2020/lib/services/dialog.service.mjs +0 -37
  39. package/fesm2015/myrmidon-auth-jwt-admin.mjs +0 -998
  40. package/fesm2015/myrmidon-auth-jwt-admin.mjs.map +0 -1
@@ -1,37 +1,37 @@
1
- import { EventEmitter } from '@angular/core';
2
- import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
3
- import { MatSnackBar } from '@angular/material/snack-bar';
4
- import { AuthJwtAccountService } from '../../services/auth-jwt-account.service';
5
- import * as i0 from "@angular/core";
6
- export declare class AuthJwtRegistrationComponent {
7
- private _snackbar;
8
- private _accountService;
9
- busy: boolean | undefined;
10
- form: FormGroup;
11
- email: FormControl<string>;
12
- name: FormControl<string>;
13
- firstName: FormControl<string>;
14
- lastName: FormControl<string>;
15
- password: FormControl<string>;
16
- confirmPassword: FormControl<string>;
17
- /**
18
- * Emitted when a user was successfully registered. Usually
19
- * you should handle this to move away from the registration
20
- * page.
21
- */
22
- registered: EventEmitter<any>;
23
- constructor(formBuilder: FormBuilder, _snackbar: MatSnackBar, _accountService: AuthJwtAccountService);
24
- /**
25
- * Creates a unique name validator. There is no dependency injection at this level,
26
- * but we can use closures. As a matter of fact, we have access to the service instance
27
- * from the component where we register validators. So we will implement a function
28
- * that will accept the service as parameter, and create the actual validation function.
29
- * This function will have access to the service when called during the validation process.
30
- * See http://restlet.com/blog/2016/02/17/implementing-angular2-forms-beyond-basics-part-2/.
31
- */
32
- private getUniqueNameValidator;
33
- private getUniqueEmailValidator;
34
- onSubmit(): void;
35
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthJwtRegistrationComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<AuthJwtRegistrationComponent, "auth-jwt-registration", never, {}, { "registered": "registered"; }, never, never, false, never>;
37
- }
1
+ import { EventEmitter } from '@angular/core';
2
+ import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
3
+ import { MatSnackBar } from '@angular/material/snack-bar';
4
+ import { AuthJwtAccountService } from '../../services/auth-jwt-account.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class AuthJwtRegistrationComponent {
7
+ private _snackbar;
8
+ private _accountService;
9
+ busy: boolean | undefined;
10
+ form: FormGroup;
11
+ email: FormControl<string>;
12
+ name: FormControl<string>;
13
+ firstName: FormControl<string>;
14
+ lastName: FormControl<string>;
15
+ password: FormControl<string>;
16
+ confirmPassword: FormControl<string>;
17
+ /**
18
+ * Emitted when a user was successfully registered. Usually
19
+ * you should handle this to move away from the registration
20
+ * page.
21
+ */
22
+ registered: EventEmitter<any>;
23
+ constructor(formBuilder: FormBuilder, _snackbar: MatSnackBar, _accountService: AuthJwtAccountService);
24
+ /**
25
+ * Creates a unique name validator. There is no dependency injection at this level,
26
+ * but we can use closures. As a matter of fact, we have access to the service instance
27
+ * from the component where we register validators. So we will implement a function
28
+ * that will accept the service as parameter, and create the actual validation function.
29
+ * This function will have access to the service when called during the validation process.
30
+ * See http://restlet.com/blog/2016/02/17/implementing-angular2-forms-beyond-basics-part-2/.
31
+ */
32
+ private getUniqueNameValidator;
33
+ private getUniqueEmailValidator;
34
+ onSubmit(): void;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthJwtRegistrationComponent, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<AuthJwtRegistrationComponent, "auth-jwt-registration", never, {}, { "registered": "registered"; }, never, never, false, never>;
37
+ }
@@ -1,15 +1,15 @@
1
- import { OnInit } from '@angular/core';
2
- import { MatDialogRef } from '@angular/material/dialog';
3
- import * as i0 from "@angular/core";
4
- export declare class ConfirmDialogComponent implements OnInit {
5
- dialogRef: MatDialogRef<ConfirmDialogComponent>;
6
- data: any;
7
- title: string;
8
- prompt: string;
9
- ok: string;
10
- cancel: string;
11
- constructor(dialogRef: MatDialogRef<ConfirmDialogComponent>, data: any);
12
- ngOnInit(): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, [null, { optional: true; }]>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "ng-component", never, {}, {}, never, never, false, never>;
15
- }
1
+ import { OnInit } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ConfirmDialogComponent implements OnInit {
5
+ dialogRef: MatDialogRef<ConfirmDialogComponent>;
6
+ data: any;
7
+ title: string;
8
+ prompt: string;
9
+ ok: string;
10
+ cancel: string;
11
+ constructor(dialogRef: MatDialogRef<ConfirmDialogComponent>, data: any);
12
+ ngOnInit(): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, [null, { optional: true; }]>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "ng-component", never, {}, {}, never, never, false, never>;
15
+ }
@@ -1,17 +1,17 @@
1
- import { OnChanges, EventEmitter, SimpleChange } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class PasswordStrengthBarComponent implements OnChanges {
4
- private _colors;
5
- passwordToCheck: string | undefined;
6
- strengthChange: EventEmitter<number>;
7
- bars: string[];
8
- constructor();
9
- private measureStrength;
10
- private getColor;
11
- ngOnChanges(changes: {
12
- [propName: string]: SimpleChange;
13
- }): void;
14
- private setBarColors;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<PasswordStrengthBarComponent, never>;
16
- static ɵcmp: i0.ɵɵComponentDeclaration<PasswordStrengthBarComponent, "auth-jwt-password-strength-bar", never, { "passwordToCheck": "passwordToCheck"; }, { "strengthChange": "strengthChange"; }, never, never, false, never>;
17
- }
1
+ import { OnChanges, EventEmitter, SimpleChange } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class PasswordStrengthBarComponent implements OnChanges {
4
+ private _colors;
5
+ passwordToCheck: string | undefined;
6
+ strengthChange: EventEmitter<number>;
7
+ bars: string[];
8
+ constructor();
9
+ private measureStrength;
10
+ private getColor;
11
+ ngOnChanges(changes: {
12
+ [propName: string]: SimpleChange;
13
+ }): void;
14
+ private setBarColors;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<PasswordStrengthBarComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<PasswordStrengthBarComponent, "auth-jwt-password-strength-bar", never, { "passwordToCheck": { "alias": "passwordToCheck"; "required": false; }; }, { "strengthChange": "strengthChange"; }, never, never, false, never>;
17
+ }
@@ -1,36 +1,36 @@
1
- import { Observable } from 'rxjs';
2
- import { PaginationData } from '@ngneat/elf-pagination';
3
- import { StatusState } from '@ngneat/elf-requests';
4
- import { User } from '@myrmidon/auth-jwt-login';
5
- import { AuthJwtAccountService, UserFilter } from '../../services/auth-jwt-account.service';
6
- import * as i0 from "@angular/core";
7
- export interface UserListProps {
8
- filter: UserFilter;
9
- }
10
- export declare class UserListRepository {
11
- private _accService;
12
- private _store;
13
- private _lastPageSize;
14
- private _loading$;
15
- private _saving$;
16
- activeUser$: Observable<User | undefined>;
17
- filter$: Observable<UserFilter>;
18
- pagination$: Observable<PaginationData & {
19
- data: User[];
20
- }>;
21
- status$: Observable<StatusState>;
22
- loading$: Observable<boolean>;
23
- saving$: Observable<boolean>;
24
- constructor(_accService: AuthJwtAccountService);
25
- private createStore;
26
- private adaptPage;
27
- private addPage;
28
- loadPage(pageNumber: number, pageSize?: number): void;
29
- setFilter(filter: UserFilter): void;
30
- clearCache(): void;
31
- setActive(name: string | null): void;
32
- updateActive(user: User): Promise<boolean>;
33
- deleteUser(name: string): Promise<boolean>;
34
- static ɵfac: i0.ɵɵFactoryDeclaration<UserListRepository, never>;
35
- static ɵprov: i0.ɵɵInjectableDeclaration<UserListRepository>;
36
- }
1
+ import { Observable } from 'rxjs';
2
+ import { PaginationData } from '@ngneat/elf-pagination';
3
+ import { StatusState } from '@ngneat/elf-requests';
4
+ import { User } from '@myrmidon/auth-jwt-login';
5
+ import { AuthJwtAccountService, UserFilter } from '../../services/auth-jwt-account.service';
6
+ import * as i0 from "@angular/core";
7
+ export interface UserListProps {
8
+ filter: UserFilter;
9
+ }
10
+ export declare class UserListRepository {
11
+ private _accService;
12
+ private _store;
13
+ private _lastPageSize;
14
+ private _loading$;
15
+ private _saving$;
16
+ activeUser$: Observable<User | undefined>;
17
+ filter$: Observable<UserFilter>;
18
+ pagination$: Observable<PaginationData & {
19
+ data: User[];
20
+ }>;
21
+ status$: Observable<StatusState>;
22
+ loading$: Observable<boolean>;
23
+ saving$: Observable<boolean>;
24
+ constructor(_accService: AuthJwtAccountService);
25
+ private createStore;
26
+ private adaptPage;
27
+ private addPage;
28
+ loadPage(pageNumber: number, pageSize?: number): void;
29
+ setFilter(filter: UserFilter): void;
30
+ clearCache(): void;
31
+ setActive(name: string | null): void;
32
+ updateActive(user: User): Promise<boolean>;
33
+ deleteUser(name: string): Promise<boolean>;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserListRepository, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<UserListRepository>;
36
+ }
@@ -1,29 +1,29 @@
1
- import { OnInit, EventEmitter } from '@angular/core';
2
- import { UntypedFormGroup, UntypedFormControl, UntypedFormBuilder } from '@angular/forms';
3
- import { AuthJwtService, User } from '@myrmidon/auth-jwt-login';
4
- import * as i0 from "@angular/core";
5
- export declare class UserEditorComponent implements OnInit {
6
- private _authService;
7
- private _user;
8
- email: UntypedFormControl;
9
- emailConfirmed: UntypedFormControl;
10
- lockoutEnabled: UntypedFormControl;
11
- firstName: UntypedFormControl;
12
- lastName: UntypedFormControl;
13
- roles: UntypedFormControl;
14
- form: UntypedFormGroup;
15
- unlocked: boolean | undefined;
16
- set user(value: User | undefined);
17
- get user(): User | undefined;
18
- userChange: EventEmitter<User>;
19
- editorClose: EventEmitter<any>;
20
- constructor(formBuilder: UntypedFormBuilder, _authService: AuthJwtService);
21
- ngOnInit(): void;
22
- private updateForm;
23
- private getUserFromForm;
24
- endLockout(): void;
25
- close(): void;
26
- save(): void;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<UserEditorComponent, never>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<UserEditorComponent, "auth-jwt-user-editor", never, { "user": "user"; }, { "userChange": "userChange"; "editorClose": "editorClose"; }, never, never, false, never>;
29
- }
1
+ import { OnInit, EventEmitter } from '@angular/core';
2
+ import { UntypedFormGroup, UntypedFormControl, UntypedFormBuilder } from '@angular/forms';
3
+ import { AuthJwtService, User } from '@myrmidon/auth-jwt-login';
4
+ import * as i0 from "@angular/core";
5
+ export declare class UserEditorComponent implements OnInit {
6
+ private _authService;
7
+ private _user;
8
+ email: UntypedFormControl;
9
+ emailConfirmed: UntypedFormControl;
10
+ lockoutEnabled: UntypedFormControl;
11
+ firstName: UntypedFormControl;
12
+ lastName: UntypedFormControl;
13
+ roles: UntypedFormControl;
14
+ form: UntypedFormGroup;
15
+ unlocked: boolean | undefined;
16
+ set user(value: User | undefined);
17
+ get user(): User | undefined;
18
+ userChange: EventEmitter<User>;
19
+ editorClose: EventEmitter<any>;
20
+ constructor(formBuilder: UntypedFormBuilder, _authService: AuthJwtService);
21
+ ngOnInit(): void;
22
+ private updateForm;
23
+ private getUserFromForm;
24
+ endLockout(): void;
25
+ close(): void;
26
+ save(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserEditorComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserEditorComponent, "auth-jwt-user-editor", never, { "user": { "alias": "user"; "required": false; }; }, { "userChange": "userChange"; "editorClose": "editorClose"; }, never, never, false, never>;
29
+ }
@@ -1,21 +1,21 @@
1
- import { OnInit } from '@angular/core';
2
- import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
- import { Observable } from 'rxjs';
4
- import { UserFilter } from '../../services/auth-jwt-account.service';
5
- import { UserListRepository } from '../state/user-list.repository';
6
- import * as i0 from "@angular/core";
7
- export declare class UserFilterComponent implements OnInit {
8
- private _repository;
9
- disabled: boolean | undefined;
10
- filter$: Observable<UserFilter>;
11
- name: FormControl<string | null>;
12
- form: FormGroup;
13
- constructor(formBuilder: FormBuilder, _repository: UserListRepository);
14
- ngOnInit(): void;
15
- private updateForm;
16
- reset(): void;
17
- private getFilter;
18
- apply(): void;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<UserFilterComponent, never>;
20
- static ɵcmp: i0.ɵɵComponentDeclaration<UserFilterComponent, "auth-jwt-user-filter", never, { "disabled": "disabled"; }, {}, never, never, false, never>;
21
- }
1
+ import { OnInit } from '@angular/core';
2
+ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
3
+ import { Observable } from 'rxjs';
4
+ import { UserFilter } from '../../services/auth-jwt-account.service';
5
+ import { UserListRepository } from '../state/user-list.repository';
6
+ import * as i0 from "@angular/core";
7
+ export declare class UserFilterComponent implements OnInit {
8
+ private _repository;
9
+ disabled: boolean | undefined;
10
+ filter$: Observable<UserFilter>;
11
+ name: FormControl<string | null>;
12
+ form: FormGroup;
13
+ constructor(formBuilder: FormBuilder, _repository: UserListRepository);
14
+ ngOnInit(): void;
15
+ private updateForm;
16
+ reset(): void;
17
+ private getFilter;
18
+ apply(): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserFilterComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserFilterComponent, "auth-jwt-user-filter", never, { "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, false, never>;
21
+ }
@@ -1,29 +1,29 @@
1
- import { PageEvent } from '@angular/material/paginator';
2
- import { Observable } from 'rxjs';
3
- import '@angular/localize/init';
4
- import { PaginationData } from '@ngneat/elf-pagination';
5
- import { GravatarService, User } from '@myrmidon/auth-jwt-login';
6
- import { DialogService } from '../../services/dialog.service';
7
- import { UserListRepository } from '../state/user-list.repository';
8
- import * as i0 from "@angular/core";
9
- export declare class UserListComponent {
10
- private _repository;
11
- private _dialogService;
12
- private _gravatarService;
13
- pagination$: Observable<PaginationData & {
14
- data: User[];
15
- }>;
16
- active$: Observable<User | undefined>;
17
- loading$: Observable<boolean>;
18
- constructor(_repository: UserListRepository, _dialogService: DialogService, _gravatarService: GravatarService);
19
- pageChange(event: PageEvent): void;
20
- deleteUser(user: User): void;
21
- setActiveUser(user: User | null): void;
22
- resetActiveUser(): void;
23
- saveActiveUser(user: User): void;
24
- onUserEditorClose(): void;
25
- getGravatarUrl(email: string, size?: number): string | null;
26
- clearCache(): void;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<UserListComponent, never>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<UserListComponent, "auth-jwt-user-list", never, {}, {}, never, never, false, never>;
29
- }
1
+ import { PageEvent } from '@angular/material/paginator';
2
+ import { Observable } from 'rxjs';
3
+ import '@angular/localize/init';
4
+ import { PaginationData } from '@ngneat/elf-pagination';
5
+ import { GravatarService, User } from '@myrmidon/auth-jwt-login';
6
+ import { DialogService } from '../../services/dialog.service';
7
+ import { UserListRepository } from '../state/user-list.repository';
8
+ import * as i0 from "@angular/core";
9
+ export declare class UserListComponent {
10
+ private _repository;
11
+ private _dialogService;
12
+ private _gravatarService;
13
+ pagination$: Observable<PaginationData & {
14
+ data: User[];
15
+ }>;
16
+ active$: Observable<User | undefined>;
17
+ loading$: Observable<boolean>;
18
+ constructor(_repository: UserListRepository, _dialogService: DialogService, _gravatarService: GravatarService);
19
+ pageChange(event: PageEvent): void;
20
+ deleteUser(user: User): void;
21
+ setActiveUser(user: User | null): void;
22
+ resetActiveUser(): void;
23
+ saveActiveUser(user: User): void;
24
+ onUserEditorClose(): void;
25
+ getGravatarUrl(email: string, size?: number): string | null;
26
+ clearCache(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserListComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserListComponent, "auth-jwt-user-list", never, {}, {}, never, never, false, never>;
29
+ }
@@ -1,114 +1,114 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { DataPage, EnvService, ErrorService } from '@myrmidon/ng-tools';
4
- import { User } from '@myrmidon/auth-jwt-login';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * User registration model. You can expand this interface to add more data.
8
- */
9
- export interface RegistrationModel {
10
- email: string;
11
- name: string;
12
- firstName?: string;
13
- lastName?: string;
14
- password: string;
15
- }
16
- /**
17
- * Result of an existing resource check.
18
- */
19
- export interface ExistResult {
20
- entry: string;
21
- isExisting: boolean;
22
- }
23
- /**
24
- * Password change data.
25
- */
26
- export interface PasswordChange {
27
- email: string;
28
- oldPassword: string;
29
- newPassword: string;
30
- confirmPassword: string;
31
- }
32
- /**
33
- * User filter parameters.
34
- */
35
- export interface UserFilter {
36
- name?: string;
37
- }
38
- export declare class AuthJwtAccountService {
39
- private _http;
40
- private _error;
41
- private _env;
42
- constructor(_http: HttpClient, _error: ErrorService, _env: EnvService);
43
- /**
44
- * Checks if the specified email address is registered on the server.
45
- * @param email email address to test.
46
- * @returns result.
47
- */
48
- isEmailRegistered(email: string): Observable<ExistResult>;
49
- /**
50
- * Checks if the specified user's given name is registered on the server.
51
- * This name is a nickname chosen by users during registration, and is the key
52
- * used for referencing users when talking to the server.
53
- * @param name name to test.
54
- * @returns result.
55
- */
56
- isNameRegistered(name: string): Observable<ExistResult>;
57
- /**
58
- * Register the user with the specified registration data.
59
- * @param registration The registration data.
60
- * @param confirmed True to automatically confirm the user's email address
61
- * without sending the confirmation email message.
62
- */
63
- register(registration: RegistrationModel, confirmed?: boolean): Observable<any>;
64
- /**
65
- * Resend the confirmation email to the specified address.
66
- * @param email address.
67
- */
68
- resendConfirmEmail(email: string): Observable<any>;
69
- /**
70
- * Request a password reset for the specified email address.
71
- * @param email Email address.
72
- */
73
- requestPasswordReset(email: string): Observable<any>;
74
- getAllUsers(): Observable<DataPage<User>>;
75
- getUsers(filter: UserFilter, pageNumber?: number, pageSize?: number): Observable<DataPage<User>>;
76
- /**
77
- * Get the top N users matching the specified name filter.
78
- * @param nameFilter The user name filter.
79
- * @param limit The maximum number of users to get.
80
- */
81
- getTopUsers(nameFilter: string, limit?: number): Observable<User[]>;
82
- /**
83
- * Get information about all the users listed in the specified names.
84
- * @param names User(s) names.
85
- */
86
- getUsersFromNames(names: string[]): Observable<User[]>;
87
- /**
88
- * Get data about the specified user.
89
- * @param name The user name.
90
- */
91
- getUser(name: string): Observable<User>;
92
- /**
93
- * Update the editable data for the specified user.
94
- * @param user The user to update.
95
- */
96
- updateUser(user: User): Observable<any>;
97
- /**
98
- * Request a password reset email for the specified email address.
99
- * @param email The email address to receive the reset message.
100
- */
101
- resetPassword(email: string): Observable<any>;
102
- /**
103
- * Change the password.
104
- * @param change The password change data.
105
- */
106
- changePassword(change: PasswordChange): Observable<any>;
107
- /**
108
- * Delete the user with the specified username.
109
- * @param name The user name.
110
- */
111
- deleteUser(name: string): Observable<any>;
112
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthJwtAccountService, never>;
113
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthJwtAccountService>;
114
- }
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { DataPage, EnvService, ErrorService } from '@myrmidon/ng-tools';
4
+ import { User } from '@myrmidon/auth-jwt-login';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * User registration model. You can expand this interface to add more data.
8
+ */
9
+ export interface RegistrationModel {
10
+ email: string;
11
+ name: string;
12
+ firstName?: string;
13
+ lastName?: string;
14
+ password: string;
15
+ }
16
+ /**
17
+ * Result of an existing resource check.
18
+ */
19
+ export interface ExistResult {
20
+ entry: string;
21
+ isExisting: boolean;
22
+ }
23
+ /**
24
+ * Password change data.
25
+ */
26
+ export interface PasswordChange {
27
+ email: string;
28
+ oldPassword: string;
29
+ newPassword: string;
30
+ confirmPassword: string;
31
+ }
32
+ /**
33
+ * User filter parameters.
34
+ */
35
+ export interface UserFilter {
36
+ name?: string;
37
+ }
38
+ export declare class AuthJwtAccountService {
39
+ private _http;
40
+ private _error;
41
+ private _env;
42
+ constructor(_http: HttpClient, _error: ErrorService, _env: EnvService);
43
+ /**
44
+ * Checks if the specified email address is registered on the server.
45
+ * @param email email address to test.
46
+ * @returns result.
47
+ */
48
+ isEmailRegistered(email: string): Observable<ExistResult>;
49
+ /**
50
+ * Checks if the specified user's given name is registered on the server.
51
+ * This name is a nickname chosen by users during registration, and is the key
52
+ * used for referencing users when talking to the server.
53
+ * @param name name to test.
54
+ * @returns result.
55
+ */
56
+ isNameRegistered(name: string): Observable<ExistResult>;
57
+ /**
58
+ * Register the user with the specified registration data.
59
+ * @param registration The registration data.
60
+ * @param confirmed True to automatically confirm the user's email address
61
+ * without sending the confirmation email message.
62
+ */
63
+ register(registration: RegistrationModel, confirmed?: boolean): Observable<any>;
64
+ /**
65
+ * Resend the confirmation email to the specified address.
66
+ * @param email address.
67
+ */
68
+ resendConfirmEmail(email: string): Observable<any>;
69
+ /**
70
+ * Request a password reset for the specified email address.
71
+ * @param email Email address.
72
+ */
73
+ requestPasswordReset(email: string): Observable<any>;
74
+ getAllUsers(): Observable<DataPage<User>>;
75
+ getUsers(filter: UserFilter, pageNumber?: number, pageSize?: number): Observable<DataPage<User>>;
76
+ /**
77
+ * Get the top N users matching the specified name filter.
78
+ * @param nameFilter The user name filter.
79
+ * @param limit The maximum number of users to get.
80
+ */
81
+ getTopUsers(nameFilter: string, limit?: number): Observable<User[]>;
82
+ /**
83
+ * Get information about all the users listed in the specified names.
84
+ * @param names User(s) names.
85
+ */
86
+ getUsersFromNames(names: string[]): Observable<User[]>;
87
+ /**
88
+ * Get data about the specified user.
89
+ * @param name The user name.
90
+ */
91
+ getUser(name: string): Observable<User>;
92
+ /**
93
+ * Update the editable data for the specified user.
94
+ * @param user The user to update.
95
+ */
96
+ updateUser(user: User): Observable<any>;
97
+ /**
98
+ * Request a password reset email for the specified email address.
99
+ * @param email The email address to receive the reset message.
100
+ */
101
+ resetPassword(email: string): Observable<any>;
102
+ /**
103
+ * Change the password.
104
+ * @param change The password change data.
105
+ */
106
+ changePassword(change: PasswordChange): Observable<any>;
107
+ /**
108
+ * Delete the user with the specified username.
109
+ * @param name The user name.
110
+ */
111
+ deleteUser(name: string): Observable<any>;
112
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthJwtAccountService, never>;
113
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthJwtAccountService>;
114
+ }
@@ -1,19 +1,19 @@
1
- import { MatDialog } from '@angular/material/dialog';
2
- import { Observable } from 'rxjs';
3
- import * as i0 from "@angular/core";
4
- /**
5
- * This service acts as a wrapper for MatDialog to simplify the process of calling
6
- * the dialog and subscribing to it. What it will do is create an Instance of
7
- * MatDialog with our custom component (ConfirmDialogComponent). Then it will set
8
- * any public properties it needs to by setting the properties on the
9
- * componentInstance object. It will return the observable afterClosed()
10
- * to the caller so they can subscribe to it. This will emit an event whenever
11
- * the dialog is closed.
12
- */
13
- export declare class DialogService {
14
- private dialog;
15
- constructor(dialog: MatDialog);
16
- confirm(title: string, prompt: string, ok?: string, cancel?: string): Observable<boolean>;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
18
- static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
19
- }
1
+ import { MatDialog } from '@angular/material/dialog';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * This service acts as a wrapper for MatDialog to simplify the process of calling
6
+ * the dialog and subscribing to it. What it will do is create an Instance of
7
+ * MatDialog with our custom component (ConfirmDialogComponent). Then it will set
8
+ * any public properties it needs to by setting the properties on the
9
+ * componentInstance object. It will return the observable afterClosed()
10
+ * to the caller so they can subscribe to it. This will emit an event whenever
11
+ * the dialog is closed.
12
+ */
13
+ export declare class DialogService {
14
+ private dialog;
15
+ constructor(dialog: MatDialog);
16
+ confirm(title: string, prompt: string, ok?: string, cancel?: string): Observable<boolean>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
19
+ }