/** * Errors thrown by the Lucid Resourceful Library * @module @nhtio/lucid-resourceful/errors */ import { Exception } from '@poppinss/utils'; import type { SyntaxError } from "./bundled_liqe"; import type { ValidationError } from "./joi"; export declare class E_INVALID_RESOURCEFUL_DATA_TYPE_OPTIONS extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(name: string, reason?: ValidationError); } export declare class E_INVALID_RESOURCEFUL_MIXIN_OPTIONS extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(name: string, reason?: ValidationError); } export declare const E_INVALID_PREPARED_VALUE: new (args: [ string, string ], options?: globalThis.ErrorOptions) => Exception; export declare const E_INVALID_CONSUMED_VALUE: new (args: [ string, any, string ], options?: globalThis.ErrorOptions) => Exception; export declare const E_UNCASTABLE: new (args: [ string ], options?: globalThis.ErrorOptions) => Exception; export declare class E_INVALID_RESOURCEFUL_DECORATOR_OPTIONS extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(decoratorName: string, fieldName: string, reason?: ValidationError); } export declare class E_FORBIDDEN extends Exception { static status: number; static code: string; constructor(message: string); } export declare class E_INVALID_LUCENE_QUERY extends Exception { static status: number; static code: string; constructor(message: string); } export declare class E_INVALID_COLUMN_ACCESS extends Exception { static status: number; static code: string; constructor(columnName: string); } export declare class E_UNEXPECTED_COLUMN_IN_QUERY extends Exception { static status: number; static code: string; constructor(columnName: string); } export declare class E_LUCENE_SYNTAX_EXCEPTION extends Exception { static status: number; static code: string; readonly offset: number; readonly line: number; readonly column: number; readonly details: string; constructor(query: string, original: SyntaxError); } export declare class E_LUCENE_UNEXPECTED_EXCEPTION extends Exception { static status: number; static code: string; constructor(original: unknown); } export declare class E_LUCENE_INVALID_TYPE extends Exception { static status: number; static code: string; constructor(type: string); } export declare class E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(reason?: ValidationError); } export declare class E_MISSING_PRIMARY_KEY_EXCEPTION extends Exception { static status: number; static code: string; constructor(type: string); } export declare class E_RECORD_NOT_FOUND_EXCEPTION extends Exception { static status: number; static code: string; constructor(); } export declare class E_RELATIONSHIP_NOT_FOUND_EXCEPTION extends Exception { static status: number; static code: string; constructor(); } export declare class E_UNSYNCABLE_RELATIONSHIP_EXCEPTION extends Exception { static status: number; static code: string; constructor(); } export declare class E_INVALID_PAYLOAD_EXCEPTION extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(reason?: ValidationError); } export declare class E_FORBIDDEN_PAYLOAD_EXCEPTION extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(reason?: ValidationError); } export declare class E_INVALID_RELATIONSHIP_EXCEPTION extends Exception { static status: number; static code: string; constructor(message: string); } export declare class E_INVALID_RESOUREFUL_READ_RELATIONSHIP_REQUEST_EXCEPTION extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(reason: E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION); } export declare class E_LUCENE_REGEX_NOT_SUPPORTED extends Exception { static status: number; static code: string; constructor(); } export declare class E_BULK_UPDATE_SEARCH_UNKNOWN_EXCEPTION extends Exception { static status: number; static code: string; constructor(); } /** * Exception thrown when an invalid field is specified for aggregation operations. * * This error occurs when attempting to perform aggregations on fields that: * - Don't exist in the model * - Are not marked as aggregatable in their column definition * - Are computed accessors or relationships (which cannot be aggregated at the database level) * * @example * ```typescript * // This would throw if 'nonExistentField' doesn't exist or isn't aggregatable * await User.$onResourcefulIndex('*', 1, 10, ['id'], null, ctx, app, [], { * nonExistentField: ['sum', 'avg'] * }) * ``` */ export declare class E_INVALID_AGGREGATION_FIELD extends Exception { static status: number; static code: string; constructor(fieldName: string, modelName: string); } /** * Exception thrown when an invalid aggregation operation is specified for a field. * * This error occurs when attempting to perform aggregation operations that are not * supported by the library or when the operation name is misspelled. Valid operations * include: 'avg', 'min', 'max', 'sum', 'countDistinct', 'sumDistinct', 'avgDistinct'. * * @example * ```typescript * // This would throw if 'invalidOperation' is not a valid aggregation method * await User.$onResourcefulIndex('*', 1, 10, ['id'], null, ctx, app, [], { * totalSales: ['invalidOperation'] * }) * ``` */ export declare class E_INVALID_AGGREGATION_OPERATION extends Exception { static status: number; static code: string; constructor(operationName: string, fieldName: string, modelName: string); } export declare class E_INVALID_RESOURCEFUL_ROUTER_OPTIONS extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(reason?: ValidationError); } export declare class E_UNRESOLVABLE_MODEL extends Exception { static status: number; static code: string; constructor(path: string, reason?: unknown); } export declare class E_INVALID_RESOURCEFUL_MODELS_MAP extends Exception { static status: number; static code: string; readonly details?: ValidationError['details']; constructor(reason?: ValidationError); } export declare class E_INVALID_RESOURCEFUL_MODELS_MAP_AGGREGATE extends Exception { static status: number; static code: string; readonly causes: (E_UNRESOLVABLE_MODEL | E_INVALID_RESOURCEFUL_MODELS_MAP)[]; constructor(causes: (E_UNRESOLVABLE_MODEL | E_INVALID_RESOURCEFUL_MODELS_MAP)[]); } export declare class E_RESOURCEFUL_ROUTER_MISCONFIGURED extends Exception { static status: number; static code: string; constructor(reason?: unknown); } export declare const E_ROUTE_NOT_FOUND: new (args: [ method: string, url: string ], options?: globalThis.ErrorOptions) => Exception; export declare class E_NOT_IN_MODEL_CONTEXT extends Exception { static status: number; static code: string; constructor(reason?: unknown); } export declare const E_INVALID_HTTP_METHOD_EXCEPTION: new (args: [ method: string, path: string ], options?: globalThis.ErrorOptions) => Exception; export { UNIQUE_CONSTRAINT_VIOLATION, FOREIGN_KEY_VIOLATION, NOT_NULL_VIOLATION, CHECK_CONSTRAINT_VIOLATION, DATA_VALIDATION_ERROR, INVALID_DATA_TYPE, DEADLOCK, LOCK_TIMEOUT, SCHEMA_ERROR, DATABASE_CONNECTION_ERROR, PERMISSION_DENIED, SERIALIZATION_FAILURE, QUERY_SYNTAX_ERROR, DIVISION_BY_ZERO, } from "./private/router_macro/utils/errors"; export declare class E_NOT_IN_ODATA_CONTEXT extends Exception { static status: number; static code: string; constructor(reason?: unknown); } export declare class E_UNACCEPTABLE_FORMAT extends Exception { static status: number; static code: string; constructor(fmt: string, reason?: unknown); } export declare class E_INVALID_ENTITYSET_IDENTIFIERS extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; readonly help: string; constructor(causes: Set); } export declare class E_EXPAND_NOT_IMPLEMENTED extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(modelName: string, causes: Array); } export declare class E_ODATA_FILTER_UNEXPECTED_CHARACTER extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(char: string, position: number); } export declare class E_ODATA_FILTER_UNEXPECTED_TYPE extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(type: string, token: any, value?: string); } export declare class E_ODATA_FILTER_UNEXPECTED_END_OF_INPUT extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(); } export declare class E_ODATA_UNKNOWN_PARAMETER_ALIAS extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(alias: string); } export declare class E_ODATA_FILTER_UNEXPECTED_TOKEN extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(token: any); } export declare class E_ODATA_FILTER_INAPPLICABLE_NODE_TYPE extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(node: any); } export declare class E_ODATA_FILTER_UNKNOWN_LOGICAL_OPERATOR extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(node: any); } export declare class E_ODATA_FILTER_UNKNOWN_COMPARISON_OPERATOR extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(node: any); } export declare class E_ODATA_FILTER_INVALID_COMPARISON_SIDE extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(); } export declare class E_ODATA_FILTER_UNEVALUATABLE_NODE_TYPE extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(node: any); } export declare class E_ODATA_FILTER_UNSUPPORTED_FUNCTION_COMPARISON extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(funcName: string); } export declare class E_ODATA_FILTER_EXPECTED_COLUMN_REFERENCE extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(); } export declare class E_UNSUPPORTED_DATABASE_DIALECT extends Exception { static status: number; static code: string; readonly details: ValidationError['details']; constructor(dialect: string); } export declare const E_ENCODED_BODY_PARSING_FAILED: new (args?: any, options?: globalThis.ErrorOptions) => Exception; export declare const E_MISSING_CURRENT_INSTANCE_ID: new (args?: any, options?: globalThis.ErrorOptions) => Exception;