import { SnapshotClient, Type } from '../../snapshot'; import { SupportedDirectusCollections } from './directus-structure'; import { LoggerService, Logger } from '../../logger'; export { Type }; export declare class SchemaClient { protected readonly loggerService: LoggerService; protected readonly snapshotClient: SnapshotClient; protected readonly logger: Logger; constructor(loggerService: LoggerService, snapshotClient: SnapshotClient); /** * Returns the list of fields of type "many-to-one" of a model. */ getRelationFields(model: string): Promise; /** * Returns the target model of a many-to-one relation. * Throw an error if the relation is not many-to-one * or the model does not exist or the field does not exist. */ getTargetModel(model: string, field: string): Promise; /** * Returns the primary field of a model. */ getPrimaryField(model: string): Promise<{ name: string; type: Type; }>; /** * Denotes if the collection is a directus collection. */ protected isDirectusCollection(collection: string): collection is SupportedDirectusCollections; /** * Returns the list of fields of type "many-to-one" of a directus collection. */ protected getDirectusCollectionRelationFields(model: SupportedDirectusCollections): string[]; /** * Returns the target model of a directus collection. */ protected getDirectusCollectionTargetModel(model: SupportedDirectusCollections, field: string): string | undefined; /** * Returns the primary field type of a directus model. */ protected getDirectusCollectionPrimaryField(model: SupportedDirectusCollections): { name: string; type: Type; }; }