refactor: Add common DTOs and schemas for the redesigned users list (#16097)

This commit is contained in:
Csaba Tuncsik
2025-06-11 14:55:04 +02:00
committed by GitHub
parent b9e03515bd
commit e681e6b477
23 changed files with 348 additions and 52 deletions

View File

@@ -6,6 +6,8 @@ import type {
Iso8601DateTimeString,
IUserManagementSettings,
IVersionNotificationSettings,
ROLE,
Role,
} from '@n8n/api-types';
import type { Scope } from '@n8n/permissions';
import type { NodeCreatorTag } from '@n8n/design-system';
@@ -55,7 +57,6 @@ import type {
TRIGGER_NODE_CREATOR_VIEW,
REGULAR_NODE_CREATOR_VIEW,
AI_OTHERS_NODE_CREATOR_VIEW,
ROLE,
AI_UNCATEGORIZED_CATEGORY,
AI_EVALUATION,
} from '@/constants';
@@ -568,9 +569,7 @@ export type IPersonalizationSurveyVersions =
| IPersonalizationSurveyAnswersV3
| IPersonalizationSurveyAnswersV4;
export type Roles = typeof ROLE;
export type IRole = Roles[keyof Roles];
export type InvitableRoleName = Roles['Member' | 'Admin'];
export type InvitableRoleName = (typeof ROLE)['Member' | 'Admin'];
export interface IUserResponse {
id: string;
@@ -578,7 +577,7 @@ export interface IUserResponse {
lastName?: string;
email?: string;
createdAt?: string;
role?: IRole;
role?: Role;
globalScopes?: Scope[];
personalizationAnswers?: IPersonalizationSurveyVersions | null;
isPending: boolean;
@@ -613,7 +612,7 @@ export const enum UserManagementAuthenticationMethod {
export interface IPermissionGroup {
loginStatus?: ILogInStatus[];
role?: IRole[];
role?: Role[];
}
export interface IPermissionAllowGroup extends IPermissionGroup {
@@ -1168,7 +1167,7 @@ export interface IInviteResponse {
email: string;
emailSent: boolean;
inviteAcceptUrl: string;
role: IRole;
role: Role;
};
error?: string;
}