@acorex-platform/module-security-management-client 0.0.59 → 0.0.60

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 (63) hide show
  1. package/fesm2022/{acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-CNHPwr3d.mjs → acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-B61j_cJF.mjs} +206 -15
  2. package/fesm2022/acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-B61j_cJF.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-security-management-client-approve-join-request.command-BSvK59LV.mjs +322 -0
  4. package/fesm2022/acorex-platform-module-security-management-client-approve-join-request.command-BSvK59LV.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-device-sessions.mjs +21 -2
  6. package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-device-sessions.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-users.mjs +170 -39
  8. package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-users.mjs.map +1 -1
  9. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-acorex-platform-module-security-management-client-contracts-entity-catalog-DAZZcjkf.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-acorex-platform-module-security-management-client-contracts-entity-catalog-JP3zTrun.mjs} +10 -10
  10. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-acorex-platform-module-security-management-client-contracts-entity-catalog-DAZZcjkf.mjs.map → acorex-platform-module-security-management-client-contracts-entity-catalog-acorex-platform-module-security-management-client-contracts-entity-catalog-JP3zTrun.mjs.map} +1 -1
  11. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-device-sessions.entity-DXhQ1_3K.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-device-sessions.entity-lwQtCJoy.mjs} +23 -4
  12. package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-device-sessions.entity-lwQtCJoy.mjs.map +1 -0
  13. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-identity-provider.entity-D6g5wMQu.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-identity-provider.entity-DZfizo-n.mjs} +2 -2
  14. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-identity-provider.entity-D6g5wMQu.mjs.map → acorex-platform-module-security-management-client-contracts-entity-catalog-identity-provider.entity-DZfizo-n.mjs.map} +1 -1
  15. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-policy.entity-DI30j3q8.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-policy.entity-Dkl_6Iio.mjs} +2 -2
  16. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-policy.entity-DI30j3q8.mjs.map → acorex-platform-module-security-management-client-contracts-entity-catalog-policy.entity-Dkl_6Iio.mjs.map} +1 -1
  17. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-profile.entity-zl0xsn2K.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-profile.entity-Ddbd-rAG.mjs} +2 -2
  18. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-profile.entity-zl0xsn2K.mjs.map → acorex-platform-module-security-management-client-contracts-entity-catalog-profile.entity-Ddbd-rAG.mjs.map} +1 -1
  19. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-role-permission.entity-Dv93TmJN.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-role-permission.entity-WCgik8MV.mjs} +2 -2
  20. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-role-permission.entity-Dv93TmJN.mjs.map → acorex-platform-module-security-management-client-contracts-entity-catalog-role-permission.entity-WCgik8MV.mjs.map} +1 -1
  21. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-roles.entity-H53Y7i9P.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-roles.entity-CRZftClq.mjs} +2 -2
  22. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-roles.entity-H53Y7i9P.mjs.map → acorex-platform-module-security-management-client-contracts-entity-catalog-roles.entity-CRZftClq.mjs.map} +1 -1
  23. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-user-role.entity-i8zSXdbv.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-user-role.entity-9QpoRCOF.mjs} +2 -2
  24. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-user-role.entity-i8zSXdbv.mjs.map → acorex-platform-module-security-management-client-contracts-entity-catalog-user-role.entity-9QpoRCOF.mjs.map} +1 -1
  25. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-user-two-factor.entity-Bt710bWo.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-user-two-factor.entity-C34VzcYk.mjs} +2 -2
  26. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-user-two-factor.entity-Bt710bWo.mjs.map → acorex-platform-module-security-management-client-contracts-entity-catalog-user-two-factor.entity-C34VzcYk.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-users.entity-LSatoTXa.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-users.entity-DuC5cfIb.mjs} +172 -41
  28. package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-users.entity-DuC5cfIb.mjs.map +1 -0
  29. package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog.mjs +1 -1
  30. package/fesm2022/acorex-platform-module-security-management-client-contracts.mjs +339 -3
  31. package/fesm2022/acorex-platform-module-security-management-client-contracts.mjs.map +1 -1
  32. package/fesm2022/acorex-platform-module-security-management-client-create-user-in-tenant.command-BFnZRmh9.mjs +376 -0
  33. package/fesm2022/acorex-platform-module-security-management-client-create-user-in-tenant.command-BFnZRmh9.mjs.map +1 -0
  34. package/fesm2022/{acorex-platform-module-security-management-client-index-DpAVeAIc.mjs → acorex-platform-module-security-management-client-index-B6qo6qLT.mjs} +5 -156
  35. package/fesm2022/acorex-platform-module-security-management-client-index-B6qo6qLT.mjs.map +1 -0
  36. package/fesm2022/acorex-platform-module-security-management-client-invite-user.command-ClQ6WxxN.mjs +370 -0
  37. package/fesm2022/acorex-platform-module-security-management-client-invite-user.command-ClQ6WxxN.mjs.map +1 -0
  38. package/fesm2022/acorex-platform-module-security-management-client-reject-join-request.command-B3kiok6b.mjs +76 -0
  39. package/fesm2022/acorex-platform-module-security-management-client-reject-join-request.command-B3kiok6b.mjs.map +1 -0
  40. package/fesm2022/{acorex-platform-module-security-management-client-reset-two-factor.command-psTDKoNf.mjs → acorex-platform-module-security-management-client-reset-two-factor.command-C27mUZ1-.mjs} +7 -2
  41. package/fesm2022/acorex-platform-module-security-management-client-reset-two-factor.command-C27mUZ1-.mjs.map +1 -0
  42. package/fesm2022/{acorex-platform-module-security-management-client-send-password-reset-email.command-CoQgWdya.mjs → acorex-platform-module-security-management-client-send-password-reset-email.command-DFxm2T_x.mjs} +7 -2
  43. package/fesm2022/acorex-platform-module-security-management-client-send-password-reset-email.command-DFxm2T_x.mjs.map +1 -0
  44. package/fesm2022/acorex-platform-module-security-management-client-settings.provider-CwDiU-C8.mjs +54 -0
  45. package/fesm2022/acorex-platform-module-security-management-client-settings.provider-CwDiU-C8.mjs.map +1 -0
  46. package/fesm2022/acorex-platform-module-security-management-client-user-role-grant.service-6U17jzjq.mjs +231 -0
  47. package/fesm2022/acorex-platform-module-security-management-client-user-role-grant.service-6U17jzjq.mjs.map +1 -0
  48. package/fesm2022/acorex-platform-module-security-management-client.mjs +1 -1
  49. package/i18n/en-AU/security-management.json +91 -4
  50. package/i18n/en-US/security-management.json +91 -4
  51. package/i18n/fa-IR/security-management.json +91 -4
  52. package/package.json +1 -1
  53. package/types/acorex-platform-module-security-management-client-contracts.d.ts +274 -7
  54. package/fesm2022/acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-CNHPwr3d.mjs.map +0 -1
  55. package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-device-sessions.entity-DXhQ1_3K.mjs.map +0 -1
  56. package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-users.entity-LSatoTXa.mjs.map +0 -1
  57. package/fesm2022/acorex-platform-module-security-management-client-create-user-in-tenant.command-CDtT9Ux_.mjs +0 -142
  58. package/fesm2022/acorex-platform-module-security-management-client-create-user-in-tenant.command-CDtT9Ux_.mjs.map +0 -1
  59. package/fesm2022/acorex-platform-module-security-management-client-index-DpAVeAIc.mjs.map +0 -1
  60. package/fesm2022/acorex-platform-module-security-management-client-invite-user.command-kFXjLdxy.mjs +0 -143
  61. package/fesm2022/acorex-platform-module-security-management-client-invite-user.command-kFXjLdxy.mjs.map +0 -1
  62. package/fesm2022/acorex-platform-module-security-management-client-reset-two-factor.command-psTDKoNf.mjs.map +0 -1
  63. package/fesm2022/acorex-platform-module-security-management-client-send-password-reset-email.command-CoQgWdya.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-security-management-client-index-B6qo6qLT.mjs","sources":["../../../../libs/modules/security-management/client/src/lib/features/user-roles/pages/user-roles-page/user-roles-page.component.ts","../../../../libs/modules/security-management/client/src/lib/features/user-roles/pages/user-roles-page/user-roles-page.component.html","../../../../libs/modules/security-management/client/src/lib/features/user-roles/pages/user-roles-page/user-roles-page-component.provider.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport {\n AXPActionMenuItem,\n AXPExecuteCommand,\n type AXPRuntimeCommandResult,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPLayoutDetailsViewAction } from '@acorex-platform/framework-client/layout/views';\nimport { AXPPageLayoutBase, AXPPageLayoutBaseComponent } from '@acorex-platform/framework-client/layout/views';\nimport { AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';\nimport { AXValueChangedEvent } from '@acorex/cdk/common';\nimport { AXSelectionListModule } from '@acorex/components/selection-list';\nimport { AXSkeletonModule } from '@acorex/components/skeleton';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { isEqual } from 'lodash-es';\nimport { resolvePersistedEntityId } from '../../../permissions/resolve-persisted-entity-id.util';\nimport { AXMUserRoleGrantService } from '../../user-role-grant.service';\nimport type { UserRoleGrantRow, UserRoleOption } from '../../user-role-grant.types';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst USER_ROLES_DISCARD_COMMAND = 'User:Roles:Discard';\nconst USER_ROLES_SAVE_COMMAND = 'User:Roles:Save';\n\n//#endregion\n\n//#region ----- Component -----\n\n/**\n * User detail/create wizard page that edits scoped UserRole assignments.\n */\n@Component({\n selector: 'axm-user-roles-page',\n standalone: true,\n imports: [\n AXPStateMessageComponent,\n AXSelectionListModule,\n AXSkeletonModule,\n AXTranslationModule,\n AsyncPipe,\n FormsModule,\n ],\n templateUrl: './user-roles-page.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMUserRolesPageComponent,\n },\n ],\n host: {\n class: 'flex h-full min-h-0 flex-1 flex-col overflow-hidden',\n },\n})\nexport class AXMUserRolesPageComponent extends AXPPageLayoutBaseComponent {\n //#region ----- Inputs -----\n\n rootContext = input<Record<string, unknown>>();\n pageConfig = input<Record<string, unknown>>();\n\n //#endregion\n\n //#region ----- Services & Dependencies -----\n\n private readonly grantService = inject(AXMUserRoleGrantService);\n private readonly hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n\n //#endregion\n\n //#region ----- State Signals -----\n\n private readonly loadedUserId = signal<string | undefined>(undefined);\n private readonly existingGrant = signal<UserRoleGrantRow | null>(null);\n private readonly baselineRoleIds = signal<string[]>([]);\n protected readonly currentRoleIds = signal<string[]>([]);\n protected readonly roleOptions = signal<UserRoleOption[]>([]);\n protected readonly isLoading = signal(true);\n\n //#endregion\n\n //#region ----- Computed Properties -----\n\n protected readonly userId = computed(() => resolvePersistedEntityId(this.rootContext()));\n\n protected readonly isDirty = computed(() => {\n return !this.areRoleSetsEqual(this.baselineRoleIds(), this.currentRoleIds());\n });\n\n /** System UserRole grants are seeded and not editable in product/platform UI. */\n protected readonly isGrantReadonly = computed(() => {\n const state = this.existingGrant()?.stateInfo;\n return state?.isSystem === true || state?.isImmutable === true;\n });\n\n /** Checkbox + label row placeholders for the loading skeleton */\n protected readonly roleSkeletonPlaceholders = computed(() => [\n 'w-40',\n 'w-28',\n 'w-48',\n 'w-32',\n 'w-44',\n 'w-36',\n 'w-40',\n 'w-52',\n ]);\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n constructor() {\n super();\n effect(() => {\n const id = this.userId();\n untracked(() => {\n void this.loadGrantForUser(id);\n });\n });\n }\n\n //#endregion\n\n //#region ----- Unsaved Changes -----\n\n override hasUnsavedChanges(): boolean {\n return this.isDirty();\n }\n\n //#endregion\n\n //#region ----- Page Actions -----\n\n override async getPrimaryMenuItems(): Promise<AXPActionMenuItem[]> {\n const discardTitle = (await this.translateService.translateAsync('@general:actions.discard.title')) ?? '';\n const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) ?? '';\n const canEdit = !!this.userId() && !this.isLoading() && !this.isGrantReadonly();\n\n const discardAction: AXPLayoutDetailsViewAction = {\n title: discardTitle,\n icon: 'fa-light fa-rotate-left',\n zone: 'footer',\n priority: 'secondary',\n color: 'default',\n visible: canEdit && this.isDirty(),\n command: { name: USER_ROLES_DISCARD_COMMAND, options: {} },\n };\n\n const saveAction: AXPLayoutDetailsViewAction = {\n title: saveTitle,\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer',\n priority: 'primary',\n color: 'primary',\n visible: canEdit && this.isDirty(),\n command: { name: USER_ROLES_SAVE_COMMAND, options: {} },\n };\n\n return [discardAction, saveAction];\n }\n\n //#endregion\n\n //#region ----- Command Handling -----\n\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === USER_ROLES_DISCARD_COMMAND) {\n this.handleDiscard();\n return;\n }\n if (command.name !== USER_ROLES_SAVE_COMMAND) {\n return;\n }\n return this.handleSaveExecute() as unknown as Promise<void>;\n }\n\n private async handleSaveExecute(): AXPCommandExecuteResultPromise {\n const userId = this.userId();\n const scope = this.grantService.resolveSessionScope();\n\n if (!userId || !scope) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n try {\n const roleIds = [...this.currentRoleIds()];\n const saved = await this.grantService.saveGrant({\n existing: this.existingGrant(),\n userId,\n roleIds,\n tenantId: scope.tenantId,\n applicationId: scope.applicationId,\n });\n\n const nextGrant: UserRoleGrantRow = {\n id: String(saved['id'] ?? this.existingGrant()?.id ?? ''),\n userId,\n roleIds,\n scopeInfo: (saved['scopeInfo'] as UserRoleGrantRow['scopeInfo']) ?? this.existingGrant()?.scopeInfo,\n };\n this.existingGrant.set(nextGrant.id ? nextGrant : this.existingGrant());\n this.baselineRoleIds.set([...roleIds]);\n this.currentRoleIds.set([...roleIds]);\n this.grantService.notifyGrantModified(saved);\n this.recompute();\n\n return {\n success: true,\n kind: 'object',\n data: roleIds,\n } as AXPRuntimeCommandResult;\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to save roles.';\n return {\n success: false,\n message: { text: message },\n };\n }\n }\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected onRolesValueChanged(event: AXValueChangedEvent): void {\n if (!event.isUserInteraction || this.isGrantReadonly()) {\n return;\n }\n\n const next = Array.isArray(event.value)\n ? event.value.map(String)\n : event.value != null\n ? [String(event.value)]\n : [];\n\n this.currentRoleIds.set(next);\n this.recompute();\n }\n\n private handleDiscard(): void {\n this.currentRoleIds.set([...this.baselineRoleIds()]);\n this.recompute();\n }\n\n //#endregion\n\n //#region ----- Wizard step context -----\n\n override getWizardStepContext(): Record<string, unknown> | null {\n return null;\n }\n\n //#endregion\n\n //#region ----- Data Loading -----\n\n private async loadGrantForUser(userId: string | undefined): Promise<void> {\n if (!userId) {\n this.loadedUserId.set(undefined);\n this.existingGrant.set(null);\n this.baselineRoleIds.set([]);\n this.currentRoleIds.set([]);\n this.roleOptions.set([]);\n this.isLoading.set(false);\n this.recompute();\n return;\n }\n\n if (userId === this.loadedUserId() && !this.isLoading()) {\n return;\n }\n\n this.isLoading.set(true);\n this.recompute();\n\n const scope = this.grantService.resolveSessionScope();\n if (!scope) {\n this.loadedUserId.set(userId);\n this.existingGrant.set(null);\n this.baselineRoleIds.set([]);\n this.currentRoleIds.set([]);\n this.isLoading.set(false);\n this.recompute();\n return;\n }\n\n try {\n const grant = await this.grantService.findGrant(userId, scope.tenantId, scope.applicationId);\n const roleIds = [...(grant?.roleIds ?? [])];\n const options = await this.grantService.listRoleOptions(roleIds);\n this.loadedUserId.set(userId);\n this.existingGrant.set(grant);\n this.baselineRoleIds.set(roleIds);\n this.currentRoleIds.set([...roleIds]);\n this.roleOptions.set(options);\n } catch {\n this.loadedUserId.set(userId);\n this.existingGrant.set(null);\n this.baselineRoleIds.set([]);\n this.currentRoleIds.set([]);\n this.roleOptions.set([]);\n } finally {\n this.isLoading.set(false);\n this.recompute();\n }\n }\n\n //#endregion\n\n //#region ----- Utility Methods -----\n\n private areRoleSetsEqual(a: string[], b: string[]): boolean {\n return isEqual([...a].sort(), [...b].sort());\n }\n\n protected override recompute(): void {\n super.recompute();\n const maybeLayout = this.hostPageLayout as unknown as { recompute?: () => void };\n maybeLayout?.recompute?.();\n }\n\n //#endregion\n}\n\n//#endregion\n","@if (isLoading()) {\n <!-- ----- Skeleton while UserRole grant loads for the current workspace ----- -->\n <div class=\"flex h-full min-h-0 flex-1 flex-col overflow-auto p-4\" aria-hidden=\"true\">\n <div class=\"user-roles-frame rounded border border-default bg-lightest p-4\">\n <div class=\"mb-4 h-4 w-3/5 max-w-md rounded-md overflow-hidden\">\n <ax-skeleton\n [animated]=\"true\"\n style=\"display: block; width: 100%; height: 100%\"\n ></ax-skeleton>\n </div>\n <div class=\"flex flex-col gap-3\">\n @for (widthClass of roleSkeletonPlaceholders(); track $index) {\n <!-- ----- One checkbox + label row placeholder ----- -->\n <div class=\"flex items-center gap-3\">\n <div class=\"h-4 w-4 shrink-0 rounded-sm overflow-hidden\">\n <ax-skeleton\n [animated]=\"true\"\n style=\"display: block; width: 100%; height: 100%\"\n ></ax-skeleton>\n </div>\n <div class=\"h-4 max-w-full rounded-md overflow-hidden\" [class]=\"widthClass\">\n <ax-skeleton\n [animated]=\"true\"\n style=\"display: block; width: 100%; height: 100%\"\n ></ax-skeleton>\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n}\n<!-- ----- User must be persisted before role grants can be edited ----- -->\n@else if (!userId()) {\n <div class=\"flex h-full min-h-[20rem] items-center justify-center p-6\">\n <axp-state-message\n [title]=\"'@security-management:users.entities.user.pages.roles.save-user-first.title'\"\n [description]=\"'@security-management:users.entities.user.pages.roles.save-user-first.description'\"\n ></axp-state-message>\n </div>\n}\n<!-- ----- Scoped role checklist for the current tenant/application ----- -->\n@else {\n <div class=\"flex h-full min-h-0 flex-1 flex-col overflow-auto p-4\">\n <div class=\"user-roles-frame rounded border border-default bg-lightest p-4\">\n <p class=\"mb-4 text-sm opacity-70\">\n {{ '@security-management:users.entities.user.pages.roles.description' | translate | async }}\n </p>\n <ax-selection-list\n class=\"w-full\"\n valueField=\"id\"\n textField=\"title\"\n look=\"solid\"\n direction=\"vertical\"\n [multiple]=\"true\"\n [showControl]=\"true\"\n [items]=\"roleOptions()\"\n [ngModel]=\"currentRoleIds()\"\n [disabled]=\"isGrantReadonly()\"\n [readonly]=\"isGrantReadonly()\"\n (onValueChanged)=\"onRolesValueChanged($event)\"\n ></ax-selection-list>\n </div>\n </div>\n}\n","//#region ----- Imports -----\n\nimport {\n AXPPageComponentDefinition,\n AXPPageComponentProvider,\n} from '@acorex-platform/framework-client/layout/components';\nimport { USER_ROLES_PAGE_COMPONENT_KEY } from '@acorex-platform/module-security-management-client/contracts';\nimport { Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ----- Provider -----\n\n@Injectable()\nexport class AXMUserRolesPageComponentProvider implements AXPPageComponentProvider {\n async components(): Promise<AXPPageComponentDefinition[]> {\n return [\n {\n key: USER_ROLES_PAGE_COMPONENT_KEY,\n loader: () =>\n import('./user-roles-page.component').then((m) => m.AXMUserRolesPageComponent),\n },\n ];\n }\n}\n\n//#endregion\n"],"names":["i2","i3","i4"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA;AAEA;AAEA,MAAM,0BAA0B,GAAG,oBAAoB;AACvD,MAAM,uBAAuB,GAAG,iBAAiB;AAEjD;AAEA;AAEA;;AAEG;AAwBG,MAAO,yBAA0B,SAAQ,0BAA0B,CAAA;;;AAwDvE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAtDT,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAA2B;AAC9C,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK;kGAA2B;;;AAM5B,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC9C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;;QAM9E,IAAA,CAAA,YAAY,GAAG,MAAM,CAAqB,SAAS;yFAAC;QACpD,IAAA,CAAA,aAAa,GAAG,MAAM,CAA0B,IAAI;0FAAC;QACrD,IAAA,CAAA,eAAe,GAAG,MAAM,CAAW,EAAE;4FAAC;QACpC,IAAA,CAAA,cAAc,GAAG,MAAM,CAAW,EAAE;2FAAC;QACrC,IAAA,CAAA,WAAW,GAAG,MAAM,CAAmB,EAAE;wFAAC;QAC1C,IAAA,CAAA,SAAS,GAAG,MAAM,CAA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AAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,yBAA2B;AACvC,yBAAA;qBACF,EAAA,IAAA,EACK;AACJ,wBAAA,KAAK,EAAE,qDAAqD;AAC7D,qBAAA,EAAA,QAAA,EAAA,gpFAAA,EAAA;;;;;;;;AE1DH;AAEA;MAGa,iCAAiC,CAAA;AAC5C,IAAA,MAAM,UAAU,GAAA;QACd,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,6BAA6B;AAClC,gBAAA,MAAM,EAAE,MACN,uEAAqC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC;AACjF,aAAA;SACF;IACH;8GATW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjC,iCAAiC,EAAA,CAAA,CAAA;;2FAAjC,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C;;;"}
@@ -0,0 +1,370 @@
1
+ import { AXDialogService } from '@acorex/components/dialog';
2
+ import { AXToastService } from '@acorex/components/toast';
3
+ import { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';
4
+ import { AXPSessionService } from '@acorex-platform/framework-client/auth';
5
+ import { AXPLayoutBuilderService, resolveLayoutBuilderDialogResult } from '@acorex-platform/framework-client/layout/builder';
6
+ import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
7
+ import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';
8
+ import { resolveEntityActionCommandInput } from '@acorex-platform/framework-shared/runtime';
9
+ import { AXMSecurityManagementServerCommands, normalizeInviteApplicationRoleAssignments, flattenInviteApplicationRoleAssignments } from '@acorex-platform/module-security-management-client/contracts';
10
+ export { AXM_USER_INVITE_COMMAND } from '@acorex-platform/module-security-management-client/contracts';
11
+ import * as i0 from '@angular/core';
12
+ import { inject, Injectable } from '@angular/core';
13
+ import { A as AXMUserRoleGrantService } from './acorex-platform-module-security-management-client-user-role-grant.service-6U17jzjq.mjs';
14
+
15
+ /** TM edition feature — multi-app invite (ADR-TEN-001 D-05). String avoids client↔client package edge. */
16
+ const INVITE_MULTI_APPLICATION_FEATURE = 'TenantManagement:Feature:InviteMultiApplication';
17
+ /** Tenant-wide invite surface only — Application Users (Security.User) stay app-scoped. */
18
+ const TENANT_USER_ENTITY = 'TenantManagement.TenantUser';
19
+ const TENANT_USER_ENTITY_NAME = 'TenantUser';
20
+ //#endregion
21
+ //#region ---- Invite user command ----
22
+ class AXPInviteUserCommand {
23
+ constructor() {
24
+ this.layoutBuilder = inject(AXPLayoutBuilderService);
25
+ this.commandService = inject(AXPCommandService);
26
+ this.dialogService = inject(AXDialogService);
27
+ this.toastService = inject(AXToastService);
28
+ this.translationService = inject(AXTranslationService);
29
+ this.sessionService = inject(AXPSessionService);
30
+ this.userRoleGrantService = inject(AXMUserRoleGrantService);
31
+ }
32
+ async execute(input) {
33
+ const actionInput = resolveEntityActionCommandInput(input);
34
+ const form = await this.openInviteDialog(actionInput);
35
+ if (!form) {
36
+ return { success: true, kind: 'object', data: { outcome: 'cancelled' } };
37
+ }
38
+ const webOrigin = typeof window !== 'undefined' ? window.location.origin : undefined;
39
+ const tenantMembershipInvite = this.allowsMultiApplicationInvite(actionInput);
40
+ const remotePayload = this.toRemotePayload(form, tenantMembershipInvite, webOrigin);
41
+ // Nested server call must skip toast middleware — this command owns UX toasts.
42
+ let result = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.InviteUser, remotePayload);
43
+ const payload = result?.data;
44
+ if (result?.success && payload?.userAlreadyExists && !payload.sent) {
45
+ const title = await this.translationService
46
+ .translateAsync('@security-management:users.entities.user.actions.invite.existing-warning-title')
47
+ .catch(() => 'User Already Exists');
48
+ const message = await this.translationService
49
+ .translateAsync('@security-management:users.entities.user.actions.invite.existing-warning-message', {
50
+ params: { email: form.email },
51
+ })
52
+ .catch(() => `A user with email ${form.email} already exists. Send an invitation to join this tenant?`);
53
+ const confirmed = await this.dialogService.confirm(title, message, 'warning', 'horizontal');
54
+ if (!confirmed.result) {
55
+ return { success: true, kind: 'object', data: { outcome: 'cancelled' } };
56
+ }
57
+ result = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.InviteUser, {
58
+ ...remotePayload,
59
+ confirmExisting: true,
60
+ });
61
+ }
62
+ if (result?.success) {
63
+ const [toastTitle, toastContent] = await Promise.all([
64
+ this.translationService
65
+ .translateAsync('@security-management:users.entities.user.actions.invite.success.title')
66
+ .catch(() => 'Invitation Sent'),
67
+ this.translationService
68
+ .translateAsync('@security-management:users.entities.user.actions.invite.success.description')
69
+ .catch(() => 'The invitation email was sent.'),
70
+ ]);
71
+ this.toastService.show({ color: 'success', title: toastTitle, content: toastContent, timeOut: 3000 });
72
+ return { success: true, kind: 'object', data: result.data };
73
+ }
74
+ const [toastTitle, fallback] = await Promise.all([
75
+ this.translationService
76
+ .translateAsync('@security-management:users.entities.user.actions.invite.error.title')
77
+ .catch(() => 'Invite Failed'),
78
+ this.translationService
79
+ .translateAsync('@security-management:users.entities.user.actions.invite.error.description')
80
+ .catch(() => 'Failed to invite user.'),
81
+ ]);
82
+ const toastContent = (typeof result?.message?.text === 'string' && result.message.text) || fallback;
83
+ this.toastService.show({ color: 'danger', title: toastTitle, content: toastContent, timeOut: 4000 });
84
+ // No `message` — outer command toast middleware would duplicate this toast.
85
+ return { success: false };
86
+ }
87
+ /**
88
+ * Multi-app selector only for TM → Tenant Users invite (ADR D-05).
89
+ * Security → Users (even inside TM) stays current-application only.
90
+ */
91
+ allowsMultiApplicationInvite(actionInput) {
92
+ if (!this.sessionService.isFeatureEnabled(INVITE_MULTI_APPLICATION_FEATURE)) {
93
+ return false;
94
+ }
95
+ const entity = actionInput.entity ?? '';
96
+ const name = actionInput.entityInfo?.name ?? '';
97
+ return entity === TENANT_USER_ENTITY || name === TENANT_USER_ENTITY_NAME;
98
+ }
99
+ toRemotePayload(form, tenantMembershipInvite, webOrigin) {
100
+ const base = {
101
+ email: form.email,
102
+ displayName: form.displayName,
103
+ tenantMembershipInvite,
104
+ webOrigin,
105
+ };
106
+ if (!tenantMembershipInvite) {
107
+ return {
108
+ ...base,
109
+ roleIds: form.roleIds,
110
+ };
111
+ }
112
+ // Same application on multiple rows → one assignment with union of roleIds.
113
+ const assignments = normalizeInviteApplicationRoleAssignments(form.applicationRoleRows);
114
+ const flat = flattenInviteApplicationRoleAssignments(assignments);
115
+ return {
116
+ ...base,
117
+ applicationIds: flat.applicationIds,
118
+ roleIds: flat.roleIds.length > 0 ? flat.roleIds : undefined,
119
+ applicationRoleAssignments: assignments,
120
+ };
121
+ }
122
+ async loadEntitledApplicationOptions() {
123
+ const result = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.ListTenantEntitledApplications, {});
124
+ if (!result?.success) {
125
+ return [];
126
+ }
127
+ const payload = result?.data;
128
+ const items = Array.isArray(payload?.items) ? payload.items : [];
129
+ const locale = this.translationService.getActiveLang?.() ?? 'en-US';
130
+ return items
131
+ .map((item) => {
132
+ const id = String(item?.id ?? '').trim();
133
+ if (!id) {
134
+ return null;
135
+ }
136
+ const title = resolveMultiLanguageString(item.title, locale).trim() || id;
137
+ return { id, title };
138
+ })
139
+ .filter((row) => row != null);
140
+ }
141
+ async loadTenantUserInviteRoleOptions(applicationId) {
142
+ const result = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.ListInviteAssignableRoles, applicationId ? { applicationId } : {});
143
+ if (!result?.success) {
144
+ return [];
145
+ }
146
+ const payload = result?.data;
147
+ const items = Array.isArray(payload?.items) ? payload.items : [];
148
+ const locale = this.translationService.getActiveLang?.() ?? 'en-US';
149
+ return items
150
+ .map((item) => {
151
+ const id = String(item?.id ?? '').trim();
152
+ const applicationId = String(item?.applicationId ?? '').trim();
153
+ if (!id || !applicationId) {
154
+ return null;
155
+ }
156
+ const title = resolveMultiLanguageString(item.title, locale).trim() || id;
157
+ return { id, title, applicationId };
158
+ })
159
+ .filter((row) => row != null);
160
+ }
161
+ /**
162
+ * Per-row Application + Roles. Duplicate apps are allowed in the UI; submit merges them
163
+ * (`normalizeInviteApplicationRoleAssignments`). Isolation (do not regress):
164
+ * - Roles reset only on `events.context('>applicationId')` (this row). Never `*applicationId`.
165
+ * - Roles `filter` equal `>applicationId`; titles come from the combo array, not lookup ids.
166
+ * - Do not hide selected apps from other rows (`excludeIds` / `filter` not-in).
167
+ */
168
+ buildApplicationRoleRepeaterChildren(entitledApps, roleOptions) {
169
+ return [
170
+ {
171
+ type: AXPWidgetsList.Layouts.FlexLayout,
172
+ mode: 'edit',
173
+ options: {
174
+ flexDirection: 'row',
175
+ gap: '12px',
176
+ alignItems: 'flex-end',
177
+ wrap: 'nowrap',
178
+ },
179
+ children: [
180
+ {
181
+ type: AXPWidgetsList.Layouts.FlexItemLayout,
182
+ mode: 'edit',
183
+ options: { grow: '1', shrink: '1', basis: '0' },
184
+ children: [
185
+ {
186
+ type: AXPWidgetsList.Layouts.FormField,
187
+ mode: 'edit',
188
+ options: {
189
+ label: '@security-management:users.entities.user.actions.invite.fields.application',
190
+ showLabel: true,
191
+ },
192
+ children: [
193
+ {
194
+ type: AXPWidgetsList.Editors.SelectBox,
195
+ mode: 'edit',
196
+ path: 'applicationId',
197
+ name: 'applicationId',
198
+ options: {
199
+ dataSource: entitledApps,
200
+ valueField: 'id',
201
+ textField: 'title',
202
+ allowSearch: true,
203
+ validations: [{ rule: 'required' }],
204
+ },
205
+ },
206
+ ],
207
+ },
208
+ ],
209
+ },
210
+ {
211
+ type: AXPWidgetsList.Layouts.FlexItemLayout,
212
+ mode: 'edit',
213
+ options: { grow: '1', shrink: '1', basis: '0' },
214
+ children: [
215
+ {
216
+ type: AXPWidgetsList.Layouts.FormField,
217
+ mode: 'edit',
218
+ options: {
219
+ label: '@security-management:users.entities.user.actions.invite.fields.roles',
220
+ showLabel: true,
221
+ },
222
+ children: [
223
+ {
224
+ type: AXPWidgetsList.Editors.SelectBox,
225
+ mode: 'edit',
226
+ path: 'roleIds',
227
+ name: 'roleIds',
228
+ options: {
229
+ dataSource: roleOptions,
230
+ valueField: 'id',
231
+ textField: 'title',
232
+ multiple: true,
233
+ allowSearch: true,
234
+ disabled: "{{ !context.eval('>applicationId') }}",
235
+ filter: {
236
+ field: 'applicationId',
237
+ operator: { type: 'equal' },
238
+ value: "{{ context.eval('>applicationId') }}",
239
+ },
240
+ },
241
+ triggers: [
242
+ {
243
+ event: "{{ events.context('>applicationId') }}",
244
+ action: '{{ widget.setValue([]); widget.refresh(); }}',
245
+ },
246
+ ],
247
+ },
248
+ ],
249
+ },
250
+ ],
251
+ },
252
+ ],
253
+ },
254
+ ];
255
+ }
256
+ async openInviteDialog(actionInput) {
257
+ const multiApp = this.allowsMultiApplicationInvite(actionInput);
258
+ const [entitledApps, inviteRoleOptions, roleOptions] = await Promise.all([
259
+ multiApp ? this.loadEntitledApplicationOptions() : Promise.resolve([]),
260
+ multiApp ? this.loadTenantUserInviteRoleOptions() : Promise.resolve([]),
261
+ multiApp
262
+ ? Promise.resolve([])
263
+ : this.userRoleGrantService.listInviteRoleOptions('application'),
264
+ ]);
265
+ const appsWithRoles = new Set(inviteRoleOptions.map((row) => row.applicationId));
266
+ const selectableApps = appsWithRoles.size > 0
267
+ ? entitledApps.filter((app) => appsWithRoles.has(app.id))
268
+ : entitledApps;
269
+ const result = await this.layoutBuilder
270
+ .create()
271
+ .dialog((dialog) => {
272
+ dialog
273
+ .setTitle('@security-management:users.entities.user.actions.invite.dialog.title')
274
+ .setSize(multiApp ? 'lg' : 'md')
275
+ .setCloseButton(true)
276
+ .setContext(multiApp
277
+ ? {
278
+ email: '',
279
+ displayName: '',
280
+ applicationRoleRows: [{ applicationId: '', roleIds: [] }],
281
+ }
282
+ : { email: '', displayName: '', roleIds: [] })
283
+ .content((flex) => {
284
+ flex
285
+ .setDirection('column')
286
+ .setGap('12px')
287
+ .formField('@security-management:users.entities.user.actions.invite.fields.email', (field) => {
288
+ field.path('email');
289
+ field.textBox({ validations: [{ rule: 'required' }, { rule: 'email' }] });
290
+ })
291
+ .formField('@security-management:users.entities.user.actions.invite.fields.display-name', (field) => {
292
+ field.path('displayName');
293
+ field.textBox({});
294
+ });
295
+ // TM Tenant Users: repeater of application + roles for that app (ADR D-05).
296
+ if (multiApp) {
297
+ flex.formField('@security-management:users.entities.user.actions.invite.fields.application-roles', (field) => {
298
+ field.path('applicationRoleRows');
299
+ field.setShowLabel(true);
300
+ field.customWidget(AXPWidgetsList.Layouts.RepeaterLayout, {
301
+ hasControls: true,
302
+ inlineAddControl: true,
303
+ defaultItem: { applicationId: '', roleIds: [] },
304
+ children: this.buildApplicationRoleRepeaterChildren(selectableApps, inviteRoleOptions),
305
+ });
306
+ });
307
+ }
308
+ else {
309
+ flex.formField('@security-management:users.entities.user.actions.invite.fields.roles', (field) => {
310
+ field.path('roleIds');
311
+ field.selectBox({
312
+ dataSource: roleOptions,
313
+ valueField: 'id',
314
+ textField: 'title',
315
+ multiple: true,
316
+ });
317
+ });
318
+ }
319
+ })
320
+ .setActions((actions) => {
321
+ actions.cancel('@general:actions.cancel.title');
322
+ actions.submit('@security-management:users.entities.user.actions.invite.dialog.submit');
323
+ })
324
+ .onAction(async (dialogRef) => {
325
+ if (dialogRef.action() === 'cancel') {
326
+ return null;
327
+ }
328
+ const ctx = dialogRef.context();
329
+ const email = (ctx.email ?? '').trim();
330
+ if (!email) {
331
+ throw new Error('@security-management:users.entities.user.actions.invite.errors.email-required');
332
+ }
333
+ if (multiApp) {
334
+ // Duplicate application rows merge; one app with all selected roles is sent.
335
+ const assignments = normalizeInviteApplicationRoleAssignments(ctx.applicationRoleRows);
336
+ if (assignments.length === 0) {
337
+ throw new Error('@security-management:users.entities.user.actions.invite.errors.application-required');
338
+ }
339
+ if (assignments.some((row) => row.roleIds.length === 0)) {
340
+ throw new Error('@security-management:users.entities.user.actions.invite.errors.roles-required');
341
+ }
342
+ return {
343
+ email,
344
+ displayName: (ctx.displayName ?? '').trim() || undefined,
345
+ applicationRoleRows: assignments,
346
+ };
347
+ }
348
+ const roleIds = Array.isArray(ctx.roleIds)
349
+ ? [...new Set(ctx.roleIds.map((id) => String(id).trim()).filter(Boolean))]
350
+ : [];
351
+ return {
352
+ email,
353
+ displayName: (ctx.displayName ?? '').trim() || undefined,
354
+ roleIds: roleIds.length > 0 ? roleIds : undefined,
355
+ };
356
+ });
357
+ })
358
+ .show();
359
+ return resolveLayoutBuilderDialogResult(result);
360
+ }
361
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInviteUserCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
362
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInviteUserCommand, providedIn: 'root' }); }
363
+ }
364
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPInviteUserCommand, decorators: [{
365
+ type: Injectable,
366
+ args: [{ providedIn: 'root' }]
367
+ }] });
368
+
369
+ export { AXPInviteUserCommand };
370
+ //# sourceMappingURL=acorex-platform-module-security-management-client-invite-user.command-ClQ6WxxN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-security-management-client-invite-user.command-ClQ6WxxN.mjs","sources":["../../../../libs/modules/security-management/client/src/lib/commands/invite-user.command.ts"],"sourcesContent":["import { AXDialogService } from '@acorex/components/dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { AXPWidgetsList } from '@acorex-platform/framework-shared/core';\nimport type {\n AXPCommand,\n AXPCommandExecuteResultPromise,\n AXPEntityActionCommandInput,\n} from '@acorex-platform/framework-shared/runtime';\nimport { resolveEntityActionCommandInput } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXM_USER_INVITE_COMMAND,\n AXMSecurityManagementServerCommands,\n flattenInviteApplicationRoleAssignments,\n normalizeInviteApplicationRoleAssignments,\n type AXMInviteUserResult,\n type AXMListInviteAssignableRolesResult,\n type AXMListTenantEntitledApplicationsResult,\n} from '@acorex-platform/module-security-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\nimport { AXMUserRoleGrantService } from '../features/user-roles/user-role-grant.service';\nimport type { UserRoleOption } from '../features/user-roles/user-role-grant.types';\n\n//#region ---- Types ----\n\ninterface InviteApplicationRoleRow {\n id?: string;\n applicationId?: string;\n roleIds?: string[];\n}\n\ninterface InviteFormResult {\n email: string;\n displayName?: string;\n applicationIds?: string[];\n roleIds?: string[];\n applicationRoleRows?: InviteApplicationRoleRow[];\n}\n\ninterface EntitledApplicationOption {\n id: string;\n title: string;\n}\n\ninterface InviteRoleOption {\n id: string;\n title: string;\n applicationId: string;\n}\n\ninterface InviteRemotePayload {\n email: string;\n displayName?: string;\n applicationIds?: string[];\n roleIds?: string[];\n applicationRoleAssignments?: Array<{ applicationId: string; roleIds: string[] }>;\n tenantMembershipInvite: boolean;\n confirmExisting?: boolean;\n webOrigin?: string;\n}\n\n/** TM edition feature — multi-app invite (ADR-TEN-001 D-05). String avoids client↔client package edge. */\nconst INVITE_MULTI_APPLICATION_FEATURE = 'TenantManagement:Feature:InviteMultiApplication';\n\n/** Tenant-wide invite surface only — Application Users (Security.User) stay app-scoped. */\nconst TENANT_USER_ENTITY = 'TenantManagement.TenantUser';\nconst TENANT_USER_ENTITY_NAME = 'TenantUser';\n\n//#endregion\n\n//#region ---- Invite user command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXPInviteUserCommand implements AXPCommand {\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly commandService = inject(AXPCommandService);\n private readonly dialogService = inject(AXDialogService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly userRoleGrantService = inject(AXMUserRoleGrantService);\n\n async execute(input?: unknown): AXPCommandExecuteResultPromise {\n const actionInput = resolveEntityActionCommandInput(input);\n const form = await this.openInviteDialog(actionInput);\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n const webOrigin = typeof window !== 'undefined' ? window.location.origin : undefined;\n const tenantMembershipInvite = this.allowsMultiApplicationInvite(actionInput);\n const remotePayload = this.toRemotePayload(form, tenantMembershipInvite, webOrigin);\n\n // Nested server call must skip toast middleware — this command owns UX toasts.\n let result = await this.commandService.executeRemote(\n AXMSecurityManagementServerCommands.InviteUser,\n remotePayload,\n );\n\n const payload = (result as { data?: AXMInviteUserResult })?.data;\n if (result?.success && payload?.userAlreadyExists && !payload.sent) {\n const title = await this.translationService\n .translateAsync('@security-management:users.entities.user.actions.invite.existing-warning-title')\n .catch(() => 'User Already Exists');\n const message = await this.translationService\n .translateAsync('@security-management:users.entities.user.actions.invite.existing-warning-message', {\n params: { email: form.email },\n })\n .catch(() => `A user with email ${form.email} already exists. Send an invitation to join this tenant?`);\n const confirmed = await this.dialogService.confirm(title, message, 'warning', 'horizontal');\n if (!confirmed.result) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n result = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.InviteUser, {\n ...remotePayload,\n confirmExisting: true,\n });\n }\n\n if (result?.success) {\n const [toastTitle, toastContent] = await Promise.all([\n this.translationService\n .translateAsync('@security-management:users.entities.user.actions.invite.success.title')\n .catch(() => 'Invitation Sent'),\n this.translationService\n .translateAsync('@security-management:users.entities.user.actions.invite.success.description')\n .catch(() => 'The invitation email was sent.'),\n ]);\n this.toastService.show({ color: 'success', title: toastTitle, content: toastContent, timeOut: 3000 });\n return { success: true, kind: 'object', data: result.data };\n }\n\n const [toastTitle, fallback] = await Promise.all([\n this.translationService\n .translateAsync('@security-management:users.entities.user.actions.invite.error.title')\n .catch(() => 'Invite Failed'),\n this.translationService\n .translateAsync('@security-management:users.entities.user.actions.invite.error.description')\n .catch(() => 'Failed to invite user.'),\n ]);\n const toastContent =\n (typeof result?.message?.text === 'string' && result.message.text) || fallback;\n this.toastService.show({ color: 'danger', title: toastTitle, content: toastContent, timeOut: 4000 });\n // No `message` — outer command toast middleware would duplicate this toast.\n return { success: false };\n }\n\n /**\n * Multi-app selector only for TM → Tenant Users invite (ADR D-05).\n * Security → Users (even inside TM) stays current-application only.\n */\n private allowsMultiApplicationInvite(actionInput: AXPEntityActionCommandInput): boolean {\n if (!this.sessionService.isFeatureEnabled(INVITE_MULTI_APPLICATION_FEATURE)) {\n return false;\n }\n const entity = actionInput.entity ?? '';\n const name = actionInput.entityInfo?.name ?? '';\n return entity === TENANT_USER_ENTITY || name === TENANT_USER_ENTITY_NAME;\n }\n\n private toRemotePayload(\n form: InviteFormResult,\n tenantMembershipInvite: boolean,\n webOrigin: string | undefined,\n ): InviteRemotePayload {\n const base: InviteRemotePayload = {\n email: form.email,\n displayName: form.displayName,\n tenantMembershipInvite,\n webOrigin,\n };\n\n if (!tenantMembershipInvite) {\n return {\n ...base,\n roleIds: form.roleIds,\n };\n }\n\n // Same application on multiple rows → one assignment with union of roleIds.\n const assignments = normalizeInviteApplicationRoleAssignments(form.applicationRoleRows);\n const flat = flattenInviteApplicationRoleAssignments(assignments);\n return {\n ...base,\n applicationIds: flat.applicationIds,\n roleIds: flat.roleIds.length > 0 ? flat.roleIds : undefined,\n applicationRoleAssignments: assignments,\n };\n }\n\n private async loadEntitledApplicationOptions(): Promise<EntitledApplicationOption[]> {\n const result = await this.commandService.executeRemote(\n AXMSecurityManagementServerCommands.ListTenantEntitledApplications,\n {},\n );\n if (!result?.success) {\n return [];\n }\n const payload = (result as { data?: AXMListTenantEntitledApplicationsResult })?.data;\n const items = Array.isArray(payload?.items) ? payload.items : [];\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n return items\n .map((item) => {\n const id = String(item?.id ?? '').trim();\n if (!id) {\n return null;\n }\n const title =\n resolveMultiLanguageString(item.title as never, locale).trim() || id;\n return { id, title };\n })\n .filter((row): row is EntitledApplicationOption => row != null);\n }\n\n private async loadTenantUserInviteRoleOptions(applicationId?: string): Promise<InviteRoleOption[]> {\n const result = await this.commandService.executeRemote(\n AXMSecurityManagementServerCommands.ListInviteAssignableRoles,\n applicationId ? { applicationId } : {},\n );\n if (!result?.success) {\n return [];\n }\n const payload = (result as { data?: AXMListInviteAssignableRolesResult })?.data;\n const items = Array.isArray(payload?.items) ? payload.items : [];\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n return items\n .map((item) => {\n const id = String(item?.id ?? '').trim();\n const applicationId = String(item?.applicationId ?? '').trim();\n if (!id || !applicationId) {\n return null;\n }\n const title =\n resolveMultiLanguageString(item.title as never, locale).trim() || id;\n return { id, title, applicationId };\n })\n .filter((row): row is InviteRoleOption => row != null);\n }\n\n /**\n * Per-row Application + Roles. Duplicate apps are allowed in the UI; submit merges them\n * (`normalizeInviteApplicationRoleAssignments`). Isolation (do not regress):\n * - Roles reset only on `events.context('>applicationId')` (this row). Never `*applicationId`.\n * - Roles `filter` equal `>applicationId`; titles come from the combo array, not lookup ids.\n * - Do not hide selected apps from other rows (`excludeIds` / `filter` not-in).\n */\n private buildApplicationRoleRepeaterChildren(\n entitledApps: EntitledApplicationOption[],\n roleOptions: InviteRoleOption[],\n ): Record<string, unknown>[] {\n return [\n {\n type: AXPWidgetsList.Layouts.FlexLayout,\n mode: 'edit' as const,\n options: {\n flexDirection: 'row',\n gap: '12px',\n alignItems: 'flex-end',\n wrap: 'nowrap',\n },\n children: [\n {\n type: AXPWidgetsList.Layouts.FlexItemLayout,\n mode: 'edit' as const,\n options: { grow: '1', shrink: '1', basis: '0' },\n children: [\n {\n type: AXPWidgetsList.Layouts.FormField,\n mode: 'edit' as const,\n options: {\n label:\n '@security-management:users.entities.user.actions.invite.fields.application',\n showLabel: true,\n },\n children: [\n {\n type: AXPWidgetsList.Editors.SelectBox,\n mode: 'edit' as const,\n path: 'applicationId',\n name: 'applicationId',\n options: {\n dataSource: entitledApps,\n valueField: 'id',\n textField: 'title',\n allowSearch: true,\n validations: [{ rule: 'required' }],\n },\n },\n ],\n },\n ],\n },\n {\n type: AXPWidgetsList.Layouts.FlexItemLayout,\n mode: 'edit' as const,\n options: { grow: '1', shrink: '1', basis: '0' },\n children: [\n {\n type: AXPWidgetsList.Layouts.FormField,\n mode: 'edit' as const,\n options: {\n label: '@security-management:users.entities.user.actions.invite.fields.roles',\n showLabel: true,\n },\n children: [\n {\n type: AXPWidgetsList.Editors.SelectBox,\n mode: 'edit' as const,\n path: 'roleIds',\n name: 'roleIds',\n options: {\n dataSource: roleOptions,\n valueField: 'id',\n textField: 'title',\n multiple: true,\n allowSearch: true,\n disabled: \"{{ !context.eval('>applicationId') }}\",\n filter: {\n field: 'applicationId',\n operator: { type: 'equal' },\n value: \"{{ context.eval('>applicationId') }}\",\n },\n },\n triggers: [\n {\n event: \"{{ events.context('>applicationId') }}\",\n action: '{{ widget.setValue([]); widget.refresh(); }}',\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n },\n ];\n }\n\n private async openInviteDialog(\n actionInput: AXPEntityActionCommandInput,\n ): Promise<InviteFormResult | null> {\n const multiApp = this.allowsMultiApplicationInvite(actionInput);\n const [entitledApps, inviteRoleOptions, roleOptions] = await Promise.all([\n multiApp ? this.loadEntitledApplicationOptions() : Promise.resolve([] as EntitledApplicationOption[]),\n multiApp ? this.loadTenantUserInviteRoleOptions() : Promise.resolve([] as InviteRoleOption[]),\n multiApp\n ? Promise.resolve([] as UserRoleOption[])\n : this.userRoleGrantService.listInviteRoleOptions('application'),\n ]);\n const appsWithRoles = new Set(inviteRoleOptions.map((row) => row.applicationId));\n const selectableApps =\n appsWithRoles.size > 0\n ? entitledApps.filter((app) => appsWithRoles.has(app.id))\n : entitledApps;\n\n const result = await this.layoutBuilder\n .create()\n .dialog<InviteFormResult | null>((dialog) => {\n dialog\n .setTitle('@security-management:users.entities.user.actions.invite.dialog.title')\n .setSize(multiApp ? 'lg' : 'md')\n .setCloseButton(true)\n .setContext(\n multiApp\n ? {\n email: '',\n displayName: '',\n applicationRoleRows: [{ applicationId: '', roleIds: [] }],\n }\n : { email: '', displayName: '', roleIds: [] },\n )\n .content((flex) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .formField('@security-management:users.entities.user.actions.invite.fields.email', (field) => {\n field.path('email');\n field.textBox({ validations: [{ rule: 'required' }, { rule: 'email' }] });\n })\n .formField('@security-management:users.entities.user.actions.invite.fields.display-name', (field) => {\n field.path('displayName');\n field.textBox({});\n });\n\n // TM Tenant Users: repeater of application + roles for that app (ADR D-05).\n if (multiApp) {\n flex.formField(\n '@security-management:users.entities.user.actions.invite.fields.application-roles',\n (field) => {\n field.path('applicationRoleRows');\n field.setShowLabel(true);\n field.customWidget(AXPWidgetsList.Layouts.RepeaterLayout, {\n hasControls: true,\n inlineAddControl: true,\n defaultItem: { applicationId: '', roleIds: [] },\n children: this.buildApplicationRoleRepeaterChildren(selectableApps, inviteRoleOptions),\n });\n },\n );\n } else {\n flex.formField(\n '@security-management:users.entities.user.actions.invite.fields.roles',\n (field) => {\n field.path('roleIds');\n field.selectBox({\n dataSource: roleOptions as UserRoleOption[],\n valueField: 'id',\n textField: 'title',\n multiple: true,\n });\n },\n );\n }\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@security-management:users.entities.user.actions.invite.dialog.submit');\n })\n .onAction(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return null;\n }\n const ctx = dialogRef.context() as InviteFormResult;\n const email = (ctx.email ?? '').trim();\n if (!email) {\n throw new Error('@security-management:users.entities.user.actions.invite.errors.email-required');\n }\n\n if (multiApp) {\n // Duplicate application rows merge; one app with all selected roles is sent.\n const assignments = normalizeInviteApplicationRoleAssignments(ctx.applicationRoleRows);\n if (assignments.length === 0) {\n throw new Error(\n '@security-management:users.entities.user.actions.invite.errors.application-required',\n );\n }\n if (assignments.some((row) => row.roleIds.length === 0)) {\n throw new Error(\n '@security-management:users.entities.user.actions.invite.errors.roles-required',\n );\n }\n return {\n email,\n displayName: (ctx.displayName ?? '').trim() || undefined,\n applicationRoleRows: assignments,\n };\n }\n\n const roleIds = Array.isArray(ctx.roleIds)\n ? [...new Set(ctx.roleIds.map((id) => String(id).trim()).filter(Boolean))]\n : [];\n return {\n email,\n displayName: (ctx.displayName ?? '').trim() || undefined,\n roleIds: roleIds.length > 0 ? roleIds : undefined,\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<InviteFormResult>(result);\n }\n}\n\nexport { AXM_USER_INVITE_COMMAND };\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmEA;AACA,MAAM,gCAAgC,GAAG,iDAAiD;AAE1F;AACA,MAAM,kBAAkB,GAAG,6BAA6B;AACxD,MAAM,uBAAuB,GAAG,YAAY;AAE5C;AAEA;MAGa,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,uBAAuB,CAAC;AA+XxE,IAAA;IA7XC,MAAM,OAAO,CAAC,KAAe,EAAA;AAC3B,QAAA,MAAM,WAAW,GAAG,+BAA+B,CAAC,KAAK,CAAC;QAC1D,MAAM,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CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;sBACvE,EAAE;gBACN,OAAO;oBACL,KAAK;AACL,oBAAA,WAAW,EAAE,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,SAAS;AACxD,oBAAA,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,OAAO,GAAG,SAAS;iBAClD;AACH,YAAA,CAAC,CAAC;AACN,QAAA,CAAC;AACA,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,gCAAgC,CAAmB,MAAM,CAAC;IACnE;8GArYW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -0,0 +1,76 @@
1
+ import { AXDialogService } from '@acorex/components/dialog';
2
+ import { AXToastService } from '@acorex/components/toast';
3
+ import { AXTranslationService } from '@acorex/core/translation';
4
+ import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
5
+ import { AXMSecurityManagementServerCommands, AXM_JOIN_REQUEST_ERROR_CODES } from '@acorex-platform/module-security-management-client/contracts';
6
+ export { AXM_USER_REJECT_JOIN_REQUEST_COMMAND } from '@acorex-platform/module-security-management-client/contracts';
7
+ import * as i0 from '@angular/core';
8
+ import { inject, Injectable } from '@angular/core';
9
+ import { r as resolveInvitationCommandTargets } from './acorex-platform-module-security-management-client-invitation-target.util-BAXQZwLW.mjs';
10
+
11
+ //#region ---- AXPRejectJoinRequestCommand ----
12
+ class AXPRejectJoinRequestCommand {
13
+ constructor() {
14
+ this.dialogService = inject(AXDialogService);
15
+ this.toastService = inject(AXToastService);
16
+ this.translationService = inject(AXTranslationService);
17
+ this.commandService = inject(AXPCommandService);
18
+ }
19
+ async execute(input = {}) {
20
+ const { tenantUserId, userId } = resolveInvitationCommandTargets(input);
21
+ if (!tenantUserId && !userId) {
22
+ return { success: false, message: { text: 'Tenant user id is required.' } };
23
+ }
24
+ const who = input.data?.displayName || input.data?.email || String(tenantUserId || userId);
25
+ const confirmTitle = await this.translationService
26
+ .translateAsync('@security-management:users.entities.user.actions.reject-join-request.confirm-title')
27
+ .catch(() => 'Reject Join Request');
28
+ const confirmMessage = await this.translationService
29
+ .translateAsync('@security-management:users.entities.user.actions.reject-join-request.confirm-message', {
30
+ params: { user: who },
31
+ })
32
+ .catch(() => `Reject the membership request for ${who}?`);
33
+ const confirmed = await this.dialogService.confirm(confirmTitle, confirmMessage, 'danger', 'horizontal');
34
+ if (!confirmed.result) {
35
+ return { success: false };
36
+ }
37
+ const result = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.RejectJoinRequest, { tenantUserId, userId });
38
+ if (result?.success) {
39
+ const [toastTitle, toastContent] = await Promise.all([
40
+ this.translationService
41
+ .translateAsync('@security-management:users.entities.user.actions.reject-join-request.success.title')
42
+ .catch(() => 'Rejected'),
43
+ this.translationService
44
+ .translateAsync('@security-management:users.entities.user.actions.reject-join-request.success.description')
45
+ .catch(() => 'The membership request was rejected.'),
46
+ ]);
47
+ this.toastService.show({ color: 'success', title: toastTitle, content: toastContent, timeOut: 3000 });
48
+ return { success: true, kind: 'object', data: undefined };
49
+ }
50
+ const [toastTitle, fallback] = await Promise.all([
51
+ this.translationService
52
+ .translateAsync('@security-management:users.entities.user.actions.reject-join-request.error.title')
53
+ .catch(() => 'Reject Failed'),
54
+ this.translationService
55
+ .translateAsync('@security-management:users.entities.user.actions.reject-join-request.error.description')
56
+ .catch(() => 'Failed to reject the membership request.'),
57
+ ]);
58
+ const code = typeof result?.message?.code === 'string' ? result.message.code : '';
59
+ const mapped = code === AXM_JOIN_REQUEST_ERROR_CODES.NotPending
60
+ ? await this.translationService
61
+ .translateAsync('@security-management:users.entities.user.actions.reject-join-request.error.not-pending')
62
+ .catch(() => fallback)
63
+ : fallback;
64
+ this.toastService.show({ color: 'danger', title: toastTitle, content: mapped, timeOut: 4000 });
65
+ return { success: false };
66
+ }
67
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRejectJoinRequestCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRejectJoinRequestCommand, providedIn: 'root' }); }
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPRejectJoinRequestCommand, decorators: [{
71
+ type: Injectable,
72
+ args: [{ providedIn: 'root' }]
73
+ }] });
74
+
75
+ export { AXPRejectJoinRequestCommand };
76
+ //# sourceMappingURL=acorex-platform-module-security-management-client-reject-join-request.command-B3kiok6b.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-security-management-client-reject-join-request.command-B3kiok6b.mjs","sources":["../../../../libs/modules/security-management/client/src/lib/commands/reject-join-request.command.ts"],"sourcesContent":["import { AXDialogService } from '@acorex/components/dialog';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXM_JOIN_REQUEST_ERROR_CODES,\n AXM_USER_REJECT_JOIN_REQUEST_COMMAND,\n AXMSecurityManagementServerCommands,\n} from '@acorex-platform/module-security-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\nimport {\n resolveInvitationCommandTargets,\n type AXPInvitationTargetCommandInput,\n} from './invitation-target.util';\n\nexport { AXM_USER_REJECT_JOIN_REQUEST_COMMAND };\n\n//#region ---- AXPRejectJoinRequestCommand ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXPRejectJoinRequestCommand implements AXPCommand<AXPInvitationTargetCommandInput> {\n private readonly dialogService = inject(AXDialogService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n private readonly commandService = inject(AXPCommandService);\n\n async execute(input: AXPInvitationTargetCommandInput = {}): AXPCommandExecuteResultPromise {\n const { tenantUserId, userId } = resolveInvitationCommandTargets(input);\n if (!tenantUserId && !userId) {\n return { success: false, message: { text: 'Tenant user id is required.' } };\n }\n\n const who = input.data?.displayName || input.data?.email || String(tenantUserId || userId);\n const confirmTitle = await this.translationService\n .translateAsync('@security-management:users.entities.user.actions.reject-join-request.confirm-title')\n .catch(() => 'Reject Join Request');\n const confirmMessage = await this.translationService\n .translateAsync('@security-management:users.entities.user.actions.reject-join-request.confirm-message', {\n params: { user: who },\n })\n .catch(() => `Reject the membership request for ${who}?`);\n\n const confirmed = await this.dialogService.confirm(confirmTitle, confirmMessage, 'danger', 'horizontal');\n if (!confirmed.result) {\n return { success: false };\n }\n\n const result = await this.commandService.executeRemote(\n AXMSecurityManagementServerCommands.RejectJoinRequest,\n { tenantUserId, userId },\n );\n\n if (result?.success) {\n const [toastTitle, toastContent] = await Promise.all([\n this.translationService\n .translateAsync('@security-management:users.entities.user.actions.reject-join-request.success.title')\n .catch(() => 'Rejected'),\n this.translationService\n .translateAsync('@security-management:users.entities.user.actions.reject-join-request.success.description')\n .catch(() => 'The membership request was rejected.'),\n ]);\n this.toastService.show({ color: 'success', title: toastTitle, content: toastContent, timeOut: 3000 });\n return { success: true, kind: 'object', data: undefined };\n }\n\n const [toastTitle, fallback] = await Promise.all([\n this.translationService\n .translateAsync('@security-management:users.entities.user.actions.reject-join-request.error.title')\n .catch(() => 'Reject Failed'),\n this.translationService\n .translateAsync('@security-management:users.entities.user.actions.reject-join-request.error.description')\n .catch(() => 'Failed to reject the membership request.'),\n ]);\n const code = typeof result?.message?.code === 'string' ? result.message.code : '';\n const mapped =\n code === AXM_JOIN_REQUEST_ERROR_CODES.NotPending\n ? await this.translationService\n .translateAsync('@security-management:users.entities.user.actions.reject-join-request.error.not-pending')\n .catch(() => fallback)\n : fallback;\n this.toastService.show({ color: 'danger', title: toastTitle, content: mapped, timeOut: 4000 });\n return { success: false };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAkBA;MAGa,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AA2D5D,IAAA;AAzDC,IAAA,MAAM,OAAO,CAAC,KAAA,GAAyC,EAAE,EAAA;QACvD,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,+BAA+B,CAAC,KAAK,CAAC;AACvE,QAAA,IAAI,CAAC,YAAY,IAAI,CAAC,MAAM,EAAE;AAC5B,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE,EAAE;QAC7E;QAEA,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,EAAE,WAAW,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC;AAC1F,QAAA,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC;aAC7B,cAAc,CAAC,oFAAoF;AACnG,aAAA,KAAK,CAAC,MAAM,qBAAqB,CAAC;AACrC,QAAA,MAA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I,CAAC;iBACF,cAAc,CAAC,kFAAkF;AACjG,iBAAA,KAAK,CAAC,MAAM,eAAe,CAAC;AAC/B,YAAA,IAAI,CAAC;iBACF,cAAc,CAAC,wFAAwF;AACvG,iBAAA,KAAK,CAAC,MAAM,0CAA0C,CAAC;AAC3D,SAAA,CAAC;QACF,MAAM,IAAI,GAAG,OAAO,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,EAAE;AACjF,QAAA,MAAM,MAAM,GACV,IAAI,KAAK,4BAA4B,CAAC;AACpC,cAAE,MAAM,IAAI,CAAC;iBACR,cAAc,CAAC,wFAAwF;AACvG,iBAAA,KAAK,CAAC,MAAM,QAAQ;cACvB,QAAQ;QACd,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC9F,QAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IAC3B;8GA9DW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -33,13 +33,18 @@ class AXPResetTwoFactorCommand {
33
33
  //#endregion
34
34
  //#region ----- Command -----
35
35
  async execute(input = {}) {
36
- const userId = input.userId ?? input.data?.id;
36
+ // Users row: data.id is User id. TenantUser row: data.userId is User id.
37
+ const userId = input.userId ?? input.data?.userId ?? input.data?.id;
37
38
  if (!userId) {
38
39
  return { success: false, message: { text: `${I18N}.errors.invalid-input` } };
39
40
  }
41
+ const nested = input.data?.user;
40
42
  const who = input.data?.displayName ||
43
+ nested?.displayName ||
41
44
  input.data?.username ||
45
+ nested?.username ||
42
46
  input.data?.email ||
47
+ nested?.email ||
43
48
  String(userId);
44
49
  // Preflight: stop before confirm when 2FA was never enabled for this user.
45
50
  const preflight = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.AdminResetTwoFactor, { userId: String(userId), dryRun: true });
@@ -93,4 +98,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
93
98
  }] });
94
99
 
95
100
  export { AXPResetTwoFactorCommand };
96
- //# sourceMappingURL=acorex-platform-module-security-management-client-reset-two-factor.command-psTDKoNf.mjs.map
101
+ //# sourceMappingURL=acorex-platform-module-security-management-client-reset-two-factor.command-C27mUZ1-.mjs.map