@dereekb/dbx-core 5.3.0 → 7.0.1
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.
- package/esm2020/lib/action/directive/state/action.enforce.modified.directive.mjs +1 -1
- package/esm2020/lib/auth/router/provider/uirouter/hook.mjs +6 -4
- package/esm2020/lib/auth/router/provider/uirouter/redirect.mjs +1 -1
- package/esm2020/lib/auth/router/provider/uirouter/role.hook.mjs +3 -4
- package/esm2020/lib/auth/router/provider/uirouter/state.hook.mjs +3 -3
- package/fesm2015/dereekb-dbx-core.mjs +8 -7
- package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-core.mjs +8 -7
- package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
- package/lib/auth/router/provider/uirouter/hook.d.ts +4 -4
- package/lib/auth/router/provider/uirouter/state.hook.d.ts +2 -2
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ import { switchMap, first, BehaviorSubject, combineLatest, distinctUntilChanged,
|
|
|
5
5
|
import * as i1$5 from '@dereekb/rxjs';
|
|
6
6
|
import { SubscriptionObject, LockSet, filterMaybe, LoadingStateType, beginLoading, idleLoadingState, errorResult, successResult, scanCount, combineLatestFromMapValuesObsFn, workFactory, emitDelayObs, asObservable, returnIfIs, skipFirstMaybe, onFalseToTrue, onTrueToFalse, setContainsAllValuesFrom, FilterSourceInstance, FilterSource, FilterSourceConnector, FilterMap } from '@dereekb/rxjs';
|
|
7
7
|
import * as i1$6 from '@dereekb/util';
|
|
8
|
-
import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, toReadableError, isGetter,
|
|
8
|
+
import { isDefinedAndNotFalse, hasValueOrNotEmpty, BooleanStringKeyArrayUtilityInstance, reduceBooleansWithOrFn, getValueFromGetter, toReadableError, isGetter, setIncludes, maybeSet, isAllowed, expandTreeFunction, flattenTreeToArrayFunction, expandFlattenTreeFunction, mergeArrays, filterMaybeValues, mergeObjects, mergeArrayOrValueIntoArray, makePromiseFullRef, DataIsExpiredError, DataDoesNotExistError, filterMaybeValuesFn, StorageObjectUtility, SHARED_MEMORY_STORAGE } from '@dereekb/util';
|
|
9
9
|
import { ComponentStore } from '@ngrx/component-store';
|
|
10
10
|
import { CommonModule, formatDate } from '@angular/common';
|
|
11
11
|
import * as i1$3 from '@ngrx/effects';
|
|
@@ -1705,7 +1705,8 @@ function makeAuthTransitionHook(config) {
|
|
|
1705
1705
|
else {
|
|
1706
1706
|
resultObs = of(redirectTo);
|
|
1707
1707
|
}
|
|
1708
|
-
redirectToObs = resultObs.pipe(map((
|
|
1708
|
+
redirectToObs = resultObs.pipe(map((inputStateRef) => {
|
|
1709
|
+
const stateRef = asSegueRef(inputStateRef);
|
|
1709
1710
|
let redirectTarget;
|
|
1710
1711
|
let redirectParams;
|
|
1711
1712
|
if (stateRef) {
|
|
@@ -1733,7 +1734,8 @@ function makeAuthTransitionHook(config) {
|
|
|
1733
1734
|
}
|
|
1734
1735
|
}
|
|
1735
1736
|
else {
|
|
1736
|
-
|
|
1737
|
+
const segueRef = asSegueRef(decision);
|
|
1738
|
+
return of($state.target(asSegueRefString(segueRef.ref), segueRef.refParams, segueRef.refOptions));
|
|
1737
1739
|
}
|
|
1738
1740
|
}), catchError((x) => {
|
|
1739
1741
|
console.warn('Encountered error in auth transition hook.', x);
|
|
@@ -1814,8 +1816,7 @@ function enableHasAuthRoleHook(transitionService, config) {
|
|
|
1814
1816
|
const targetState = transition.targetState();
|
|
1815
1817
|
const data = targetState.state().data;
|
|
1816
1818
|
const requiredRoles = new Set(data.authRoles);
|
|
1817
|
-
|
|
1818
|
-
return authService.authUserState$.pipe(map((x) => setIncludes(x)));
|
|
1819
|
+
return authService.authRoles$.pipe(map((x) => setIncludes(x, requiredRoles, data.authRolesMode)));
|
|
1819
1820
|
}
|
|
1820
1821
|
});
|
|
1821
1822
|
// Register the "requires auth" hook with the TransitionsService
|
|
@@ -1843,8 +1844,8 @@ function enableHasAuthStateHook(transitionService, config) {
|
|
|
1843
1844
|
const targetState = transition.targetState();
|
|
1844
1845
|
const data = targetState.state().data;
|
|
1845
1846
|
const config = toHasAuthStateObjectConfig(data.authStates);
|
|
1846
|
-
const
|
|
1847
|
-
return authService.authUserState$.pipe(map((x) => isAllowed(x,
|
|
1847
|
+
const allowedStates = toParsedHasAuthStateConfig(config);
|
|
1848
|
+
return authService.authUserState$.pipe(map((x) => isAllowed(x, allowedStates)));
|
|
1848
1849
|
}
|
|
1849
1850
|
});
|
|
1850
1851
|
// Register the "requires auth" hook with the TransitionsService
|