UNPKG

@forestadmin/datasource-toolkit

Version:
15 lines 1.2 kB
import { CollectionSchema, ColumnSchema, FieldSchema, ManyToManySchema, OneToManySchema, RelationSchema } from '../interfaces/schema'; export default class SchemaUtils { static throwIfAlreadyDefinedField(schema: CollectionSchema, fieldName: string, collectionName?: string): void; static throwIfMissingField(schema: CollectionSchema, fieldName: string, collectionName?: string): void; static getField(schema: CollectionSchema, fieldName: string, collectionName?: string): FieldSchema; static getColumn(schema: CollectionSchema, fieldName: string, collectionName?: string): ColumnSchema; static getRelation(schema: CollectionSchema, relationName: string, collectionName?: string): RelationSchema; static getPrimaryKeys(schema: CollectionSchema): string[]; static isPrimaryKey(schema: CollectionSchema, fieldName: string): boolean; static isForeignKey(schema: CollectionSchema, name: string): boolean; static getToManyRelation(schema: CollectionSchema, relationName: string): ManyToManySchema | OneToManySchema; static getColumnNames(schema: CollectionSchema): string[]; private static throwIfAccessingFieldFromRelation; } //# sourceMappingURL=schema.d.ts.map