@acorex-platform/module-security-management-server 0.0.18 → 2.0.0-next.42

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 (453) hide show
  1. package/contracts/src/AXM_USER_ACCESS_STATE_DEFINITION_KEY.js.map +1 -1
  2. package/contracts/src/AXM_USER_EFFECTIVE_STATE_DEFINITION_KEY.js.map +1 -1
  3. package/contracts/src/ROLE_PERMISSIONS_PAGE_COMPONENT_KEY.d.ts +2 -0
  4. package/contracts/src/ROLE_PERMISSIONS_PAGE_COMPONENT_KEY.js +6 -0
  5. package/contracts/src/ROLE_PERMISSIONS_PAGE_COMPONENT_KEY.js.map +1 -0
  6. package/contracts/src/USER_ROLES_PAGE_COMPONENT_KEY.d.ts +1 -0
  7. package/contracts/src/USER_ROLES_PAGE_COMPONENT_KEY.js +5 -0
  8. package/contracts/src/USER_ROLES_PAGE_COMPONENT_KEY.js.map +1 -0
  9. package/contracts/src/create-application-role-rows.util.d.ts +15 -0
  10. package/contracts/src/create-application-role-rows.util.js +67 -0
  11. package/contracts/src/create-application-role-rows.util.js.map +1 -0
  12. package/contracts/src/device-session-admin-scope.d.ts +15 -0
  13. package/contracts/src/device-session-admin-scope.js +16 -0
  14. package/contracts/src/device-session-admin-scope.js.map +1 -0
  15. package/contracts/src/entities/device-sessions/device-sessions.entity.js +50 -1
  16. package/contracts/src/entities/device-sessions/device-sessions.entity.js.map +1 -1
  17. package/contracts/src/entities/device-sessions/device-sessions.types.d.ts +7 -0
  18. package/contracts/src/entities/device-sessions/device-sessions.types.js.map +1 -1
  19. package/contracts/src/entities/device-sessions/index.d.ts +0 -1
  20. package/contracts/src/entities/device-sessions/index.js +0 -1
  21. package/contracts/src/entities/device-sessions/index.js.map +1 -1
  22. package/contracts/src/entities/identity-provider/identity-provider.entity.d.ts +2 -0
  23. package/contracts/src/entities/identity-provider/identity-provider.entity.js +453 -0
  24. package/contracts/src/entities/identity-provider/identity-provider.entity.js.map +1 -0
  25. package/contracts/src/entities/identity-provider/identity-provider.types.d.ts +61 -0
  26. package/contracts/src/entities/identity-provider/identity-provider.types.js +14 -0
  27. package/contracts/src/entities/identity-provider/identity-provider.types.js.map +1 -0
  28. package/contracts/src/entities/identity-provider/index.d.ts +1 -0
  29. package/contracts/src/entities/identity-provider/index.js +5 -0
  30. package/contracts/src/entities/identity-provider/index.js.map +1 -0
  31. package/contracts/src/entities/index.d.ts +4 -0
  32. package/contracts/src/entities/index.js +4 -0
  33. package/contracts/src/entities/index.js.map +1 -1
  34. package/contracts/src/entities/policy/index.d.ts +0 -1
  35. package/contracts/src/entities/policy/index.js +0 -1
  36. package/contracts/src/entities/policy/index.js.map +1 -1
  37. package/contracts/src/entities/policy/policy.entity.js +15 -0
  38. package/contracts/src/entities/policy/policy.entity.js.map +1 -1
  39. package/contracts/src/entities/policy/policy.types.js.map +1 -1
  40. package/contracts/src/entities/profile/index.d.ts +0 -1
  41. package/contracts/src/entities/profile/index.js +0 -1
  42. package/contracts/src/entities/profile/index.js.map +1 -1
  43. package/contracts/src/entities/profile/profile.entity.js +15 -0
  44. package/contracts/src/entities/profile/profile.entity.js.map +1 -1
  45. package/contracts/src/entities/profile/profile.types.js.map +1 -1
  46. package/contracts/src/entities/role-permission/index.d.ts +1 -0
  47. package/contracts/src/entities/role-permission/index.js +5 -0
  48. package/contracts/src/entities/role-permission/index.js.map +1 -0
  49. package/contracts/src/entities/role-permission/role-permission.entity.d.ts +2 -0
  50. package/contracts/src/entities/role-permission/role-permission.entity.js +163 -0
  51. package/contracts/src/entities/role-permission/role-permission.entity.js.map +1 -0
  52. package/contracts/src/entities/role-permission/role-permission.types.d.ts +11 -0
  53. package/contracts/src/entities/role-permission/role-permission.types.js +5 -0
  54. package/contracts/src/entities/role-permission/role-permission.types.js.map +1 -0
  55. package/contracts/src/entities/roles/index.d.ts +0 -1
  56. package/contracts/src/entities/roles/index.js +0 -1
  57. package/contracts/src/entities/roles/index.js.map +1 -1
  58. package/contracts/src/entities/roles/roles.entity.js +73 -144
  59. package/contracts/src/entities/roles/roles.entity.js.map +1 -1
  60. package/contracts/src/entities/roles/roles.types.d.ts +4 -1
  61. package/contracts/src/entities/roles/roles.types.js.map +1 -1
  62. package/contracts/src/entities/user-role/index.d.ts +1 -0
  63. package/{src/lib/seed/tenant → contracts/src/entities/user-role}/index.js +1 -1
  64. package/contracts/src/entities/user-role/index.js.map +1 -0
  65. package/contracts/src/entities/user-role/user-role.entity.d.ts +2 -0
  66. package/contracts/src/entities/user-role/user-role.entity.js +164 -0
  67. package/contracts/src/entities/user-role/user-role.entity.js.map +1 -0
  68. package/contracts/src/entities/user-role/user-role.types.d.ts +11 -0
  69. package/contracts/src/entities/user-role/user-role.types.js +5 -0
  70. package/contracts/src/entities/user-role/user-role.types.js.map +1 -0
  71. package/contracts/src/entities/user-two-factor/index.d.ts +2 -0
  72. package/contracts/src/entities/user-two-factor/index.js +8 -0
  73. package/contracts/src/entities/user-two-factor/index.js.map +1 -0
  74. package/contracts/src/entities/user-two-factor/user-two-factor.entity.d.ts +6 -0
  75. package/contracts/src/entities/user-two-factor/user-two-factor.entity.js +103 -0
  76. package/contracts/src/entities/user-two-factor/user-two-factor.entity.js.map +1 -0
  77. package/contracts/src/entities/user-two-factor/user-two-factor.types.d.ts +24 -0
  78. package/contracts/src/entities/user-two-factor/user-two-factor.types.js +4 -0
  79. package/contracts/src/entities/user-two-factor/user-two-factor.types.js.map +1 -0
  80. package/contracts/src/entities/users/index.d.ts +1 -1
  81. package/contracts/src/entities/users/index.js +1 -1
  82. package/contracts/src/entities/users/index.js.map +1 -1
  83. package/contracts/src/entities/users/user-provisioning-list-actions.d.ts +8 -0
  84. package/contracts/src/entities/users/user-provisioning-list-actions.js +95 -0
  85. package/contracts/src/entities/users/user-provisioning-list-actions.js.map +1 -0
  86. package/contracts/src/entities/users/users.entity.js +244 -83
  87. package/contracts/src/entities/users/users.entity.js.map +1 -1
  88. package/contracts/src/entities/users/users.types.d.ts +15 -0
  89. package/contracts/src/entities/users/users.types.js.map +1 -1
  90. package/contracts/src/entity-catalog.d.ts +7 -0
  91. package/contracts/src/entity-catalog.js +28 -0
  92. package/contracts/src/entity-catalog.js.map +1 -0
  93. package/contracts/src/entity-entry.device-sessions.d.ts +1 -0
  94. package/contracts/src/entity-entry.device-sessions.js +6 -0
  95. package/contracts/src/entity-entry.device-sessions.js.map +1 -0
  96. package/contracts/src/entity-entry.identity-provider.d.ts +1 -0
  97. package/contracts/src/entity-entry.identity-provider.js +6 -0
  98. package/contracts/src/entity-entry.identity-provider.js.map +1 -0
  99. package/contracts/src/entity-entry.policy.d.ts +1 -0
  100. package/contracts/src/entity-entry.policy.js +6 -0
  101. package/contracts/src/entity-entry.policy.js.map +1 -0
  102. package/contracts/src/entity-entry.profile.d.ts +1 -0
  103. package/contracts/src/entity-entry.profile.js +6 -0
  104. package/contracts/src/entity-entry.profile.js.map +1 -0
  105. package/contracts/src/entity-entry.role-permission.d.ts +1 -0
  106. package/contracts/src/entity-entry.role-permission.js +6 -0
  107. package/contracts/src/entity-entry.role-permission.js.map +1 -0
  108. package/contracts/src/entity-entry.roles.d.ts +1 -0
  109. package/contracts/src/entity-entry.roles.js +6 -0
  110. package/contracts/src/entity-entry.roles.js.map +1 -0
  111. package/contracts/src/entity-entry.user-role.d.ts +1 -0
  112. package/contracts/src/entity-entry.user-role.js +6 -0
  113. package/contracts/src/entity-entry.user-role.js.map +1 -0
  114. package/contracts/src/entity-entry.user-two-factor.d.ts +1 -0
  115. package/contracts/src/entity-entry.user-two-factor.js +6 -0
  116. package/contracts/src/entity-entry.user-two-factor.js.map +1 -0
  117. package/contracts/src/entity-entry.users.d.ts +1 -0
  118. package/contracts/src/entity-entry.users.js +6 -0
  119. package/contracts/src/entity-entry.users.js.map +1 -0
  120. package/contracts/src/features.keys.d.ts +4 -0
  121. package/contracts/src/features.keys.js +4 -0
  122. package/contracts/src/features.keys.js.map +1 -1
  123. package/contracts/src/index.d.ts +10 -1
  124. package/contracts/src/index.js +10 -1
  125. package/contracts/src/index.js.map +1 -1
  126. package/contracts/src/invite-application-role-rows.util.d.ts +16 -0
  127. package/contracts/src/invite-application-role-rows.util.js +68 -0
  128. package/contracts/src/invite-application-role-rows.util.js.map +1 -0
  129. package/contracts/src/invite-assignable-roles.util.d.ts +34 -0
  130. package/contracts/src/invite-assignable-roles.util.js +75 -0
  131. package/contracts/src/invite-assignable-roles.util.js.map +1 -0
  132. package/contracts/src/lib/context.definitions.d.ts +2 -0
  133. package/contracts/src/lib/context.definitions.js +15 -0
  134. package/contracts/src/lib/context.definitions.js.map +1 -0
  135. package/contracts/src/manifest.d.ts +6 -0
  136. package/contracts/src/manifest.js +24 -0
  137. package/contracts/src/manifest.js.map +1 -0
  138. package/contracts/src/menu.keys.d.ts +1 -0
  139. package/contracts/src/menu.keys.js +1 -0
  140. package/contracts/src/menu.keys.js.map +1 -1
  141. package/contracts/src/permission.keys.d.ts +48 -18
  142. package/contracts/src/permission.keys.js +49 -21
  143. package/contracts/src/permission.keys.js.map +1 -1
  144. package/contracts/src/resolve-user-effective-state.js.map +1 -1
  145. package/contracts/src/root-config.d.ts +33 -0
  146. package/contracts/src/root-config.js +33 -0
  147. package/contracts/src/root-config.js.map +1 -1
  148. package/contracts/src/server-commands.d.ts +322 -0
  149. package/contracts/src/server-commands.js +77 -1
  150. package/contracts/src/server-commands.js.map +1 -1
  151. package/contracts/src/settings.keys.d.ts +16 -0
  152. package/contracts/src/settings.keys.js +21 -0
  153. package/contracts/src/settings.keys.js.map +1 -0
  154. package/contracts/src/user-access-state.js.map +1 -1
  155. package/contracts/src/user-effective-state.js.map +1 -1
  156. package/contracts/src/user-invitation.d.ts +41 -0
  157. package/contracts/src/user-invitation.js +18 -0
  158. package/contracts/src/user-invitation.js.map +1 -0
  159. package/contracts/src/user-password-reset.js.map +1 -1
  160. package/package.json +16 -18
  161. package/server/src/index.d.ts +3 -0
  162. package/server/src/index.js +11 -0
  163. package/server/src/index.js.map +1 -0
  164. package/server/src/lib/effective-access-history/effective-access-history.service.d.ts +35 -0
  165. package/server/src/lib/effective-access-history/effective-access-history.service.js +486 -0
  166. package/server/src/lib/effective-access-history/effective-access-history.service.js.map +1 -0
  167. package/server/src/lib/effective-access-history/effective-access-history.types.d.ts +64 -0
  168. package/server/src/lib/effective-access-history/effective-access-history.types.js +5 -0
  169. package/server/src/lib/effective-access-history/effective-access-history.types.js.map +1 -0
  170. package/server/src/lib/effective-access-history/version-as-of.util.d.ts +37 -0
  171. package/server/src/lib/effective-access-history/version-as-of.util.js +167 -0
  172. package/server/src/lib/effective-access-history/version-as-of.util.js.map +1 -0
  173. package/server/src/lib/entities/index.d.ts +1 -0
  174. package/server/src/lib/entities/index.js +5 -0
  175. package/{src/lib/seed/tenant → server/src/lib/entities}/index.js.map +1 -1
  176. package/server/src/lib/entities/security-management.entity-catalog.d.ts +1 -0
  177. package/server/src/lib/entities/security-management.entity-catalog.js +12 -0
  178. package/server/src/lib/entities/security-management.entity-catalog.js.map +1 -0
  179. package/server/src/lib/handlers/security-report.handlers.d.ts +36 -0
  180. package/server/src/lib/handlers/security-report.handlers.js +164 -0
  181. package/server/src/lib/handlers/security-report.handlers.js.map +1 -0
  182. package/server/src/lib/identity-provider/auth-oauth-clients.constants.d.ts +5 -0
  183. package/server/src/lib/identity-provider/auth-oauth-clients.constants.js +11 -0
  184. package/server/src/lib/identity-provider/auth-oauth-clients.constants.js.map +1 -0
  185. package/server/src/lib/identity-provider/identity-provider-catalog.service.d.ts +20 -0
  186. package/server/src/lib/identity-provider/identity-provider-catalog.service.js +169 -0
  187. package/server/src/lib/identity-provider/identity-provider-catalog.service.js.map +1 -0
  188. package/server/src/lib/identity-provider/identity-provider-ids.constants.d.ts +8 -0
  189. package/server/src/lib/identity-provider/identity-provider-ids.constants.js +19 -0
  190. package/server/src/lib/identity-provider/identity-provider-ids.constants.js.map +1 -0
  191. package/server/src/lib/identity-provider/identity-provider-stub.bootstrap.d.ts +12 -0
  192. package/server/src/lib/identity-provider/identity-provider-stub.bootstrap.js +48 -0
  193. package/server/src/lib/identity-provider/identity-provider-stub.bootstrap.js.map +1 -0
  194. package/server/src/lib/identity-provider/identity-provider.constants.d.ts +1 -0
  195. package/server/src/lib/identity-provider/identity-provider.constants.js +7 -0
  196. package/server/src/lib/identity-provider/identity-provider.constants.js.map +1 -0
  197. package/server/src/lib/middlewares/device-sessions-active.middleware.d.ts +15 -0
  198. package/server/src/lib/middlewares/device-sessions-active.middleware.js +76 -0
  199. package/server/src/lib/middlewares/device-sessions-active.middleware.js.map +1 -0
  200. package/server/src/lib/middlewares/device-sessions-app-scope.middleware.d.ts +29 -0
  201. package/server/src/lib/middlewares/device-sessions-app-scope.middleware.js +137 -0
  202. package/server/src/lib/middlewares/device-sessions-app-scope.middleware.js.map +1 -0
  203. package/server/src/lib/middlewares/device-sessions-app-scope.util.d.ts +41 -0
  204. package/server/src/lib/middlewares/device-sessions-app-scope.util.js +69 -0
  205. package/server/src/lib/middlewares/device-sessions-app-scope.util.js.map +1 -0
  206. package/server/src/lib/middlewares/device-sessions-token-revoke.middleware.d.ts +18 -0
  207. package/server/src/lib/middlewares/device-sessions-token-revoke.middleware.js +90 -0
  208. package/server/src/lib/middlewares/device-sessions-token-revoke.middleware.js.map +1 -0
  209. package/server/src/lib/middlewares/user-assigned-roles.middleware.d.ts +36 -0
  210. package/server/src/lib/middlewares/user-assigned-roles.middleware.js +359 -0
  211. package/server/src/lib/middlewares/user-assigned-roles.middleware.js.map +1 -0
  212. package/{src → server/src}/lib/middlewares/user-effective-state.middleware.js +1 -1
  213. package/server/src/lib/middlewares/user-effective-state.middleware.js.map +1 -0
  214. package/server/src/lib/middlewares/user-invitation-list.middleware.d.ts +32 -0
  215. package/server/src/lib/middlewares/user-invitation-list.middleware.js +250 -0
  216. package/server/src/lib/middlewares/user-invitation-list.middleware.js.map +1 -0
  217. package/server/src/lib/middlewares/user-profile-write.middleware.d.ts +18 -0
  218. package/server/src/lib/middlewares/user-profile-write.middleware.js +206 -0
  219. package/server/src/lib/middlewares/user-profile-write.middleware.js.map +1 -0
  220. package/server/src/lib/password-reset/change-own-password.command.d.ts +8 -0
  221. package/server/src/lib/password-reset/change-own-password.command.js +38 -0
  222. package/server/src/lib/password-reset/change-own-password.command.js.map +1 -0
  223. package/{src → server/src}/lib/password-reset/complete-password-reset.command.d.ts +3 -4
  224. package/{src → server/src}/lib/password-reset/complete-password-reset.command.js +8 -12
  225. package/server/src/lib/password-reset/complete-password-reset.command.js.map +1 -0
  226. package/server/src/lib/password-reset/get-own-password-status.command.d.ts +8 -0
  227. package/server/src/lib/password-reset/get-own-password-status.command.js +31 -0
  228. package/server/src/lib/password-reset/get-own-password-status.command.js.map +1 -0
  229. package/{src → server/src}/lib/password-reset/send-password-reset-email.command.d.ts +12 -13
  230. package/{src → server/src}/lib/password-reset/send-password-reset-email.command.js +10 -15
  231. package/server/src/lib/password-reset/send-password-reset-email.command.js.map +1 -0
  232. package/server/src/lib/password-reset/user-change-password.service.d.ts +24 -0
  233. package/server/src/lib/password-reset/user-change-password.service.js +92 -0
  234. package/server/src/lib/password-reset/user-change-password.service.js.map +1 -0
  235. package/{src → server/src}/lib/password-reset/user-password-reset.service.d.ts +2 -7
  236. package/{src → server/src}/lib/password-reset/user-password-reset.service.js +29 -90
  237. package/server/src/lib/password-reset/user-password-reset.service.js.map +1 -0
  238. package/server/src/lib/queries/get-permission-holders-history.query.d.ts +4 -0
  239. package/server/src/lib/queries/get-permission-holders-history.query.definition.d.ts +5 -0
  240. package/server/src/lib/queries/get-permission-holders-history.query.definition.js +38 -0
  241. package/server/src/lib/queries/get-permission-holders-history.query.definition.js.map +1 -0
  242. package/server/src/lib/queries/get-permission-holders-history.query.js +25 -0
  243. package/server/src/lib/queries/get-permission-holders-history.query.js.map +1 -0
  244. package/server/src/lib/queries/get-role-holders-history.query.d.ts +4 -0
  245. package/server/src/lib/queries/get-role-holders-history.query.definition.d.ts +5 -0
  246. package/server/src/lib/queries/get-role-holders-history.query.definition.js +38 -0
  247. package/server/src/lib/queries/get-role-holders-history.query.definition.js.map +1 -0
  248. package/server/src/lib/queries/get-role-holders-history.query.js +25 -0
  249. package/server/src/lib/queries/get-role-holders-history.query.js.map +1 -0
  250. package/server/src/lib/queries/get-user-effective-permissions-history.query.d.ts +4 -0
  251. package/server/src/lib/queries/get-user-effective-permissions-history.query.definition.d.ts +5 -0
  252. package/server/src/lib/queries/get-user-effective-permissions-history.query.definition.js +35 -0
  253. package/server/src/lib/queries/get-user-effective-permissions-history.query.definition.js.map +1 -0
  254. package/server/src/lib/queries/get-user-effective-permissions-history.query.js +26 -0
  255. package/server/src/lib/queries/get-user-effective-permissions-history.query.js.map +1 -0
  256. package/server/src/lib/queries/get-user-effective-roles-history.query.d.ts +4 -0
  257. package/server/src/lib/queries/get-user-effective-roles-history.query.definition.d.ts +5 -0
  258. package/server/src/lib/queries/get-user-effective-roles-history.query.definition.js +36 -0
  259. package/server/src/lib/queries/get-user-effective-roles-history.query.definition.js.map +1 -0
  260. package/server/src/lib/queries/get-user-effective-roles-history.query.js +25 -0
  261. package/server/src/lib/queries/get-user-effective-roles-history.query.js.map +1 -0
  262. package/server/src/lib/queries/get-user-password-change-history.query.d.ts +4 -0
  263. package/server/src/lib/queries/get-user-password-change-history.query.definition.d.ts +5 -0
  264. package/server/src/lib/queries/get-user-password-change-history.query.definition.js +33 -0
  265. package/server/src/lib/queries/get-user-password-change-history.query.definition.js.map +1 -0
  266. package/server/src/lib/queries/get-user-password-change-history.query.js +23 -0
  267. package/server/src/lib/queries/get-user-password-change-history.query.js.map +1 -0
  268. package/server/src/lib/queries/security-query.helpers.d.ts +47 -0
  269. package/server/src/lib/queries/security-query.helpers.js +184 -0
  270. package/server/src/lib/queries/security-query.helpers.js.map +1 -0
  271. package/server/src/lib/reports/password-change-history.service.d.ts +14 -0
  272. package/server/src/lib/reports/password-change-history.service.js +74 -0
  273. package/server/src/lib/reports/password-change-history.service.js.map +1 -0
  274. package/server/src/lib/reports/permission-display-catalog.d.ts +7 -0
  275. package/server/src/lib/reports/permission-display-catalog.js +101 -0
  276. package/server/src/lib/reports/permission-display-catalog.js.map +1 -0
  277. package/server/src/lib/reports/security-report-definition.provider.d.ts +5 -0
  278. package/server/src/lib/reports/security-report-definition.provider.js +23 -0
  279. package/server/src/lib/reports/security-report-definition.provider.js.map +1 -0
  280. package/server/src/lib/reports/security-report-parameter-groups.d.ts +343 -0
  281. package/server/src/lib/reports/security-report-parameter-groups.js +167 -0
  282. package/server/src/lib/reports/security-report-parameter-groups.js.map +1 -0
  283. package/server/src/lib/reports/security-report-scope.constants.d.ts +5 -0
  284. package/server/src/lib/reports/security-report-scope.constants.js +11 -0
  285. package/server/src/lib/reports/security-report-scope.constants.js.map +1 -0
  286. package/server/src/lib/reports/security-report.definitions.d.ts +12 -0
  287. package/server/src/lib/reports/security-report.definitions.js +386 -0
  288. package/server/src/lib/reports/security-report.definitions.js.map +1 -0
  289. package/server/src/lib/security-management-entity-storage.bootstrap.d.ts +26 -0
  290. package/server/src/lib/security-management-entity-storage.bootstrap.js +56 -0
  291. package/server/src/lib/security-management-entity-storage.bootstrap.js.map +1 -0
  292. package/server/src/lib/security-management-server.module.d.ts +7 -0
  293. package/server/src/lib/security-management-server.module.js +190 -0
  294. package/server/src/lib/security-management-server.module.js.map +1 -0
  295. package/server/src/lib/two-factor/admin-reset-two-factor.command.d.ts +8 -0
  296. package/server/src/lib/two-factor/admin-reset-two-factor.command.js +35 -0
  297. package/server/src/lib/two-factor/admin-reset-two-factor.command.js.map +1 -0
  298. package/server/src/lib/two-factor/confirm-two-factor-enrollment.command.d.ts +8 -0
  299. package/server/src/lib/two-factor/confirm-two-factor-enrollment.command.js +34 -0
  300. package/server/src/lib/two-factor/confirm-two-factor-enrollment.command.js.map +1 -0
  301. package/server/src/lib/two-factor/disable-two-factor.command.d.ts +8 -0
  302. package/server/src/lib/two-factor/disable-two-factor.command.js +31 -0
  303. package/server/src/lib/two-factor/disable-two-factor.command.js.map +1 -0
  304. package/server/src/lib/two-factor/generate-two-factor-recovery-codes.command.d.ts +8 -0
  305. package/server/src/lib/two-factor/generate-two-factor-recovery-codes.command.js +34 -0
  306. package/server/src/lib/two-factor/generate-two-factor-recovery-codes.command.js.map +1 -0
  307. package/server/src/lib/two-factor/get-two-factor-status.command.d.ts +8 -0
  308. package/server/src/lib/two-factor/get-two-factor-status.command.js +31 -0
  309. package/server/src/lib/two-factor/get-two-factor-status.command.js.map +1 -0
  310. package/server/src/lib/two-factor/recovery-codes.util.d.ts +11 -0
  311. package/server/src/lib/two-factor/recovery-codes.util.js +73 -0
  312. package/server/src/lib/two-factor/recovery-codes.util.js.map +1 -0
  313. package/server/src/lib/two-factor/start-two-factor-enrollment.command.d.ts +8 -0
  314. package/server/src/lib/two-factor/start-two-factor-enrollment.command.js +31 -0
  315. package/server/src/lib/two-factor/start-two-factor-enrollment.command.js.map +1 -0
  316. package/server/src/lib/two-factor/totp.util.d.ts +32 -0
  317. package/server/src/lib/two-factor/totp.util.js +128 -0
  318. package/server/src/lib/two-factor/totp.util.js.map +1 -0
  319. package/server/src/lib/two-factor/two-factor-encryption.util.d.ts +25 -0
  320. package/server/src/lib/two-factor/two-factor-encryption.util.js +123 -0
  321. package/server/src/lib/two-factor/two-factor-encryption.util.js.map +1 -0
  322. package/server/src/lib/two-factor/two-factor-gate.bootstrap.d.ts +9 -0
  323. package/server/src/lib/two-factor/two-factor-gate.bootstrap.js +65 -0
  324. package/server/src/lib/two-factor/two-factor-gate.bootstrap.js.map +1 -0
  325. package/server/src/lib/two-factor/two-factor-redis.store.d.ts +63 -0
  326. package/server/src/lib/two-factor/two-factor-redis.store.js +321 -0
  327. package/server/src/lib/two-factor/two-factor-redis.store.js.map +1 -0
  328. package/server/src/lib/two-factor/user-two-factor.service.d.ts +62 -0
  329. package/server/src/lib/two-factor/user-two-factor.service.js +573 -0
  330. package/server/src/lib/two-factor/user-two-factor.service.js.map +1 -0
  331. package/server/src/lib/two-factor/verify-two-factor-login.command.d.ts +18 -0
  332. package/server/src/lib/two-factor/verify-two-factor-login.command.js +54 -0
  333. package/server/src/lib/two-factor/verify-two-factor-login.command.js.map +1 -0
  334. package/server/src/lib/user-invitation/accept-invitation.command.d.ts +8 -0
  335. package/server/src/lib/user-invitation/accept-invitation.command.js +41 -0
  336. package/server/src/lib/user-invitation/accept-invitation.command.js.map +1 -0
  337. package/server/src/lib/user-invitation/accept-my-invitation.command.d.ts +8 -0
  338. package/server/src/lib/user-invitation/accept-my-invitation.command.js +40 -0
  339. package/server/src/lib/user-invitation/accept-my-invitation.command.js.map +1 -0
  340. package/server/src/lib/user-invitation/approve-join-request.command.d.ts +8 -0
  341. package/server/src/lib/user-invitation/approve-join-request.command.js +41 -0
  342. package/server/src/lib/user-invitation/approve-join-request.command.js.map +1 -0
  343. package/server/src/lib/user-invitation/cancel-invitation.command.d.ts +8 -0
  344. package/server/src/lib/user-invitation/cancel-invitation.command.js +37 -0
  345. package/server/src/lib/user-invitation/cancel-invitation.command.js.map +1 -0
  346. package/server/src/lib/user-invitation/cancel-my-join-request.command.d.ts +8 -0
  347. package/server/src/lib/user-invitation/cancel-my-join-request.command.js +40 -0
  348. package/server/src/lib/user-invitation/cancel-my-join-request.command.js.map +1 -0
  349. package/server/src/lib/user-invitation/create-user-in-tenant.command.d.ts +8 -0
  350. package/server/src/lib/user-invitation/create-user-in-tenant.command.js +37 -0
  351. package/server/src/lib/user-invitation/create-user-in-tenant.command.js.map +1 -0
  352. package/server/src/lib/user-invitation/decline-invitation.command.d.ts +8 -0
  353. package/server/src/lib/user-invitation/decline-invitation.command.js +37 -0
  354. package/server/src/lib/user-invitation/decline-invitation.command.js.map +1 -0
  355. package/server/src/lib/user-invitation/invite-user.command.d.ts +8 -0
  356. package/server/src/lib/user-invitation/invite-user.command.js +37 -0
  357. package/server/src/lib/user-invitation/invite-user.command.js.map +1 -0
  358. package/server/src/lib/user-invitation/list-invite-assignable-roles.command.d.ts +8 -0
  359. package/server/src/lib/user-invitation/list-invite-assignable-roles.command.js +41 -0
  360. package/server/src/lib/user-invitation/list-invite-assignable-roles.command.js.map +1 -0
  361. package/server/src/lib/user-invitation/list-my-join-requests.command.d.ts +8 -0
  362. package/server/src/lib/user-invitation/list-my-join-requests.command.js +40 -0
  363. package/server/src/lib/user-invitation/list-my-join-requests.command.js.map +1 -0
  364. package/server/src/lib/user-invitation/list-my-pending-invitations.command.d.ts +8 -0
  365. package/server/src/lib/user-invitation/list-my-pending-invitations.command.js +37 -0
  366. package/server/src/lib/user-invitation/list-my-pending-invitations.command.js.map +1 -0
  367. package/server/src/lib/user-invitation/list-tenant-entitled-applications.command.d.ts +8 -0
  368. package/server/src/lib/user-invitation/list-tenant-entitled-applications.command.js +41 -0
  369. package/server/src/lib/user-invitation/list-tenant-entitled-applications.command.js.map +1 -0
  370. package/server/src/lib/user-invitation/lookup-tenant-by-unique-name.command.d.ts +8 -0
  371. package/server/src/lib/user-invitation/lookup-tenant-by-unique-name.command.js +40 -0
  372. package/server/src/lib/user-invitation/lookup-tenant-by-unique-name.command.js.map +1 -0
  373. package/server/src/lib/user-invitation/reject-join-request.command.d.ts +8 -0
  374. package/server/src/lib/user-invitation/reject-join-request.command.js +41 -0
  375. package/server/src/lib/user-invitation/reject-join-request.command.js.map +1 -0
  376. package/server/src/lib/user-invitation/request-tenant-membership.command.d.ts +8 -0
  377. package/server/src/lib/user-invitation/request-tenant-membership.command.js +40 -0
  378. package/server/src/lib/user-invitation/request-tenant-membership.command.js.map +1 -0
  379. package/server/src/lib/user-invitation/resend-invitation.command.d.ts +12 -0
  380. package/server/src/lib/user-invitation/resend-invitation.command.js +37 -0
  381. package/server/src/lib/user-invitation/resend-invitation.command.js.map +1 -0
  382. package/server/src/lib/user-invitation/user-invitation-application-access.util.d.ts +25 -0
  383. package/server/src/lib/user-invitation/user-invitation-application-access.util.js +121 -0
  384. package/server/src/lib/user-invitation/user-invitation-application-access.util.js.map +1 -0
  385. package/server/src/lib/user-invitation/user-invitation.service.d.ts +162 -0
  386. package/server/src/lib/user-invitation/user-invitation.service.js +1658 -0
  387. package/server/src/lib/user-invitation/user-invitation.service.js.map +1 -0
  388. package/contracts/src/datasource.keys.d.ts +0 -4
  389. package/contracts/src/datasource.keys.js +0 -10
  390. package/contracts/src/datasource.keys.js.map +0 -1
  391. package/src/index.d.ts +0 -5
  392. package/src/index.js +0 -13
  393. package/src/index.js.map +0 -1
  394. package/src/lib/middlewares/user-effective-state.middleware.js.map +0 -1
  395. package/src/lib/password-reset/complete-password-reset.command.js.map +0 -1
  396. package/src/lib/password-reset/send-password-reset-email.command.js.map +0 -1
  397. package/src/lib/password-reset/user-password-reset.service.js.map +0 -1
  398. package/src/lib/security-management-server.module.d.ts +0 -2
  399. package/src/lib/security-management-server.module.js +0 -48
  400. package/src/lib/security-management-server.module.js.map +0 -1
  401. package/src/lib/seed/index.d.ts +0 -22
  402. package/src/lib/seed/index.js +0 -24
  403. package/src/lib/seed/index.js.map +0 -1
  404. package/src/lib/seed/policy/index.d.ts +0 -2
  405. package/src/lib/seed/policy/index.js +0 -6
  406. package/src/lib/seed/policy/index.js.map +0 -1
  407. package/src/lib/seed/policy/policy.mock.d.ts +0 -7
  408. package/src/lib/seed/policy/policy.mock.js +0 -40
  409. package/src/lib/seed/policy/policy.mock.js.map +0 -1
  410. package/src/lib/seed/policy/policy.seed.d.ts +0 -5
  411. package/src/lib/seed/policy/policy.seed.js +0 -31
  412. package/src/lib/seed/policy/policy.seed.js.map +0 -1
  413. package/src/lib/seed/role/index.d.ts +0 -4
  414. package/src/lib/seed/role/index.js +0 -8
  415. package/src/lib/seed/role/index.js.map +0 -1
  416. package/src/lib/seed/role/role-ids.constants.d.ts +0 -14
  417. package/src/lib/seed/role/role-ids.constants.js +0 -20
  418. package/src/lib/seed/role/role-ids.constants.js.map +0 -1
  419. package/src/lib/seed/role/role-permission-keys.constants.d.ts +0 -578
  420. package/src/lib/seed/role/role-permission-keys.constants.js +0 -620
  421. package/src/lib/seed/role/role-permission-keys.constants.js.map +0 -1
  422. package/src/lib/seed/role/role.mock.d.ts +0 -4
  423. package/src/lib/seed/role/role.mock.js +0 -321
  424. package/src/lib/seed/role/role.mock.js.map +0 -1
  425. package/src/lib/seed/role/role.seed.d.ts +0 -5
  426. package/src/lib/seed/role/role.seed.js +0 -31
  427. package/src/lib/seed/role/role.seed.js.map +0 -1
  428. package/src/lib/seed/security-management-seed.provider.d.ts +0 -4
  429. package/src/lib/seed/security-management-seed.provider.js +0 -18
  430. package/src/lib/seed/security-management-seed.provider.js.map +0 -1
  431. package/src/lib/seed/security-management-seed.tokens.d.ts +0 -1
  432. package/src/lib/seed/security-management-seed.tokens.js +0 -7
  433. package/src/lib/seed/security-management-seed.tokens.js.map +0 -1
  434. package/src/lib/seed/security-management.seed-catalog.d.ts +0 -2
  435. package/src/lib/seed/security-management.seed-catalog.js +0 -17
  436. package/src/lib/seed/security-management.seed-catalog.js.map +0 -1
  437. package/src/lib/seed/tenant/index.d.ts +0 -1
  438. package/src/lib/seed/tenant/tenant-ids.constants.d.ts +0 -11
  439. package/src/lib/seed/tenant/tenant-ids.constants.js +0 -17
  440. package/src/lib/seed/tenant/tenant-ids.constants.js.map +0 -1
  441. package/src/lib/seed/user/index.d.ts +0 -4
  442. package/src/lib/seed/user/index.js +0 -13
  443. package/src/lib/seed/user/index.js.map +0 -1
  444. package/src/lib/seed/user/resolve-user-effective-state.util.d.ts +0 -4
  445. package/src/lib/seed/user/resolve-user-effective-state.util.js +0 -10
  446. package/src/lib/seed/user/resolve-user-effective-state.util.js.map +0 -1
  447. package/src/lib/seed/user/user.mock.d.ts +0 -21
  448. package/src/lib/seed/user/user.mock.js +0 -338
  449. package/src/lib/seed/user/user.mock.js.map +0 -1
  450. package/src/lib/seed/user/user.seed.d.ts +0 -5
  451. package/src/lib/seed/user/user.seed.js +0 -31
  452. package/src/lib/seed/user/user.seed.js.map +0 -1
  453. /package/{src → server/src}/lib/middlewares/user-effective-state.middleware.d.ts +0 -0
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOwnPasswordStatusCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
7
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
8
+ const user_change_password_service_1 = require("./user-change-password.service");
9
+ //#region ----- Get own password status command -----
10
+ let GetOwnPasswordStatusCommand = class GetOwnPasswordStatusCommand {
11
+ constructor(changePassword) {
12
+ this.changePassword = changePassword;
13
+ }
14
+ execute() {
15
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
16
+ const result = yield this.changePassword.getOwnPasswordStatus();
17
+ if (!result.success) {
18
+ return { success: false, message: { code: result.code } };
19
+ }
20
+ return { success: true, kind: 'object', data: result.data };
21
+ });
22
+ }
23
+ };
24
+ exports.GetOwnPasswordStatusCommand = GetOwnPasswordStatusCommand;
25
+ exports.GetOwnPasswordStatusCommand = GetOwnPasswordStatusCommand = tslib_1.__decorate([
26
+ (0, abstract_1.ServerHandler)({ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.GetOwnPasswordStatus, auth: 'session' }),
27
+ (0, common_1.Injectable)(),
28
+ tslib_1.__metadata("design:paramtypes", [user_change_password_service_1.UserChangePasswordService])
29
+ ], GetOwnPasswordStatusCommand);
30
+ //#endregion
31
+ //# sourceMappingURL=get-own-password-status.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-own-password-status.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/password-reset/get-own-password-status.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,gFAAkF;AAClF,gHAG+D;AAE/D,iFAA2E;AAE3E,qDAAqD;AAI9C,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,YAA6B,cAAyC;QAAzC,mBAAc,GAAd,cAAc,CAA2B;IAAG,CAAC;IAEpE,OAAO;;YACX,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC;YAChE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5D,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9D,CAAC;KAAA;CACF,CAAA;AAVY,kEAA2B;sCAA3B,2BAA2B;IAFvC,IAAA,wBAAa,EAAC,EAAE,GAAG,EAAE,0EAAmC,CAAC,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACjG,IAAA,mBAAU,GAAE;6CAEkC,wDAAyB;GAD3D,2BAA2B,CAUvC;AAED,YAAY"}
@@ -1,21 +1,20 @@
1
- import type { AXPCommand } from '@acorex-platform/framework-shared/runtime';
2
- import type { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';
3
- import { type AXMSendPasswordResetEmailInput } from '@acorex-platform/module-security-management-contracts';
1
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
2
+ import { type AXMSendPasswordResetEmailInput } from '@acorex-platform/module-security-management-client/contracts';
4
3
  import { UserPasswordResetService } from './user-password-reset.service';
5
4
  export declare class SendPasswordResetEmailCommand implements AXPCommand<AXMSendPasswordResetEmailInput & {
6
- __context__?: {
7
- data?: {
8
- id?: string;
9
- };
5
+ data?: {
6
+ id?: string;
10
7
  };
11
- }, unknown> {
8
+ }, {
9
+ sent: boolean;
10
+ }> {
12
11
  private readonly passwordReset;
13
12
  constructor(passwordReset: UserPasswordResetService);
14
13
  execute(input?: AXMSendPasswordResetEmailInput & {
15
- __context__?: {
16
- data?: {
17
- id?: string;
18
- };
14
+ data?: {
15
+ id?: string;
19
16
  };
20
- }): Promise<AXPExecuteCommandResult>;
17
+ }): AXPCommandExecuteResultPromise<{
18
+ sent: boolean;
19
+ }>;
21
20
  }
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SendPasswordResetEmailCommand = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@acorex-platform/framework-shared/core");
6
7
  const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
7
- const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-contracts");
8
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
8
9
  const user_password_reset_service_1 = require("./user-password-reset.service");
9
10
  //#region ---- Send password reset email command ----
10
11
  let SendPasswordResetEmailCommand = class SendPasswordResetEmailCommand {
@@ -13,34 +14,28 @@ let SendPasswordResetEmailCommand = class SendPasswordResetEmailCommand {
13
14
  }
14
15
  execute() {
15
16
  return tslib_1.__awaiter(this, arguments, void 0, function* (input = {}) {
16
- var _a, _b, _c;
17
+ var _a, _b;
17
18
  try {
18
- const userId = (_a = input.userId) !== null && _a !== void 0 ? _a : (_c = (_b = input.__context__) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.id;
19
+ const userId = (_a = input.userId) !== null && _a !== void 0 ? _a : (_b = input.data) === null || _b === void 0 ? void 0 : _b.id;
19
20
  const result = yield this.passwordReset.sendPasswordResetEmail({
20
21
  userId: userId ? String(userId) : undefined,
21
22
  login: input.login,
22
23
  webOrigin: input.webOrigin,
23
24
  });
24
- return {
25
- success: result.success,
26
- data: { sent: result.sent === true },
27
- message: result.message ? { text: result.message } : undefined,
28
- };
25
+ if (!result.success) {
26
+ return (0, core_1.runtimeCommandFailure)(result.message);
27
+ }
28
+ return (0, core_1.runtimeCommandSuccessObject)({ sent: result.sent === true }, result.message ? { message: { text: result.message } } : undefined);
29
29
  }
30
30
  catch (error) {
31
- return {
32
- success: false,
33
- message: {
34
- text: error instanceof Error ? error.message : 'Failed to send password reset email.',
35
- },
36
- };
31
+ return (0, core_1.runtimeCommandFailure)(error instanceof Error ? error.message : 'Failed to send password reset email.');
37
32
  }
38
33
  });
39
34
  }
40
35
  };
41
36
  exports.SendPasswordResetEmailCommand = SendPasswordResetEmailCommand;
42
37
  exports.SendPasswordResetEmailCommand = SendPasswordResetEmailCommand = tslib_1.__decorate([
43
- (0, abstract_1.ServerHandler)({ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.SendPasswordResetEmail }),
38
+ (0, abstract_1.ServerHandler)({ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.SendPasswordResetEmail, auth: 'public' }),
44
39
  (0, common_1.Injectable)(),
45
40
  tslib_1.__metadata("design:paramtypes", [user_password_reset_service_1.UserPasswordResetService])
46
41
  ], SendPasswordResetEmailCommand);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-password-reset-email.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/password-reset/send-password-reset-email.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,iEAA4G;AAE5G,gFAAkF;AAClF,gHAG+D;AAE/D,+EAAyE;AAEzE,qDAAqD;AAI9C,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAGxC,YAA6B,aAAuC;QAAvC,kBAAa,GAAb,aAAa,CAA0B;IAAG,CAAC;IAElE,OAAO;qEACX,QAAqE,EAAE;;YAEvE,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,MAAA,KAAK,CAAC,IAAI,0CAAE,EAAE,CAAC;gBAC9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC;oBAC7D,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;oBAC3C,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,SAAS,EAAE,KAAK,CAAC,SAAS;iBAC3B,CAAC,CAAC;gBAEH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;oBACpB,OAAO,IAAA,4BAAqB,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC/C,CAAC;gBACD,OAAO,IAAA,kCAA2B,EAChC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,EAC9B,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CACnE,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,IAAA,4BAAqB,EAC1B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,sCAAsC,CAChF,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AA7BY,sEAA6B;wCAA7B,6BAA6B;IAFzC,IAAA,wBAAa,EAAC,EAAE,GAAG,EAAE,0EAAmC,CAAC,sBAAsB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAClG,IAAA,mBAAU,GAAE;6CAIiC,sDAAwB;GAHzD,6BAA6B,CA6BzC;AAED,YAAY"}
@@ -0,0 +1,24 @@
1
+ import { EntityStorageMiddlewareService } from '@acorex-platform/framework-server/core';
2
+ import { type AXMChangeOwnPasswordInput, type AXMChangeOwnPasswordResult, type AXMGetOwnPasswordStatusResult } from '@acorex-platform/module-security-management-client/contracts';
3
+ export type ChangeOwnPasswordOutcome = {
4
+ success: true;
5
+ data: AXMChangeOwnPasswordResult;
6
+ } | {
7
+ success: false;
8
+ code: string;
9
+ };
10
+ export type OwnPasswordStatusOutcome = {
11
+ success: true;
12
+ data: AXMGetOwnPasswordStatusResult;
13
+ } | {
14
+ success: false;
15
+ code: string;
16
+ };
17
+ /** Verifies the current password (when present) and updates the signed-in user's credential. */
18
+ export declare class UserChangePasswordService {
19
+ private readonly entityStorage;
20
+ constructor(entityStorage: EntityStorageMiddlewareService);
21
+ getOwnPasswordStatus(): Promise<OwnPasswordStatusOutcome>;
22
+ changeOwnPassword(input: AXMChangeOwnPasswordInput): Promise<ChangeOwnPasswordOutcome>;
23
+ private readSessionUserId;
24
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserChangePasswordService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const lodash_1 = require("lodash");
7
+ const core_1 = require("@acorex-platform/framework-server/core");
8
+ const security_1 = require("@acorex-platform/framework-server/security");
9
+ const core_2 = require("@acorex-platform/framework-shared/core");
10
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
11
+ //#endregion
12
+ //#region ----- Constants -----
13
+ const USER_ENTITY = 'SecurityManagement.User';
14
+ //#endregion
15
+ //#region ----- Helpers -----
16
+ function hasStoredPassword(stored) {
17
+ return typeof stored === 'string' && stored.trim().length > 0;
18
+ }
19
+ //#endregion
20
+ //#region ----- User change-password service -----
21
+ /** Verifies the current password (when present) and updates the signed-in user's credential. */
22
+ let UserChangePasswordService = class UserChangePasswordService {
23
+ constructor(entityStorage) {
24
+ this.entityStorage = entityStorage;
25
+ }
26
+ getOwnPasswordStatus() {
27
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
+ const userId = this.readSessionUserId();
29
+ if (!userId) {
30
+ return { success: false, code: module_security_management_contracts_1.AXM_CHANGE_OWN_PASSWORD_ERROR_CODES.NotSignedIn };
31
+ }
32
+ const user = (yield this.entityStorage.getOneAsEngine(USER_ENTITY, userId));
33
+ if (!(user === null || user === void 0 ? void 0 : user.id)) {
34
+ return { success: false, code: module_security_management_contracts_1.AXM_CHANGE_OWN_PASSWORD_ERROR_CODES.NotSignedIn };
35
+ }
36
+ return {
37
+ success: true,
38
+ data: { hasPassword: hasStoredPassword((0, lodash_1.get)(user, 'password')) },
39
+ };
40
+ });
41
+ }
42
+ changeOwnPassword(input) {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ var _a, _b;
45
+ const currentPassword = (_a = input.currentPassword) !== null && _a !== void 0 ? _a : '';
46
+ const newPassword = (_b = input.newPassword) !== null && _b !== void 0 ? _b : '';
47
+ if (!newPassword) {
48
+ return { success: false, code: module_security_management_contracts_1.AXM_CHANGE_OWN_PASSWORD_ERROR_CODES.InvalidInput };
49
+ }
50
+ const userId = this.readSessionUserId();
51
+ if (!userId) {
52
+ return { success: false, code: module_security_management_contracts_1.AXM_CHANGE_OWN_PASSWORD_ERROR_CODES.NotSignedIn };
53
+ }
54
+ const user = (yield this.entityStorage.getOneAsEngine(USER_ENTITY, userId));
55
+ if (!(user === null || user === void 0 ? void 0 : user.id)) {
56
+ return { success: false, code: module_security_management_contracts_1.AXM_CHANGE_OWN_PASSWORD_ERROR_CODES.NotSignedIn };
57
+ }
58
+ const storedPassword = (0, lodash_1.get)(user, 'password');
59
+ const hasPassword = hasStoredPassword(storedPassword);
60
+ if (hasPassword) {
61
+ if (!currentPassword) {
62
+ return { success: false, code: module_security_management_contracts_1.AXM_CHANGE_OWN_PASSWORD_ERROR_CODES.InvalidInput };
63
+ }
64
+ if (!(yield (0, core_2.verifyPassword)(currentPassword, storedPassword))) {
65
+ return { success: false, code: module_security_management_contracts_1.AXM_CHANGE_OWN_PASSWORD_ERROR_CODES.IncorrectCurrent };
66
+ }
67
+ if (yield (0, core_2.verifyPassword)(newPassword, storedPassword)) {
68
+ return { success: false, code: module_security_management_contracts_1.AXM_CHANGE_OWN_PASSWORD_ERROR_CODES.SameAsCurrent };
69
+ }
70
+ }
71
+ const passwordChangedAt = new Date().toISOString();
72
+ yield this.entityStorage.updateOne(USER_ENTITY, userId, {
73
+ password: yield (0, core_2.hashPassword)(newPassword),
74
+ passwordChangedAt,
75
+ });
76
+ return { success: true, data: { passwordChangedAt } };
77
+ });
78
+ }
79
+ readSessionUserId() {
80
+ var _a, _b;
81
+ const req = (0, core_1.getEntityStorageRequest)();
82
+ const userId = (_b = (_a = req === null || req === void 0 ? void 0 : req[security_1.CURRENT_SESSION_KEY]) === null || _a === void 0 ? void 0 : _a.userId) === null || _b === void 0 ? void 0 : _b.trim();
83
+ return userId || undefined;
84
+ }
85
+ };
86
+ exports.UserChangePasswordService = UserChangePasswordService;
87
+ exports.UserChangePasswordService = UserChangePasswordService = tslib_1.__decorate([
88
+ (0, common_1.Injectable)(),
89
+ tslib_1.__metadata("design:paramtypes", [core_1.EntityStorageMiddlewareService])
90
+ ], UserChangePasswordService);
91
+ //#endregion
92
+ //# sourceMappingURL=user-change-password.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-change-password.service.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/password-reset/user-change-password.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,mCAA6B;AAE7B,iEAAiH;AACjH,yEAGoD;AACpD,iEAAsF;AACtF,gHAM+D;AAgB/D,YAAY;AAEZ,+BAA+B;AAE/B,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAE9C,YAAY;AAEZ,6BAA6B;AAE7B,SAAS,iBAAiB,CAAC,MAAe;IACxC,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAChE,CAAC;AAED,YAAY;AAEZ,kDAAkD;AAElD,gGAAgG;AAEzF,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAA6B,aAA6C;QAA7C,kBAAa,GAAb,aAAa,CAAgC;IAAG,CAAC;IAExE,oBAAoB;;YACxB,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACxC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,0EAAmC,CAAC,W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CAAE,IAAI,EAAE,CAAC;QAC1D,OAAO,MAAM,IAAI,SAAS,CAAC;IAC7B,CAAC;CACF,CAAA;AA3EY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;6CAEiC,qCAA8B;GAD/D,yBAAyB,CA2ErC;AAED,YAAY"}
@@ -1,14 +1,12 @@
1
1
  import { EntityStorageMiddlewareService } from '@acorex-platform/framework-server/core';
2
2
  import { ServerCommandExecutorService } from '@acorex-platform/framework-server/domain/providers';
3
- import { SettingsManagementStoreService } from '@acorex-platform/module-settings-management-server';
4
- import { AXMCompletePasswordResetInput, AXMSendPasswordResetEmailInput } from '@acorex-platform/module-security-management-contracts';
3
+ import { AXMCompletePasswordResetInput, AXMSendPasswordResetEmailInput } from '@acorex-platform/module-security-management-client/contracts';
5
4
  export declare class UserPasswordResetService {
6
5
  private readonly entityStorage;
7
6
  private readonly commandExecutor;
8
- private readonly settingsStore;
9
7
  private readonly logger;
10
8
  private readonly recentRequests;
11
- constructor(entityStorage: EntityStorageMiddlewareService, commandExecutor: ServerCommandExecutorService, settingsStore: SettingsManagementStoreService);
9
+ constructor(entityStorage: EntityStorageMiddlewareService, commandExecutor: ServerCommandExecutorService);
12
10
  /**
13
11
  * Shared by admin Action and public forgot-password.
14
12
  * Always returns a generic success for the forgot path (no user enumeration).
@@ -24,8 +22,5 @@ export declare class UserPasswordResetService {
24
22
  }>;
25
23
  private resolveUser;
26
24
  private listUsers;
27
- private resolveCompanyEmailMerge;
28
- private loadTenantSnapshot;
29
- private resolveScopedSettings;
30
25
  private assertRateLimit;
31
26
  }
@@ -10,37 +10,17 @@ const core_1 = require("@acorex-platform/framework-server/core");
10
10
  const providers_1 = require("@acorex-platform/framework-server/domain/providers");
11
11
  const abstract_1 = require("@acorex-platform/framework-server/jql/abstract");
12
12
  const core_2 = require("@acorex-platform/framework-shared/core");
13
- const module_communication_management_contracts_1 = require("@acorex-platform/module-communication-management-contracts");
14
- const module_content_management_contracts_1 = require("@acorex-platform/module-content-management-contracts");
15
- const module_organization_management_contracts_1 = require("@acorex-platform/module-organization-management-contracts");
16
- const module_settings_management_server_1 = require("@acorex-platform/module-settings-management-server");
13
+ const module_communication_management_contracts_1 = require("@acorex-platform/module-communication-management-client/contracts");
14
+ const module_content_management_contracts_1 = require("@acorex-platform/module-content-management-client/contracts");
17
15
  //#region ---- Constants ----
18
16
  const USER_ENTITY = 'SecurityManagement.User';
19
- const TENANT_ENTITY = 'TenantManagement.Tenant';
20
- const TEMPLATE_NAME = 'password-reset';
17
+ const TEMPLATE_ID = module_content_management_contracts_1.AXM_TEXT_TEMPLATE_IDS.passwordReset;
21
18
  const EMAIL_CHANNEL = 'email-smtp';
22
19
  const EXPIRY_MINUTES = 60;
23
20
  const RATE_LIMIT_WINDOW_MS = 60000;
24
21
  const RATE_LIMIT_MAX = 5;
25
22
  //#endregion
26
23
  //#region ---- Helpers ----
27
- function resolvePasswordResetApiOrigin() {
28
- var _a, _b, _c;
29
- const fromBase = ((_a = process.env['ACOREX_API_BASE_URL']) === null || _a === void 0 ? void 0 : _a.trim()) ||
30
- ((_b = process.env['DEMO_API_BASE_URL']) === null || _b === void 0 ? void 0 : _b.trim()) ||
31
- '';
32
- if (fromBase) {
33
- try {
34
- const url = new URL(fromBase.includes('://') ? fromBase : `http://${fromBase}`);
35
- return url.origin;
36
- }
37
- catch (_d) {
38
- // fall through
39
- }
40
- }
41
- const port = ((_c = process.env['PORT']) === null || _c === void 0 ? void 0 : _c.trim()) || '5500';
42
- return `http://localhost:${port}`;
43
- }
44
24
  function hashToken(token) {
45
25
  return (0, crypto_1.createHash)('sha256').update(token).digest('hex');
46
26
  }
@@ -66,10 +46,9 @@ function tokensMatch(a, b) {
66
46
  //#endregion
67
47
  //#region ---- User password reset service ----
68
48
  let UserPasswordResetService = UserPasswordResetService_1 = class UserPasswordResetService {
69
- constructor(entityStorage, commandExecutor, settingsStore) {
49
+ constructor(entityStorage, commandExecutor) {
70
50
  this.entityStorage = entityStorage;
71
51
  this.commandExecutor = commandExecutor;
72
- this.settingsStore = settingsStore;
73
52
  this.logger = new common_1.Logger(UserPasswordResetService_1.name);
74
53
  this.recentRequests = new Map();
75
54
  }
@@ -79,7 +58,7 @@ let UserPasswordResetService = UserPasswordResetService_1 = class UserPasswordRe
79
58
  */
80
59
  sendPasswordResetEmail(input) {
81
60
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
82
- var _a, _b, _c, _d, _e, _f, _g;
61
+ var _a, _b, _c, _d, _e, _f;
83
62
  const loginKey = ((_b = (_a = input.login) !== null && _a !== void 0 ? _a : input.userId) !== null && _b !== void 0 ? _b : '').toString().trim().toLowerCase();
84
63
  if (loginKey) {
85
64
  this.assertRateLimit(loginKey);
@@ -107,28 +86,34 @@ let UserPasswordResetService = UserPasswordResetService_1 = class UserPasswordRe
107
86
  expiresAt: expiresAt.toISOString(),
108
87
  sentAt: now.toISOString(),
109
88
  };
110
- yield this.entityStorage.updateOne(USER_ENTITY, user.id, { passwordReset });
89
+ yield this.entityStorage.updateOneAsEngine(USER_ENTITY, user.id, { passwordReset });
111
90
  const isAdminPath = Boolean(input.userId);
112
91
  const webOrigin = resolveWebOrigin(input.webOrigin);
113
92
  const resetLink = `${webOrigin}/auth/reset-password?token=${encodeURIComponent(rawToken)}`;
114
- const tenantId = (_e = (_d = user.ownershipInfo) === null || _d === void 0 ? void 0 : _d.tenantId) === null || _e === void 0 ? void 0 : _e.trim();
115
- if (!tenantId) {
116
- this.logger.warn(`password-reset missing ownershipInfo.tenantId for user ${user.id}`);
93
+ const platformTenantId = (_d = (0, abstract_1.getPrimaryPlatformTenantId)()) === null || _d === void 0 ? void 0 : _d.trim();
94
+ if (!platformTenantId) {
95
+ this.logger.warn(`password-reset missing platform tenant id for user ${user.id}`);
117
96
  if (isAdminPath) {
118
- return { success: false, message: 'User tenant context is required to send email.' };
97
+ return { success: false, message: 'Platform tenant context is required to send email.' };
119
98
  }
120
99
  return { success: true, sent: false };
121
100
  }
122
- const companyMerge = yield this.resolveCompanyEmailMerge(tenantId, webOrigin);
123
- const merge = Object.assign(Object.assign({}, companyMerge), { userName: user.displayName || user.username || email, resetLink, expiryMinutes: String(EXPIRY_MINUTES) });
101
+ // Event tokens only — master Context tokens (companyName, …) come from render resolve.
102
+ const merge = {
103
+ userName: user.displayName || user.username || email,
104
+ resetLink,
105
+ expiryMinutes: EXPIRY_MINUTES,
106
+ };
124
107
  const renderResult = yield this.commandExecutor.execute(module_content_management_contracts_1.AXM_TEXT_TEMPLATE_RENDER_COMMAND_KEY, {
125
- textTemplateName: TEMPLATE_NAME,
108
+ textTemplateId: TEMPLATE_ID,
109
+ tenantId: platformTenantId,
110
+ userId: user.id,
126
111
  channel: 'email',
127
- merge,
112
+ data: merge,
128
113
  });
129
- const rendered = renderResult === null || renderResult === void 0 ? void 0 : renderResult.data;
114
+ const rendered = (0, core_2.runtimeCommandPayloadData)(renderResult);
130
115
  if (!(renderResult === null || renderResult === void 0 ? void 0 : renderResult.success) || !(rendered === null || rendered === void 0 ? void 0 : rendered.body)) {
131
- const text = typeof ((_f = renderResult === null || renderResult === void 0 ? void 0 : renderResult.message) === null || _f === void 0 ? void 0 : _f.text) === 'string'
116
+ const text = typeof ((_e = renderResult === null || renderResult === void 0 ? void 0 : renderResult.message) === null || _e === void 0 ? void 0 : _e.text) === 'string'
132
117
  ? renderResult.message.text
133
118
  : 'Password reset template is not configured.';
134
119
  this.logger.warn(`password-reset text template render failed: ${text}`);
@@ -146,13 +131,13 @@ let UserPasswordResetService = UserPasswordResetService_1 = class UserPasswordRe
146
131
  recipientAddress: email,
147
132
  recipientUserId: user.id,
148
133
  recipientName: user.displayName || user.username,
149
- tenantId,
150
- definitionKey: TEMPLATE_NAME,
134
+ tenantId: platformTenantId,
135
+ definitionKey: TEMPLATE_ID,
151
136
  correlationId: `password-reset:${user.id}:${passwordReset.sentAt}`,
152
137
  idempotencyKey: `password-reset:${user.id}:${passwordReset.tokenHash}`,
153
138
  });
154
139
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
155
- const text = typeof ((_g = result === null || result === void 0 ? void 0 : result.message) === null || _g === void 0 ? void 0 : _g.text) === 'string'
140
+ const text = typeof ((_f = result === null || result === void 0 ? void 0 : result.message) === null || _f === void 0 ? void 0 : _f.text) === 'string'
156
141
  ? result.message.text
157
142
  : 'Failed to send password reset email.';
158
143
  this.logger.warn(`password-reset send failed for user ${user.id}: ${text}`);
@@ -180,11 +165,11 @@ let UserPasswordResetService = UserPasswordResetService_1 = class UserPasswordRe
180
165
  }
181
166
  const expiresAt = Date.parse(user.passwordReset.expiresAt);
182
167
  if (!Number.isFinite(expiresAt) || expiresAt < Date.now()) {
183
- yield this.entityStorage.updateOne(USER_ENTITY, user.id, { passwordReset: null });
168
+ yield this.entityStorage.updateOneAsEngine(USER_ENTITY, user.id, { passwordReset: null });
184
169
  return { success: false, message: 'This password reset link is invalid or has expired.' };
185
170
  }
186
171
  const password = yield (0, core_2.hashPassword)(newPassword);
187
- yield this.entityStorage.updateOne(USER_ENTITY, user.id, {
172
+ yield this.entityStorage.updateOneAsEngine(USER_ENTITY, user.id, {
188
173
  password,
189
174
  passwordChangedAt: new Date().toISOString(),
190
175
  passwordReset: null,
@@ -196,7 +181,7 @@ let UserPasswordResetService = UserPasswordResetService_1 = class UserPasswordRe
196
181
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
197
182
  var _a, _b, _c, _d;
198
183
  if ((_a = input.userId) === null || _a === void 0 ? void 0 : _a.trim()) {
199
- const record = yield this.entityStorage.getOne(USER_ENTITY, input.userId.trim());
184
+ const record = yield this.entityStorage.getOneAsEngine(USER_ENTITY, input.userId.trim());
200
185
  return (_b = record) !== null && _b !== void 0 ? _b : null;
201
186
  }
202
187
  const login = (_c = input.login) === null || _c === void 0 ? void 0 : _c.trim().toLowerCase();
@@ -214,51 +199,6 @@ let UserPasswordResetService = UserPasswordResetService_1 = class UserPasswordRe
214
199
  return Array.isArray(items) ? items : [];
215
200
  });
216
201
  }
217
- resolveCompanyEmailMerge(tenantId, webOrigin) {
218
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
219
- const settingsValues = yield this.resolveScopedSettings(tenantId);
220
- const tenant = yield this.loadTenantSnapshot(tenantId);
221
- return (0, module_organization_management_contracts_1.buildCompanyEmailMergeFromOrganization)({
222
- settingsValues,
223
- tenant,
224
- webOrigin,
225
- apiOrigin: resolvePasswordResetApiOrigin(),
226
- });
227
- });
228
- }
229
- loadTenantSnapshot(tenantId) {
230
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
231
- const id = tenantId.trim();
232
- if (!id) {
233
- return null;
234
- }
235
- try {
236
- const row = (yield this.entityStorage.getOne(TENANT_ENTITY, id));
237
- return row !== null && row !== void 0 ? row : null;
238
- }
239
- catch (_a) {
240
- return null;
241
- }
242
- });
243
- }
244
- resolveScopedSettings(tenantId) {
245
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
246
- var _a;
247
- const platformDocument = yield this.settingsStore.findByPartition({ scope: 'P', documentId: 'P' });
248
- let values = Object.assign({}, ((_a = platformDocument === null || platformDocument === void 0 ? void 0 : platformDocument.values) !== null && _a !== void 0 ? _a : {}));
249
- if (tenantId.trim()) {
250
- const tenantDocument = yield this.settingsStore.findByPartition({
251
- scope: 'T',
252
- documentId: `T:${tenantId}`,
253
- tenantId,
254
- });
255
- if (tenantDocument === null || tenantDocument === void 0 ? void 0 : tenantDocument.values) {
256
- values = Object.assign(Object.assign({}, values), tenantDocument.values);
257
- }
258
- }
259
- return values;
260
- });
261
- }
262
202
  assertRateLimit(key) {
263
203
  var _a;
264
204
  const now = Date.now();
@@ -275,8 +215,7 @@ exports.UserPasswordResetService = UserPasswordResetService;
275
215
  exports.UserPasswordResetService = UserPasswordResetService = UserPasswordResetService_1 = tslib_1.__decorate([
276
216
  (0, common_1.Injectable)(),
277
217
  tslib_1.__metadata("design:paramtypes", [core_1.EntityStorageMiddlewareService,
278
- providers_1.ServerCommandExecutorService,
279
- module_settings_management_server_1.SettingsManagementStoreService])
218
+ providers_1.ServerCommandExecutorService])
280
219
  ], UserPasswordResetService);
281
220
  //#endregion
282
221
  //# sourceMappingURL=user-password-reset.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-password-reset.service.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/password-reset/user-password-reset.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AACpD,mCAAkE;AAClE,mCAA6B;AAE7B,iEAAwF;AACxF,kFAAkG;AAClG,6EAA8H;AAC9H,iEAAiG;AACjG,0HAAsH;AACtH,8GAI8D;AAQ9D,6BAA6B;AAE7B,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAC9C,MAAM,WAAW,GAAG,2DAAqB,CAAC,aAAa,CAAC;AACxD,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,oBAAoB,GAAG,KAAM,CAAC;AACpC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,YAAY;AAEZ,2BAA2B;AAE3B,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,gBAAgB,CAAC,QAAiB;;IACzC,MAAM,SAAS,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,CAAC;IACnC,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,MAAM,OAAO,GACX,CAAA,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,0CAAE,IAAI,EAAE;SACxC,MAAA,MAAA,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,0CAAE,IAAI,EAA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,CAAC,2DAA2D,CAAC,CAAC;QAC/E,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;CACF,CAAA;AAhMY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;6CAMuB,qCAA8B;QAC5B,wCAA4B;GANrD,wBAAwB,CAgMpC;AAED,YAAY"}
@@ -0,0 +1,4 @@
1
+ import type { ReportQueryInput, ReportQueryResult } from '@acorex-platform/framework-server/report';
2
+ import type { EffectiveAccessHistoryService } from '../effective-access-history/effective-access-history.service';
3
+ import { type SecurityHistoryFilterScopeOptions } from './security-query.helpers';
4
+ export declare function runGetPermissionHoldersHistoryQuery(history: EffectiveAccessHistoryService, input: ReportQueryInput, scope?: SecurityHistoryFilterScopeOptions): Promise<ReportQueryResult>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Build-time only. Do not import from Nest modules.
3
+ * Source: get-permission-holders-history.query.ts
4
+ */
5
+ export declare const getPermissionHoldersHistoryQueryDefinition: import("@acorex-platform/framework-shared/runtime").AXPAlignedQueryMetadataDefinition;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ * Build-time only. Do not import from Nest modules.
4
+ * Source: get-permission-holders-history.query.ts
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getPermissionHoldersHistoryQueryDefinition = void 0;
8
+ const runtime_1 = require("@acorex-platform/framework-shared/runtime");
9
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
10
+ exports.getPermissionHoldersHistoryQueryDefinition = (0, runtime_1.defineQuery)({
11
+ key: module_security_management_contracts_1.RootConfig.queries.reports.getPermissionHoldersHistory,
12
+ title: 'Permission holders',
13
+ description: 'Users who held a permission that overlaps the selected date range, reconstructed from grant Change History.',
14
+ executionMode: 'backend',
15
+ kind: 'collection',
16
+ filter: [
17
+ { name: 'permission', title: 'Permission', source: 'custom', interface: { name: 'text-editor' } },
18
+ { name: 'dateRange', title: 'Date range', source: 'custom', interface: { name: 'date-time-editor' } },
19
+ { name: 'tenantId', title: 'Tenant', source: 'custom', interface: { name: 'lookup-editor' } },
20
+ { name: 'applicationId', title: 'Application', source: 'custom', interface: { name: 'lookup-editor' } },
21
+ ],
22
+ sort: [
23
+ { name: 'username', title: 'Username', field: 'username' },
24
+ { name: 'displayName', title: 'Display name', field: 'displayName' },
25
+ { name: 'permission', title: 'Permission', field: 'permission' },
26
+ { name: 'validFrom', title: 'Valid from', field: 'validFrom' },
27
+ { name: 'validTo', title: 'Valid to', field: 'validTo' },
28
+ ],
29
+ columns: [
30
+ { name: 'username', title: 'Username', interface: { name: 'text-editor' } },
31
+ { name: 'displayName', title: 'Display name', interface: { name: 'text-editor' } },
32
+ { name: 'permission', title: 'Permission', interface: { name: 'text-editor' } },
33
+ { name: 'validFrom', title: 'Valid from', interface: { name: 'date-time-editor' } },
34
+ { name: 'validTo', title: 'Valid to', interface: { name: 'date-time-editor' } },
35
+ ],
36
+ categories: [runtime_1.AXP_CATALOG_DEFINITION_CATEGORY_REPORT],
37
+ });
38
+ //# sourceMappingURL=get-permission-holders-history.query.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-permission-holders-history.query.definition.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/queries/get-permission-holders-history.query.definition.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uEAAgH;AAChH,gHAAmF;AAEtE,QAAA,0CAA0C,GAAG,IAAA,qBAAW,EAAC;IACpE,GAAG,EAAE,iDAAU,CAAC,OAAO,CAAC,OAAO,CAAC,2BAA2B;IAC3D,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,6GAA6G;IAC/G,aAAa,EAAE,SAAS;IACxB,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE;QACN,EAAE,IAAI,EAAE,YAAY,EA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K,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE;QAC/E,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE;QACnF,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE;KAChF;IACD,UAAU,EAAE,CAAC,gDAAsC,CAAC;CACrD,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runGetPermissionHoldersHistoryQuery = runGetPermissionHoldersHistoryQuery;
4
+ const tslib_1 = require("tslib");
5
+ const security_query_helpers_1 = require("./security-query.helpers");
6
+ //#region ----- Permission holders history query -----
7
+ function runGetPermissionHoldersHistoryQuery(history_1, input_1) {
8
+ return tslib_1.__awaiter(this, arguments, void 0, function* (history, input, scope = {}) {
9
+ const filters = (0, security_query_helpers_1.extractSecurityHistoryFilters)(input.filter, scope);
10
+ const range = (0, security_query_helpers_1.requireHistoryRange)(filters);
11
+ if (!range || !filters.permission) {
12
+ return { items: [], total: 0 };
13
+ }
14
+ const rows = yield history.getPermissionHoldersInRange({
15
+ permission: filters.permission,
16
+ tenantId: range.tenantId,
17
+ applicationId: range.applicationId,
18
+ from: range.from,
19
+ to: range.to,
20
+ });
21
+ return (0, security_query_helpers_1.paginateRows)(rows, input);
22
+ });
23
+ }
24
+ //#endregion
25
+ //# sourceMappingURL=get-permission-holders-history.query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-permission-holders-history.query.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/queries/get-permission-holders-history.query.ts"],"names":[],"mappings":";;AAWA,kFAoBC;;AA7BD,qEAKkC;AAElC,sDAAsD;AAEtD,SAAsB,mCAAmC;iEACvD,OAAsC,EACtC,KAAuB,EACvB,QAA2C,EAAE;QAE7C,MAAM,OAAO,GAAG,IAAA,sDAA6B,EAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACnE,MAAM,KAAK,GAAG,IAAA,4CAAmB,EAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YAClC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,2BAA2B,CAAC;YACrD,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,EAAE,EAAE,KAAK,CAAC,EAAE;SACb,CAAC,CAAC;QAEH,OAAO,IAAA,qCAAY,EAAC,IAA4C,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;CAAA;AAED,YAAY"}
@@ -0,0 +1,4 @@
1
+ import type { ReportQueryInput, ReportQueryResult } from '@acorex-platform/framework-server/report';
2
+ import type { EffectiveAccessHistoryService } from '../effective-access-history/effective-access-history.service';
3
+ import { type SecurityHistoryFilterScopeOptions } from './security-query.helpers';
4
+ export declare function runGetRoleHoldersHistoryQuery(history: EffectiveAccessHistoryService, input: ReportQueryInput, scope?: SecurityHistoryFilterScopeOptions): Promise<ReportQueryResult>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Build-time only. Do not import from Nest modules.
3
+ * Source: get-role-holders-history.query.ts
4
+ */
5
+ export declare const getRoleHoldersHistoryQueryDefinition: import("@acorex-platform/framework-shared/runtime").AXPAlignedQueryMetadataDefinition;