import { Result } from "@webiny/feature/api"; import type { CmsModel } from "../../../types/index.js"; import type { ICache } from "../../../utils/caching/types.js"; import { ModelNotFoundError, ModelPersistenceError } from "../../../domain/contentModel/errors.js"; /** * PluginModelsProvider provides access to plugin-defined (code) models. */ export interface IPluginModelsProvider { list(tenant: string): Promise; } export declare const PluginModelsProvider: import("@webiny/di").Abstraction; export declare namespace PluginModelsProvider { type Interface = IPluginModelsProvider; } export declare const ModelCache: import("@webiny/di").Abstraction>>; export declare namespace ModelCache { type Interface = ICache>; } /** * ModelsFetcher - Centralized model fetching with caching. * * This abstraction handles fetching models from both plugins and database, * applies access control filtering, and caches the results for optimal performance. */ export interface IModelsFetcher { /** * Fetch all accessible models for the current tenant and identity. * Results are cached based on tenant + identity. */ fetchAll(): Promise>; /** * Fetch a single model by modelId. * Uses the cached fetchAll result. */ fetchById(modelId: string): Promise>; } export interface IModelsFetcherErrors { notFound: ModelNotFoundError; persistence: ModelPersistenceError; } type ModelsFetcherError = IModelsFetcherErrors[keyof IModelsFetcherErrors]; export declare const ModelsFetcher: import("@webiny/di").Abstraction; export declare namespace ModelsFetcher { type Interface = IModelsFetcher; type Error = ModelsFetcherError; type FetchAllReturn = Promise>; type FetchByIdReturn = Promise>; } export {};