2023-12-13 11:49:05 +01:00

53 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { errors } from '@strapi/utils';
import { Entity, Pagination, SanitizedAdminUser } from './shared';
// displayName seems to be used only for audit logs
export interface SanitizedAdminUserForAuditLogs extends SanitizedAdminUser {
displayName: string;
}
interface AuditLog extends Pick<Entity, 'id'> {
date: string;
action: string;
/**
* TODO: could this be better typed working on the server-side code could indicate this.
* However, we know it's JSON.
*/
payload: Record<string, unknown>;
user?: SanitizedAdminUserForAuditLogs;
}
namespace GetAll {
export interface Request {
body: {};
query: {};
}
export interface Response {
data: {
pagination: Pagination;
results: AuditLog[];
};
error?: errors.ApplicationError;
}
}
namespace Get {
export interface Request {
body: {};
query: {};
}
export interface Params {
id: Entity['id'];
}
export type Response =
| AuditLog
| {
error?: errors.ApplicationError;
};
}
export { AuditLog, GetAll, Get };