@myclub_se/data-access 3.1.19 → 3.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 (76) hide show
  1. package/esm2022/lib/api-models/api-auth/api-auth-member.mjs +1 -1
  2. package/esm2022/lib/api-models/api-auth/api-auth-section.mjs +1 -1
  3. package/esm2022/lib/api-models/api-auth/api-auth-team.mjs +1 -1
  4. package/esm2022/lib/api-models/api-auth/api-auth.mjs +1 -1
  5. package/esm2022/lib/api-models/api-retrieve-2fa.mjs +2 -0
  6. package/esm2022/lib/api-models/api-search-team.mjs +1 -1
  7. package/esm2022/lib/api-models/api-user.mjs +1 -1
  8. package/esm2022/lib/api-models/index.mjs +2 -1
  9. package/esm2022/lib/authentication/authentication.service.mjs +3 -3
  10. package/esm2022/lib/models/auth/auth-member.mjs +4 -2
  11. package/esm2022/lib/models/auth/auth-section.mjs +8 -2
  12. package/esm2022/lib/models/auth/auth-team.mjs +4 -2
  13. package/esm2022/lib/models/auth/auth.mjs +10 -2
  14. package/esm2022/lib/models/index.mjs +2 -1
  15. package/esm2022/lib/models/retrieve-2fa.mjs +9 -0
  16. package/esm2022/lib/models/search-team.mjs +4 -2
  17. package/esm2022/lib/models/user.mjs +4 -2
  18. package/esm2022/lib/services/constant.service.mjs +5 -1
  19. package/esm2022/lib/services/factories/auth-factory.mjs +2 -2
  20. package/esm2022/lib/services/factories/auth-member-factory.mjs +2 -2
  21. package/esm2022/lib/services/factories/auth-section-factory.mjs +2 -2
  22. package/esm2022/lib/services/factories/auth-team-factory.mjs +2 -2
  23. package/esm2022/lib/services/factories/retrieve-2fa-factory.mjs +3 -0
  24. package/esm2022/lib/services/factories/search-team-factory.mjs +2 -2
  25. package/esm2022/lib/services/factories/user-factory.mjs +2 -2
  26. package/esm2022/lib/services/index.mjs +3 -2
  27. package/esm2022/lib/services/token.service.mjs +7 -3
  28. package/esm2022/lib/services/user.service.mjs +22 -1
  29. package/esm2022/lib/store/actions/auth.actions.mjs +5 -1
  30. package/esm2022/lib/store/actions/constant.actions.mjs +7 -1
  31. package/esm2022/lib/store/actions/token.actions.mjs +1 -1
  32. package/esm2022/lib/store/actions/user.actions.mjs +26 -1
  33. package/esm2022/lib/store/effects/auth.effects.mjs +5 -2
  34. package/esm2022/lib/store/effects/constant.effects.mjs +5 -2
  35. package/esm2022/lib/store/effects/token.effects.mjs +2 -2
  36. package/esm2022/lib/store/effects/user.effects.mjs +9 -2
  37. package/esm2022/lib/store/reducers/auth.reducer.mjs +3 -3
  38. package/esm2022/lib/store/reducers/constant.reducer.mjs +13 -2
  39. package/esm2022/lib/store/reducers/index.mjs +2 -1
  40. package/esm2022/lib/store/selectors/constant.selectors.mjs +2 -1
  41. package/esm2022/lib/store/state/constant.state.mjs +3 -2
  42. package/fesm2022/myclub_se-data-access.mjs +200 -78
  43. package/fesm2022/myclub_se-data-access.mjs.map +1 -1
  44. package/lib/api-models/api-auth/api-auth-member.d.ts +1 -0
  45. package/lib/api-models/api-auth/api-auth-section.d.ts +3 -0
  46. package/lib/api-models/api-auth/api-auth-team.d.ts +1 -0
  47. package/lib/api-models/api-auth/api-auth.d.ts +4 -0
  48. package/lib/api-models/api-retrieve-2fa.d.ts +4 -0
  49. package/lib/api-models/api-search-team.d.ts +1 -0
  50. package/lib/api-models/api-user.d.ts +2 -1
  51. package/lib/api-models/index.d.ts +1 -0
  52. package/lib/authentication/authentication.service.d.ts +1 -1
  53. package/lib/models/auth/auth-member.d.ts +2 -1
  54. package/lib/models/auth/auth-section.d.ts +4 -1
  55. package/lib/models/auth/auth-team.d.ts +2 -1
  56. package/lib/models/auth/auth.d.ts +5 -1
  57. package/lib/models/index.d.ts +1 -0
  58. package/lib/models/retrieve-2fa.d.ts +5 -0
  59. package/lib/models/search-team.d.ts +2 -1
  60. package/lib/models/user.d.ts +2 -1
  61. package/lib/services/constant.service.d.ts +1 -0
  62. package/lib/services/factories/retrieve-2fa-factory.d.ts +3 -0
  63. package/lib/services/index.d.ts +2 -1
  64. package/lib/services/token.service.d.ts +1 -1
  65. package/lib/services/user.service.d.ts +4 -0
  66. package/lib/store/actions/auth.actions.d.ts +4 -0
  67. package/lib/store/actions/constant.actions.d.ts +15 -1
  68. package/lib/store/actions/token.actions.d.ts +2 -0
  69. package/lib/store/actions/user.actions.d.ts +55 -2
  70. package/lib/store/effects/auth.effects.d.ts +1 -0
  71. package/lib/store/effects/constant.effects.d.ts +5 -0
  72. package/lib/store/effects/user.effects.d.ts +15 -1
  73. package/lib/store/reducers/index.d.ts +1 -0
  74. package/lib/store/selectors/constant.selectors.d.ts +1 -0
  75. package/lib/store/state/constant.state.d.ts +1 -0
  76. package/package.json +1 -1
@@ -2,4 +2,5 @@ export interface ApiAuthMember {
2
2
  id: string;
3
3
  readonly calendar_url: string;
4
4
  readonly name: string;
5
+ readonly member_admin_2fa_required: boolean;
5
6
  }
@@ -1,4 +1,7 @@
1
1
  export interface ApiAuthSection {
2
2
  id: string;
3
3
  name: string;
4
+ readonly section_admin_2fa_required: boolean;
5
+ readonly team_admin_2fa_required: boolean;
6
+ readonly member_admin_2fa_required: boolean;
4
7
  }
@@ -4,4 +4,5 @@ export interface ApiAuthTeam {
4
4
  readonly name: string;
5
5
  readonly calendar_url: string;
6
6
  section?: ApiAuthTeamSection;
7
+ team_admin_2fa_required: boolean;
7
8
  }
@@ -12,4 +12,8 @@ export interface ApiAuth {
12
12
  site_enabled: boolean;
13
13
  teams: ApiAuthTeam[];
14
14
  user_name: string;
15
+ readonly club_admin_2fa_required: boolean;
16
+ readonly section_admin_2fa_required: boolean;
17
+ readonly team_admin_2fa_required: boolean;
18
+ readonly member_admin_2fa_required: boolean;
15
19
  }
@@ -0,0 +1,4 @@
1
+ export interface ApiRetrieve2fa {
2
+ readonly qr_code: string;
3
+ readonly provisioning_uri: string;
4
+ }
@@ -8,4 +8,5 @@ export interface ApiSearchTeam {
8
8
  name: string;
9
9
  section_name: string | undefined;
10
10
  show_memberships: string;
11
+ readonly team_admin_2fa_required: boolean;
11
12
  }
@@ -6,7 +6,7 @@ export interface ApiUser {
6
6
  last_name: string;
7
7
  is_active: boolean;
8
8
  date_joined: string;
9
- myclub_account_id: number;
9
+ readonly myclub_account_id: number;
10
10
  new_email: string;
11
11
  num_logins: number;
12
12
  created: string;
@@ -15,4 +15,5 @@ export interface ApiUser {
15
15
  calendar_token: string;
16
16
  is_staff: boolean;
17
17
  device_token: string | null;
18
+ readonly two_fa_verified: boolean;
18
19
  }
@@ -48,6 +48,7 @@ export * from './api-overbooked-bookable-item';
48
48
  export * from './api-overbooked-location';
49
49
  export * from './api-partner';
50
50
  export * from './api-registration-qr-code';
51
+ export * from './api-retrieve-2fa';
51
52
  export * from './api-search-club';
52
53
  export * from './api-search-team';
53
54
  export * from './api-section';
@@ -22,7 +22,7 @@ export declare class AuthenticationService {
22
22
  currentToken$: Observable<Token | null>;
23
23
  get isAuthenticated(): boolean;
24
24
  constructor(apiService: ApiService, app: App, tokenService: TokenService);
25
- authenticateByCredentials(username: string, password: string): Observable<Token>;
25
+ authenticateByCredentials(username: string, password: string, totpCode?: string): Observable<Token>;
26
26
  authenticateByToken(token: string): Observable<Token>;
27
27
  clearAuthentication(): void;
28
28
  clearPublicAuthentication(): void;
@@ -2,7 +2,8 @@ export declare class AuthMember {
2
2
  id: string;
3
3
  name: string;
4
4
  calendar_url: string;
5
+ readonly memberAdmin2faRequired: boolean;
5
6
  eventColor: string;
6
7
  eventBackgroundColor: string;
7
- constructor(id: string, name: string, calendar_url: string);
8
+ constructor(id: string, name: string, calendar_url: string, memberAdmin2faRequired: boolean);
8
9
  }
@@ -1,5 +1,8 @@
1
1
  export declare class AuthSection {
2
2
  id: string;
3
3
  name: string;
4
- constructor(id: string, name: string);
4
+ readonly sectionAdmin2faRequired: boolean;
5
+ readonly teamAdmin2faRequired: boolean;
6
+ readonly memberAdmin2faRequired: boolean;
7
+ constructor(id: string, name: string, sectionAdmin2faRequired: boolean, teamAdmin2faRequired: boolean, memberAdmin2faRequired: boolean);
5
8
  }
@@ -4,5 +4,6 @@ export declare class AuthTeam {
4
4
  readonly calendar_url: string;
5
5
  readonly name: string;
6
6
  section: AuthTeamSection | null;
7
- constructor(id: string, calendar_url: string, name: string, section: AuthTeamSection | null);
7
+ readonly teamAdmin2faRequired: boolean;
8
+ constructor(id: string, calendar_url: string, name: string, section: AuthTeamSection | null, teamAdmin2faRequired: boolean);
8
9
  }
@@ -13,5 +13,9 @@ export declare class Auth {
13
13
  siteEnabled: boolean;
14
14
  teams: AuthTeam[] | SearchTeam[];
15
15
  user_name: string;
16
- constructor(id: string, name: string, clubAdmin: boolean, isSectionClub: boolean, members: AuthMember[], registrationEnabled: boolean, sections: AuthSection[], siteEnabled: boolean, teams: AuthTeam[] | SearchTeam[], user_name: string);
16
+ readonly clubAdmin2faRequired: boolean;
17
+ readonly sectionAdmin2faRequired: boolean;
18
+ readonly teamAdmin2faRequired: boolean;
19
+ readonly memberAdmin2faRequired: boolean;
20
+ constructor(id: string, name: string, clubAdmin: boolean, isSectionClub: boolean, members: AuthMember[], registrationEnabled: boolean, sections: AuthSection[], siteEnabled: boolean, teams: AuthTeam[] | SearchTeam[], user_name: string, clubAdmin2faRequired: boolean, sectionAdmin2faRequired: boolean, teamAdmin2faRequired: boolean, memberAdmin2faRequired: boolean);
17
21
  }
@@ -54,6 +54,7 @@ export * from './overbooked-location';
54
54
  export * from './partner';
55
55
  export * from './public-authentication';
56
56
  export * from './registration-qr-code';
57
+ export * from './retrieve-2fa';
57
58
  export * from './role';
58
59
  export * from './search-club';
59
60
  export * from './search-team';
@@ -0,0 +1,5 @@
1
+ export declare class Retrieve2fa {
2
+ readonly qrCode: string;
3
+ readonly provisioningUri: string;
4
+ constructor(qrCode: string, provisioningUri: string);
5
+ }
@@ -9,9 +9,10 @@ export declare class SearchTeam {
9
9
  name: string;
10
10
  section_name: string | undefined;
11
11
  show_memberships: string;
12
+ readonly teamAdmin2faRequired: boolean;
12
13
  static asFormGroup(team?: SearchTeam): FormGroup<{
13
14
  id: FormControl<string | null>;
14
15
  name: FormControl<string | null>;
15
16
  }>;
16
- constructor(club: Club | undefined, section: Section | undefined, id: string, club_name: string, name: string, section_name: string | undefined, show_memberships: string);
17
+ constructor(club: Club | undefined, section: Section | undefined, id: string, club_name: string, name: string, section_name: string | undefined, show_memberships: string, teamAdmin2faRequired: boolean);
17
18
  }
@@ -7,10 +7,11 @@ export declare class User {
7
7
  language: string;
8
8
  lastName: string;
9
9
  newEmail: string | null;
10
+ readonly twoFaVerified: boolean;
10
11
  newPassword: string;
11
12
  verifyPassword: string;
12
13
  password: string;
13
14
  static asFormGroup(user?: User | null): FormGroup;
14
- constructor(deviceToken: string | null, email: string, firstName: string, isStaff: boolean, language: string, lastName: string, newEmail: string | null, newPassword?: string, verifyPassword?: string, password?: string);
15
+ constructor(deviceToken: string | null, email: string, firstName: string, isStaff: boolean, language: string, lastName: string, newEmail: string | null, twoFaVerified: boolean, newPassword?: string, verifyPassword?: string, password?: string);
15
16
  name(): string;
16
17
  }
@@ -23,6 +23,7 @@ export declare class ConstantService {
23
23
  getBookingCalendarTypes(): Observable<Array<OptionInterface>>;
24
24
  getLanguages(): Observable<Array<OptionInterface>>;
25
25
  getMemberContactTypes(): Observable<Array<OptionInterface>>;
26
+ get2FAMethods(): Observable<Array<OptionInterface>>;
26
27
  private getConstants;
27
28
  static ɵfac: i0.ɵɵFactoryDeclaration<ConstantService, never>;
28
29
  static ɵprov: i0.ɵɵInjectableDeclaration<ConstantService>;
@@ -0,0 +1,3 @@
1
+ import { Retrieve2fa } from '../../models';
2
+ import { ApiRetrieve2fa } from '../../api-models';
3
+ export declare const retrieve2faFactory: (apiRetrieve2fa: ApiRetrieve2fa) => Retrieve2fa;
@@ -1,5 +1,6 @@
1
- export * from './auth.service';
2
1
  export * from './activity.service';
2
+ export * from './api.service';
3
+ export * from './auth.service';
3
4
  export * from './bookable.service';
4
5
  export * from './booking-calendar.service';
5
6
  export * from './club.service';
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
5
5
  export declare class TokenService {
6
6
  private apiService;
7
7
  constructor(apiService: ApiService);
8
- getTokenByCredentials(clientId: string, clientSecret: string, username: string, password: string): Observable<Token>;
8
+ getTokenByCredentials(clientId: string, clientSecret: string, username: string, password: string, totpCode?: string): Observable<Token>;
9
9
  getTokenByCode(clientId: string, clientSecret: string, code: string): Observable<Token>;
10
10
  getTokenByRefreshToken(clientId: string, clientSecret: string, refreshToken: string | null): Observable<Token | null>;
11
11
  getTokenBySession(): Observable<Token | null>;
@@ -5,12 +5,16 @@ import * as i0 from "@angular/core";
5
5
  export declare class UserService {
6
6
  private apiService;
7
7
  constructor(apiService: ApiService);
8
+ activate2fa(twoFaMethod: string): import("rxjs").Observable<boolean>;
8
9
  activateUser(uidb64: string, token: string): import("rxjs").Observable<boolean>;
9
10
  createUser(newAccount: NewAccountInterface): import("rxjs").Observable<boolean>;
11
+ deactivate2fa(): import("rxjs").Observable<boolean>;
10
12
  getCurrentUser(): import("rxjs").Observable<User>;
11
13
  removeCurrentUser(): import("rxjs").Observable<boolean>;
12
14
  resetPassword(email: string): import("rxjs").Observable<boolean>;
15
+ retrieve2faCode(): import("rxjs").Observable<import("../models").Retrieve2fa>;
13
16
  updateCurrentUser(user: User): import("rxjs").Observable<User>;
17
+ verify2faCode(totp_code: string): import("rxjs").Observable<boolean>;
14
18
  static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
15
19
  static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
16
20
  }
@@ -4,6 +4,8 @@ import { RemoveMemberAuthInterface, RemoveTeamAuthInterface } from '../interface
4
4
  export declare enum AuthActionType {
5
5
  Clear = "[Auth] Clear",
6
6
  ClearSuccess = "[Auth] Clear success",
7
+ ClearCurrent = "[Auth] Clear current",
8
+ ClearCurrentSuccess = "[Auth] Clear current success",
7
9
  GetCurrent = "[Auth] Get current",
8
10
  GetCurrentSuccess = "[Auth] Get current success",
9
11
  List = "[Auth] List",
@@ -25,6 +27,8 @@ export declare enum AuthActionType {
25
27
  }
26
28
  export declare const clearAuthenticationAction: import("@ngrx/store").ActionCreator<AuthActionType.Clear, () => import("@ngrx/store").Action<AuthActionType.Clear>>;
27
29
  export declare const clearAuthenticationSuccessAction: import("@ngrx/store").ActionCreator<AuthActionType.ClearSuccess, () => import("@ngrx/store").Action<AuthActionType.ClearSuccess>>;
30
+ export declare const clearCurrentAuthAction: import("@ngrx/store").ActionCreator<AuthActionType.ClearCurrent, () => import("@ngrx/store").Action<AuthActionType.ClearCurrent>>;
31
+ export declare const clearCurrentAuthSuccessAction: import("@ngrx/store").ActionCreator<AuthActionType.ClearCurrentSuccess, () => import("@ngrx/store").Action<AuthActionType.ClearCurrentSuccess>>;
28
32
  export declare const getCurrentAuthAction: import("@ngrx/store").ActionCreator<AuthActionType.GetCurrent, () => import("@ngrx/store").Action<AuthActionType.GetCurrent>>;
29
33
  export declare const getCurrentAuthSuccessAction: import("@ngrx/store").ActionCreator<AuthActionType.GetCurrentSuccess, (props: {
30
34
  payload: Auth | null;
@@ -58,7 +58,10 @@ export declare enum ConstantActionType {
58
58
  RetrieveBookingCalendarTypesFailure = "[Constant] Retrieve Booking Calendar Types failure",
59
59
  RetrieveFeatureFlags = "[Constant] Retrieve Feature Flags",
60
60
  RetrieveFeatureFlagsSuccess = "[Constant] Retrieve Feature Flags success",
61
- RetrieveFeatureFlagsFailure = "[Constant] Retrieve Feature Flags failure"
61
+ RetrieveFeatureFlagsFailure = "[Constant] Retrieve Feature Flags failure",
62
+ Retrieve2FAMethods = "[Constant] Retrieve 2FA methods",
63
+ Retrieve2FAMethodsFailure = "[Constant] Retrieve 2FA methods failure",
64
+ Retrieve2FAMethodsSuccess = "[Constant] Retrieve 2FA methods success"
62
65
  }
63
66
  export declare const retrieveLanguagesConstantsAction: import("@ngrx/store").ActionCreator<ConstantActionType.RetrieveLanguages, () => import("@ngrx/store").Action<ConstantActionType.RetrieveLanguages>>;
64
67
  export declare const retrieveLanguagesConstantsFailureAction: import("@ngrx/store").ActionCreator<ConstantActionType.RetrieveLanguagesFailure, (props: {
@@ -275,3 +278,14 @@ export declare const retrieveFeatureFlagsFailureAction: import("@ngrx/store").Ac
275
278
  }) => {
276
279
  payload: HttpErrorResponse;
277
280
  } & import("@ngrx/store").Action<ConstantActionType.RetrieveFeatureFlagsFailure>>;
281
+ export declare const retrieve2FAMethodsAction: import("@ngrx/store").ActionCreator<ConstantActionType.Retrieve2FAMethods, () => import("@ngrx/store").Action<ConstantActionType.Retrieve2FAMethods>>;
282
+ export declare const retrieve2FAMethodsFailureAction: import("@ngrx/store").ActionCreator<ConstantActionType.Retrieve2FAMethodsFailure, (props: {
283
+ payload: HttpErrorResponse;
284
+ }) => {
285
+ payload: HttpErrorResponse;
286
+ } & import("@ngrx/store").Action<ConstantActionType.Retrieve2FAMethodsFailure>>;
287
+ export declare const retrieve2FAMethodsSuccessAction: import("@ngrx/store").ActionCreator<ConstantActionType.Retrieve2FAMethodsSuccess, (props: {
288
+ payload: Array<OptionInterface>;
289
+ }) => {
290
+ payload: Array<OptionInterface>;
291
+ } & import("@ngrx/store").Action<ConstantActionType.Retrieve2FAMethodsSuccess>>;
@@ -39,11 +39,13 @@ export declare const loginTokenAction: import("@ngrx/store").ActionCreator<Token
39
39
  payload: {
40
40
  username: string;
41
41
  password: string;
42
+ totpCode?: string;
42
43
  };
43
44
  }) => {
44
45
  payload: {
45
46
  username: string;
46
47
  password: string;
48
+ totpCode?: string;
47
49
  };
48
50
  } & import("@ngrx/store").Action<TokenActionType.Login>>;
49
51
  export declare const loginTokenFailureAction: import("@ngrx/store").ActionCreator<TokenActionType.LoginFailure, (props: {
@@ -1,15 +1,22 @@
1
1
  import { HttpErrorResponse } from '@angular/common/http';
2
2
  import { NewAccountInterface } from '../../interfaces';
3
- import { User, UserNotification } from '../../models';
3
+ import { Retrieve2fa, User, UserNotification } from '../../models';
4
4
  import { ActivateUserInterface } from '../interfaces';
5
5
  export declare enum UserActionType {
6
6
  Activate = "[User] Activate",
7
7
  ActivateFailure = "[User] Activate failure",
8
8
  ActivateSuccess = "[User] Activate Success",
9
+ Activate2FA = "[User] Activate 2FA",
10
+ Activate2FAFailure = "[User] Activate 2FA failure",
11
+ Activate2FASuccess = "[User] Activate 2FA success",
9
12
  ClearUserNotifications = "[User] Clear user notifications",
10
13
  Create = "[User] Create",
11
14
  CreateFailure = "[User] Create failure",
12
15
  CreateSuccess = "[User] Create success",
16
+ Deactivate2FA = "[User] Deactivate 2FA",
17
+ Deactivate2FAFailure = "[User] Deactivate 2FA failure",
18
+ Deactivate2FASuccess = "[User] Deactivate 2FA success",
19
+ Get = "[User] Get",
13
20
  GetCurrent = "[User] Get current",
14
21
  GetCurrentFailure = "[User] Get current failure",
15
22
  GetCurrentSuccess = "[User] Get current success",
@@ -22,9 +29,15 @@ export declare enum UserActionType {
22
29
  ResetPassword = "[User] Reset password",
23
30
  ResetPasswordFailure = "[User] Reset password failure",
24
31
  ResetPasswordSuccess = "[User] Reset password success",
32
+ Retrieve2FACode = "[User] Retrieve 2FA code",
33
+ Retrieve2FACodeFailure = "[User] Retrieve 2FA code failure",
34
+ Retrieve2FACodeSuccess = "[User] Retrieve 2FA code success",
25
35
  UpdateCurrent = "[User] Update current",
26
36
  UpdateCurrentFailure = "[User] Update current failure",
27
- UpdateCurrentSuccess = "[User] Update success"
37
+ UpdateCurrentSuccess = "[User] Update success",
38
+ Verify2FA = "[User] Verify 2FA",
39
+ Verify2FAFailure = "[User] Verify 2FA failure",
40
+ Verify2FASuccess = "[User] Verify 2FA success"
28
41
  }
29
42
  export declare const activateUserAction: import("@ngrx/store").ActionCreator<UserActionType.Activate, (props: {
30
43
  payload: ActivateUserInterface;
@@ -33,6 +46,17 @@ export declare const activateUserAction: import("@ngrx/store").ActionCreator<Use
33
46
  } & import("@ngrx/store").Action<UserActionType.Activate>>;
34
47
  export declare const activateUserFailureAction: import("@ngrx/store").ActionCreator<UserActionType.ActivateFailure, () => import("@ngrx/store").Action<UserActionType.ActivateFailure>>;
35
48
  export declare const activateUserSuccessAction: import("@ngrx/store").ActionCreator<UserActionType.ActivateSuccess, () => import("@ngrx/store").Action<UserActionType.ActivateSuccess>>;
49
+ export declare const activate2FAUserAction: import("@ngrx/store").ActionCreator<UserActionType.Activate2FA, (props: {
50
+ payload: string;
51
+ }) => {
52
+ payload: string;
53
+ } & import("@ngrx/store").Action<UserActionType.Activate2FA>>;
54
+ export declare const activate2FAUserFailureAction: import("@ngrx/store").ActionCreator<UserActionType.Activate2FAFailure, (props: {
55
+ payload: HttpErrorResponse;
56
+ }) => {
57
+ payload: HttpErrorResponse;
58
+ } & import("@ngrx/store").Action<UserActionType.Activate2FAFailure>>;
59
+ export declare const activate2FAUserSuccessAction: import("@ngrx/store").ActionCreator<UserActionType.Activate2FASuccess, () => import("@ngrx/store").Action<UserActionType.Activate2FASuccess>>;
36
60
  export declare const clearUserNotificationsAction: import("@ngrx/store").ActionCreator<UserActionType.ClearUserNotifications, () => import("@ngrx/store").Action<UserActionType.ClearUserNotifications>>;
37
61
  export declare const createUserAction: import("@ngrx/store").ActionCreator<UserActionType.Create, (props: {
38
62
  payload: NewAccountInterface;
@@ -45,6 +69,13 @@ export declare const createUserFailureAction: import("@ngrx/store").ActionCreato
45
69
  payload: HttpErrorResponse;
46
70
  } & import("@ngrx/store").Action<UserActionType.CreateFailure>>;
47
71
  export declare const createUserSuccessAction: import("@ngrx/store").ActionCreator<UserActionType.CreateSuccess, () => import("@ngrx/store").Action<UserActionType.CreateSuccess>>;
72
+ export declare const deactivate2FAUserAction: import("@ngrx/store").ActionCreator<UserActionType.Deactivate2FA, () => import("@ngrx/store").Action<UserActionType.Deactivate2FA>>;
73
+ export declare const deactivate2FAUserFailureAction: import("@ngrx/store").ActionCreator<UserActionType.Deactivate2FAFailure, (props: {
74
+ payload: HttpErrorResponse;
75
+ }) => {
76
+ payload: HttpErrorResponse;
77
+ } & import("@ngrx/store").Action<UserActionType.Deactivate2FAFailure>>;
78
+ export declare const deactivate2FAUserSuccessAction: import("@ngrx/store").ActionCreator<UserActionType.Deactivate2FASuccess, () => import("@ngrx/store").Action<UserActionType.Deactivate2FASuccess>>;
48
79
  export declare const getCurrentUserAction: import("@ngrx/store").ActionCreator<UserActionType.GetCurrent, () => import("@ngrx/store").Action<UserActionType.GetCurrent>>;
49
80
  export declare const deleteCurrentUserAction: import("@ngrx/store").ActionCreator<UserActionType.DeleteCurrent, () => import("@ngrx/store").Action<UserActionType.DeleteCurrent>>;
50
81
  export declare const deleteCurrentUserFailureAction: import("@ngrx/store").ActionCreator<UserActionType.DeleteCurrentFailure, (props: {
@@ -85,6 +116,17 @@ export declare const resetPasswordAction: import("@ngrx/store").ActionCreator<Us
85
116
  } & import("@ngrx/store").Action<UserActionType.ResetPassword>>;
86
117
  export declare const resetPasswordFailureAction: import("@ngrx/store").ActionCreator<UserActionType.ResetPasswordFailure, () => import("@ngrx/store").Action<UserActionType.ResetPasswordFailure>>;
87
118
  export declare const resetPasswordSuccessAction: import("@ngrx/store").ActionCreator<UserActionType.ResetPasswordSuccess, () => import("@ngrx/store").Action<UserActionType.ResetPasswordSuccess>>;
119
+ export declare const retrieve2FACodeUserAction: import("@ngrx/store").ActionCreator<UserActionType.Retrieve2FACode, () => import("@ngrx/store").Action<UserActionType.Retrieve2FACode>>;
120
+ export declare const retrieve2FACodeUserFailureAction: import("@ngrx/store").ActionCreator<UserActionType.Retrieve2FACodeFailure, (props: {
121
+ payload: HttpErrorResponse;
122
+ }) => {
123
+ payload: HttpErrorResponse;
124
+ } & import("@ngrx/store").Action<UserActionType.Retrieve2FACodeFailure>>;
125
+ export declare const retrieve2FACodeUserSuccessAction: import("@ngrx/store").ActionCreator<UserActionType.Retrieve2FACodeSuccess, (props: {
126
+ payload: Retrieve2fa;
127
+ }) => {
128
+ payload: Retrieve2fa;
129
+ } & import("@ngrx/store").Action<UserActionType.Retrieve2FACodeSuccess>>;
88
130
  export declare const updateCurrentUserAction: import("@ngrx/store").ActionCreator<UserActionType.UpdateCurrent, (props: {
89
131
  payload: User;
90
132
  }) => {
@@ -100,3 +142,14 @@ export declare const updateCurrentUserSuccessAction: import("@ngrx/store").Actio
100
142
  }) => {
101
143
  payload: User;
102
144
  } & import("@ngrx/store").Action<UserActionType.UpdateCurrentSuccess>>;
145
+ export declare const verify2FAUserAction: import("@ngrx/store").ActionCreator<UserActionType.Verify2FA, (props: {
146
+ payload: string;
147
+ }) => {
148
+ payload: string;
149
+ } & import("@ngrx/store").Action<UserActionType.Verify2FA>>;
150
+ export declare const verify2FAUserFailureAction: import("@ngrx/store").ActionCreator<UserActionType.Verify2FAFailure, (props: {
151
+ payload: HttpErrorResponse;
152
+ }) => {
153
+ payload: HttpErrorResponse;
154
+ } & import("@ngrx/store").Action<UserActionType.Verify2FAFailure>>;
155
+ export declare const verify2FAUserSuccessAction: import("@ngrx/store").ActionCreator<UserActionType.Verify2FASuccess, () => import("@ngrx/store").Action<UserActionType.Verify2FASuccess>>;
@@ -9,6 +9,7 @@ export declare class AuthEffects {
9
9
  private storageService;
10
10
  private teamService;
11
11
  clearAuthentication$: Observable<import("@ngrx/store").Action<import("../actions").AuthActionType.ClearSuccess> | import("@ngrx/store").Action<import("../actions").StoreActionTypes>> & import("@ngrx/effects").CreateEffectMetadata;
12
+ clearCurrent$: Observable<import("@ngrx/store").Action<import("../actions").AuthActionType.ClearCurrentSuccess>> & import("@ngrx/effects").CreateEffectMetadata;
12
13
  getCurrent$: Observable<{
13
14
  payload: Auth | null;
14
15
  } & import("@ngrx/store").Action<import("../actions").AuthActionType.GetCurrentSuccess>> & import("@ngrx/effects").CreateEffectMetadata;
@@ -101,6 +101,11 @@ export declare class ConstantEffects {
101
101
  } & import("@ngrx/store").Action<import("../actions").ConstantActionType.RetrieveFeatureFlagsSuccess>) | ({
102
102
  payload: HttpErrorResponse;
103
103
  } & import("@ngrx/store").Action<import("../actions").ConstantActionType.RetrieveFeatureFlagsFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
104
+ retrieve2FATypes$: import("rxjs").Observable<({
105
+ payload: OptionInterface[];
106
+ } & import("@ngrx/store").Action<import("../actions").ConstantActionType.Retrieve2FAMethodsSuccess>) | ({
107
+ payload: HttpErrorResponse;
108
+ } & import("@ngrx/store").Action<import("../actions").ConstantActionType.Retrieve2FAMethodsFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
104
109
  static ɵfac: i0.ɵɵFactoryDeclaration<ConstantEffects, never>;
105
110
  static ɵprov: i0.ɵɵInjectableDeclaration<ConstantEffects>;
106
111
  }
@@ -1,4 +1,4 @@
1
- import { User, UserNotification } from '../../models';
1
+ import { Retrieve2fa, User, UserNotification } from '../../models';
2
2
  import { Observable } from 'rxjs';
3
3
  import { HttpErrorResponse } from '@angular/common/http';
4
4
  import * as i0 from "@angular/core";
@@ -8,9 +8,15 @@ export declare class UserEffects {
8
8
  private userNotificationService;
9
9
  constructor();
10
10
  activate$: Observable<import("@ngrx/store").Action<import("../actions").UserActionType.ActivateFailure> | import("@ngrx/store").Action<import("../actions").UserActionType.ActivateSuccess>> & import("@ngrx/effects").CreateEffectMetadata;
11
+ activate2fa$: Observable<import("@ngrx/store").Action<import("../actions").UserActionType.Activate2FASuccess> | ({
12
+ payload: HttpErrorResponse;
13
+ } & import("@ngrx/store").Action<import("../actions").UserActionType.Activate2FAFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
11
14
  create$: Observable<import("@ngrx/store").Action<import("../actions").UserActionType.CreateSuccess> | ({
12
15
  payload: HttpErrorResponse;
13
16
  } & import("@ngrx/store").Action<import("../actions").UserActionType.CreateFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
17
+ deactivate2fa$: Observable<import("@ngrx/store").Action<import("../actions").UserActionType.Deactivate2FASuccess> | ({
18
+ payload: HttpErrorResponse;
19
+ } & import("@ngrx/store").Action<import("../actions").UserActionType.Deactivate2FAFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
14
20
  deleteCurrent$: Observable<import("@ngrx/store").Action<import("../actions").AuthActionType.Clear> | import("@ngrx/store").Action<import("../actions").UserActionType.DeleteCurrentSuccess> | ({
15
21
  payload: HttpErrorResponse;
16
22
  } & import("@ngrx/store").Action<import("../actions").UserActionType.DeleteCurrentFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
@@ -25,11 +31,19 @@ export declare class UserEffects {
25
31
  payload: HttpErrorResponse;
26
32
  } & import("@ngrx/store").Action<import("../actions").UserActionType.ListUserNotificationsFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
27
33
  resetPassword$: Observable<import("@ngrx/store").Action<import("../actions").UserActionType.ResetPasswordFailure> | import("@ngrx/store").Action<import("../actions").UserActionType.ResetPasswordSuccess>> & import("@ngrx/effects").CreateEffectMetadata;
34
+ retrieve2faCode$: Observable<({
35
+ payload: Retrieve2fa;
36
+ } & import("@ngrx/store").Action<import("../actions").UserActionType.Retrieve2FACodeSuccess>) | ({
37
+ payload: HttpErrorResponse;
38
+ } & import("@ngrx/store").Action<import("../actions").UserActionType.Retrieve2FACodeFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
28
39
  updateCurrent$: Observable<({
29
40
  payload: User;
30
41
  } & import("@ngrx/store").Action<import("../actions").UserActionType.UpdateCurrentSuccess>) | ({
31
42
  payload: HttpErrorResponse;
32
43
  } & import("@ngrx/store").Action<import("../actions").UserActionType.UpdateCurrentFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
44
+ verify2fa$: Observable<import("@ngrx/store").Action<import("../actions").UserActionType.GetCurrent> | import("@ngrx/store").Action<import("../actions").UserActionType.Verify2FASuccess> | ({
45
+ payload: HttpErrorResponse;
46
+ } & import("@ngrx/store").Action<import("../actions").UserActionType.Verify2FAFailure>)> & import("@ngrx/effects").CreateEffectMetadata;
33
47
  private fetchAllNotifications;
34
48
  static ɵfac: i0.ɵɵFactoryDeclaration<UserEffects, never>;
35
49
  static ɵprov: i0.ɵɵInjectableDeclaration<UserEffects>;
@@ -1 +1,2 @@
1
1
  export * from './data-access.reducer';
2
+ export * from './reducer-helpers';
@@ -19,3 +19,4 @@ export declare const selectBookingSlotSessionTypes: import("@ngrx/store").Memoiz
19
19
  export declare const selectBookingCalendarStatuses: import("@ngrx/store").MemoizedSelector<object, import("@myclub_se/data-access").ListResultInterface<import("@myclub_se/data-access").OptionInterface>, (s1: ConstantState) => import("@myclub_se/data-access").ListResultInterface<import("@myclub_se/data-access").OptionInterface>>;
20
20
  export declare const selectBookingCalendarTypes: import("@ngrx/store").MemoizedSelector<object, import("@myclub_se/data-access").ListResultInterface<import("@myclub_se/data-access").OptionInterface>, (s1: ConstantState) => import("@myclub_se/data-access").ListResultInterface<import("@myclub_se/data-access").OptionInterface>>;
21
21
  export declare const selectFeatureFlags: import("@ngrx/store").MemoizedSelector<object, import("@myclub_se/data-access").RetrieveResultInterface<import("@myclub_se/data-access").FeatureFlags> | undefined, (s1: ConstantState) => import("@myclub_se/data-access").RetrieveResultInterface<import("@myclub_se/data-access").FeatureFlags> | undefined>;
22
+ export declare const selectTwoFaMethods: import("@ngrx/store").MemoizedSelector<object, import("@myclub_se/data-access").ListResultInterface<import("@myclub_se/data-access").OptionInterface>, (s1: ConstantState) => import("@myclub_se/data-access").ListResultInterface<import("@myclub_se/data-access").OptionInterface>>;
@@ -21,5 +21,6 @@ export interface ConstantState {
21
21
  bookingCalendarStatuses: ListResultInterface<OptionInterface>;
22
22
  bookingCalendarTypes: ListResultInterface<OptionInterface>;
23
23
  featureFlags: RetrieveResultInterface<FeatureFlags> | undefined;
24
+ twoFaMethods: ListResultInterface<OptionInterface>;
24
25
  }
25
26
  export declare const initialConstantState: ConstantState;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@myclub_se/data-access",
3
3
  "description": "This is the package required to access the api for the MyClub Member API V3 from angular",
4
- "version": "3.1.19",
4
+ "version": "3.2.0",
5
5
  "license": "MIT",
6
6
  "main": "src/index.ts",
7
7
  "peerDependencies": {