import { JSONSchema4 } from 'json-schema'; import { PgType } from '../abstractions'; /** * Returns true if a JSON schema property element is a primitive property. * @remarks * A primitive property is considered to be a property whose type is either * a primitive type or an array of primitive type. * @param schema - Schema element to analyze. */ export declare function isPrimitiveProperty(schema: JSONSchema4): boolean; /** * Returns true if a JSON schema property element is an object property. * @remarks * An object property is considered to be a property whose type is either * of type object or an array of type object. * @param schema - Schema element to analyze. */ export declare function isObjectProperty(schema: JSONSchema4): boolean; /** * Returns true if schema property type is a primitive. * @param typeName - Type name to check. */ export declare function isPrimitiveType(typeName: unknown): boolean; /** * Returns a property (defined in 'properties') schema by name from JSON schema. * @param schema - JSON schema where the property exists. * @param propertyName - Name of the property to extract. */ export declare function getPropertySchema(schema: JSONSchema4, propertyName: string): JSONSchema4; /** * Maps JSON schema's property type to a Postgres type. * @param schema - Property schema. * @throws If the schema property type is not supported. */ export declare function mapToPgType(schema: JSONSchema4): PgType; /** * Returns an array of all defined content metadata schemas (movie, collection etc.). * @param schema - Publish message schema. */ export declare function getContentMetadataSchemas(schemaGlob: string): Promise; /** * Separates primitive properties from object properties. * @param schema - Content metadata schema. * @param ignoredProperties - Array of ignored properties. * @returns Tuple of separated properties: first element will be primitive properties, second object properties. */ export declare function separateProperties(schema: JSONSchema4, ignoredProperties: string[]): [{ [p: string]: JSONSchema4; }, { [p: string]: JSONSchema4; }]; /** * Filters out properties by name from a dictionary of JSON schema properties. * @param schemas - Dictionary of schemas. * @param excluded - Array of excluded names. */ export declare function filterProperties(schemas: { [p: string]: JSONSchema4; }, excluded: string[]): { [p: string]: JSONSchema4; }; /** * Returns schema's title, throws if it is undefined. * @param schema - JSON schema */ export declare function getSchemaTitle(schema: JSONSchema4): string;