| 
									
										
										
										
											2024-03-01 14:41:47 +01:00
										 |  |  | import type { Data } from '@strapi/types'; | 
					
						
							| 
									
										
										
										
											2023-10-30 12:17:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | export interface Entity { | 
					
						
							| 
									
										
										
										
											2024-03-01 14:41:47 +01:00
										 |  |  |   id: Data.ID; | 
					
						
							| 
									
										
										
										
											2023-10-30 12:17:27 +00:00
										 |  |  |   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; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 11:40:51 +00:00
										 |  |  | export type AdminUserCreationPayload = Omit< | 
					
						
							|  |  |  |   AdminUser, | 
					
						
							|  |  |  |   keyof Entity | 'roles' | 'isActive' | 'blocked' | 
					
						
							|  |  |  | > & { | 
					
						
							| 
									
										
										
										
											2024-03-01 14:41:47 +01:00
										 |  |  |   roles: Data.ID[]; | 
					
						
							| 
									
										
										
										
											2023-11-16 16:38:15 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 11:40:51 +00:00
										 |  |  | export type AdminUserUpdatePayload = Omit<AdminUser, keyof Entity | 'roles'> & { | 
					
						
							| 
									
										
										
										
											2024-03-01 14:41:47 +01:00
										 |  |  |   roles: Data.ID[]; | 
					
						
							| 
									
										
										
										
											2023-11-16 16:38:15 +01:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2023-10-30 12:17:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 11:40:51 +00:00
										 |  |  | export type SanitizedAdminUser = Omit<AdminUser, 'password' | 'resetPasswordToken' | 'roles'> & { | 
					
						
							|  |  |  |   roles: SanitizedAdminRole[]; | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2023-11-16 16:38:15 +01:00
										 |  |  | export interface AdminRole extends Entity { | 
					
						
							|  |  |  |   name: string; | 
					
						
							|  |  |  |   code: string; | 
					
						
							|  |  |  |   description?: string; | 
					
						
							|  |  |  |   users: AdminUser[]; | 
					
						
							|  |  |  |   permissions: Permission[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export type SanitizedAdminRole = Omit< | 
					
						
							|  |  |  |   AdminRole, | 
					
						
							|  |  |  |   'users' | 'permissions' | 'createdAt' | 'updatedAt' | 
					
						
							|  |  |  | >; | 
					
						
							| 
									
										
										
										
											2023-11-21 11:40:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | export interface Pagination { | 
					
						
							|  |  |  |   page: number; | 
					
						
							|  |  |  |   pageSize: number; | 
					
						
							|  |  |  |   pageCount: number; | 
					
						
							|  |  |  |   total: number; | 
					
						
							|  |  |  | } |