| 
									
										
										
										
											2024-03-01 15:56:07 +01:00
										 |  |  | import type { UID, Modules } from '@strapi/types'; | 
					
						
							| 
									
										
										
										
											2023-11-15 11:08:04 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | import { errors } from '@strapi/utils'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-01 15:56:07 +01:00
										 |  |  | type Entity = Modules.EntityService.Result<UID.Schema>; | 
					
						
							| 
									
										
										
										
											2023-11-15 11:08:04 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * POST /uid/generate | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export declare namespace GenerateUID { | 
					
						
							|  |  |  |   export interface Request { | 
					
						
							|  |  |  |     body: { | 
					
						
							|  |  |  |       contentTypeUID: string; | 
					
						
							|  |  |  |       data: Entity; | 
					
						
							|  |  |  |       field: string; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2024-01-29 15:35:20 +00:00
										 |  |  |     query: { | 
					
						
							|  |  |  |       locale?: string | null; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-11-15 11:08:04 +00:00
										 |  |  |   } | 
					
						
							|  |  |  |   export interface Response { | 
					
						
							| 
									
										
										
										
											2023-12-04 16:00:50 +00:00
										 |  |  |     data: string; | 
					
						
							| 
									
										
										
										
											2023-11-15 11:08:04 +00:00
										 |  |  |     error?: errors.ApplicationError | errors.YupValidationError; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * POST /uid/check-availability | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export declare namespace CheckUIDAvailability { | 
					
						
							|  |  |  |   export interface Request { | 
					
						
							|  |  |  |     body: { | 
					
						
							|  |  |  |       contentTypeUID: string; | 
					
						
							|  |  |  |       field: string; | 
					
						
							|  |  |  |       value: string; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2024-01-29 15:35:20 +00:00
										 |  |  |     query: { | 
					
						
							|  |  |  |       locale?: string | null; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-11-15 11:08:04 +00:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-12-04 16:00:50 +00:00
										 |  |  |   export type Response = | 
					
						
							|  |  |  |     | { | 
					
						
							|  |  |  |         isAvailable: boolean; | 
					
						
							|  |  |  |         suggestion: string | null; | 
					
						
							|  |  |  |         error?: never; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     | { | 
					
						
							|  |  |  |         isAvailable?: never; | 
					
						
							|  |  |  |         suggesiton?: never; | 
					
						
							|  |  |  |         error?: errors.ApplicationError | errors.YupValidationError; | 
					
						
							|  |  |  |       }; | 
					
						
							| 
									
										
										
										
											2023-11-15 11:08:04 +00:00
										 |  |  | } |