@dereekb/dbx-core 2.1.0 → 3.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 (235) hide show
  1. package/esm2020/lib/action/action.handler.mjs +3 -125
  2. package/esm2020/lib/action/action.machine.mjs +8 -7
  3. package/esm2020/lib/action/action.module.mjs +10 -10
  4. package/esm2020/lib/action/action.store.mjs +3 -3
  5. package/esm2020/lib/action/action.store.source.mjs +3 -3
  6. package/esm2020/lib/action/directive/auto/action.automodify.directive.mjs +4 -4
  7. package/esm2020/lib/action/directive/auto/action.autotrigger.directive.mjs +7 -6
  8. package/esm2020/lib/action/directive/context/action.directive.mjs +3 -3
  9. package/esm2020/lib/action/directive/context/action.source.directive.mjs +3 -3
  10. package/esm2020/lib/action/directive/debug/action.logger.directive.mjs +3 -3
  11. package/esm2020/lib/action/directive/map/action.map.directive.mjs +3 -3
  12. package/esm2020/lib/action/directive/map/action.map.key.directive.mjs +3 -3
  13. package/esm2020/lib/action/directive/map/action.map.source.directive.mjs +3 -3
  14. package/esm2020/lib/action/directive/map/action.map.working.disable.directive.mjs +3 -3
  15. package/esm2020/lib/action/directive/state/action.disabled.directive.mjs +5 -6
  16. package/esm2020/lib/action/directive/state/action.enforce.modified.directive.mjs +6 -6
  17. package/esm2020/lib/action/directive/state/action.handler.directive.mjs +10 -9
  18. package/esm2020/lib/action/directive/state/action.success.directive.mjs +23 -35
  19. package/esm2020/lib/action/directive/state/action.success.handler.directive.mjs +48 -0
  20. package/esm2020/lib/action/directive/state/action.value.directive.mjs +8 -8
  21. package/esm2020/lib/action/directive/state/action.value.stream.directive.mjs +3 -3
  22. package/esm2020/lib/action/directive/state/action.value.trigger.directive.mjs +6 -6
  23. package/esm2020/lib/action/directive/state/action.value.trigger.instance.mjs +2 -1
  24. package/esm2020/lib/action/directive/state/action.working.component.mjs +28 -22
  25. package/esm2020/lib/action/directive/state/index.mjs +2 -2
  26. package/esm2020/lib/auth/auth.module.mjs +26 -0
  27. package/esm2020/lib/auth/auth.role.any.directive.mjs +36 -0
  28. package/esm2020/lib/auth/auth.role.has.directive.mjs +36 -0
  29. package/esm2020/lib/auth/auth.state.module.mjs +28 -0
  30. package/esm2020/lib/auth/auth.state.service.mjs +23 -0
  31. package/esm2020/lib/auth/auth.user.mjs +11 -0
  32. package/esm2020/lib/auth/index.mjs +10 -0
  33. package/esm2020/lib/auth/router/auth.router.mjs +6 -0
  34. package/esm2020/lib/auth/router/auth.router.module.mjs +26 -0
  35. package/esm2020/lib/auth/router/auth.router.service.mjs +61 -0
  36. package/esm2020/lib/auth/router/index.mjs +6 -0
  37. package/esm2020/lib/auth/router/provider/uirouter/auth.hook.mjs +23 -0
  38. package/esm2020/lib/auth/router/provider/uirouter/hook.mjs +65 -0
  39. package/esm2020/lib/auth/router/provider/uirouter/index.mjs +6 -0
  40. package/esm2020/lib/auth/router/provider/uirouter/redirect.mjs +29 -0
  41. package/esm2020/lib/auth/router/provider/uirouter/role.hook.mjs +32 -0
  42. package/esm2020/lib/auth/router/provider/uirouter/state.hook.mjs +53 -0
  43. package/esm2020/lib/auth/router/state/auth.router.state.module.mjs +32 -0
  44. package/esm2020/lib/auth/router/state/effect/auth.router.state.effect.mjs +46 -0
  45. package/esm2020/lib/auth/router/state/effect/index.mjs +2 -0
  46. package/esm2020/lib/auth/router/state/index.mjs +3 -0
  47. package/esm2020/lib/auth/service/auth.service.mjs +6 -0
  48. package/esm2020/lib/auth/service/auth.service.rxjs.mjs +27 -0
  49. package/esm2020/lib/auth/service/index.mjs +3 -0
  50. package/esm2020/lib/auth/state/action/auth.action.mjs +14 -0
  51. package/esm2020/lib/auth/state/action/index.mjs +12 -0
  52. package/esm2020/lib/auth/state/action/user.action.mjs +18 -0
  53. package/esm2020/lib/auth/state/effect/auth.effect.mjs +44 -0
  54. package/esm2020/lib/auth/state/index.mjs +13 -0
  55. package/esm2020/lib/auth/state/reducer/index.mjs +23 -0
  56. package/esm2020/lib/auth/state/reducer/user.reducer.mjs +12 -0
  57. package/esm2020/lib/auth/state/state.mjs +2 -0
  58. package/esm2020/lib/button/action/action.button.directive.mjs +3 -3
  59. package/esm2020/lib/button/action/action.button.trigger.directive.mjs +3 -3
  60. package/esm2020/lib/button/button.directive.mjs +6 -6
  61. package/esm2020/lib/button/button.loading.directive.mjs +3 -3
  62. package/esm2020/lib/button/button.mjs +1 -1
  63. package/esm2020/lib/button/button.module.mjs +4 -4
  64. package/esm2020/lib/button/router/button.segue.directive.mjs +8 -4
  65. package/esm2020/lib/context/context.directive.mjs +41 -0
  66. package/esm2020/lib/context/context.mjs +22 -0
  67. package/esm2020/lib/context/context.module.mjs +28 -0
  68. package/esm2020/lib/context/context.service.mjs +29 -0
  69. package/esm2020/lib/context/index.mjs +6 -0
  70. package/esm2020/lib/context/state/action/data.action.mjs +10 -0
  71. package/esm2020/lib/context/state/action/index.mjs +7 -0
  72. package/esm2020/lib/context/state/effect/index.mjs +38 -0
  73. package/esm2020/lib/context/state/index.mjs +13 -0
  74. package/esm2020/lib/context/state/reducer/data.reducer.mjs +16 -0
  75. package/esm2020/lib/context/state/reducer/index.mjs +25 -0
  76. package/esm2020/lib/context/state/state.mjs +2 -0
  77. package/esm2020/lib/filter/action/action.filter.source.directive.mjs +3 -3
  78. package/esm2020/lib/filter/filter.abstract.connector.directive.mjs +3 -3
  79. package/esm2020/lib/filter/filter.abstract.source.directive.mjs +4 -4
  80. package/esm2020/lib/filter/filter.connector.directive.mjs +3 -3
  81. package/esm2020/lib/filter/filter.map.connector.directive.mjs +3 -3
  82. package/esm2020/lib/filter/filter.map.directive.mjs +3 -3
  83. package/esm2020/lib/filter/filter.map.instance.directive.mjs +3 -3
  84. package/esm2020/lib/filter/filter.map.source.directive.mjs +3 -3
  85. package/esm2020/lib/filter/filter.module.mjs +4 -4
  86. package/esm2020/lib/filter/filter.source.directive.mjs +3 -3
  87. package/esm2020/lib/index.mjs +6 -2
  88. package/esm2020/lib/injection/index.mjs +9 -0
  89. package/esm2020/lib/injection/injection.component.mjs +34 -0
  90. package/esm2020/lib/injection/injection.component.module.mjs +31 -0
  91. package/esm2020/lib/injection/injection.context.directive.mjs +124 -0
  92. package/esm2020/lib/injection/injection.context.forward.directive.mjs +30 -0
  93. package/esm2020/lib/injection/injection.context.mjs +18 -0
  94. package/esm2020/lib/injection/injection.directive.mjs +33 -0
  95. package/esm2020/lib/injection/injection.instance.mjs +116 -0
  96. package/esm2020/lib/injection/injection.mjs +16 -0
  97. package/esm2020/lib/ngrx/index.mjs +2 -0
  98. package/esm2020/lib/ngrx/store.lockset.mjs +64 -0
  99. package/esm2020/lib/pipe/date/date.pipe.module.mjs +4 -4
  100. package/esm2020/lib/pipe/date/datedistance.pipe.mjs +3 -3
  101. package/esm2020/lib/pipe/date/dateformatdistance.pipe.mjs +3 -3
  102. package/esm2020/lib/pipe/date/datefromtoformat.pipe.mjs +3 -3
  103. package/esm2020/lib/pipe/date/minutesstring.pipe.mjs +3 -3
  104. package/esm2020/lib/pipe/date/timedistance.pipe.mjs +6 -6
  105. package/esm2020/lib/pipe/date/tojsdate.pipe.mjs +13 -5
  106. package/esm2020/lib/pipe/date/tominutes.pipe.mjs +3 -3
  107. package/esm2020/lib/pipe/index.mjs +3 -1
  108. package/esm2020/lib/pipe/misc/index.mjs +3 -0
  109. package/esm2020/lib/pipe/misc/misc.pipe.module.mjs +20 -0
  110. package/esm2020/lib/pipe/misc/prettyjson.pipe.mjs +27 -0
  111. package/esm2020/lib/pipe/pipe.module.mjs +21 -0
  112. package/esm2020/lib/router/anchor/anchor.directive.mjs +18 -5
  113. package/esm2020/lib/router/anchor/anchor.mjs +1 -1
  114. package/esm2020/lib/router/router/provider/angular/angular.router.service.mjs +8 -5
  115. package/esm2020/lib/router/router/provider/angular/angular.router.service.module.mjs +4 -4
  116. package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.mjs +32 -10
  117. package/esm2020/lib/router/router/provider/uirouter/uirouter.router.service.module.mjs +4 -4
  118. package/esm2020/lib/router/router/service/index.mjs +2 -1
  119. package/esm2020/lib/router/router/service/router.go.mjs +14 -0
  120. package/esm2020/lib/router/router/service/router.service.mjs +1 -1
  121. package/esm2020/lib/router/router/transition/transition.directive.mjs +7 -7
  122. package/esm2020/lib/router/router/transition/transition.watcher.directive.mjs +6 -6
  123. package/esm2020/lib/router/segue.mjs +17 -2
  124. package/esm2020/lib/storage/storage.accessor.simple.factory.mjs +3 -3
  125. package/esm2020/lib/storage/storage.module.mjs +4 -4
  126. package/esm2020/lib/subscription/subscription.directive.mjs +6 -6
  127. package/esm2020/lib/util/view.mjs +18 -2
  128. package/esm2020/lib/view/if.directive.mjs +30 -0
  129. package/esm2020/lib/view/index.mjs +2 -0
  130. package/fesm2015/dereekb-dbx-core.mjs +1672 -575
  131. package/fesm2015/dereekb-dbx-core.mjs.map +1 -1
  132. package/fesm2020/dereekb-dbx-core.mjs +1682 -585
  133. package/fesm2020/dereekb-dbx-core.mjs.map +1 -1
  134. package/lib/action/action.handler.d.ts +4 -72
  135. package/lib/action/action.module.d.ts +3 -3
  136. package/lib/action/directive/auto/action.automodify.directive.d.ts +1 -1
  137. package/lib/action/directive/auto/action.autotrigger.directive.d.ts +3 -3
  138. package/lib/action/directive/state/action.disabled.directive.d.ts +1 -1
  139. package/lib/action/directive/state/action.enforce.modified.directive.d.ts +3 -2
  140. package/lib/action/directive/state/action.success.directive.d.ts +9 -17
  141. package/lib/action/directive/state/action.success.handler.directive.d.ts +24 -0
  142. package/lib/action/directive/state/action.value.directive.d.ts +5 -5
  143. package/lib/action/directive/state/action.value.trigger.instance.d.ts +2 -2
  144. package/lib/action/directive/state/action.working.component.d.ts +11 -5
  145. package/lib/action/directive/state/index.d.ts +1 -1
  146. package/lib/auth/auth.module.d.ts +8 -0
  147. package/lib/auth/auth.role.any.directive.d.ts +20 -0
  148. package/lib/auth/auth.role.has.directive.d.ts +20 -0
  149. package/lib/auth/auth.state.module.d.ts +8 -0
  150. package/lib/auth/auth.state.service.d.ts +13 -0
  151. package/lib/auth/auth.user.d.ts +28 -0
  152. package/lib/auth/index.d.ts +9 -0
  153. package/lib/auth/router/auth.router.d.ts +10 -0
  154. package/lib/auth/router/auth.router.module.d.ts +9 -0
  155. package/lib/auth/router/auth.router.service.d.ts +38 -0
  156. package/lib/auth/router/index.d.ts +5 -0
  157. package/lib/auth/router/provider/uirouter/auth.hook.d.ts +18 -0
  158. package/lib/auth/router/provider/uirouter/hook.d.ts +46 -0
  159. package/lib/auth/router/provider/uirouter/index.d.ts +5 -0
  160. package/lib/auth/router/provider/uirouter/redirect.d.ts +9 -0
  161. package/lib/auth/router/provider/uirouter/role.hook.d.ts +26 -0
  162. package/lib/auth/router/provider/uirouter/state.hook.d.ts +31 -0
  163. package/lib/auth/router/state/auth.router.state.module.d.ts +14 -0
  164. package/lib/auth/router/state/effect/auth.router.state.effect.d.ts +32 -0
  165. package/lib/auth/router/state/effect/index.d.ts +1 -0
  166. package/lib/auth/router/state/index.d.ts +2 -0
  167. package/lib/auth/service/auth.service.d.ts +46 -0
  168. package/lib/auth/service/auth.service.rxjs.d.ts +18 -0
  169. package/lib/auth/service/index.d.ts +2 -0
  170. package/lib/auth/state/action/auth.action.d.ts +12 -0
  171. package/lib/auth/state/action/index.d.ts +11 -0
  172. package/lib/auth/state/action/user.action.d.ts +34 -0
  173. package/lib/auth/state/effect/auth.effect.d.ts +31 -0
  174. package/lib/auth/state/index.d.ts +12 -0
  175. package/lib/auth/state/reducer/index.d.ts +29 -0
  176. package/lib/auth/state/reducer/user.reducer.d.ts +11 -0
  177. package/lib/auth/state/state.d.ts +5 -0
  178. package/lib/button/button.d.ts +3 -3
  179. package/lib/button/router/button.segue.directive.d.ts +1 -0
  180. package/lib/context/context.d.ts +39 -0
  181. package/lib/context/context.directive.d.ts +19 -0
  182. package/lib/context/context.module.d.ts +8 -0
  183. package/lib/context/context.service.d.ts +16 -0
  184. package/lib/context/index.d.ts +5 -0
  185. package/lib/context/state/action/data.action.d.ts +13 -0
  186. package/lib/context/state/action/index.d.ts +6 -0
  187. package/lib/context/state/effect/index.d.ts +39 -0
  188. package/lib/context/state/index.d.ts +12 -0
  189. package/lib/context/state/reducer/data.reducer.d.ts +13 -0
  190. package/lib/context/state/reducer/index.d.ts +34 -0
  191. package/lib/context/state/state.d.ts +9 -0
  192. package/lib/filter/filter.abstract.source.directive.d.ts +2 -2
  193. package/lib/index.d.ts +5 -1
  194. package/lib/injection/index.d.ts +8 -0
  195. package/lib/injection/injection.component.d.ts +15 -0
  196. package/lib/injection/injection.component.module.d.ts +9 -0
  197. package/lib/injection/injection.context.d.ts +39 -0
  198. package/lib/injection/injection.context.directive.d.ts +25 -0
  199. package/lib/injection/injection.context.forward.directive.d.ts +16 -0
  200. package/lib/{injected/injected.d.ts → injection/injection.d.ts} +4 -4
  201. package/lib/injection/injection.directive.d.ts +19 -0
  202. package/lib/{injected/injected.instance.d.ts → injection/injection.instance.d.ts} +8 -8
  203. package/lib/ngrx/index.d.ts +1 -0
  204. package/lib/ngrx/store.lockset.d.ts +36 -0
  205. package/lib/pipe/index.d.ts +2 -0
  206. package/lib/pipe/misc/index.d.ts +2 -0
  207. package/lib/pipe/misc/misc.pipe.module.d.ts +7 -0
  208. package/lib/pipe/misc/prettyjson.pipe.d.ts +9 -0
  209. package/lib/pipe/pipe.module.d.ts +8 -0
  210. package/lib/router/anchor/anchor.d.ts +5 -1
  211. package/lib/router/anchor/anchor.directive.d.ts +10 -2
  212. package/lib/router/router/provider/angular/angular.router.service.d.ts +7 -5
  213. package/lib/router/router/provider/uirouter/uirouter.router.service.d.ts +11 -5
  214. package/lib/router/router/service/index.d.ts +1 -0
  215. package/lib/router/router/service/router.go.d.ts +14 -0
  216. package/lib/router/router/service/router.service.d.ts +10 -4
  217. package/lib/router/router/transition/transition.directive.d.ts +2 -2
  218. package/lib/router/router/transition/transition.watcher.directive.d.ts +1 -1
  219. package/lib/router/segue.d.ts +10 -3
  220. package/lib/util/view.d.ts +12 -0
  221. package/lib/view/if.directive.d.ts +19 -0
  222. package/lib/view/index.d.ts +1 -0
  223. package/package.json +6 -13
  224. package/esm2020/lib/action/directive/state/action.success.component.mjs +0 -50
  225. package/esm2020/lib/injected/index.mjs +0 -6
  226. package/esm2020/lib/injected/injected.component.mjs +0 -34
  227. package/esm2020/lib/injected/injected.component.module.mjs +0 -26
  228. package/esm2020/lib/injected/injected.directive.mjs +0 -33
  229. package/esm2020/lib/injected/injected.instance.mjs +0 -116
  230. package/esm2020/lib/injected/injected.mjs +0 -16
  231. package/lib/action/directive/state/action.success.component.d.ts +0 -15
  232. package/lib/injected/index.d.ts +0 -5
  233. package/lib/injected/injected.component.d.ts +0 -15
  234. package/lib/injected/injected.component.module.d.ts +0 -8
  235. package/lib/injected/injected.directive.d.ts +0 -19
@@ -1,81 +1,13 @@
1
- import { Observable } from 'rxjs';
2
1
  import { DbxActionContextStoreSourceInstance } from './action.store.source';
3
- import { Maybe, Destroyable } from '@dereekb/util';
4
- export interface WorkHandlerContextDelegate<O = any> {
5
- startWorking(): void;
6
- success(result?: Maybe<O>): void;
7
- reject(error?: Maybe<any>): void;
8
- }
2
+ import { Work, WorkInstanceDelegate } from '@dereekb/rxjs';
9
3
  /**
10
- * WorkHandlerContextDelegate implementation using an DbxActionContextStoreSourceInstance.
4
+ * WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.
11
5
  */
12
- export declare class WorkHandlerContextSourceDelegate<T = any, O = any> implements WorkHandlerContextDelegate<O> {
6
+ export declare class DbxActionWorkInstanceDelegate<T = any, O = any> implements WorkInstanceDelegate<O> {
13
7
  readonly source: DbxActionContextStoreSourceInstance<T, O>;
14
8
  constructor(source: DbxActionContextStoreSourceInstance<T, O>);
15
9
  startWorking(): void;
16
10
  success(result: O): void;
17
11
  reject(error: any): void;
18
12
  }
19
- /**
20
- * Used by DbxActionHandlerDirective when handling a function.
21
- */
22
- export declare class WorkHandlerContext<T = any, O = any> implements Destroyable {
23
- readonly value: T;
24
- readonly delegate: WorkHandlerContextDelegate<O>;
25
- private _done;
26
- private _doneActionBegan;
27
- private _actionBegan;
28
- private _isComplete;
29
- constructor(value: T, delegate: WorkHandlerContextDelegate<O>);
30
- get actionBegan(): boolean;
31
- get actionBegan$(): Observable<boolean>;
32
- get isComplete(): boolean;
33
- get isComplete$(): Observable<boolean>;
34
- /**
35
- * Begins working using an observable.
36
- */
37
- startWorkingWithObservable(actionObs: Observable<O>): void;
38
- /**
39
- * Notifies the system that the action has begun.
40
- */
41
- startWorking(): void;
42
- /**
43
- * Sets success on the action.
44
- */
45
- success(result?: O): void;
46
- /**
47
- * Sets rejected on the action.
48
- */
49
- reject(error?: any): void;
50
- destroy(): void;
51
- private _setWorking;
52
- private _setComplete;
53
- }
54
- export declare type HandleActionFunctionConfigFn<T, O> = (value: T) => HandleWorkValueReadyConfig<T, O>;
55
- /**
56
- * Creates a function that uses a provider to always handle new values.
57
- */
58
- export declare function handleWorkValueReadyWithConfigFn<T, O>(providerFn: HandleActionFunctionConfigFn<T, O>): (value: T) => Maybe<WorkHandlerContext<T, O>>;
59
- /**
60
- * Config for handleWorkValueReadyFn().
61
- */
62
- export interface HandleWorkValueReadyConfig<T, O> {
63
- handlerFunction: HandleActionFunction<T, O>;
64
- delegate: WorkHandlerContextDelegate<O>;
65
- }
66
- /**
67
- * Performs the action using the value and returns an observable.
68
- */
69
- export declare type HandleActionUsingObservable<T = any, O = any> = (value: T) => Observable<O>;
70
- /**
71
- * Performs the action that uses the context handler to handle the event.
72
- */
73
- export declare type HandleActionUsingContext<T = any, O = any> = (value: T, context: WorkHandlerContext<T, O>) => void;
74
- /**
75
- * Performs the action. Can either return an observable that will use the handler, or can use the handler itself.
76
- */
77
- export declare type HandleActionFunction<T = any, O = any> = HandleActionUsingObservable<T, O> | HandleActionUsingContext<T, O>;
78
- /**
79
- * Creates a function that handles the incoming value and creates a WorkHandlerContext.
80
- */
81
- export declare function handleWorkValueReadyFn<T, O>({ handlerFunction, delegate }: HandleWorkValueReadyConfig<T, O>): (value: T) => Maybe<WorkHandlerContext<T, O>>;
13
+ export declare type HandleActionFunction<T = any, O = any> = Work<T, O>;
@@ -13,12 +13,12 @@ import * as i11 from "./directive/state/action.value.stream.directive";
13
13
  import * as i12 from "./directive/auto/action.automodify.directive";
14
14
  import * as i13 from "./directive/state/action.value.directive";
15
15
  import * as i14 from "./directive/debug/action.logger.directive";
16
- import * as i15 from "./directive/state/action.success.component";
17
- import * as i16 from "./directive/state/action.success.directive";
16
+ import * as i15 from "./directive/state/action.success.directive";
17
+ import * as i16 from "./directive/state/action.success.handler.directive";
18
18
  import * as i17 from "./directive/state/action.working.component";
19
19
  import * as i18 from "@angular/common";
20
20
  export declare class DbxCoreActionModule {
21
21
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxCoreActionModule, never>;
22
- static ɵmod: i0.ɵɵNgModuleDeclaration<DbxCoreActionModule, [typeof i1.DbxActionDirective, typeof i2.DbxActionContextMapDirective, typeof i3.DbxActionFromMapDirective, typeof i4.DbxActionMapSourceDirective, typeof i5.DbxActionMapWorkingDisableDirective, typeof i6.DbxActionSourceDirective, typeof i7.DbxActionHandlerDirective, typeof i8.DbxActionDisabledDirective, typeof i9.DbxActionEnforceModifiedDirective, typeof i10.DbxActionAutoTriggerDirective, typeof i11.dbxActionValueStreamDirective, typeof i12.DbxActionAutoModifyDirective, typeof i13.DbxActionValueDirective, typeof i14.DbxActionContextLoggerDirective, typeof i15.DbxActionSuccessComponent, typeof i16.DbxActionSuccessDirective, typeof i17.DbxActionWorkingComponent], [typeof i18.CommonModule], [typeof i1.DbxActionDirective, typeof i2.DbxActionContextMapDirective, typeof i3.DbxActionFromMapDirective, typeof i4.DbxActionMapSourceDirective, typeof i5.DbxActionMapWorkingDisableDirective, typeof i6.DbxActionSourceDirective, typeof i7.DbxActionHandlerDirective, typeof i8.DbxActionDisabledDirective, typeof i9.DbxActionEnforceModifiedDirective, typeof i10.DbxActionAutoTriggerDirective, typeof i11.dbxActionValueStreamDirective, typeof i12.DbxActionAutoModifyDirective, typeof i13.DbxActionValueDirective, typeof i14.DbxActionContextLoggerDirective, typeof i15.DbxActionSuccessComponent, typeof i16.DbxActionSuccessDirective, typeof i17.DbxActionWorkingComponent]>;
22
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxCoreActionModule, [typeof i1.DbxActionDirective, typeof i2.DbxActionContextMapDirective, typeof i3.DbxActionFromMapDirective, typeof i4.DbxActionMapSourceDirective, typeof i5.DbxActionMapWorkingDisableDirective, typeof i6.DbxActionSourceDirective, typeof i7.DbxActionHandlerDirective, typeof i8.DbxActionDisabledDirective, typeof i9.DbxActionEnforceModifiedDirective, typeof i10.DbxActionAutoTriggerDirective, typeof i11.dbxActionValueStreamDirective, typeof i12.DbxActionAutoModifyDirective, typeof i13.DbxActionValueDirective, typeof i14.DbxActionContextLoggerDirective, typeof i15.DbxActionHasSuccessDirective, typeof i16.DbxActionSuccessHandlerDirective, typeof i17.DbxActionIsWorkingDirective], [typeof i18.CommonModule], [typeof i1.DbxActionDirective, typeof i2.DbxActionContextMapDirective, typeof i3.DbxActionFromMapDirective, typeof i4.DbxActionMapSourceDirective, typeof i5.DbxActionMapWorkingDisableDirective, typeof i6.DbxActionSourceDirective, typeof i7.DbxActionHandlerDirective, typeof i8.DbxActionDisabledDirective, typeof i9.DbxActionEnforceModifiedDirective, typeof i10.DbxActionAutoTriggerDirective, typeof i11.dbxActionValueStreamDirective, typeof i12.DbxActionAutoModifyDirective, typeof i13.DbxActionValueDirective, typeof i14.DbxActionContextLoggerDirective, typeof i15.DbxActionHasSuccessDirective, typeof i16.DbxActionSuccessHandlerDirective, typeof i17.DbxActionIsWorkingDirective]>;
23
23
  static ɵinj: i0.ɵɵInjectorDeclaration<DbxCoreActionModule>;
24
24
  }
@@ -7,7 +7,7 @@ export declare class DbxActionAutoModifyDirective<T, O> extends AbstractSubscrip
7
7
  readonly source: DbxActionContextStoreSourceInstance<T, O>;
8
8
  private readonly _autoModifyEnabled;
9
9
  get autoModifyEnabled(): boolean;
10
- set autoModifyEnabled(autoModifyEnabled: Maybe<any>);
10
+ set autoModifyEnabled(autoModifyEnabled: Maybe<boolean | ''>);
11
11
  constructor(source: DbxActionContextStoreSourceInstance<T, O>);
12
12
  ngOnInit(): void;
13
13
  ngOnDestroy(): void;
@@ -9,7 +9,9 @@ import * as i0 from "@angular/core";
9
9
  */
10
10
  export declare class DbxActionAutoTriggerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
11
11
  readonly source: DbxActionContextStoreSourceInstance<T, O>;
12
- private _triggerEnabled;
12
+ private readonly _triggerEnabled;
13
+ private readonly _triggerLimit;
14
+ private readonly _trigger;
13
15
  /**
14
16
  * How much to throttle the auto-triggering.
15
17
  */
@@ -33,8 +35,6 @@ export declare class DbxActionAutoTriggerDirective<T, O> extends AbstractSubscri
33
35
  set instantTrigger(instantTrigger: any);
34
36
  get triggerLimit(): Maybe<number>;
35
37
  set triggerLimit(triggerLimit: Maybe<number>);
36
- private readonly _triggerLimit;
37
- private readonly _trigger;
38
38
  private _triggerCount;
39
39
  readonly _errorCount$: Observable<number>;
40
40
  readonly _triggerCount$: Observable<number>;
@@ -15,7 +15,7 @@ export declare class DbxActionDisabledDirective<T, O> extends AbstractSubscripti
15
15
  ngOnInit(): void;
16
16
  ngOnDestroy(): void;
17
17
  get disabled(): boolean;
18
- set disabled(disabled: Maybe<any>);
18
+ set disabled(disabled: Maybe<boolean | ''>);
19
19
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionDisabledDirective<any, any>, [{ host: true; }]>;
20
20
  static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionDisabledDirective<any, any>, "[dbxActionDisabled]", never, { "disabled": "dbxActionDisabled"; }, {}, never>;
21
21
  }
@@ -1,4 +1,5 @@
1
1
  import { OnInit, OnDestroy } from '@angular/core';
2
+ import { Maybe } from '@dereekb/util';
2
3
  import { AbstractSubscriptionDirective } from '../../../subscription';
3
4
  import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
4
5
  import * as i0 from "@angular/core";
@@ -13,7 +14,7 @@ export declare class DbxActionEnforceModifiedDirective extends AbstractSubscript
13
14
  ngOnInit(): void;
14
15
  ngOnDestroy(): void;
15
16
  get enabled(): boolean;
16
- set enabled(enabled: boolean);
17
+ set enabled(enabled: Maybe<string | boolean>);
17
18
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionEnforceModifiedDirective, [{ host: true; }]>;
18
- static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionEnforceModifiedDirective, "[dbxActionEnforceModified]", never, { "enabled": "[dbxActionEnforceModified]"; }, {}, never>;
19
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionEnforceModifiedDirective, "[dbxActionEnforceModified]", never, { "enabled": "dbxActionEnforceModified"; }, {}, never>;
19
20
  }
@@ -1,24 +1,16 @@
1
- import { OnInit, OnDestroy } from '@angular/core';
1
+ import { OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { Maybe } from '@dereekb/util';
3
- import { AbstractSubscriptionDirective } from '../../../subscription';
3
+ import { AbstractIfDirective } from '../../../view/if.directive';
4
4
  import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
7
- * Performs the action on success.
7
+ * Structural directive that displays the content when the store has a success value.
8
8
  */
9
- export declare type SuccessActionFunction<O> = (value: O) => void;
10
- /**
11
- * Directive that executes a function on ActionContextStore Success.
12
- */
13
- export declare class DbxActionSuccessDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
9
+ export declare class DbxActionHasSuccessDirective extends AbstractIfDirective implements OnDestroy {
14
10
  readonly source: DbxActionContextStoreSourceInstance;
15
- private _successFunction;
16
- readonly successFunction$: import("rxjs").Observable<SuccessActionFunction<O>>;
17
- get successFunction(): Maybe<SuccessActionFunction<O>>;
18
- set successFunction(successFunction: Maybe<SuccessActionFunction<O>>);
19
- constructor(source: DbxActionContextStoreSourceInstance);
20
- ngOnInit(): void;
21
- ngOnDestroy(): void;
22
- static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionSuccessDirective<any, any>, [{ host: true; }]>;
23
- static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionSuccessDirective<any, any>, "[dbxActionSuccess]", never, { "successFunction": "dbxActionSuccess"; }, {}, never>;
11
+ hideAfter?: Maybe<number> | '';
12
+ readonly show$: import("rxjs").Observable<boolean>;
13
+ constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, source: DbxActionContextStoreSourceInstance);
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionHasSuccessDirective, never>;
15
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionHasSuccessDirective, "[dbxActionHasSuccess]", never, { "hideAfter": "dbxActionHasSuccess"; }, {}, never>;
24
16
  }
@@ -0,0 +1,24 @@
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
+ import { Maybe } from '@dereekb/util';
3
+ import { AbstractSubscriptionDirective } from '../../../subscription';
4
+ import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Performs the action on success.
8
+ */
9
+ export declare type DbxActionSuccessHandlerFunction<O> = (value: O) => void;
10
+ /**
11
+ * Directive that executes a function on ActionContextStore Success.
12
+ */
13
+ export declare class DbxActionSuccessHandlerDirective<T, O> extends AbstractSubscriptionDirective implements OnInit, OnDestroy {
14
+ readonly source: DbxActionContextStoreSourceInstance<T, O>;
15
+ private _successFunction;
16
+ readonly successFunction$: import("rxjs").Observable<DbxActionSuccessHandlerFunction<O>>;
17
+ get successFunction(): Maybe<DbxActionSuccessHandlerFunction<O>>;
18
+ set successFunction(successFunction: Maybe<DbxActionSuccessHandlerFunction<O>>);
19
+ constructor(source: DbxActionContextStoreSourceInstance<T, O>);
20
+ ngOnInit(): void;
21
+ ngOnDestroy(): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionSuccessHandlerDirective<any, any>, [{ host: true; }]>;
23
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionSuccessHandlerDirective<any, any>, "[dbxActionSuccessHandler]", never, { "successFunction": "dbxActionSuccessHandler"; }, {}, never>;
24
+ }
@@ -1,19 +1,19 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { Maybe, ObjectOrGetter } from '@dereekb/util';
2
+ import { Maybe, GetterOrValue } from '@dereekb/util';
3
3
  import { AbstractSubscriptionDirective } from '../../../subscription';
4
4
  import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
7
7
  * Directive that provides a default value when triggered.
8
8
  *
9
- * No value is required, allowing the directive to automatically call readyValue with undefined.
9
+ * No value is required, allowing the directive to automatically call readyValue.
10
10
  */
11
11
  export declare class DbxActionValueDirective<T, O> extends AbstractSubscriptionDirective implements OnInit {
12
12
  readonly source: DbxActionContextStoreSourceInstance<T, O>;
13
13
  private _valueOrFunction;
14
- readonly valueOrFunction$: import("rxjs").Observable<ObjectOrGetter<T>>;
15
- get valueOrFunction(): Maybe<ObjectOrGetter<T>>;
16
- set valueOrFunction(valueOrFunction: Maybe<ObjectOrGetter<T>>);
14
+ readonly valueOrFunction$: import("rxjs").Observable<GetterOrValue<T>>;
15
+ get valueOrFunction(): Maybe<GetterOrValue<T>>;
16
+ set valueOrFunction(valueOrFunction: Maybe<GetterOrValue<T>>);
17
17
  constructor(source: DbxActionContextStoreSourceInstance<T, O>);
18
18
  ngOnInit(): void;
19
19
  ngOnDestroy(): void;
@@ -1,10 +1,10 @@
1
- import { ObservableGetter, IsModifiedFunction } from '@dereekb/rxjs';
1
+ import { ObservableOrValue, IsModifiedFunction } from '@dereekb/rxjs';
2
2
  import { Destroyable, Initialized, Maybe } from '@dereekb/util';
3
3
  import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
4
4
  /**
5
5
  * DbxActionValueOnTriggerInstance function. Returns an ObervableGetter that returns a value.
6
6
  */
7
- export declare type DbxActionValueOnTriggerFunction<T> = () => ObservableGetter<Maybe<T>>;
7
+ export declare type DbxActionValueOnTriggerFunction<T> = () => ObservableOrValue<Maybe<T>>;
8
8
  export interface DbxActionValueOnTriggerResult<T = any> {
9
9
  value?: Maybe<T>;
10
10
  reject?: any;
@@ -1,12 +1,18 @@
1
+ import { OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { Maybe } from '@dereekb/util';
3
+ import { AbstractIfDirective } from '../../../view/if.directive';
1
4
  import { DbxActionContextStoreSourceInstance } from '../../action.store.source';
2
5
  import * as i0 from "@angular/core";
3
6
  /**
4
- * Displays the input content when working is set.
7
+ * Structural directive that displays the content when the store is working.
8
+ *
9
+ * Can specify a period in milliseconds that shows how long to show up after working for a particular number of seconds.
5
10
  */
6
- export declare class DbxActionWorkingComponent {
11
+ export declare class DbxActionIsWorkingDirective extends AbstractIfDirective implements OnDestroy {
7
12
  readonly source: DbxActionContextStoreSourceInstance;
13
+ showAfter?: Maybe<number> | '';
8
14
  readonly show$: import("rxjs").Observable<boolean>;
9
- constructor(source: DbxActionContextStoreSourceInstance);
10
- static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionWorkingComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<DbxActionWorkingComponent, "dbx-action-working", never, {}, {}, never, ["*"]>;
15
+ constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, source: DbxActionContextStoreSourceInstance);
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxActionIsWorkingDirective, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionIsWorkingDirective, "[dbxActionIsWorking]", never, { "showAfter": "dbxActionIsWorking"; }, {}, never>;
12
18
  }
@@ -1,7 +1,7 @@
1
1
  export * from './action.disabled.directive';
2
2
  export * from './action.handler.directive';
3
- export * from './action.success.component';
4
3
  export * from './action.success.directive';
4
+ export * from './action.success.handler.directive';
5
5
  export * from './action.value.directive';
6
6
  export * from './action.working.component';
7
7
  export * from './action.enforce.modified.directive';
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./auth.role.has.directive";
3
+ import * as i2 from "./auth.role.any.directive";
4
+ export declare class DbxCoreAuthModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxCoreAuthModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxCoreAuthModule, [typeof i1.DbxAuthHasRolesDirective, typeof i2.DbxAuthHasAnyRoleDirective], never, [typeof i1.DbxAuthHasRolesDirective, typeof i2.DbxAuthHasAnyRoleDirective]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<DbxCoreAuthModule>;
8
+ }
@@ -0,0 +1,20 @@
1
+ import { AuthRole, ArrayOrValue } from '@dereekb/util';
2
+ import { TemplateRef, ViewContainerRef, OnDestroy } from '@angular/core';
3
+ import { DbxAuthService } from './service';
4
+ import { Maybe } from '@dereekb/util';
5
+ import { AbstractIfDirective } from '../view/if.directive';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Structural decorator directive similar to ngIf that embeds content if the current auth user has any of the target role(s).
9
+ */
10
+ export declare class DbxAuthHasAnyRoleDirective extends AbstractIfDirective implements OnDestroy {
11
+ private dbxAuthService;
12
+ private _targetRoles;
13
+ readonly targetRoles$: import("rxjs").Observable<Maybe<ArrayOrValue<string>>>;
14
+ readonly show$: import("rxjs").Observable<boolean>;
15
+ constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, dbxAuthService: DbxAuthService);
16
+ ngOnDestroy(): void;
17
+ set targetRoles(roles: Maybe<ArrayOrValue<AuthRole>>);
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxAuthHasAnyRoleDirective, never>;
19
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxAuthHasAnyRoleDirective, "[dbxAuthHasAnyRole]", never, { "targetRoles": "dbxAuthHasAnyRole"; }, {}, never>;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { AuthRole, ArrayOrValue } from '@dereekb/util';
2
+ import { TemplateRef, ViewContainerRef, OnDestroy } from '@angular/core';
3
+ import { DbxAuthService } from './service';
4
+ import { Maybe } from '@dereekb/util';
5
+ import { AbstractIfDirective } from '../view/if.directive';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Structural decorator directive similar to ngIf that embeds content if the current auth user has all of the target role(s).
9
+ */
10
+ export declare class DbxAuthHasRolesDirective extends AbstractIfDirective implements OnDestroy {
11
+ private dbxAuthService;
12
+ private _targetRoles;
13
+ readonly targetRoles$: import("rxjs").Observable<Maybe<ArrayOrValue<string>>>;
14
+ readonly show$: import("rxjs").Observable<boolean>;
15
+ constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, dbxAuthService: DbxAuthService);
16
+ ngOnDestroy(): void;
17
+ set targetRoles(roles: Maybe<ArrayOrValue<AuthRole>>);
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxAuthHasRolesDirective, never>;
19
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DbxAuthHasRolesDirective, "[dbxAuthHasRoles]", never, { "targetRoles": "dbxAuthHasRoles"; }, {}, never>;
20
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@ngrx/store";
3
+ import * as i2 from "@ngrx/effects";
4
+ export declare class DbxAppAuthStateModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxAppAuthStateModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxAppAuthStateModule, never, [typeof i1.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<DbxAppAuthStateModule>;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { Store } from "@ngrx/store";
2
+ import { DbxAppAuthFullState } from "./state/state";
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * State for accessing the app's DbxAppAuthState defined within the DbxAppAuthFullState for the ngrx store.
6
+ */
7
+ export declare class DbxAppAuthStateService {
8
+ readonly store: Store<DbxAppAuthFullState>;
9
+ readonly authStateUser$: import("rxjs").Observable<import("./state/reducer/user.reducer").DbxAppAuthStateUser>;
10
+ constructor(store: Store<DbxAppAuthFullState>);
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxAppAuthStateService, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<DbxAppAuthStateService>;
13
+ }
@@ -0,0 +1,28 @@
1
+ import { Maybe } from "@dereekb/util";
2
+ /**
3
+ * An application user state.
4
+ *
5
+ * Generic states that define the current state of the user:
6
+ * - none: the user is not logged in
7
+ * - anon: the user is logged in as an anonymous account
8
+ * - error: there was an error loading the correct user state
9
+ * - new: the user has a full account but has not completed onboarding/setup
10
+ * - user: the user has a full account and has completed setup
11
+ */
12
+ export declare type AuthUserState = 'none' | 'anon' | 'new' | 'user' | 'error';
13
+ /**
14
+ * Arbitrary identifier used to differentiate users.
15
+ */
16
+ export declare type AuthUserIdentifier = string;
17
+ export declare const NO_AUTH_USER_IDENTIFIER = "0";
18
+ /**
19
+ * AuthUserIdentifier used to indicate that the user cannot be uniquely identifier.
20
+ */
21
+ export declare type NoAuthUserIdentifier = typeof NO_AUTH_USER_IDENTIFIER;
22
+ /**
23
+ * Creates an AuthUserIdentifier from the input. If the input is undefined, returns the NoAuthUserIdentifier.
24
+ *
25
+ * @param inputId
26
+ * @returns
27
+ */
28
+ export declare function authUserIdentifier(inputId: Maybe<AuthUserIdentifier>): AuthUserIdentifier;
@@ -0,0 +1,9 @@
1
+ export * from './router';
2
+ export * from './service';
3
+ export * from './state';
4
+ export * from './auth.user';
5
+ export * from './auth.module';
6
+ export * from './auth.role.any.directive';
7
+ export * from './auth.role.has.directive';
8
+ export * from './auth.state.module';
9
+ export * from './auth.state.service';
@@ -0,0 +1,10 @@
1
+ import { SegueRefOrSegueRefRouterLink } from '../../router/segue';
2
+ /**
3
+ * Auth routes configurations for an app.
4
+ */
5
+ export declare abstract class DbxAppAuthRoutes {
6
+ abstract readonly loginRef: SegueRefOrSegueRefRouterLink;
7
+ abstract readonly loggedOutRef?: SegueRefOrSegueRefRouterLink;
8
+ abstract readonly onboardRef?: SegueRefOrSegueRefRouterLink;
9
+ abstract readonly appRef: SegueRefOrSegueRefRouterLink;
10
+ }
@@ -0,0 +1,9 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { DbxAppAuthRoutes } from './auth.router';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DbxAppAuthRouterModule {
5
+ static forRoot(dbxAppAuthRoutes: DbxAppAuthRoutes): ModuleWithProviders<DbxAppAuthRouterModule>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxAppAuthRouterModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DbxAppAuthRouterModule, never, never, never>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<DbxAppAuthRouterModule>;
9
+ }
@@ -0,0 +1,38 @@
1
+ import { DbxRouterService } from "../../router/router/service/router.service";
2
+ import { DbxAppAuthRoutes } from "./auth.router";
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Helper service for navigating to important auth-related routes.
6
+ */
7
+ export declare class DbxAppAuthRouterService {
8
+ readonly dbxRouterService: DbxRouterService;
9
+ readonly dbxAppAuthRoutes: DbxAppAuthRoutes;
10
+ constructor(dbxRouterService: DbxRouterService, dbxAppAuthRoutes: DbxAppAuthRoutes);
11
+ get hasOnboardingState(): boolean;
12
+ /**
13
+ * Navigates to the login state.
14
+ *
15
+ * @returns
16
+ */
17
+ goToLogin(): Promise<boolean>;
18
+ /**
19
+ * Navigates to the logged out state, if it exists, otherwise navigates to the login state.
20
+ *
21
+ * @returns
22
+ */
23
+ goToLoggedOut(): Promise<boolean>;
24
+ /**
25
+ * Navigates to the onboarding state if it is available, otherwise navigates to the app.
26
+ *
27
+ * @returns
28
+ */
29
+ goToOnboarding(): Promise<boolean>;
30
+ /**
31
+ * Navigates to the app state.
32
+ *
33
+ * @returns
34
+ */
35
+ goToApp(): Promise<boolean>;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<DbxAppAuthRouterService, never>;
37
+ static ɵprov: i0.ɵɵInjectableDeclaration<DbxAppAuthRouterService>;
38
+ }
@@ -0,0 +1,5 @@
1
+ export * from './provider/uirouter';
2
+ export * from './state';
3
+ export * from './auth.router';
4
+ export * from './auth.router.service';
5
+ export * from './auth.router.module';
@@ -0,0 +1,18 @@
1
+ import { TransitionService } from '@uirouter/core';
2
+ import { AuthTransitionHookOptions } from './hook';
3
+ export interface IsLoggedInHookConfig {
4
+ options: AuthTransitionHookOptions;
5
+ }
6
+ /**
7
+ * UIRouter State data with configuration for the hasAuthRoleHook.
8
+ */
9
+ export interface IsLoggedInStateData {
10
+ /**
11
+ * Whether or not the user needs to be logged in for this state.
12
+ */
13
+ requiredLogIn: boolean;
14
+ }
15
+ /**
16
+ * This hook redirects to the configured default state when a user is not logged in for configured states.
17
+ */
18
+ export declare function enableIsLoggedInHook(transitionService: TransitionService, config: IsLoggedInHookConfig): void;
@@ -0,0 +1,46 @@
1
+ import { TransitionHookFn, Transition, UIInjector } from '@uirouter/core';
2
+ import { Observable } from 'rxjs';
3
+ import { SegueRef } from './../../../../router/segue';
4
+ import { DbxAuthService } from '../../../service/auth.service';
5
+ import { FactoryWithRequiredInput, Maybe } from '@dereekb/util';
6
+ import { Injector } from '@angular/core';
7
+ /**
8
+ * authTransitionHookFn() configuration. The values are handled as:
9
+ * - true: continue to the state.
10
+ * - false: redirect to the login page.
11
+ * - StateOrName: redirect to the target page instead.
12
+ */
13
+ export declare type AuthTransitionDecision = true | false | SegueRef;
14
+ export interface AuthTransitionDecisionGetterInput {
15
+ readonly transition: Transition;
16
+ readonly injector: Injector;
17
+ readonly authService: DbxAuthService;
18
+ }
19
+ export declare type AuthTransitionRedirectTargetGetter = FactoryWithRequiredInput<Observable<Maybe<SegueRef>>, AuthTransitionDecisionGetterInput>;
20
+ export declare type AuthTransitionRedirectTargetOrGetter = Maybe<SegueRef> | AuthTransitionRedirectTargetGetter;
21
+ export interface AuthTransitionHookOptions {
22
+ /**
23
+ * The state to redirect the user to when their auth fails.
24
+ */
25
+ defaultRedirectTarget: string;
26
+ /**
27
+ * The state to redirect the user to. Defaults to defaultRedirectTarget.
28
+ */
29
+ errorRedirectTarget?: string;
30
+ }
31
+ export interface AuthTransitionHookConfig extends AuthTransitionHookOptions {
32
+ /**
33
+ * Creates the decision observable for the transition that decides whether or not to redirect or continue.
34
+ */
35
+ makeDecisionsObs: (transition: Transition, authService: DbxAuthService, injector: UIInjector) => Observable<AuthTransitionDecision>;
36
+ }
37
+ export interface AuthTransitionStateData {
38
+ /**
39
+ * Optional getter/decision maker when a role needs to be
40
+ */
41
+ redirectTo?: AuthTransitionRedirectTargetOrGetter;
42
+ }
43
+ /**
44
+ * This generates a TransitionHookFn that can be used with redirecting routes.
45
+ */
46
+ export declare function makeAuthTransitionHook(config: AuthTransitionHookConfig): TransitionHookFn;
@@ -0,0 +1,5 @@
1
+ export * from './hook';
2
+ export * from './redirect';
3
+ export * from './auth.hook';
4
+ export * from './role.hook';
5
+ export * from './state.hook';
@@ -0,0 +1,9 @@
1
+ import { ObjectMap } from "@dereekb/util";
2
+ import { AuthTransitionRedirectTargetGetter, AuthTransitionRedirectTargetOrGetter } from "./hook";
3
+ /**
4
+ * Creates a AuthTransitionRedirectTargetGetter that can redirect values based on the current authUserState.
5
+ *
6
+ * @param stateMap
7
+ * @returns
8
+ */
9
+ export declare function redirectBasedOnAuthUserState(stateMap: ObjectMap<AuthTransitionRedirectTargetOrGetter>): AuthTransitionRedirectTargetGetter;
@@ -0,0 +1,26 @@
1
+ import { AuthRole, SetIncludesMode, ArrayOrValue } from '@dereekb/util';
2
+ import { TransitionService } from '@uirouter/core';
3
+ import { AuthTransitionHookOptions, AuthTransitionStateData } from './hook';
4
+ export interface HasAuthRoleHookConfig {
5
+ options: AuthTransitionHookOptions;
6
+ }
7
+ /**
8
+ * UIRouter State data with configuration for the hasAuthRoleHook.
9
+ */
10
+ export interface HasAuthRoleStateData extends AuthTransitionStateData {
11
+ /**
12
+ * Auth roles marked for this state
13
+ */
14
+ authRoles: ArrayOrValue<AuthRole>;
15
+ /**
16
+ * How to use the above auth roles. This defaults to 'all' by default.
17
+ */
18
+ authRolesMode?: SetIncludesMode;
19
+ }
20
+ /**
21
+ * This hook redirects to the configured default state when a user:
22
+ *
23
+ * - does not have an allowed state
24
+ * - has a disallowed state
25
+ */
26
+ export declare function enableHasAuthRoleHook(transitionService: TransitionService, config: HasAuthRoleHookConfig): void;
@@ -0,0 +1,31 @@
1
+ import { ArrayOrValue } from '@dereekb/util';
2
+ import { TransitionService } from '@uirouter/core';
3
+ import { AuthUserState } from '../../../auth.user';
4
+ import { AuthTransitionHookOptions } from './hook';
5
+ export interface HasAuthStateHookConfig {
6
+ options: AuthTransitionHookOptions;
7
+ }
8
+ export declare type HasAuthStateConfig = ArrayOrValue<AuthUserState> | HasAuthStateObjectConfig;
9
+ export interface HasAuthStateObjectConfig {
10
+ /**
11
+ * Whether or not this state or any child state is considered "secure", which requires the user to be logged in.
12
+ */
13
+ allowedStates?: ArrayOrValue<AuthUserState>;
14
+ /**
15
+ * States that are not allowed. If the current state is this state, a rejection is returned.
16
+ */
17
+ disallowedStates?: ArrayOrValue<AuthUserState>;
18
+ }
19
+ export interface HasAuthStateData {
20
+ /**
21
+ * Configuration for the hasAuthStateHook.
22
+ */
23
+ authStates: HasAuthStateConfig;
24
+ }
25
+ /**
26
+ * This hook redirects to the configured default state when a user:
27
+ *
28
+ * - does not have an allowed state
29
+ * - has a disallowed state
30
+ */
31
+ export declare function enableHasAuthStateHook(transitionService: TransitionService, config: HasAuthStateHookConfig): void;