mirror of
https://github.com/strapi/strapi.git
synced 2025-07-13 12:02:10 +00:00

* chore(wip): convert settings pages * chore: add api-tokens contract * fix: types * chore: convert webhooks page (#18682) * chore: convert webhooks * fix: configurations provider * chore: add all contracts * chore(admin): add workflow contracts (#18707) * chore(admin): add audit-logs contracts (#18708) * chore: convert users page to TS (#18710) * chore(admin): convert Roles Settings (#18774) * chore(admin): fix types from merge * chore(admin): convert Single Sign On settings page to TS and refactoring * chore: pretty --------- Co-authored-by: HichamELBSI <elabbassih@gmail.com>
68 lines
1.4 KiB
TypeScript
68 lines
1.4 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 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 AdminUserCreationPayload = Omit<
|
|
AdminUser,
|
|
keyof Entity | 'roles' | 'isActive' | 'blocked'
|
|
> & {
|
|
roles: TEntity.ID[];
|
|
};
|
|
|
|
export type AdminUserUpdatePayload = Omit<AdminUser, keyof Entity | 'roles'> & {
|
|
roles: TEntity.ID[];
|
|
};
|
|
|
|
export type SanitizedAdminUser = Omit<AdminUser, 'password' | 'resetPasswordToken' | 'roles'> & {
|
|
roles: SanitizedAdminRole[];
|
|
};
|
|
export interface AdminRole extends Entity {
|
|
name: string;
|
|
code: string;
|
|
description?: string;
|
|
users: AdminUser[];
|
|
permissions: Permission[];
|
|
}
|
|
|
|
export type SanitizedAdminRole = Omit<
|
|
AdminRole,
|
|
'users' | 'permissions' | 'createdAt' | 'updatedAt'
|
|
>;
|
|
|
|
export interface Pagination {
|
|
page: number;
|
|
pageSize: number;
|
|
pageCount: number;
|
|
total: number;
|
|
}
|