Araksya Gevorgyan 281b331dc7
feat(homepage): add endpoints for widget move and resize actions (#24358)
* feat(homepage): add endpoints for widget move and resize actions
2025-09-24 16:57:09 +02:00

97 lines
1.9 KiB
TypeScript

import type { errors } from '@strapi/utils';
import type { Struct, UID } from '@strapi/types';
// Export required to avoid "cannot be named" TS build error
export interface RecentDocument {
kind: Struct.ContentTypeKind;
contentTypeUid: UID.ContentType;
contentTypeDisplayName: string;
documentId: string;
locale: string | null;
status?: 'draft' | 'published' | 'modified';
title: string;
updatedAt: Date;
publishedAt?: Date | null;
}
export declare namespace GetRecentDocuments {
export interface Request {
body: {};
query: {
action: 'update' | 'publish';
};
}
export interface Response {
data: RecentDocument[];
error?: errors.ApplicationError;
}
}
export declare namespace GetKeyStatistics {
export interface Request {
body: {};
}
export interface Response {
data: {
assets: number;
contentTypes: number;
components: number;
locales: number | null;
admins: number;
webhooks: number;
apiTokens: number;
};
error?: errors.ApplicationError;
}
}
export declare namespace GetCountDocuments {
export interface Request {
body: {};
}
export interface Response {
data: {
draft: number;
published: number;
modified: number;
};
error?: errors.ApplicationError;
}
}
export declare namespace Homepage {
export type WidgetUID = string;
export type Width = 4 | 6 | 8 | 12;
export interface Layout {
version: number;
order: WidgetUID[];
widths: Record<WidgetUID, Width>;
updatedAt: string;
}
export interface LayoutWrite {
order: WidgetUID[];
widths: Record<WidgetUID, Width>;
}
}
export declare namespace GetHomepageLayout {
export interface Response {
data: Homepage.Layout;
}
}
export declare namespace UpdateHomepageLayout {
export interface Request {
body: Homepage.LayoutWrite;
}
export interface Response {
data: Homepage.Layout;
}
}