2023-11-15 11:08:04 +00:00
|
|
|
import { Schema } from '@strapi/types';
|
|
|
|
import { errors } from '@strapi/utils';
|
|
|
|
import { Configuration, Settings, Metadatas, Layouts } from './content-types';
|
|
|
|
|
|
|
|
export interface Component extends Schema.Component {
|
|
|
|
isDisplayed: boolean;
|
|
|
|
info: Schema.Info;
|
|
|
|
apiID: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ComponentConfiguration extends Configuration {
|
|
|
|
category: string;
|
|
|
|
isComponent: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GET /components
|
|
|
|
*/
|
|
|
|
export declare namespace FindComponents {
|
|
|
|
export interface Request {
|
|
|
|
body: {};
|
|
|
|
query: {};
|
|
|
|
}
|
|
|
|
export interface Response {
|
|
|
|
data: Component[];
|
|
|
|
error?: errors.ApplicationError;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GET /components/:uid/configuration
|
|
|
|
*/
|
|
|
|
export declare namespace FindComponentConfiguration {
|
|
|
|
export interface Request {
|
|
|
|
body: {};
|
|
|
|
query: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Params {
|
|
|
|
uid: string;
|
|
|
|
}
|
|
|
|
export interface Response {
|
|
|
|
data: {
|
2023-12-04 16:00:50 +00:00
|
|
|
component: ComponentConfiguration;
|
|
|
|
components: Record<string, ComponentConfiguration>;
|
2023-11-15 11:08:04 +00:00
|
|
|
};
|
|
|
|
error?: errors.ApplicationError;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PUT /components/:uid/configuration
|
|
|
|
*/
|
|
|
|
export declare namespace UpdateComponentConfiguration {
|
|
|
|
export interface Request {
|
|
|
|
body: {
|
|
|
|
layouts: Layouts;
|
|
|
|
metadatas: Metadatas;
|
|
|
|
settings: Settings;
|
|
|
|
};
|
|
|
|
query: {};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Params {
|
|
|
|
uid: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Response {
|
2023-12-04 16:00:50 +00:00
|
|
|
data: ComponentConfiguration;
|
2023-11-15 11:08:04 +00:00
|
|
|
error?: errors.ApplicationError | errors.YupValidationError;
|
|
|
|
}
|
|
|
|
}
|