mirror of
https://github.com/strapi/strapi.git
synced 2025-07-22 00:17:15 +00:00
53 lines
1.0 KiB
TypeScript
53 lines
1.0 KiB
TypeScript
import type { Public, Modules } from '@strapi/types';
|
|
|
|
import { errors } from '@strapi/utils';
|
|
|
|
type Entity = Modules.EntityService.Result<Public.UID.Schema>;
|
|
|
|
/**
|
|
* POST /uid/generate
|
|
*/
|
|
export declare namespace GenerateUID {
|
|
export interface Request {
|
|
body: {
|
|
contentTypeUID: string;
|
|
data: Entity;
|
|
field: string;
|
|
};
|
|
query: {
|
|
locale?: string | null;
|
|
};
|
|
}
|
|
export interface Response {
|
|
data: string;
|
|
error?: errors.ApplicationError | errors.YupValidationError;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* POST /uid/check-availability
|
|
*/
|
|
export declare namespace CheckUIDAvailability {
|
|
export interface Request {
|
|
body: {
|
|
contentTypeUID: string;
|
|
field: string;
|
|
value: string;
|
|
};
|
|
query: {
|
|
locale?: string | null;
|
|
};
|
|
}
|
|
export type Response =
|
|
| {
|
|
isAvailable: boolean;
|
|
suggestion: string | null;
|
|
error?: never;
|
|
}
|
|
| {
|
|
isAvailable?: never;
|
|
suggesiton?: never;
|
|
error?: errors.ApplicationError | errors.YupValidationError;
|
|
};
|
|
}
|