Josh 14ef2b7c24
chore(admin): convert ProfilePage and re-use server driven types (#18593)
* chore(admin): convert ProfilePage and re-use server driven types

* chore: fix tests

* chore: fix double export from types

* fix: type isSSOLocked endpoint
2023-10-30 12:17:27 +00:00

49 lines
1.0 KiB
TypeScript

import type { Entity as TEntity } from '@strapi/types';
export interface Entity {
id: TEntity.ID;
createdAt: string;
updatedAt: string;
}
export interface Permission extends Entity {
action: string;
actionParameters: object;
subject?: string | null;
properties: {
fields?: string[];
locales?: string[];
[key: string]: any;
};
conditions: string[];
}
export interface AdminRole extends Entity {
name: string;
code: string;
description?: string;
users: AdminUser[];
permissions: Permission[];
}
export interface AdminUser extends Entity {
firstname?: string;
lastname?: string;
username?: string;
email?: string;
password?: string;
resetPasswordToken?: string | null;
registrationToken?: string | null;
isActive: boolean;
roles: AdminRole[];
blocked: boolean;
preferedLanguage?: string;
}
export type SanitizedAdminUser = Omit<
AdminUser,
'password' | 'resetPasswordToken' | 'registrationToken'
>;
export type SanitizedAdminRole = Omit<AdminRole, 'users' | 'permissions'>;