UNPKG

@proofkit/fmodata

Version:

FileMaker OData API client

59 lines (58 loc) 2.27 kB
import { InternalLogger } from '../../logger.js'; import { FMTable } from '../../orm/table.js'; import { Result } from '../../types.js'; import { ExpandValidationConfig } from '../../validation.js'; import { ExpandConfig } from './shared-types.js'; export interface ProcessResponseConfig { table?: FMTable<any, any>; schema?: Record<string, any>; singleMode: "exact" | "maybe" | false; selectedFields?: string[]; expandValidationConfigs?: ExpandValidationConfig[]; skipValidation?: boolean; useEntityIds?: boolean; includeSpecialColumns?: boolean; fieldMapping?: Record<string, string>; } /** * Processes OData response with transformation and validation. * Shared by QueryBuilder and RecordBuilder. */ export declare function processODataResponse<T>(rawResponse: any, config: ProcessResponseConfig): Promise<Result<T>>; /** * Gets schema from a table occurrence, excluding container fields. * Container fields are never returned in regular responses (only via getSingleField). */ export declare function getSchemaFromTable(table: FMTable<any, any> | undefined): Record<string, any> | undefined; /** * Processes query response with expand configs. * This is a convenience wrapper that builds validation configs from expand configs. */ export declare function processQueryResponse<T>(response: any, config: { occurrence?: FMTable<any, any>; singleMode: "exact" | "maybe" | false; queryOptions: { select?: (keyof T)[] | string[]; }; expandConfigs: ExpandConfig[]; skipValidation?: boolean; useEntityIds?: boolean; includeSpecialColumns?: boolean; includeCount?: boolean; fieldMapping?: Record<string, string>; logger: InternalLogger; }): Promise<Result<any>>; /** * Processes record response by delegating to the canonical query processor. * Record reads are query reads with singleMode fixed to "exact". */ export declare function processRecordResponse<T>(response: any, config: { table?: FMTable<any, any>; selectedFields?: string[]; expandConfigs: ExpandConfig[]; skipValidation?: boolean; useEntityIds?: boolean; includeSpecialColumns?: boolean; fieldMapping?: Record<string, string>; logger: InternalLogger; }): Promise<Result<T>>;