import type { Result } from "@webiny/feature/api"; import type { CmsEntryValues, CmsModel, UpdateCmsEntryInput } from "../../../types/index.js"; import type { EntryNotAuthorizedError, EntryNotFoundError } from "../../../domain/contentEntry/errors.js"; import { GetRevisionByIdUseCase } from "../../../features/contentEntry/GetRevisionById/index.js"; export interface IValidateEntryUserCaseExecuteResult { error: string; id: string; fieldId: string; parents: string[]; } /** * ValidateEntry Use Case - Validates entry data against model field validators. * This can be used to validate data before creating or updating an entry. */ export type IValidateEntryUseCaseExecuteResult = Promise>; export interface IValidateEntryUseCase { execute(model: CmsModel, id: string | null | undefined, input: UpdateCmsEntryInput): IValidateEntryUseCaseExecuteResult; } export interface IValidateEntryUseCaseErrors { notAuthorized: EntryNotAuthorizedError; notFound: EntryNotFoundError; getRevisionById: GetRevisionByIdUseCase.Error; } type UseCaseError = IValidateEntryUseCaseErrors[keyof IValidateEntryUseCaseErrors]; /** Validate a content entry against its model schema. */ export declare const ValidateEntryUseCase: import("@webiny/di").Abstraction; export declare namespace ValidateEntryUseCase { type Interface = IValidateEntryUseCase; type Input = UpdateCmsEntryInput; type Error = UseCaseError; type Return = IValidateEntryUseCaseExecuteResult; } export {};