/** * @typedef {object} EntityWhere * @property {Array<{ * tableKey: string, * keyType: string, * matchers: Array<{ * matcherKey: string, * matcherType: "equal"|"notEqual"|"in"|"notIn"|"greaterThan"|"lowerThan"| * "like"|"iLike"|"notLike"|"notILike"| * "includeNotNull"|"isNull"|"isNotNull", * relation: { * entityName: string, * shortName: string, * entityKey: string, * referencedKey: string, * where: () => EntityWhere, * }, * }|{ * matcherKey: string, * matcherType: "via"|"notExists", * relation: { * entityName: string, * shortName: string, * entityKey: string, * referencedKey: string, * where: () => EntityWhere, * }, * }>, * }>} fieldSpecification */ /** * @typedef {object} EntityUpdate * @property {string} schemaName * @property {string} name * @property {string} shortName * @property {Array} columns * @property {EntityWhere} where * @property {boolean} injectUpdatedAt * @property {Record * }>} fields */ /** * @typedef {object} EntityQueryBuilder * @property {string} name * @property {string} shortName * @property {Array} columns * @property {( orderBy?: Array, * orderBySpec?: *, * shortName?: string, * options?: { skipValidator?: boolean|undefined }, * ) => import("../types/advanced-types.d.ts").QueryPart} [orderBy] * @property {( orderBy?: Array, * orderBySpec?: *, * options?: { shortName?: string; skipValidator?: boolean|undefined }, * ) => import("../types/advanced-types.d.ts").QueryPart} [orderByExperimental] * @property {EntityWhere} where * @property {Array<{ * builderKey: string, * ownKey: string, * referencedKey: string, * returnsMany: boolean, * entityInformation: () => EntityQueryBuilder, * }>} relations */ /** * Builds a where clause based on the generated 'where' information. * * @param {EntityWhere|(()=>EntityWhere)} entityWhereInformation * @param {*} where * @param {string} shortName * @returns {import("../types/advanced-types.d.ts").QueryPart} */ export function generatedWhereBuilderHelper(entityWhereInformation: EntityWhere | (() => EntityWhere), where: any, shortName: string): import("../types/advanced-types.d.ts").QueryPart; /** * Helper to generate update queries based on the dumped spec and the input data. * The input data is validated, so we can safely access it as 'any'. * * @param {EntityUpdate} entity * @param {any} input * @returns {import("../types/advanced-types.d.ts").QueryPart>} */ export function generatedUpdateHelper(entity: EntityUpdate, input: any): import("../types/advanced-types.d.ts").QueryPart>; /** * Helper to generate the correct queries to be used with the query builder. * Works with correlated sub queries to fetched nested result sets. * * Calls itself recursively with the entities that need to be included. * * @param {EntityQueryBuilder} entity * @param {*} builder * @param {{ * shortName?: string, * wherePart?: string, * nestedIndex?: number, * }} options * @returns {import("../types/advanced-types.d.ts").QueryPart>} */ export function generatedQueryBuilderHelper(entity: EntityQueryBuilder, builder: any, { shortName, wherePart, nestedIndex }: { shortName?: string; wherePart?: string; nestedIndex?: number; }): import("../types/advanced-types.d.ts").QueryPart>; export type EntityWhere = { fieldSpecification: Array<{ tableKey: string; keyType: string; matchers: Array<{ matcherKey: string; matcherType: "equal" | "notEqual" | "in" | "notIn" | "greaterThan" | "lowerThan" | "like" | "iLike" | "notLike" | "notILike" | "includeNotNull" | "isNull" | "isNotNull"; relation: { entityName: string; shortName: string; entityKey: string; referencedKey: string; where: () => EntityWhere; }; } | { matcherKey: string; matcherType: "via" | "notExists"; relation: { entityName: string; shortName: string; entityKey: string; referencedKey: string; where: () => EntityWhere; }; }>; }>; }; export type EntityUpdate = { schemaName: string; name: string; shortName: string; columns: Array; where: EntityWhere; injectUpdatedAt: boolean; fields: Record; }>; }; export type EntityQueryBuilder = { name: string; shortName: string; columns: Array; orderBy?: ((orderBy?: Array, orderBySpec?: any, shortName?: string, options?: { skipValidator?: boolean | undefined; }) => import("../types/advanced-types.d.ts").QueryPart) | undefined; orderByExperimental?: ((orderBy?: Array, orderBySpec?: any, options?: { shortName?: string; skipValidator?: boolean | undefined; }) => import("../types/advanced-types.d.ts").QueryPart) | undefined; where: EntityWhere; relations: Array<{ builderKey: string; ownKey: string; referencedKey: string; returnsMany: boolean; entityInformation: () => EntityQueryBuilder; }>; };