import { BaserowClient } from "./baserow-client"; import type { Field, FieldCreateRequest, FieldUpdateRequest, RelatedFields, UniqueRowValues, UniqueRowValuesParams, DuplicateFieldJobResponse, DuplicateFieldParams, GenerateAIFieldValuesRequest } from "../types/database"; /** * Operations for managing Baserow database fields. */ export declare class DatabaseFieldOperations { private client; constructor(client: BaserowClient); /** * Retrieves a specific field by its ID. * @param fieldId - The ID of the field to retrieve. * @returns The field object. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/get_database_table_field */ get(fieldId: number): Promise; /** * Lists all fields in a specific table. * @param tableId - The ID of the table to list fields from. * @returns An array of field objects. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/list_database_table_fields */ list(tableId: number): Promise; /** * Creates a new field in a table. * @param tableId - The ID of the table to create the field in. * @param payload - The field creation details. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns The newly created field. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/create_database_table_field */ create(tableId: number, payload: FieldCreateRequest, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; /** * Updates an existing field. * @param fieldId - The ID of the field to update. * @param payload - The field update details. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns The updated field. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/update_database_table_field */ update(fieldId: number, payload: FieldUpdateRequest, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; /** * Deletes a field. * @param fieldId - The ID of the field to delete. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns Related fields that changed as a result of this operation. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/delete_database_table_field */ delete(fieldId: number, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; /** * Retrieves unique row values for a specific field. * @param fieldId - The ID of the field to get unique values from. * @param params - Optional parameters like limit and whether to split comma-separated values. * @returns An object containing an array of unique values. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/get_database_field_unique_row_values */ getUniqueRowValues(fieldId: number, params?: UniqueRowValuesParams): Promise; /** * Starts a job to duplicate a field asynchronously. * @param fieldId - The ID of the field to duplicate. * @param params - Optional parameters for the duplication process. * @returns The job details for tracking the duplication process. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/duplicate_table_field */ duplicateAsync(fieldId: number, params?: DuplicateFieldParams): Promise; /** * Generates AI field values for specified rows using a configured AI field. * This is a premium feature. * @param fieldId - The ID of the AI field to generate values for. * @param payload - The request payload containing row IDs. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns A string response (job ID or confirmation). * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/generate_table_ai_field_value */ generateAIFieldValues(fieldId: number, payload: GenerateAIFieldValuesRequest, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; }