UNPKG

stackpress

Version:

Incept is a content management framework.

40 lines (39 loc) 1.94 kB
import Exception from '../Exception.js'; import type Model from '../schema/spec/Model.js'; import type { SearchJoinMap, SearchPath } from './types.js'; export declare const stringable: string[]; export declare const floatable: string[]; export declare const dateable: string[]; export declare const boolable: string[]; export declare const intable: string[]; export declare function toErrorResponse(e: Error | Exception, code?: number): import("@stackpress/lib/types").ErrorResponse; export declare function toResponse(results: any, total?: number): { code: number; status: string; results: any; total: number; } | { code: number; status: string; results: any; total?: number; }; export declare function toSqlString<Strict = string | null | undefined>(value: any, strict?: boolean): Strict; export declare function toSqlBoolean<Strict = boolean | null | undefined>(value: any, strict?: boolean): Strict; export declare function toSqlDate<Strict = Date | null | undefined>(value: any, strict?: boolean): Strict; export declare function toSqlInteger<Strict = number | null | undefined>(value: any, strict?: boolean): Strict; export declare function toSqlFloat<Strict = number | null | undefined>(value: any, strict?: boolean): Strict; export declare function sequence(models: Model[]): Model[]; export declare function getColumns(column: string, model: Model, prefixes?: string[]): string[]; export declare function getColumnInfo(selector: string, model: Model): { name: string; table: string; column: string; alias: string; path: SearchPath[]; last: SearchPath; joins: SearchJoinMap; }; export declare function getColumnPath(selector: string, model: Model, path?: SearchPath[]): SearchPath[]; export declare function getColumnJoins(selector: string, model: Model, index?: number, joins?: SearchJoinMap): SearchJoinMap; export declare function getAlias(selector: string): string;