@dereekb/dbx-core 9.20.2 → 9.20.4
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/router/auth/hook/id.hook.mjs +54 -0
- package/esm2020/lib/router/auth/hook/index.mjs +2 -1
- package/esm2020/lib/router/auth/hook/uid.hook.mjs +12 -48
- package/fesm2015/dereekb-dbx-core.mjs +40 -23
- package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-core.mjs +40 -23
- package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
- package/lib/router/auth/hook/id.hook.d.ts +44 -0
- package/lib/router/auth/hook/index.d.ts +1 -0
- package/lib/router/auth/hook/uid.hook.d.ts +0 -2
- package/package.json +4 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DbxAuthService } from '../../../auth/service/auth.service';
|
|
2
|
+
import { TransitionService, Transition, HookMatchCriteria } from '@uirouter/core';
|
|
3
|
+
import { Maybe, ModelKey } from '@dereekb/util';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { Injector } from '@angular/core';
|
|
6
|
+
export declare const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_VALUE = "0";
|
|
7
|
+
export declare const DEFAULT_REDIRECT_FOR_IDENTIFIER_PARAM_KEY = "id";
|
|
8
|
+
export interface RedirectForIdentifierParamHookInput {
|
|
9
|
+
/**
|
|
10
|
+
* Factory that returns an observable that sends the default allowed identifier to use when accessing the resource.
|
|
11
|
+
*/
|
|
12
|
+
readonly defaultAllowedValue: (authService: DbxAuthService, injector: Injector, transition: Transition) => Observable<ModelKey>;
|
|
13
|
+
/**
|
|
14
|
+
* Route parameter to use.
|
|
15
|
+
*
|
|
16
|
+
* Defaults to "uid"
|
|
17
|
+
*/
|
|
18
|
+
readonly idParam?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The default param value to check against.
|
|
21
|
+
*
|
|
22
|
+
* Defaults to 0.
|
|
23
|
+
*/
|
|
24
|
+
readonly defaultParamValue?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Criteria or route to watch and intercept.
|
|
27
|
+
*/
|
|
28
|
+
readonly criteria: HookMatchCriteria | string;
|
|
29
|
+
readonly transitionService: TransitionService;
|
|
30
|
+
/**
|
|
31
|
+
* Whether or not the current user can view the target id.
|
|
32
|
+
*
|
|
33
|
+
* Can return another identifier, or true to allow access, or false/null/undefined to deny access.
|
|
34
|
+
*/
|
|
35
|
+
readonly canViewModelWithId: (targetId: ModelKey, authService: DbxAuthService, injector: Injector) => Observable<Maybe<boolean | ModelKey>>;
|
|
36
|
+
/**
|
|
37
|
+
* Hook priority
|
|
38
|
+
*/
|
|
39
|
+
readonly priority?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* This hook asserts the user is allowed to view a route with an identifier as a state parameter.
|
|
43
|
+
*/
|
|
44
|
+
export declare function redirectForIdentifierParamHook(input: RedirectForIdentifierParamHookInput): void;
|
|
@@ -37,7 +37,5 @@ export interface RedirectForUserIdentifierParamHookInput {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* This hook asserts the user is allowed to view a route with a user identifier as a parameter.
|
|
40
|
-
*
|
|
41
|
-
* If not, or
|
|
42
40
|
*/
|
|
43
41
|
export declare function redirectForUserIdentifierParamHook(input: RedirectForUserIdentifierParamHookInput): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-core",
|
|
3
|
-
"version": "9.20.
|
|
3
|
+
"version": "9.20.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^14.0.0",
|
|
6
6
|
"@angular/core": "^14.0.0",
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
"@ngrx/effects": "^14.0.0",
|
|
10
10
|
"@ngrx/entity": "^14.0.0",
|
|
11
11
|
"@ngrx/store": "^14.0.0",
|
|
12
|
-
"@dereekb/util": "9.20.
|
|
13
|
-
"@dereekb/rxjs": "9.20.
|
|
12
|
+
"@dereekb/util": "9.20.4",
|
|
13
|
+
"@dereekb/rxjs": "9.20.4",
|
|
14
14
|
"@angular/platform-browser": "^14.2.0",
|
|
15
15
|
"@uirouter/core": "^6.0.8",
|
|
16
16
|
"date-fns": "^2.29.0",
|
|
17
|
-
"@dereekb/date": "9.20.
|
|
17
|
+
"@dereekb/date": "9.20.4",
|
|
18
18
|
"@angular/router": "^14.2.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|