import { type CriteriaOptions, criteriaCompileRefusal } from './criteria.ts'; import { strictCriteriaRefusal } from './criteriaDialect.ts'; /** * What a GSF 8.15 dataserver says to a CRITERIA_MATCH before it runs it: the * INVALID_CRITERIA text from its criteria validator (Groovy syntax, the `Expr` * and field-method whitelists, GStrings, ...), then from its `@CompileStatic` * compilation (a call no overload takes, given the fields' `types`), or * undefined when it accepts the criteria. The checks DATA_LOGON makes under * `fidelity: 'gsf'`, for clients that want to test the criteria they build. * @public */ export function criteriaRefusal( criteria: string, options: Pick = {}, ): string | undefined { return ( strictCriteriaRefusal(criteria, undefined, options.types) ?? criteriaCompileRefusal(criteria, options.types) ); }