@acorex-platform/module-security-management-client 0.0.37 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-Ddzg9VYV.mjs → acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-D-VISihP.mjs} +116 -37
- package/fesm2022/acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-D-VISihP.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-cancel-invitation.command-C3iaOEKI.mjs +74 -0
- package/fesm2022/acorex-platform-module-security-management-client-cancel-invitation.command-C3iaOEKI.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-device-sessions.mjs +22 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-device-sessions.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-identity-provider.mjs +232 -16
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-identity-provider.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-policy.mjs +21 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-policy.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-profile.mjs +21 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-profile.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-role-permission.mjs +22 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-role-permission.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-roles.mjs +22 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-roles.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-user-role.mjs +22 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-user-role.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-user-two-factor.mjs +182 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-user-two-factor.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-users.mjs +165 -3
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entities-users.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-acorex-platform-module-security-management-client-contracts-entity-catalog-CeqvAe30.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-acorex-platform-module-security-management-client-contracts-entity-catalog-B4oiF8FO.mjs} +16 -9
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-acorex-platform-module-security-management-client-contracts-entity-catalog-B4oiF8FO.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-device-sessions.entity-D5wMKRJ3.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-device-sessions.entity-CU-5X-qu.mjs} +18 -2
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-device-sessions.entity-CU-5X-qu.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-identity-provider.entity-6LBD6MuU.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-identity-provider.entity-Bld1buTd.mjs} +228 -18
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-identity-provider.entity-Bld1buTd.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-policy.entity-CVsH_anF.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-policy.entity-DZVzHzVM.mjs} +17 -2
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-policy.entity-DZVzHzVM.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-profile.entity-B3m3wpcT.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-profile.entity-BCy5fNc9.mjs} +17 -2
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-profile.entity-BCy5fNc9.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-role-permission.entity-DK99ir3U.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-role-permission.entity-DcvYjfZm.mjs} +18 -2
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-role-permission.entity-DcvYjfZm.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-roles.entity-B5PknTEu.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-roles.entity-lNKDIDry.mjs} +18 -2
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-roles.entity-lNKDIDry.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-user-role.entity-IHUWsgjf.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-user-role.entity-DKII6o5N.mjs} +18 -2
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-user-role.entity-DKII6o5N.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-user-two-factor.entity-ge21b3mE.mjs +100 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-user-two-factor.entity-ge21b3mE.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-security-management-client-contracts-entity-catalog-users.entity-DmVp5gj1.mjs → acorex-platform-module-security-management-client-contracts-entity-catalog-users.entity-CJ7x5rjC.mjs} +161 -5
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-users.entity-CJ7x5rjC.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts.mjs +187 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-security-management-client-index-C1rCxs2K.mjs → acorex-platform-module-security-management-client-index-CT-N83bV.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-security-management-client-index-C1rCxs2K.mjs.map → acorex-platform-module-security-management-client-index-CT-N83bV.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-invitation-target.util-BAXQZwLW.mjs +41 -0
- package/fesm2022/acorex-platform-module-security-management-client-invitation-target.util-BAXQZwLW.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-invite-user.command-kFXjLdxy.mjs +143 -0
- package/fesm2022/acorex-platform-module-security-management-client-invite-user.command-kFXjLdxy.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-local-entities.mjs +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-local-entities.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-security-management-client-resend-invitation.command-D9Ijk565.mjs +76 -0
- package/fesm2022/acorex-platform-module-security-management-client-resend-invitation.command-D9Ijk565.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client-reset-two-factor.command-psTDKoNf.mjs +96 -0
- package/fesm2022/acorex-platform-module-security-management-client-reset-two-factor.command-psTDKoNf.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-security-management-client.mjs +1 -1
- package/package.json +5 -1
- package/types/acorex-platform-module-security-management-client-contracts-entities-user-two-factor.d.ts +9 -0
- package/types/acorex-platform-module-security-management-client-contracts.d.ts +264 -10
- package/fesm2022/acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-Ddzg9VYV.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-acorex-platform-module-security-management-client-contracts-entity-catalog-CeqvAe30.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-device-sessions.entity-D5wMKRJ3.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-identity-provider.entity-6LBD6MuU.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-policy.entity-CVsH_anF.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-profile.entity-B3m3wpcT.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-role-permission.entity-DK99ir3U.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-roles.entity-B5PknTEu.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-user-role.entity-IHUWsgjf.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-security-management-client-contracts-entity-catalog-users.entity-DmVp5gj1.mjs.map +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
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 { AXM_TWO_FACTOR_ERROR_CODES, AXMSecurityManagementServerCommands } from '@acorex-platform/module-security-management-client/contracts';
|
|
6
|
+
export { AXM_USER_RESET_TWO_FACTOR_COMMAND } from '@acorex-platform/module-security-management-client/contracts';
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { inject, Injectable } from '@angular/core';
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ----- Constants -----
|
|
12
|
+
const I18N = '@security-management:users.entities.user.actions.reset-two-factor';
|
|
13
|
+
const TWO_FACTOR_ERROR_I18N = {
|
|
14
|
+
[AXM_TWO_FACTOR_ERROR_CODES.InvalidInput]: `${I18N}.errors.invalid-input`,
|
|
15
|
+
[AXM_TWO_FACTOR_ERROR_CODES.UserNotFound]: `${I18N}.errors.user-not-found`,
|
|
16
|
+
[AXM_TWO_FACTOR_ERROR_CODES.Forbidden]: `${I18N}.errors.forbidden`,
|
|
17
|
+
[AXM_TWO_FACTOR_ERROR_CODES.NotEnabled]: `${I18N}.errors.not-enabled`,
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ----- Client command -----
|
|
21
|
+
/**
|
|
22
|
+
* Admin Action on User detail: if 2FA is not enabled, warn and stop;
|
|
23
|
+
* otherwise confirm, then call server AdminResetTwoFactor.
|
|
24
|
+
*/
|
|
25
|
+
class AXPResetTwoFactorCommand {
|
|
26
|
+
constructor() {
|
|
27
|
+
//#region ----- Services & Dependencies -----
|
|
28
|
+
this.dialogService = inject(AXDialogService);
|
|
29
|
+
this.toastService = inject(AXToastService);
|
|
30
|
+
this.translationService = inject(AXTranslationService);
|
|
31
|
+
this.commandService = inject(AXPCommandService);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ----- Command -----
|
|
35
|
+
async execute(input = {}) {
|
|
36
|
+
const userId = input.userId ?? input.data?.id;
|
|
37
|
+
if (!userId) {
|
|
38
|
+
return { success: false, message: { text: `${I18N}.errors.invalid-input` } };
|
|
39
|
+
}
|
|
40
|
+
const who = input.data?.displayName ||
|
|
41
|
+
input.data?.username ||
|
|
42
|
+
input.data?.email ||
|
|
43
|
+
String(userId);
|
|
44
|
+
// Preflight: stop before confirm when 2FA was never enabled for this user.
|
|
45
|
+
const preflight = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.AdminResetTwoFactor, { userId: String(userId), dryRun: true });
|
|
46
|
+
if (!preflight?.success) {
|
|
47
|
+
await this.showFailureToast(preflight?.message?.code);
|
|
48
|
+
return { success: false };
|
|
49
|
+
}
|
|
50
|
+
const confirmTitle = await this.translationService.translateAsync(`${I18N}.confirm-title`);
|
|
51
|
+
const confirmMessage = await this.translationService.translateAsync(`${I18N}.confirm-message`, {
|
|
52
|
+
params: { user: who },
|
|
53
|
+
});
|
|
54
|
+
const confirmed = await this.dialogService.confirm(confirmTitle, confirmMessage, 'danger', 'horizontal');
|
|
55
|
+
if (!confirmed.result) {
|
|
56
|
+
return { success: false };
|
|
57
|
+
}
|
|
58
|
+
const result = await this.commandService.executeRemote(AXMSecurityManagementServerCommands.AdminResetTwoFactor, { userId: String(userId) });
|
|
59
|
+
if (result?.success) {
|
|
60
|
+
const [toastTitle, toastContent] = await Promise.all([
|
|
61
|
+
this.translationService.translateAsync(`${I18N}.success.title`),
|
|
62
|
+
this.translationService.translateAsync(`${I18N}.success.description`),
|
|
63
|
+
]);
|
|
64
|
+
this.toastService.show({ color: 'success', title: toastTitle, content: toastContent, timeOut: 3000 });
|
|
65
|
+
return { success: true, kind: 'object', data: undefined };
|
|
66
|
+
}
|
|
67
|
+
await this.showFailureToast(result?.message?.code);
|
|
68
|
+
return { success: false };
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ----- Helpers -----
|
|
72
|
+
async showFailureToast(code) {
|
|
73
|
+
const codeKey = typeof code === 'string' ? code : '';
|
|
74
|
+
const errorKey = TWO_FACTOR_ERROR_I18N[codeKey] || `${I18N}.error.description`;
|
|
75
|
+
const isNotEnabled = codeKey === AXM_TWO_FACTOR_ERROR_CODES.NotEnabled;
|
|
76
|
+
const [toastTitle, toastContent] = await Promise.all([
|
|
77
|
+
this.translationService.translateAsync(isNotEnabled ? `${I18N}.errors.not-enabled-title` : `${I18N}.error.title`),
|
|
78
|
+
this.translationService.translateAsync(errorKey),
|
|
79
|
+
]);
|
|
80
|
+
this.toastService.show({
|
|
81
|
+
color: isNotEnabled ? 'warning' : 'danger',
|
|
82
|
+
title: toastTitle,
|
|
83
|
+
content: toastContent,
|
|
84
|
+
timeOut: 4000,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPResetTwoFactorCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
88
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPResetTwoFactorCommand, providedIn: 'root' }); }
|
|
89
|
+
}
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPResetTwoFactorCommand, decorators: [{
|
|
91
|
+
type: Injectable,
|
|
92
|
+
args: [{ providedIn: 'root' }]
|
|
93
|
+
}] });
|
|
94
|
+
|
|
95
|
+
export { AXPResetTwoFactorCommand };
|
|
96
|
+
//# sourceMappingURL=acorex-platform-module-security-management-client-reset-two-factor.command-psTDKoNf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-security-management-client-reset-two-factor.command-psTDKoNf.mjs","sources":["../../../../libs/modules/security-management/client/src/lib/commands/reset-two-factor.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 { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXM_TWO_FACTOR_ERROR_CODES,\n AXM_USER_RESET_TWO_FACTOR_COMMAND,\n AXMSecurityManagementServerCommands,\n} from '@acorex-platform/module-security-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\n//#region ----- Types -----\n\nexport interface AXPResetTwoFactorCommandInput {\n userId?: string;\n data?: {\n id?: string;\n displayName?: string;\n username?: string;\n email?: string;\n };\n}\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst I18N = '@security-management:users.entities.user.actions.reset-two-factor';\n\nconst TWO_FACTOR_ERROR_I18N: Record<string, string> = {\n [AXM_TWO_FACTOR_ERROR_CODES.InvalidInput]: `${I18N}.errors.invalid-input`,\n [AXM_TWO_FACTOR_ERROR_CODES.UserNotFound]: `${I18N}.errors.user-not-found`,\n [AXM_TWO_FACTOR_ERROR_CODES.Forbidden]: `${I18N}.errors.forbidden`,\n [AXM_TWO_FACTOR_ERROR_CODES.NotEnabled]: `${I18N}.errors.not-enabled`,\n};\n\n//#endregion\n\n//#region ----- Client command -----\n\n/**\n * Admin Action on User detail: if 2FA is not enabled, warn and stop;\n * otherwise confirm, then call server AdminResetTwoFactor.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXPResetTwoFactorCommand implements AXPCommand<AXPResetTwoFactorCommandInput> {\n //#region ----- Services & Dependencies -----\n\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 //#endregion\n\n //#region ----- Command -----\n\n async execute(input: AXPResetTwoFactorCommandInput = {}): AXPCommandExecuteResultPromise {\n const userId = input.userId ?? input.data?.id;\n if (!userId) {\n return { success: false, message: { text: `${I18N}.errors.invalid-input` } };\n }\n\n const who =\n input.data?.displayName ||\n input.data?.username ||\n input.data?.email ||\n String(userId);\n\n // Preflight: stop before confirm when 2FA was never enabled for this user.\n const preflight = await this.commandService.executeRemote(\n AXMSecurityManagementServerCommands.AdminResetTwoFactor,\n { userId: String(userId), dryRun: true },\n );\n if (!preflight?.success) {\n await this.showFailureToast(preflight?.message?.code);\n return { success: false };\n }\n\n const confirmTitle = await this.translationService.translateAsync(`${I18N}.confirm-title`);\n const confirmMessage = await this.translationService.translateAsync(`${I18N}.confirm-message`, {\n params: { user: who },\n });\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.AdminResetTwoFactor,\n { userId: String(userId) },\n );\n\n if (result?.success) {\n const [toastTitle, toastContent] = await Promise.all([\n this.translationService.translateAsync(`${I18N}.success.title`),\n this.translationService.translateAsync(`${I18N}.success.description`),\n ]);\n this.toastService.show({ color: 'success', title: toastTitle, content: toastContent, timeOut: 3000 });\n return { success: true, kind: 'object', data: undefined };\n }\n\n await this.showFailureToast(result?.message?.code);\n return { success: false };\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private async showFailureToast(code: unknown): Promise<void> {\n const codeKey = typeof code === 'string' ? code : '';\n const errorKey = TWO_FACTOR_ERROR_I18N[codeKey] || `${I18N}.error.description`;\n const isNotEnabled = codeKey === AXM_TWO_FACTOR_ERROR_CODES.NotEnabled;\n const [toastTitle, toastContent] = await Promise.all([\n this.translationService.translateAsync(\n isNotEnabled ? `${I18N}.errors.not-enabled-title` : `${I18N}.error.title`,\n ),\n this.translationService.translateAsync(errorKey),\n ]);\n this.toastService.show({\n color: isNotEnabled ? 'warning' : 'danger',\n title: toastTitle,\n content: toastContent,\n timeOut: 4000,\n });\n }\n\n //#endregion\n}\n\nexport { AXM_USER_RESET_TWO_FACTOR_COMMAND };\n\n//#endregion\n"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AXMAssignPermissionsCommand, a as AXMDeviceSessionsService, b as AXMPermissionsModule, c as AXMRolePermissionGrantService, d as AXMRolePermissionsPageComponent, e as AXMRolePermissionsPageComponentProvider, f as AXMSecurityManagementModule, g as AXPPermissionsEditorComponent, h as AXPPermissionsWidget, i as AXPPermissionsWidgetColumnComponent, j as AXPPermissionsWidgetEditComponent, k as AXPPermissionsWidgetViewComponent } from './acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-
|
|
1
|
+
export { A as AXMAssignPermissionsCommand, a as AXMDeviceSessionsService, b as AXMPermissionsModule, c as AXMRolePermissionGrantService, d as AXMRolePermissionsPageComponent, e as AXMRolePermissionsPageComponentProvider, f as AXMSecurityManagementModule, g as AXPPermissionsEditorComponent, h as AXPPermissionsWidget, i as AXPPermissionsWidgetColumnComponent, j as AXPPermissionsWidgetEditComponent, k as AXPPermissionsWidgetViewComponent } from './acorex-platform-module-security-management-client-acorex-platform-module-security-management-client-D-VISihP.mjs';
|
|
2
2
|
//# sourceMappingURL=acorex-platform-module-security-management-client.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex-platform/module-security-management-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.46",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0 || ^22.0.0",
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
"types": "./types/acorex-platform-module-security-management-client-contracts-entities-user-role.d.ts",
|
|
52
52
|
"default": "./fesm2022/acorex-platform-module-security-management-client-contracts-entities-user-role.mjs"
|
|
53
53
|
},
|
|
54
|
+
"./contracts/entities/user-two-factor": {
|
|
55
|
+
"types": "./types/acorex-platform-module-security-management-client-contracts-entities-user-two-factor.d.ts",
|
|
56
|
+
"default": "./fesm2022/acorex-platform-module-security-management-client-contracts-entities-user-two-factor.mjs"
|
|
57
|
+
},
|
|
54
58
|
"./contracts/entities/users": {
|
|
55
59
|
"types": "./types/acorex-platform-module-security-management-client-contracts-entities-users.d.ts",
|
|
56
60
|
"default": "./fesm2022/acorex-platform-module-security-management-client-contracts-entities-users.mjs"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AXPEntity } from '@acorex-platform/framework-shared/entity';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Schema-only entity for authenticator enrollment.
|
|
5
|
+
* No secret fields in UI; all mutations go through dedicated 2FA commands.
|
|
6
|
+
*/
|
|
7
|
+
declare function userTwoFactorFactory(): Promise<AXPEntity | null>;
|
|
8
|
+
|
|
9
|
+
export { userTwoFactorFactory };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AXPContextDefinition, AXPExpression } from '@acorex-platform/framework-shared/core';
|
|
2
|
-
import { AXPEntityModel } from '@acorex-platform/framework-shared/entity';
|
|
1
|
+
import { AXPContextDefinition, AXPModuleManifest, AXPExpression } from '@acorex-platform/framework-shared/core';
|
|
2
|
+
import { AXPEntityModel, AXPEntity } from '@acorex-platform/framework-shared/entity';
|
|
3
3
|
|
|
4
4
|
declare const AXM_SECURITY_CONTEXT_DEFINITIONS: AXPContextDefinition[];
|
|
5
5
|
|
|
@@ -153,6 +153,12 @@ declare const RootConfig: {
|
|
|
153
153
|
readonly titlePlural: `@${string}:identity-providers.entities.identity-provider.plural`;
|
|
154
154
|
readonly icon: "fa-light fa-id-badge";
|
|
155
155
|
};
|
|
156
|
+
readonly userTwoFactor: {
|
|
157
|
+
readonly name: "UserTwoFactor";
|
|
158
|
+
readonly title: `@${string}:user-two-factor.entities.user-two-factor.title`;
|
|
159
|
+
readonly titlePlural: `@${string}:user-two-factor.entities.user-two-factor.plural`;
|
|
160
|
+
readonly icon: "fa-light fa-shield-keyhole";
|
|
161
|
+
};
|
|
156
162
|
};
|
|
157
163
|
readonly queries: {
|
|
158
164
|
readonly reports: {
|
|
@@ -165,6 +171,12 @@ declare const RootConfig: {
|
|
|
165
171
|
};
|
|
166
172
|
};
|
|
167
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Security Management Module Manifest.
|
|
176
|
+
* Defines module metadata, features, and provider references.
|
|
177
|
+
*/
|
|
178
|
+
declare const SecurityManagementManifest: AXPModuleManifest;
|
|
179
|
+
|
|
168
180
|
/** Status provider key for `accessState` on SecurityManagement.User (transitions define editable paths in the status UI). */
|
|
169
181
|
declare const AXM_USER_ACCESS_STATE_DEFINITION_KEY = "security-management.access-state.user";
|
|
170
182
|
|
|
@@ -213,10 +225,51 @@ interface AXMUserPasswordResetInfo {
|
|
|
213
225
|
sentAt: string;
|
|
214
226
|
}
|
|
215
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Invitation challenge / audit metadata on TenantManagement.TenantUser.
|
|
230
|
+
* The raw token is never persisted — only a SHA-256 hash while the invite is pending.
|
|
231
|
+
*/
|
|
232
|
+
interface AXMUserInvitationInfo {
|
|
233
|
+
/** Present only while `TenantUser.statusId` is pending; cleared after resolve. */
|
|
234
|
+
tokenHash?: string;
|
|
235
|
+
expiresAt: string;
|
|
236
|
+
sentAt: string;
|
|
237
|
+
invitedByUserId: string;
|
|
238
|
+
applicationIds?: string[];
|
|
239
|
+
/** Always `invite` for rows created/updated by Invite (not create-in-tenant). */
|
|
240
|
+
source: 'invite';
|
|
241
|
+
/** Set when the invitee accepts; distinguishes accepted invite from create-in-tenant. */
|
|
242
|
+
acceptedAt?: string;
|
|
243
|
+
}
|
|
244
|
+
/** How a User identity row was created (directory provenance). */
|
|
245
|
+
type AXMUserCreatedVia = 'invite' | 'create-in-tenant' | 'register' | 'seed' | 'idp';
|
|
246
|
+
/**
|
|
247
|
+
* In-app inbox definition for membership invites to users who already have a tenant.
|
|
248
|
+
* Inbox row action opens the auth waiting room (Approve/Decline live there).
|
|
249
|
+
*/
|
|
250
|
+
declare const AXM_MEMBERSHIP_INVITATION_NOTIFICATION_DEFINITION_KEY: "security-management.membership-invitation";
|
|
251
|
+
/** Query `source` value when opening waiting room from a membership-invite notification. */
|
|
252
|
+
declare const AXM_MEMBERSHIP_INVITE_WAITING_ROOM_SOURCE: "membership-invite";
|
|
253
|
+
|
|
216
254
|
declare const AXMSecurityManagementServerCommands: {
|
|
217
255
|
readonly SendPasswordResetEmail: "SecurityManagement:Server:SendPasswordResetEmail";
|
|
218
256
|
readonly CompletePasswordReset: "SecurityManagement:Server:CompletePasswordReset";
|
|
219
257
|
readonly ChangeOwnPassword: "SecurityManagement:Server:ChangeOwnPassword";
|
|
258
|
+
readonly InviteUser: "SecurityManagement:Server:InviteUser";
|
|
259
|
+
readonly ResendInvitation: "SecurityManagement:Server:ResendInvitation";
|
|
260
|
+
readonly CancelInvitation: "SecurityManagement:Server:CancelInvitation";
|
|
261
|
+
readonly AcceptInvitation: "SecurityManagement:Server:AcceptInvitation";
|
|
262
|
+
readonly ListMyPendingInvitations: "SecurityManagement:Server:ListMyPendingInvitations";
|
|
263
|
+
readonly DeclineInvitation: "SecurityManagement:Server:DeclineInvitation";
|
|
264
|
+
readonly AcceptMyInvitation: "SecurityManagement:Server:AcceptMyInvitation";
|
|
265
|
+
readonly StartTwoFactorEnrollment: "SecurityManagement:Server:StartTwoFactorEnrollment";
|
|
266
|
+
readonly ConfirmTwoFactorEnrollment: "SecurityManagement:Server:ConfirmTwoFactorEnrollment";
|
|
267
|
+
readonly DisableTwoFactor: "SecurityManagement:Server:DisableTwoFactor";
|
|
268
|
+
readonly GenerateTwoFactorRecoveryCodes: "SecurityManagement:Server:GenerateTwoFactorRecoveryCodes";
|
|
269
|
+
readonly GetTwoFactorStatus: "SecurityManagement:Server:GetTwoFactorStatus";
|
|
270
|
+
readonly AdminResetTwoFactor: "SecurityManagement:Server:AdminResetTwoFactor";
|
|
271
|
+
/** Public — completes login after password challenge (TOTP or recovery). */
|
|
272
|
+
readonly VerifyTwoFactorLogin: "SecurityManagement:Server:VerifyTwoFactorLogin";
|
|
220
273
|
};
|
|
221
274
|
/** Stable codes for self-service password change (client maps to i18n). */
|
|
222
275
|
declare const AXM_CHANGE_OWN_PASSWORD_ERROR_CODES: {
|
|
@@ -227,6 +280,12 @@ declare const AXM_CHANGE_OWN_PASSWORD_ERROR_CODES: {
|
|
|
227
280
|
};
|
|
228
281
|
/** Client/UI action key (confirm dialog → server send). */
|
|
229
282
|
declare const AXM_USER_SEND_PASSWORD_RESET_COMMAND = "SecurityManagement:User:SendPasswordResetEmail";
|
|
283
|
+
/** Client/UI action key (confirm dialog → server admin reset 2FA). */
|
|
284
|
+
declare const AXM_USER_RESET_TWO_FACTOR_COMMAND = "SecurityManagement:User:ResetTwoFactor";
|
|
285
|
+
/** Client/UI action keys for invite flows. */
|
|
286
|
+
declare const AXM_USER_INVITE_COMMAND = "SecurityManagement:User:Invite";
|
|
287
|
+
declare const AXM_USER_RESEND_INVITATION_COMMAND = "SecurityManagement:User:ResendInvitation";
|
|
288
|
+
declare const AXM_USER_CANCEL_INVITATION_COMMAND = "SecurityManagement:User:CancelInvitation";
|
|
230
289
|
interface AXMSendPasswordResetEmailInput {
|
|
231
290
|
/** Admin path: target user id. */
|
|
232
291
|
userId?: string;
|
|
@@ -246,6 +305,137 @@ interface AXMChangeOwnPasswordInput {
|
|
|
246
305
|
interface AXMChangeOwnPasswordResult {
|
|
247
306
|
passwordChangedAt: string;
|
|
248
307
|
}
|
|
308
|
+
interface AXMInviteUserInput {
|
|
309
|
+
email: string;
|
|
310
|
+
displayName?: string;
|
|
311
|
+
applicationIds?: string[];
|
|
312
|
+
/** Client sets true after warning that the identity already exists. */
|
|
313
|
+
confirmExisting?: boolean;
|
|
314
|
+
webOrigin?: string;
|
|
315
|
+
}
|
|
316
|
+
interface AXMInviteUserResult {
|
|
317
|
+
userId: string;
|
|
318
|
+
tenantUserId: string;
|
|
319
|
+
userAlreadyExists: boolean;
|
|
320
|
+
sent: boolean;
|
|
321
|
+
}
|
|
322
|
+
interface AXMResendInvitationInput {
|
|
323
|
+
tenantUserId?: string;
|
|
324
|
+
userId?: string;
|
|
325
|
+
webOrigin?: string;
|
|
326
|
+
}
|
|
327
|
+
interface AXMCancelInvitationInput {
|
|
328
|
+
tenantUserId?: string;
|
|
329
|
+
userId?: string;
|
|
330
|
+
}
|
|
331
|
+
/** Stable codes for public invitation accept (client maps invalid/expired to the page, not a toast). */
|
|
332
|
+
declare const AXM_ACCEPT_INVITATION_ERROR_CODES: {
|
|
333
|
+
readonly Invalid: "ACCEPT_INVITATION_INVALID";
|
|
334
|
+
readonly Expired: "ACCEPT_INVITATION_EXPIRED";
|
|
335
|
+
readonly PasswordRequired: "ACCEPT_INVITATION_PASSWORD_REQUIRED";
|
|
336
|
+
};
|
|
337
|
+
type AXMAcceptInvitationReason = 'valid' | 'invalid' | 'expired';
|
|
338
|
+
interface AXMAcceptInvitationInput {
|
|
339
|
+
token: string;
|
|
340
|
+
newPassword?: string;
|
|
341
|
+
/** Check the token only. Does not set a password or consume the link. */
|
|
342
|
+
preview?: boolean;
|
|
343
|
+
}
|
|
344
|
+
interface AXMAcceptInvitationPreviewResult {
|
|
345
|
+
usable: boolean;
|
|
346
|
+
reason: AXMAcceptInvitationReason;
|
|
347
|
+
}
|
|
348
|
+
interface AXMPendingInvitationItem {
|
|
349
|
+
tenantUserId: string;
|
|
350
|
+
tenantId: string;
|
|
351
|
+
tenantTitle?: string;
|
|
352
|
+
invitedByUserId?: string;
|
|
353
|
+
expiresAt?: string;
|
|
354
|
+
sentAt?: string;
|
|
355
|
+
applicationIds?: string[];
|
|
356
|
+
}
|
|
357
|
+
interface AXMListMyPendingInvitationsResult {
|
|
358
|
+
items: AXMPendingInvitationItem[];
|
|
359
|
+
}
|
|
360
|
+
interface AXMAcceptMyInvitationInput {
|
|
361
|
+
tenantUserId: string;
|
|
362
|
+
newPassword?: string;
|
|
363
|
+
}
|
|
364
|
+
interface AXMDeclineInvitationInput {
|
|
365
|
+
tenantUserId: string;
|
|
366
|
+
}
|
|
367
|
+
/** Stable codes for two-factor self-service and login challenge (client maps to i18n). */
|
|
368
|
+
declare const AXM_TWO_FACTOR_ERROR_CODES: {
|
|
369
|
+
readonly NotSignedIn: "TWO_FACTOR_NOT_SIGNED_IN";
|
|
370
|
+
readonly InvalidInput: "TWO_FACTOR_INVALID_INPUT";
|
|
371
|
+
readonly IncorrectPassword: "TWO_FACTOR_INCORRECT_PASSWORD";
|
|
372
|
+
readonly IncorrectCode: "TWO_FACTOR_INCORRECT_CODE";
|
|
373
|
+
readonly AlreadyEnabled: "TWO_FACTOR_ALREADY_ENABLED";
|
|
374
|
+
readonly NotEnabled: "TWO_FACTOR_NOT_ENABLED";
|
|
375
|
+
readonly EnrollmentExpired: "TWO_FACTOR_ENROLLMENT_EXPIRED";
|
|
376
|
+
readonly ChallengeExpired: "TWO_FACTOR_CHALLENGE_EXPIRED";
|
|
377
|
+
readonly RateLimited: "TWO_FACTOR_RATE_LIMITED";
|
|
378
|
+
readonly InvalidConfiguration: "TWO_FACTOR_INVALID_CONFIGURATION";
|
|
379
|
+
readonly ProofRequired: "TWO_FACTOR_PROOF_REQUIRED";
|
|
380
|
+
readonly UserNotFound: "TWO_FACTOR_USER_NOT_FOUND";
|
|
381
|
+
readonly Forbidden: "TWO_FACTOR_FORBIDDEN";
|
|
382
|
+
};
|
|
383
|
+
interface AXMStartTwoFactorEnrollmentInput {
|
|
384
|
+
password: string;
|
|
385
|
+
}
|
|
386
|
+
interface AXMStartTwoFactorEnrollmentResult {
|
|
387
|
+
enrollmentId: string;
|
|
388
|
+
otpauthUri: string;
|
|
389
|
+
/** Base32 secret for manual entry (client renders QR via ax-qrcode). */
|
|
390
|
+
secretBase32: string;
|
|
391
|
+
expiresAt: string;
|
|
392
|
+
}
|
|
393
|
+
interface AXMConfirmTwoFactorEnrollmentInput {
|
|
394
|
+
enrollmentId: string;
|
|
395
|
+
code: string;
|
|
396
|
+
}
|
|
397
|
+
interface AXMConfirmTwoFactorEnrollmentResult {
|
|
398
|
+
enabled: true;
|
|
399
|
+
verifiedAt: string;
|
|
400
|
+
}
|
|
401
|
+
interface AXMDisableTwoFactorInput {
|
|
402
|
+
/** At least one of password or totpCode is required. */
|
|
403
|
+
password?: string;
|
|
404
|
+
totpCode?: string;
|
|
405
|
+
}
|
|
406
|
+
interface AXMDisableTwoFactorResult {
|
|
407
|
+
enabled: false;
|
|
408
|
+
}
|
|
409
|
+
interface AXMGenerateTwoFactorRecoveryCodesInput {
|
|
410
|
+
/** At least one of password or totpCode is required. */
|
|
411
|
+
password?: string;
|
|
412
|
+
totpCode?: string;
|
|
413
|
+
}
|
|
414
|
+
interface AXMGenerateTwoFactorRecoveryCodesResult {
|
|
415
|
+
/** Plaintext codes shown once only (display format ABCD-EFGH). */
|
|
416
|
+
codes: string[];
|
|
417
|
+
}
|
|
418
|
+
interface AXMGetTwoFactorStatusResult {
|
|
419
|
+
enabled: boolean;
|
|
420
|
+
enrolled: boolean;
|
|
421
|
+
verifiedAt?: string | null;
|
|
422
|
+
hasRecoveryCodes: boolean;
|
|
423
|
+
unusedRecoveryCodeCount: number;
|
|
424
|
+
}
|
|
425
|
+
interface AXMAdminResetTwoFactorInput {
|
|
426
|
+
userId: string;
|
|
427
|
+
/** When true, only validates that 2FA is enabled; does not wipe or revoke sessions. */
|
|
428
|
+
dryRun?: boolean;
|
|
429
|
+
}
|
|
430
|
+
interface AXMAdminResetTwoFactorResult {
|
|
431
|
+
reset: boolean;
|
|
432
|
+
}
|
|
433
|
+
interface AXMVerifyTwoFactorLoginInput {
|
|
434
|
+
challengeId: string;
|
|
435
|
+
/** TOTP (6 digits) or recovery code. */
|
|
436
|
+
code: string;
|
|
437
|
+
rememberMe?: boolean;
|
|
438
|
+
}
|
|
249
439
|
|
|
250
440
|
declare enum AXMSessionStatusTypes {
|
|
251
441
|
revoked = "revoked",
|
|
@@ -288,10 +478,19 @@ interface AXMSecurityManagementDeviceSessionsEntityModel extends AXPEntityModel<
|
|
|
288
478
|
loggedOutAt?: Date | string | null;
|
|
289
479
|
}
|
|
290
480
|
|
|
481
|
+
/**
|
|
482
|
+
* Login protocol for {@link AXMIdentityProviderEntityModel}.
|
|
483
|
+
* `directory` covers LDAP, Active Directory, and similar bind-based directories.
|
|
484
|
+
*/
|
|
485
|
+
declare const AXM_IDENTITY_PROVIDER_PROTOCOL: {
|
|
486
|
+
readonly Oidc: "oidc";
|
|
487
|
+
readonly Directory: "directory";
|
|
488
|
+
};
|
|
489
|
+
type AXMIdentityProviderProtocol = (typeof AXM_IDENTITY_PROVIDER_PROTOCOL)[keyof typeof AXM_IDENTITY_PROVIDER_PROTOCOL];
|
|
291
490
|
/**
|
|
292
491
|
* Platform login IdP row (SecurityManagement.IdentityProvider).
|
|
293
492
|
* Active/inactive uses the disable plugin field `isDisabled`.
|
|
294
|
-
* Broker routing uses `key` as OAuth `acr_values
|
|
493
|
+
* Broker routing uses `key` as OAuth `acr_values` (OIDC only).
|
|
295
494
|
*/
|
|
296
495
|
interface AXMIdentityProviderEntityModel {
|
|
297
496
|
id: string;
|
|
@@ -299,18 +498,43 @@ interface AXMIdentityProviderEntityModel {
|
|
|
299
498
|
key: string;
|
|
300
499
|
title: string;
|
|
301
500
|
icon?: string | null;
|
|
302
|
-
/**
|
|
501
|
+
/**
|
|
502
|
+
* `oidc` = external OAuth/OIDC broker; `directory` = LDAP/AD-style bind login.
|
|
503
|
+
* Missing/legacy rows are treated as `oidc`.
|
|
504
|
+
*/
|
|
505
|
+
protocol?: AXMIdentityProviderProtocol | null;
|
|
506
|
+
/** External IdP authorize URL (OIDC). */
|
|
303
507
|
authorizationUrl?: string | null;
|
|
304
|
-
/** External IdP token URL. */
|
|
508
|
+
/** External IdP token URL (OIDC). */
|
|
305
509
|
tokenUrl?: string | null;
|
|
306
|
-
/** Optional userinfo URL when id_token is absent. */
|
|
510
|
+
/** Optional userinfo URL when id_token is absent (OIDC). */
|
|
307
511
|
userInfoUrl?: string | null;
|
|
308
|
-
/** Space-separated scopes requested from the external IdP. */
|
|
512
|
+
/** Space-separated scopes requested from the external IdP (OIDC). */
|
|
309
513
|
scopes?: string | null;
|
|
514
|
+
/**
|
|
515
|
+
* OIDC issuer URL, or stable directory issuer label stored on provisioned identities.
|
|
516
|
+
*/
|
|
310
517
|
issuerUrl?: string | null;
|
|
518
|
+
/**
|
|
519
|
+
* OAuth client id (OIDC), or directory service-account Bind DN when using search bind.
|
|
520
|
+
*/
|
|
311
521
|
clientId?: string | null;
|
|
312
|
-
/**
|
|
522
|
+
/**
|
|
523
|
+
* OAuth client secret (OIDC), or directory Bind Password when using search bind.
|
|
524
|
+
*/
|
|
313
525
|
clientSecret?: string | null;
|
|
526
|
+
/** Directory server URL, e.g. `ldap://directory.example.com:389`. */
|
|
527
|
+
directoryUrl?: string | null;
|
|
528
|
+
/** Directory search base DN, e.g. `DC=example,DC=com`. */
|
|
529
|
+
directoryBaseDn?: string | null;
|
|
530
|
+
/** Direct bind template with `{{username}}`, e.g. `{{username}}@example.com`. */
|
|
531
|
+
directoryUserDnTemplate?: string | null;
|
|
532
|
+
/** Optional search filter with `{{username}}` when using a service bind account. */
|
|
533
|
+
directoryUserSearchFilter?: string | null;
|
|
534
|
+
/** Start TLS when connecting to the directory server. */
|
|
535
|
+
directoryUseTls?: boolean | null;
|
|
536
|
+
/** Reject connections when the directory TLS certificate is untrusted. */
|
|
537
|
+
directoryTlsRejectUnauthorized?: boolean | null;
|
|
314
538
|
/** From disable plugin — `true` means not offered on login. */
|
|
315
539
|
isDisabled?: boolean;
|
|
316
540
|
priority: number;
|
|
@@ -375,6 +599,36 @@ interface AXMSecurityManagementUserRoleEntityModel extends AXPEntityModel<string
|
|
|
375
599
|
roleIds: string[];
|
|
376
600
|
}
|
|
377
601
|
|
|
602
|
+
type AXMUserTwoFactorMethod = 'authenticator';
|
|
603
|
+
interface AXMUserTwoFactorRecoveryCode {
|
|
604
|
+
hash: string;
|
|
605
|
+
/** Salt / hashing metadata (e.g. full pbkdf2 encoded string already embeds salt — optional extra). */
|
|
606
|
+
salt?: string;
|
|
607
|
+
usedAt?: string | null;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Persisted authenticator enrollment for one user.
|
|
611
|
+
* Secrets must never be returned on client/entity APIs.
|
|
612
|
+
*/
|
|
613
|
+
interface AXMSecurityManagementUserTwoFactorEntityModel extends AXPEntityModel<string> {
|
|
614
|
+
userId: string;
|
|
615
|
+
method: AXMUserTwoFactorMethod;
|
|
616
|
+
encryptedSecret: string;
|
|
617
|
+
iv: string;
|
|
618
|
+
authTag: string;
|
|
619
|
+
keyVersion: number;
|
|
620
|
+
verifiedAt: string;
|
|
621
|
+
/** Last accepted TOTP time-step (floor(unix/period)); replay guard. */
|
|
622
|
+
lastAcceptedStep?: number | null;
|
|
623
|
+
recoveryCodes?: AXMUserTwoFactorRecoveryCode[];
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Schema-only entity for authenticator enrollment.
|
|
628
|
+
* No secret fields in UI; all mutations go through dedicated 2FA commands.
|
|
629
|
+
*/
|
|
630
|
+
declare function userTwoFactorFactory(): Promise<AXPEntity | null>;
|
|
631
|
+
|
|
378
632
|
interface AXMSecurityManagementUsersEntityModel extends AXPEntityModel<string> {
|
|
379
633
|
id: string;
|
|
380
634
|
username: string;
|
|
@@ -414,5 +668,5 @@ interface AXMSecurityManagementUsersEntityModel extends AXPEntityModel<string> {
|
|
|
414
668
|
passwordReset?: AXMUserPasswordResetInfo | null;
|
|
415
669
|
}
|
|
416
670
|
|
|
417
|
-
export { AXMSecurityManagementServerCommands, AXMSessionStatusTypes, AXMUserAccessState, AXMUserEffectiveState, AXM_CHANGE_OWN_PASSWORD_ERROR_CODES, AXM_SECURITY_CONTEXT_DEFINITIONS, AXM_USER_ACCESS_STATE_DEFINITION_KEY, AXM_USER_EFFECTIVE_STATE_DEFINITION_KEY, AXM_USER_SEND_PASSWORD_RESET_COMMAND, AXPAdministrationPermissionKeys, AXPSecurityManagementFeatureKeys, AXPSecurityManagementMenuKeys, AXPSecurityManagementPermissionKeys, ROLE_PERMISSIONS_PAGE_COMPONENT_KEY, RootConfig, USER_ROLES_PAGE_COMPONENT_KEY, resolveAXMUserEffectiveState };
|
|
418
|
-
export type { AXMChangeOwnPasswordInput, AXMChangeOwnPasswordResult, AXMCompletePasswordResetInput, AXMIdentityProviderEntityModel, AXMPolicyEffect, AXMPolicyEffectRule, AXMPolicyScope, AXMSecurityManagementDeviceSessionsEntityModel, AXMSecurityManagementPolicyEntityModel, AXMSecurityManagementProfileEntityModel, AXMSecurityManagementRolePermissionEntityModel, AXMSecurityManagementRolesEntityModel, AXMSecurityManagementUserRoleEntityModel, AXMSecurityManagementUsersEntityModel, AXMSendPasswordResetEmailInput, AXMUserPasswordResetInfo };
|
|
671
|
+
export { AXMSecurityManagementServerCommands, AXMSessionStatusTypes, AXMUserAccessState, AXMUserEffectiveState, AXM_ACCEPT_INVITATION_ERROR_CODES, AXM_CHANGE_OWN_PASSWORD_ERROR_CODES, AXM_IDENTITY_PROVIDER_PROTOCOL, AXM_MEMBERSHIP_INVITATION_NOTIFICATION_DEFINITION_KEY, AXM_MEMBERSHIP_INVITE_WAITING_ROOM_SOURCE, AXM_SECURITY_CONTEXT_DEFINITIONS, AXM_TWO_FACTOR_ERROR_CODES, AXM_USER_ACCESS_STATE_DEFINITION_KEY, AXM_USER_CANCEL_INVITATION_COMMAND, AXM_USER_EFFECTIVE_STATE_DEFINITION_KEY, AXM_USER_INVITE_COMMAND, AXM_USER_RESEND_INVITATION_COMMAND, AXM_USER_RESET_TWO_FACTOR_COMMAND, AXM_USER_SEND_PASSWORD_RESET_COMMAND, AXPAdministrationPermissionKeys, AXPSecurityManagementFeatureKeys, AXPSecurityManagementMenuKeys, AXPSecurityManagementPermissionKeys, ROLE_PERMISSIONS_PAGE_COMPONENT_KEY, RootConfig, SecurityManagementManifest, USER_ROLES_PAGE_COMPONENT_KEY, resolveAXMUserEffectiveState, userTwoFactorFactory };
|
|
672
|
+
export type { AXMAcceptInvitationInput, AXMAcceptInvitationPreviewResult, AXMAcceptInvitationReason, AXMAcceptMyInvitationInput, AXMAdminResetTwoFactorInput, AXMAdminResetTwoFactorResult, AXMCancelInvitationInput, AXMChangeOwnPasswordInput, AXMChangeOwnPasswordResult, AXMCompletePasswordResetInput, AXMConfirmTwoFactorEnrollmentInput, AXMConfirmTwoFactorEnrollmentResult, AXMDeclineInvitationInput, AXMDisableTwoFactorInput, AXMDisableTwoFactorResult, AXMGenerateTwoFactorRecoveryCodesInput, AXMGenerateTwoFactorRecoveryCodesResult, AXMGetTwoFactorStatusResult, AXMIdentityProviderEntityModel, AXMIdentityProviderProtocol, AXMInviteUserInput, AXMInviteUserResult, AXMListMyPendingInvitationsResult, AXMPendingInvitationItem, AXMPolicyEffect, AXMPolicyEffectRule, AXMPolicyScope, AXMResendInvitationInput, AXMSecurityManagementDeviceSessionsEntityModel, AXMSecurityManagementPolicyEntityModel, AXMSecurityManagementProfileEntityModel, AXMSecurityManagementRolePermissionEntityModel, AXMSecurityManagementRolesEntityModel, AXMSecurityManagementUserRoleEntityModel, AXMSecurityManagementUserTwoFactorEntityModel, AXMSecurityManagementUsersEntityModel, AXMSendPasswordResetEmailInput, AXMStartTwoFactorEnrollmentInput, AXMStartTwoFactorEnrollmentResult, AXMUserCreatedVia, AXMUserInvitationInfo, AXMUserPasswordResetInfo, AXMUserTwoFactorMethod, AXMUserTwoFactorRecoveryCode, AXMVerifyTwoFactorLoginInput };
|