import { Result } from "@webiny/feature/api"; import type { CmsEntry, CmsEntryStorageOperationsGetPreviousRevisionParams, CmsEntryValues, CmsModel } from "../../../types/index.js"; import type { EntryNotAuthorizedError } from "../../../domain/contentEntry/errors.js"; import { EntryNotFoundError, type EntryPersistenceError } from "../../../domain/contentEntry/errors.js"; /** * Base internal use case - returns entry regardless of deleted state. * This is used internally by the public variation. */ export interface IGetPreviousRevisionByEntryIdBaseUseCase { execute(model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams): Promise, UseCaseError>>; } export interface IGetPreviousRevisionByEntryIdUseCaseErrors { notAuthorized: EntryNotAuthorizedError; notFound: EntryNotFoundError; storage: EntryPersistenceError; } type UseCaseError = IGetPreviousRevisionByEntryIdUseCaseErrors[keyof IGetPreviousRevisionByEntryIdUseCaseErrors]; /** Base use case for retrieving the previous entry revision. */ export declare const GetPreviousRevisionByEntryIdBaseUseCase: import("@webiny/di").Abstraction; export declare namespace GetPreviousRevisionByEntryIdBaseUseCase { type Interface = IGetPreviousRevisionByEntryIdBaseUseCase; type Params = CmsEntryStorageOperationsGetPreviousRevisionParams; type Error = UseCaseError; type Return = Promise, UseCaseError>>; } /** Retrieve the previous revision of an entry. */ export declare const GetPreviousRevisionByEntryIdUseCase: import("@webiny/di").Abstraction; export declare namespace GetPreviousRevisionByEntryIdUseCase { type Interface = IGetPreviousRevisionByEntryIdBaseUseCase; type Params = CmsEntryStorageOperationsGetPreviousRevisionParams; type Error = UseCaseError; type Return = Promise, UseCaseError>>; } /** * GetPreviousRevisionByEntryIdRepository - Fetches previous revision from storage by entry ID and version. */ export interface IGetPreviousRevisionByEntryIdRepository { execute(model: CmsModel, params: CmsEntryStorageOperationsGetPreviousRevisionParams): Promise, RepositoryError>>; } export interface IGetPreviousRevisionByEntryIdRepositoryErrors { storage: EntryPersistenceError; notFound: EntryNotFoundError; } type RepositoryError = IGetPreviousRevisionByEntryIdRepositoryErrors[keyof IGetPreviousRevisionByEntryIdRepositoryErrors]; export declare const GetPreviousRevisionByEntryIdRepository: import("@webiny/di").Abstraction; export declare namespace GetPreviousRevisionByEntryIdRepository { type Interface = IGetPreviousRevisionByEntryIdRepository; type Error = RepositoryError; } export {};