@daffodil/auth 0.59.2 → 0.61.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 (75) hide show
  1. package/driver/in-memory/package.json +1 -1
  2. package/driver/magento/package.json +1 -1
  3. package/driver/package.json +1 -1
  4. package/driver/testing/package.json +1 -1
  5. package/esm2020/state/actions/auth.actions.mjs +11 -1
  6. package/esm2020/state/auth-state.module.mjs +5 -4
  7. package/esm2020/state/effects/auth.effects.mjs +16 -5
  8. package/esm2020/state/effects/login.effects.mjs +11 -15
  9. package/esm2020/state/facades/auth/facade.mjs +5 -5
  10. package/esm2020/state/facades/login/facade.mjs +5 -5
  11. package/esm2020/state/facades/register/facade.mjs +5 -5
  12. package/esm2020/state/facades/reset-password/facade.mjs +5 -5
  13. package/esm2020/state/injection-tokens/public_api.mjs +2 -0
  14. package/esm2020/state/injection-tokens/unauthenticated/hook.token.mjs +15 -0
  15. package/esm2020/state/injection-tokens/unauthenticated/hooks.token.mjs +29 -0
  16. package/esm2020/state/injection-tokens/unauthenticated/public_api.mjs +2 -0
  17. package/esm2020/state/public_api.mjs +2 -1
  18. package/esm2020/state/reducers/auth/auth-initial-state.mjs +3 -3
  19. package/esm2020/state/reducers/auth/auth-reducer-state.interface.mjs +1 -1
  20. package/esm2020/state/reducers/auth/auth.reducer.mjs +6 -16
  21. package/esm2020/state/reducers/login/login-initial-state.mjs +3 -5
  22. package/esm2020/state/reducers/login/login-reducer-state.interface.mjs +1 -1
  23. package/esm2020/state/reducers/login/login.reducer.mjs +5 -15
  24. package/esm2020/state/reducers/public_api.mjs +2 -1
  25. package/esm2020/state/reducers/register/register-initial-state.mjs +3 -5
  26. package/esm2020/state/reducers/register/register-reducer-state.interface.mjs +1 -1
  27. package/esm2020/state/reducers/register/register.reducer.mjs +5 -15
  28. package/esm2020/state/reducers/reset-password/initial-state.mjs +3 -3
  29. package/esm2020/state/reducers/reset-password/reducer.mjs +5 -15
  30. package/esm2020/state/reducers/reset-password/state.interface.mjs +1 -1
  31. package/esm2020/state/reducers/token/extra.token.mjs +27 -0
  32. package/esm2020/state/reducers/token/public_api.mjs +2 -0
  33. package/esm2020/state/reducers/token/reducers.token.mjs +18 -0
  34. package/esm2020/state/selectors/auth/auth.selector.mjs +4 -6
  35. package/esm2020/state/selectors/auth-all.selector.mjs +9 -9
  36. package/esm2020/state/selectors/login/login.selector.mjs +4 -6
  37. package/esm2020/state/selectors/public_api.mjs +5 -1
  38. package/esm2020/state/selectors/register/register.selector.mjs +4 -6
  39. package/esm2020/state/selectors/reset-password/selector.mjs +4 -6
  40. package/fesm2015/daffodil-auth-state.mjs +158 -99
  41. package/fesm2015/daffodil-auth-state.mjs.map +1 -1
  42. package/fesm2020/daffodil-auth-state.mjs +159 -126
  43. package/fesm2020/daffodil-auth-state.mjs.map +1 -1
  44. package/package.json +1 -1
  45. package/routing/package.json +1 -1
  46. package/state/actions/auth.actions.d.ts +5 -1
  47. package/state/effects/auth.effects.d.ts +4 -2
  48. package/state/effects/login.effects.d.ts +3 -6
  49. package/state/facades/auth/facade.d.ts +2 -2
  50. package/state/facades/login/facade.d.ts +2 -2
  51. package/state/facades/register/facade.d.ts +2 -2
  52. package/state/facades/reset-password/facade.d.ts +2 -2
  53. package/state/injection-tokens/public_api.d.ts +1 -0
  54. package/state/injection-tokens/unauthenticated/hook.token.d.ts +8 -0
  55. package/state/injection-tokens/unauthenticated/hooks.token.d.ts +22 -0
  56. package/state/injection-tokens/unauthenticated/public_api.d.ts +1 -0
  57. package/state/package.json +1 -1
  58. package/state/public_api.d.ts +1 -0
  59. package/state/reducers/auth/auth-reducer-state.interface.d.ts +2 -4
  60. package/state/reducers/login/login-reducer-state.interface.d.ts +2 -5
  61. package/state/reducers/login/login.reducer.d.ts +1 -1
  62. package/state/reducers/public_api.d.ts +1 -0
  63. package/state/reducers/register/register-reducer-state.interface.d.ts +2 -5
  64. package/state/reducers/register/register.reducer.d.ts +1 -1
  65. package/state/reducers/reset-password/state.interface.d.ts +2 -4
  66. package/state/reducers/token/extra.token.d.ts +22 -0
  67. package/state/reducers/token/public_api.d.ts +1 -0
  68. package/state/reducers/token/reducers.token.d.ts +10 -0
  69. package/state/selectors/auth/auth.selector.d.ts +6 -8
  70. package/state/selectors/login/login.selector.d.ts +5 -7
  71. package/state/selectors/public_api.d.ts +4 -0
  72. package/state/selectors/register/register.selector.d.ts +5 -8
  73. package/state/selectors/reset-password/selector.d.ts +6 -8
  74. package/state/testing/package.json +1 -1
  75. package/testing/package.json +1 -1
@@ -3,4 +3,5 @@ export * from './reducers/public_api';
3
3
  export * from './selectors/public_api';
4
4
  export * from './facades/public_api';
5
5
  export * from './config/public_api';
6
+ export * from './injection-tokens/public_api';
6
7
  export { DaffAuthStateModule } from './auth-state.module';
@@ -1,6 +1,4 @@
1
- import { DaffStateError } from '@daffodil/core/state';
2
- export interface DaffAuthReducerState {
3
- loading: boolean;
4
- errors: DaffStateError[];
1
+ import { DaffOperationState } from '@daffodil/core/state';
2
+ export interface DaffAuthReducerState extends DaffOperationState {
5
3
  loggedIn: boolean;
6
4
  }
@@ -1,5 +1,2 @@
1
- import { DaffStateError } from '@daffodil/core/state';
2
- export interface DaffAuthLoginReducerState {
3
- loading: boolean;
4
- errors: DaffStateError[];
5
- }
1
+ import { DaffOperationState } from '@daffodil/core/state';
2
+ export declare type DaffAuthLoginReducerState = DaffOperationState;
@@ -1,4 +1,4 @@
1
1
  import { DaffLoginInfo, DaffAuthToken } from '@daffodil/auth';
2
2
  import { DaffAuthLoginActions } from '../../actions/public_api';
3
3
  import { DaffAuthLoginReducerState } from './login-reducer-state.interface';
4
- export declare function daffAuthLoginReducer<T extends DaffLoginInfo, U extends DaffAuthToken>(state: DaffAuthLoginReducerState, action: DaffAuthLoginActions<T, U>): DaffAuthLoginReducerState;
4
+ export declare function daffAuthLoginReducer<T extends DaffLoginInfo, U extends DaffAuthToken>(state: import("@daffodil/core/state").DaffOperationState, action: DaffAuthLoginActions<T, U>): DaffAuthLoginReducerState;
@@ -2,6 +2,7 @@ export * from './auth/public_api';
2
2
  export * from './login/public_api';
3
3
  export * from './register/public_api';
4
4
  export * from './reset-password/public_api';
5
+ export * from './token/public_api';
5
6
  export { DAFF_AUTH_STORE_FEATURE_KEY } from './auth-store-feature-key';
6
7
  export { daffAuthReducers } from './auth-reducers';
7
8
  export { DaffAuthFeatureState, DaffAuthStateRootSlice, } from './auth-feature-state.interface';
@@ -1,5 +1,2 @@
1
- import { DaffStateError } from '@daffodil/core/state';
2
- export interface DaffAuthRegisterReducerState {
3
- loading: boolean;
4
- errors: DaffStateError[];
5
- }
1
+ import { DaffOperationState } from '@daffodil/core/state';
2
+ export declare type DaffAuthRegisterReducerState = DaffOperationState;
@@ -1,4 +1,4 @@
1
1
  import { DaffAccountRegistration } from '@daffodil/auth';
2
2
  import { DaffAuthRegisterActions } from '../../actions/public_api';
3
3
  import { DaffAuthRegisterReducerState } from './register-reducer-state.interface';
4
- export declare function daffAuthRegisterReducer<T extends DaffAccountRegistration>(state: DaffAuthRegisterReducerState, action: DaffAuthRegisterActions<T>): DaffAuthRegisterReducerState;
4
+ export declare function daffAuthRegisterReducer<T extends DaffAccountRegistration>(state: import("@daffodil/core/state").DaffOperationState, action: DaffAuthRegisterActions<T>): DaffAuthRegisterReducerState;
@@ -1,7 +1,5 @@
1
1
  import { DaffAuthResetPasswordInfo } from '@daffodil/auth';
2
- import { DaffStateError } from '@daffodil/core/state';
3
- export interface DaffAuthResetPasswordReducerState {
4
- loading: boolean;
5
- errors: DaffStateError[];
2
+ import { DaffOperationState } from '@daffodil/core/state';
3
+ export interface DaffAuthResetPasswordReducerState extends DaffOperationState {
6
4
  token: DaffAuthResetPasswordInfo['token'];
7
5
  }
@@ -0,0 +1,22 @@
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ import { ActionReducer } from '@ngrx/store';
3
+ import { DaffAuthFeatureState } from '../auth-feature-state.interface';
4
+ /**
5
+ * A token to hold the injectable extra reducers.
6
+ *
7
+ * Prefer using {@link daffAuthProvideExtraReducers}.
8
+ */
9
+ export declare const DAFF_AUTH_EXTRA_REDUCERS: InjectionToken<ActionReducer<DaffAuthFeatureState, import("@ngrx/store").Action>[]>;
10
+ /**
11
+ * Provides additional reducers that run after the standard Daffodil auth reducers.
12
+ *
13
+ * ```ts
14
+ * providers: [
15
+ * ...daffAuthProvideExtraReducers(
16
+ * myReducer1,
17
+ * myReducer2
18
+ * )
19
+ * ]
20
+ * ```
21
+ */
22
+ export declare function daffAuthProvideExtraReducers(...reducers: ActionReducer<DaffAuthFeatureState>[]): Provider[];
@@ -0,0 +1 @@
1
+ export { daffAuthProvideExtraReducers, DAFF_AUTH_EXTRA_REDUCERS, } from './extra.token';
@@ -0,0 +1,10 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ActionReducer } from '@ngrx/store';
3
+ import { DaffAuthFeatureState } from '../auth-feature-state.interface';
4
+ /**
5
+ * An internal token to hold the Daffodil auth reducers.
6
+ * Includes the extra and standard reducers.
7
+ *
8
+ * @docs-private
9
+ */
10
+ export declare const DAFF_AUTH_REDUCERS: InjectionToken<ActionReducer<DaffAuthFeatureState, import("@ngrx/store").Action>>;
@@ -1,10 +1,8 @@
1
1
  import { MemoizedSelector } from '@ngrx/store';
2
- import { DaffStateError } from '@daffodil/core/state';
3
- import { DaffAuthReducerState } from '../../reducers/public_api';
4
- export interface AuthSelectors {
5
- selectAuthState: MemoizedSelector<Record<string, any>, DaffAuthReducerState>;
6
- selectAuthLoading: MemoizedSelector<Record<string, any>, boolean>;
7
- selectAuthErrors: MemoizedSelector<Record<string, any>, DaffStateError[]>;
8
- selectAuthLoggedIn: MemoizedSelector<Record<string, any>, boolean>;
2
+ import { DaffOperationStateSelectors } from '@daffodil/core/state';
3
+ import { DaffAuthReducerState, DaffAuthStateRootSlice } from '../../reducers/public_api';
4
+ export interface AuthSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthReducerState> {
5
+ selectAuthState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthReducerState>;
6
+ selectAuthLoggedIn: MemoizedSelector<DaffAuthStateRootSlice, boolean>;
9
7
  }
10
- export declare const getAuthSelectors: () => AuthSelectors;
8
+ export declare const daffAuthSelectorFactory: () => AuthSelectors;
@@ -1,9 +1,7 @@
1
1
  import { MemoizedSelector } from '@ngrx/store';
2
- import { DaffStateError } from '@daffodil/core/state';
3
- import { DaffAuthLoginReducerState } from '../../reducers/public_api';
4
- export interface DaffAuthLoginSelectors {
5
- selectAuthLoginState: MemoizedSelector<Record<string, any>, DaffAuthLoginReducerState>;
6
- selectAuthLoginLoading: MemoizedSelector<Record<string, any>, boolean>;
7
- selectAuthLoginErrors: MemoizedSelector<Record<string, any>, DaffStateError[]>;
2
+ import { DaffOperationStateSelectors } from '@daffodil/core/state';
3
+ import { DaffAuthLoginReducerState, DaffAuthStateRootSlice } from '../../reducers/public_api';
4
+ export interface DaffAuthLoginSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthLoginReducerState> {
5
+ selectAuthLoginState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthLoginReducerState>;
8
6
  }
9
- export declare const getDaffAuthLoginSelectors: () => DaffAuthLoginSelectors;
7
+ export declare const daffAuthLoginSelectorFactory: () => DaffAuthLoginSelectors;
@@ -1 +1,5 @@
1
1
  export * from './auth-all.selector';
2
+ export * from './auth/auth.selector';
3
+ export * from './login/login.selector';
4
+ export * from './register/register.selector';
5
+ export * from './reset-password/selector';
@@ -1,10 +1,7 @@
1
1
  import { MemoizedSelector } from '@ngrx/store';
2
- import { DaffAuthToken } from '@daffodil/auth';
3
- import { DaffStateError } from '@daffodil/core/state';
4
- import { DaffAuthRegisterReducerState } from '../../reducers/public_api';
5
- export interface DaffAuthRegisterSelectors {
6
- selectAuthRegisterState: MemoizedSelector<Record<string, any>, DaffAuthRegisterReducerState>;
7
- selectAuthRegisterLoading: MemoizedSelector<Record<string, any>, boolean>;
8
- selectAuthRegisterErrors: MemoizedSelector<Record<string, any>, DaffStateError[]>;
2
+ import { DaffOperationStateSelectors } from '@daffodil/core/state';
3
+ import { DaffAuthRegisterReducerState, DaffAuthStateRootSlice } from '../../reducers/public_api';
4
+ export interface DaffAuthRegisterSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthRegisterReducerState> {
5
+ selectAuthRegisterState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthRegisterReducerState>;
9
6
  }
10
- export declare const getDaffAuthRegisterSelectors: <T extends DaffAuthToken = DaffAuthToken>() => DaffAuthRegisterSelectors;
7
+ export declare const daffAuthRegisterSelectorFactory: () => DaffAuthRegisterSelectors;
@@ -1,11 +1,9 @@
1
1
  import { MemoizedSelector } from '@ngrx/store';
2
2
  import { DaffAuthResetPasswordInfo } from '@daffodil/auth';
3
- import { DaffStateError } from '@daffodil/core/state';
4
- import { DaffAuthResetPasswordReducerState } from '../../reducers/public_api';
5
- export interface DaffAuthResetPasswordSelectors {
6
- selectAuthResetPasswordState: MemoizedSelector<Record<string, any>, DaffAuthResetPasswordReducerState>;
7
- selectAuthResetPasswordLoading: MemoizedSelector<Record<string, any>, boolean>;
8
- selectAuthResetPasswordErrors: MemoizedSelector<Record<string, any>, DaffStateError[]>;
9
- selectAuthResetPasswordToken: MemoizedSelector<Record<string, any>, DaffAuthResetPasswordInfo['token']>;
3
+ import { DaffOperationStateSelectors } from '@daffodil/core/state';
4
+ import { DaffAuthResetPasswordReducerState, DaffAuthStateRootSlice } from '../../reducers/public_api';
5
+ export interface DaffAuthResetPasswordSelectors extends DaffOperationStateSelectors<DaffAuthStateRootSlice, DaffAuthResetPasswordReducerState> {
6
+ selectAuthResetPasswordState: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthResetPasswordReducerState>;
7
+ selectAuthResetPasswordToken: MemoizedSelector<DaffAuthStateRootSlice, DaffAuthResetPasswordInfo['token']>;
10
8
  }
11
- export declare const getDaffAuthResetPasswordSelectors: () => DaffAuthResetPasswordSelectors;
9
+ export declare const daffAuthResetPasswordSelectorFactory: () => DaffAuthResetPasswordSelectors;
@@ -1 +1 @@
1
- {"name":"@daffodil/auth/state/testing","module":"../../fesm2015/daffodil-auth-state-testing.mjs","es2020":"../../fesm2020/daffodil-auth-state-testing.mjs","esm2020":"../../esm2020/state/testing/daffodil-auth-state-testing.mjs","fesm2020":"../../fesm2020/daffodil-auth-state-testing.mjs","fesm2015":"../../fesm2015/daffodil-auth-state-testing.mjs","typings":"daffodil-auth-state-testing.d.ts","sideEffects":false,"version":"0.59.2"}
1
+ {"name":"@daffodil/auth/state/testing","module":"../../fesm2015/daffodil-auth-state-testing.mjs","es2020":"../../fesm2020/daffodil-auth-state-testing.mjs","esm2020":"../../esm2020/state/testing/daffodil-auth-state-testing.mjs","fesm2020":"../../fesm2020/daffodil-auth-state-testing.mjs","fesm2015":"../../fesm2015/daffodil-auth-state-testing.mjs","typings":"daffodil-auth-state-testing.d.ts","sideEffects":false,"version":"0.61.0"}
@@ -1 +1 @@
1
- {"name":"@daffodil/auth/testing","module":"../fesm2015/daffodil-auth-testing.mjs","es2020":"../fesm2020/daffodil-auth-testing.mjs","esm2020":"../esm2020/testing/daffodil-auth-testing.mjs","fesm2020":"../fesm2020/daffodil-auth-testing.mjs","fesm2015":"../fesm2015/daffodil-auth-testing.mjs","typings":"daffodil-auth-testing.d.ts","sideEffects":false,"version":"0.59.2"}
1
+ {"name":"@daffodil/auth/testing","module":"../fesm2015/daffodil-auth-testing.mjs","es2020":"../fesm2020/daffodil-auth-testing.mjs","esm2020":"../esm2020/testing/daffodil-auth-testing.mjs","fesm2020":"../fesm2020/daffodil-auth-testing.mjs","fesm2015":"../fesm2015/daffodil-auth-testing.mjs","typings":"daffodil-auth-testing.d.ts","sideEffects":false,"version":"0.61.0"}