Marc Roig 002fc78b3c
feat: preview endpoint (#21574)
* feat: base files for static preview

* feat: preview config

* Update packages/core/content-manager/server/src/preview/routes/index.ts

Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>

* chore: empty handler

* chore: comment controllers type

* fix: remove is enabled check from load

* feat: test preview config

* chore: refactor type

* feat: preview endpoint

* feat: preview test

* fix: tests

* fix: api test

* chore: comment

---------

Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
2024-10-08 14:23:47 +02:00

32 lines
705 B
TypeScript

import type { Data, UID } from '@strapi/types';
import { type errors } from '@strapi/utils';
/**
* GET /content-manager/preview/url/:uid
*/
export declare namespace GetPreviewUrl {
export interface Request {
params: {
contentType: UID.ContentType;
};
query: {
documentId?: Data.DocumentID;
locale?: string;
status?: 'published' | 'draft';
};
}
// NOTE: Response status will be 204 if no URL is found
export type Response =
| {
data: {
url: string | undefined;
};
error?: never;
}
| {
data?: never;
error: errors.ApplicationError | errors.ValidationError | errors.NotFoundError;
};
}