/** * Filter utilities * * Helpers for building type-safe filter objects for list operations. * These functions create filter objects that match the API's filter schemas. */ import type { BankAccountFilter, ClientFilter, DocumentFilter, TransactionFilter } from "@artu-ai/shared"; /** * Helper to build a type-safe client filter object. * Provides autocomplete for valid filter properties. * * @param filter - Client filter object * @returns The same filter object (type-safe passthrough) * * @example * ```typescript * const filter = buildClientFilter({ * name: { contains: "García" }, * type: { in: ["individual", "company"] }, * }); * ``` */ export declare function buildClientFilter(filter: ClientFilter): ClientFilter; /** * Helper to build a type-safe transaction filter object. * * @param filter - Transaction filter object * @returns The same filter object (type-safe passthrough) */ export declare function buildTransactionFilter(filter: TransactionFilter): TransactionFilter; /** * Helper to build a type-safe document filter object. * * @param filter - Document filter object * @returns The same filter object (type-safe passthrough) */ export declare function buildDocumentFilter(filter: DocumentFilter): DocumentFilter; /** * Helper to build a type-safe bank account filter object. * * @param filter - Bank account filter object * @returns The same filter object (type-safe passthrough) */ export declare function buildBankAccountFilter(filter: BankAccountFilter): BankAccountFilter; /** * Creates a "contains" filter for a string field. * Matches if the field contains the substring (case-insensitive). * * @param value - Substring to search for * @returns Filter object * * @example * ```typescript * { name: contains("García") } * // Matches: "Juan García", "García López", etc. * ``` */ export declare function contains(value: string): { contains: string; }; /** * Creates a "starts with" filter for a string field. * Matches if the field starts with the prefix (case-insensitive). * * @param value - Prefix to match * @returns Filter object * * @example * ```typescript * { name: startsWith("Juan") } * // Matches: "Juan García", "Juan López", etc. * ``` */ export declare function startsWith(value: string): { startsWith: string; }; /** * Creates an "ends with" filter for a string field. * Matches if the field ends with the suffix (case-insensitive). * * @param value - Suffix to match * @returns Filter object * * @example * ```typescript * { email: endsWith("@company.com") } * ``` */ export declare function endsWith(value: string): { endsWith: string; }; /** * Creates an "equals" filter for exact string matching. * Matches if the field equals the value exactly (case-sensitive). * * @param value - Exact value to match * @returns Filter object * * @example * ```typescript * { rfc: equals("XAXX010101000") } * ``` */ export declare function equals(value: T): { eq: T; }; /** * Creates a "not equals" filter. * Matches if the field does not equal the value. * * @param value - Value to exclude * @returns Filter object * * @example * ```typescript * { status: notEquals("deleted") } * ``` */ export declare function notEquals(value: T): { neq: T; }; /** * Creates an "in" filter for matching one of multiple values. * Matches if the field equals any of the provided values. * * @param values - Values to match against * @returns Filter object * * @example * ```typescript * { type: oneOf("individual", "company") } * // Matches if type is "individual" OR "company" * ``` */ export declare function oneOf(...values: T[]): { in: T[]; }; /** * Creates a "not in" filter for excluding values. * Matches if the field does NOT equal any of the provided values. * * @param values - Values to exclude * @returns Filter object * * @example * ```typescript * { status: notOneOf("deleted", "archived") } * // Matches if status is NOT "deleted" AND NOT "archived" * ``` */ export declare function notOneOf(...values: T[]): { nin: T[]; }; /** * Creates a date range filter (inclusive on both ends). * * @param start - Start of range (optional) * @param end - End of range (optional) * @returns Filter object * * @example * ```typescript * { createdAt: dateRange(new Date("2024-01-01"), new Date("2024-12-31")) } * // Matches dates from Jan 1 to Dec 31, 2024 (inclusive) * ``` */ export declare function dateRange(start?: Date, end?: Date): { gte?: string; lte?: string; }; /** * Creates an "after" date filter (exclusive). * Matches if the field is strictly after the date. * * @param date - Date to compare against * @returns Filter object * * @example * ```typescript * { createdAt: after(new Date("2024-01-01")) } * // Matches dates after Jan 1, 2024 (not including Jan 1) * ``` */ export declare function after(date: Date): { gt: string; }; /** * Creates a "before" date filter (exclusive). * Matches if the field is strictly before the date. * * @param date - Date to compare against * @returns Filter object * * @example * ```typescript * { createdAt: before(new Date("2024-12-31")) } * // Matches dates before Dec 31, 2024 (not including Dec 31) * ``` */ export declare function before(date: Date): { lt: string; }; /** * Creates an "on or after" date filter (inclusive). * * @param date - Date to compare against * @returns Filter object */ export declare function onOrAfter(date: Date): { gte: string; }; /** * Creates an "on or before" date filter (inclusive). * * @param date - Date to compare against * @returns Filter object */ export declare function onOrBefore(date: Date): { lte: string; }; /** * Creates a number range filter (inclusive on both ends). * * @param min - Minimum value (optional) * @param max - Maximum value (optional) * @returns Filter object * * @example * ```typescript * { amount: numberRange(1000, 10000) } * // Matches amounts from 1000 to 10000 (inclusive) * ``` */ export declare function numberRange(min?: number, max?: number): { gte?: number; lte?: number; }; /** * Creates a "greater than" number filter (exclusive). * * @param value - Value to compare against * @returns Filter object * * @example * ```typescript * { amount: greaterThan(1000) } * // Matches amounts > 1000 * ``` */ export declare function greaterThan(value: number): { gt: number; }; /** * Creates a "less than" number filter (exclusive). * * @param value - Value to compare against * @returns Filter object * * @example * ```typescript * { amount: lessThan(10000) } * // Matches amounts < 10000 * ``` */ export declare function lessThan(value: number): { lt: number; }; /** * Creates a "greater than or equal" number filter (inclusive). * * @param value - Value to compare against * @returns Filter object */ export declare function atLeast(value: number): { gte: number; }; /** * Creates a "less than or equal" number filter (inclusive). * * @param value - Value to compare against * @returns Filter object */ export declare function atMost(value: number): { lte: number; }; /** * Creates a filter for true boolean values. * * @returns Filter object * * @example * ```typescript * { isActive: isTrue() } * ``` */ export declare function isTrue(): { eq: boolean; }; /** * Creates a filter for false boolean values. * * @returns Filter object * * @example * ```typescript * { isDeleted: isFalse() } * ``` */ export declare function isFalse(): { eq: boolean; }; /** * Creates a filter for null/undefined values. * * @returns Filter object * * @example * ```typescript * { deletedAt: isNull() } * ``` */ export declare function isNull(): { eq: null; }; /** * Creates a filter for non-null values. * * @returns Filter object * * @example * ```typescript * { rfc: isNotNull() } * ``` */ export declare function isNotNull(): { neq: null; };