@dflat-core/web 1.0.44 → 1.0.46

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 (492) hide show
  1. package/README.md +12 -16
  2. package/assets/variables.scss +3 -1
  3. package/fesm2022/dflat-core-web-core-data.mjs +416 -412
  4. package/fesm2022/dflat-core-web-core-data.mjs.map +1 -1
  5. package/fesm2022/dflat-core-web-core-model.mjs +229 -218
  6. package/fesm2022/dflat-core-web-core-model.mjs.map +1 -1
  7. package/fesm2022/dflat-core-web-core-services.mjs +1840 -1615
  8. package/fesm2022/dflat-core-web-core-services.mjs.map +1 -1
  9. package/fesm2022/dflat-core-web-core-ux.mjs +21444 -16366
  10. package/fesm2022/dflat-core-web-core-ux.mjs.map +1 -1
  11. package/fesm2022/dflat-core-web-core.mjs +585 -728
  12. package/fesm2022/dflat-core-web-core.mjs.map +1 -1
  13. package/fesm2022/dflat-core-web-system-data.mjs +2813 -1300
  14. package/fesm2022/dflat-core-web-system-data.mjs.map +1 -1
  15. package/fesm2022/dflat-core-web-system-model.mjs +282 -260
  16. package/fesm2022/dflat-core-web-system-model.mjs.map +1 -1
  17. package/fesm2022/dflat-core-web-system-root.mjs +1994 -681
  18. package/fesm2022/dflat-core-web-system-root.mjs.map +1 -1
  19. package/fesm2022/dflat-core-web-system-ux.mjs +21157 -8828
  20. package/fesm2022/dflat-core-web-system-ux.mjs.map +1 -1
  21. package/fesm2022/dflat-core-web.mjs +11 -15
  22. package/fesm2022/dflat-core-web.mjs.map +1 -1
  23. package/package.json +33 -31
  24. package/scss/dflat-app.scss +8 -2
  25. package/types/dflat-core-web-core-data.d.ts +108 -0
  26. package/types/dflat-core-web-core-model.d.ts +491 -0
  27. package/types/dflat-core-web-core-services.d.ts +426 -0
  28. package/types/dflat-core-web-core-ux.d.ts +5867 -0
  29. package/types/dflat-core-web-core.d.ts +137 -0
  30. package/types/dflat-core-web-system-data.d.ts +545 -0
  31. package/types/dflat-core-web-system-model.d.ts +1605 -0
  32. package/types/dflat-core-web-system-root.d.ts +557 -0
  33. package/types/dflat-core-web-system-ux.d.ts +3250 -0
  34. package/{index.d.ts → types/dflat-core-web.d.ts} +1 -1
  35. package/core/index.d.ts +0 -6
  36. package/core/lib/array.function.d.ts +0 -8
  37. package/core/lib/core.module.d.ts +0 -9
  38. package/core/lib/global/EnvironmentBase.d.ts +0 -27
  39. package/core/lib/nameof.function.d.ts +0 -4
  40. package/core/lib/services/ensuremoduleloadedonceguard.d.ts +0 -3
  41. package/core/lib/services/utilities.service.d.ts +0 -87
  42. package/core-data/index.d.ts +0 -3
  43. package/core-data/lib/core-data.module.d.ts +0 -7
  44. package/core-data/lib/services/data-service.d.ts +0 -69
  45. package/core-data/lib/services/entity-data-service.d.ts +0 -37
  46. package/core-model/index.d.ts +0 -4
  47. package/core-model/lib/core-model.module.d.ts +0 -7
  48. package/core-model/lib/interface.d.ts +0 -140
  49. package/core-model/lib/model/interface.generated.d.ts +0 -309
  50. package/core-model/lib/model/model.d.ts +0 -38
  51. package/core-services/index.d.ts +0 -25
  52. package/core-services/lib/core-services.module.d.ts +0 -10
  53. package/core-services/lib/model/model.d.ts +0 -25
  54. package/core-services/lib/services/app-keys.d.ts +0 -15
  55. package/core-services/lib/services/appConfig.service.d.ts +0 -8
  56. package/core-services/lib/services/application-menu.service.d.ts +0 -22
  57. package/core-services/lib/services/auth-guard.service.d.ts +0 -18
  58. package/core-services/lib/services/auth.interceptor.d.ts +0 -15
  59. package/core-services/lib/services/auth.service.d.ts +0 -67
  60. package/core-services/lib/services/breadcrumb.service.d.ts +0 -14
  61. package/core-services/lib/services/busmessage.service.d.ts +0 -19
  62. package/core-services/lib/services/can-activate-guard.service.d.ts +0 -12
  63. package/core-services/lib/services/filter.service.d.ts +0 -15
  64. package/core-services/lib/services/geolocation.service.d.ts +0 -29
  65. package/core-services/lib/services/headers.service.d.ts +0 -15
  66. package/core-services/lib/services/hub.service.d.ts +0 -33
  67. package/core-services/lib/services/local-store-manager.service.d.ts +0 -50
  68. package/core-services/lib/services/menu.service.d.ts +0 -27
  69. package/core-services/lib/services/message.service.d.ts +0 -14
  70. package/core-services/lib/services/module-menu-services.token.d.ts +0 -8
  71. package/core-services/lib/services/notifications.service.d.ts +0 -14
  72. package/core-services/lib/services/permission.service.d.ts +0 -12
  73. package/core-services/lib/services/screen.service.d.ts +0 -14
  74. package/core-services/lib/services/server-url.d.ts +0 -12
  75. package/core-services/lib/services/string.function.d.ts +0 -1
  76. package/core-services/lib/services/user.service.d.ts +0 -22
  77. package/core-ux/index.d.ts +0 -145
  78. package/core-ux/lib/components/actions/actions-content.component.d.ts +0 -10
  79. package/core-ux/lib/components/actions/actions.component.d.ts +0 -57
  80. package/core-ux/lib/components/actions/extended-action/extended-action.component.d.ts +0 -34
  81. package/core-ux/lib/components/base-editor/base-editor.component.d.ts +0 -93
  82. package/core-ux/lib/components/base-item-list/base-item-list.component.d.ts +0 -21
  83. package/core-ux/lib/components/basefilter/basefilter.component.d.ts +0 -275
  84. package/core-ux/lib/components/breadcrumb/breadcrumb.component.d.ts +0 -12
  85. package/core-ux/lib/components/datagrid-custom/datagrid-cell/datagrid-cell.component.d.ts +0 -32
  86. package/core-ux/lib/components/datagrid-custom/datagrid-custom.component.d.ts +0 -159
  87. package/core-ux/lib/components/datagrid-custom/datagrid-sorter.component.d.ts +0 -15
  88. package/core-ux/lib/components/datapage/layout-page/page-layout.component.d.ts +0 -13
  89. package/core-ux/lib/components/datapage/old/old.datapage.component.d.ts +0 -10
  90. package/core-ux/lib/components/datapage/old-layout-handler.directive.d.ts +0 -31
  91. package/core-ux/lib/components/dynamic-components/dynamic-field/dynamic-field.component.d.ts +0 -41
  92. package/core-ux/lib/components/dynamic-components/dynamic-filter/dynamic-filter-extra.component.d.ts +0 -27
  93. package/core-ux/lib/components/dynamic-components/dynamic-filter/dynamic-filter-panel.component.d.ts +0 -8
  94. package/core-ux/lib/components/dynamic-components/dynamic-filter/dynamic-filter.component.d.ts +0 -54
  95. package/core-ux/lib/components/dynamic-components/dynamic-form/dynamic-form.component.d.ts +0 -122
  96. package/core-ux/lib/components/filtersummary/filtersummary.component.d.ts +0 -27
  97. package/core-ux/lib/components/form-password/form-password.component.d.ts +0 -9
  98. package/core-ux/lib/components/grid-row/grid-row.component.d.ts +0 -12
  99. package/core-ux/lib/components/image-display/image.component.d.ts +0 -20
  100. package/core-ux/lib/components/input-selector/input-selector.component.d.ts +0 -50
  101. package/core-ux/lib/components/input-tree-selector/input-tree-selector.component.d.ts +0 -25
  102. package/core-ux/lib/components/logs/logs.component.d.ts +0 -32
  103. package/core-ux/lib/components/menu/menu.component.d.ts +0 -39
  104. package/core-ux/lib/components/menu-dashboard/menu-dashboard.component.d.ts +0 -15
  105. package/core-ux/lib/components/paginator/paginator.component.d.ts +0 -17
  106. package/core-ux/lib/components/parameter-field/parameter-field.component.d.ts +0 -13
  107. package/core-ux/lib/components/parameter-field/parameter-types/base-array-parameter-type.component.d.ts +0 -16
  108. package/core-ux/lib/components/parameter-field/parameter-types/base-parameter-type.component.d.ts +0 -21
  109. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-bool/parameter-type-bool.component.d.ts +0 -9
  110. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-bool-array/parameter-type-bool-array.component.d.ts +0 -12
  111. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-date/parameter-type-date.component.d.ts +0 -16
  112. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-date-array/parameter-type-date-array.component.d.ts +0 -17
  113. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-number/parameter-type-number.component.d.ts +0 -6
  114. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-number-array/parameter-type-number-array.component.d.ts +0 -6
  115. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-password/parameter-type-password.component.d.ts +0 -9
  116. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-text/parameter-type-text.component.d.ts +0 -7
  117. package/core-ux/lib/components/parameter-field/parameter-types/parameter-type-text-array/parameter-type-text-array.component.d.ts +0 -6
  118. package/core-ux/lib/components/property-grid/property-grid.component.d.ts +0 -125
  119. package/core-ux/lib/components/search-results/search-results.component.d.ts +0 -7
  120. package/core-ux/lib/components/tab/tab.component.d.ts +0 -14
  121. package/core-ux/lib/components/tabset/tabset.component.d.ts +0 -15
  122. package/core-ux/lib/components/text-viewer/text-viewer.component.d.ts +0 -21
  123. package/core-ux/lib/components/time-picker/time-picker.component.d.ts +0 -27
  124. package/core-ux/lib/components/tree/tree.component.d.ts +0 -39
  125. package/core-ux/lib/components/validation-error/validation-error.component.d.ts +0 -8
  126. package/core-ux/lib/components/wizard/wizard-step/wizard-step.component.d.ts +0 -26
  127. package/core-ux/lib/components/wizard/wizard.component.d.ts +0 -29
  128. package/core-ux/lib/core-ux.module.d.ts +0 -102
  129. package/core-ux/lib/directives/addclass.directive.d.ts +0 -11
  130. package/core-ux/lib/directives/collapse.directive.d.ts +0 -34
  131. package/core-ux/lib/directives/draggable.directive.d.ts +0 -39
  132. package/core-ux/lib/directives/droppable.directive.d.ts +0 -55
  133. package/core-ux/lib/directives/editMode.directive.d.ts +0 -8
  134. package/core-ux/lib/directives/focusable.directive.d.ts +0 -16
  135. package/core-ux/lib/directives/insertion.directive.d.ts +0 -8
  136. package/core-ux/lib/directives/onEnter.directive.d.ts +0 -11
  137. package/core-ux/lib/directives/tab-heading.d.ts +0 -8
  138. package/core-ux/lib/directives/tab-transclude.d.ts +0 -11
  139. package/core-ux/lib/directives/tooltip.directive.d.ts +0 -16
  140. package/core-ux/lib/directives/validate-on-enter.directive.d.ts +0 -10
  141. package/core-ux/lib/directives/viewMode.directive.d.ts +0 -8
  142. package/core-ux/lib/layout/default/default-layout.d.ts +0 -36
  143. package/core-ux/lib/layout/login/login-layout.d.ts +0 -15
  144. package/core-ux/lib/log.service.d.ts +0 -8
  145. package/core-ux/lib/modals/confirm-modal/confirm-modal.component.d.ts +0 -17
  146. package/core-ux/lib/modals/dialog/dialog.component.d.ts +0 -57
  147. package/core-ux/lib/modals/dialog-component.tokens.d.ts +0 -3
  148. package/core-ux/lib/modals/export-data-modal/export-data-modal.component.d.ts +0 -11
  149. package/core-ux/lib/modals/track-record-modal/track-record-modal.component.d.ts +0 -21
  150. package/core-ux/lib/modals/validation-modal/validation-modal.component.d.ts +0 -24
  151. package/core-ux/lib/model/datagrid.d.ts +0 -194
  152. package/core-ux/lib/model/model.d.ts +0 -222
  153. package/core-ux/lib/model/tree.d.ts +0 -12
  154. package/core-ux/lib/pipes/euro.pipe.d.ts +0 -9
  155. package/core-ux/lib/pipes/todefine.pipe.d.ts +0 -8
  156. package/core-ux/lib/pipes/tofixedsizeinteger.pipe.d.ts +0 -8
  157. package/core-ux/lib/services/action.service.d.ts +0 -42
  158. package/core-ux/lib/services/alert.service.d.ts +0 -51
  159. package/core-ux/lib/services/application.service.d.ts +0 -73
  160. package/core-ux/lib/services/can-deactivate-guard.d.ts +0 -12
  161. package/core-ux/lib/services/drag.service.d.ts +0 -54
  162. package/core-ux/lib/services/entity-selectors.d.ts +0 -37
  163. package/core-ux/lib/services/fire-authentication.service.d.ts +0 -13
  164. package/core-ux/lib/services/image.service.d.ts +0 -15
  165. package/core-ux/lib/services/modal-state.service.d.ts +0 -26
  166. package/core-ux/lib/services/modal.service.d.ts +0 -30
  167. package/core-ux/lib/services/presentation-profile.token.d.ts +0 -40
  168. package/core-ux/lib/services/selectorMapperBase.service.d.ts +0 -42
  169. package/core-ux/lib/v2/components/actions-panel/action-panel.component.d.ts +0 -48
  170. package/core-ux/lib/v2/components/base-component/base-component.d.ts +0 -80
  171. package/core-ux/lib/v2/components/cell-renderer/cell-renderer.component.d.ts +0 -11
  172. package/core-ux/lib/v2/components/data-grid/data-grid.component.d.ts +0 -104
  173. package/core-ux/lib/v2/components/data-grid/grid-field-descriptor/grid-field.component.d.ts +0 -55
  174. package/core-ux/lib/v2/components/data-list/data-list.component.d.ts +0 -29
  175. package/core-ux/lib/v2/components/editor-tab/editor-tab.component.d.ts +0 -15
  176. package/core-ux/lib/v2/components/editor-tabset/editor-tabset.component.d.ts +0 -18
  177. package/core-ux/lib/v2/components/field-descriptor/field.component.d.ts +0 -61
  178. package/core-ux/lib/v2/components/filter-form/filter-form.component.d.ts +0 -12
  179. package/core-ux/lib/v2/components/filter-summary/filter-summary.component.d.ts +0 -34
  180. package/core-ux/lib/v2/components/new-editor/new-editor.component.d.ts +0 -66
  181. package/core-ux/lib/v2/components/new-paginator/new-paginator.component.d.ts +0 -31
  182. package/core-ux/lib/v2/components/orderable/orderable-modal.component.d.ts +0 -36
  183. package/core-ux/lib/v2/components/orderable/orderable-modal.service.d.ts +0 -11
  184. package/core-ux/lib/v2/components/orderable/orderable.interface.d.ts +0 -52
  185. package/core-ux/lib/v2/components/property-editor/property-editor-component.d.ts +0 -89
  186. package/core-ux/lib/v2/components/selector/selector-registry.service.d.ts +0 -9
  187. package/core-ux/lib/v2/components/selector/selector.component.d.ts +0 -33
  188. package/core-ux/lib/v2/components/selector/selector.model.d.ts +0 -19
  189. package/core-ux/lib/v2/components/standard-page-layout/standard-page-layout.component.d.ts +0 -29
  190. package/core-ux/lib/v2/directives/base-shortcut.directive.d.ts +0 -15
  191. package/core-ux/lib/v2/directives/hide-on-threshold.directive.d.ts +0 -20
  192. package/core-ux/lib/v2/directives/layout-handler.directive.d.ts +0 -54
  193. package/core-ux/lib/v2/directives/row-ref.directive.d.ts +0 -21
  194. package/core-ux/lib/v2/models/aggregation-model.d.ts +0 -8
  195. package/core-ux/lib/v2/models/contexts/action-context.d.ts +0 -66
  196. package/core-ux/lib/v2/models/contexts/action-handler-context.d.ts +0 -49
  197. package/core-ux/lib/v2/models/contexts/base-form-context.d.ts +0 -42
  198. package/core-ux/lib/v2/models/contexts/change-detection-context.d.ts +0 -41
  199. package/core-ux/lib/v2/models/contexts/data-context.d.ts +0 -25
  200. package/core-ux/lib/v2/models/contexts/data-grid-style-context.d.ts +0 -36
  201. package/core-ux/lib/v2/models/contexts/editor-context.d.ts +0 -30
  202. package/core-ux/lib/v2/models/contexts/entity-config-context.d.ts +0 -49
  203. package/core-ux/lib/v2/models/contexts/filter-context.d.ts +0 -49
  204. package/core-ux/lib/v2/models/contexts/layout-context.d.ts +0 -57
  205. package/core-ux/lib/v2/models/contexts/logger-context.d.ts +0 -5
  206. package/core-ux/lib/v2/models/contexts/section-context.d.ts +0 -85
  207. package/core-ux/lib/v2/models/contexts/selection-context.d.ts +0 -45
  208. package/core-ux/lib/v2/models/entity-facade.d.ts +0 -35
  209. package/core-ux/lib/v2/models/guards/facade-load-guard.d.ts +0 -35
  210. package/core-ux/lib/v2/models/guards/filter-lifecycle-guard.d.ts +0 -29
  211. package/core-ux/lib/v2/models/states/sorting-state.d.ts +0 -14
  212. package/core-ux/lib/v2/models/utilities/action-definition.d.ts +0 -38
  213. package/core-ux/lib/v2/models/utilities/change-utilities.d.ts +0 -11
  214. package/core-ux/lib/v2/models/utilities/entity-updater.d.ts +0 -11
  215. package/core-ux/lib/v2/models/utilities/form-wrapper.d.ts +0 -30
  216. package/core-ux/lib/v2/models/utilities/row-registry.d.ts +0 -15
  217. package/core-ux/lib/v2/models/utilities/selection-styler.d.ts +0 -15
  218. package/core-ux/lib/v2/pipes/gridstyle.pipe.d.ts +0 -15
  219. package/core-ux/lib/v2/services/app-config.service.d.ts +0 -22
  220. package/core-ux/lib/v2/services/entity-facade-registry.service.d.ts +0 -28
  221. package/core-ux/lib/v2/services/facade-modal.service.d.ts +0 -21
  222. package/core-ux/lib/v2/services/layout.service.d.ts +0 -93
  223. package/core-ux/lib/v2/services/property-change-bus.service.d.ts +0 -9
  224. package/core-ux/lib/v2/services/selection.service.d.ts +0 -23
  225. package/core-ux/lib/v2/services/test.service.d.ts +0 -7
  226. package/core-ux/lib/v2/services/validation.service.d.ts +0 -10
  227. package/core-ux/lib/v2/services/view-model-loader.service.d.ts +0 -13
  228. package/system-data/index.d.ts +0 -68
  229. package/system-data/lib/data-services/account-service.generated.d.ts +0 -20
  230. package/system-data/lib/data-services/action-service.generated.d.ts +0 -15
  231. package/system-data/lib/data-services/address-service.generated.d.ts +0 -10
  232. package/system-data/lib/data-services/checkout-service.generated.d.ts +0 -13
  233. package/system-data/lib/data-services/company-service.generated.d.ts +0 -10
  234. package/system-data/lib/data-services/config-service.generated.d.ts +0 -18
  235. package/system-data/lib/data-services/country-service.generated.d.ts +0 -10
  236. package/system-data/lib/data-services/currency-service.generated.d.ts +0 -10
  237. package/system-data/lib/data-services/custom-field-group-entity-service.generated.d.ts +0 -10
  238. package/system-data/lib/data-services/custom-field-group-item-service.generated.d.ts +0 -13
  239. package/system-data/lib/data-services/custom-field-group-service.generated.d.ts +0 -10
  240. package/system-data/lib/data-services/custom-field-options-service.generated.d.ts +0 -10
  241. package/system-data/lib/data-services/custom-field-service.generated.d.ts +0 -10
  242. package/system-data/lib/data-services/custom-field-value-service.generated.d.ts +0 -10
  243. package/system-data/lib/data-services/day-info-service.generated.d.ts +0 -10
  244. package/system-data/lib/data-services/entity-files-service.generated.d.ts +0 -10
  245. package/system-data/lib/data-services/error-category-service.generated.d.ts +0 -13
  246. package/system-data/lib/data-services/exchange-rate-detail-service.generated.d.ts +0 -35
  247. package/system-data/lib/data-services/exchange-rate-service.generated.d.ts +0 -10
  248. package/system-data/lib/data-services/files-service.generated.d.ts +0 -26
  249. package/system-data/lib/data-services/keyword-service.generated.d.ts +0 -12
  250. package/system-data/lib/data-services/meta-entity-field-service.generated.d.ts +0 -10
  251. package/system-data/lib/data-services/meta-entity-form-field-service.generated.d.ts +0 -10
  252. package/system-data/lib/data-services/meta-entity-form-section-service.generated.d.ts +0 -10
  253. package/system-data/lib/data-services/meta-entity-form-service.generated.d.ts +0 -10
  254. package/system-data/lib/data-services/meta-entity-keyword-service.generated.d.ts +0 -10
  255. package/system-data/lib/data-services/meta-entity-relation-definition-service.generated.d.ts +0 -10
  256. package/system-data/lib/data-services/meta-entity-relation-service.generated.d.ts +0 -10
  257. package/system-data/lib/data-services/meta-entity-service.generated.d.ts +0 -10
  258. package/system-data/lib/data-services/meta-entity-translation-service.generated.d.ts +0 -10
  259. package/system-data/lib/data-services/meta-entity-view-field-service.generated.d.ts +0 -10
  260. package/system-data/lib/data-services/news-service.generated.d.ts +0 -13
  261. package/system-data/lib/data-services/parameter-section-service.generated.d.ts +0 -10
  262. package/system-data/lib/data-services/parameter-service.generated.d.ts +0 -10
  263. package/system-data/lib/data-services/parameter-value-service.generated.d.ts +0 -10
  264. package/system-data/lib/data-services/permission-service.generated.d.ts +0 -13
  265. package/system-data/lib/data-services/plugin-parameter-value-service.generated.d.ts +0 -10
  266. package/system-data/lib/data-services/presentation-profile-item-service.generated.d.ts +0 -14
  267. package/system-data/lib/data-services/presentation-profile-service.generated.d.ts +0 -13
  268. package/system-data/lib/data-services/rating-service.generated.d.ts +0 -14
  269. package/system-data/lib/data-services/rating-summary-service.generated.d.ts +0 -10
  270. package/system-data/lib/data-services/request-entity-service.generated.d.ts +0 -10
  271. package/system-data/lib/data-services/request-result-service.generated.d.ts +0 -12
  272. package/system-data/lib/data-services/request-service.generated.d.ts +0 -10
  273. package/system-data/lib/data-services/resource-key-service.generated.d.ts +0 -10
  274. package/system-data/lib/data-services/resource-language-service.generated.d.ts +0 -10
  275. package/system-data/lib/data-services/resource-translation-service.generated.d.ts +0 -10
  276. package/system-data/lib/data-services/role-permission-service.generated.d.ts +0 -10
  277. package/system-data/lib/data-services/role-service.generated.d.ts +0 -10
  278. package/system-data/lib/data-services/subcompany-service.generated.d.ts +0 -10
  279. package/system-data/lib/data-services/supplier-company-service.generated.d.ts +0 -10
  280. package/system-data/lib/data-services/supplier-service.generated.d.ts +0 -10
  281. package/system-data/lib/data-services/synchronized-company-service.generated.d.ts +0 -10
  282. package/system-data/lib/data-services/tva-rate-service.generated.d.ts +0 -10
  283. package/system-data/lib/data-services/user-account-company-service.generated.d.ts +0 -10
  284. package/system-data/lib/data-services/user-account-news-service.generated.d.ts +0 -10
  285. package/system-data/lib/data-services/user-account-role-service.generated.d.ts +0 -10
  286. package/system-data/lib/data-services/user-account-service.generated.d.ts +0 -10
  287. package/system-data/lib/data-services/user-account-token-service.generated.d.ts +0 -10
  288. package/system-data/lib/data-services/user-favorite-service.generated.d.ts +0 -10
  289. package/system-data/lib/data-services/user-group-definition-service.generated.d.ts +0 -10
  290. package/system-data/lib/data-services/user-group-service.generated.d.ts +0 -10
  291. package/system-data/lib/data-services/user-history-service.generated.d.ts +0 -10
  292. package/system-data/lib/data-services/user-permission-view-service.generated.d.ts +0 -10
  293. package/system-data/lib/data-services/user-session-service.generated.d.ts +0 -10
  294. package/system-data/lib/data-services/version-service.generated.d.ts +0 -10
  295. package/system-data/lib/system-data.module.d.ts +0 -9
  296. package/system-model/index.d.ts +0 -3
  297. package/system-model/lib/model/interface.generated.d.ts +0 -1588
  298. package/system-model/lib/model/model.d.ts +0 -11
  299. package/system-model/lib/system-model.module.d.ts +0 -7
  300. package/system-root/index.d.ts +0 -8
  301. package/system-root/lib/generated/system-entity-keys.generated.d.ts +0 -63
  302. package/system-root/lib/generated/system-menu-item-provider.generated.d.ts +0 -67
  303. package/system-root/lib/generated/system-menu-service.generated.d.ts +0 -26
  304. package/system-root/lib/generated/system-permissions.generated.d.ts +0 -368
  305. package/system-root/lib/system-entity-keys.d.ts +0 -11
  306. package/system-root/lib/system-menu-item-provider.d.ts +0 -11
  307. package/system-root/lib/system-menu-service.d.ts +0 -12
  308. package/system-root/lib/system-root.module.d.ts +0 -7
  309. package/system-ux/index.d.ts +0 -181
  310. package/system-ux/lib/activate/activate.component.d.ts +0 -36
  311. package/system-ux/lib/address/address-editor.component.d.ts +0 -12
  312. package/system-ux/lib/app/access-denied/access-denied.component.d.ts +0 -9
  313. package/system-ux/lib/app/dflat-app.module.d.ts +0 -49
  314. package/system-ux/lib/app/history/history.component.d.ts +0 -16
  315. package/system-ux/lib/app/homepage/homepage.component.d.ts +0 -19
  316. package/system-ux/lib/app/layout/dflat-layout.component.d.ts +0 -38
  317. package/system-ux/lib/app/search/search-result/search-result.component.d.ts +0 -42
  318. package/system-ux/lib/app/search/search.component.d.ts +0 -68
  319. package/system-ux/lib/app/services/dflat-app.service.d.ts +0 -21
  320. package/system-ux/lib/app/services/dflat-auth.interceptor.d.ts +0 -16
  321. package/system-ux/lib/app/services/dflat-permission.service.d.ts +0 -7
  322. package/system-ux/lib/app/spinner/dflat-spinner.component.d.ts +0 -11
  323. package/system-ux/lib/app/user-menu/user-menu.component.d.ts +0 -56
  324. package/system-ux/lib/app/user-profile/user-profile.component.d.ts +0 -35
  325. package/system-ux/lib/components/image-upload/image-upload.component.d.ts +0 -99
  326. package/system-ux/lib/config/config-component.d.ts +0 -22
  327. package/system-ux/lib/config/datawarehouse-supply/dw-supply.component.d.ts +0 -14
  328. package/system-ux/lib/custom-field/custom-field-editor.component.d.ts +0 -13
  329. package/system-ux/lib/custom-field-options/custom-field-options-editor.component.d.ts +0 -17
  330. package/system-ux/lib/data-components/address.component.d.ts +0 -7
  331. package/system-ux/lib/data-components/company.component.d.ts +0 -15
  332. package/system-ux/lib/data-components/country.component.d.ts +0 -6
  333. package/system-ux/lib/data-components/currency.component.d.ts +0 -6
  334. package/system-ux/lib/data-components/customfield.component.d.ts +0 -15
  335. package/system-ux/lib/data-components/customfieldgroup.component.d.ts +0 -21
  336. package/system-ux/lib/data-components/customfieldgroupentity.component.d.ts +0 -16
  337. package/system-ux/lib/data-components/customfieldgroupitem.component.d.ts +0 -25
  338. package/system-ux/lib/data-components/customfieldoptions.component.d.ts +0 -19
  339. package/system-ux/lib/data-components/customfieldvalue.component.d.ts +0 -10
  340. package/system-ux/lib/data-components/dayinfo.component.d.ts +0 -10
  341. package/system-ux/lib/data-components/errorcategory.component.d.ts +0 -10
  342. package/system-ux/lib/data-components/exchangerate.component.d.ts +0 -11
  343. package/system-ux/lib/data-components/files.component.d.ts +0 -10
  344. package/system-ux/lib/data-components/generated/address.component.generated.d.ts +0 -18
  345. package/system-ux/lib/data-components/generated/company.component.generated.d.ts +0 -25
  346. package/system-ux/lib/data-components/generated/country.component.generated.d.ts +0 -25
  347. package/system-ux/lib/data-components/generated/currency.component.generated.d.ts +0 -25
  348. package/system-ux/lib/data-components/generated/customfield.component.generated.d.ts +0 -25
  349. package/system-ux/lib/data-components/generated/customfieldgroup.component.generated.d.ts +0 -25
  350. package/system-ux/lib/data-components/generated/customfieldgroupentity.component.generated.d.ts +0 -18
  351. package/system-ux/lib/data-components/generated/customfieldgroupitem.component.generated.d.ts +0 -18
  352. package/system-ux/lib/data-components/generated/customfieldoptions.component.generated.d.ts +0 -18
  353. package/system-ux/lib/data-components/generated/customfieldvalue.component.generated.d.ts +0 -18
  354. package/system-ux/lib/data-components/generated/dayinfo.component.generated.d.ts +0 -18
  355. package/system-ux/lib/data-components/generated/entityfiles.component.generated.d.ts +0 -18
  356. package/system-ux/lib/data-components/generated/errorcategory.component.generated.d.ts +0 -18
  357. package/system-ux/lib/data-components/generated/exchangerate.component.generated.d.ts +0 -18
  358. package/system-ux/lib/data-components/generated/files.component.generated.d.ts +0 -18
  359. package/system-ux/lib/data-components/generated/keyword.component.generated.d.ts +0 -25
  360. package/system-ux/lib/data-components/generated/metaentity.component.generated.d.ts +0 -25
  361. package/system-ux/lib/data-components/generated/metaentityfield.component.generated.d.ts +0 -25
  362. package/system-ux/lib/data-components/generated/metaentityform.component.generated.d.ts +0 -25
  363. package/system-ux/lib/data-components/generated/metaentityformfield.component.generated.d.ts +0 -18
  364. package/system-ux/lib/data-components/generated/metaentityformsection.component.generated.d.ts +0 -25
  365. package/system-ux/lib/data-components/generated/metaentitykeyword.component.generated.d.ts +0 -18
  366. package/system-ux/lib/data-components/generated/metaentityrelation.component.generated.d.ts +0 -25
  367. package/system-ux/lib/data-components/generated/metaentityrelationdefinition.component.generated.d.ts +0 -18
  368. package/system-ux/lib/data-components/generated/metaentitytranslation.component.generated.d.ts +0 -18
  369. package/system-ux/lib/data-components/generated/metaentityviewfield.component.generated.d.ts +0 -25
  370. package/system-ux/lib/data-components/generated/news.component.generated.d.ts +0 -25
  371. package/system-ux/lib/data-components/generated/parameter.component.generated.d.ts +0 -25
  372. package/system-ux/lib/data-components/generated/parametersection.component.generated.d.ts +0 -25
  373. package/system-ux/lib/data-components/generated/parametervalue.component.generated.d.ts +0 -18
  374. package/system-ux/lib/data-components/generated/permission.component.generated.d.ts +0 -25
  375. package/system-ux/lib/data-components/generated/presentationprofile.component.generated.d.ts +0 -25
  376. package/system-ux/lib/data-components/generated/presentationprofileitem.component.generated.d.ts +0 -18
  377. package/system-ux/lib/data-components/generated/rating.component.generated.d.ts +0 -18
  378. package/system-ux/lib/data-components/generated/ratingsummary.component.generated.d.ts +0 -25
  379. package/system-ux/lib/data-components/generated/request.component.generated.d.ts +0 -25
  380. package/system-ux/lib/data-components/generated/requestentity.component.generated.d.ts +0 -25
  381. package/system-ux/lib/data-components/generated/requestresult.component.generated.d.ts +0 -18
  382. package/system-ux/lib/data-components/generated/resourcekey.component.generated.d.ts +0 -25
  383. package/system-ux/lib/data-components/generated/resourcelanguage.component.generated.d.ts +0 -25
  384. package/system-ux/lib/data-components/generated/resourcetranslation.component.generated.d.ts +0 -18
  385. package/system-ux/lib/data-components/generated/role.component.generated.d.ts +0 -25
  386. package/system-ux/lib/data-components/generated/rolepermission.component.generated.d.ts +0 -18
  387. package/system-ux/lib/data-components/generated/subcompany.component.generated.d.ts +0 -18
  388. package/system-ux/lib/data-components/generated/supplier.component.generated.d.ts +0 -25
  389. package/system-ux/lib/data-components/generated/suppliercompany.component.generated.d.ts +0 -18
  390. package/system-ux/lib/data-components/generated/synchronizedcompany.component.generated.d.ts +0 -18
  391. package/system-ux/lib/data-components/generated/system-components.generated.d.ts +0 -69
  392. package/system-ux/lib/data-components/generated/tvarate.component.generated.d.ts +0 -18
  393. package/system-ux/lib/data-components/generated/useraccount.component.generated.d.ts +0 -25
  394. package/system-ux/lib/data-components/generated/useraccountcompany.component.generated.d.ts +0 -18
  395. package/system-ux/lib/data-components/generated/useraccountnews.component.generated.d.ts +0 -18
  396. package/system-ux/lib/data-components/generated/useraccountrole.component.generated.d.ts +0 -18
  397. package/system-ux/lib/data-components/generated/useraccounttoken.component.generated.d.ts +0 -18
  398. package/system-ux/lib/data-components/generated/userfavorite.component.generated.d.ts +0 -18
  399. package/system-ux/lib/data-components/generated/usergroup.component.generated.d.ts +0 -18
  400. package/system-ux/lib/data-components/generated/usergroupdefinition.component.generated.d.ts +0 -18
  401. package/system-ux/lib/data-components/generated/userhistory.component.generated.d.ts +0 -18
  402. package/system-ux/lib/data-components/generated/userpermissionview.component.generated.d.ts +0 -18
  403. package/system-ux/lib/data-components/generated/usersession.component.generated.d.ts +0 -18
  404. package/system-ux/lib/data-components/generated/version.component.generated.d.ts +0 -18
  405. package/system-ux/lib/data-components/keyword.component.d.ts +0 -10
  406. package/system-ux/lib/data-components/metaentity.component.d.ts +0 -16
  407. package/system-ux/lib/data-components/metaentityfield.component.d.ts +0 -17
  408. package/system-ux/lib/data-components/metaentityform.component.d.ts +0 -10
  409. package/system-ux/lib/data-components/metaentityformfield.component.d.ts +0 -10
  410. package/system-ux/lib/data-components/metaentityformsection.component.d.ts +0 -10
  411. package/system-ux/lib/data-components/metaentitykeyword.component.d.ts +0 -10
  412. package/system-ux/lib/data-components/metaentityrelation.component.d.ts +0 -10
  413. package/system-ux/lib/data-components/metaentityrelationdefinition.component.d.ts +0 -10
  414. package/system-ux/lib/data-components/metaentitytranslation.component.d.ts +0 -10
  415. package/system-ux/lib/data-components/metaentityviewfield.component.d.ts +0 -10
  416. package/system-ux/lib/data-components/news.component.d.ts +0 -8
  417. package/system-ux/lib/data-components/parameter.component.d.ts +0 -10
  418. package/system-ux/lib/data-components/parametersection.component.d.ts +0 -10
  419. package/system-ux/lib/data-components/parametervalue.component.d.ts +0 -15
  420. package/system-ux/lib/data-components/permission.component.d.ts +0 -8
  421. package/system-ux/lib/data-components/presentationprofileitem.component.d.ts +0 -10
  422. package/system-ux/lib/data-components/rating.component.d.ts +0 -10
  423. package/system-ux/lib/data-components/ratingsummary.component.d.ts +0 -10
  424. package/system-ux/lib/data-components/request.component.d.ts +0 -16
  425. package/system-ux/lib/data-components/requestentity.component.d.ts +0 -10
  426. package/system-ux/lib/data-components/requestresult.component.d.ts +0 -10
  427. package/system-ux/lib/data-components/resourcekey.component.d.ts +0 -11
  428. package/system-ux/lib/data-components/resourcelanguage.component.d.ts +0 -9
  429. package/system-ux/lib/data-components/resourcetranslation.component.d.ts +0 -10
  430. package/system-ux/lib/data-components/role.component.d.ts +0 -10
  431. package/system-ux/lib/data-components/rolepermission.component.d.ts +0 -10
  432. package/system-ux/lib/data-components/subcompany.component.d.ts +0 -11
  433. package/system-ux/lib/data-components/supplier.component.d.ts +0 -8
  434. package/system-ux/lib/data-components/suppliercompany.component.d.ts +0 -10
  435. package/system-ux/lib/data-components/synchronizedcompany.component.d.ts +0 -15
  436. package/system-ux/lib/data-components/tvarate.component.d.ts +0 -14
  437. package/system-ux/lib/data-components/useraccount.component.d.ts +0 -11
  438. package/system-ux/lib/data-components/useraccountcompany.component.d.ts +0 -10
  439. package/system-ux/lib/data-components/useraccountnews.component.d.ts +0 -10
  440. package/system-ux/lib/data-components/useraccountrole.component.d.ts +0 -10
  441. package/system-ux/lib/data-components/useraccounttoken.component.d.ts +0 -10
  442. package/system-ux/lib/data-components/usercompany.component.d.ts +0 -19
  443. package/system-ux/lib/data-components/userfavorite.component.d.ts +0 -10
  444. package/system-ux/lib/data-components/usergroup.component.d.ts +0 -8
  445. package/system-ux/lib/data-components/usergroupdefinition.component.d.ts +0 -15
  446. package/system-ux/lib/data-components/userhistory.component.d.ts +0 -10
  447. package/system-ux/lib/data-components/userpermission.component.d.ts +0 -11
  448. package/system-ux/lib/data-components/userpermissionview.component.d.ts +0 -10
  449. package/system-ux/lib/data-components/userrole.component.d.ts +0 -17
  450. package/system-ux/lib/data-components/usersession.component.d.ts +0 -10
  451. package/system-ux/lib/data-components/version.component.d.ts +0 -10
  452. package/system-ux/lib/editor-components/company-editor.component.d.ts +0 -12
  453. package/system-ux/lib/editor-components/country-editor.component.d.ts +0 -12
  454. package/system-ux/lib/editor-components/currency-editor.component.d.ts +0 -12
  455. package/system-ux/lib/editor-components/custom-field-group-editor.component.d.ts +0 -14
  456. package/system-ux/lib/editor-components/custom-field-group-entity-editor.component.d.ts +0 -13
  457. package/system-ux/lib/editor-components/custom-field-group-item-editor.component.d.ts +0 -12
  458. package/system-ux/lib/editor-components/news-editor.component.d.ts +0 -28
  459. package/system-ux/lib/editor-components/permission-editor.component.d.ts +0 -12
  460. package/system-ux/lib/editor-components/request-editor.component.d.ts +0 -12
  461. package/system-ux/lib/editor-components/resource-translation-editor.component.d.ts +0 -12
  462. package/system-ux/lib/editor-components/role-editor.component.d.ts +0 -27
  463. package/system-ux/lib/editor-components/user-account-editor.component.d.ts +0 -12
  464. package/system-ux/lib/editor-components/user-account-profile.component.d.ts +0 -31
  465. package/system-ux/lib/editor-components/user-group-editor.component.d.ts +0 -12
  466. package/system-ux/lib/entity-files/entity-files.component.d.ts +0 -37
  467. package/system-ux/lib/exchange-rate/exchange-rate-detail.component.d.ts +0 -17
  468. package/system-ux/lib/exchange-rate/exchange-rate-editor.component.d.ts +0 -25
  469. package/system-ux/lib/login/login.component.d.ts +0 -37
  470. package/system-ux/lib/meta-entity-field/meta-entity-field-editor.component.d.ts +0 -12
  471. package/system-ux/lib/presentation-profile/pp-facade.service.d.ts +0 -39
  472. package/system-ux/lib/presentation-profile/presentation-profile-action-service.d.ts +0 -16
  473. package/system-ux/lib/presentation-profile/presentation-profile-column-grid/presentation-profile-column.component.d.ts +0 -73
  474. package/system-ux/lib/presentation-profile/presentation-profile-column-grid/presentation-profile-items.component.d.ts +0 -50
  475. package/system-ux/lib/presentation-profile/presentation-profile-resolver.service.d.ts +0 -34
  476. package/system-ux/lib/presentation-profile/presentation-profile-transformer.d.ts +0 -48
  477. package/system-ux/lib/presentation-profile/presentation-profile.component.d.ts +0 -16
  478. package/system-ux/lib/presentation-profile/presentation-profile.service.d.ts +0 -58
  479. package/system-ux/lib/request-results/request-results.component.d.ts +0 -15
  480. package/system-ux/lib/reset-password/reset-password.component.d.ts +0 -32
  481. package/system-ux/lib/resource-language/resourcelanguage-editor.component.d.ts +0 -12
  482. package/system-ux/lib/services/custom-field-action-service.d.ts +0 -25
  483. package/system-ux/lib/services/custom-field-service.d.ts +0 -21
  484. package/system-ux/lib/services/rates-action-service.d.ts +0 -28
  485. package/system-ux/lib/services/select-user-company-action-service.d.ts +0 -23
  486. package/system-ux/lib/services/system-section.service.d.ts +0 -12
  487. package/system-ux/lib/services/system-selector-mapper.service.d.ts +0 -24
  488. package/system-ux/lib/services/user-action-service.d.ts +0 -20
  489. package/system-ux/lib/supplier/supplier-editor.component.d.ts +0 -12
  490. package/system-ux/lib/system-ux.module.d.ts +0 -131
  491. package/system-ux/lib/tva-rate/tva-rate-detail.component.d.ts +0 -17
  492. package/system-ux/lib/tva-rate/tva-rate-editor.component.d.ts +0 -25
@@ -1,1622 +1,1847 @@
1
- import * as i7 from '@dflat-core/web/core';
2
- import { Utilities, EnsureModuleLoadedOnceGuard } from '@dflat-core/web/core';
3
- import { DictionnaryWrapper, UserUpdatedMessage, Notification, User, CoreModelModule, ApiErrorTypes } from '@dflat-core/web/core-model';
4
- import { CommonModule } from '@angular/common';
5
- import * as i3 from '@angular/common/http';
6
- import { HttpHeaders, provideHttpClient, withInterceptorsFromDi, HttpErrorResponse } from '@angular/common/http';
7
- import * as i0 from '@angular/core';
8
- import { Injectable, EventEmitter, Optional, SkipSelf, NgModule, InjectionToken, Inject } from '@angular/core';
9
- import * as i1 from '@angular/router';
10
- import jwt_decode from 'jwt-decode';
11
- import { Subject, ReplaySubject, timer, throwError, BehaviorSubject, empty } from 'rxjs';
12
- import { filter, map, finalize, catchError } from 'rxjs/operators';
13
- import * as i1$1 from '@angular/platform-browser';
14
- import * as signalR from '@microsoft/signalr';
15
-
16
- class AppConfiguration {
17
- constructor() {
18
- this.searchText = "";
19
- this.isSearchAllowed = false;
20
- }
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AppConfiguration, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
22
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AppConfiguration }); }
23
- }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AppConfiguration, decorators: [{
25
- type: Injectable
26
- }], ctorParameters: () => [] });
27
-
28
- class AppKeys {
29
- static { this.CURRENT_USER = "current_user"; }
30
- static { this.ACCESS_TOKEN = "access_token"; }
31
- static { this.REFRESH_TOKEN = "refresh_token"; }
32
- static { this.TOKEN_EXPIRES_IN = "expires_in"; }
33
- static { this.REMEMBER_ME = "remember_me"; }
34
- static { this.PERMISSIONS = "permissions"; }
35
- static { this.LAST_GEOLOCATIONS = "geolocations"; }
36
- static { this.REFERENCE_SUPPLIER_ID = "refsuppid"; }
37
- static { this.USER_COMPANY_ID = "companyid"; }
38
- static { this.SELECTED_COMPANY = "selectedcompany"; }
39
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AppKeys, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
40
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AppKeys }); }
41
- }
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AppKeys, decorators: [{
43
- type: Injectable
44
- }] });
45
-
46
- class BusMessageService {
47
- constructor() {
48
- this.message$ = new Subject();
49
- }
50
- publish(message) {
51
- const channel = message.constructor.name;
52
- this.message$.next({ Channel: channel, Data: message });
53
- }
54
- of(messageType) {
55
- const channel = messageType.name;
56
- return this.message$.pipe(filter(m => m.Channel === channel), map(m => m.Data));
57
- }
58
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: BusMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
59
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: BusMessageService }); }
60
- }
61
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: BusMessageService, decorators: [{
62
- type: Injectable
63
- }], ctorParameters: () => [] });
64
- class NotificationMqService {
65
- constructor() {
66
- this.message$ = new Subject();
67
- }
68
- publish(message) {
69
- const defaultchannel = message.entityType;
70
- this.message$.next({ Channel: defaultchannel, Data: message });
71
- if (!Utilities.IsUndefined(message.entityId)) {
72
- const detailchannel = `${message.entityType}-${message.entityId}`;
73
- this.message$.next({ Channel: detailchannel, Data: message });
74
- }
75
- }
76
- of(channelKey) {
77
- const channel = channelKey;
78
- return this.message$.pipe(filter(m => m.Channel === channel), map(m => m.Data));
79
- }
80
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NotificationMqService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
81
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NotificationMqService }); }
82
- }
83
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NotificationMqService, decorators: [{
84
- type: Injectable
85
- }], ctorParameters: () => [] });
86
-
87
- class LocalStoreManager {
88
- constructor() {
89
- this.syncKeys = [];
90
- this.initEvent = new Subject();
91
- this.reservedKeys = ['sync_keys', 'addToSyncKeys', 'removeFromSyncKeys',
92
- 'getSessionStorage', 'setSessionStorage', 'addToSessionStorage', 'removeFromSessionStorage', 'clearAllSessionsStorage'];
93
- this.sessionStorageTransferHandler = (event) => {
94
- if (!event.newValue)
95
- return;
96
- if (event.key == 'getSessionStorage') {
97
- if (sessionStorage.length) {
98
- this.localStorageSetItem('setSessionStorage', sessionStorage);
99
- localStorage.removeItem('setSessionStorage');
100
- }
101
- }
102
- else if (event.key == 'setSessionStorage') {
103
- if (!this.syncKeys.length)
104
- this.loadSyncKeys();
105
- let data = JSON.parse(event.newValue);
106
- //console.info("Set => Key: Transfer setSessionStorage" + ", data: " + JSON.stringify(data));
107
- for (let key in data) {
108
- if (this.syncKeysContains(key))
109
- this.sessionStorageSetItem(key, JSON.parse(data[key]));
110
- }
111
- this.onInit();
112
- }
113
- else if (event.key === 'addToSessionStorage') {
114
- let data = JSON.parse(event.newValue);
115
- //console.warn("Set => Key: Transfer addToSessionStorage" + ", data: " + JSON.stringify(data));
116
- this.addToSessionStorageHelper(data["data"], data["key"]);
117
- }
118
- else if (event.key === 'removeFromSessionStorage') {
119
- this.removeFromSessionStorageHelper(event.newValue);
120
- }
121
- else if (event.key === 'clearAllSessionsStorage' && sessionStorage.length) {
122
- this.clearInstanceSessionStorage();
123
- }
124
- else if (event.key === 'addToSyncKeys') {
125
- this.addToSyncKeysHelper(event.newValue);
126
- }
127
- else if (event.key === 'removeFromSyncKeys') {
128
- this.removeFromSyncKeysHelper(event.newValue);
129
- }
130
- };
131
- }
132
- static { this.syncListenerInitialised = false; }
133
- static { this.DBKEY_USER_DATA = "user_data"; }
134
- static { this.DBKEY_SYNC_KEYS = "sync_keys"; }
135
- //Todo: Implement EventListeners for the various event operations and a SessionStorageEvent for specific data keys
136
- initialiseStorageSyncListener() {
137
- if (LocalStoreManager.syncListenerInitialised == true)
138
- return;
139
- LocalStoreManager.syncListenerInitialised = true;
140
- window.addEventListener("storage", this.sessionStorageTransferHandler, false);
141
- this.syncSessionStorage();
142
- }
143
- deinitialiseStorageSyncListener() {
144
- window.removeEventListener("storage", this.sessionStorageTransferHandler, false);
145
- LocalStoreManager.syncListenerInitialised = false;
146
- }
147
- syncSessionStorage() {
148
- localStorage.setItem('getSessionStorage', '_dummy');
149
- localStorage.removeItem('getSessionStorage');
150
- }
151
- clearAllStorage() {
152
- this.clearAllSessionsStorage();
153
- this.clearLocalStorage();
154
- }
155
- clearAllSessionsStorage() {
156
- this.clearInstanceSessionStorage();
157
- localStorage.removeItem(LocalStoreManager.DBKEY_SYNC_KEYS);
158
- localStorage.setItem('clearAllSessionsStorage', '_dummy');
159
- localStorage.removeItem('clearAllSessionsStorage');
160
- }
161
- clearInstanceSessionStorage() {
162
- sessionStorage.clear();
163
- this.syncKeys = [];
164
- }
165
- clearLocalStorage() {
166
- localStorage.clear();
167
- }
168
- addToSessionStorage(data, key) {
169
- this.addToSessionStorageHelper(data, key);
170
- this.addToSyncKeysBackup(key);
171
- this.localStorageSetItem('addToSessionStorage', { key: key, data: data });
172
- localStorage.removeItem('addToSessionStorage');
173
- }
174
- addToSessionStorageHelper(data, key) {
175
- this.addToSyncKeysHelper(key);
176
- this.sessionStorageSetItem(key, data);
177
- }
178
- removeFromSessionStorage(keyToRemove) {
179
- this.removeFromSessionStorageHelper(keyToRemove);
180
- this.removeFromSyncKeysBackup(keyToRemove);
181
- localStorage.setItem('removeFromSessionStorage', keyToRemove);
182
- localStorage.removeItem('removeFromSessionStorage');
183
- }
184
- removeFromSessionStorageHelper(keyToRemove) {
185
- sessionStorage.removeItem(keyToRemove);
186
- this.removeFromSyncKeysHelper(keyToRemove);
187
- }
188
- testForInvalidKeys(key) {
189
- if (!key)
190
- throw new Error("key cannot be empty");
191
- if (this.reservedKeys.some(x => x === key))
192
- throw new Error(`The storage key "${key}" is reserved and cannot be used. Please use a different key`);
193
- }
194
- syncKeysContains(key) {
195
- return this.syncKeys.some(x => x === key);
196
- }
197
- loadSyncKeys() {
198
- if (this.syncKeys.length)
199
- return;
200
- this.syncKeys = this.getSyncKeysFromStorage();
201
- }
202
- getSyncKeysFromStorage(defaultValue = []) {
203
- let data = this.localStorageGetItem(LocalStoreManager.DBKEY_SYNC_KEYS);
204
- if (data == null)
205
- return defaultValue;
206
- else
207
- return data;
208
- }
209
- addToSyncKeys(key) {
210
- this.addToSyncKeysHelper(key);
211
- this.addToSyncKeysBackup(key);
212
- localStorage.setItem('addToSyncKeys', key);
213
- localStorage.removeItem('addToSyncKeys');
214
- }
215
- addToSyncKeysBackup(key) {
216
- let storedSyncKeys = this.getSyncKeysFromStorage();
217
- if (!storedSyncKeys.some(x => x === key)) {
218
- storedSyncKeys.push(key);
219
- this.localStorageSetItem(LocalStoreManager.DBKEY_SYNC_KEYS, storedSyncKeys);
220
- }
221
- }
222
- removeFromSyncKeysBackup(key) {
223
- let storedSyncKeys = this.getSyncKeysFromStorage();
224
- let index = storedSyncKeys.indexOf(key);
225
- if (index > -1) {
226
- storedSyncKeys.splice(index, 1);
227
- this.localStorageSetItem(LocalStoreManager.DBKEY_SYNC_KEYS, storedSyncKeys);
228
- }
229
- }
230
- addToSyncKeysHelper(key) {
231
- if (!this.syncKeysContains(key))
232
- this.syncKeys.push(key);
233
- }
234
- removeFromSyncKeys(key) {
235
- this.removeFromSyncKeysHelper(key);
236
- this.removeFromSyncKeysBackup(key);
237
- localStorage.setItem('removeFromSyncKeys', key);
238
- localStorage.removeItem('removeFromSyncKeys');
239
- }
240
- removeFromSyncKeysHelper(key) {
241
- let index = this.syncKeys.indexOf(key);
242
- if (index > -1) {
243
- this.syncKeys.splice(index, 1);
244
- }
245
- }
246
- saveSessionData(data, key = LocalStoreManager.DBKEY_USER_DATA) {
247
- this.testForInvalidKeys(key);
248
- this.removeFromSyncKeys(key);
249
- localStorage.removeItem(key);
250
- this.sessionStorageSetItem(key, data);
251
- }
252
- saveSyncedSessionData(data, key = LocalStoreManager.DBKEY_USER_DATA) {
253
- this.testForInvalidKeys(key);
254
- localStorage.removeItem(key);
255
- this.addToSessionStorage(data, key);
256
- }
257
- savePermanentData(data, key = LocalStoreManager.DBKEY_USER_DATA) {
258
- this.testForInvalidKeys(key);
259
- this.removeFromSessionStorage(key);
260
- this.localStorageSetItem(key, data);
261
- }
262
- moveDataToSessionStorage(key = LocalStoreManager.DBKEY_USER_DATA) {
263
- this.testForInvalidKeys(key);
264
- let data = this.getData(key);
265
- if (data == null)
266
- return;
267
- this.saveSessionData(data, key);
268
- }
269
- moveDataToSyncedSessionStorage(key = LocalStoreManager.DBKEY_USER_DATA) {
270
- this.testForInvalidKeys(key);
271
- let data = this.getData(key);
272
- if (data == null)
273
- return;
274
- this.saveSyncedSessionData(data, key);
275
- }
276
- moveDataToPermanentStorage(key = LocalStoreManager.DBKEY_USER_DATA) {
277
- this.testForInvalidKeys(key);
278
- let data = this.getData(key);
279
- if (data == null)
280
- return;
281
- this.savePermanentData(data, key);
282
- }
283
- exists(key = LocalStoreManager.DBKEY_USER_DATA) {
284
- let data = sessionStorage.getItem(key);
285
- if (data == null)
286
- data = localStorage.getItem(key);
287
- return data != null;
288
- }
289
- getData(key = LocalStoreManager.DBKEY_USER_DATA) {
290
- this.testForInvalidKeys(key);
291
- let data = this.sessionStorageGetItem(key);
292
- if (data == null)
293
- data = this.localStorageGetItem(key);
294
- return data;
295
- }
296
- getDataObject(key = LocalStoreManager.DBKEY_USER_DATA, isDateType = false) {
297
- let data = this.getData(key);
298
- if (data != null) {
299
- if (isDateType)
300
- data = new Date(data);
301
- return data;
302
- }
303
- else {
304
- return null;
305
- }
306
- }
307
- deleteData(key = LocalStoreManager.DBKEY_USER_DATA) {
308
- this.testForInvalidKeys(key);
309
- this.removeFromSessionStorage(key);
310
- localStorage.removeItem(key);
311
- }
312
- localStorageSetItem(key, data) {
313
- localStorage.setItem(key, JSON.stringify(data));
314
- }
315
- sessionStorageSetItem(key, data) {
316
- sessionStorage.setItem(key, JSON.stringify(data));
317
- }
318
- localStorageGetItem(key) {
319
- return Utilities.JSonTryParse(localStorage.getItem(key));
320
- }
321
- sessionStorageGetItem(key) {
322
- return Utilities.JSonTryParse(sessionStorage.getItem(key));
323
- }
324
- onInit() {
325
- setTimeout(() => {
326
- this.initEvent.next({});
327
- this.initEvent.complete();
328
- });
329
- }
330
- getInitEvent() {
331
- return this.initEvent.asObservable();
332
- }
333
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: LocalStoreManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
334
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: LocalStoreManager }); }
335
- }
336
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: LocalStoreManager, decorators: [{
337
- type: Injectable
338
- }] });
339
-
340
- class HeadersService {
341
- constructor(localStorage) {
342
- this.localStorage = localStorage;
343
- }
344
- // for requesting secure data using json
345
- authJsonHeaders() {
346
- let result = new HttpHeaders()
347
- .set('Content-Type', 'application/json')
348
- .set('Accept', 'application/json')
349
- .set('Authorization', `Bearer ${this.geJWTToken}`);
350
- return result;
351
- }
352
- // for requesting secure data from a form post
353
- authFormHeaders() {
354
- let result = new HttpHeaders()
355
- .set('Content-Type', 'application/x-www-form-urlencoded')
356
- .set('Accept', 'application/json')
357
- .set('Authorization', `Bearer ${this.geJWTToken}`);
358
- return result;
359
- }
360
- authFileUploadHeaders() {
361
- return new HttpHeaders()
362
- .set('Authorization', `Bearer ${this.geJWTToken}`);
363
- }
364
- // for requesting unsecured data using json
365
- jsonHeaders() {
366
- return new HttpHeaders()
367
- .set('Content-Type', 'application/json')
368
- .set('Accept', 'application/json');
369
- }
370
- // for requesting unsecured data using form post
371
- contentHeadersV2() {
372
- return new HttpHeaders()
373
- .set('Content-Type', 'application/x-www-form-urlencoded')
374
- .set('Accept', 'application/json');
375
- }
376
- get geJWTToken() {
377
- let result = this.localStorage.getDataObject(AppKeys.ACCESS_TOKEN);
378
- if (Utilities.IsNil(result))
379
- return '';
380
- return result;
381
- }
382
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: HeadersService, deps: [{ token: LocalStoreManager }], target: i0.ɵɵFactoryTarget.Injectable }); }
383
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: HeadersService }); }
384
- }
385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: HeadersService, decorators: [{
386
- type: Injectable
387
- }], ctorParameters: () => [{ type: LocalStoreManager }] });
388
-
389
- class ServerUrl {
390
- static { this.isProduction = false; }
391
- // POUR TESTER L'ENVIRONNEMENT DE PROD EN LOCAL DECOMMENTER LES LIGNES
392
- // static baseUrl = (ServerUrl.isProduction ? 'http://localhost:56407' : 'http://localhost:56407');
393
- static { this.baseUrl = (ServerUrl.isProduction ? '' : 'http://localhost:56407'); }
394
- static { this.apiUrl = ServerUrl.baseUrl + '/api'; }
395
- static { this.hubUrl = ServerUrl.baseUrl + '/hub'; }
396
- static { this.loginPath = '/Account/Login'; }
397
- static { this.connectPath = '/Account/Connect'; }
398
- static { this.registerPath = '/Account/Register'; }
399
- static { this.activatePath = '/Account/Activate'; }
400
- static { this.refreshPath = '/Account/RefreshToken'; }
401
- static { this.disconnectPath = '/Account/Disconnect'; }
402
- }
403
-
404
- class PermissionService {
405
- constructor(localStorage) {
406
- this.localStorage = localStorage;
407
- }
408
- hasPermission(permission) {
409
- return this.permissions != null && this.permissions.some(p => p === permission) || this.isAdmin;
410
- }
411
- get permissions() {
412
- let permissions = this.localStorage.getDataObject(AppKeys.PERMISSIONS);
413
- let parsed_permissions = JSON.parse(permissions);
414
- return parsed_permissions;
415
- }
416
- get isAdmin() {
417
- let parsed = JSON.parse(this.currentUser);
418
- return parsed && parsed.IsAdmin || false;
419
- }
420
- get currentUser() {
421
- return this.localStorage.getDataObject(AppKeys.CURRENT_USER);
422
- }
423
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: PermissionService, deps: [{ token: LocalStoreManager }], target: i0.ɵɵFactoryTarget.Injectable }); }
424
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: PermissionService }); }
425
- }
426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: PermissionService, decorators: [{
427
- type: Injectable
428
- }], ctorParameters: () => [{ type: LocalStoreManager }] });
429
-
430
- class MenuService {
431
- constructor(permissionService) {
432
- this.permissionService = permissionService;
433
- this.current = new ReplaySubject(1);
434
- this.hasPermission = (permKey) => {
435
- if (permKey === undefined)
436
- return true;
437
- return this.permissionService.hasPermission(permKey);
438
- };
439
- this.hasAnyPermission = (permKeys) => {
440
- let result = false;
441
- permKeys.forEach(p => result = result || this.hasPermission(p));
442
- return result;
443
- };
444
- }
445
- setCurrent(menu) {
446
- this.current.next(menu);
447
- }
448
- getCurrent() {
449
- return this.current;
450
- }
451
- get permissionRouteMap() {
452
- if (Utilities.IsNil(this._permissionRouteMap)) {
453
- this._permissionRouteMap = new DictionnaryWrapper();
454
- this.getAllMenuItems(true).forEach(item => {
455
- if (!Utilities.IsNil(item.sublinks)) {
456
- item.sublinks.forEach(subItem => {
457
- if (subItem.permissionKey) {
458
- this._permissionRouteMap.dictionary[subItem.link] = subItem.permissionKey;
459
- }
460
- });
461
- }
462
- });
463
- }
464
- return this._permissionRouteMap;
465
- }
466
- resetPermissionMap() {
467
- this._permissionRouteMap = undefined;
468
- }
469
- hasAccessToThisRoute(url) {
470
- let menuItems = this.getAccessGrantedMenuItems();
471
- if (!Utilities.IsNil(menuItems) && menuItems.findIndex(f => f.link === url) >= 0)
472
- return true;
473
- if (this.permissionRouteMap.containsKeyOrPartKey(url)) {
474
- return this.hasPermission(this.permissionRouteMap.getPartKey(url));
475
- }
476
- // Le menu n'a pas de permissions associé, on renvoie true
477
- return true;
478
- }
479
- pushItem(items, menuItem, isAdmin) {
480
- if (Utilities.IsNil(menuItem.permissionKey) ||
481
- isAdmin || this.hasPermission(menuItem.permissionKey)) {
482
- items.push(menuItem);
483
- }
484
- }
485
- getMenuItems(isAdmin) {
486
- let results = this.getAllMenuItems(isAdmin);
487
- for (let i = 0; i < results.length; i++)
488
- results[i].id = i;
489
- return this.sortLinks(results);
490
- }
491
- sortLinks(links) {
492
- return links.map(t => { return { ...t, sublinks: this.sortLinksSubLevel(t.sublinks) }; });
493
- }
494
- sortLinksSubLevel(links) {
495
- if (!links)
496
- return null;
497
- return links.sort((a, b) => a.title.localeCompare(b.title));
498
- }
499
- // private fillmap(map: Map<string,MenuItem>,menuItems: MenuItem[], parent: string = null )
500
- // {
501
- // if ( ! Utilities.IsNil(menuItems)) {
502
- // menuItems.forEach(x =>{
503
- // if ( ! Utilities.IsNil(parent))
504
- // parent = parent.concat("/" + x.title);
505
- // else
506
- // parent = x.title;
507
- // map.set(parent,x);
508
- // this.fillmap(map,x.sublinks,parent);
509
- // });
510
- // }
511
- // return map;
512
- // }
513
- // public mergeall(Menus:MenuItem[][]): MenuItem[]
514
- // {
515
- // let menuItem = Array<MenuItem>();
516
- // let map = new Map<string,MenuItem>();
517
- // Menus.forEach(menuItem => {
518
- // this.fillmap(map,menuItem,null);
519
- // });
520
- // let sortedmap = new Map([...map].sort());
521
- // sortedmap.forEach(element => {
522
- // menuItem.push()
523
- // });
524
- // return menuItem;
525
- // }
526
- merge(Menus) {
527
- // let titles : string[];
528
- // if (!(item.title in titles)){
529
- // titles.push(item.title);
530
- // menu.push(item);
531
- // }
532
- // else{
533
- let menu = [];
534
- Menus.forEach(item => {
535
- let index = menu.findIndex(x => x.title == item.title);
536
- if (index >= 0)
537
- menu[index].sublinks = [...menu[index].sublinks, ...item.sublinks];
538
- else
539
- menu.push(item);
540
- });
541
- return menu;
542
- }
543
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: MenuService, deps: [{ token: PermissionService }], target: i0.ɵɵFactoryTarget.Injectable }); }
544
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: MenuService }); }
545
- }
546
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: MenuService, decorators: [{
547
- type: Injectable
548
- }], ctorParameters: () => [{ type: PermissionService }] });
549
-
1
+ import * as i7 from "@dflat-core/web/core";
2
+ import { EnsureModuleLoadedOnceGuard, Utilities } from "@dflat-core/web/core";
3
+ import { ApiErrorTypes, CoreModelModule, DictionnaryWrapper, Notification, User, UserUpdatedMessage } from "@dflat-core/web/core-model";
4
+ import { CommonModule } from "@angular/common";
5
+ import * as i3 from "@angular/common/http";
6
+ import { HttpErrorResponse, HttpHeaders, provideHttpClient, withInterceptorsFromDi, withXhr } from "@angular/common/http";
7
+ import * as i0 from "@angular/core";
8
+ import { EventEmitter, Inject, Injectable, InjectionToken, NgModule, Optional, SkipSelf } from "@angular/core";
9
+ import jwt_decode from "jwt-decode";
10
+ import { BehaviorSubject, ReplaySubject, Subject, empty, throwError, timer } from "rxjs";
11
+ import { catchError, filter, finalize, map } from "rxjs/operators";
12
+ import * as i4 from "@angular/router";
13
+ import * as i1 from "@angular/platform-browser";
14
+ import * as signalR from "@microsoft/signalr";
15
+ var AppConfiguration = class AppConfiguration {
16
+ constructor() {
17
+ this.searchText = "";
18
+ this.isSearchAllowed = false;
19
+ }
20
+ static {
21
+ this.ɵfac = i0.ɵɵngDeclareFactory({
22
+ minVersion: "12.0.0",
23
+ version: "22.2.1",
24
+ ngImport: i0,
25
+ type: AppConfiguration,
26
+ deps: [],
27
+ target: i0.ɵɵFactoryTarget.Injectable
28
+ });
29
+ }
30
+ static {
31
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
32
+ minVersion: "12.0.0",
33
+ version: "22.2.1",
34
+ ngImport: i0,
35
+ type: AppConfiguration
36
+ });
37
+ }
38
+ };
39
+ i0.ɵɵngDeclareClassMetadata({
40
+ minVersion: "12.0.0",
41
+ version: "22.2.1",
42
+ ngImport: i0,
43
+ type: AppConfiguration,
44
+ decorators: [{ type: Injectable }],
45
+ ctorParameters: () => []
46
+ });
47
+ var AppKeys = class AppKeys {
48
+ static {
49
+ this.CURRENT_USER = "current_user";
50
+ }
51
+ static {
52
+ this.ACCESS_TOKEN = "access_token";
53
+ }
54
+ static {
55
+ this.REFRESH_TOKEN = "refresh_token";
56
+ }
57
+ static {
58
+ this.TOKEN_EXPIRES_IN = "expires_in";
59
+ }
60
+ static {
61
+ this.REMEMBER_ME = "remember_me";
62
+ }
63
+ static {
64
+ this.PERMISSIONS = "permissions";
65
+ }
66
+ static {
67
+ this.LAST_GEOLOCATIONS = "geolocations";
68
+ }
69
+ static {
70
+ this.REFERENCE_SUPPLIER_ID = "refsuppid";
71
+ }
72
+ static {
73
+ this.USER_COMPANY_ID = "companyid";
74
+ }
75
+ static {
76
+ this.SELECTED_COMPANY = "selectedcompany";
77
+ }
78
+ static {
79
+ this.ɵfac = i0.ɵɵngDeclareFactory({
80
+ minVersion: "12.0.0",
81
+ version: "22.2.1",
82
+ ngImport: i0,
83
+ type: AppKeys,
84
+ deps: [],
85
+ target: i0.ɵɵFactoryTarget.Injectable
86
+ });
87
+ }
88
+ static {
89
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
90
+ minVersion: "12.0.0",
91
+ version: "22.2.1",
92
+ ngImport: i0,
93
+ type: AppKeys
94
+ });
95
+ }
96
+ };
97
+ i0.ɵɵngDeclareClassMetadata({
98
+ minVersion: "12.0.0",
99
+ version: "22.2.1",
100
+ ngImport: i0,
101
+ type: AppKeys,
102
+ decorators: [{ type: Injectable }]
103
+ });
104
+ var ServerUrl = class ServerUrl {
105
+ static {
106
+ this.isProduction = false;
107
+ }
108
+ static {
109
+ this.baseUrl = ServerUrl.isProduction ? "" : "http://localhost:56407";
110
+ }
111
+ static {
112
+ this.apiUrl = ServerUrl.baseUrl + "/api";
113
+ }
114
+ static {
115
+ this.hubUrl = ServerUrl.baseUrl + "/hub";
116
+ }
117
+ static {
118
+ this.loginPath = "/Account/Login";
119
+ }
120
+ static {
121
+ this.connectPath = "/Account/Connect";
122
+ }
123
+ static {
124
+ this.registerPath = "/Account/Register";
125
+ }
126
+ static {
127
+ this.activatePath = "/Account/Activate";
128
+ }
129
+ static {
130
+ this.refreshPath = "/Account/RefreshToken";
131
+ }
132
+ static {
133
+ this.disconnectPath = "/Account/Disconnect";
134
+ }
135
+ };
136
+ var LocalStoreManager = class LocalStoreManager {
137
+ constructor() {
138
+ this.syncKeys = [];
139
+ this.initEvent = new Subject();
140
+ this.reservedKeys = [
141
+ "sync_keys",
142
+ "addToSyncKeys",
143
+ "removeFromSyncKeys",
144
+ "getSessionStorage",
145
+ "setSessionStorage",
146
+ "addToSessionStorage",
147
+ "removeFromSessionStorage",
148
+ "clearAllSessionsStorage"
149
+ ];
150
+ this.sessionStorageTransferHandler = (event) => {
151
+ if (!event.newValue) return;
152
+ if (event.key == "getSessionStorage") {
153
+ if (sessionStorage.length) {
154
+ this.localStorageSetItem("setSessionStorage", sessionStorage);
155
+ localStorage.removeItem("setSessionStorage");
156
+ }
157
+ } else if (event.key == "setSessionStorage") {
158
+ if (!this.syncKeys.length) this.loadSyncKeys();
159
+ let data = JSON.parse(event.newValue);
160
+ for (let key in data) if (this.syncKeysContains(key)) this.sessionStorageSetItem(key, JSON.parse(data[key]));
161
+ this.onInit();
162
+ } else if (event.key === "addToSessionStorage") {
163
+ let data = JSON.parse(event.newValue);
164
+ this.addToSessionStorageHelper(data["data"], data["key"]);
165
+ } else if (event.key === "removeFromSessionStorage") this.removeFromSessionStorageHelper(event.newValue);
166
+ else if (event.key === "clearAllSessionsStorage" && sessionStorage.length) this.clearInstanceSessionStorage();
167
+ else if (event.key === "addToSyncKeys") this.addToSyncKeysHelper(event.newValue);
168
+ else if (event.key === "removeFromSyncKeys") this.removeFromSyncKeysHelper(event.newValue);
169
+ };
170
+ }
171
+ static {
172
+ this.syncListenerInitialised = false;
173
+ }
174
+ static {
175
+ this.DBKEY_USER_DATA = "user_data";
176
+ }
177
+ static {
178
+ this.DBKEY_SYNC_KEYS = "sync_keys";
179
+ }
180
+ initialiseStorageSyncListener() {
181
+ if (LocalStoreManager.syncListenerInitialised == true) return;
182
+ LocalStoreManager.syncListenerInitialised = true;
183
+ window.addEventListener("storage", this.sessionStorageTransferHandler, false);
184
+ this.syncSessionStorage();
185
+ }
186
+ deinitialiseStorageSyncListener() {
187
+ window.removeEventListener("storage", this.sessionStorageTransferHandler, false);
188
+ LocalStoreManager.syncListenerInitialised = false;
189
+ }
190
+ syncSessionStorage() {
191
+ localStorage.setItem("getSessionStorage", "_dummy");
192
+ localStorage.removeItem("getSessionStorage");
193
+ }
194
+ clearAllStorage() {
195
+ this.clearAllSessionsStorage();
196
+ this.clearLocalStorage();
197
+ }
198
+ clearAllSessionsStorage() {
199
+ this.clearInstanceSessionStorage();
200
+ localStorage.removeItem(LocalStoreManager.DBKEY_SYNC_KEYS);
201
+ localStorage.setItem("clearAllSessionsStorage", "_dummy");
202
+ localStorage.removeItem("clearAllSessionsStorage");
203
+ }
204
+ clearInstanceSessionStorage() {
205
+ sessionStorage.clear();
206
+ this.syncKeys = [];
207
+ }
208
+ clearLocalStorage() {
209
+ localStorage.clear();
210
+ }
211
+ addToSessionStorage(data, key) {
212
+ this.addToSessionStorageHelper(data, key);
213
+ this.addToSyncKeysBackup(key);
214
+ this.localStorageSetItem("addToSessionStorage", {
215
+ key,
216
+ data
217
+ });
218
+ localStorage.removeItem("addToSessionStorage");
219
+ }
220
+ addToSessionStorageHelper(data, key) {
221
+ this.addToSyncKeysHelper(key);
222
+ this.sessionStorageSetItem(key, data);
223
+ }
224
+ removeFromSessionStorage(keyToRemove) {
225
+ this.removeFromSessionStorageHelper(keyToRemove);
226
+ this.removeFromSyncKeysBackup(keyToRemove);
227
+ localStorage.setItem("removeFromSessionStorage", keyToRemove);
228
+ localStorage.removeItem("removeFromSessionStorage");
229
+ }
230
+ removeFromSessionStorageHelper(keyToRemove) {
231
+ sessionStorage.removeItem(keyToRemove);
232
+ this.removeFromSyncKeysHelper(keyToRemove);
233
+ }
234
+ testForInvalidKeys(key) {
235
+ if (!key) throw new Error("key cannot be empty");
236
+ if (this.reservedKeys.some((x) => x === key)) throw new Error(`The storage key "${key}" is reserved and cannot be used. Please use a different key`);
237
+ }
238
+ syncKeysContains(key) {
239
+ return this.syncKeys.some((x) => x === key);
240
+ }
241
+ loadSyncKeys() {
242
+ if (this.syncKeys.length) return;
243
+ this.syncKeys = this.getSyncKeysFromStorage();
244
+ }
245
+ getSyncKeysFromStorage(defaultValue = []) {
246
+ let data = this.localStorageGetItem(LocalStoreManager.DBKEY_SYNC_KEYS);
247
+ if (data == null) return defaultValue;
248
+ else return data;
249
+ }
250
+ addToSyncKeys(key) {
251
+ this.addToSyncKeysHelper(key);
252
+ this.addToSyncKeysBackup(key);
253
+ localStorage.setItem("addToSyncKeys", key);
254
+ localStorage.removeItem("addToSyncKeys");
255
+ }
256
+ addToSyncKeysBackup(key) {
257
+ let storedSyncKeys = this.getSyncKeysFromStorage();
258
+ if (!storedSyncKeys.some((x) => x === key)) {
259
+ storedSyncKeys.push(key);
260
+ this.localStorageSetItem(LocalStoreManager.DBKEY_SYNC_KEYS, storedSyncKeys);
261
+ }
262
+ }
263
+ removeFromSyncKeysBackup(key) {
264
+ let storedSyncKeys = this.getSyncKeysFromStorage();
265
+ let index = storedSyncKeys.indexOf(key);
266
+ if (index > -1) {
267
+ storedSyncKeys.splice(index, 1);
268
+ this.localStorageSetItem(LocalStoreManager.DBKEY_SYNC_KEYS, storedSyncKeys);
269
+ }
270
+ }
271
+ addToSyncKeysHelper(key) {
272
+ if (!this.syncKeysContains(key)) this.syncKeys.push(key);
273
+ }
274
+ removeFromSyncKeys(key) {
275
+ this.removeFromSyncKeysHelper(key);
276
+ this.removeFromSyncKeysBackup(key);
277
+ localStorage.setItem("removeFromSyncKeys", key);
278
+ localStorage.removeItem("removeFromSyncKeys");
279
+ }
280
+ removeFromSyncKeysHelper(key) {
281
+ let index = this.syncKeys.indexOf(key);
282
+ if (index > -1) this.syncKeys.splice(index, 1);
283
+ }
284
+ saveSessionData(data, key = LocalStoreManager.DBKEY_USER_DATA) {
285
+ this.testForInvalidKeys(key);
286
+ this.removeFromSyncKeys(key);
287
+ localStorage.removeItem(key);
288
+ this.sessionStorageSetItem(key, data);
289
+ }
290
+ saveSyncedSessionData(data, key = LocalStoreManager.DBKEY_USER_DATA) {
291
+ this.testForInvalidKeys(key);
292
+ localStorage.removeItem(key);
293
+ this.addToSessionStorage(data, key);
294
+ }
295
+ savePermanentData(data, key = LocalStoreManager.DBKEY_USER_DATA) {
296
+ this.testForInvalidKeys(key);
297
+ this.removeFromSessionStorage(key);
298
+ this.localStorageSetItem(key, data);
299
+ }
300
+ moveDataToSessionStorage(key = LocalStoreManager.DBKEY_USER_DATA) {
301
+ this.testForInvalidKeys(key);
302
+ let data = this.getData(key);
303
+ if (data == null) return;
304
+ this.saveSessionData(data, key);
305
+ }
306
+ moveDataToSyncedSessionStorage(key = LocalStoreManager.DBKEY_USER_DATA) {
307
+ this.testForInvalidKeys(key);
308
+ let data = this.getData(key);
309
+ if (data == null) return;
310
+ this.saveSyncedSessionData(data, key);
311
+ }
312
+ moveDataToPermanentStorage(key = LocalStoreManager.DBKEY_USER_DATA) {
313
+ this.testForInvalidKeys(key);
314
+ let data = this.getData(key);
315
+ if (data == null) return;
316
+ this.savePermanentData(data, key);
317
+ }
318
+ exists(key = LocalStoreManager.DBKEY_USER_DATA) {
319
+ let data = sessionStorage.getItem(key);
320
+ if (data == null) data = localStorage.getItem(key);
321
+ return data != null;
322
+ }
323
+ getData(key = LocalStoreManager.DBKEY_USER_DATA) {
324
+ this.testForInvalidKeys(key);
325
+ let data = this.sessionStorageGetItem(key);
326
+ if (data == null) data = this.localStorageGetItem(key);
327
+ return data;
328
+ }
329
+ getDataObject(key = LocalStoreManager.DBKEY_USER_DATA, isDateType = false) {
330
+ let data = this.getData(key);
331
+ if (data != null) {
332
+ if (isDateType) data = new Date(data);
333
+ return data;
334
+ } else return null;
335
+ }
336
+ deleteData(key = LocalStoreManager.DBKEY_USER_DATA) {
337
+ this.testForInvalidKeys(key);
338
+ this.removeFromSessionStorage(key);
339
+ localStorage.removeItem(key);
340
+ }
341
+ localStorageSetItem(key, data) {
342
+ localStorage.setItem(key, JSON.stringify(data));
343
+ }
344
+ sessionStorageSetItem(key, data) {
345
+ sessionStorage.setItem(key, JSON.stringify(data));
346
+ }
347
+ localStorageGetItem(key) {
348
+ return Utilities.JSonTryParse(localStorage.getItem(key));
349
+ }
350
+ sessionStorageGetItem(key) {
351
+ return Utilities.JSonTryParse(sessionStorage.getItem(key));
352
+ }
353
+ onInit() {
354
+ setTimeout(() => {
355
+ this.initEvent.next({});
356
+ this.initEvent.complete();
357
+ });
358
+ }
359
+ getInitEvent() {
360
+ return this.initEvent.asObservable();
361
+ }
362
+ static {
363
+ this.ɵfac = i0.ɵɵngDeclareFactory({
364
+ minVersion: "12.0.0",
365
+ version: "22.2.1",
366
+ ngImport: i0,
367
+ type: LocalStoreManager,
368
+ deps: [],
369
+ target: i0.ɵɵFactoryTarget.Injectable
370
+ });
371
+ }
372
+ static {
373
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
374
+ minVersion: "12.0.0",
375
+ version: "22.2.1",
376
+ ngImport: i0,
377
+ type: LocalStoreManager
378
+ });
379
+ }
380
+ };
381
+ i0.ɵɵngDeclareClassMetadata({
382
+ minVersion: "12.0.0",
383
+ version: "22.2.1",
384
+ ngImport: i0,
385
+ type: LocalStoreManager,
386
+ decorators: [{ type: Injectable }]
387
+ });
388
+ var HeadersService = class HeadersService {
389
+ constructor(localStorage) {
390
+ this.localStorage = localStorage;
391
+ }
392
+ authJsonHeaders() {
393
+ return new HttpHeaders().set("Content-Type", "application/json").set("Accept", "application/json").set("Authorization", `Bearer ${this.geJWTToken}`);
394
+ }
395
+ authFormHeaders() {
396
+ return new HttpHeaders().set("Content-Type", "application/x-www-form-urlencoded").set("Accept", "application/json").set("Authorization", `Bearer ${this.geJWTToken}`);
397
+ }
398
+ authFileUploadHeaders() {
399
+ return new HttpHeaders().set("Authorization", `Bearer ${this.geJWTToken}`);
400
+ }
401
+ jsonHeaders() {
402
+ return new HttpHeaders().set("Content-Type", "application/json").set("Accept", "application/json");
403
+ }
404
+ contentHeadersV2() {
405
+ return new HttpHeaders().set("Content-Type", "application/x-www-form-urlencoded").set("Accept", "application/json");
406
+ }
407
+ get geJWTToken() {
408
+ let result = this.localStorage.getDataObject(AppKeys.ACCESS_TOKEN);
409
+ if (Utilities.IsNil(result)) return "";
410
+ return result;
411
+ }
412
+ static {
413
+ this.ɵfac = i0.ɵɵngDeclareFactory({
414
+ minVersion: "12.0.0",
415
+ version: "22.2.1",
416
+ ngImport: i0,
417
+ type: HeadersService,
418
+ deps: [{ token: LocalStoreManager }],
419
+ target: i0.ɵɵFactoryTarget.Injectable
420
+ });
421
+ }
422
+ static {
423
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
424
+ minVersion: "12.0.0",
425
+ version: "22.2.1",
426
+ ngImport: i0,
427
+ type: HeadersService
428
+ });
429
+ }
430
+ };
431
+ i0.ɵɵngDeclareClassMetadata({
432
+ minVersion: "12.0.0",
433
+ version: "22.2.1",
434
+ ngImport: i0,
435
+ type: HeadersService,
436
+ decorators: [{ type: Injectable }],
437
+ ctorParameters: () => [{ type: LocalStoreManager }]
438
+ });
439
+ var BusMessageService = class BusMessageService {
440
+ constructor() {
441
+ this.message$ = new Subject();
442
+ }
443
+ publish(message) {
444
+ const channel = message.constructor.name;
445
+ this.message$.next({
446
+ Channel: channel,
447
+ Data: message
448
+ });
449
+ }
450
+ of(messageType) {
451
+ const channel = messageType.name;
452
+ return this.message$.pipe(filter((m) => m.Channel === channel), map((m) => m.Data));
453
+ }
454
+ static {
455
+ this.ɵfac = i0.ɵɵngDeclareFactory({
456
+ minVersion: "12.0.0",
457
+ version: "22.2.1",
458
+ ngImport: i0,
459
+ type: BusMessageService,
460
+ deps: [],
461
+ target: i0.ɵɵFactoryTarget.Injectable
462
+ });
463
+ }
464
+ static {
465
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
466
+ minVersion: "12.0.0",
467
+ version: "22.2.1",
468
+ ngImport: i0,
469
+ type: BusMessageService
470
+ });
471
+ }
472
+ };
473
+ i0.ɵɵngDeclareClassMetadata({
474
+ minVersion: "12.0.0",
475
+ version: "22.2.1",
476
+ ngImport: i0,
477
+ type: BusMessageService,
478
+ decorators: [{ type: Injectable }],
479
+ ctorParameters: () => []
480
+ });
481
+ var NotificationMqService = class NotificationMqService {
482
+ constructor() {
483
+ this.message$ = new Subject();
484
+ }
485
+ publish(message) {
486
+ const defaultchannel = message.entityType;
487
+ this.message$.next({
488
+ Channel: defaultchannel,
489
+ Data: message
490
+ });
491
+ if (!Utilities.IsUndefined(message.entityId)) {
492
+ const detailchannel = `${message.entityType}-${message.entityId}`;
493
+ this.message$.next({
494
+ Channel: detailchannel,
495
+ Data: message
496
+ });
497
+ }
498
+ }
499
+ of(channelKey) {
500
+ const channel = channelKey;
501
+ return this.message$.pipe(filter((m) => m.Channel === channel), map((m) => m.Data));
502
+ }
503
+ static {
504
+ this.ɵfac = i0.ɵɵngDeclareFactory({
505
+ minVersion: "12.0.0",
506
+ version: "22.2.1",
507
+ ngImport: i0,
508
+ type: NotificationMqService,
509
+ deps: [],
510
+ target: i0.ɵɵFactoryTarget.Injectable
511
+ });
512
+ }
513
+ static {
514
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
515
+ minVersion: "12.0.0",
516
+ version: "22.2.1",
517
+ ngImport: i0,
518
+ type: NotificationMqService
519
+ });
520
+ }
521
+ };
522
+ i0.ɵɵngDeclareClassMetadata({
523
+ minVersion: "12.0.0",
524
+ version: "22.2.1",
525
+ ngImport: i0,
526
+ type: NotificationMqService,
527
+ decorators: [{ type: Injectable }],
528
+ ctorParameters: () => []
529
+ });
530
+ var PermissionService = class PermissionService {
531
+ constructor(localStorage) {
532
+ this.localStorage = localStorage;
533
+ }
534
+ hasPermission(permission) {
535
+ return this.permissions != null && this.permissions.some((p) => p === permission) || this.isAdmin;
536
+ }
537
+ get permissions() {
538
+ let permissions = this.localStorage.getDataObject(AppKeys.PERMISSIONS);
539
+ return JSON.parse(permissions);
540
+ }
541
+ get isAdmin() {
542
+ let parsed = JSON.parse(this.currentUser);
543
+ return parsed && parsed.IsAdmin || false;
544
+ }
545
+ get currentUser() {
546
+ return this.localStorage.getDataObject(AppKeys.CURRENT_USER);
547
+ }
548
+ static {
549
+ this.ɵfac = i0.ɵɵngDeclareFactory({
550
+ minVersion: "12.0.0",
551
+ version: "22.2.1",
552
+ ngImport: i0,
553
+ type: PermissionService,
554
+ deps: [{ token: LocalStoreManager }],
555
+ target: i0.ɵɵFactoryTarget.Injectable
556
+ });
557
+ }
558
+ static {
559
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
560
+ minVersion: "12.0.0",
561
+ version: "22.2.1",
562
+ ngImport: i0,
563
+ type: PermissionService
564
+ });
565
+ }
566
+ };
567
+ i0.ɵɵngDeclareClassMetadata({
568
+ minVersion: "12.0.0",
569
+ version: "22.2.1",
570
+ ngImport: i0,
571
+ type: PermissionService,
572
+ decorators: [{ type: Injectable }],
573
+ ctorParameters: () => [{ type: LocalStoreManager }]
574
+ });
575
+ var MenuService = class MenuService {
576
+ constructor(permissionService) {
577
+ this.permissionService = permissionService;
578
+ this.current = new ReplaySubject(1);
579
+ this.hasPermission = (permKey) => {
580
+ if (permKey === void 0) return true;
581
+ return this.permissionService.hasPermission(permKey);
582
+ };
583
+ this.hasAnyPermission = (permKeys) => {
584
+ let result = false;
585
+ permKeys.forEach((p) => result = result || this.hasPermission(p));
586
+ return result;
587
+ };
588
+ }
589
+ setCurrent(menu) {
590
+ this.current.next(menu);
591
+ }
592
+ getCurrent() {
593
+ return this.current;
594
+ }
595
+ get permissionRouteMap() {
596
+ if (Utilities.IsNil(this._permissionRouteMap)) {
597
+ this._permissionRouteMap = new DictionnaryWrapper();
598
+ this.getAllMenuItems(true).forEach((item) => {
599
+ if (!Utilities.IsNil(item.sublinks)) item.sublinks.forEach((subItem) => {
600
+ if (subItem.permissionKey) this._permissionRouteMap.dictionary[subItem.link] = subItem.permissionKey;
601
+ });
602
+ });
603
+ }
604
+ return this._permissionRouteMap;
605
+ }
606
+ resetPermissionMap() {
607
+ this._permissionRouteMap = void 0;
608
+ }
609
+ hasAccessToThisRoute(url) {
610
+ let menuItems = this.getAccessGrantedMenuItems();
611
+ if (!Utilities.IsNil(menuItems) && menuItems.findIndex((f) => f.link === url) >= 0) return true;
612
+ if (this.permissionRouteMap.containsKeyOrPartKey(url)) return this.hasPermission(this.permissionRouteMap.getPartKey(url));
613
+ return true;
614
+ }
615
+ pushItem(items, menuItem, isAdmin) {
616
+ if (Utilities.IsNil(menuItem.permissionKey) || isAdmin || this.hasPermission(menuItem.permissionKey)) items.push(menuItem);
617
+ }
618
+ getMenuItems(isAdmin) {
619
+ let results = this.getAllMenuItems(isAdmin);
620
+ for (let i = 0; i < results.length; i++) results[i].id = i;
621
+ return this.sortLinks(results);
622
+ }
623
+ sortLinks(links) {
624
+ return links.map((t) => {
625
+ return {
626
+ ...t,
627
+ sublinks: this.sortLinksSubLevel(t.sublinks)
628
+ };
629
+ });
630
+ }
631
+ sortLinksSubLevel(links) {
632
+ if (!links) return null;
633
+ return links.sort((a, b) => a.title.localeCompare(b.title));
634
+ }
635
+ merge(Menus) {
636
+ let menu = [];
637
+ Menus.forEach((item) => {
638
+ let index = menu.findIndex((x) => x.title == item.title);
639
+ if (index >= 0) menu[index].sublinks = [...menu[index].sublinks, ...item.sublinks];
640
+ else menu.push(item);
641
+ });
642
+ return menu;
643
+ }
644
+ static {
645
+ this.ɵfac = i0.ɵɵngDeclareFactory({
646
+ minVersion: "12.0.0",
647
+ version: "22.2.1",
648
+ ngImport: i0,
649
+ type: MenuService,
650
+ deps: [{ token: PermissionService }],
651
+ target: i0.ɵɵFactoryTarget.Injectable
652
+ });
653
+ }
654
+ static {
655
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
656
+ minVersion: "12.0.0",
657
+ version: "22.2.1",
658
+ ngImport: i0,
659
+ type: MenuService
660
+ });
661
+ }
662
+ };
663
+ i0.ɵɵngDeclareClassMetadata({
664
+ minVersion: "12.0.0",
665
+ version: "22.2.1",
666
+ ngImport: i0,
667
+ type: MenuService,
668
+ decorators: [{ type: Injectable }],
669
+ ctorParameters: () => [{ type: PermissionService }]
670
+ });
550
671
  var AuthTokenType;
551
- (function (AuthTokenType) {
552
- AuthTokenType[AuthTokenType["AccessToken"] = 0] = "AccessToken";
553
- AuthTokenType[AuthTokenType["RefreshToken"] = 1] = "RefreshToken";
672
+ (function(AuthTokenType) {
673
+ AuthTokenType[AuthTokenType["AccessToken"] = 0] = "AccessToken";
674
+ AuthTokenType[AuthTokenType["RefreshToken"] = 1] = "RefreshToken";
554
675
  })(AuthTokenType || (AuthTokenType = {}));
555
- class AuthService {
556
- constructor(headersService, busMsg, httpClient, router, localStorage, menuService, env) {
557
- this.headersService = headersService;
558
- this.busMsg = busMsg;
559
- this.httpClient = httpClient;
560
- this.router = router;
561
- this.localStorage = localStorage;
562
- this.menuService = menuService;
563
- this.env = env;
564
- this.baseUrl = this.env.apiUrl;
565
- this.refreshTokenTimerCheckId = "is_refreshToken_timer_started";
566
- this.scheduleRefreshToken(this.isLoggedIn, false);
567
- }
568
- // After a successful login, save token data into session storage
569
- // note: use "localStorage" for persistent, browser-wide logins; "sessionStorage" for per-session storage.
570
- login(username, password, rememberMe) {
571
- // console.log(`login base url : ${this.baseUrl} (environment is production : ${this.env.production})`);
572
- let body = JSON.stringify({ "username": username, "password": password });
573
- let _url = this.baseUrl + ServerUrl.connectPath;
574
- return this.httpClient.post(_url, body, { headers: this.headersService.authJsonHeaders() }).pipe(map((resp) => {
575
- // login successful if there's a jwt token in the response
576
- // let user = (resp as any) as IUserCredential;
577
- let user = resp;
578
- if (user && user.AccessToken) {
579
- // store user details and jwt token in local storage to keep user logged in between page refreshes
580
- this.saveUserInfos(user, JSON.stringify(user), rememberMe);
581
- // publish token
582
- this.busMsg.publish(new UserUpdatedMessage(user.AccessToken));
583
- // schedule refresh token
584
- this.scheduleRefreshToken(true, true);
585
- return user;
586
- }
587
- }));
588
- }
589
- // After a successful login, save token data into session storage
590
- // note: use "localStorage" for persistent, browser-wide logins; "sessionStorage" for per-session storage.
591
- register(captchaToken, firstName, lastName, email, password, rememberMe) {
592
- // console.log(`login base url : ${this.baseUrl} (environment is production : ${this.env.production})`);
593
- let body = JSON.stringify({ "CaptchaToken": captchaToken, "FirstName": firstName, "LastName": lastName, "Email": email, "Password": password });
594
- let _url = this.baseUrl + ServerUrl.registerPath;
595
- return this.httpClient.post(_url, body, { headers: this.headersService.authJsonHeaders() }).pipe(map((resp) => {
596
- // login successful if there's a jwt token in the response
597
- let user = resp;
598
- if (user && user.AccessToken) {
599
- // store user details and jwt token in local storage to keep user logged in between page refreshes
600
- this.saveUserInfos(user, JSON.stringify(user), rememberMe);
601
- // publish token
602
- this.busMsg.publish(new UserUpdatedMessage(user.AccessToken));
603
- // schedule refresh token
604
- this.scheduleRefreshToken(true, true);
605
- return user;
606
- }
607
- }));
608
- }
609
- // Activation d'un utilisateur
610
- activate(code) {
611
- // console.log(`login base url : ${this.baseUrl} (environment is production : ${this.env.production})`);
612
- let body = JSON.stringify({ "ActivationCode": code });
613
- let _url = this.baseUrl + ServerUrl.activatePath;
614
- return this.httpClient.post(_url, body, { headers: this.headersService.authJsonHeaders() }).pipe(map((resp) => {
615
- return resp;
616
- }));
617
- }
618
- saveUserInfos(user, userDetails, rememberMe) {
619
- // check permissions
620
- let permissions = user.Permissions || new Array();
621
- // this.getPermissions(user.AccessToken) || new Array<any>();
622
- if (rememberMe) {
623
- this.localStorage.savePermanentData(user.AccessToken, AppKeys.ACCESS_TOKEN);
624
- this.localStorage.savePermanentData(user.RefreshToken, AppKeys.REFRESH_TOKEN);
625
- this.localStorage.savePermanentData(userDetails, AppKeys.CURRENT_USER);
626
- this.localStorage.savePermanentData(JSON.stringify(permissions), AppKeys.PERMISSIONS);
627
- }
628
- else {
629
- this.localStorage.saveSyncedSessionData(user.AccessToken, AppKeys.ACCESS_TOKEN);
630
- this.localStorage.saveSyncedSessionData(user.RefreshToken, AppKeys.REFRESH_TOKEN);
631
- this.localStorage.saveSyncedSessionData(userDetails, AppKeys.CURRENT_USER);
632
- this.localStorage.saveSyncedSessionData(JSON.stringify(permissions), AppKeys.PERMISSIONS);
633
- }
634
- if (rememberMe) {
635
- this.localStorage.savePermanentData(rememberMe, AppKeys.REMEMBER_ME);
636
- }
637
- }
638
- getPermissions(token) {
639
- let decodedToken = jwt_decode(token);
640
- let permissions = new Array();
641
- if (decodedToken.permissions) {
642
- permissions = Array.isArray(decodedToken.permissions) ? decodedToken.permissions : [decodedToken.permissions];
643
- }
644
- return permissions;
645
- }
646
- removeUserInfos() {
647
- this.localStorage.deleteData(AppKeys.ACCESS_TOKEN);
648
- this.localStorage.deleteData(AppKeys.REFRESH_TOKEN);
649
- this.localStorage.deleteData(AppKeys.CURRENT_USER);
650
- this.loginRedirectUrl = '/';
651
- }
652
- // called when logging out user; clears tokens from browser
653
- logout(pseudo) {
654
- this.disconnect(pseudo);
655
- }
656
- disconnect(pseudo) {
657
- const headers = new HttpHeaders({ "Content-Type": "application/json" });
658
- const model = { refreshToken: this.refreshToken };
659
- return this.httpClient
660
- .post(`${this.baseUrl}${ServerUrl.disconnectPath}`, model, { headers: headers })
661
- .pipe(map(response => response || {}), finalize(() => {
662
- this.ensureLogout();
663
- // navigate to home page
664
- this.router.navigate(['/']);
665
- })).subscribe(result => {
666
- console.log("logout", result);
667
- });
668
- }
669
- ensureLogout() {
670
- this.menuService.resetPermissionMap();
671
- this.busMsg.publish(new UserUpdatedMessage(null));
672
- this.removeUserInfos();
673
- this.unscheduleRefreshToken(true);
674
- }
675
- redirectLoginUser() {
676
- let redirect = this.loginRedirectUrl && this.loginRedirectUrl !== '/' ? this.loginRedirectUrl : '/';
677
- this.loginRedirectUrl = null;
678
- let urlParamsAndFragment = Utilities.splitInTwo(redirect, '#');
679
- let urlAndParams = Utilities.splitInTwo(urlParamsAndFragment.firstPart, '?');
680
- let navigationExtras = {
681
- fragment: urlParamsAndFragment.secondPart,
682
- queryParams: Utilities.getQueryParamsFromString(urlAndParams.secondPart),
683
- queryParamsHandling: "merge"
684
- };
685
- this.router.navigate([urlAndParams.firstPart], navigationExtras);
686
- }
687
- invalidateCurrentTabId() {
688
- if (!this.rememberMe) {
689
- return;
690
- }
691
- const currentTabId = this.getCurrentTabId();
692
- if (this.timerStat && this.timerStat.tabId === currentTabId) {
693
- this.setRefreshTokenTimerStopped();
694
- }
695
- }
696
- scheduleRefreshToken(isAuthUserLoggedIn, calledFromLogin) {
697
- this.unscheduleRefreshToken(false);
698
- if (!this.isLoggedIn) {
699
- return;
700
- }
701
- const expDateUtc = this.getAccessTokenExpirationDateUtc();
702
- if (!expDateUtc) {
703
- throw new Error("This access token has not the `exp` property.");
704
- }
705
- const expiresAtUtc = expDateUtc.valueOf();
706
- const nowUtc = new Date().valueOf();
707
- // 3s pour empêcher les timers des autres onglets de tourner moins de 3s
708
- const initialDelay = Math.max(1, expiresAtUtc - nowUtc - 3000);
709
- const timerSource$ = timer(initialDelay);
710
- this.refreshTokenSubscription = timerSource$.subscribe(() => {
711
- if (calledFromLogin || !this.isRefreshTokenTimerStartedInAnotherTab()) {
712
- this.updateToken();
713
- }
714
- else {
715
- this.scheduleRefreshToken(isAuthUserLoggedIn, false);
716
- }
717
- });
718
- if (calledFromLogin || !this.isRefreshTokenTimerStartedInAnotherTab()) {
719
- this.setRefreshTokenTimerStarted();
720
- }
721
- }
722
- setRefreshTokenTimerStopped() {
723
- this.localStorage.savePermanentData(JSON.stringify({
724
- isStarted: false,
725
- tabId: -1
726
- }), this.refreshTokenTimerCheckId);
727
- }
728
- setRefreshTokenTimerStarted() {
729
- this.localStorage.savePermanentData(JSON.stringify({
730
- isStarted: true,
731
- tabId: this.getCurrentTabId()
732
- }), this.refreshTokenTimerCheckId);
733
- }
734
- deleteRefreshTokenTimerCheckId() {
735
- this.localStorage.deleteData(this.refreshTokenTimerCheckId);
736
- }
737
- isRefreshTokenTimerStartedInAnotherTab() {
738
- if (!this.rememberMe) {
739
- return false; // Chaque onglet gère son token (infos stockés dans le local storage)
740
- }
741
- const currentTabId = this.getCurrentTabId();
742
- // console.log("RefreshTokenTimer Check", {
743
- // refreshTokenTimerCheckId: this.timerStat,
744
- // currentTabId: currentTabId
745
- // });
746
- const isStarted = this.timerStat && this.timerStat.isStarted === true && this.timerStat.tabId !== currentTabId;
747
- // if (isStarted) {
748
- // console.log(`RefreshToken timer has already been started in another tab with tabId=${this.timerStat.tabId}.
749
- // currentTabId=${currentTabId}.`);
750
- // }
751
- return isStarted;
752
- }
753
- getCurrentTabId() {
754
- const tabIdToken = "currentTabId";
755
- let tabId = this.localStorage.getData(tabIdToken);
756
- if (tabId) {
757
- return tabId;
758
- }
759
- tabId = Math.random();
760
- this.localStorage.saveSyncedSessionData(tabId, tabIdToken);
761
- return tabId;
762
- }
763
- getAccessTokenExpirationDateUtc() {
764
- const decoded = this.getDecodedAccessToken();
765
- if (decoded.exp === undefined) {
766
- return null;
767
- }
768
- const date = new Date(0);
769
- date.setUTCSeconds(decoded.exp);
770
- // console.log(`Token Expires at ${date}`);
771
- return date;
772
- }
773
- isAccessTokenTokenExpired() {
774
- const expirationDateUtc = this.getAccessTokenExpirationDateUtc();
775
- if (!expirationDateUtc) {
776
- return true;
777
- }
778
- return !(expirationDateUtc.valueOf() > new Date().valueOf());
779
- }
780
- getDecodedAccessToken() {
781
- return jwt_decode(this.token);
782
- }
783
- isEmptyString(value) {
784
- return !value || 0 === value.length;
785
- }
786
- unscheduleRefreshToken(cancelTimerCheckToken) {
787
- if (this.refreshTokenSubscription) {
788
- this.refreshTokenSubscription.unsubscribe();
789
- }
790
- if (cancelTimerCheckToken) {
791
- this.deleteRefreshTokenTimerCheckId();
792
- }
793
- }
794
- updateToken() {
795
- console.log(`Entering updateToken()`);
796
- const headers = new HttpHeaders({ "Content-Type": "application/json" });
797
- const model = { refreshToken: this.refreshToken };
798
- return this.httpClient
799
- .post(`${this.baseUrl}${ServerUrl.refreshPath}`, model, { headers: headers })
800
- .pipe(map(response => response || {}), catchError((error) => throwError(() => new Error(error.error))))
801
- .subscribe(resp => {
802
- // login successful if there's a jwt token in the response
803
- let user = resp;
804
- if (user && user.AccessToken) {
805
- // store user details and jwt token in local storage to keep user logged in between page refreshes
806
- this.saveUserInfos(user, JSON.stringify(user), this.rememberMe);
807
- // publish token
808
- this.busMsg.publish(new UserUpdatedMessage(user.AccessToken));
809
- this.scheduleRefreshToken(this.isLoggedIn, false);
810
- return user;
811
- }
812
- });
813
- }
814
- hasPermission(permission) {
815
- return this.permissions != null && this.permissions.some(p => p === permission) || this.isAdmin;
816
- }
817
- //#region Fields
818
- get timerStat() {
819
- const timerStat_key = this.localStorage.getDataObject(this.refreshTokenTimerCheckId);
820
- const timerStat = JSON.parse(timerStat_key);
821
- return timerStat;
822
- }
823
- get isLoggedIn() {
824
- const accessToken = this.token;
825
- const refreshToken = this.refreshToken;
826
- const hasTokens = !this.isEmptyString(accessToken) && !this.isEmptyString(refreshToken);
827
- return hasTokens && !this.isAccessTokenTokenExpired();
828
- }
829
- get isAdmin() {
830
- let parsed = JSON.parse(this.currentUser);
831
- if (Utilities.IsNil(parsed))
832
- return false;
833
- return parsed.IsAdmin || false;
834
- }
835
- get pseudo() {
836
- let parsed = JSON.parse(this.currentUser);
837
- return parsed.Username || '';
838
- }
839
- get userId() {
840
- let parsed = JSON.parse(this.currentUser);
841
- return parsed.Id || 0;
842
- }
843
- get currentUser() {
844
- return this.localStorage.getDataObject(AppKeys.CURRENT_USER);
845
- }
846
- get rememberMe() {
847
- return this.localStorage.getDataObject(AppKeys.REMEMBER_ME) === true;
848
- }
849
- get token() {
850
- return this.localStorage.getDataObject(AppKeys.ACCESS_TOKEN);
851
- }
852
- get refreshToken() {
853
- return this.localStorage.getDataObject(AppKeys.REFRESH_TOKEN);
854
- }
855
- get permissions() {
856
- let permissions = this.localStorage.getDataObject(AppKeys.PERMISSIONS);
857
- let parsed_permissions = JSON.parse(permissions);
858
- return parsed_permissions;
859
- }
860
- get companyId() {
861
- const decoded = this.getDecodedAccessToken();
862
- if (Utilities.IsNil(decoded[AppKeys.USER_COMPANY_ID])) {
863
- return null;
864
- }
865
- return decoded[AppKeys.USER_COMPANY_ID];
866
- }
867
- get referenceSupplierId() {
868
- const decoded = this.getDecodedAccessToken();
869
- if (Utilities.IsNil(decoded[AppKeys.REFERENCE_SUPPLIER_ID])) {
870
- return null;
871
- }
872
- return decoded[AppKeys.REFERENCE_SUPPLIER_ID];
873
- }
874
- //#endregion
875
- navigateToHome() {
876
- this.router.navigate(['/']);
877
- }
878
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthService, deps: [{ token: HeadersService }, { token: BusMessageService }, { token: i3.HttpClient }, { token: i1.Router }, { token: LocalStoreManager }, { token: MenuService }, { token: i7.EnvironmentBase }], target: i0.ɵɵFactoryTarget.Injectable }); }
879
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthService }); }
880
- }
881
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthService, decorators: [{
882
- type: Injectable
883
- }], ctorParameters: () => [{ type: HeadersService }, { type: BusMessageService }, { type: i3.HttpClient }, { type: i1.Router }, { type: LocalStoreManager }, { type: MenuService }, { type: i7.EnvironmentBase }] });
884
-
885
- class AuthGuard {
886
- constructor(authService, menuService, router) {
887
- this.authService = authService;
888
- this.menuService = menuService;
889
- this.router = router;
890
- }
891
- canActivate(route, state) {
892
- let url = state.url;
893
- return this.checkLogin(url);
894
- }
895
- canActivateChild(route, state) {
896
- return this.canActivate(route, state);
897
- }
898
- canLoad(route) {
899
- let url = `/${route.path}`;
900
- return this.checkLogin(url);
901
- }
902
- checkLogin(url) {
903
- if (this.authService.isLoggedIn) {
904
- if (url === '/accessDenied' || this.authService.isAdmin) {
905
- return true;
906
- }
907
- return this.hasAuthUserAccessToThisRoute(url);
908
- }
909
- this.menuService.resetPermissionMap();
910
- this.authService.loginRedirectUrl = url;
911
- this.router.navigate(['/login']);
912
- return false;
913
- }
914
- hasAuthUserAccessToThisRoute(returnUrl) {
915
- if (!this.menuService.hasAccessToThisRoute(Utilities.splitInTwo(returnUrl, '?').firstPart)) {
916
- this.showAccessDenied(returnUrl);
917
- return false;
918
- }
919
- return true;
920
- }
921
- showAccessDenied(returnUrl) {
922
- this.router.navigate(['/accessDenied']);
923
- }
924
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthGuard, deps: [{ token: AuthService }, { token: MenuService }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
925
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthGuard }); }
926
- }
927
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthGuard, decorators: [{
928
- type: Injectable
929
- }], ctorParameters: () => [{ type: AuthService }, { type: MenuService }, { type: i1.Router }] });
930
-
931
- class BreadcrumbService {
932
- constructor(title) {
933
- this.title = title;
934
- this.initialData = {
935
- description: '',
936
- display: false,
937
- header: '',
938
- levels: [
939
- {
940
- icon: 'clock-o',
941
- link: ['/'],
942
- title: 'Default'
943
- }
944
- ]
945
- };
946
- this.current = new ReplaySubject(1);
947
- this.clear();
948
- }
949
- setCurrent(data) {
950
- if (data.description !== undefined && data.description !== '') {
951
- this.title.setTitle('DFlat - ' + data.levels[data.levels.length - 1].title);
952
- }
953
- else
954
- this.title.setTitle('DFlat');
955
- this.current.next(data);
956
- }
957
- getCurrent() {
958
- return this.current;
959
- }
960
- clear() {
961
- this.setCurrent(this.initialData);
962
- }
963
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: BreadcrumbService, deps: [{ token: i1$1.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
964
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: BreadcrumbService }); }
965
- }
966
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: BreadcrumbService, decorators: [{
967
- type: Injectable
968
- }], ctorParameters: () => [{ type: i1$1.Title }] });
969
-
970
- class FilterService {
971
- get DisplayFilter() { return this.displayFilter; }
972
- get Keywords() { return this.keywords; }
973
- set Keywords(value) { this.keywords = value; }
974
- constructor() {
975
- this.displayFilterChangedSubject = new BehaviorSubject(false);
976
- this.filterChanged$ = this.displayFilterChangedSubject.asObservable();
977
- this.displayFilter = true;
978
- this.keywords = '';
979
- }
980
- setFilterDisplay(value) {
981
- if (this.displayFilter != value) {
982
- this.displayFilter = value;
983
- // Déclenchement de l'évènement de changement d'affichage du filtre
984
- this.displayFilterChangedSubject.next(this.displayFilter);
985
- }
986
- }
987
- toggleFilterDisplay() {
988
- this.displayFilter = !this.displayFilter;
989
- // Déclenchement de l'évènement de changement d'affichage du filtre
990
- this.displayFilterChangedSubject.next(this.displayFilter);
991
- }
992
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: FilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
993
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: FilterService }); }
994
- }
995
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: FilterService, decorators: [{
996
- type: Injectable
997
- }], ctorParameters: () => [] });
998
-
999
- class GeolocationService {
1000
- constructor(localStore) {
1001
- this.localStore = localStore;
1002
- this.positionsHistory = new Array(0);
1003
- this.positionChanged = new EventEmitter();
1004
- try {
1005
- let saveLocations = localStore.getDataObject(AppKeys.LAST_GEOLOCATIONS, false);
1006
- if (!Utilities.IsNil(saveLocations))
1007
- this.positionsHistory = saveLocations;
1008
- }
1009
- catch { }
1010
- }
1011
- getCurrentPosition() {
1012
- // Retourne la dernière valeur de l'historique
1013
- if (!Utilities.IsNil(this.positionsHistory) && this.positionsHistory.length > 0)
1014
- return this.positionsHistory[0];
1015
- }
1016
- setCurrentPosition(formattedName, placeId, latitude, longitude) {
1017
- // Création d'un objet de type NamedPosition
1018
- let currentPosition = {
1019
- placeId: placeId,
1020
- formattedName: formattedName,
1021
- latitude: latitude,
1022
- longitude: longitude
1023
- };
1024
- // Insertion de la dernière position dans l'historique (on ne garde que les 5 dernières positions)
1025
- this.positionsHistory.unshift(currentPosition);
1026
- if (this.positionsHistory.length > 5)
1027
- this.positionsHistory.pop();
1028
- // Sauvegarde dans le localStorage
1029
- this.localStore.savePermanentData(this.positionsHistory, AppKeys.LAST_GEOLOCATIONS);
1030
- // Déclenchement de l'évènement de changemetn de position courante.
1031
- this.positionChanged.emit(currentPosition);
1032
- }
1033
- /**
1034
- * Calcule la distance en mètres entre la position courante et le point dont les coordonnées GPS sont spécifiées en paramètre.
1035
- * @param latitude Latitude du point
1036
- * @param longitude Longitude du point
1037
- * @returns La distance en mètres entre la position courante et le point dont les coordonnées GPS sont spécifiées en paramètre.
1038
- */
1039
- getDistanceToCurrent(latitude, longitude) {
1040
- // Distance entre les coordonnées spécifiées et la position courante.
1041
- let position = this.getCurrentPosition();
1042
- if (Utilities.IsNil(position))
1043
- return undefined;
1044
- return this.getDistance(position.latitude, position.longitude, latitude, longitude);
1045
- }
1046
- /** Calcule la distance en mètres entre 2 points en coordonnées GPS.
1047
- * @param latitude1 Latitude du point 1
1048
- * @param longitude1 Longitude du point 1
1049
- * @param latitude2 Latitude du point 2
1050
- * @param longitude2 Longitude du point 2
1051
- * @returns Une estimation la distance en mètres entre les point GPS 1 et 2 dont les coordonnées sont spécifiées.
1052
- */
1053
- getDistance(latitude1, longitude1, latitude2, longitude2) {
1054
- // Connaissant la position de deux points A et B sur une sphère, calculer la distance entre eux
1055
- // revient à calculer l'abscisse curviligne S (AB) sur le grand cercle passant par A et B.
1056
- // Si l’on considère deux points A et B sur la sphère, de latitudes ϕA et ϕB et de longitudes λA et λB,
1057
- // alors la distance angulaire en radians SA-B entre A et B est donnée par la relation fondamentale de trigonométrie
1058
- // sphérique, utilisant dλ = λB – λA :
1059
- // SA-B = arc cos (sin ϕA sin ϕB + cos ϕA cos ϕB cos dλ)
1060
- // La distance S en mètres, s’obtient en multipliant SA-B par un rayon de la Terre conventionnel (6 378 137 mètres par exemple).
1061
- // Conversion en radian
1062
- let a = latitude1 * Math.PI / 180;
1063
- let b = longitude1 * Math.PI / 180;
1064
- let c = latitude2 * Math.PI / 180;
1065
- let d = longitude2 * Math.PI / 180;
1066
- // Calcul de la distance en m
1067
- let e = Math.sin(a) * Math.sin(c) + Math.cos(a) * Math.cos(c) * Math.cos(d - b);
1068
- let result = 6378137 * Math.acos(e);
1069
- return result;
1070
- }
1071
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GeolocationService, deps: [{ token: LocalStoreManager }], target: i0.ɵɵFactoryTarget.Injectable }); }
1072
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GeolocationService }); }
1073
- }
1074
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: GeolocationService, decorators: [{
1075
- type: Injectable
1076
- }], ctorParameters: () => [{ type: LocalStoreManager }] });
1077
-
1078
- class NotificationsService {
1079
- // public markThreadAsRead: Subject<any> = new Subject<any>();
1080
- constructor() {
1081
- this.notificationsList = [];
1082
- // a stream that publishes new notifications only once
1083
- this.newNotifications = new Subject();
1084
- // `notifications` is a stream that emits an array of the most up to date notifications
1085
- this.notifications = new ReplaySubject(1);
1086
- // `updates` receives _operations_ to be applied to our `notifications`
1087
- // it's a way we can perform changes on *all* notifications (that are currently
1088
- // stored in `notifications`)
1089
- this.updates = new Subject();
1090
- // action streams
1091
- this.create = new Subject();
1092
- // recois des operation, et les fais sur la liste interne, puis diffuse le resultat sur notifications
1093
- this.updates.subscribe((ope) => {
1094
- this.notificationsList = ope(this.notificationsList);
1095
- this.notifications.next(this.notificationsList);
1096
- });
1097
- this.newNotifications.pipe(map(function (notification) {
1098
- return (notifications) => {
1099
- return notifications.concat(notification);
1100
- };
1101
- }))
1102
- .subscribe(this.updates);
1103
- }
1104
- // an imperative function call to this action stream
1105
- addNotification(notification) {
1106
- this.newNotifications.next(notification);
1107
- }
1108
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NotificationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1109
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NotificationsService }); }
1110
- }
1111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NotificationsService, decorators: [{
1112
- type: Injectable
1113
- }], ctorParameters: () => [] });
1114
-
676
+ var AuthService = class AuthService {
677
+ constructor(headersService, busMsg, httpClient, router, localStorage, menuService, env) {
678
+ this.headersService = headersService;
679
+ this.busMsg = busMsg;
680
+ this.httpClient = httpClient;
681
+ this.router = router;
682
+ this.localStorage = localStorage;
683
+ this.menuService = menuService;
684
+ this.env = env;
685
+ this.baseUrl = this.env.apiUrl;
686
+ this.refreshTokenTimerCheckId = "is_refreshToken_timer_started";
687
+ this.scheduleRefreshToken(this.isLoggedIn, false);
688
+ }
689
+ login(username, password, rememberMe) {
690
+ let body = JSON.stringify({
691
+ "username": username,
692
+ "password": password
693
+ });
694
+ let _url = this.baseUrl + ServerUrl.connectPath;
695
+ return this.httpClient.post(_url, body, { headers: this.headersService.authJsonHeaders() }).pipe(map((resp) => {
696
+ let user = resp;
697
+ if (user && user.AccessToken) {
698
+ this.saveUserInfos(user, JSON.stringify(user), rememberMe);
699
+ this.busMsg.publish(new UserUpdatedMessage(user.AccessToken));
700
+ this.scheduleRefreshToken(true, true);
701
+ return user;
702
+ }
703
+ }));
704
+ }
705
+ register(captchaToken, firstName, lastName, email, password, rememberMe) {
706
+ let body = JSON.stringify({
707
+ "CaptchaToken": captchaToken,
708
+ "FirstName": firstName,
709
+ "LastName": lastName,
710
+ "Email": email,
711
+ "Password": password
712
+ });
713
+ let _url = this.baseUrl + ServerUrl.registerPath;
714
+ return this.httpClient.post(_url, body, { headers: this.headersService.authJsonHeaders() }).pipe(map((resp) => {
715
+ let user = resp;
716
+ if (user && user.AccessToken) {
717
+ this.saveUserInfos(user, JSON.stringify(user), rememberMe);
718
+ this.busMsg.publish(new UserUpdatedMessage(user.AccessToken));
719
+ this.scheduleRefreshToken(true, true);
720
+ return user;
721
+ }
722
+ }));
723
+ }
724
+ activate(code) {
725
+ let body = JSON.stringify({ "ActivationCode": code });
726
+ let _url = this.baseUrl + ServerUrl.activatePath;
727
+ return this.httpClient.post(_url, body, { headers: this.headersService.authJsonHeaders() }).pipe(map((resp) => {
728
+ return resp;
729
+ }));
730
+ }
731
+ saveUserInfos(user, userDetails, rememberMe) {
732
+ let permissions = user.Permissions || new Array();
733
+ if (rememberMe) {
734
+ this.localStorage.savePermanentData(user.AccessToken, AppKeys.ACCESS_TOKEN);
735
+ this.localStorage.savePermanentData(user.RefreshToken, AppKeys.REFRESH_TOKEN);
736
+ this.localStorage.savePermanentData(userDetails, AppKeys.CURRENT_USER);
737
+ this.localStorage.savePermanentData(JSON.stringify(permissions), AppKeys.PERMISSIONS);
738
+ } else {
739
+ this.localStorage.saveSyncedSessionData(user.AccessToken, AppKeys.ACCESS_TOKEN);
740
+ this.localStorage.saveSyncedSessionData(user.RefreshToken, AppKeys.REFRESH_TOKEN);
741
+ this.localStorage.saveSyncedSessionData(userDetails, AppKeys.CURRENT_USER);
742
+ this.localStorage.saveSyncedSessionData(JSON.stringify(permissions), AppKeys.PERMISSIONS);
743
+ }
744
+ if (rememberMe) this.localStorage.savePermanentData(rememberMe, AppKeys.REMEMBER_ME);
745
+ }
746
+ getPermissions(token) {
747
+ let decodedToken = jwt_decode(token);
748
+ let permissions = new Array();
749
+ if (decodedToken.permissions) permissions = Array.isArray(decodedToken.permissions) ? decodedToken.permissions : [decodedToken.permissions];
750
+ return permissions;
751
+ }
752
+ removeUserInfos() {
753
+ this.localStorage.deleteData(AppKeys.ACCESS_TOKEN);
754
+ this.localStorage.deleteData(AppKeys.REFRESH_TOKEN);
755
+ this.localStorage.deleteData(AppKeys.CURRENT_USER);
756
+ this.loginRedirectUrl = "/";
757
+ }
758
+ logout(pseudo) {
759
+ this.disconnect(pseudo);
760
+ }
761
+ disconnect(pseudo) {
762
+ const headers = new HttpHeaders({ "Content-Type": "application/json" });
763
+ const model = { refreshToken: this.refreshToken };
764
+ return this.httpClient.post(`${this.baseUrl}${ServerUrl.disconnectPath}`, model, { headers }).pipe(map((response) => response || {}), finalize(() => {
765
+ this.ensureLogout();
766
+ this.router.navigate(["/"]);
767
+ })).subscribe((result) => {
768
+ console.log("logout", result);
769
+ });
770
+ }
771
+ ensureLogout() {
772
+ this.menuService.resetPermissionMap();
773
+ this.busMsg.publish(new UserUpdatedMessage(null));
774
+ this.removeUserInfos();
775
+ this.unscheduleRefreshToken(true);
776
+ }
777
+ redirectLoginUser() {
778
+ let redirect = this.loginRedirectUrl && this.loginRedirectUrl !== "/" ? this.loginRedirectUrl : "/";
779
+ this.loginRedirectUrl = null;
780
+ let urlParamsAndFragment = Utilities.splitInTwo(redirect, "#");
781
+ let urlAndParams = Utilities.splitInTwo(urlParamsAndFragment.firstPart, "?");
782
+ let navigationExtras = {
783
+ fragment: urlParamsAndFragment.secondPart,
784
+ queryParams: Utilities.getQueryParamsFromString(urlAndParams.secondPart),
785
+ queryParamsHandling: "merge"
786
+ };
787
+ this.router.navigate([urlAndParams.firstPart], navigationExtras);
788
+ }
789
+ invalidateCurrentTabId() {
790
+ if (!this.rememberMe) return;
791
+ const currentTabId = this.getCurrentTabId();
792
+ if (this.timerStat && this.timerStat.tabId === currentTabId) this.setRefreshTokenTimerStopped();
793
+ }
794
+ scheduleRefreshToken(isAuthUserLoggedIn, calledFromLogin) {
795
+ this.unscheduleRefreshToken(false);
796
+ if (!this.isLoggedIn) return;
797
+ const expDateUtc = this.getAccessTokenExpirationDateUtc();
798
+ if (!expDateUtc) throw new Error("This access token has not the `exp` property.");
799
+ const expiresAtUtc = expDateUtc.valueOf();
800
+ const nowUtc = (/* @__PURE__ */ new Date()).valueOf();
801
+ const initialDelay = Math.max(1, expiresAtUtc - nowUtc - 3e3);
802
+ const timerSource$ = timer(initialDelay);
803
+ this.refreshTokenSubscription = timerSource$.subscribe(() => {
804
+ if (calledFromLogin || !this.isRefreshTokenTimerStartedInAnotherTab()) this.updateToken();
805
+ else this.scheduleRefreshToken(isAuthUserLoggedIn, false);
806
+ });
807
+ if (calledFromLogin || !this.isRefreshTokenTimerStartedInAnotherTab()) this.setRefreshTokenTimerStarted();
808
+ }
809
+ setRefreshTokenTimerStopped() {
810
+ this.localStorage.savePermanentData(JSON.stringify({
811
+ isStarted: false,
812
+ tabId: -1
813
+ }), this.refreshTokenTimerCheckId);
814
+ }
815
+ setRefreshTokenTimerStarted() {
816
+ this.localStorage.savePermanentData(JSON.stringify({
817
+ isStarted: true,
818
+ tabId: this.getCurrentTabId()
819
+ }), this.refreshTokenTimerCheckId);
820
+ }
821
+ deleteRefreshTokenTimerCheckId() {
822
+ this.localStorage.deleteData(this.refreshTokenTimerCheckId);
823
+ }
824
+ isRefreshTokenTimerStartedInAnotherTab() {
825
+ if (!this.rememberMe) return false;
826
+ const currentTabId = this.getCurrentTabId();
827
+ return this.timerStat && this.timerStat.isStarted === true && this.timerStat.tabId !== currentTabId;
828
+ }
829
+ getCurrentTabId() {
830
+ const tabIdToken = "currentTabId";
831
+ let tabId = this.localStorage.getData(tabIdToken);
832
+ if (tabId) return tabId;
833
+ tabId = Math.random();
834
+ this.localStorage.saveSyncedSessionData(tabId, tabIdToken);
835
+ return tabId;
836
+ }
837
+ getAccessTokenExpirationDateUtc() {
838
+ const decoded = this.getDecodedAccessToken();
839
+ if (decoded.exp === void 0) return null;
840
+ const date = /* @__PURE__ */ new Date(0);
841
+ date.setUTCSeconds(decoded.exp);
842
+ return date;
843
+ }
844
+ isAccessTokenTokenExpired() {
845
+ const expirationDateUtc = this.getAccessTokenExpirationDateUtc();
846
+ if (!expirationDateUtc) return true;
847
+ return !(expirationDateUtc.valueOf() > (/* @__PURE__ */ new Date()).valueOf());
848
+ }
849
+ getDecodedAccessToken() {
850
+ return jwt_decode(this.token);
851
+ }
852
+ isEmptyString(value) {
853
+ return !value || 0 === value.length;
854
+ }
855
+ unscheduleRefreshToken(cancelTimerCheckToken) {
856
+ if (this.refreshTokenSubscription) this.refreshTokenSubscription.unsubscribe();
857
+ if (cancelTimerCheckToken) this.deleteRefreshTokenTimerCheckId();
858
+ }
859
+ updateToken() {
860
+ console.log(`Entering updateToken()`);
861
+ const headers = new HttpHeaders({ "Content-Type": "application/json" });
862
+ const model = { refreshToken: this.refreshToken };
863
+ return this.httpClient.post(`${this.baseUrl}${ServerUrl.refreshPath}`, model, { headers }).pipe(map((response) => response || {}), catchError((error) => throwError(() => new Error(error.error)))).subscribe((resp) => {
864
+ let user = resp;
865
+ if (user && user.AccessToken) {
866
+ this.saveUserInfos(user, JSON.stringify(user), this.rememberMe);
867
+ this.busMsg.publish(new UserUpdatedMessage(user.AccessToken));
868
+ this.scheduleRefreshToken(this.isLoggedIn, false);
869
+ return user;
870
+ }
871
+ });
872
+ }
873
+ hasPermission(permission) {
874
+ return this.permissions != null && this.permissions.some((p) => p === permission) || this.isAdmin;
875
+ }
876
+ get timerStat() {
877
+ const timerStat_key = this.localStorage.getDataObject(this.refreshTokenTimerCheckId);
878
+ return JSON.parse(timerStat_key);
879
+ }
880
+ get isLoggedIn() {
881
+ const accessToken = this.token;
882
+ const refreshToken = this.refreshToken;
883
+ return !this.isEmptyString(accessToken) && !this.isEmptyString(refreshToken) && !this.isAccessTokenTokenExpired();
884
+ }
885
+ get isAdmin() {
886
+ let parsed = JSON.parse(this.currentUser);
887
+ if (Utilities.IsNil(parsed)) return false;
888
+ return parsed.IsAdmin || false;
889
+ }
890
+ get pseudo() {
891
+ return JSON.parse(this.currentUser).Username || "";
892
+ }
893
+ get userId() {
894
+ return JSON.parse(this.currentUser).Id || 0;
895
+ }
896
+ get currentUser() {
897
+ return this.localStorage.getDataObject(AppKeys.CURRENT_USER);
898
+ }
899
+ get rememberMe() {
900
+ return this.localStorage.getDataObject(AppKeys.REMEMBER_ME) === true;
901
+ }
902
+ get token() {
903
+ return this.localStorage.getDataObject(AppKeys.ACCESS_TOKEN);
904
+ }
905
+ get refreshToken() {
906
+ return this.localStorage.getDataObject(AppKeys.REFRESH_TOKEN);
907
+ }
908
+ get permissions() {
909
+ let permissions = this.localStorage.getDataObject(AppKeys.PERMISSIONS);
910
+ return JSON.parse(permissions);
911
+ }
912
+ get companyId() {
913
+ const decoded = this.getDecodedAccessToken();
914
+ if (Utilities.IsNil(decoded[AppKeys.USER_COMPANY_ID])) return null;
915
+ return decoded[AppKeys.USER_COMPANY_ID];
916
+ }
917
+ get referenceSupplierId() {
918
+ const decoded = this.getDecodedAccessToken();
919
+ if (Utilities.IsNil(decoded[AppKeys.REFERENCE_SUPPLIER_ID])) return null;
920
+ return decoded[AppKeys.REFERENCE_SUPPLIER_ID];
921
+ }
922
+ navigateToHome() {
923
+ this.router.navigate(["/"]);
924
+ }
925
+ static {
926
+ this.ɵfac = i0.ɵɵngDeclareFactory({
927
+ minVersion: "12.0.0",
928
+ version: "22.2.1",
929
+ ngImport: i0,
930
+ type: AuthService,
931
+ deps: [
932
+ { token: HeadersService },
933
+ { token: BusMessageService },
934
+ { token: i3.HttpClient },
935
+ { token: i4.Router },
936
+ { token: LocalStoreManager },
937
+ { token: MenuService },
938
+ { token: i7.EnvironmentBase }
939
+ ],
940
+ target: i0.ɵɵFactoryTarget.Injectable
941
+ });
942
+ }
943
+ static {
944
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
945
+ minVersion: "12.0.0",
946
+ version: "22.2.1",
947
+ ngImport: i0,
948
+ type: AuthService
949
+ });
950
+ }
951
+ };
952
+ i0.ɵɵngDeclareClassMetadata({
953
+ minVersion: "12.0.0",
954
+ version: "22.2.1",
955
+ ngImport: i0,
956
+ type: AuthService,
957
+ decorators: [{ type: Injectable }],
958
+ ctorParameters: () => [
959
+ { type: HeadersService },
960
+ { type: BusMessageService },
961
+ { type: i3.HttpClient },
962
+ { type: i4.Router },
963
+ { type: LocalStoreManager },
964
+ { type: MenuService },
965
+ { type: i7.EnvironmentBase }
966
+ ]
967
+ });
968
+ var AuthGuard = class AuthGuard {
969
+ constructor(authService, menuService, router) {
970
+ this.authService = authService;
971
+ this.menuService = menuService;
972
+ this.router = router;
973
+ }
974
+ canActivate(route, state) {
975
+ let url = state.url;
976
+ return this.checkLogin(url);
977
+ }
978
+ canActivateChild(route, state) {
979
+ return this.canActivate(route, state);
980
+ }
981
+ canLoad(route) {
982
+ let url = `/${route.path}`;
983
+ return this.checkLogin(url);
984
+ }
985
+ checkLogin(url) {
986
+ if (this.authService.isLoggedIn) {
987
+ if (url === "/accessDenied" || this.authService.isAdmin) return true;
988
+ return this.hasAuthUserAccessToThisRoute(url);
989
+ }
990
+ this.menuService.resetPermissionMap();
991
+ this.authService.loginRedirectUrl = url;
992
+ this.router.navigate(["/login"]);
993
+ return false;
994
+ }
995
+ hasAuthUserAccessToThisRoute(returnUrl) {
996
+ if (!this.menuService.hasAccessToThisRoute(Utilities.splitInTwo(returnUrl, "?").firstPart)) {
997
+ this.showAccessDenied(returnUrl);
998
+ return false;
999
+ }
1000
+ return true;
1001
+ }
1002
+ showAccessDenied(returnUrl) {
1003
+ this.router.navigate(["/accessDenied"]);
1004
+ }
1005
+ static {
1006
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1007
+ minVersion: "12.0.0",
1008
+ version: "22.2.1",
1009
+ ngImport: i0,
1010
+ type: AuthGuard,
1011
+ deps: [
1012
+ { token: AuthService },
1013
+ { token: MenuService },
1014
+ { token: i4.Router }
1015
+ ],
1016
+ target: i0.ɵɵFactoryTarget.Injectable
1017
+ });
1018
+ }
1019
+ static {
1020
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1021
+ minVersion: "12.0.0",
1022
+ version: "22.2.1",
1023
+ ngImport: i0,
1024
+ type: AuthGuard
1025
+ });
1026
+ }
1027
+ };
1028
+ i0.ɵɵngDeclareClassMetadata({
1029
+ minVersion: "12.0.0",
1030
+ version: "22.2.1",
1031
+ ngImport: i0,
1032
+ type: AuthGuard,
1033
+ decorators: [{ type: Injectable }],
1034
+ ctorParameters: () => [
1035
+ { type: AuthService },
1036
+ { type: MenuService },
1037
+ { type: i4.Router }
1038
+ ]
1039
+ });
1040
+ var BreadcrumbService = class BreadcrumbService {
1041
+ constructor(title) {
1042
+ this.title = title;
1043
+ this.initialData = {
1044
+ description: "",
1045
+ display: false,
1046
+ header: "",
1047
+ levels: [{
1048
+ icon: "clock-o",
1049
+ link: ["/"],
1050
+ title: "Default"
1051
+ }]
1052
+ };
1053
+ this.current = new ReplaySubject(1);
1054
+ this.clear();
1055
+ }
1056
+ setCurrent(data) {
1057
+ if (data.description !== void 0 && data.description !== "") this.title.setTitle("DFlat - " + data.levels[data.levels.length - 1].title);
1058
+ else this.title.setTitle("DFlat");
1059
+ this.current.next(data);
1060
+ }
1061
+ getCurrent() {
1062
+ return this.current;
1063
+ }
1064
+ clear() {
1065
+ this.setCurrent(this.initialData);
1066
+ }
1067
+ static {
1068
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1069
+ minVersion: "12.0.0",
1070
+ version: "22.2.1",
1071
+ ngImport: i0,
1072
+ type: BreadcrumbService,
1073
+ deps: [{ token: i1.Title }],
1074
+ target: i0.ɵɵFactoryTarget.Injectable
1075
+ });
1076
+ }
1077
+ static {
1078
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1079
+ minVersion: "12.0.0",
1080
+ version: "22.2.1",
1081
+ ngImport: i0,
1082
+ type: BreadcrumbService
1083
+ });
1084
+ }
1085
+ };
1086
+ i0.ɵɵngDeclareClassMetadata({
1087
+ minVersion: "12.0.0",
1088
+ version: "22.2.1",
1089
+ ngImport: i0,
1090
+ type: BreadcrumbService,
1091
+ decorators: [{ type: Injectable }],
1092
+ ctorParameters: () => [{ type: i1.Title }]
1093
+ });
1094
+ var FilterService = class FilterService {
1095
+ get DisplayFilter() {
1096
+ return this.displayFilter;
1097
+ }
1098
+ get Keywords() {
1099
+ return this.keywords;
1100
+ }
1101
+ set Keywords(value) {
1102
+ this.keywords = value;
1103
+ }
1104
+ constructor() {
1105
+ this.displayFilterChangedSubject = new BehaviorSubject(false);
1106
+ this.filterChanged$ = this.displayFilterChangedSubject.asObservable();
1107
+ this.displayFilter = true;
1108
+ this.keywords = "";
1109
+ }
1110
+ setFilterDisplay(value) {
1111
+ if (this.displayFilter != value) {
1112
+ this.displayFilter = value;
1113
+ this.displayFilterChangedSubject.next(this.displayFilter);
1114
+ }
1115
+ }
1116
+ toggleFilterDisplay() {
1117
+ this.displayFilter = !this.displayFilter;
1118
+ this.displayFilterChangedSubject.next(this.displayFilter);
1119
+ }
1120
+ static {
1121
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1122
+ minVersion: "12.0.0",
1123
+ version: "22.2.1",
1124
+ ngImport: i0,
1125
+ type: FilterService,
1126
+ deps: [],
1127
+ target: i0.ɵɵFactoryTarget.Injectable
1128
+ });
1129
+ }
1130
+ static {
1131
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1132
+ minVersion: "12.0.0",
1133
+ version: "22.2.1",
1134
+ ngImport: i0,
1135
+ type: FilterService
1136
+ });
1137
+ }
1138
+ };
1139
+ i0.ɵɵngDeclareClassMetadata({
1140
+ minVersion: "12.0.0",
1141
+ version: "22.2.1",
1142
+ ngImport: i0,
1143
+ type: FilterService,
1144
+ decorators: [{ type: Injectable }],
1145
+ ctorParameters: () => []
1146
+ });
1147
+ var GeolocationService = class GeolocationService {
1148
+ constructor(localStore) {
1149
+ this.localStore = localStore;
1150
+ this.positionsHistory = new Array(0);
1151
+ this.positionChanged = new EventEmitter();
1152
+ try {
1153
+ let saveLocations = localStore.getDataObject(AppKeys.LAST_GEOLOCATIONS, false);
1154
+ if (!Utilities.IsNil(saveLocations)) this.positionsHistory = saveLocations;
1155
+ } catch {}
1156
+ }
1157
+ getCurrentPosition() {
1158
+ if (!Utilities.IsNil(this.positionsHistory) && this.positionsHistory.length > 0) return this.positionsHistory[0];
1159
+ }
1160
+ setCurrentPosition(formattedName, placeId, latitude, longitude) {
1161
+ let currentPosition = {
1162
+ placeId,
1163
+ formattedName,
1164
+ latitude,
1165
+ longitude
1166
+ };
1167
+ this.positionsHistory.unshift(currentPosition);
1168
+ if (this.positionsHistory.length > 5) this.positionsHistory.pop();
1169
+ this.localStore.savePermanentData(this.positionsHistory, AppKeys.LAST_GEOLOCATIONS);
1170
+ this.positionChanged.emit(currentPosition);
1171
+ }
1172
+ getDistanceToCurrent(latitude, longitude) {
1173
+ let position = this.getCurrentPosition();
1174
+ if (Utilities.IsNil(position)) return void 0;
1175
+ return this.getDistance(position.latitude, position.longitude, latitude, longitude);
1176
+ }
1177
+ getDistance(latitude1, longitude1, latitude2, longitude2) {
1178
+ let a = latitude1 * Math.PI / 180;
1179
+ let b = longitude1 * Math.PI / 180;
1180
+ let c = latitude2 * Math.PI / 180;
1181
+ let d = longitude2 * Math.PI / 180;
1182
+ let e = Math.sin(a) * Math.sin(c) + Math.cos(a) * Math.cos(c) * Math.cos(d - b);
1183
+ return 6378137 * Math.acos(e);
1184
+ }
1185
+ static {
1186
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1187
+ minVersion: "12.0.0",
1188
+ version: "22.2.1",
1189
+ ngImport: i0,
1190
+ type: GeolocationService,
1191
+ deps: [{ token: LocalStoreManager }],
1192
+ target: i0.ɵɵFactoryTarget.Injectable
1193
+ });
1194
+ }
1195
+ static {
1196
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1197
+ minVersion: "12.0.0",
1198
+ version: "22.2.1",
1199
+ ngImport: i0,
1200
+ type: GeolocationService
1201
+ });
1202
+ }
1203
+ };
1204
+ i0.ɵɵngDeclareClassMetadata({
1205
+ minVersion: "12.0.0",
1206
+ version: "22.2.1",
1207
+ ngImport: i0,
1208
+ type: GeolocationService,
1209
+ decorators: [{ type: Injectable }],
1210
+ ctorParameters: () => [{ type: LocalStoreManager }]
1211
+ });
1212
+ var NotificationsService = class NotificationsService {
1213
+ constructor() {
1214
+ this.notificationsList = [];
1215
+ this.newNotifications = new Subject();
1216
+ this.notifications = new ReplaySubject(1);
1217
+ this.updates = new Subject();
1218
+ this.create = new Subject();
1219
+ this.updates.subscribe((ope) => {
1220
+ this.notificationsList = ope(this.notificationsList);
1221
+ this.notifications.next(this.notificationsList);
1222
+ });
1223
+ this.newNotifications.pipe(map(function(notification) {
1224
+ return (notifications) => {
1225
+ return notifications.concat(notification);
1226
+ };
1227
+ })).subscribe(this.updates);
1228
+ }
1229
+ addNotification(notification) {
1230
+ this.newNotifications.next(notification);
1231
+ }
1232
+ static {
1233
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1234
+ minVersion: "12.0.0",
1235
+ version: "22.2.1",
1236
+ ngImport: i0,
1237
+ type: NotificationsService,
1238
+ deps: [],
1239
+ target: i0.ɵɵFactoryTarget.Injectable
1240
+ });
1241
+ }
1242
+ static {
1243
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1244
+ minVersion: "12.0.0",
1245
+ version: "22.2.1",
1246
+ ngImport: i0,
1247
+ type: NotificationsService
1248
+ });
1249
+ }
1250
+ };
1251
+ i0.ɵɵngDeclareClassMetadata({
1252
+ minVersion: "12.0.0",
1253
+ version: "22.2.1",
1254
+ ngImport: i0,
1255
+ type: NotificationsService,
1256
+ decorators: [{ type: Injectable }],
1257
+ ctorParameters: () => []
1258
+ });
1115
1259
  var RequestState;
1116
- (function (RequestState) {
1117
- RequestState[RequestState["Pending"] = 0] = "Pending";
1118
- RequestState[RequestState["InProgress"] = 1] = "InProgress";
1119
- RequestState[RequestState["Success"] = 2] = "Success";
1120
- RequestState[RequestState["Error"] = 3] = "Error";
1121
- RequestState[RequestState["Warning"] = 4] = "Warning";
1260
+ (function(RequestState) {
1261
+ RequestState[RequestState["Pending"] = 0] = "Pending";
1262
+ RequestState[RequestState["InProgress"] = 1] = "InProgress";
1263
+ RequestState[RequestState["Success"] = 2] = "Success";
1264
+ RequestState[RequestState["Error"] = 3] = "Error";
1265
+ RequestState[RequestState["Warning"] = 4] = "Warning";
1122
1266
  })(RequestState || (RequestState = {}));
1123
- /*
1124
- signalR Hub Service.
1125
- Currently chimera class, both registering to a the dflatHub and registering handlers.
1126
- TODO Extract handlers elsewhere.
1127
- */
1128
- class HubService {
1129
- get hubOptions() {
1130
- let _self = this;
1131
- var options = {
1132
- skipNegotiation: true,
1133
- transport: signalR.HttpTransportType.WebSockets,
1134
- accessTokenFactory: () => {
1135
- const token = _self.localStorage.getDataObject(AppKeys.ACCESS_TOKEN);
1136
- return token;
1137
- }
1138
- };
1139
- return options;
1140
- }
1141
- constructor(localStorage, notificationService, busMsg, mqMsg, authService, env) {
1142
- this.localStorage = localStorage;
1143
- this.notificationService = notificationService;
1144
- this.busMsg = busMsg;
1145
- this.mqMsg = mqMsg;
1146
- this.authService = authService;
1147
- this.env = env;
1148
- this.hubUrl = this.env.hubUrl;
1149
- this.hubConnection = null;
1150
- this.isConnected = false;
1151
- this.isReconnect = false;
1152
- this.busMsg.of(UserUpdatedMessage).subscribe(msg => {
1153
- // log out
1154
- if (msg.userKey === null) {
1155
- this.disposeConnection();
1156
- }
1157
- else {
1158
- this.startHub();
1159
- }
1160
- });
1161
- }
1162
- //TODO REFACTO
1163
- init() {
1164
- if (!this.isInit) {
1165
- this.startHub();
1166
- this.isInit = true;
1167
- }
1168
- }
1169
- disposeConnection() {
1170
- if (this.hubConnection) {
1171
- this.hubConnection.stop();
1172
- }
1173
- }
1174
- startHub() {
1175
- // Si la connnexion est déjà active ou qu'un utilisateur n'est pas connecté on ne fait rien.
1176
- if (this.isConnected || !this.authService.isLoggedIn || this.isConnecting)
1177
- return;
1178
- this.isConnecting = true;
1179
- var options = this.hubOptions;
1180
- ;
1181
- this.hubConnection = new signalR.HubConnectionBuilder()
1182
- .withUrl(this.hubUrl, options)
1183
- .configureLogging(signalR.LogLevel.Trace)
1184
- .build();
1185
- this.hubConnection.serverTimeoutInMilliseconds = 30000;
1186
- this.configure();
1187
- this.hubConnection
1188
- .start()
1189
- .then(() => {
1190
- console.log('*****Connection started!');
1191
- this.isConnected = true;
1192
- this.isConnecting = false;
1193
- clearInterval(this.timer$);
1194
- })
1195
- .catch(err => {
1196
- console.log('Error while establishing connection :(', err);
1197
- this.isConnected = false;
1198
- this.isConnecting = false;
1199
- clearInterval(this.timer$);
1200
- this.scheduleStartingHub();
1201
- });
1202
- }
1203
- configure() {
1204
- // subscribe to operation log from server
1205
- this.hubConnection.on('OperationLog', (uid, message) => {
1206
- this.publishEvents(new Notification({ id: undefined, content: message, class: undefined, entityType: uid, entityId: undefined }));
1207
- });
1208
- // subscribe to broadcasted messagse from server
1209
- this.hubConnection.on('BroadcastMessage', (name, message) => {
1210
- // console.log(`BroadcastMessage received : ${message}, ${name}`);
1211
- });
1212
- //Subscriptions have to be prior the connection start so the server hub knows which 'events' this client is eligible for.
1213
- this.hubConnection.on("ReportProgress", (name, message, state, entityType, entityId) => {
1214
- // console.log(`ReportProgress: name: ${name} | message: ${message} | state: ${state} | entityType: ${entityType} | entityId: ${entityId} `);
1215
- //let end = state === RequestState.Success || state === RequestState.Error || state === RequestState.Warning ;
1216
- let classNotif = "info";
1217
- //if (end) {
1218
- const notif = new Notification({ id: name, content: message, class: classNotif, entityType: entityType, entityId: entityId });
1219
- this.publishEvents(notif);
1220
- //}
1221
- });
1222
- //Registers a handler that will be invoked when the connection is closed.
1223
- this.hubConnection.onclose(e => {
1224
- console.log(`Hub connection closed !`);
1225
- this.isConnected = false;
1226
- this.scheduleStartingHub();
1227
- });
1228
- }
1229
- scheduleStartingHub() {
1230
- // chaque 30s
1231
- this.timer$ = setInterval(() => {
1232
- console.log("retry start hub");
1233
- this.startHub();
1234
- }, 30000);
1235
- }
1236
- publishEvents(notif) {
1237
- this.mqMsg.publish(notif);
1238
- }
1239
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: HubService, deps: [{ token: LocalStoreManager }, { token: NotificationsService }, { token: BusMessageService }, { token: NotificationMqService }, { token: AuthService }, { token: i7.EnvironmentBase }], target: i0.ɵɵFactoryTarget.Injectable }); }
1240
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: HubService }); }
1241
- }
1242
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: HubService, decorators: [{
1243
- type: Injectable
1244
- }], ctorParameters: () => [{ type: LocalStoreManager }, { type: NotificationsService }, { type: BusMessageService }, { type: NotificationMqService }, { type: AuthService }, { type: i7.EnvironmentBase }] });
1245
-
1246
- class MessagesService {
1247
- // public markThreadAsRead: Subject<any> = new Subject<any>();
1248
- constructor() {
1249
- this.messagesList = [];
1250
- // a stream that publishes new messages only once
1251
- this.newMessages = new Subject();
1252
- // `messages` is a stream that emits an array of the most up to date messages
1253
- this.messages = new ReplaySubject(1);
1254
- // `updates` receives _operations_ to be applied to our `messages`
1255
- // it's a way we can perform changes on *all* messages (that are currently
1256
- // stored in `messages`)
1257
- this.updates = new Subject();
1258
- // action streams
1259
- this.create = new Subject();
1260
- // recois des operation, et les fais sur la liste interne, puis diffuse le resultat sur messages
1261
- this.updates.subscribe((ope) => {
1262
- this.messagesList = ope(this.messagesList);
1263
- this.messages.next(this.messagesList);
1264
- });
1265
- this.newMessages.pipe(map(function (message) {
1266
- return (messages) => {
1267
- return messages.concat(message);
1268
- };
1269
- }))
1270
- .subscribe(this.updates);
1271
- }
1272
- // an imperative function call to this action stream
1273
- addMessage(message) {
1274
- this.newMessages.next(message);
1275
- }
1276
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: MessagesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1277
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: MessagesService }); }
1278
- }
1279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: MessagesService, decorators: [{
1280
- type: Injectable
1281
- }], ctorParameters: () => [] });
1282
-
1283
- class ScreenService {
1284
- constructor() {
1285
- this.screenChanged = new EventEmitter();
1286
- this.scrollChanged = new EventEmitter();
1287
- }
1288
- getScreenConfiguration() {
1289
- return this.config;
1290
- }
1291
- setScreenConfiguration(value) {
1292
- // Si la valeur passée est vide, on ne fait rien.
1293
- if (Utilities.IsNil(value))
1294
- return;
1295
- // Sinon, on vérifie qu'une des valeurs de configuration a changé
1296
- if (Utilities.IsNil(this.config)
1297
- || this.config.isExtraSmallScreen != value.isExtraSmallScreen
1298
- || this.config.isSmallScreen != value.isSmallScreen
1299
- || this.config.isLargeScreen != value.isLargeScreen) {
1300
- this.config = value;
1301
- // Déclenchement de l'évènement de changemetn de position courante.
1302
- this.screenChanged.emit(this.config);
1303
- }
1304
- }
1305
- scroll(elt) {
1306
- // Déclenchement de l'évènement de scrolling
1307
- this.scrollChanged.emit(elt);
1308
- }
1309
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ScreenService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1310
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ScreenService }); }
1311
- }
1312
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ScreenService, decorators: [{
1313
- type: Injectable
1314
- }], ctorParameters: () => [] });
1315
-
1316
- class UserService {
1317
- constructor(router, authService) {
1318
- this.router = router;
1319
- this.authService = authService;
1320
- this.userChanged = new EventEmitter();
1321
- this.current = new ReplaySubject(1);
1322
- this.editUser = new ReplaySubject(1);
1323
- }
1324
- setCurrent(user) {
1325
- this.current.next(user);
1326
- this.userChanged.emit(user);
1327
- }
1328
- getCurrent() {
1329
- return this.current;
1330
- }
1331
- openEditUser() {
1332
- this.editUser.next(1);
1333
- }
1334
- getEditUser() {
1335
- return this.editUser;
1336
- }
1337
- get AuthenticatedUser() {
1338
- let user = this.authService.currentUser;
1339
- let parsed = JSON.parse(user);
1340
- let login = parsed;
1341
- if (Utilities.IsNil(login))
1342
- return undefined;
1343
- return new User(login);
1344
- }
1345
- logout() {
1346
- const user = new User({});
1347
- user.IsConnected = false;
1348
- this.setCurrent(user);
1349
- this.authService.logout(this.authService.pseudo);
1350
- }
1351
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: UserService, deps: [{ token: i1.Router }, { token: AuthService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1352
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: UserService }); }
1353
- }
1354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: UserService, decorators: [{
1355
- type: Injectable
1356
- }], ctorParameters: () => [{ type: i1.Router }, { type: AuthService }] });
1357
-
1358
- // IMPORTANT : DANS LE BUT DE FACILITER LES MERGE ET LA LECTURE DU CODE.
1359
- // 1. TOUJOURS CONSERVER LE TRI SUR LES IMPORTS
1360
- // UTILISER L'EXTENSION "TypeScript Import Sorter" DANS VSCODE.
1361
- // CONFIGURER L'EXTENSION POUR ACTIVER LA MISE EN FORME AUTOMATIQUE A LA SAUVEGARDE
1362
- // 2. UTILISER CTRL-SHIFT O POUR SUPPRIMER AUTOMATIQUEMENT LES IMPORTS INUTILES
1363
- // 3. TRIER LES COMPOSANTS OU DEPENDANCES DANS LES DECLARATIONS (IMPORTS, EXPORTS)
1364
- // SELECTION DU TEXTE PUIS CTRL-SHIFT P, "Sort Lines Ascending"
1365
- // ON PEUT PARAMETRER DES RACCOURCIS CLAVIER DANS VSCODE
1366
- // Ensure that CoreServicesModule is only loaded into AppModule
1367
- class CoreServicesModule extends EnsureModuleLoadedOnceGuard {
1368
- // Looks for the module in the parent injector to see if it's already been loaded (only want it loaded once)
1369
- constructor(parentModule) {
1370
- super(parentModule);
1371
- }
1372
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CoreServicesModule, deps: [{ token: CoreServicesModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
1373
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.4", ngImport: i0, type: CoreServicesModule, imports: [CommonModule, CoreModelModule] }); }
1374
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CoreServicesModule, providers: [
1375
- LocalStoreManager,
1376
- GeolocationService,
1377
- MessagesService,
1378
- NotificationsService,
1379
- PermissionService,
1380
- UserService,
1381
- AuthGuard,
1382
- AuthService,
1383
- HeadersService,
1384
- BusMessageService,
1385
- BreadcrumbService,
1386
- ScreenService,
1387
- AppConfiguration,
1388
- HubService,
1389
- NotificationMqService,
1390
- FilterService,
1391
- provideHttpClient(withInterceptorsFromDi())
1392
- ], imports: [CommonModule, CoreModelModule] }); }
1393
- }
1394
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CoreServicesModule, decorators: [{
1395
- type: NgModule,
1396
- args: [{ exports: [],
1397
- declarations: [], imports: [CommonModule, CoreModelModule], providers: [
1398
- LocalStoreManager,
1399
- GeolocationService,
1400
- MessagesService,
1401
- NotificationsService,
1402
- PermissionService,
1403
- UserService,
1404
- AuthGuard,
1405
- AuthService,
1406
- HeadersService,
1407
- BusMessageService,
1408
- BreadcrumbService,
1409
- ScreenService,
1410
- AppConfiguration,
1411
- HubService,
1412
- NotificationMqService,
1413
- FilterService,
1414
- provideHttpClient(withInterceptorsFromDi())
1415
- ] }]
1416
- }], ctorParameters: () => [{ type: CoreServicesModule, decorators: [{
1417
- type: Optional
1418
- }, {
1419
- type: SkipSelf
1420
- }] }] });
1421
-
1422
- class AuthInterceptor {
1423
- constructor(router, injector) {
1424
- this.router = router;
1425
- this.injector = injector;
1426
- }
1427
- intercept(req, next) {
1428
- const headersService = this.injector.get(HeadersService);
1429
- const authService = this.injector.get(AuthService);
1430
- switch (req.method) {
1431
- case "GET":
1432
- req = req.clone({ headers: headersService.authFormHeaders(), withCredentials: true });
1433
- break;
1434
- case "POST":
1435
- // let isFileUpload = req.url.match(/Upload|File/)
1436
- // let headers;
1437
- // if (isFileUpload) {
1438
- // headers = headersService.authFileUploadHeaders();
1439
- // }
1440
- // else {
1441
- // headers = headersService.authJsonHeaders();
1442
- //}
1443
- if (req.headers['lazyUpdate'] == null) {
1444
- req = req.clone({ headers: headersService.authJsonHeaders(), withCredentials: true });
1445
- }
1446
- break;
1447
- default:
1448
- req = req;
1449
- break;
1450
- }
1451
- const r = req;
1452
- return next.handle(req).pipe(catchError(err => {
1453
- console.log(err);
1454
- if (err instanceof HttpErrorResponse) {
1455
- // Ignore signalr failure
1456
- if (r.url.includes("/hub/")) {
1457
- return empty();
1458
- }
1459
- if (err.status === 401 || err.status === 403) {
1460
- // Ignore login failed
1461
- if (!(r.url.endsWith("/api/Account/Connect"))) {
1462
- authService.ensureLogout();
1463
- this.router.navigate(['/login']);
1464
- return empty();
1465
- }
1466
- }
1467
- else if (err.status === 400) {
1468
- let apiError = {};
1469
- apiError.ApiErrorType = ApiErrorTypes.UserError;
1470
- apiError.Message = err.error;
1471
- this.onError(err, apiError);
1472
- }
1473
- else {
1474
- try {
1475
- if (err.error instanceof Blob) {
1476
- err.error.text().then((str => {
1477
- let apiError = JSON.parse(str);
1478
- this.onError(err, apiError);
1479
- }));
1480
- }
1481
- else {
1482
- let apiError = err.error;
1483
- this.onError(err, apiError);
1484
- }
1485
- // if (typeof err.error === "string") {
1486
- // }
1487
- // else {
1488
- // let reader = new FileReader();
1489
- // reader.addEventListener("loadend",
1490
- // () => {
1491
- // let result = reader.result as string;
1492
- // result = trimChar(result, "\"");
1493
- // this.onError(err, result);
1494
- // });
1495
- // reader.readAsText(err.error);
1496
- // }
1497
- }
1498
- catch (error) {
1499
- let apiError = {};
1500
- apiError.ApiErrorType = ApiErrorTypes.UserError;
1501
- apiError.Message = "Une erreur a été détectée. Merci de contacter le service technique !";
1502
- this.onError(err, apiError);
1503
- }
1504
- }
1505
- }
1506
- return throwError(err);
1507
- }));
1508
- }
1509
- onError(errResponse, error) {
1510
- console.log(error.Message);
1511
- }
1512
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthInterceptor, deps: [{ token: i1.Router }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
1513
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthInterceptor }); }
1514
- }
1515
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AuthInterceptor, decorators: [{
1516
- type: Injectable
1517
- }], ctorParameters: () => [{ type: i1.Router }, { type: i0.Injector }] });
1518
-
1519
- class CanActivateGuard {
1520
- constructor(router, userService) {
1521
- this.router = router;
1522
- this.userService = userService;
1523
- this.connected = false;
1524
- this.userService.getCurrent().subscribe((user) => {
1525
- this.connected = user.IsConnected;
1526
- });
1527
- }
1528
- canActivate() {
1529
- if (!this.connected) {
1530
- this.router.navigate(['login']);
1531
- }
1532
- return this.connected;
1533
- }
1534
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CanActivateGuard, deps: [{ token: i1.Router }, { token: UserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1535
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CanActivateGuard }); }
1536
- }
1537
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: CanActivateGuard, decorators: [{
1538
- type: Injectable
1539
- }], ctorParameters: () => [{ type: i1.Router }, { type: UserService }] });
1540
-
1267
+ var HubService = class HubService {
1268
+ get hubOptions() {
1269
+ let _self = this;
1270
+ return {
1271
+ skipNegotiation: true,
1272
+ transport: signalR.HttpTransportType.WebSockets,
1273
+ accessTokenFactory: () => {
1274
+ return _self.localStorage.getDataObject(AppKeys.ACCESS_TOKEN);
1275
+ }
1276
+ };
1277
+ }
1278
+ constructor(localStorage, notificationService, busMsg, mqMsg, authService, env) {
1279
+ this.localStorage = localStorage;
1280
+ this.notificationService = notificationService;
1281
+ this.busMsg = busMsg;
1282
+ this.mqMsg = mqMsg;
1283
+ this.authService = authService;
1284
+ this.env = env;
1285
+ this.hubUrl = this.env.hubUrl;
1286
+ this.hubConnection = null;
1287
+ this.isConnected = false;
1288
+ this.isReconnect = false;
1289
+ this.busMsg.of(UserUpdatedMessage).subscribe((msg) => {
1290
+ if (msg.userKey === null) this.disposeConnection();
1291
+ else this.startHub();
1292
+ });
1293
+ }
1294
+ init() {
1295
+ if (!this.isInit) {
1296
+ this.startHub();
1297
+ this.isInit = true;
1298
+ }
1299
+ }
1300
+ disposeConnection() {
1301
+ if (this.hubConnection) this.hubConnection.stop();
1302
+ }
1303
+ startHub() {
1304
+ if (this.isConnected || !this.authService.isLoggedIn || this.isConnecting) return;
1305
+ this.isConnecting = true;
1306
+ var options = this.hubOptions;
1307
+ this.hubConnection = new signalR.HubConnectionBuilder().withUrl(this.hubUrl, options).configureLogging(signalR.LogLevel.Trace).build();
1308
+ this.hubConnection.serverTimeoutInMilliseconds = 3e4;
1309
+ this.configure();
1310
+ this.hubConnection.start().then(() => {
1311
+ console.log("*****Connection started!");
1312
+ this.isConnected = true;
1313
+ this.isConnecting = false;
1314
+ clearInterval(this.timer$);
1315
+ }).catch((err) => {
1316
+ console.log("Error while establishing connection :(", err);
1317
+ this.isConnected = false;
1318
+ this.isConnecting = false;
1319
+ clearInterval(this.timer$);
1320
+ this.scheduleStartingHub();
1321
+ });
1322
+ }
1323
+ configure() {
1324
+ this.hubConnection.on("OperationLog", (uid, message) => {
1325
+ this.publishEvents(new Notification({
1326
+ id: void 0,
1327
+ content: message,
1328
+ class: void 0,
1329
+ entityType: uid,
1330
+ entityId: void 0
1331
+ }));
1332
+ });
1333
+ this.hubConnection.on("BroadcastMessage", (name, message) => {});
1334
+ this.hubConnection.on("ReportProgress", (name, message, state, entityType, entityId) => {
1335
+ const notif = new Notification({
1336
+ id: name,
1337
+ content: message,
1338
+ class: "info",
1339
+ entityType,
1340
+ entityId
1341
+ });
1342
+ this.publishEvents(notif);
1343
+ });
1344
+ this.hubConnection.onclose((e) => {
1345
+ console.log(`Hub connection closed !`);
1346
+ this.isConnected = false;
1347
+ this.scheduleStartingHub();
1348
+ });
1349
+ }
1350
+ scheduleStartingHub() {
1351
+ this.timer$ = setInterval(() => {
1352
+ console.log("retry start hub");
1353
+ this.startHub();
1354
+ }, 3e4);
1355
+ }
1356
+ publishEvents(notif) {
1357
+ this.mqMsg.publish(notif);
1358
+ }
1359
+ static {
1360
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1361
+ minVersion: "12.0.0",
1362
+ version: "22.2.1",
1363
+ ngImport: i0,
1364
+ type: HubService,
1365
+ deps: [
1366
+ { token: LocalStoreManager },
1367
+ { token: NotificationsService },
1368
+ { token: BusMessageService },
1369
+ { token: NotificationMqService },
1370
+ { token: AuthService },
1371
+ { token: i7.EnvironmentBase }
1372
+ ],
1373
+ target: i0.ɵɵFactoryTarget.Injectable
1374
+ });
1375
+ }
1376
+ static {
1377
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1378
+ minVersion: "12.0.0",
1379
+ version: "22.2.1",
1380
+ ngImport: i0,
1381
+ type: HubService
1382
+ });
1383
+ }
1384
+ };
1385
+ i0.ɵɵngDeclareClassMetadata({
1386
+ minVersion: "12.0.0",
1387
+ version: "22.2.1",
1388
+ ngImport: i0,
1389
+ type: HubService,
1390
+ decorators: [{ type: Injectable }],
1391
+ ctorParameters: () => [
1392
+ { type: LocalStoreManager },
1393
+ { type: NotificationsService },
1394
+ { type: BusMessageService },
1395
+ { type: NotificationMqService },
1396
+ { type: AuthService },
1397
+ { type: i7.EnvironmentBase }
1398
+ ]
1399
+ });
1400
+ var MessagesService = class MessagesService {
1401
+ constructor() {
1402
+ this.messagesList = [];
1403
+ this.newMessages = new Subject();
1404
+ this.messages = new ReplaySubject(1);
1405
+ this.updates = new Subject();
1406
+ this.create = new Subject();
1407
+ this.updates.subscribe((ope) => {
1408
+ this.messagesList = ope(this.messagesList);
1409
+ this.messages.next(this.messagesList);
1410
+ });
1411
+ this.newMessages.pipe(map(function(message) {
1412
+ return (messages) => {
1413
+ return messages.concat(message);
1414
+ };
1415
+ })).subscribe(this.updates);
1416
+ }
1417
+ addMessage(message) {
1418
+ this.newMessages.next(message);
1419
+ }
1420
+ static {
1421
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1422
+ minVersion: "12.0.0",
1423
+ version: "22.2.1",
1424
+ ngImport: i0,
1425
+ type: MessagesService,
1426
+ deps: [],
1427
+ target: i0.ɵɵFactoryTarget.Injectable
1428
+ });
1429
+ }
1430
+ static {
1431
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1432
+ minVersion: "12.0.0",
1433
+ version: "22.2.1",
1434
+ ngImport: i0,
1435
+ type: MessagesService
1436
+ });
1437
+ }
1438
+ };
1439
+ i0.ɵɵngDeclareClassMetadata({
1440
+ minVersion: "12.0.0",
1441
+ version: "22.2.1",
1442
+ ngImport: i0,
1443
+ type: MessagesService,
1444
+ decorators: [{ type: Injectable }],
1445
+ ctorParameters: () => []
1446
+ });
1447
+ var ScreenService = class ScreenService {
1448
+ constructor() {
1449
+ this.screenChanged = new EventEmitter();
1450
+ this.scrollChanged = new EventEmitter();
1451
+ }
1452
+ getScreenConfiguration() {
1453
+ return this.config;
1454
+ }
1455
+ setScreenConfiguration(value) {
1456
+ if (Utilities.IsNil(value)) return;
1457
+ if (Utilities.IsNil(this.config) || this.config.isExtraSmallScreen != value.isExtraSmallScreen || this.config.isSmallScreen != value.isSmallScreen || this.config.isLargeScreen != value.isLargeScreen) {
1458
+ this.config = value;
1459
+ this.screenChanged.emit(this.config);
1460
+ }
1461
+ }
1462
+ scroll(elt) {
1463
+ this.scrollChanged.emit(elt);
1464
+ }
1465
+ static {
1466
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1467
+ minVersion: "12.0.0",
1468
+ version: "22.2.1",
1469
+ ngImport: i0,
1470
+ type: ScreenService,
1471
+ deps: [],
1472
+ target: i0.ɵɵFactoryTarget.Injectable
1473
+ });
1474
+ }
1475
+ static {
1476
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1477
+ minVersion: "12.0.0",
1478
+ version: "22.2.1",
1479
+ ngImport: i0,
1480
+ type: ScreenService
1481
+ });
1482
+ }
1483
+ };
1484
+ i0.ɵɵngDeclareClassMetadata({
1485
+ minVersion: "12.0.0",
1486
+ version: "22.2.1",
1487
+ ngImport: i0,
1488
+ type: ScreenService,
1489
+ decorators: [{ type: Injectable }],
1490
+ ctorParameters: () => []
1491
+ });
1492
+ var UserService = class UserService {
1493
+ constructor(router, authService) {
1494
+ this.router = router;
1495
+ this.authService = authService;
1496
+ this.userChanged = new EventEmitter();
1497
+ this.current = new ReplaySubject(1);
1498
+ this.editUser = new ReplaySubject(1);
1499
+ }
1500
+ setCurrent(user) {
1501
+ this.current.next(user);
1502
+ this.userChanged.emit(user);
1503
+ }
1504
+ getCurrent() {
1505
+ return this.current;
1506
+ }
1507
+ openEditUser() {
1508
+ this.editUser.next(1);
1509
+ }
1510
+ getEditUser() {
1511
+ return this.editUser;
1512
+ }
1513
+ get AuthenticatedUser() {
1514
+ let user = this.authService.currentUser;
1515
+ let login = JSON.parse(user);
1516
+ if (Utilities.IsNil(login)) return void 0;
1517
+ return new User(login);
1518
+ }
1519
+ logout() {
1520
+ const user = new User({});
1521
+ user.IsConnected = false;
1522
+ this.setCurrent(user);
1523
+ this.authService.logout(this.authService.pseudo);
1524
+ }
1525
+ static {
1526
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1527
+ minVersion: "12.0.0",
1528
+ version: "22.2.1",
1529
+ ngImport: i0,
1530
+ type: UserService,
1531
+ deps: [{ token: i4.Router }, { token: AuthService }],
1532
+ target: i0.ɵɵFactoryTarget.Injectable
1533
+ });
1534
+ }
1535
+ static {
1536
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1537
+ minVersion: "12.0.0",
1538
+ version: "22.2.1",
1539
+ ngImport: i0,
1540
+ type: UserService
1541
+ });
1542
+ }
1543
+ };
1544
+ i0.ɵɵngDeclareClassMetadata({
1545
+ minVersion: "12.0.0",
1546
+ version: "22.2.1",
1547
+ ngImport: i0,
1548
+ type: UserService,
1549
+ decorators: [{ type: Injectable }],
1550
+ ctorParameters: () => [{ type: i4.Router }, { type: AuthService }]
1551
+ });
1552
+ var CoreServicesModule = class CoreServicesModule extends EnsureModuleLoadedOnceGuard {
1553
+ constructor(parentModule) {
1554
+ super(parentModule);
1555
+ }
1556
+ static {
1557
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1558
+ minVersion: "12.0.0",
1559
+ version: "22.2.1",
1560
+ ngImport: i0,
1561
+ type: CoreServicesModule,
1562
+ deps: [{
1563
+ token: CoreServicesModule,
1564
+ optional: true,
1565
+ skipSelf: true
1566
+ }],
1567
+ target: i0.ɵɵFactoryTarget.NgModule
1568
+ });
1569
+ }
1570
+ static {
1571
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
1572
+ minVersion: "14.0.0",
1573
+ version: "22.2.1",
1574
+ ngImport: i0,
1575
+ type: CoreServicesModule,
1576
+ imports: [CommonModule, CoreModelModule]
1577
+ });
1578
+ }
1579
+ static {
1580
+ this.ɵinj = i0.ɵɵngDeclareInjector({
1581
+ minVersion: "12.0.0",
1582
+ version: "22.2.1",
1583
+ ngImport: i0,
1584
+ type: CoreServicesModule,
1585
+ providers: [
1586
+ LocalStoreManager,
1587
+ GeolocationService,
1588
+ MessagesService,
1589
+ NotificationsService,
1590
+ PermissionService,
1591
+ UserService,
1592
+ AuthGuard,
1593
+ AuthService,
1594
+ HeadersService,
1595
+ BusMessageService,
1596
+ BreadcrumbService,
1597
+ ScreenService,
1598
+ AppConfiguration,
1599
+ HubService,
1600
+ NotificationMqService,
1601
+ FilterService,
1602
+ provideHttpClient(withXhr(), withInterceptorsFromDi())
1603
+ ],
1604
+ imports: [CommonModule, CoreModelModule]
1605
+ });
1606
+ }
1607
+ };
1608
+ i0.ɵɵngDeclareClassMetadata({
1609
+ minVersion: "12.0.0",
1610
+ version: "22.2.1",
1611
+ ngImport: i0,
1612
+ type: CoreServicesModule,
1613
+ decorators: [{
1614
+ type: NgModule,
1615
+ args: [{
1616
+ exports: [],
1617
+ declarations: [],
1618
+ imports: [CommonModule, CoreModelModule],
1619
+ providers: [
1620
+ LocalStoreManager,
1621
+ GeolocationService,
1622
+ MessagesService,
1623
+ NotificationsService,
1624
+ PermissionService,
1625
+ UserService,
1626
+ AuthGuard,
1627
+ AuthService,
1628
+ HeadersService,
1629
+ BusMessageService,
1630
+ BreadcrumbService,
1631
+ ScreenService,
1632
+ AppConfiguration,
1633
+ HubService,
1634
+ NotificationMqService,
1635
+ FilterService,
1636
+ provideHttpClient(withXhr(), withInterceptorsFromDi())
1637
+ ]
1638
+ }]
1639
+ }],
1640
+ ctorParameters: () => [{
1641
+ type: CoreServicesModule,
1642
+ decorators: [{ type: Optional }, { type: SkipSelf }]
1643
+ }]
1644
+ });
1645
+ var AuthInterceptor = class AuthInterceptor {
1646
+ constructor(router, injector) {
1647
+ this.router = router;
1648
+ this.injector = injector;
1649
+ }
1650
+ intercept(req, next) {
1651
+ const headersService = this.injector.get(HeadersService);
1652
+ const authService = this.injector.get(AuthService);
1653
+ switch (req.method) {
1654
+ case "GET":
1655
+ req = req.clone({
1656
+ headers: headersService.authFormHeaders(),
1657
+ withCredentials: true
1658
+ });
1659
+ break;
1660
+ case "POST":
1661
+ if (req.headers["lazyUpdate"] == null) req = req.clone({
1662
+ headers: headersService.authJsonHeaders(),
1663
+ withCredentials: true
1664
+ });
1665
+ break;
1666
+ default: req = req;
1667
+ }
1668
+ const r = req;
1669
+ return next.handle(req).pipe(catchError((err) => {
1670
+ console.log(err);
1671
+ if (err instanceof HttpErrorResponse) {
1672
+ if (r.url.includes("/hub/")) return empty();
1673
+ if (err.status === 401 || err.status === 403) {
1674
+ if (!r.url.endsWith("/api/Account/Connect")) {
1675
+ authService.ensureLogout();
1676
+ this.router.navigate(["/login"]);
1677
+ return empty();
1678
+ }
1679
+ } else if (err.status === 400) {
1680
+ let apiError = {};
1681
+ apiError.ApiErrorType = ApiErrorTypes.UserError;
1682
+ apiError.Message = err.error;
1683
+ this.onError(err, apiError);
1684
+ } else try {
1685
+ if (err.error instanceof Blob) err.error.text().then(((str) => {
1686
+ let apiError = JSON.parse(str);
1687
+ this.onError(err, apiError);
1688
+ }));
1689
+ else {
1690
+ let apiError = err.error;
1691
+ this.onError(err, apiError);
1692
+ }
1693
+ } catch (error) {
1694
+ let apiError = {};
1695
+ apiError.ApiErrorType = ApiErrorTypes.UserError;
1696
+ apiError.Message = "Une erreur a été détectée. Merci de contacter le service technique !";
1697
+ this.onError(err, apiError);
1698
+ }
1699
+ }
1700
+ return throwError(err);
1701
+ }));
1702
+ }
1703
+ onError(errResponse, error) {
1704
+ console.log(error.Message);
1705
+ }
1706
+ static {
1707
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1708
+ minVersion: "12.0.0",
1709
+ version: "22.2.1",
1710
+ ngImport: i0,
1711
+ type: AuthInterceptor,
1712
+ deps: [{ token: i4.Router }, { token: i0.Injector }],
1713
+ target: i0.ɵɵFactoryTarget.Injectable
1714
+ });
1715
+ }
1716
+ static {
1717
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1718
+ minVersion: "12.0.0",
1719
+ version: "22.2.1",
1720
+ ngImport: i0,
1721
+ type: AuthInterceptor
1722
+ });
1723
+ }
1724
+ };
1725
+ i0.ɵɵngDeclareClassMetadata({
1726
+ minVersion: "12.0.0",
1727
+ version: "22.2.1",
1728
+ ngImport: i0,
1729
+ type: AuthInterceptor,
1730
+ decorators: [{ type: Injectable }],
1731
+ ctorParameters: () => [{ type: i4.Router }, { type: i0.Injector }]
1732
+ });
1733
+ var CanActivateGuard = class CanActivateGuard {
1734
+ constructor(router, userService) {
1735
+ this.router = router;
1736
+ this.userService = userService;
1737
+ this.connected = false;
1738
+ this.userService.getCurrent().subscribe((user) => {
1739
+ this.connected = user.IsConnected;
1740
+ });
1741
+ }
1742
+ canActivate() {
1743
+ if (!this.connected) this.router.navigate(["login"]);
1744
+ return this.connected;
1745
+ }
1746
+ static {
1747
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1748
+ minVersion: "12.0.0",
1749
+ version: "22.2.1",
1750
+ ngImport: i0,
1751
+ type: CanActivateGuard,
1752
+ deps: [{ token: i4.Router }, { token: UserService }],
1753
+ target: i0.ɵɵFactoryTarget.Injectable
1754
+ });
1755
+ }
1756
+ static {
1757
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1758
+ minVersion: "12.0.0",
1759
+ version: "22.2.1",
1760
+ ngImport: i0,
1761
+ type: CanActivateGuard
1762
+ });
1763
+ }
1764
+ };
1765
+ i0.ɵɵngDeclareClassMetadata({
1766
+ minVersion: "12.0.0",
1767
+ version: "22.2.1",
1768
+ ngImport: i0,
1769
+ type: CanActivateGuard,
1770
+ decorators: [{ type: Injectable }],
1771
+ ctorParameters: () => [{ type: i4.Router }, { type: UserService }]
1772
+ });
1541
1773
  function trimChar(str, c) {
1542
- // Escape special char when needed
1543
- c = c === "]"
1544
- ? "\\]"
1545
- : c === "\\"
1546
- ? "\\\\"
1547
- : c;
1548
- return str.replace(new RegExp(`^[${c}]+|[${c}]+$`, "g"), "");
1774
+ c = c === "]" ? "\\]" : c === "\\" ? "\\\\" : c;
1775
+ return str.replace(new RegExp(`^[${c}]+|[${c}]+$`, "g"), "");
1549
1776
  }
1550
-
1551
- /**
1552
- * Menus des modules de l'application : chaque module racine ([module]-root) y déclare le sien,
1553
- * `{ provide: MODULE_MENU_SERVICES, useExisting: <Module>MenuService, multi: true }`.
1554
- * ApplicationMenuService les réunit en un seul menu.
1555
- */
1556
- const MODULE_MENU_SERVICES = new InjectionToken('MODULE_MENU_SERVICES');
1557
-
1558
- class MenuItem {
1559
- constructor(title, link, icon, sublinks, permissionKey) {
1560
- this.external = false;
1561
- this.target = '';
1562
- this.title = title;
1563
- this.link = link;
1564
- this.icon = icon;
1565
- this.sublinks = sublinks;
1566
- this.permissionKey = permissionKey;
1567
- }
1568
- }
1569
-
1570
- /**
1571
- * Menu de l'application : réunion des menus de tous ses modules (déclarés sous
1572
- * MODULE_MENU_SERVICES), dans l'ordre de déclaration. Les thèmes de même libellé sont fusionnés
1573
- * et leurs éléments réunis sans doublon (même lien). Chaque module filtre ses éléments selon les
1574
- * permissions de l'utilisateur connecté.
1575
- *
1576
- * Fourni sous MenuService par DflatAppModule.
1577
- */
1578
- class ApplicationMenuService extends MenuService {
1579
- constructor(permissionService, moduleMenus) {
1580
- super(permissionService);
1581
- this.moduleMenus = moduleMenus;
1582
- }
1583
- getAllMenuItems(isAdmin) {
1584
- // Copies : merge complète les éléments de son premier thème de chaque libellé.
1585
- const themes = (this.moduleMenus ?? [])
1586
- .reduce((all, menu) => all.concat(menu.getAllMenuItems(isAdmin)), new Array())
1587
- .map(theme => new MenuItem(theme.title, theme.link, theme.icon, [...(theme.sublinks ?? [])], theme.permissionKey));
1588
- return this.merge(themes)
1589
- .map(theme => new MenuItem(theme.title, theme.link, theme.icon, this.distinctItems(theme.sublinks), theme.permissionKey));
1590
- }
1591
- getAccessGrantedMenuItems() {
1592
- return (this.moduleMenus ?? [])
1593
- .reduce((all, menu) => all.concat(menu.getAccessGrantedMenuItems() ?? []), new Array());
1594
- }
1595
- /** Éléments sans doublon : le premier élément de chaque lien est gardé. */
1596
- distinctItems(items) {
1597
- const links = new Set();
1598
- return (items ?? []).filter(item => {
1599
- if (item.link !== undefined && links.has(item.link))
1600
- return false;
1601
- links.add(item.link);
1602
- return true;
1603
- });
1604
- }
1605
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ApplicationMenuService, deps: [{ token: PermissionService }, { token: MODULE_MENU_SERVICES, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1606
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ApplicationMenuService }); }
1607
- }
1608
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: ApplicationMenuService, decorators: [{
1609
- type: Injectable
1610
- }], ctorParameters: () => [{ type: PermissionService }, { type: undefined, decorators: [{
1611
- type: Optional
1612
- }, {
1613
- type: Inject,
1614
- args: [MODULE_MENU_SERVICES]
1615
- }] }] });
1616
-
1617
- /**
1618
- * Generated bundle index. Do not edit.
1619
- */
1620
-
1777
+ const MODULE_MENU_SERVICES = new InjectionToken("MODULE_MENU_SERVICES");
1778
+ var MenuItem = class {
1779
+ constructor(title, link, icon, sublinks, permissionKey) {
1780
+ this.external = false;
1781
+ this.target = "";
1782
+ this.title = title;
1783
+ this.link = link;
1784
+ this.icon = icon;
1785
+ this.sublinks = sublinks;
1786
+ this.permissionKey = permissionKey;
1787
+ }
1788
+ };
1789
+ var ApplicationMenuService = class ApplicationMenuService extends MenuService {
1790
+ constructor(permissionService, moduleMenus) {
1791
+ super(permissionService);
1792
+ this.moduleMenus = moduleMenus;
1793
+ }
1794
+ getAllMenuItems(isAdmin) {
1795
+ const themes = (this.moduleMenus ?? []).reduce((all, menu) => all.concat(menu.getAllMenuItems(isAdmin)), new Array()).map((theme) => new MenuItem(theme.title, theme.link, theme.icon, [...theme.sublinks ?? []], theme.permissionKey));
1796
+ return this.merge(themes).map((theme) => new MenuItem(theme.title, theme.link, theme.icon, this.distinctItems(theme.sublinks), theme.permissionKey));
1797
+ }
1798
+ getAccessGrantedMenuItems() {
1799
+ return (this.moduleMenus ?? []).reduce((all, menu) => all.concat(menu.getAccessGrantedMenuItems() ?? []), new Array());
1800
+ }
1801
+ distinctItems(items) {
1802
+ const links = /* @__PURE__ */ new Set();
1803
+ return (items ?? []).filter((item) => {
1804
+ if (item.link !== void 0 && links.has(item.link)) return false;
1805
+ links.add(item.link);
1806
+ return true;
1807
+ });
1808
+ }
1809
+ static {
1810
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1811
+ minVersion: "12.0.0",
1812
+ version: "22.2.1",
1813
+ ngImport: i0,
1814
+ type: ApplicationMenuService,
1815
+ deps: [{ token: PermissionService }, {
1816
+ token: MODULE_MENU_SERVICES,
1817
+ optional: true
1818
+ }],
1819
+ target: i0.ɵɵFactoryTarget.Injectable
1820
+ });
1821
+ }
1822
+ static {
1823
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1824
+ minVersion: "12.0.0",
1825
+ version: "22.2.1",
1826
+ ngImport: i0,
1827
+ type: ApplicationMenuService
1828
+ });
1829
+ }
1830
+ };
1831
+ i0.ɵɵngDeclareClassMetadata({
1832
+ minVersion: "12.0.0",
1833
+ version: "22.2.1",
1834
+ ngImport: i0,
1835
+ type: ApplicationMenuService,
1836
+ decorators: [{ type: Injectable }],
1837
+ ctorParameters: () => [{ type: PermissionService }, {
1838
+ type: void 0,
1839
+ decorators: [{ type: Optional }, {
1840
+ type: Inject,
1841
+ args: [MODULE_MENU_SERVICES]
1842
+ }]
1843
+ }]
1844
+ });
1621
1845
  export { AppConfiguration, AppKeys, ApplicationMenuService, AuthGuard, AuthInterceptor, AuthService, AuthTokenType, BreadcrumbService, BusMessageService, CanActivateGuard, CoreServicesModule, FilterService, GeolocationService, HeadersService, HubService, LocalStoreManager, MODULE_MENU_SERVICES, MenuItem, MenuService, MessagesService, NotificationMqService, NotificationsService, PermissionService, ScreenService, ServerUrl, UserService, trimChar };
1622
- //# sourceMappingURL=dflat-core-web-core-services.mjs.map
1846
+
1847
+ //# sourceMappingURL=dflat-core-web-core-services.mjs.map