@lenne.tech/ng-base 18.1.3 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/CLAUDE.md +55 -0
  2. package/LICENSE +2 -2
  3. package/README.md +237 -44
  4. package/fesm2022/lenne.tech-ng-base-ai.mjs +767 -0
  5. package/fesm2022/lenne.tech-ng-base-ai.mjs.map +1 -0
  6. package/fesm2022/lenne.tech-ng-base-auth-provide.mjs +939 -0
  7. package/fesm2022/lenne.tech-ng-base-auth-provide.mjs.map +1 -0
  8. package/fesm2022/lenne.tech-ng-base-auth.mjs +454 -0
  9. package/fesm2022/lenne.tech-ng-base-auth.mjs.map +1 -0
  10. package/fesm2022/lenne.tech-ng-base-bug-bug-report-dialog-BRzVmKJr.mjs +825 -0
  11. package/fesm2022/lenne.tech-ng-base-bug-bug-report-dialog-BRzVmKJr.mjs.map +1 -0
  12. package/fesm2022/lenne.tech-ng-base-bug-bug-report-service-DWoTb_iw.mjs +351 -0
  13. package/fesm2022/lenne.tech-ng-base-bug-bug-report-service-DWoTb_iw.mjs.map +1 -0
  14. package/fesm2022/lenne.tech-ng-base-bug-capture-engine-TkjMDdqj.mjs +1046 -0
  15. package/fesm2022/lenne.tech-ng-base-bug-capture-engine-TkjMDdqj.mjs.map +1 -0
  16. package/fesm2022/lenne.tech-ng-base-bug-constants-Brm2KGHi.mjs +4 -0
  17. package/fesm2022/lenne.tech-ng-base-bug-constants-Brm2KGHi.mjs.map +1 -0
  18. package/fesm2022/lenne.tech-ng-base-bug-messages-BsP4fRQU.mjs +179 -0
  19. package/fesm2022/lenne.tech-ng-base-bug-messages-BsP4fRQU.mjs.map +1 -0
  20. package/fesm2022/lenne.tech-ng-base-bug-provide.mjs +26 -0
  21. package/fesm2022/lenne.tech-ng-base-bug-provide.mjs.map +1 -0
  22. package/fesm2022/lenne.tech-ng-base-bug-report-Tzlhe1Cm.mjs +62 -0
  23. package/fesm2022/lenne.tech-ng-base-bug-report-Tzlhe1Cm.mjs.map +1 -0
  24. package/fesm2022/lenne.tech-ng-base-bug-server.mjs +818 -0
  25. package/fesm2022/lenne.tech-ng-base-bug-server.mjs.map +1 -0
  26. package/fesm2022/lenne.tech-ng-base-bug.mjs +196 -0
  27. package/fesm2022/lenne.tech-ng-base-bug.mjs.map +1 -0
  28. package/fesm2022/lenne.tech-ng-base-files-ui.mjs +445 -0
  29. package/fesm2022/lenne.tech-ng-base-files-ui.mjs.map +1 -0
  30. package/fesm2022/lenne.tech-ng-base-files.mjs +474 -0
  31. package/fesm2022/lenne.tech-ng-base-files.mjs.map +1 -0
  32. package/fesm2022/lenne.tech-ng-base-server.mjs +408 -0
  33. package/fesm2022/lenne.tech-ng-base-server.mjs.map +1 -0
  34. package/fesm2022/lenne.tech-ng-base-share.mjs +76 -0
  35. package/fesm2022/lenne.tech-ng-base-share.mjs.map +1 -0
  36. package/fesm2022/lenne.tech-ng-base-sync.mjs +1096 -0
  37. package/fesm2022/lenne.tech-ng-base-sync.mjs.map +1 -0
  38. package/fesm2022/lenne.tech-ng-base-testing.mjs +171 -0
  39. package/fesm2022/lenne.tech-ng-base-testing.mjs.map +1 -0
  40. package/fesm2022/lenne.tech-ng-base-ui-provide.mjs +124 -0
  41. package/fesm2022/lenne.tech-ng-base-ui-provide.mjs.map +1 -0
  42. package/fesm2022/lenne.tech-ng-base-ui.mjs +34611 -0
  43. package/fesm2022/lenne.tech-ng-base-ui.mjs.map +1 -0
  44. package/fesm2022/lenne.tech-ng-base-utils.mjs +287 -0
  45. package/fesm2022/lenne.tech-ng-base-utils.mjs.map +1 -0
  46. package/fesm2022/lenne.tech-ng-base.mjs +615 -910
  47. package/fesm2022/lenne.tech-ng-base.mjs.map +1 -1
  48. package/i18n/auth/de.json +17 -0
  49. package/i18n/auth/en.json +17 -0
  50. package/i18n/bug/de.json +85 -0
  51. package/i18n/bug/en.json +85 -0
  52. package/i18n/de.json +8 -0
  53. package/i18n/en.json +8 -0
  54. package/i18n/files/de.json +27 -0
  55. package/i18n/files/en.json +27 -0
  56. package/i18n/share/de.json +8 -0
  57. package/i18n/share/en.json +8 -0
  58. package/i18n/ui/de.json +38 -0
  59. package/i18n/ui/en.json +38 -0
  60. package/package.json +127 -58
  61. package/types/lenne.tech-ng-base-ai.d.ts +830 -0
  62. package/types/lenne.tech-ng-base-auth-provide.d.ts +603 -0
  63. package/types/lenne.tech-ng-base-auth.d.ts +320 -0
  64. package/types/lenne.tech-ng-base-bug-provide.d.ts +272 -0
  65. package/types/lenne.tech-ng-base-bug-rolldown-runtime-C25Le4-w.d.ts +1 -0
  66. package/types/lenne.tech-ng-base-bug-server.d.ts +316 -0
  67. package/types/lenne.tech-ng-base-bug.d.ts +202 -0
  68. package/types/lenne.tech-ng-base-files-ui.d.ts +116 -0
  69. package/types/lenne.tech-ng-base-files.d.ts +288 -0
  70. package/types/lenne.tech-ng-base-server.d.ts +262 -0
  71. package/types/lenne.tech-ng-base-share.d.ts +21 -0
  72. package/types/lenne.tech-ng-base-sync.d.ts +380 -0
  73. package/types/lenne.tech-ng-base-testing.d.ts +327 -0
  74. package/types/lenne.tech-ng-base-ui-provide.d.ts +65 -0
  75. package/types/lenne.tech-ng-base-ui.d.ts +7732 -0
  76. package/types/lenne.tech-ng-base-utils.d.ts +150 -0
  77. package/types/lenne.tech-ng-base.d.ts +503 -0
  78. package/ui/styles/components/accordion.css +3 -0
  79. package/ui/styles/components/alert-dialog.css +4 -0
  80. package/ui/styles/components/alert.css +3 -0
  81. package/ui/styles/components/aspect-ratio.css +3 -0
  82. package/ui/styles/components/attachment.css +4 -0
  83. package/ui/styles/components/autocomplete.css +4 -0
  84. package/ui/styles/components/avatar.css +3 -0
  85. package/ui/styles/components/badge.css +3 -0
  86. package/ui/styles/components/breadcrumb.css +3 -0
  87. package/ui/styles/components/bubble.css +3 -0
  88. package/ui/styles/components/button-group.css +3 -0
  89. package/ui/styles/components/button.css +3 -0
  90. package/ui/styles/components/calendar.css +5 -0
  91. package/ui/styles/components/card.css +3 -0
  92. package/ui/styles/components/checkbox.css +3 -0
  93. package/ui/styles/components/code-block.css +4 -0
  94. package/ui/styles/components/collapsible.css +3 -0
  95. package/ui/styles/components/combobox.css +5 -0
  96. package/ui/styles/components/command.css +5 -0
  97. package/ui/styles/components/context-menu.css +3 -0
  98. package/ui/styles/components/date-picker.css +7 -0
  99. package/ui/styles/components/dialog.css +4 -0
  100. package/ui/styles/components/drawer.css +3 -0
  101. package/ui/styles/components/dropdown-menu.css +3 -0
  102. package/ui/styles/components/empty.css +3 -0
  103. package/ui/styles/components/field.css +5 -0
  104. package/ui/styles/components/hover-card.css +3 -0
  105. package/ui/styles/components/index.css +91 -0
  106. package/ui/styles/components/input-group.css +6 -0
  107. package/ui/styles/components/input-otp.css +3 -0
  108. package/ui/styles/components/input.css +3 -0
  109. package/ui/styles/components/item.css +4 -0
  110. package/ui/styles/components/kbd.css +3 -0
  111. package/ui/styles/components/label.css +3 -0
  112. package/ui/styles/components/lt-breadcrumb.css +3 -0
  113. package/ui/styles/components/lt-bug-attachments.css +5 -0
  114. package/ui/styles/components/lt-bug-journey-timeline.css +5 -0
  115. package/ui/styles/components/lt-bug-report-dialog.css +15 -0
  116. package/ui/styles/components/lt-bug-report.css +4 -0
  117. package/ui/styles/components/lt-color-mode-button.css +3 -0
  118. package/ui/styles/components/lt-confirm-dialog.css +4 -0
  119. package/ui/styles/components/lt-data-view.css +5 -0
  120. package/ui/styles/components/lt-date-picker.css +3 -0
  121. package/ui/styles/components/lt-date-time-picker.css +5 -0
  122. package/ui/styles/components/lt-enter-action.css +2 -0
  123. package/ui/styles/components/lt-footer.css +3 -0
  124. package/ui/styles/components/lt-form-field.css +4 -0
  125. package/ui/styles/components/lt-header.css +5 -0
  126. package/ui/styles/components/lt-imports.css +21 -0
  127. package/ui/styles/components/lt-navigation-menu.css +3 -0
  128. package/ui/styles/components/lt-notice.css +3 -0
  129. package/ui/styles/components/lt-overlay-defaults.css +3 -0
  130. package/ui/styles/components/lt-page-card.css +3 -0
  131. package/ui/styles/components/lt-page-title.css +2 -0
  132. package/ui/styles/components/lt-password-input.css +4 -0
  133. package/ui/styles/components/lt-readonly-field.css +2 -0
  134. package/ui/styles/components/lt-select.css +4 -0
  135. package/ui/styles/components/lt-text-field.css +5 -0
  136. package/ui/styles/components/lt-toolbar-item.css +2 -0
  137. package/ui/styles/components/lt-toolbar.css +3 -0
  138. package/ui/styles/components/lt-tus-upload-component.css +5 -0
  139. package/ui/styles/components/marker.css +3 -0
  140. package/ui/styles/components/menubar.css +3 -0
  141. package/ui/styles/components/message-scroller.css +4 -0
  142. package/ui/styles/components/message.css +3 -0
  143. package/ui/styles/components/native-select.css +3 -0
  144. package/ui/styles/components/navigation-menu.css +3 -0
  145. package/ui/styles/components/pagination.css +4 -0
  146. package/ui/styles/components/popover.css +3 -0
  147. package/ui/styles/components/progress.css +3 -0
  148. package/ui/styles/components/questionnaire.css +4 -0
  149. package/ui/styles/components/radio-group.css +3 -0
  150. package/ui/styles/components/resizable.css +3 -0
  151. package/ui/styles/components/select.css +3 -0
  152. package/ui/styles/components/separator.css +3 -0
  153. package/ui/styles/components/sheet.css +4 -0
  154. package/ui/styles/components/sidebar.css +9 -0
  155. package/ui/styles/components/skeleton.css +3 -0
  156. package/ui/styles/components/slider.css +3 -0
  157. package/ui/styles/components/sonner.css +4 -0
  158. package/ui/styles/components/spinner.css +3 -0
  159. package/ui/styles/components/switch.css +3 -0
  160. package/ui/styles/components/table.css +3 -0
  161. package/ui/styles/components/tabs.css +4 -0
  162. package/ui/styles/components/textarea.css +3 -0
  163. package/ui/styles/components/toggle-group.css +4 -0
  164. package/ui/styles/components/toggle.css +3 -0
  165. package/ui/styles/components/tooltip.css +3 -0
  166. package/ui/styles/components/trace.css +3 -0
  167. package/ui/styles/components/typography.css +3 -0
  168. package/ui/styles/components/utils.css +2 -0
  169. package/ui/styles/core.css +137 -0
  170. package/ui/styles/palette.css +94 -0
  171. package/ui/styles/theme.css +14 -0
  172. package/ui/styles/transitions.css +131 -0
  173. package/base-cms/index.d.ts +0 -5
  174. package/base-cms/interfaces/base-cms-module-config.interface.d.ts +0 -16
  175. package/base-cms/pages/base-cms/base-cms.component.d.ts +0 -92
  176. package/base-cms/public-api.d.ts +0 -5
  177. package/base-components/components/breadcrumb/breadcrumb.component.d.ts +0 -10
  178. package/base-components/components/change-password/change-password.component.d.ts +0 -24
  179. package/base-components/components/checkbox/checkbox.component.d.ts +0 -12
  180. package/base-components/components/delete-account/delete-account.component.d.ts +0 -15
  181. package/base-components/components/fab-button/fab-button.component.d.ts +0 -16
  182. package/base-components/components/input/input.component.d.ts +0 -27
  183. package/base-components/components/loading-bar/loading-bar.component.d.ts +0 -17
  184. package/base-components/components/model-form/model-form-base.component.d.ts +0 -64
  185. package/base-components/components/model-form/model-form.component.d.ts +0 -139
  186. package/base-components/components/model-form-sub/model-form-sub.component.d.ts +0 -56
  187. package/base-components/components/model-table/model-table.component.d.ts +0 -115
  188. package/base-components/components/refence-input/refence-input.component.d.ts +0 -84
  189. package/base-components/components/select/select.component.d.ts +0 -25
  190. package/base-components/components/skeleton-loader/skeleton-loader.component.d.ts +0 -10
  191. package/base-components/components/tags/tags.component.d.ts +0 -60
  192. package/base-components/components/textarea/textarea.component.d.ts +0 -21
  193. package/base-components/components/toast/toast.component.d.ts +0 -19
  194. package/base-components/components/upload-image/upload-image.component.d.ts +0 -111
  195. package/base-components/directives/back-button.directive.d.ts +0 -9
  196. package/base-components/directives/context-menu.directive.d.ts +0 -22
  197. package/base-components/directives/sort.directive.d.ts +0 -15
  198. package/base-components/directives/stop-propagation.directive.d.ts +0 -10
  199. package/base-components/index.d.ts +0 -5
  200. package/base-components/pipes/ellipses.pipe.d.ts +0 -10
  201. package/base-components/public-api.d.ts +0 -26
  202. package/base-prototype/index.d.ts +0 -5
  203. package/base-prototype/pages/email-verification/email-verification.component.d.ts +0 -18
  204. package/base-prototype/pages/forgot-password/forgot-password.component.d.ts +0 -26
  205. package/base-prototype/pages/login/login.component.d.ts +0 -33
  206. package/base-prototype/pages/profile/profile.component.d.ts +0 -24
  207. package/base-prototype/pages/register/register.component.d.ts +0 -31
  208. package/base-prototype/pages/set-password/set-password.component.d.ts +0 -29
  209. package/base-prototype/public-api.d.ts +0 -9
  210. package/esm2022/base-cms/interfaces/base-cms-module-config.interface.mjs +0 -3
  211. package/esm2022/base-cms/lenne.tech-ng-base-base-cms.mjs +0 -5
  212. package/esm2022/base-cms/pages/base-cms/base-cms.component.mjs +0 -238
  213. package/esm2022/base-cms/public-api.mjs +0 -8
  214. package/esm2022/base-components/components/breadcrumb/breadcrumb.component.mjs +0 -23
  215. package/esm2022/base-components/components/change-password/change-password.component.mjs +0 -97
  216. package/esm2022/base-components/components/checkbox/checkbox.component.mjs +0 -38
  217. package/esm2022/base-components/components/delete-account/delete-account.component.mjs +0 -59
  218. package/esm2022/base-components/components/fab-button/fab-button.component.mjs +0 -24
  219. package/esm2022/base-components/components/input/input.component.mjs +0 -75
  220. package/esm2022/base-components/components/loading-bar/loading-bar.component.mjs +0 -37
  221. package/esm2022/base-components/components/model-form/model-form-base.component.mjs +0 -145
  222. package/esm2022/base-components/components/model-form/model-form.component.mjs +0 -591
  223. package/esm2022/base-components/components/model-form-sub/model-form-sub.component.mjs +0 -117
  224. package/esm2022/base-components/components/model-table/model-table.component.mjs +0 -478
  225. package/esm2022/base-components/components/refence-input/refence-input.component.mjs +0 -278
  226. package/esm2022/base-components/components/select/select.component.mjs +0 -62
  227. package/esm2022/base-components/components/skeleton-loader/skeleton-loader.component.mjs +0 -33
  228. package/esm2022/base-components/components/tags/tags.component.mjs +0 -227
  229. package/esm2022/base-components/components/textarea/textarea.component.mjs +0 -79
  230. package/esm2022/base-components/components/toast/toast.component.mjs +0 -69
  231. package/esm2022/base-components/components/upload-image/upload-image.component.mjs +0 -346
  232. package/esm2022/base-components/directives/back-button.directive.mjs +0 -25
  233. package/esm2022/base-components/directives/context-menu.directive.mjs +0 -112
  234. package/esm2022/base-components/directives/sort.directive.mjs +0 -61
  235. package/esm2022/base-components/directives/stop-propagation.directive.mjs +0 -24
  236. package/esm2022/base-components/lenne.tech-ng-base-base-components.mjs +0 -5
  237. package/esm2022/base-components/pipes/ellipses.pipe.mjs +0 -23
  238. package/esm2022/base-components/public-api.mjs +0 -30
  239. package/esm2022/base-prototype/lenne.tech-ng-base-base-prototype.mjs +0 -5
  240. package/esm2022/base-prototype/pages/email-verification/email-verification.component.mjs +0 -60
  241. package/esm2022/base-prototype/pages/forgot-password/forgot-password.component.mjs +0 -78
  242. package/esm2022/base-prototype/pages/login/login.component.mjs +0 -114
  243. package/esm2022/base-prototype/pages/profile/profile.component.mjs +0 -87
  244. package/esm2022/base-prototype/pages/register/register.component.mjs +0 -100
  245. package/esm2022/base-prototype/pages/set-password/set-password.component.mjs +0 -91
  246. package/esm2022/base-prototype/public-api.mjs +0 -11
  247. package/esm2022/lenne.tech-ng-base.mjs +0 -5
  248. package/esm2022/public-api.mjs +0 -25
  249. package/esm2022/shared/classes/auth.class.mjs +0 -14
  250. package/esm2022/shared/classes/basic-user.class.mjs +0 -49
  251. package/esm2022/shared/classes/graphql-enum.class.mjs +0 -10
  252. package/esm2022/shared/classes/graphql-meta.class.mjs +0 -345
  253. package/esm2022/shared/classes/graphql-type.class.mjs +0 -14
  254. package/esm2022/shared/classes/helper.class.mjs +0 -307
  255. package/esm2022/shared/classes/sort.class.mjs +0 -38
  256. package/esm2022/shared/classes/standard.class.mjs +0 -40
  257. package/esm2022/shared/decorators/debounce.decorator.mjs +0 -12
  258. package/esm2022/shared/enums/comparison-operator.enum.mjs +0 -16
  259. package/esm2022/shared/enums/graphql-request-type.enum.mjs +0 -10
  260. package/esm2022/shared/enums/logical-operator.enum.mjs +0 -10
  261. package/esm2022/shared/enums/skeleton-type.enum.mjs +0 -7
  262. package/esm2022/shared/enums/sort-order.enum.mjs +0 -6
  263. package/esm2022/shared/enums/toast-type.enum.mjs +0 -8
  264. package/esm2022/shared/functions/ws-client.function.mjs +0 -39
  265. package/esm2022/shared/interfaces/base-module-config.interface.mjs +0 -3
  266. package/esm2022/shared/interfaces/breadcrumb.interface.mjs +0 -2
  267. package/esm2022/shared/interfaces/can-component-deactivate.interface.mjs +0 -2
  268. package/esm2022/shared/interfaces/cms-enum-values.interface.mjs +0 -2
  269. package/esm2022/shared/interfaces/cms-field-config.interface.mjs +0 -2
  270. package/esm2022/shared/interfaces/cms-model-config.interface.mjs +0 -2
  271. package/esm2022/shared/interfaces/cms-table-field.interface.mjs +0 -2
  272. package/esm2022/shared/interfaces/combined-filter-input.interface.mjs +0 -2
  273. package/esm2022/shared/interfaces/compress-options.interface.mjs +0 -2
  274. package/esm2022/shared/interfaces/cropping-options.interface.mjs +0 -2
  275. package/esm2022/shared/interfaces/field-object.interface.mjs +0 -2
  276. package/esm2022/shared/interfaces/field.interface.mjs +0 -2
  277. package/esm2022/shared/interfaces/filter-input.interface.mjs +0 -2
  278. package/esm2022/shared/interfaces/find-args.interface.mjs +0 -2
  279. package/esm2022/shared/interfaces/graphql-crud-type.interface.mjs +0 -2
  280. package/esm2022/shared/interfaces/graphql-fields-object.interface.mjs +0 -2
  281. package/esm2022/shared/interfaces/graphql-options.interface.mjs +0 -2
  282. package/esm2022/shared/interfaces/graphql-plus-options.interfacen.mjs +0 -2
  283. package/esm2022/shared/interfaces/graphql-type-collection.interface.mjs +0 -2
  284. package/esm2022/shared/interfaces/login-config.interface.mjs +0 -2
  285. package/esm2022/shared/interfaces/register-config.interface.mjs +0 -2
  286. package/esm2022/shared/interfaces/single-filter-input.interface.mjs +0 -2
  287. package/esm2022/shared/interfaces/sort-input.interface.mjs +0 -2
  288. package/esm2022/shared/interfaces/time-components.interface.mjs +0 -2
  289. package/esm2022/shared/interfaces/toast.interface.mjs +0 -2
  290. package/esm2022/shared/lenne.tech-ng-base-shared.mjs +0 -5
  291. package/esm2022/shared/public-api.mjs +0 -74
  292. package/esm2022/shared/services/auth.service.mjs +0 -152
  293. package/esm2022/shared/services/breadcrumb.service.mjs +0 -69
  294. package/esm2022/shared/services/cms.service.mjs +0 -82
  295. package/esm2022/shared/services/file.service.mjs +0 -86
  296. package/esm2022/shared/services/forms.service.mjs +0 -61
  297. package/esm2022/shared/services/graphql-meta.service.mjs +0 -132
  298. package/esm2022/shared/services/graphql-plus.service.mjs +0 -93
  299. package/esm2022/shared/services/graphql.service.mjs +0 -510
  300. package/esm2022/shared/services/image.service.mjs +0 -102
  301. package/esm2022/shared/services/loader.service.mjs +0 -78
  302. package/esm2022/shared/services/navigation.service.mjs +0 -38
  303. package/esm2022/shared/services/scroll.service.mjs +0 -207
  304. package/esm2022/shared/services/storage.service.mjs +0 -149
  305. package/esm2022/shared/services/toast.service.mjs +0 -39
  306. package/esm2022/shared/services/user.service.mjs +0 -160
  307. package/esm2022/shared/services/ws.service.mjs +0 -17
  308. package/esm2022/shared/types/graphql-fields.type.mjs +0 -2
  309. package/esm2022/shared/types/storage.type.mjs +0 -2
  310. package/esm2022/shared/validators/email.validator.mjs +0 -7
  311. package/esm2022/shared/validators/match.validator.mjs +0 -22
  312. package/esm2022/shared/validators/secure-password.validator.mjs +0 -7
  313. package/esm2022/src/base.module.mjs +0 -64
  314. package/esm2022/src/decorators/auto-unsubscribe.decorator.mjs +0 -23
  315. package/esm2022/src/directives/lazy-load.directive.mjs +0 -48
  316. package/esm2022/src/directives/match-height.directive.mjs +0 -92
  317. package/esm2022/src/directives/resizable.directive.mjs +0 -92
  318. package/esm2022/src/factories/apollo-options.factory.mjs +0 -108
  319. package/esm2022/src/functions/extract-files.function.mjs +0 -87
  320. package/esm2022/src/guards/auth.guard.mjs +0 -91
  321. package/esm2022/src/guards/can-deactivate.guard.mjs +0 -16
  322. package/esm2022/src/guards/logout.guard.mjs +0 -34
  323. package/esm2022/src/pipes/date-ago.pipe.mjs +0 -64
  324. package/esm2022/src/pipes/safe-html.pipe.mjs +0 -22
  325. package/esm2022/src/services/fullscreen.service.mjs +0 -51
  326. package/esm2022/src/services/seo.service.mjs +0 -117
  327. package/esm2022/src/services/theme.service.mjs +0 -44
  328. package/fesm2022/lenne.tech-ng-base-base-cms.mjs +0 -251
  329. package/fesm2022/lenne.tech-ng-base-base-cms.mjs.map +0 -1
  330. package/fesm2022/lenne.tech-ng-base-base-components.mjs +0 -2917
  331. package/fesm2022/lenne.tech-ng-base-base-components.mjs.map +0 -1
  332. package/fesm2022/lenne.tech-ng-base-base-prototype.mjs +0 -505
  333. package/fesm2022/lenne.tech-ng-base-base-prototype.mjs.map +0 -1
  334. package/fesm2022/lenne.tech-ng-base-shared.mjs +0 -2863
  335. package/fesm2022/lenne.tech-ng-base-shared.mjs.map +0 -1
  336. package/index.d.ts +0 -5
  337. package/public-api.d.ts +0 -17
  338. package/shared/classes/auth.class.d.ts +0 -10
  339. package/shared/classes/basic-user.class.d.ts +0 -27
  340. package/shared/classes/graphql-enum.class.d.ts +0 -7
  341. package/shared/classes/graphql-meta.class.d.ts +0 -66
  342. package/shared/classes/graphql-type.class.d.ts +0 -13
  343. package/shared/classes/helper.class.d.ts +0 -99
  344. package/shared/classes/sort.class.d.ts +0 -12
  345. package/shared/classes/standard.class.d.ts +0 -32
  346. package/shared/decorators/debounce.decorator.d.ts +0 -1
  347. package/shared/enums/comparison-operator.enum.d.ts +0 -14
  348. package/shared/enums/graphql-request-type.enum.d.ts +0 -8
  349. package/shared/enums/logical-operator.enum.d.ts +0 -8
  350. package/shared/enums/skeleton-type.enum.d.ts +0 -5
  351. package/shared/enums/sort-order.enum.d.ts +0 -4
  352. package/shared/enums/toast-type.enum.d.ts +0 -6
  353. package/shared/functions/ws-client.function.d.ts +0 -5
  354. package/shared/index.d.ts +0 -5
  355. package/shared/interfaces/base-module-config.interface.d.ts +0 -61
  356. package/shared/interfaces/breadcrumb.interface.d.ts +0 -4
  357. package/shared/interfaces/can-component-deactivate.interface.d.ts +0 -7
  358. package/shared/interfaces/cms-enum-values.interface.d.ts +0 -4
  359. package/shared/interfaces/cms-field-config.interface.d.ts +0 -45
  360. package/shared/interfaces/cms-model-config.interface.d.ts +0 -14
  361. package/shared/interfaces/cms-table-field.interface.d.ts +0 -10
  362. package/shared/interfaces/combined-filter-input.interface.d.ts +0 -9
  363. package/shared/interfaces/compress-options.interface.d.ts +0 -15
  364. package/shared/interfaces/cropping-options.interface.d.ts +0 -12
  365. package/shared/interfaces/field-object.interface.d.ts +0 -6
  366. package/shared/interfaces/field.interface.d.ts +0 -5
  367. package/shared/interfaces/filter-input.interface.d.ts +0 -9
  368. package/shared/interfaces/find-args.interface.d.ts +0 -11
  369. package/shared/interfaces/graphql-crud-type.interface.d.ts +0 -7
  370. package/shared/interfaces/graphql-fields-object.interface.d.ts +0 -6
  371. package/shared/interfaces/graphql-options.interface.d.ts +0 -11
  372. package/shared/interfaces/graphql-plus-options.interfacen.d.ts +0 -9
  373. package/shared/interfaces/graphql-type-collection.interface.d.ts +0 -7
  374. package/shared/interfaces/login-config.interface.d.ts +0 -6
  375. package/shared/interfaces/register-config.interface.d.ts +0 -4
  376. package/shared/interfaces/single-filter-input.interface.d.ts +0 -11
  377. package/shared/interfaces/sort-input.interface.d.ts +0 -5
  378. package/shared/interfaces/time-components.interface.d.ts +0 -6
  379. package/shared/interfaces/toast.interface.d.ts +0 -8
  380. package/shared/public-api.d.ts +0 -65
  381. package/shared/services/auth.service.d.ts +0 -44
  382. package/shared/services/breadcrumb.service.d.ts +0 -32
  383. package/shared/services/cms.service.d.ts +0 -27
  384. package/shared/services/file.service.d.ts +0 -22
  385. package/shared/services/forms.service.d.ts +0 -14
  386. package/shared/services/graphql-meta.service.d.ts +0 -45
  387. package/shared/services/graphql-plus.service.d.ts +0 -27
  388. package/shared/services/graphql.service.d.ts +0 -71
  389. package/shared/services/image.service.d.ts +0 -27
  390. package/shared/services/loader.service.d.ts +0 -32
  391. package/shared/services/navigation.service.d.ts +0 -15
  392. package/shared/services/scroll.service.d.ts +0 -85
  393. package/shared/services/storage.service.d.ts +0 -49
  394. package/shared/services/toast.service.d.ts +0 -15
  395. package/shared/services/user.service.d.ts +0 -77
  396. package/shared/services/ws.service.d.ts +0 -8
  397. package/shared/types/graphql-fields.type.d.ts +0 -5
  398. package/shared/types/storage.type.d.ts +0 -4
  399. package/shared/validators/email.validator.d.ts +0 -1
  400. package/shared/validators/match.validator.d.ts +0 -4
  401. package/shared/validators/secure-password.validator.d.ts +0 -1
  402. package/src/base.module.d.ts +0 -16
  403. package/src/decorators/auto-unsubscribe.decorator.d.ts +0 -5
  404. package/src/directives/lazy-load.directive.d.ts +0 -17
  405. package/src/directives/match-height.directive.d.ts +0 -20
  406. package/src/directives/resizable.directive.d.ts +0 -26
  407. package/src/factories/apollo-options.factory.d.ts +0 -16
  408. package/src/functions/extract-files.function.d.ts +0 -15
  409. package/src/guards/auth.guard.d.ts +0 -27
  410. package/src/guards/can-deactivate.guard.d.ts +0 -10
  411. package/src/guards/logout.guard.d.ts +0 -16
  412. package/src/pipes/date-ago.pipe.d.ts +0 -34
  413. package/src/pipes/safe-html.pipe.d.ts +0 -13
  414. package/src/services/fullscreen.service.d.ts +0 -18
  415. package/src/services/seo.service.d.ts +0 -61
  416. package/src/services/theme.service.d.ts +0 -17
@@ -0,0 +1,603 @@
1
+ import { CanActivateChildFn, CanActivateFn } from "@angular/router";
2
+ import { HttpInterceptorFn } from "@angular/common/http";
3
+ import * as i0 from "@angular/core";
4
+ import { EnvironmentProviders, InjectionToken, Signal } from "@angular/core";
5
+ /**
6
+ * Requires a signed-in user (auth-state cookie; on the server the request cookie). Otherwise redirects to
7
+ * `loginPath?redirect=<url>`. UI gating only: the backend authorises every request itself.
8
+ */
9
+ export declare const ltAuthGuard: CanActivateFn & CanActivateChildFn;
10
+ /** Only for signed-out users (login, register…); a signed-in user is redirected to `redirectTo` (default `/app`). */
11
+ export declare function ltGuestGuard(redirectTo?: string): CanActivateFn & CanActivateChildFn;
12
+ /** Requires one of the roles (`role` or `roles`); signed-out → login, missing role → `redirectTo` (default `/`). */
13
+ export declare function ltRoleGuard(roles: string | string[], redirectTo?: string): CanActivateFn & CanActivateChildFn;
14
+ /**
15
+ * First-admin setup redirect (enable with `provideLtAuth({ systemSetup: { enabled: true } })`), put it on the root
16
+ * route as `canActivateChild`. `needsSetup && httpInitEnabled !== false` → setup page; setup done but on the setup
17
+ * page → login page; errors never redirect.
18
+ */
19
+ export declare const ltSystemSetupGuard: CanActivateFn & CanActivateChildFn;
20
+ /**
21
+ * Session-loss detection shared by `ltAuthInterceptor` (HttpClient) and the auth-aware `LT_FETCH` (fetch, SSE, sync).
22
+ *
23
+ * On a 401 outside the auth endpoints and public pages while the state says signed in, it probes
24
+ * `GET /iam/get-session` (positive verdict cached 1 s): dead → `clearUser()` and a redirect to
25
+ * `loginPath?redirect=<current url>` (guard held 1 s), alive → nothing (in JWT mode the JWT is re-minted).
26
+ * A probe without verdict (network error, 429, 5xx) never logs out. Server: no-op.
27
+ */
28
+ export declare class LtUnauthorizedHandler {
29
+ private readonly auth;
30
+ /** Handle a 401 for `url`. Resolves to `true` when the session was found dead and the user was redirected. */
31
+ handle(url?: string): Promise<boolean>;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<LtUnauthorizedHandler, never>;
33
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
34
+ }
35
+ /**
36
+ * `HttpClient` interceptor for API requests (URLs under the configured API base):
37
+ * sends credentials, adds `Authorization: Bearer` in JWT mode (refreshed first when it is about to expire), retries once after a cookie → JWT switch or a JWT
38
+ * refresh, and hands an unrecoverable 401 to {@link LtUnauthorizedHandler}. A request that brings its own
39
+ * `Authorization` header keeps it and is not retried. Other URLs and server-side requests pass through unchanged.
40
+ *
41
+ * @example provideHttpClient(withInterceptors([ltAuthInterceptor]))
42
+ */
43
+ export declare const ltAuthInterceptor: HttpInterceptorFn;
44
+ /** Cookie names (exact names win over the `NG_PUBLIC_COOKIE_PREFIX` derived ones). */
45
+ interface LtAuthCookieNamesOptions {
46
+ /** Auth-state cookie (default `lt-auth-state`, or `<prefix>-auth-state`). */
47
+ state?: string;
48
+ /** JWT cookie (default `lt-jwt-token`, or `<prefix>-jwt-token`). */
49
+ token?: string;
50
+ }
51
+ /** Options of `provideLtAuth()`; runtime overrides via `NG_PUBLIC_LT_AUTH_*`. */
52
+ interface LtAuthOptions {
53
+ /** Better Auth base path, must equal nest-server `betterAuth.basePath` (default `/iam`). */
54
+ basePath?: string;
55
+ /** Cookie names. */
56
+ cookieNames?: LtAuthCookieNamesOptions;
57
+ /**
58
+ * Register Better Auth's `adminClient()` plugin (default **`false`**). nest-server does not serve the admin plugin
59
+ * today (routes 404), and its methods are not hashed. Enable only together with a backend that registers `admin()`.
60
+ */
61
+ enableAdmin?: boolean;
62
+ /**
63
+ * Offer passkeys (default `true`); `false` makes `passkeySupported()` false. The passkey flows call
64
+ * `/iam/passkey/*` directly, so `@better-auth/passkey` is not needed (add `passkeyClient()` via `plugins` if wanted).
65
+ */
66
+ enablePasskey?: boolean;
67
+ /** Register the two-factor plugin (default `true`). */
68
+ enableTwoFactor?: boolean;
69
+ /** 401 handling. */
70
+ interceptor?: {
71
+ /** Detect session loss on 401 and redirect to the login page (default `true`). */
72
+ enabled?: boolean;
73
+ /** Extra route prefixes on which a 401 never logs out (merged with the built-in auth pages). */
74
+ publicPaths?: string[];
75
+ };
76
+ /** Login page (default `/auth/login`). */
77
+ loginPath?: string;
78
+ /** Extra Better Auth client plugins (same as `registerLtAuthPlugins()`). */
79
+ plugins?: unknown[];
80
+ /** First-admin setup flow. */
81
+ systemSetup?: {
82
+ /** Enable the setup redirect of `ltSystemSetupGuard` (default `false`). */
83
+ enabled?: boolean;
84
+ /** Setup page (default `/auth/setup`). */
85
+ setupPath?: string;
86
+ };
87
+ /** Where a sign-in that needs a second factor redirects (default `/auth/2fa`). */
88
+ twoFactorRedirectPath?: string;
89
+ }
90
+ /** Fully resolved auth options. */
91
+ interface LtResolvedAuthOptions {
92
+ basePath: string;
93
+ cookieNames: Required<LtAuthCookieNamesOptions>;
94
+ enableAdmin: boolean;
95
+ enablePasskey: boolean;
96
+ enableTwoFactor: boolean;
97
+ interceptor: {
98
+ enabled: boolean;
99
+ publicPaths: string[];
100
+ };
101
+ loginPath: string;
102
+ plugins: unknown[];
103
+ systemSetup: {
104
+ enabled: boolean;
105
+ setupPath: string;
106
+ };
107
+ twoFactorRedirectPath: string;
108
+ }
109
+ /** Default name of the auth-state cookie. */
110
+ export declare const LT_AUTH_STATE_COOKIE_DEFAULT = "lt-auth-state";
111
+ /** Default name of the JWT cookie. */
112
+ export declare const LT_JWT_TOKEN_COOKIE_DEFAULT = "lt-jwt-token";
113
+ /** Defaults of {@link LtAuthOptions}. */
114
+ export declare const LT_AUTH_DEFAULTS: LtResolvedAuthOptions;
115
+ /** Options passed to `provideLtAuth()` (raw). */
116
+ export declare const LT_AUTH_INPUT_OPTIONS: InjectionToken<LtAuthOptions>;
117
+ /**
118
+ * Resolved auth options: defaults ← `provideLtAuth(options)` ← runtime `NG_PUBLIC_LT_AUTH_*`; cookie names derived
119
+ * from `NG_PUBLIC_COOKIE_PREFIX` unless set explicitly.
120
+ */
121
+ export declare const LT_AUTH_OPTIONS: InjectionToken<LtResolvedAuthOptions>;
122
+ /** Sanitise a cookie prefix to RFC 6265 token characters (`[A-Za-z0-9._-]`). */
123
+ export declare function resolveLtCookiePrefix(raw: unknown): string;
124
+ /**
125
+ * Cookie names: an explicit non-default name wins, else `<prefix>-auth-state` / `<prefix>-jwt-token`, else the defaults.
126
+ * Mirror the prefix on the backend (`COOKIE_PREFIX`) so both sides agree.
127
+ */
128
+ export declare function resolveLtAuthCookieNames(configured: LtAuthCookieNamesOptions | undefined, cookiePrefix?: unknown): Required<LtAuthCookieNamesOptions>;
129
+ /** User as delivered by nest-server's Better Auth integration (`/iam`). Additional fields are kept. */
130
+ interface LtUser {
131
+ banExpires?: Date | string;
132
+ banned?: boolean;
133
+ banReason?: string;
134
+ email: string;
135
+ emailVerified?: boolean;
136
+ id: string;
137
+ image?: string;
138
+ name?: string;
139
+ role?: string;
140
+ roles?: string[];
141
+ twoFactorEnabled?: boolean;
142
+ [key: string]: unknown;
143
+ }
144
+ /** User input of `setUser()`; `image: null` (Better Auth) is normalised to `undefined`. */
145
+ type LtUserInput = Omit<LtUser, 'image'> & {
146
+ image?: null | string;
147
+ };
148
+ /** Auth transport: session cookie (default) or JWT Bearer token (fallback when cookies do not work). */
149
+ type LtAuthMode = 'cookie' | 'jwt';
150
+ /** Content of the client-readable auth-state cookie (`lt-auth-state`). A UI cache, never a security boundary. */
151
+ interface LtAuthState {
152
+ authMode: LtAuthMode;
153
+ user: LtUser | null;
154
+ }
155
+ /** Feature flags of nest-server (`GET /iam/features`), e.g. `emailVerification`, `passkey`, `signUpChecks`. */
156
+ type LtAuthFeatures = Record<string, boolean | number | string | string[]>;
157
+ /** Result envelope of the Better Auth client (`{ data, error }`). */
158
+ interface LtAuthResponse<T = LtAuthResponseData> {
159
+ data?: T | null;
160
+ error?: LtAuthError | null;
161
+ }
162
+ /** Data of a sign-in/sign-up response (Better Auth's native fields plus nest-server's own). */
163
+ interface LtAuthResponseData {
164
+ /** nest-server, sign-up: the email must be verified first; the session was revoked, nobody is signed in. */
165
+ emailVerificationRequired?: boolean;
166
+ redirect?: boolean;
167
+ /** nest-server, sign-in: a second factor is required (navigate to the 2FA page; no user is set). */
168
+ requiresTwoFactor?: boolean;
169
+ /** nest-server: whether the call succeeded (`false` together with `requiresTwoFactor`). */
170
+ success?: boolean;
171
+ /**
172
+ * nest-server with `cookies: false` (or `exposeTokenInBody`): the JWT for the Bearer header. Better Auth's native
173
+ * answers carry the opaque session token here, which is never used as JWT.
174
+ */
175
+ token?: string | null;
176
+ /** Set together with `twoFactorRedirect` when the account needs a second factor. */
177
+ twoFactorRedirect?: boolean;
178
+ url?: string;
179
+ user?: LtUser;
180
+ [key: string]: unknown;
181
+ }
182
+ /** Better Auth error (`{ code, message, status }`); nest-server messages may carry a `#LTNS_xxxx:` marker. */
183
+ interface LtAuthError {
184
+ code?: string;
185
+ message?: string;
186
+ status?: number;
187
+ statusText?: string;
188
+ }
189
+ /** Result of `LtAuthService.authenticateWithPasskey()`. */
190
+ interface LtPasskeyAuthResult {
191
+ error?: string;
192
+ session?: {
193
+ token: string;
194
+ };
195
+ success: boolean;
196
+ user?: LtUser;
197
+ }
198
+ /** Result of `LtAuthService.registerPasskey()`. */
199
+ interface LtPasskeyRegisterResult {
200
+ error?: string;
201
+ passkey?: unknown;
202
+ success: boolean;
203
+ }
204
+ /** A registered passkey (`passkey.listUserPasskeys()`). */
205
+ interface LtPasskey {
206
+ backedUp?: boolean;
207
+ createdAt?: Date | string;
208
+ deviceType?: string;
209
+ id: string;
210
+ name?: string | null;
211
+ [key: string]: unknown;
212
+ }
213
+ /** Result of `twoFactor.enable()`: TOTP URI for the QR code plus the backup codes. */
214
+ interface LtTwoFactorEnableResult {
215
+ backupCodes: string[];
216
+ totpURI: string;
217
+ }
218
+ /**
219
+ * Blocks stray plaintext credential keys at compile time: a param object may only carry the credential fields its
220
+ * method hashes. `{ ...form }` with an extra `password` on `requestPasswordReset` is a type error instead of a leak.
221
+ */
222
+ type LtNoStrayCredential<T, Own extends string> = Omit<{
223
+ currentPassword?: never;
224
+ newPassword?: never;
225
+ password?: never;
226
+ }, Own> & T;
227
+ /** Per-call fetch options forwarded to Better Auth (`fetchOptions`). */
228
+ interface LtAuthCallOptions {
229
+ /** Abort the request. */
230
+ signal?: AbortSignal;
231
+ /** Extra headers. */
232
+ headers?: Record<string, string>;
233
+ [key: string]: unknown;
234
+ }
235
+ /** Response of `GET /system-setup/status`. */
236
+ interface LtSystemSetupStatus {
237
+ httpInitEnabled?: boolean;
238
+ httpInitTokenRequired?: boolean;
239
+ needsSetup: boolean;
240
+ }
241
+ /** Body of `initSetup()`; the password is hashed, the token is sent as `X-System-Setup-Token`. */
242
+ interface LtSystemSetupInput {
243
+ email: string;
244
+ name: string;
245
+ password: string;
246
+ token?: string;
247
+ }
248
+ /** Lifetime of the auth-state and JWT cookies (7 days). */
249
+ export declare const LT_AUTH_COOKIE_MAX_AGE: number;
250
+ /**
251
+ * Resolve the auth state from a raw cookie string, tolerating several cookies of the same name.
252
+ *
253
+ * A host-only cookie and a domain-scoped twin can coexist and disagree; the one carrying a `user` wins. Preferring the
254
+ * user-less twin caused random logouts in the Nuxt stack. `lt-auth-state` is a UI cache, the session itself is the
255
+ * httpOnly `iam.session_token`, so a forged cookie yields at most a UI that looks signed in while every API call 401s.
256
+ */
257
+ export declare function resolveLtAuthState(cookieString: string, stateCookieName: string): LtAuthState | null;
258
+ /**
259
+ * Read/write access to the auth cookies (`lt-auth-state`, `lt-jwt-token`) with the duplicate-tolerant read and the
260
+ * SSR no-write rule. The server reads the request cookies and never writes.
261
+ */
262
+ export declare class LtAuthStateService {
263
+ private readonly cookies;
264
+ private readonly options;
265
+ private readonly document;
266
+ private readonly isServer;
267
+ /** Cookie names in use. */
268
+ get cookieNames(): {
269
+ state: string;
270
+ token: string;
271
+ };
272
+ /** Current auth state from the cookies (`null` when none). */
273
+ readState(): LtAuthState | null;
274
+ /** Write the auth state (browser only; never writes a user-less state during SSR). */
275
+ writeState(state: LtAuthState): void;
276
+ /** Auth mode from the state cookie; `cookie` when unknown. */
277
+ getAuthMode(): LtAuthMode;
278
+ /** Merge `authMode` into the state cookie (keeps the user). */
279
+ setAuthMode(mode: LtAuthMode): void;
280
+ /**
281
+ * First JWT of the token cookie(s), or `null`. Browser only. A value that is not JWT-shaped (e.g. an opaque Better Auth
282
+ * session token an older version stored) is never returned and is deleted.
283
+ */
284
+ getJwtToken(): string | null;
285
+ /**
286
+ * Store or clear the JWT (7 days). Browser only. Only JWT-shaped values are accepted: the token cookie is readable by
287
+ * scripts, so an opaque session token (the body of `two-factor/*` or `passkey/*` answers) must never land there.
288
+ * Returns whether the value was stored.
289
+ */
290
+ setJwtToken(token: string | null): boolean;
291
+ /**
292
+ * Delete a stored token that is not JWT-shaped and fall back to cookie mode (run at startup in the browser). Returns
293
+ * whether something was purged.
294
+ */
295
+ purgeInvalidJwt(): boolean;
296
+ /** Whether any state cookie carries a user. */
297
+ isAuthenticated(): boolean;
298
+ /** The user from the state cookie. */
299
+ readUser(): LtUser | null;
300
+ /**
301
+ * Delete the auth-state and JWT cookies on the host-only and the `domain=<host>` slot, and best-effort the Better Auth
302
+ * cookies on the usual paths. Browser only.
303
+ */
304
+ clearAuthCookies(): void;
305
+ private deleteEverywhere;
306
+ static ɵfac: i0.ɵɵFactoryDeclaration<LtAuthStateService, never>;
307
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
308
+ }
309
+ /**
310
+ * Hooks around `signOut()`. `provideLtSync()` registers one that flushes the offline outbox before the session ends and
311
+ * deletes the IndexedDB afterwards; projects can add their own (multi provider).
312
+ */
313
+ interface LtAuthSignOutHook {
314
+ /** Runs before `POST /iam/sign-out` with the id of the signed-in user (errors are logged, never block sign-out). */
315
+ beforeSignOut?(userId: string | null): Promise<void> | void;
316
+ /** Runs after the local state was cleared. */
317
+ afterSignOut?(): Promise<void> | void;
318
+ }
319
+ /** Sign-out hooks (multi). */
320
+ export declare const LT_AUTH_SIGN_OUT_HOOKS: InjectionToken<LtAuthSignOutHook[]>;
321
+ /** TransferState key of the feature flags fetched during SSR. */
322
+ export declare const LT_AUTH_FEATURES_STATE_KEY: import("@angular/core").StateKey<LtAuthFeatures>;
323
+ /** Upper bound for `validateSession()` waiting on `GET /iam/get-session`. */
324
+ export declare const LT_VALIDATE_SESSION_TIMEOUT_MS = 10000;
325
+ /** What a sign-in / sign-up answer says (nest-server's own shape and Better Auth's native one). */
326
+ interface LtAuthAnswer {
327
+ /** Sign-up with email verification: nest-server revoked the session, nobody is signed in yet. */
328
+ emailVerificationRequired: boolean;
329
+ /** A JWT the server put into the body on purpose (`cookies: false` or `exposeTokenInBody` with the JWT plugin). */
330
+ jwt: string | null;
331
+ /** The answer proves a session (`success: true`, a token or a session object) and reports no failure. */
332
+ session: boolean;
333
+ /** A second factor is required (`requiresTwoFactor` from nest-server, `twoFactorRedirect` from Better Auth). */
334
+ twoFactor: boolean;
335
+ user: LtUserInput | null;
336
+ }
337
+ /**
338
+ * Read a sign-in / sign-up answer, either the Better Auth client envelope (`{ data, error }`) or a raw body.
339
+ *
340
+ * nest-server answers `{ requiresTwoFactor, success, user }` (the token is removed from the body while cookies are on),
341
+ * `{ requiresTwoFactor: true, success: false }` when 2FA is required and `{ emailVerificationRequired: true, user }`
342
+ * after a sign-up whose session it revoked. Better Auth's native answers carry `twoFactorRedirect` or
343
+ * `{ token: <opaque session token>, user }`. Only a JWT-shaped body token counts as JWT: an opaque session token never
344
+ * becomes a bearer kept in a script-readable cookie.
345
+ */
346
+ export declare function readLtAuthAnswer(result: unknown): LtAuthAnswer;
347
+ /**
348
+ * The light half of authentication: session state, transport and session validation, without Better Auth.
349
+ *
350
+ * Guards, `ltAuthInterceptor`, `provideLtAuth()` (and through it `LT_FETCH`) and offline sync use this store, so an
351
+ * app's initial bundle carries no passkey, 2FA or Better Auth code. `LtAuthService` (`@lenne.tech/ng-base/auth`)
352
+ * exposes the same state and methods and adds the Better Auth flows; both read and write the same signals.
353
+ *
354
+ * State is signal-based and backed by the client-readable `lt-auth-state` cookie, so SSR renders the signed-in shell
355
+ * from the request cookie (UI gating only; the session itself is the httpOnly `iam.session_token`). Transport: session
356
+ * cookie first; when cookies do not work (401 while the state says signed in) the store switches to JWT mode
357
+ * (`GET /iam/token`, Bearer header) and refreshes a stale JWT once per burst. nest-server with `cookies: false` answers
358
+ * every sign-in with a JWT, which puts the store into JWT mode directly; session checks never change the mode, and a
359
+ * JWT close to its expiry is refreshed with itself as bearer before it is sent.
360
+ */
361
+ export declare class LtAuthStore {
362
+ private readonly api;
363
+ private readonly authState;
364
+ private readonly options;
365
+ private readonly runtimeConfig;
366
+ private readonly transferState;
367
+ private readonly injector;
368
+ private readonly document;
369
+ private readonly signOutHooks;
370
+ private readonly isServer;
371
+ /** A non-JWT value in the JWT cookie (opaque session token from an older version) is deleted before anything reads it. */
372
+ private readonly purgedInvalidJwt;
373
+ private readonly initialState;
374
+ private readonly transferredFeatures;
375
+ private readonly userState;
376
+ private readonly modeState;
377
+ private readonly loadingState;
378
+ private readonly featuresState;
379
+ private featuresLoaded;
380
+ private featuresRequest;
381
+ /** In-flight `GET /token` shared by every 401 of a burst (cookie → JWT switch and stale-JWT refresh alike). */
382
+ private jwtMint;
383
+ private readonly sessionLoss;
384
+ /** Signed-in user (from the auth-state cookie, refreshed by `validateSession()` and every sign-in). */
385
+ readonly user: Signal<LtUser | null>;
386
+ /** Whether a user is signed in (UI gating; the backend decides). */
387
+ readonly isAuthenticated: Signal<boolean>;
388
+ /** Current transport. */
389
+ readonly authMode: Signal<LtAuthMode>;
390
+ /** Whether the JWT fallback is active. */
391
+ readonly isJwtMode: Signal<boolean>;
392
+ /** Whether a sign-in/up/out or passkey flow is running. */
393
+ readonly isLoading: Signal<boolean>;
394
+ /** Whether the user has the `admin` role (UX gate only). */
395
+ readonly isAdmin: Signal<boolean>;
396
+ /** Whether two-factor authentication is enabled for the user. */
397
+ readonly is2FAEnabled: Signal<boolean>;
398
+ /** nest-server feature flags (`GET /iam/features`); fetched on the server and transferred to the browser. */
399
+ readonly features: Signal<LtAuthFeatures>;
400
+ /** Whether passkeys can be used: enabled in the options, backend feature on and WebAuthn available in this browser. */
401
+ readonly passkeySupported: Signal<boolean>;
402
+ /** The current JWT (JWT mode only), or `null`. */
403
+ jwtToken(): string | null;
404
+ /** `user.role === role` or `user.roles` contains it (case-sensitive). */
405
+ hasRole(role: string): boolean;
406
+ /** Whether the user has any of the roles. */
407
+ hasAnyRole(...roles: string[]): boolean;
408
+ /**
409
+ * Fetch the feature flags (`GET /iam/features`, anonymous). One request in flight at a time; errors keep the last
410
+ * known flags. On the server the result is put into `TransferState` for the browser. SSR without API URL: no fetch.
411
+ */
412
+ fetchFeatures(): Promise<LtAuthFeatures>;
413
+ /** The feature flags, fetched at most once (transferred from SSR, or fetched on first call). */
414
+ ensureFeatures(): Promise<LtAuthFeatures>;
415
+ /** Store the user in state and cookie (browser always; SSR never writes). `image: null` becomes `undefined`. */
416
+ setUser(user: LtUserInput | null, mode?: LtAuthMode): void;
417
+ /** Clear local auth state and cookies (browser). Does not delete offline data (use `signOut()` for that). */
418
+ clearUser(): void;
419
+ /**
420
+ * Sign out: sign-out hooks (offline sync flush), `POST /iam/sign-out`, local state cleared, after-hooks (sync wipe).
421
+ * The request is a plain {@link fetchWithAuth} call, so signing out never loads Better Auth. The local state is
422
+ * cleared even when the request fails (offline device): the failure is logged, not thrown.
423
+ */
424
+ signOut(options?: LtAuthCallOptions): Promise<void>;
425
+ /**
426
+ * Validate the session (app start / hard reload). Server: answers from the cookie, no backend call. Browser:
427
+ * `GET /iam/get-session` (≤ 10 s, plain {@link fetchWithAuth}); a user is merged with the cached one
428
+ * (nest-server-only fields kept, authz keys fail-closed); no user but a cached one → `true` (e.g. right after 2FA);
429
+ * else `false`.
430
+ */
431
+ validateSession(): Promise<boolean>;
432
+ /**
433
+ * The auth-aware fetch (also provided as `LT_FETCH` by `provideLtAuth()` and used by the Better Auth client).
434
+ *
435
+ * For API URLs (see {@link isLtApiRequest}): cookie mode sends `credentials: 'include'`; JWT mode adds
436
+ * `Authorization: Bearer` and omits cookies except for passkey/2FA/`get-session` (an explicit `init.credentials`
437
+ * wins). On a 401 while signed in: cookie mode → switch to JWT and retry once; JWT mode → one shared refresh per
438
+ * burst and retry once. A 401 that survives is handed to the session-loss detection. Auth-flow endpoints
439
+ * (sign-in, 2FA, …) are never retried: their 401 is the flow's verdict. Other URLs are fetched unchanged (no token).
440
+ */
441
+ fetchWithAuth(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
442
+ /**
443
+ * Token to retry a request with after a 401, or `null` when no retry makes sense (server, auth-flow endpoint, not
444
+ * signed in, cookie-bound path in JWT mode, no token obtainable). `sentToken` is the bearer the request carried
445
+ * (`null` in cookie mode). Used by {@link fetchWithAuth} and `ltAuthInterceptor`.
446
+ */
447
+ recoverFrom401(url: string, sentToken: string | null): Promise<string | null>;
448
+ /** Session-loss handling for a 401 from `url` (see `LtUnauthorizedHandler`). */
449
+ handleUnauthorized(url?: string): Promise<boolean>;
450
+ /** `GET /iam/token` → store the JWT and switch to JWT mode. One request per burst. Browser only. */
451
+ switchToJwtMode(): Promise<boolean>;
452
+ /** Re-mint the JWT (JWT mode only). */
453
+ refreshJwtToken(): Promise<boolean>;
454
+ /**
455
+ * Build an absolute app URL from `NG_PUBLIC_SITE_URL` (or the browser origin), for `redirectTo` / `callbackURL`.
456
+ * Never derived from the request: on the server without a site URL it throws. Absolute input is returned unchanged.
457
+ */
458
+ absoluteAppUrl(path: string): string;
459
+ /** Full URL of a Better Auth route (`/get-session` → `<api>/iam/get-session`). */
460
+ authUrl(path: string): string;
461
+ /** Run `task` with `isLoading()` set. */
462
+ withLoading<T>(task: () => Promise<T>): Promise<T>;
463
+ /**
464
+ * Apply a sign-in / sign-up answer (see {@link readLtAuthAnswer}). No user is set when a second factor or an email
465
+ * verification is pending, or when the answer proves no session. A JWT-shaped body token → JWT mode; otherwise
466
+ * cookie mode plus a background JWT from `GET /iam/token` (cookie stays primary). `true` when a user was set.
467
+ */
468
+ applyAuthResult(result: unknown): boolean;
469
+ /**
470
+ * Take a session another flow already proved (2FA verification, passkey sign-in), as after a password sign-in:
471
+ * a JWT-shaped `token` in the answer (nest-server with `cookies: false` or `exposeTokenInBody`) → JWT mode; otherwise
472
+ * cookie mode plus a background JWT. Any other token is Better Auth's opaque session token and is never kept. An
473
+ * answer without user loads it from `GET /iam/get-session` (with the bearer in JWT mode). Resolves to the user, or
474
+ * `undefined` when no session could be loaded (local state then stays signed out).
475
+ */
476
+ adoptVerifiedSession(result: unknown): Promise<LtUser | undefined>;
477
+ /**
478
+ * Load the user via `GET /iam/get-session`, merge it with the cached one and store it, in `mode` (default: the
479
+ * current mode; the session answer proves the session, not the transport).
480
+ */
481
+ loadSessionUser(mode?: LtAuthMode): Promise<LtUser | undefined>;
482
+ /**
483
+ * The JWT to send (JWT mode only, else `null`), refreshed first when it expires within
484
+ * {@link LT_JWT_REFRESH_MARGIN_MS} (one refresh per burst; the old token is kept when the refresh fails).
485
+ */
486
+ currentJwt(): Promise<string | null>;
487
+ /** Whether the JWT of JWT mode expires within {@link LT_JWT_REFRESH_MARGIN_MS} (browser only). */
488
+ jwtNeedsRefresh(): boolean;
489
+ /**
490
+ * Navigate to `path` and keep the `redirect` query parameter of the current URL (login → 2FA must not lose where the
491
+ * user wanted to go). A `redirect` already in `path` wins; only app-relative targets (`/…`, not `//…`) are kept.
492
+ */
493
+ navigateKeepingRedirect(path: string): void;
494
+ /** Navigate within the app (Router when available, else a full page load in the browser). */
495
+ navigate(url: string): void;
496
+ /**
497
+ * Merge a session user onto the cached user of the SAME identity: nest-server-only fields survive, authorization
498
+ * keys always reflect the session. A different / absent / id-less identity yields the session user verbatim.
499
+ */
500
+ private mergeSessionUser;
501
+ /** Cached user: the duplicate-tolerant cookie view, else the in-memory state. */
502
+ private cachedUser;
503
+ /** `GET /iam/get-session` with the session cookie (bearer too in JWT mode); `null` without a session. */
504
+ private fetchSession;
505
+ /** Mint a JWT and switch to JWT mode; one `GET /token` per burst. */
506
+ private mintJwt;
507
+ /** Fetch a JWT in the background so it is ready as fallback; keeps the current mode (cookie stays primary). */
508
+ private prefetchJwt;
509
+ /**
510
+ * `GET <auth>/token` with the session cookie and, in JWT mode, the current JWT as bearer while it is still valid
511
+ * (with `cookies: false` the bearer is the only proof of the session); the token or `null`.
512
+ */
513
+ private requestJwt;
514
+ private loadFeatures;
515
+ private send;
516
+ private persistState;
517
+ private currentUrl;
518
+ static ɵfac: i0.ɵɵFactoryDeclaration<LtAuthStore, never>;
519
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
520
+ }
521
+ /** `user.role === role` or `user.roles` (array) contains it; malformed shapes → `false`. */
522
+ export declare function hasLtRole(user: LtUser | null | undefined, role: string): boolean;
523
+ /** Built-in route prefixes on which a 401 never logs out (auth pages). Extend via `provideLtAuth({ interceptor: { publicPaths } })`. */
524
+ export declare const LT_AUTH_PUBLIC_PATHS: readonly string[];
525
+ /** API path fragments whose 401 is part of a normal auth flow (never treated as session loss). */
526
+ export declare const LT_AUTH_ENDPOINT_FRAGMENTS: readonly string[];
527
+ /**
528
+ * Paths that need the session cookie even in JWT mode: passkey and 2FA challenges are bound to cookies, and
529
+ * `/get-session` resolves the session from the cookie only (a bearer-only request gets `200 null`, which the session
530
+ * probe would read as "dead" for every user in JWT mode).
531
+ */
532
+ export declare const LT_AUTH_COOKIE_PATHS: readonly string[];
533
+ /** Whether a 401 from `url` belongs to an auth flow (wrong password, wrong code, probe) rather than a lost session. */
534
+ export declare function isLtAuthEndpoint(url: string): boolean;
535
+ /**
536
+ * Whether `url` goes to the API, so it may carry credentials and the Bearer token:
537
+ *
538
+ * - it starts with the API base URL at a path boundary (`https://api.example.com` matches `https://api.example.com/x`,
539
+ * never `https://api.example.com.evil.test`);
540
+ * - or it is same-origin and starts with `/api` (dev proxy);
541
+ * - or no API URL is configured and it is same-origin (same-origin reverse proxy).
542
+ *
543
+ * Absolute URLs on `origin` are compared by their path. Foreign hosts never get the token.
544
+ */
545
+ export declare function isLtApiRequest(url: string, baseUrl: string, origin?: string | null): boolean;
546
+ /**
547
+ * Auth providers: options, the auth-aware `LT_FETCH` (Bearer in JWT mode, JWT switch/refresh, session-loss handling)
548
+ * used by error translation, AI, sync and the Better Auth client, session validation and feature flags at startup
549
+ * (features fetched on the server and transferred), and the user restored from the auth-state cookie.
550
+ *
551
+ * Startup: the server fetches the feature flags (bounded, anonymous) before rendering and transfers them; the browser
552
+ * takes them from `TransferState` (fetching only when nothing was transferred) and validates the session in the
553
+ * background, so the first render is never held up by the backend.
554
+ *
555
+ * Add `ltAuthInterceptor` to `provideHttpClient(withInterceptors([...]))` for `HttpClient` calls (generated API client).
556
+ */
557
+ export declare function provideLtAuth(options?: LtAuthOptions): EnvironmentProviders;
558
+ /** TransferState key of the setup status read during SSR. */
559
+ export declare const LT_SYSTEM_SETUP_STATE_KEY: import("@angular/core").StateKey<LtSystemSetupStatus>;
560
+ /** Header that carries the setup token. Sent unhashed and never in the body (the server compares it as given). */
561
+ export declare const LT_SYSTEM_SETUP_TOKEN_HEADER = "X-System-Setup-Token";
562
+ /**
563
+ * Error thrown by `initSetup()` for a non-2xx answer. `data` is the response body, so
564
+ * `LtErrorTranslationService.translateError(error)` reads its `#LTNS_xxxx` code (`LTNS_0053` HTTP setup disabled,
565
+ * `LTNS_0054` wrong token).
566
+ */
567
+ interface LtSystemSetupError extends Error {
568
+ data: unknown;
569
+ status: number;
570
+ statusCode: number;
571
+ }
572
+ /**
573
+ * First-admin setup of nest-server (`/system-setup/*`), the counterpart of `useSystemSetup()`.
574
+ * Status is fetched once and transferred SSR → browser.
575
+ */
576
+ export declare class LtSystemSetupService {
577
+ private readonly api;
578
+ private readonly fetch;
579
+ private readonly transferState;
580
+ private readonly isServer;
581
+ private readonly transferred;
582
+ private readonly needsSetupState;
583
+ private readonly httpInitEnabledState;
584
+ private readonly httpInitTokenRequiredState;
585
+ private statusRequest;
586
+ /** `true` when no admin exists yet; `null` until checked. */
587
+ readonly needsSetup: import("@angular/core").Signal<boolean | null>;
588
+ /** Whether HTTP init is open (nest-server ≥ 12.4; `true` for older APIs); `null` until checked. */
589
+ readonly httpInitEnabled: import("@angular/core").Signal<boolean | null>;
590
+ /** Whether HTTP init requires `X-System-Setup-Token`; `null` until checked. */
591
+ readonly httpInitTokenRequired: import("@angular/core").Signal<boolean | null>;
592
+ /** `GET /system-setup/status`. Errors/404 → `needsSetup = false`. SSR without API URL → `false` without fetching. */
593
+ checkSetupStatus(): Promise<LtSystemSetupStatus>;
594
+ /**
595
+ * `POST /system-setup/init` with `{ email, password: sha256, name }`; the token (trimmed, unhashed) goes into
596
+ * `X-System-Setup-Token`. On 403 the status is re-read and the error rethrown (`LTNS_0053` disabled, `LTNS_0054` wrong token).
597
+ */
598
+ initSetup(input: LtSystemSetupInput): Promise<void>;
599
+ private loadStatus;
600
+ static ɵfac: i0.ɵɵFactoryDeclaration<LtSystemSetupService, never>;
601
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
602
+ }
603
+ export type { LtAuthAnswer, LtAuthCallOptions, LtAuthCookieNamesOptions, LtAuthError, LtAuthFeatures, LtAuthMode, LtAuthOptions, LtAuthResponse, LtAuthResponseData, LtAuthSignOutHook, LtAuthState, LtNoStrayCredential, LtPasskey, LtPasskeyAuthResult, LtPasskeyRegisterResult, LtResolvedAuthOptions, LtSystemSetupError, LtSystemSetupInput, LtSystemSetupStatus, LtTwoFactorEnableResult, LtUser, LtUserInput };