import { Result } from "@webiny/feature/api"; import type { CmsEntry, CmsEntryStorageOperationsGetLatestRevisionParams, 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 three public variations. */ export interface IGetLatestRevisionByEntryIdBaseUseCase { execute(model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams): Promise, UseCaseError>>; } export interface IGetLatestRevisionByEntryIdUseCaseErrors { notAuthorized: EntryNotAuthorizedError; notFound: EntryNotFoundError; storage: EntryPersistenceError; } type UseCaseError = IGetLatestRevisionByEntryIdUseCaseErrors[keyof IGetLatestRevisionByEntryIdUseCaseErrors]; /** Base use case for retrieving the latest entry revision. */ export declare const GetLatestRevisionByEntryIdBaseUseCase: import("@webiny/di").Abstraction; export declare namespace GetLatestRevisionByEntryIdBaseUseCase { type Interface = IGetLatestRevisionByEntryIdBaseUseCase; type Params = CmsEntryStorageOperationsGetLatestRevisionParams; type Error = UseCaseError; type Return = Promise, UseCaseError>>; } /** Retrieve the latest revision of an entry. */ export declare const GetLatestRevisionByEntryIdUseCase: import("@webiny/di").Abstraction; export declare namespace GetLatestRevisionByEntryIdUseCase { type Interface = IGetLatestRevisionByEntryIdBaseUseCase; type Params = CmsEntryStorageOperationsGetLatestRevisionParams; type Error = UseCaseError; type Return = Promise, UseCaseError>>; } /** Retrieve the latest deleted revision of an entry. */ export declare const GetLatestDeletedRevisionByEntryIdUseCase: import("@webiny/di").Abstraction; export declare namespace GetLatestDeletedRevisionByEntryIdUseCase { type Interface = IGetLatestRevisionByEntryIdBaseUseCase; type Params = CmsEntryStorageOperationsGetLatestRevisionParams; type Error = UseCaseError; type Return = Promise, UseCaseError>>; } export declare namespace GetLatestNonDeletedRevisionByEntryIdUseCase { type Interface = IGetLatestRevisionByEntryIdBaseUseCase; type Params = CmsEntryStorageOperationsGetLatestRevisionParams; type Error = UseCaseError; type Return = Promise, UseCaseError>>; } /** Retrieve the latest entry revision, including deleted ones. */ export declare const GetLatestRevisionByEntryIdIncludingDeletedUseCase: import("@webiny/di").Abstraction; export declare namespace GetLatestRevisionByEntryIdIncludingDeletedUseCase { type Interface = IGetLatestRevisionByEntryIdBaseUseCase; type Params = CmsEntryStorageOperationsGetLatestRevisionParams; type Error = UseCaseError; type Return = Promise, UseCaseError>>; } /** * GetLatestRevisionByEntryIdRepository - Fetches latest revision from storage by entry ID. */ export interface IGetLatestRevisionByEntryIdRepository { execute(model: CmsModel, params: CmsEntryStorageOperationsGetLatestRevisionParams): Promise, RepositoryError>>; } export interface IGetLatestRevisionByEntryIdRepositoryErrors { storage: EntryPersistenceError; notFound: EntryNotFoundError; } type RepositoryError = IGetLatestRevisionByEntryIdRepositoryErrors[keyof IGetLatestRevisionByEntryIdRepositoryErrors]; export declare const GetLatestRevisionByEntryIdRepository: import("@webiny/di").Abstraction; export declare namespace GetLatestRevisionByEntryIdRepository { type Interface = IGetLatestRevisionByEntryIdRepository; type Error = RepositoryError; } export {};