import type { TypesRepository } from "../../../repositories/content/types/TypesRepository.js"; /** One field_value whose `type` is not the type of the field it targets. */ export interface FieldTypeMismatch { /** Path of the value in the call, e.g. `field_values[0]`. */ param: string; field_id: number; field_name?: string; type: string; expected_type: string; } /** * A field_value declares a `type` different from the field's type. * * The platform builds each value with the class of the `type` sent, not of * the field: a string sent to an asset field is stored as that string. The * tool refuses the whole call before writing. */ export declare class FieldTypeMismatchError extends Error { readonly mismatches: FieldTypeMismatch[]; readonly code = "FIELD_TYPE_MISMATCH"; constructor(mismatches: FieldTypeMismatch[]); get details(): Record; } /** * Resolves positional field_ids (1, 2, 3...) to real Modyo field IDs, then * checks each value's `type` against the type of its field. * * LLMs often use sequential positions instead of real IDs (e.g., 33215). * The Modyo API accepts any field_id without error, but positional IDs * cause published entries to have null values in json.fields. * * Resolution logic per field_value: * - If field_id exists in the type's real field IDs → keep as-is * - If field_id matches a field position → map to that field's real ID * - Otherwise → keep as-is (let the API handle validation) * * Type check, after resolution (values inside a group are checked against * the group's `children`): * - a field_id that is not a field of the type is not checked; * - a field whose `type` the content type does not report is not checked; * - any other difference throws FieldTypeMismatchError, so nothing is sent. */ export declare function resolveFieldIds(typesRepo: TypesRepository, spaceId: number, contentTypeId: number, fieldValues: T[], debug?: (msg: string, data?: Record) => void): Promise; //# sourceMappingURL=resolveFieldIds.d.ts.map