import type { BaserowRow, ListRowsParams, ListRowsResponse, CreateRowParams, UpdateRowParams, DeleteRowParams, MoveRowParams, BatchCreateRowsPayload, BatchUpdateRowsPayload, GetAdjacentRowParams, ListRowHistoryParams, ListRowHistoryResponse, ListRowNamesParams, ListRowNamesResponse, ListRowCommentsParams, ListRowCommentsResponse, CreateRowCommentPayload, UpdateRowCommentPayload, RowComment, UpdateRowCommentNotificationModePayload } from "../types/database"; import type { BaserowClient } from "./baserow-client"; export declare class DatabaseRowOperations { private client; constructor(client: BaserowClient); /** * Lists rows in a table, with support for pagination, filtering, sorting, and searching. * @param tableId - The ID of the table to list rows from. * @param params - Optional query parameters for pagination, filtering, sorting, etc. * @returns A paginated list of rows. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/list_database_table_rows */ list(tableId: number, params?: ListRowsParams): Promise>; /** * Fetches a single row from a table. * @param tableId - The ID of the table. * @param rowId - The ID of the row to fetch. * @param params - Optional parameters like 'include' or 'user_field_names'. * @returns The requested row. * @throws {BaserowApiError} If the request fails or the row/table doesn't exist. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/get_database_table_row */ get(tableId: number, rowId: number, params?: { include?: "metadata"; userFieldNames?: boolean; }): Promise; /** * Creates a new row in a table. * @param tableId - The ID of the table to create the row in. * @param rowData - An object representing the row data. Keys should be `field_{id}` or field names if user_field_names is true. * @param params - Optional query parameters like 'before', 'send_webhook_events', 'user_field_names'. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns The newly created row. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/create_database_table_row */ create, TResponse extends BaserowRow = BaserowRow>(tableId: number, rowData: TRequest, params?: CreateRowParams, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; /** * Updates an existing row in a table. * @param tableId - The ID of the table containing the row. * @param rowId - The ID of the row to update. * @param rowData - An object containing the fields to update. Keys should be `field_{id}` or field names if user_field_names is true. * @param params - Optional query parameters like 'send_webhook_events', 'user_field_names'. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns The updated row. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/update_database_table_row */ update, TResponse extends BaserowRow = BaserowRow>(tableId: number, rowId: number, rowData: Partial, // Use Partial as we only send fields to update params?: UpdateRowParams, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; /** * Deletes a row from a table. * @param tableId - The ID of the table containing the row. * @param rowId - The ID of the row to delete. * @param params - Optional query parameters like 'send_webhook_events'. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/delete_database_table_row */ delete(tableId: number, rowId: number, params?: DeleteRowParams, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; /** * Moves a row within a table. * @param tableId - The ID of the table containing the row. * @param rowId - The ID of the row to move. * @param params - Query parameters specifying where to move the row ('before_id') and optionally 'user_field_names'. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns The moved row with its potentially updated order. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/move_database_table_row */ move(tableId: number, rowId: number, params?: MoveRowParams, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; /** * Creates multiple rows in a table in a single batch request. * @param tableId - The ID of the table to create rows in. * @param payload - An object containing an `items` array of row data objects. * @param params - Optional query parameters like 'before', 'send_webhook_events', 'user_field_names'. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns An object containing an `items` array with the newly created rows. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/batch_create_database_table_rows */ batchCreate, TResponse extends BaserowRow = BaserowRow>(tableId: number, payload: BatchCreateRowsPayload, params?: Omit & { before?: number | null; }, // before can be null for batch options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise<{ items: TResponse[]; }>; /** * Updates multiple rows in a table in a single batch request. * @param tableId - The ID of the table containing the rows. * @param payload - An object containing an `items` array of row objects, each including its `id` and the fields to update. * @param params - Optional query parameters like 'send_webhook_events', 'user_field_names'. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @returns An object containing an `items` array with the updated rows. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/batch_update_database_table_rows */ batchUpdate, TResponse extends BaserowRow = BaserowRow>(tableId: number, payload: BatchUpdateRowsPayload & { id: number; }>, // Only need id and fields to update params?: UpdateRowParams, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise<{ items: TResponse[]; }>; /** * Deletes multiple rows from a table in a single batch request. * @param tableId - The ID of the table containing the rows. * @param rowIds - An array of row IDs to delete. * @param params - Optional query parameters like 'send_webhook_events'. * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/batch_delete_database_table_rows */ batchDelete(tableId: number, rowIds: number[], params?: DeleteRowParams, options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string; }): Promise; /** * Fetches the adjacent row (previous or next) to a given row within a table, optionally applying view filters/sorts. * @param tableId - The ID of the table. * @param rowId - The ID of the reference row. * @param params - Optional parameters: 'previous' flag, 'view_id', 'search', 'user_field_names'. * @returns The adjacent row or null if no adjacent row exists matching the criteria. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/get_adjacent_database_table_row */ getAdjacent(tableId: number, rowId: number, params?: GetAdjacentRowParams): Promise; /** * Fetches the change history for a specific row. * @param tableId - The ID of the table. * @param rowId - The ID of the row. * @param params - Optional pagination parameters ('limit', 'offset'). * @returns A paginated list of row history entries. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/get_database_table_row_history */ getHistory(tableId: number, rowId: number, params?: ListRowHistoryParams): Promise; /** * Fetches the primary field values (names) for specific rows across one or more tables. * @param params - An object where keys are `table__` and values are comma-separated row IDs. * @returns An object mapping table IDs to row IDs to row names. * @throws {BaserowApiError} If the request fails. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/list_database_table_row_names */ listNames(params: ListRowNamesParams): Promise; /** * Lists comments for a specific row. (Premium feature) * @param tableId - The ID of the table. * @param rowId - The ID of the row. * @param params - Optional pagination parameters. * @returns A paginated list of row comments. * @throws {BaserowApiError} If the request fails or feature is unavailable. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/get_row_comments */ listComments(tableId: number, rowId: number, params?: ListRowCommentsParams): Promise; /** * Creates a comment on a specific row. (Premium feature) * @param tableId - The ID of the table. * @param rowId - The ID of the row to comment on. * @param payload - The comment content. * @returns The newly created comment. * @throws {BaserowApiError} If the request fails or feature is unavailable. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/create_row_comment */ createComment(tableId: number, rowId: number, payload: CreateRowCommentPayload): Promise; /** * Updates an existing row comment. Only the author can update their comment. (Premium feature) * @param tableId - The ID of the table containing the comment's row. * @param commentId - The ID of the comment to update. * @param payload - The updated comment content. * @returns The updated comment. * @throws {BaserowApiError} If the request fails, feature is unavailable, or user is not the author. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/update_row_comment */ updateComment(tableId: number, commentId: number, payload: UpdateRowCommentPayload): Promise; /** * Deletes a row comment. Only the author can delete their comment. (Premium feature) * @param tableId - The ID of the table containing the comment's row. * @param commentId - The ID of the comment to delete. * @returns The deleted comment object (based on spec, confirm if it actually returns content or just 204). * @throws {BaserowApiError} If the request fails, feature is unavailable, or user is not the author. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/delete_row_comment */ deleteComment(tableId: number, commentId: number): Promise; /** * Updates the user's notification preferences for comments on a specific row. (Premium feature) * @param tableId - The ID of the table. * @param rowId - The ID of the row. * @param payload - The desired notification mode ('all' or 'mentions'). * @throws {BaserowApiError} If the request fails or feature is unavailable. * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/update_row_comment_notification_mode */ updateCommentNotificationMode(tableId: number, rowId: number, payload: UpdateRowCommentNotificationModePayload): Promise; }