@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,8 @@
1
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
2
+ import { type AXMListMyPendingInvitationsResult } from '@acorex-platform/module-security-management-client/contracts';
3
+ import { UserInvitationService } from './user-invitation.service';
4
+ export declare class ListMyPendingInvitationsCommand implements AXPCommand<Record<string, never>, AXMListMyPendingInvitationsResult> {
5
+ private readonly invitations;
6
+ constructor(invitations: UserInvitationService);
7
+ execute(input?: Record<string, never>): AXPCommandExecuteResultPromise<AXMListMyPendingInvitationsResult>;
8
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListMyPendingInvitationsCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@acorex-platform/framework-shared/core");
7
+ const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
8
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
9
+ const user_invitation_service_1 = require("./user-invitation.service");
10
+ //#region ---- ListMyPendingInvitations command ----
11
+ let ListMyPendingInvitationsCommand = class ListMyPendingInvitationsCommand {
12
+ constructor(invitations) {
13
+ this.invitations = invitations;
14
+ }
15
+ execute() {
16
+ return tslib_1.__awaiter(this, arguments, void 0, function* (input = {}) {
17
+ try {
18
+ const result = yield this.invitations.listMyPendingInvitations();
19
+ if (!result.success || result.data == null) {
20
+ return (0, core_1.runtimeCommandFailure)(result.message);
21
+ }
22
+ return (0, core_1.runtimeCommandSuccessObject)(result.data, result.message ? { message: { text: result.message } } : undefined);
23
+ }
24
+ catch (error) {
25
+ return (0, core_1.runtimeCommandFailure)(error instanceof Error ? error.message : 'Invitation command failed.');
26
+ }
27
+ });
28
+ }
29
+ };
30
+ exports.ListMyPendingInvitationsCommand = ListMyPendingInvitationsCommand;
31
+ exports.ListMyPendingInvitationsCommand = ListMyPendingInvitationsCommand = tslib_1.__decorate([
32
+ (0, abstract_1.ServerHandler)({ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.ListMyPendingInvitations, auth: 'session' }),
33
+ (0, common_1.Injectable)(),
34
+ tslib_1.__metadata("design:paramtypes", [user_invitation_service_1.UserInvitationService])
35
+ ], ListMyPendingInvitationsCommand);
36
+ //#endregion
37
+ //# sourceMappingURL=list-my-pending-invitations.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-my-pending-invitations.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/user-invitation/list-my-pending-invitations.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,iEAA4G;AAE5G,gFAAkF;AAClF,gHAG+D;AAC/D,uEAAkE;AAElE,oDAAoD;AAI7C,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAG1C,YAA6B,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;IAAG,CAAC;IAE7D,OAAO;qEACX,QAA+B,EAAE;YAGjC,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,wBAAwB,EAAE,CAAC;gBACjE,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;oBAC3C,OAAO,IAAA,4BAAqB,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC/C,CAAC;gBACD,OAAO,IAAA,kCAA2B,EAChC,MAAM,CAAC,IAAI,EACX,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,4BAA4B,CACtE,CAAC;YACJ,CAAC;QAEH,CAAC;KAAA;CACF,CAAA;AAzBY,0EAA+B;0CAA/B,+BAA+B;IAF3C,IAAA,wBAAa,EAAC,EAAE,GAAG,EAAE,0EAAmC,CAAC,wBAAwB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACrG,IAAA,mBAAU,GAAE;6CAI+B,+CAAqB;GAHpD,+BAA+B,CAyB3C;AAED,YAAY"}
@@ -0,0 +1,8 @@
1
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
2
+ import { type AXMListTenantEntitledApplicationsResult } from '@acorex-platform/module-security-management-client/contracts';
3
+ import { UserInvitationService } from './user-invitation.service';
4
+ export declare class ListTenantEntitledApplicationsCommand implements AXPCommand<Record<string, never>, AXMListTenantEntitledApplicationsResult> {
5
+ private readonly invitations;
6
+ constructor(invitations: UserInvitationService);
7
+ execute(_input?: Record<string, never>): AXPCommandExecuteResultPromise<AXMListTenantEntitledApplicationsResult>;
8
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListTenantEntitledApplicationsCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@acorex-platform/framework-shared/core");
7
+ const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
8
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
9
+ const user_invitation_service_1 = require("./user-invitation.service");
10
+ //#region ---- ListTenantEntitledApplications command ----
11
+ let ListTenantEntitledApplicationsCommand = class ListTenantEntitledApplicationsCommand {
12
+ constructor(invitations) {
13
+ this.invitations = invitations;
14
+ }
15
+ execute() {
16
+ return tslib_1.__awaiter(this, arguments, void 0, function* (_input = {}) {
17
+ try {
18
+ const result = yield this.invitations.listTenantEntitledApplications();
19
+ if (!result.success || result.data == null) {
20
+ return (0, core_1.runtimeCommandFailure)(result.message);
21
+ }
22
+ return (0, core_1.runtimeCommandSuccessObject)(result.data, result.message ? { message: { text: result.message } } : undefined);
23
+ }
24
+ catch (error) {
25
+ return (0, core_1.runtimeCommandFailure)(error instanceof Error ? error.message : 'List entitled applications failed.');
26
+ }
27
+ });
28
+ }
29
+ };
30
+ exports.ListTenantEntitledApplicationsCommand = ListTenantEntitledApplicationsCommand;
31
+ exports.ListTenantEntitledApplicationsCommand = ListTenantEntitledApplicationsCommand = tslib_1.__decorate([
32
+ (0, abstract_1.ServerHandler)({
33
+ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.ListTenantEntitledApplications,
34
+ auth: 'session',
35
+ permissions: [module_security_management_contracts_1.AXPAdministrationPermissionKeys.MaintainUsersAndRoles],
36
+ }),
37
+ (0, common_1.Injectable)(),
38
+ tslib_1.__metadata("design:paramtypes", [user_invitation_service_1.UserInvitationService])
39
+ ], ListTenantEntitledApplicationsCommand);
40
+ //#endregion
41
+ //# sourceMappingURL=list-tenant-entitled-applications.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-tenant-entitled-applications.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/user-invitation/list-tenant-entitled-applications.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,iEAA4G;AAE5G,gFAAkF;AAClF,gHAI+D;AAC/D,uEAAkE;AAElE,0DAA0D;AAQnD,IAAM,qCAAqC,GAA3C,MAAM,qCAAqC;IAGhD,YAA6B,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;IAAG,CAAC;IAE7D,OAAO;qEACX,SAAgC,EAAE;YAElC,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,8BAA8B,EAAE,CAAC;gBACvE,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;oBAC3C,OAAO,IAAA,4BAAqB,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC/C,CAAC;gBACD,OAAO,IAAA,kCAA2B,EAChC,MAAM,CAAC,IAAI,EACX,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,oCAAoC,CAC9E,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AAvBY,sFAAqC;gDAArC,qCAAqC;IANjD,IAAA,wBAAa,EAAC;QACb,GAAG,EAAE,0EAAmC,CAAC,8BAA8B;QACvE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,CAAC,sEAA+B,CAAC,qBAAqB,CAAC;KACrE,CAAC;IACD,IAAA,mBAAU,GAAE;6CAI+B,+CAAqB;GAHpD,qCAAqC,CAuBjD;AAED,YAAY"}
@@ -0,0 +1,8 @@
1
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
2
+ import { type AXMLookupTenantByUniqueNameInput, type AXMLookupTenantByUniqueNameResult } from '@acorex-platform/module-security-management-client/contracts';
3
+ import { UserInvitationService } from './user-invitation.service';
4
+ export declare class LookupTenantByUniqueNameCommand implements AXPCommand<AXMLookupTenantByUniqueNameInput, AXMLookupTenantByUniqueNameResult> {
5
+ private readonly invitations;
6
+ constructor(invitations: UserInvitationService);
7
+ execute(input?: AXMLookupTenantByUniqueNameInput): AXPCommandExecuteResultPromise<AXMLookupTenantByUniqueNameResult>;
8
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LookupTenantByUniqueNameCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@acorex-platform/framework-shared/core");
7
+ const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
8
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
9
+ const user_invitation_service_1 = require("./user-invitation.service");
10
+ //#region ---- LookupTenantByUniqueName command ----
11
+ let LookupTenantByUniqueNameCommand = class LookupTenantByUniqueNameCommand {
12
+ constructor(invitations) {
13
+ this.invitations = invitations;
14
+ }
15
+ execute() {
16
+ return tslib_1.__awaiter(this, arguments, void 0, function* (input = { uniqueName: '' }) {
17
+ try {
18
+ const result = yield this.invitations.lookupTenantByUniqueName(input);
19
+ if (!result.success || result.data == null) {
20
+ return (0, core_1.runtimeCommandFailure)(result.message, { code: result.code });
21
+ }
22
+ return (0, core_1.runtimeCommandSuccessObject)(result.data);
23
+ }
24
+ catch (error) {
25
+ return (0, core_1.runtimeCommandFailure)(error instanceof Error ? error.message : 'Tenant lookup failed.');
26
+ }
27
+ });
28
+ }
29
+ };
30
+ exports.LookupTenantByUniqueNameCommand = LookupTenantByUniqueNameCommand;
31
+ exports.LookupTenantByUniqueNameCommand = LookupTenantByUniqueNameCommand = tslib_1.__decorate([
32
+ (0, abstract_1.ServerHandler)({
33
+ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.LookupTenantByUniqueName,
34
+ auth: 'session',
35
+ }),
36
+ (0, common_1.Injectable)(),
37
+ tslib_1.__metadata("design:paramtypes", [user_invitation_service_1.UserInvitationService])
38
+ ], LookupTenantByUniqueNameCommand);
39
+ //#endregion
40
+ //# sourceMappingURL=lookup-tenant-by-unique-name.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lookup-tenant-by-unique-name.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/user-invitation/lookup-tenant-by-unique-name.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,iEAA4G;AAE5G,gFAAkF;AAClF,gHAI+D;AAC/D,uEAAkE;AAElE,oDAAoD;AAO7C,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAG1C,YAA6B,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;IAAG,CAAC;IAE7D,OAAO;qEACX,QAA0C,EAAE,UAAU,EAAE,EAAE,EAAE;YAE5D,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;gBACtE,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;oBAC3C,OAAO,IAAA,4BAAqB,EAAC,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBACtE,CAAC;gBACD,OAAO,IAAA,kCAA2B,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,IAAA,4BAAqB,EAC1B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CACjE,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AApBY,0EAA+B;0CAA/B,+BAA+B;IAL3C,IAAA,wBAAa,EAAC;QACb,GAAG,EAAE,0EAAmC,CAAC,wBAAwB;QACjE,IAAI,EAAE,SAAS;KAChB,CAAC;IACD,IAAA,mBAAU,GAAE;6CAI+B,+CAAqB;GAHpD,+BAA+B,CAoB3C;AAED,YAAY"}
@@ -0,0 +1,8 @@
1
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
2
+ import { type AXMRejectJoinRequestInput } from '@acorex-platform/module-security-management-client/contracts';
3
+ import { UserInvitationService } from './user-invitation.service';
4
+ export declare class RejectJoinRequestCommand implements AXPCommand<AXMRejectJoinRequestInput, unknown> {
5
+ private readonly invitations;
6
+ constructor(invitations: UserInvitationService);
7
+ execute(input?: AXMRejectJoinRequestInput): AXPCommandExecuteResultPromise<unknown>;
8
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RejectJoinRequestCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@acorex-platform/framework-shared/core");
7
+ const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
8
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
9
+ const user_invitation_service_1 = require("./user-invitation.service");
10
+ //#region ---- RejectJoinRequest command ----
11
+ let RejectJoinRequestCommand = class RejectJoinRequestCommand {
12
+ constructor(invitations) {
13
+ this.invitations = invitations;
14
+ }
15
+ execute() {
16
+ return tslib_1.__awaiter(this, arguments, void 0, function* (input = {}) {
17
+ try {
18
+ const result = yield this.invitations.rejectJoinRequest(input);
19
+ if (!result.success) {
20
+ return (0, core_1.runtimeCommandFailure)(result.message, { code: result.code });
21
+ }
22
+ return (0, core_1.runtimeCommandSuccessObject)(undefined);
23
+ }
24
+ catch (error) {
25
+ return (0, core_1.runtimeCommandFailure)(error instanceof Error ? error.message : 'Failed to reject join request.');
26
+ }
27
+ });
28
+ }
29
+ };
30
+ exports.RejectJoinRequestCommand = RejectJoinRequestCommand;
31
+ exports.RejectJoinRequestCommand = RejectJoinRequestCommand = tslib_1.__decorate([
32
+ (0, abstract_1.ServerHandler)({
33
+ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.RejectJoinRequest,
34
+ auth: 'session',
35
+ permissions: [module_security_management_contracts_1.AXPAdministrationPermissionKeys.MaintainUsersAndRoles],
36
+ }),
37
+ (0, common_1.Injectable)(),
38
+ tslib_1.__metadata("design:paramtypes", [user_invitation_service_1.UserInvitationService])
39
+ ], RejectJoinRequestCommand);
40
+ //#endregion
41
+ //# sourceMappingURL=reject-join-request.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reject-join-request.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/user-invitation/reject-join-request.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,iEAA4G;AAE5G,gFAAkF;AAClF,gHAI+D;AAC/D,uEAAkE;AAElE,6CAA6C;AAQtC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAGnC,YAA6B,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;IAAG,CAAC;IAE7D,OAAO;qEACX,QAAmC,EAAE;YAErC,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAC/D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;oBACpB,OAAO,IAAA,4BAAqB,EAAC,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBACtE,CAAC;gBACD,OAAO,IAAA,kCAA2B,EAAC,SAAS,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,IAAA,4BAAqB,EAC1B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAC1E,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AApBY,4DAAwB;mCAAxB,wBAAwB;IANpC,IAAA,wBAAa,EAAC;QACb,GAAG,EAAE,0EAAmC,CAAC,iBAAiB;QAC1D,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,CAAC,sEAA+B,CAAC,qBAAqB,CAAC;KACrE,CAAC;IACD,IAAA,mBAAU,GAAE;6CAI+B,+CAAqB;GAHpD,wBAAwB,CAoBpC;AAED,YAAY"}
@@ -0,0 +1,8 @@
1
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
2
+ import { type AXMRequestTenantMembershipInput, type AXMRequestTenantMembershipResult } from '@acorex-platform/module-security-management-client/contracts';
3
+ import { UserInvitationService } from './user-invitation.service';
4
+ export declare class RequestTenantMembershipCommand implements AXPCommand<AXMRequestTenantMembershipInput, AXMRequestTenantMembershipResult> {
5
+ private readonly invitations;
6
+ constructor(invitations: UserInvitationService);
7
+ execute(input?: AXMRequestTenantMembershipInput): AXPCommandExecuteResultPromise<AXMRequestTenantMembershipResult>;
8
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RequestTenantMembershipCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@acorex-platform/framework-shared/core");
7
+ const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
8
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
9
+ const user_invitation_service_1 = require("./user-invitation.service");
10
+ //#region ---- RequestTenantMembership command ----
11
+ let RequestTenantMembershipCommand = class RequestTenantMembershipCommand {
12
+ constructor(invitations) {
13
+ this.invitations = invitations;
14
+ }
15
+ execute() {
16
+ return tslib_1.__awaiter(this, arguments, void 0, function* (input = { uniqueName: '' }) {
17
+ try {
18
+ const result = yield this.invitations.requestTenantMembership(input);
19
+ if (!result.success || result.data == null) {
20
+ return (0, core_1.runtimeCommandFailure)(result.message, { code: result.code });
21
+ }
22
+ return (0, core_1.runtimeCommandSuccessObject)(result.data);
23
+ }
24
+ catch (error) {
25
+ return (0, core_1.runtimeCommandFailure)(error instanceof Error ? error.message : 'Join request failed.');
26
+ }
27
+ });
28
+ }
29
+ };
30
+ exports.RequestTenantMembershipCommand = RequestTenantMembershipCommand;
31
+ exports.RequestTenantMembershipCommand = RequestTenantMembershipCommand = tslib_1.__decorate([
32
+ (0, abstract_1.ServerHandler)({
33
+ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.RequestTenantMembership,
34
+ auth: 'session',
35
+ }),
36
+ (0, common_1.Injectable)(),
37
+ tslib_1.__metadata("design:paramtypes", [user_invitation_service_1.UserInvitationService])
38
+ ], RequestTenantMembershipCommand);
39
+ //#endregion
40
+ //# sourceMappingURL=request-tenant-membership.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-tenant-membership.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/user-invitation/request-tenant-membership.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,iEAA4G;AAE5G,gFAAkF;AAClF,gHAI+D;AAC/D,uEAAkE;AAElE,mDAAmD;AAO5C,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAGzC,YAA6B,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;IAAG,CAAC;IAE7D,OAAO;qEACX,QAAyC,EAAE,UAAU,EAAE,EAAE,EAAE;YAE3D,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;gBACrE,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;oBAC3C,OAAO,IAAA,4BAAqB,EAAC,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;gBACtE,CAAC;gBACD,OAAO,IAAA,kCAA2B,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,IAAA,4BAAqB,EAC1B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAChE,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAA;AApBY,wEAA8B;yCAA9B,8BAA8B;IAL1C,IAAA,wBAAa,EAAC;QACb,GAAG,EAAE,0EAAmC,CAAC,uBAAuB;QAChE,IAAI,EAAE,SAAS;KAChB,CAAC;IACD,IAAA,mBAAU,GAAE;6CAI+B,+CAAqB;GAHpD,8BAA8B,CAoB1C;AAED,YAAY"}
@@ -0,0 +1,12 @@
1
+ import type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';
2
+ import { type AXMResendInvitationInput } from '@acorex-platform/module-security-management-client/contracts';
3
+ import { UserInvitationService } from './user-invitation.service';
4
+ export declare class ResendInvitationCommand implements AXPCommand<AXMResendInvitationInput, {
5
+ sent: boolean;
6
+ }> {
7
+ private readonly invitations;
8
+ constructor(invitations: UserInvitationService);
9
+ execute(input?: AXMResendInvitationInput): AXPCommandExecuteResultPromise<{
10
+ sent: boolean;
11
+ }>;
12
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResendInvitationCommand = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const core_1 = require("@acorex-platform/framework-shared/core");
7
+ const abstract_1 = require("@acorex-platform/framework-server/domain/abstract");
8
+ const module_security_management_contracts_1 = require("@acorex-platform/module-security-management-client/contracts");
9
+ const user_invitation_service_1 = require("./user-invitation.service");
10
+ //#region ---- ResendInvitation command ----
11
+ let ResendInvitationCommand = class ResendInvitationCommand {
12
+ constructor(invitations) {
13
+ this.invitations = invitations;
14
+ }
15
+ execute() {
16
+ return tslib_1.__awaiter(this, arguments, void 0, function* (input = {}) {
17
+ try {
18
+ const result = yield this.invitations.resendInvitation(input);
19
+ if (!result.success) {
20
+ return (0, core_1.runtimeCommandFailure)(result.message);
21
+ }
22
+ return (0, core_1.runtimeCommandSuccessObject)({ sent: result.sent === true }, result.message ? { message: { text: result.message } } : undefined);
23
+ }
24
+ catch (error) {
25
+ return (0, core_1.runtimeCommandFailure)(error instanceof Error ? error.message : 'Invitation command failed.');
26
+ }
27
+ });
28
+ }
29
+ };
30
+ exports.ResendInvitationCommand = ResendInvitationCommand;
31
+ exports.ResendInvitationCommand = ResendInvitationCommand = tslib_1.__decorate([
32
+ (0, abstract_1.ServerHandler)({ key: module_security_management_contracts_1.AXMSecurityManagementServerCommands.ResendInvitation, auth: 'session', permissions: [module_security_management_contracts_1.AXPAdministrationPermissionKeys.MaintainUsersAndRoles] }),
33
+ (0, common_1.Injectable)(),
34
+ tslib_1.__metadata("design:paramtypes", [user_invitation_service_1.UserInvitationService])
35
+ ], ResendInvitationCommand);
36
+ //#endregion
37
+ //# sourceMappingURL=resend-invitation.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resend-invitation.command.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/user-invitation/resend-invitation.command.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,iEAA4G;AAE5G,gFAAkF;AAClF,gHAI+D;AAC/D,uEAAkE;AAElE,4CAA4C;AAIrC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAGlC,YAA6B,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;IAAG,CAAC;IAE7D,OAAO;qEACX,QAAkC,EAA8B;YAGhE,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBAC9D,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,4BAA4B,CACtE,CAAC;YACJ,CAAC;QAEH,CAAC;KAAA;CACF,CAAA;AAzBY,0DAAuB;kCAAvB,uBAAuB;IAFnC,IAAA,wBAAa,EAAC,EAAE,GAAG,EAAE,0EAAmC,CAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,sEAA+B,CAAC,qBAAqB,CAAC,EAAE,CAAC;IACnK,IAAA,mBAAU,GAAE;6CAI+B,+CAAqB;GAHpD,uBAAuB,CAyBnC;AAED,YAAY"}
@@ -0,0 +1,25 @@
1
+ import type { EntityStorageMiddlewareService } from '@acorex-platform/framework-server/core';
2
+ /** TM edition feature — multi-app invite (ADR-TEN-001 D-05). */
3
+ export declare const INVITE_MULTI_APPLICATION_FEATURE = "TenantManagement:Feature:InviteMultiApplication";
4
+ /**
5
+ * Returns application rows the tenant is entitled to via active subscriptions / editions.
6
+ * Does **not** filter by inviter AppAccess — ADR invite selectable set is tenant entitlement.
7
+ */
8
+ export declare function resolveTenantSubscribedApplications(storage: EntityStorageMiddlewareService, tenantId: string): Promise<Array<{
9
+ id: string;
10
+ title: unknown;
11
+ }>>;
12
+ /**
13
+ * Returns application ids the tenant is entitled to via active subscriptions / editions.
14
+ */
15
+ export declare function resolveTenantSubscribedApplicationIds(storage: EntityStorageMiddlewareService, tenantId: string): Promise<string[]>;
16
+ /**
17
+ * True when any edition on the session application enables the given feature key.
18
+ * Used as server SoT alongside `tenantMembershipInvite` (not Application.code).
19
+ */
20
+ export declare function sessionApplicationHasFeature(storage: EntityStorageMiddlewareService, applicationId: string | undefined, featureKey: string): Promise<boolean>;
21
+ /**
22
+ * Intersect requested application ids with tenant subscription entitlement.
23
+ * Empty result means none of the requested apps are valid for the tenant.
24
+ */
25
+ export declare function filterApplicationIdsByEntitlement(requestedIds: string[], entitledIds: ReadonlySet<string> | readonly string[]): string[];
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INVITE_MULTI_APPLICATION_FEATURE = void 0;
4
+ exports.resolveTenantSubscribedApplications = resolveTenantSubscribedApplications;
5
+ exports.resolveTenantSubscribedApplicationIds = resolveTenantSubscribedApplicationIds;
6
+ exports.sessionApplicationHasFeature = sessionApplicationHasFeature;
7
+ exports.filterApplicationIdsByEntitlement = filterApplicationIdsByEntitlement;
8
+ const tslib_1 = require("tslib");
9
+ const abstract_1 = require("@acorex-platform/framework-server/jql/abstract");
10
+ const core_1 = require("@acorex-platform/framework-shared/core");
11
+ const lodash_1 = require("lodash");
12
+ //#region ----- Constants -----
13
+ const APPLICATION_ENTITY = 'ApplicationManagement.Application';
14
+ const EDITION_ENTITY = 'ApplicationManagement.Edition';
15
+ const SUBSCRIPTION_ENTITY = 'SubscriptionManagement.Subscription';
16
+ const SUBSCRIPTION_PLAN_ITEM_ENTITY = 'SubscriptionManagement.SubscriptionPlanItem';
17
+ /** TM edition feature — multi-app invite (ADR-TEN-001 D-05). */
18
+ exports.INVITE_MULTI_APPLICATION_FEATURE = 'TenantManagement:Feature:InviteMultiApplication';
19
+ const ACTIVE_STATUS = core_1.AXPSystemStatusType.Active;
20
+ const SUBSCRIBER_TYPE_TENANT = 'Tenant';
21
+ //#endregion
22
+ //#region ----- Tenant-subscribed applications (invite entitlement) -----
23
+ /**
24
+ * Returns application rows the tenant is entitled to via active subscriptions / editions.
25
+ * Does **not** filter by inviter AppAccess — ADR invite selectable set is tenant entitlement.
26
+ */
27
+ function resolveTenantSubscribedApplications(storage, tenantId) {
28
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
+ const tid = tenantId.trim();
30
+ if (!tid) {
31
+ return [];
32
+ }
33
+ const [applications, subscriptions, planItems] = yield Promise.all([
34
+ listEntities(storage, APPLICATION_ENTITY),
35
+ listEntities(storage, SUBSCRIPTION_ENTITY),
36
+ listEntities(storage, SUBSCRIPTION_PLAN_ITEM_ENTITY),
37
+ ]);
38
+ const planIds = subscriptions
39
+ .filter((subscription) => subscription['subscriberType'] === SUBSCRIBER_TYPE_TENANT &&
40
+ String(subscription['subscriberId']) === tid &&
41
+ subscription['statusId'] === ACTIVE_STATUS &&
42
+ subscription['planId'])
43
+ .map((subscription) => String(subscription['planId']));
44
+ if (planIds.length === 0) {
45
+ return [];
46
+ }
47
+ const subscribedEditionIds = new Set(planItems
48
+ .filter((planItem) => planIds.includes(String(planItem['planId'])) && planItem['editionId'])
49
+ .map((planItem) => String(planItem['editionId'])));
50
+ return applications
51
+ .filter((application) => {
52
+ if (application['statusId'] !== ACTIVE_STATUS) {
53
+ return false;
54
+ }
55
+ const editionIds = application['editionIds'];
56
+ return (Array.isArray(editionIds) &&
57
+ editionIds.some((editionId) => subscribedEditionIds.has(String(editionId))));
58
+ })
59
+ .map((application) => ({
60
+ id: String(application['id']),
61
+ title: application['title'],
62
+ }))
63
+ .filter((application) => Boolean(application.id));
64
+ });
65
+ }
66
+ /**
67
+ * Returns application ids the tenant is entitled to via active subscriptions / editions.
68
+ */
69
+ function resolveTenantSubscribedApplicationIds(storage, tenantId) {
70
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
71
+ return (yield resolveTenantSubscribedApplications(storage, tenantId)).map((row) => row.id);
72
+ });
73
+ }
74
+ /**
75
+ * True when any edition on the session application enables the given feature key.
76
+ * Used as server SoT alongside `tenantMembershipInvite` (not Application.code).
77
+ */
78
+ function sessionApplicationHasFeature(storage, applicationId, featureKey) {
79
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
+ var _a;
81
+ const id = applicationId === null || applicationId === void 0 ? void 0 : applicationId.trim();
82
+ if (!id || !featureKey.trim()) {
83
+ return false;
84
+ }
85
+ const application = (yield storage.getOneAsEngine(APPLICATION_ENTITY, id));
86
+ const editionIds = application === null || application === void 0 ? void 0 : application['editionIds'];
87
+ if (!Array.isArray(editionIds) || editionIds.length === 0) {
88
+ return false;
89
+ }
90
+ for (const editionId of editionIds) {
91
+ const eid = String(editionId !== null && editionId !== void 0 ? editionId : '').trim();
92
+ if (!eid) {
93
+ continue;
94
+ }
95
+ const edition = (yield storage.getOneAsEngine(EDITION_ENTITY, eid));
96
+ const modulesAndFeatures = edition === null || edition === void 0 ? void 0 : edition['modulesAndFeatures'];
97
+ const value = (_a = modulesAndFeatures === null || modulesAndFeatures === void 0 ? void 0 : modulesAndFeatures.features) === null || _a === void 0 ? void 0 : _a[featureKey];
98
+ if (value === true) {
99
+ return true;
100
+ }
101
+ }
102
+ return false;
103
+ });
104
+ }
105
+ /**
106
+ * Intersect requested application ids with tenant subscription entitlement.
107
+ * Empty result means none of the requested apps are valid for the tenant.
108
+ */
109
+ function filterApplicationIdsByEntitlement(requestedIds, entitledIds) {
110
+ const entitled = entitledIds instanceof Set ? entitledIds : new Set(entitledIds);
111
+ return [...new Set(requestedIds.map((id) => id.trim()).filter(Boolean))].filter((id) => entitled.has(id));
112
+ }
113
+ function listEntities(storage, entityName) {
114
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
115
+ const result = yield storage.query(entityName, (0, abstract_1.bypassAllEntityVisibilityFilters)({ skip: 0, take: 5000 }));
116
+ const items = (0, lodash_1.get)(result, 'items', []);
117
+ return Array.isArray(items) ? items : [];
118
+ });
119
+ }
120
+ //#endregion
121
+ //# sourceMappingURL=user-invitation-application-access.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-invitation-application-access.util.js","sourceRoot":"","sources":["../../../../../../../libs/modules/security-management/server/src/lib/user-invitation/user-invitation-application-access.util.ts"],"names":[],"mappings":";;;AA0BA,kFAmDC;AAKD,sFAKC;AAMD,oEAoCC;AAMD,8EAQC;;AA9ID,6EAAkG;AAClG,iEAA6E;AAC7E,mCAA6B;AAE7B,+BAA+B;AAE/B,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAC/D,MAAM,cAAc,GAAG,+BAA+B,CAAC;AACvD,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AAClE,MAAM,6BAA6B,GAAG,6CAA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