{
  "version": 3,
  "sources": ["../../src/types/error.ts", "../../src/client/health-operations.ts", "../../src/client/admin-operations.ts", "../../src/client/workspace-operations.ts", "../../src/client/application-operations.ts", "../../src/client/integration-operations.ts", "../../src/client/user-source-operations.ts", "../../src/client/builder-operations.ts", "../../src/client/dashboard-operations.ts", "../../src/client/database-table-operations.ts", "../../src/client/database-field-operations.ts", "../../src/client/database-view-operations.ts", "../../src/client/database-row-operations.ts", "../../src/client/database-webhook-operations.ts", "../../src/client/database-token-operations.ts", "../../src/client/user-file-operations.ts", "../../src/client/secure-file-operations.ts", "../../src/client/job-operations.ts", "../../src/client/license-operations.ts", "../../src/client/notification-operations.ts", "../../src/client/role-assignment-operations.ts", "../../src/client/team-operations.ts", "../../src/client/template-operations.ts", "../../src/client/trash-operations.ts", "../../src/client/user-operations.ts", "../../src/client/sso-operations.ts", "../../src/client/baserow-client.ts", "../../src/cli/commands/generate-types.ts", "../../src/cli/utils/config.ts", "../../src/cli/config/manager.ts", "../../src/cli/commands/config.ts", "../../node_modules/jwt-decode/build/esm/index.js", "../../src/cli/utils/client.ts", "../../src/cli/commands/login.ts", "../../src/cli/commands/logout.ts", "../../src/cli/commands/rows.ts", "../../src/cli/commands/tables.ts"],
  "sourcesContent": [
    "/**\n * Custom error class for Baserow API errors\n */\nexport class BaserowApiError extends Error {\n  /**\n   * HTTP status code\n   */\n  public readonly status: number;\n  \n  /**\n   * Error code from Baserow\n   */\n  public readonly code?: string;\n  \n  /**\n   * Detailed error information\n   */\n  public readonly detail?: string;\n  \n  constructor(message: string, status: number, code?: string, detail?: string) {\n    super(message);\n    this.name = 'BaserowApiError';\n    this.status = status;\n    this.code = code;\n    this.detail = detail;\n    \n    // Ensure instanceof works correctly in TypeScript\n    Object.setPrototypeOf(this, BaserowApiError.prototype);\n  }\n} ",
    "import { BaserowClient } from \"./baserow-client\";\nimport type { EmailTesterRequest, EmailTesterResponse, FullHealthCheck } from \"../types/health\";\n\n/**\n * Operations for checking Baserow server health.\n */\nexport class HealthOperations {\n  constructor(private client: BaserowClient) {}\n  \n  /**\n   * Get full health check for the Baserow instance\n   */\n  async getFullHealthCheck(): Promise<FullHealthCheck> {\n    return this.client._request<FullHealthCheck>('GET', '/api/_health/full/');\n  }\n  \n  /**\n   * Test email configuration\n   */\n  async testEmail(request: EmailTesterRequest): Promise<EmailTesterResponse> {\n    return this.client._request<EmailTesterResponse>(\n      'POST',\n      '/api/_health/email/',\n      request\n    );\n  }\n  \n  /**\n   * Check celery queue size\n   */\n  async checkCeleryQueueSize(queues: string[] = ['celery', 'export']): Promise<void> {\n    const queryParams = queues.map(queue => `queue=${queue}`).join('&');\n    return this.client._request<void>(\n      'GET',\n      `/api/_health/celery-queue/?${queryParams}`\n    );\n  }\n  \n  /**\n   * @deprecated Use getFullHealthCheck instead.\n   * This method is kept for backward compatibility.\n   */\n  async getHealthCheck(): Promise<FullHealthCheck> {\n    return this.getFullHealthCheck();\n  }\n  \n  /**\n   * @deprecated This endpoint doesn't exist in the OpenAPI specification.\n   */\n  async checkMigrations(): Promise<{ migration_migrations_applied: boolean }> {\n    console.warn('checkMigrations is deprecated as this endpoint is not in the OpenAPI spec');\n    return this.client._request<{ migration_migrations_applied: boolean }>(\n      'GET',\n      '/api/_health/migration-check/'\n    );\n  }\n} ",
    "import { BaserowClient } from \"./baserow-client\";\nimport type {\n    AuditLogActionType,\n    SingleAuditLogExportJobRequest,\n    SingleAuditLogExportJobResponse,\n    PatchedUserAdminUpdate,\n    UserAdminResponse,\n    BaserowImpersonateAuthTokenPayload,\n    ImpersonateResponse,\n    PaginationSerializerWorkspacesAdminResponse,\n    ListAdminWorkspacesParams,\n    ListAuditLogActionTypesParams,\n    ListAuditLogParams,\n    ListAuditLogUsersParams,\n    ListAuditLogWorkspacesParams,\n    PaginationSerializerAuditLog,\n    PaginationSerializerAuditLogUser,\n    PaginationSerializerAuditLogWorkspace,\n    BaseAuthProviderPayload,\n    AdminDashboard,\n    ListAdminUsersParams,\n    PaginationSerializerUserAdminResponse,\n    UserAdminCreate,\n    WorkspacesAdminResponse,\n} from '../types/admin'\n    \n/**\n * Operations for Baserow administration.\n */\nexport class AdminOperations {\n    constructor(private client: BaserowClient) {}\n\n    // --- Audit Log ---\n\n    /**\n     * Lists audit log entries. (Enterprise feature)\n     * @param params - Optional parameters for filtering, sorting, and pagination.\n     * @returns Paginated list of audit log entries.\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/audit_log_list\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/audit_log_list_2\n     */\n    async listAuditLog(params?: ListAuditLogParams): Promise<PaginationSerializerAuditLog> {\n        const queryParams = params ? { ...params } : undefined;\n        // Using the non-admin path as default\n        return this.client._request<PaginationSerializerAuditLog>(\n            'GET', // Added Method\n            '/api/audit-log/',\n            queryParams\n        );\n    }\n\n    /**\n     * Lists distinct action types found in the audit log. (Enterprise feature)\n     * @param params - Optional parameters for searching and filtering by workspace.\n     * @returns Array of distinct audit log action types.\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/audit_log_action_types\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/audit_log_action_types_2\n     */\n    async listAuditLogActionTypes(params?: ListAuditLogActionTypesParams): Promise<AuditLogActionType[]> {\n        const queryParams = params ? { ...params } : undefined;\n         // Using the non-admin path as default\n        return this.client._request<AuditLogActionType[]>(\n            'GET', // Added Method\n            '/api/audit-log/action-types/',\n            queryParams\n        );\n    }\n\n    /**\n     * Starts an asynchronous job to export audit log entries to a CSV file. (Enterprise feature)\n     * @param payload - Export options and filters.\n     * @param options - Optional request parameters like ClientSessionId.\n     * @returns Details of the created export job.\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/async_audit_log_export\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/async_audit_log_export_2\n     */\n    async exportAuditLog(payload: SingleAuditLogExportJobRequest, options?: { clientSessionId?: string }): Promise<SingleAuditLogExportJobResponse> {\n        const headers: Record<string, string> | undefined = options?.clientSessionId\n            ? { 'ClientSessionId': options.clientSessionId }\n            : undefined;\n         // Using the non-admin path as default\n        return this.client._request<SingleAuditLogExportJobResponse>(\n            'POST', // Added Method\n            '/api/audit-log/export/',\n            undefined,\n            payload,\n            headers\n        );\n    }\n\n    /**\n     * Lists users who have entries in the audit log. (Enterprise feature)\n     * @param params - Optional parameters for searching, pagination, and filtering by workspace.\n     * @returns Paginated list of users from the audit log.\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/audit_log_users\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/audit_log_users_2\n     */\n    async listAuditLogUsers(params?: ListAuditLogUsersParams): Promise<PaginationSerializerAuditLogUser> {\n        const queryParams = params ? { ...params } : undefined;\n         // Using the non-admin path as default\n        return this.client._request<PaginationSerializerAuditLogUser>(\n            'GET', // Added Method\n            '/api/audit-log/users/',\n            queryParams\n        );\n    }\n\n    /**\n     * Lists distinct workspaces found in the audit log. (Enterprise feature)\n     * @param params - Optional parameters for searching and pagination.\n     * @returns Paginated list of workspaces from the audit log.\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/audit_log_workspaces\n     * @see https://api.baserow.io/api/redoc/#tag/Audit-log/operation/audit_log_workspaces_2\n     */\n    async listAuditLogWorkspaces(params?: ListAuditLogWorkspacesParams): Promise<PaginationSerializerAuditLogWorkspace> {\n        const queryParams = params ? { ...params } : undefined;\n         // Using the non-admin path as default\n        return this.client._request<PaginationSerializerAuditLogWorkspace>(\n            'GET', // Added Method\n            '/api/audit-log/workspaces/',\n            queryParams\n        );\n    }\n\n    // --- Auth Providers ---\n\n    /**\n     * Lists all available authentication providers configured in the admin panel.\n     * @returns An array of authentication provider configurations.\n     * @see https://api.baserow.io/api/redoc/#tag/Auth/operation/list_auth_providers\n     */\n    async listAuthProviders(): Promise<any[]> { // Replace 'any' with specific Authentication_ProviderAuthProvider if fully defined\n        return this.client._request<any[]>(\n            'GET', // Added Method\n            '/api/admin/auth-provider/'\n        );\n    }\n\n    /**\n     * Creates a new authentication provider. Requires staff/admin privileges.\n     * @param payload - The configuration for the new auth provider.\n     * @returns The created authentication provider configuration.\n     * @see https://api.baserow.io/api/redoc/#tag/Auth/operation/create_auth_provider\n     */\n    async createAuthProvider(payload: BaseAuthProviderPayload): Promise<any> { // Replace 'any' with specific Authentication_ProviderAuthProvider\n        return this.client._request<any>(\n            'POST', // Added Method\n            '/api/admin/auth-provider/',\n            undefined,\n            payload\n        );\n    }\n\n    /**\n     * Retrieves a specific authentication provider by its ID.\n     * @param authProviderId - The ID of the authentication provider.\n     * @returns The authentication provider configuration.\n     * @see https://api.baserow.io/api/redoc/#tag/Auth/operation/get_auth_provider\n     */\n    async getAuthProvider(authProviderId: number): Promise<any> { // Replace 'any' with specific Authentication_ProviderAuthProvider\n        return this.client._request<any>(\n            'GET', // Added Method\n            `/api/admin/auth-provider/${authProviderId}/`\n        );\n    }\n\n    /**\n     * Updates an existing authentication provider. Requires staff/admin privileges.\n     * @param authProviderId - The ID of the provider to update.\n     * @param payload - The partial configuration updates.\n     * @returns The updated authentication provider configuration.\n     * @see https://api.baserow.io/api/redoc/#tag/Auth/operation/update_auth_provider\n     */\n    async updateAuthProvider(authProviderId: number, payload: Partial<BaseAuthProviderPayload>): Promise<any> { // Replace 'any' with specific Authentication_ProviderAuthProvider\n        return this.client._request<any>(\n            'PATCH', // Added Method\n            `/api/admin/auth-provider/${authProviderId}/`,\n            undefined,\n            payload\n        );\n    }\n\n     /**\n      * Deletes an authentication provider. Requires staff/admin privileges.\n      * @param authProviderId - The ID of the provider to delete.\n      * @see https://api.baserow.io/api/redoc/#tag/Auth/operation/delete_auth_provider\n      */\n     async deleteAuthProvider(authProviderId: number): Promise<void> {\n        await this.client._request<void>(\n            'DELETE', // Added Method\n            `/api/admin/auth-provider/${authProviderId}/`\n        );\n     }\n\n    // --- Dashboard ---\n\n    /**\n     * Gets statistics for the admin dashboard. Requires staff/admin privileges.\n     * @returns Dashboard statistics object.\n     * @see https://api.baserow.io/api/redoc/#tag/Admin/operation/admin_dashboard\n     */\n    async getDashboardStats(): Promise<AdminDashboard> {\n        return this.client._request<AdminDashboard>(\n            'GET', // Added Method\n            '/api/admin/dashboard/'\n        );\n    }\n\n    // --- Users ---\n\n    /**\n     * Lists all users in the Baserow instance. Requires staff/admin privileges.\n     * @param params - Optional parameters for pagination, searching, and sorting.\n     * @returns Paginated list of admin user representations.\n     * @see https://api.baserow.io/api/redoc/#tag/Admin/operation/admin_list_users\n     */\n    async listUsers(params?: ListAdminUsersParams): Promise<PaginationSerializerUserAdminResponse> {\n        const queryParams = params ? { ...params } : undefined;\n        return this.client._request<PaginationSerializerUserAdminResponse>(\n            'GET', // Added Method\n            '/api/admin/users/',\n            queryParams\n        );\n    }\n\n    /**\n     * Creates a new user. Requires staff/admin privileges.\n     * @param payload - User details (name, email, password, active/staff status).\n     * @returns The created user details.\n     * @see https://api.baserow.io/api/redoc/#tag/Admin/operation/admin_create_user\n     */\n    async createUser(payload: UserAdminCreate): Promise<UserAdminResponse> {\n        return this.client._request<UserAdminResponse>(\n            'POST', // Added Method\n            '/api/admin/users/',\n            undefined,\n            payload\n        );\n    }\n\n    /**\n     * Updates an existing user. Requires staff/admin privileges.\n     * @param userId - The ID of the user to update.\n     * @param payload - The user attributes to update.\n     * @returns The updated user details.\n     * @see https://api.baserow.io/api/redoc/#tag/Admin/operation/admin_edit_user\n     */\n    async updateUser(userId: number, payload: PatchedUserAdminUpdate): Promise<UserAdminResponse> {\n        return this.client._request<UserAdminResponse>(\n            'PATCH', // Added Method\n            `/api/admin/users/${userId}/`,\n            undefined,\n            payload\n        );\n    }\n\n    /**\n     * Deletes a user. Requires staff/admin privileges. Cannot delete self.\n     * @param userId - The ID of the user to delete.\n     * @returns void - Returns 200 OK on success (spec says 200, not 204).\n     * @see https://api.baserow.io/api/redoc/#tag/Admin/operation/admin_delete_user\n     */\n    async deleteUser(userId: number): Promise<void> {\n        // Spec indicates 200 OK response, adjust _request if it strictly expects 204 for deletes\n        await this.client._request<void>(\n            'DELETE', // Added Method\n            `/api/admin/users/${userId}/`\n        );\n    }\n\n    /**\n     * Allows a staff user to impersonate another non-staff/non-superuser.\n     * @param payload - Object containing the user ID to impersonate.\n     * @returns Authentication tokens and user details for the impersonated session.\n     * @see https://api.baserow.io/api/redoc/#tag/Admin/operation/admin_impersonate_user\n     */\n    async impersonateUser(payload: BaserowImpersonateAuthTokenPayload): Promise<ImpersonateResponse> {\n        return this.client._request<ImpersonateResponse>(\n            'POST', // Added Method\n            '/api/admin/users/impersonate/',\n            undefined,\n            payload\n        );\n    }\n\n    // --- Workspaces (Admin-specific) ---\n\n    /**\n     * Lists all workspaces in the instance. Requires staff/admin privileges.\n     * @param params - Optional parameters for pagination, searching, and sorting.\n     * @returns Paginated list of admin workspace representations.\n     * @see https://api.baserow.io/api/redoc/#tag/Admin/operation/admin_list_workspaces\n     */\n    async listWorkspaces(params?: ListAdminWorkspacesParams): Promise<PaginationSerializerWorkspacesAdminResponse> {\n        const queryParams = params ? { ...params } : undefined;\n        return this.client._request<PaginationSerializerWorkspacesAdminResponse>(\n            'GET', // Added Method\n            '/api/admin/workspaces/',\n            queryParams\n        );\n    }\n\n     /**\n      * Deletes a workspace as an admin. Requires staff/admin privileges.\n      * @param workspaceId - The ID of the workspace to delete.\n      * @see https://api.baserow.io/api/redoc/#tag/Admin/operation/admin_delete_workspace\n      */\n     async deleteWorkspace(workspaceId: number): Promise<void> {\n        await this.client._request<void>(\n            'DELETE', // Added Method\n            `/api/admin/workspaces/${workspaceId}/`\n        );\n     }\n}\n",
    "import type { \n  Workspace, \n  WorkspaceUserWorkspace, \n  WorkspaceUser,\n  CreateWorkspacePayload,\n  UpdateWorkspacePayload,\n  OrderWorkspacesPayload,\n  ListWorkspaceUsersParams,\n  UpdateWorkspaceUserPayload,\n  WorkspaceInvitation,\n  CreateWorkspaceInvitationPayload,\n  UpdateWorkspaceInvitationPayload,\n  GenerativeAISettings,\n  ListExportWorkspaceApplicationsResponse,\n  ExportApplicationsJobTypeResponse,\n  ImportResource,\n  ImportWorkspaceApplicationsPayload,\n  ImportApplicationsJobTypeResponse,\n  PermissionObject\n} from \"../types/workspace\";\n\nimport type { BaserowClient } from \"./baserow-client\";\n\nexport class WorkspaceOperations {\n  constructor(private client: BaserowClient) {}\n\n  /**\n   * Lists all the workspaces of the authorized user.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/list_workspaces\n   */\n  async list(): Promise<WorkspaceUserWorkspace[]> {\n    // No headers needed for list, original code is fine\n    return this.client._request<WorkspaceUserWorkspace[]>(\n      \"GET\",\n      \"/api/workspaces/\"\n    );\n  }\n\n  /**\n   * Creates a new workspace.\n   * @param data - The data for the new workspace.\n   * @param options - Optional request parameters like ClientSessionId.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/create_workspace\n   */\n  async create(\n    data: CreateWorkspacePayload,\n    options?: { clientSessionId?: string }\n  ): Promise<WorkspaceUserWorkspace> {\n    // Corrected header handling\n    const headers: Record<string, string> | undefined = options?.clientSessionId\n      ? { ClientSessionId: options.clientSessionId }\n      : undefined;\n    return this.client._request<WorkspaceUserWorkspace>(\n      \"POST\",\n      \"/api/workspaces/\",\n      undefined,\n      data,\n      headers\n    );\n  }\n\n  /**\n   * Updates an existing workspace.\n   * @param workspaceId - The ID of the workspace to update.\n   * @param data - The data to update the workspace with.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/update_workspace\n   */\n  async update(\n    workspaceId: number,\n    data: UpdateWorkspacePayload,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<Workspace> {\n    // Corrected header handling\n    const headers: Record<string, string> | undefined = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    // Pass undefined if no headers were added\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n    return this.client._request<Workspace>(\n      \"PATCH\",\n      `/api/workspaces/${workspaceId}/`,\n      undefined,\n      data,\n      finalHeaders\n    );\n  }\n\n  /**\n   * Deletes a workspace.\n   * @param workspaceId - The ID of the workspace to delete.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/delete_workspace\n   */\n  async delete(\n    workspaceId: number,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<void> {\n    // Corrected header handling\n    const headers: Record<string, string> | undefined = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n    await this.client._request<void>(\n      \"DELETE\",\n      `/api/workspaces/${workspaceId}/`,\n      undefined,\n      undefined,\n      finalHeaders\n    );\n  }\n\n  /**\n   * Changes the order of workspaces for the user.\n   * @param workspaceIds - An array of workspace IDs in the desired order.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/order_workspaces\n   */\n  async order(\n    workspaceIds: number[],\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<void> {\n    // Corrected header handling\n    const headers: Record<string, string> | undefined = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n    const payload: OrderWorkspacesPayload = { workspaces: workspaceIds };\n    await this.client._request<void>(\n      \"POST\",\n      \"/api/workspaces/order/\",\n      undefined,\n      payload,\n      finalHeaders\n    );\n  }\n\n  /**\n   * Leaves a workspace.\n   * @param workspaceId - The ID of the workspace to leave.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/leave_workspace\n   */\n  async leave(workspaceId: number): Promise<void> {\n    // No headers needed for leave, original code is fine\n    await this.client._request<void>(\n      \"POST\",\n      `/api/workspaces/${workspaceId}/leave/`\n    );\n  }\n\n  /**\n   * Lists all users within a specific workspace. Requires admin permissions.\n   * @param workspaceId - The ID of the workspace.\n   * @param params - Optional search and sort parameters.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/list_workspace_users\n   */\n  async listUsers(\n    workspaceId: number,\n    params?: ListWorkspaceUsersParams\n  ): Promise<WorkspaceUser[]> {\n    // Use spread operator to create a new object literal if params exist\n    const queryParams = params ? { ...params } : undefined;\n    return this.client._request<WorkspaceUser[]>(\n      \"GET\",\n      `/api/workspaces/users/workspace/${workspaceId}/`,\n      queryParams // Pass the potentially new object or undefined\n    );\n  }\n\n  /**\n   * Updates a user's permissions within a workspace. Requires admin permissions.\n   * @param workspaceUserId - The ID of the workspace-user relation (not the user ID itself).\n   * @param payload - The permissions to update.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/update_workspace_user\n   */\n  async updateUserPermissions(\n    workspaceUserId: number,\n    payload: UpdateWorkspaceUserPayload\n  ): Promise<WorkspaceUser> {\n    // Note: ClientSessionId/UndoRedo headers are not listed in the spec for this endpoint\n    return this.client._request<WorkspaceUser>(\n      \"PATCH\",\n      `/api/workspaces/users/${workspaceUserId}/`,\n      undefined,\n      payload\n    );\n  }\n\n  /**\n   * Removes a user from a workspace. Requires admin permissions.\n   * @param workspaceUserId - The ID of the workspace-user relation to delete.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/delete_workspace_user\n   */\n  async deleteUser(workspaceUserId: number): Promise<void> {\n    // Note: ClientSessionId/UndoRedo headers are not listed in the spec for this endpoint\n    await this.client._request<void>(\n      \"DELETE\",\n      `/api/workspaces/users/${workspaceUserId}/`\n    );\n  }\n\n  /**\n   * Lists pending invitations for a workspace. Requires admin permissions.\n   * @param workspaceId - The ID of the workspace.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspace-invitations/operation/list_workspace_invitations\n   */\n  async listInvitations(workspaceId: number): Promise<WorkspaceInvitation[]> {\n    return this.client._request<WorkspaceInvitation[]>(\n      \"GET\",\n      `/api/workspaces/invitations/workspace/${workspaceId}/`\n    );\n  }\n\n  /**\n   * Creates a new invitation for a user to join a workspace. Requires admin permissions.\n   * @param workspaceId - The ID of the workspace to invite the user to.\n   * @param payload - Details of the invitation (email, permissions, etc.).\n   * @see https://api.baserow.io/api/redoc/#tag/Workspace-invitations/operation/create_workspace_invitation\n   */\n  async createInvitation(\n    workspaceId: number,\n    payload: CreateWorkspaceInvitationPayload\n  ): Promise<WorkspaceInvitation> {\n    // Note: ClientSessionId/UndoRedo headers are not listed in the spec for this endpoint\n    return this.client._request<WorkspaceInvitation>(\n      \"POST\",\n      `/api/workspaces/invitations/workspace/${workspaceId}/`,\n      undefined,\n      payload\n    );\n  }\n\n  /**\n   * Retrieves details of a specific workspace invitation. Requires admin permissions.\n   * @param workspaceInvitationId - The ID of the invitation.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspace-invitations/operation/get_workspace_invitation\n   */\n  async getInvitation(\n    workspaceInvitationId: number\n  ): Promise<WorkspaceInvitation> {\n    return this.client._request<WorkspaceInvitation>(\n      \"GET\",\n      `/api/workspaces/invitations/${workspaceInvitationId}/`\n    );\n  }\n\n  /**\n   * Updates an existing workspace invitation. Requires admin permissions.\n   * @param workspaceInvitationId - The ID of the invitation to update.\n   * @param payload - The permissions to update.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspace-invitations/operation/update_workspace_invitation\n   */\n  async updateInvitation(\n    workspaceInvitationId: number,\n    payload: UpdateWorkspaceInvitationPayload\n  ): Promise<WorkspaceInvitation> {\n    // Note: ClientSessionId/UndoRedo headers are not listed in the spec for this endpoint\n    return this.client._request<WorkspaceInvitation>(\n      \"PATCH\",\n      `/api/workspaces/invitations/${workspaceInvitationId}/`,\n      undefined,\n      payload\n    );\n  }\n\n  /**\n   * Deletes/revokes a pending workspace invitation. Requires admin permissions.\n   * @param workspaceInvitationId - The ID of the invitation to delete.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspace-invitations/operation/delete_workspace_invitation\n   */\n  async deleteInvitation(workspaceInvitationId: number): Promise<void> {\n    // Note: ClientSessionId/UndoRedo headers are not listed in the spec for this endpoint\n    await this.client._request<void>(\n      \"DELETE\",\n      `/api/workspaces/invitations/${workspaceInvitationId}/`\n    );\n  }\n\n  /**\n   * Accepts a workspace invitation. This is typically called by the invited user.\n   * @param workspaceInvitationId - The ID of the invitation to accept.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspace-invitations/operation/accept_workspace_invitation\n   */\n  async acceptInvitation(\n    workspaceInvitationId: number\n  ): Promise<WorkspaceUserWorkspace> {\n    return this.client._request<WorkspaceUserWorkspace>(\n      \"POST\",\n      `/api/workspaces/invitations/${workspaceInvitationId}/accept/`\n    );\n  }\n\n  /**\n   * Rejects a workspace invitation. This is typically called by the invited user.\n   * @param workspaceInvitationId - The ID of the invitation to reject.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspace-invitations/operation/reject_workspace_invitation\n   */\n  async rejectInvitation(workspaceInvitationId: number): Promise<void> {\n    await this.client._request<void>(\n      \"POST\",\n      `/api/workspaces/invitations/${workspaceInvitationId}/reject/`\n    );\n  }\n\n  /**\n   * Gets the generative AI model settings for a workspace. Requires admin permissions.\n   * @param workspaceId - The ID of the workspace.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/get_workspace_generative_ai_models_settings\n   */\n  async getGenerativeAiSettings(\n    workspaceId: number\n  ): Promise<GenerativeAISettings> {\n    return this.client._request<GenerativeAISettings>(\n      \"GET\",\n      `/api/workspaces/${workspaceId}/settings/generative-ai/`\n    );\n  }\n\n  /**\n   * Updates the generative AI model settings for a workspace. Requires admin permissions.\n   * @param workspaceId - The ID of the workspace.\n   * @param settings - The settings to update.\n   * @param options - Optional request parameters like ClientSessionId.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/update_workspace_generative_ai_models_settings\n   */\n  async updateGenerativeAiSettings(\n    workspaceId: number,\n    settings: Partial<GenerativeAISettings>,\n    options?: { clientSessionId?: string }\n  ): Promise<Workspace> {\n    // Spec says returns Workspace, confirm if needed\n    const headers: Record<string, string> | undefined = options?.clientSessionId\n      ? { ClientSessionId: options.clientSessionId }\n      : undefined;\n    return this.client._request<Workspace>(\n      \"PATCH\",\n      `/api/workspaces/${workspaceId}/settings/generative-ai/`,\n      undefined,\n      settings,\n      headers\n    );\n  }\n\n  /**\n   * Lists previously created exports for a workspace.\n   * @param workspaceId - The ID of the workspace.\n   * @param options - Optional request parameters like ClientSessionId.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/list_workspace_exports\n   */\n  async listExports(\n    workspaceId: number,\n    options?: { clientSessionId?: string }\n  ): Promise<ListExportWorkspaceApplicationsResponse> {\n    const headers: Record<string, string> | undefined = options?.clientSessionId\n      ? { ClientSessionId: options.clientSessionId }\n      : undefined;\n    return this.client._request<ListExportWorkspaceApplicationsResponse>(\n      \"GET\",\n      `/api/workspaces/${workspaceId}/export/`,\n      undefined,\n      undefined,\n      headers\n    );\n  }\n\n  /**\n   * Starts an asynchronous job to export applications from a workspace.\n   * @param workspaceId - The ID of the workspace to export from.\n   * @param payload - Optional: Specify application IDs to export, or export only structure.\n   * @param options - Optional request parameters like ClientSessionId.\n   * @returns The job details for the export task.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/export_workspace_applications_async\n   */\n  async exportApplications(\n    workspaceId: number,\n    payload?: { application_ids?: number[]; only_structure?: boolean },\n    options?: { clientSessionId?: string }\n  ): Promise<ExportApplicationsJobTypeResponse> {\n    const headers: Record<string, string> | undefined = options?.clientSessionId\n      ? { ClientSessionId: options.clientSessionId }\n      : undefined;\n    return this.client._request<ExportApplicationsJobTypeResponse>(\n      \"POST\",\n      `/api/workspaces/${workspaceId}/export/async/`,\n      undefined,\n      payload, // Body might be optional if exporting all\n      headers\n    );\n  }\n\n  /**\n   * Uploads a file (previously exported .zip) to be imported into a workspace.\n   * @param workspaceId - The ID of the workspace to import into.\n   * @param file - The File object or Blob representing the .zip file.\n   * @param options - Optional request parameters like ClientSessionId.\n   * @returns Information about the uploaded resource.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/import_resource_upload_file\n   */\n  async uploadImportFile(\n    workspaceId: number,\n    file: File | Blob,\n    options?: { clientSessionId?: string }\n  ): Promise<ImportResource> {\n    const headers: Record<string, string> = {}; // Don't set Content-Type for FormData\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n\n    const formData = new FormData();\n    formData.append(\n      \"file\",\n      file,\n      file instanceof File ? file.name : \"import.zip\"\n    );\n\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<ImportResource>(\n      \"POST\",\n      `/api/workspaces/${workspaceId}/import/upload-file/`,\n      undefined,\n      formData,\n      finalHeaders // Pass undefined or the headers object\n    );\n  }\n\n  /**\n   * Starts an asynchronous job to import applications from an uploaded resource.\n   * @param workspaceId - The ID of the workspace to import into.\n   * @param payload - Contains the ID of the uploaded resource.\n   * @param options - Optional request parameters like ClientSessionId.\n   * @returns The job details for the import task.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/import_workspace_applications_async\n   */\n  async importApplications(\n    workspaceId: number,\n    payload: ImportWorkspaceApplicationsPayload,\n    options?: { clientSessionId?: string }\n  ): Promise<ImportApplicationsJobTypeResponse> {\n    const headers: Record<string, string> | undefined = options?.clientSessionId\n      ? { ClientSessionId: options.clientSessionId }\n      : undefined;\n    return this.client._request<ImportApplicationsJobTypeResponse>(\n      \"POST\",\n      `/api/workspaces/${workspaceId}/import/async/`,\n      undefined,\n      payload,\n      headers\n    );\n  }\n\n  /**\n   * Deletes an uploaded import/export resource file.\n   * @param workspaceId - The ID of the workspace the resource belongs to.\n   * @param resourceId - The ID of the resource (obtained from upload) to delete.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/import_export_resource\n   */\n  async deleteImportResource(\n    workspaceId: number,\n    resourceId: number\n  ): Promise<void> {\n    // Note: ClientSessionId/UndoRedo headers are not listed in the spec for this endpoint\n    await this.client._request<void>(\n      \"DELETE\",\n      `/api/workspaces/${workspaceId}/import/${resourceId}/`\n    );\n  }\n\n  /**\n   * Gets the permission object for the current user within a specific workspace.\n   * @param workspaceId - The ID of the workspace.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/workspace_permissions\n   */\n  async getPermissions(workspaceId: number): Promise<PermissionObject[]> {\n    return this.client._request<PermissionObject[]>(\n      \"GET\",\n      `/api/workspaces/${workspaceId}/permissions/`\n    );\n  }\n\n  /**\n   * Creates an initial workspace with example data. Typically used after signup if onboarding is skipped.\n   * @see https://api.baserow.io/api/redoc/#tag/Workspaces/operation/create_initial_workspace\n   */\n  async createInitialWorkspace(): Promise<WorkspaceUserWorkspace> {\n    // Note: ClientSessionId/UndoRedo headers are not listed in the spec for this endpoint\n    return this.client._request<WorkspaceUserWorkspace>(\n      \"POST\",\n      \"/api/workspaces/create-initial-workspace/\"\n    );\n  }\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow applications.\n */\nexport class ApplicationOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Application methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow integrations.\n */\nexport class IntegrationOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Integration methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow user sources.\n */\nexport class UserSourceOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // User source methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow page builder functionality.\n */\nexport class BuilderOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Builder methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow dashboards.\n */\nexport class DashboardOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Dashboard methods will be implemented here\n} ",
    "// database-table-operations.ts\nimport type {\n  Table,\n  ListTablesResponse,\n  TableCreate,\n  PatchedTableUpdate,\n  OrderTablesPayload,\n  TableImportPayload,\n  FileImportJobResponse,\n  DuplicateTableJobResponse,\n  ExportOptions,\n  ExportJob,\n  DataSync,\n  DataSyncCreatePayload,\n  DataSyncUpdatePayload,\n  ListDataSyncProperty,\n  ListDataSyncPropertiesResponse,\n  ListDataSyncPropertiesRequest,\n  SyncDataSyncTableJobResponse,\n} from \"../types/database\"; // Adjust path as needed\nimport type { BaserowClient } from \"./baserow-client\";\n\n/**\n * Converts camelCase parameters to snake_case for API compatibility\n */\nfunction convertToSnakeCase(params: Record<string, any>): Record<string, any> {\n  if (!params) return params;\n  \n  const converted: Record<string, any> = {};\n  for (const [key, value] of Object.entries(params)) {\n    const snakeKey = key.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);\n    converted[snakeKey] = value;\n  }\n  return converted;\n}\n\nexport class DatabaseTableOperations {\n  constructor(private client: BaserowClient) {}\n\n  /**\n   * Lists all tables in a database.\n   * @param databaseId - The ID of the database to list tables from.\n   * @returns A list of tables.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/list_database_tables\n   */\n  async list(databaseId: number): Promise<ListTablesResponse> {\n    return this.client._request<ListTablesResponse>(\n      \"GET\",\n      `/api/database/tables/database/${databaseId}/`\n    );\n  }\n\n  /**\n   * Creates a new table synchronously within a database. Optionally initializes with data.\n   * @param databaseId - The ID of the database to create the table in.\n   * @param payload - The table creation details, including name and optional initial data.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @returns The newly created table.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/create_database_table\n   */\n  async create(\n    databaseId: number,\n    payload: TableCreate,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<Table> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<Table>(\n      \"POST\",\n      `/api/database/tables/database/${databaseId}/`,\n      undefined,\n      convertToSnakeCase(payload),\n      finalHeaders\n    );\n  }\n\n  /**\n   * Creates a job to asynchronously create a new table within a database. Optionally initializes with data.\n   * @param databaseId - The ID of the database to create the table in.\n   * @param payload - The table creation details, including name and optional initial data.\n   * @param options - Optional request parameters like ClientSessionId.\n   * @returns The job details for tracking the asynchronous creation.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/create_database_table_async\n   */\n  async createAsync(\n    databaseId: number,\n    payload: TableCreate,\n    options?: { clientSessionId?: string } // Only ClientSessionId mentioned in spec\n  ): Promise<FileImportJobResponse> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<FileImportJobResponse>(\n      \"POST\",\n      `/api/database/tables/database/${databaseId}/async/`,\n      undefined,\n      convertToSnakeCase(payload),\n      finalHeaders\n    );\n  }\n\n  /**\n   * Fetches a specific table by its ID.\n   * @param tableId - The ID of the table to fetch.\n   * @returns The requested table.\n   * @throws {BaserowApiError} If the request fails or the table doesn't exist.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/get_database_table\n   */\n  async get(tableId: number): Promise<Table> {\n    return this.client._request<Table>(\n      \"GET\",\n      `/api/database/tables/${tableId}/`\n    );\n  }\n\n  /**\n   * Updates an existing table. Currently, only the name can be updated.\n   * @param tableId - The ID of the table to update.\n   * @param payload - The updated table details (e.g., { name: 'New Name' }).\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @returns The updated table.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/update_database_table\n   */\n  async update(\n    tableId: number,\n    payload: PatchedTableUpdate,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<Table> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<Table>(\n      \"PATCH\",\n      `/api/database/tables/${tableId}/`,\n      undefined,\n      convertToSnakeCase(payload),\n      finalHeaders\n    );\n  }\n\n  /**\n   * Deletes a table.\n   * @param tableId - The ID of the table to delete.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/delete_database_table\n   */\n  async delete(\n    tableId: number,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<void> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    await this.client._request<void>(\n      \"DELETE\",\n      `/api/database/tables/${tableId}/`,\n      undefined,\n      undefined,\n      finalHeaders\n    );\n  }\n\n  /**\n   * Starts a job to duplicate a table asynchronously.\n   * @param tableId - The ID of the table to duplicate.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @returns The job details for tracking the duplication process.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/duplicate_database_table_async\n   */\n  async duplicateAsync(\n    tableId: number,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<DuplicateTableJobResponse> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<DuplicateTableJobResponse>(\n      \"POST\",\n      `/api/database/tables/${tableId}/duplicate/async/`,\n      undefined,\n      {}, // No body needed for duplicate\n      finalHeaders\n    );\n  }\n\n  /**\n   * Changes the order of tables within a database.\n   * @param databaseId - The ID of the database containing the tables.\n   * @param payload - An object containing the `table_ids` array in the desired order.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/order_database_tables\n   */\n  async order(\n    databaseId: number,\n    payload: OrderTablesPayload,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<void> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    const snakeCasePayload = {\n      table_ids: payload.tableIds\n    };\n\n    await this.client._request<void>(\n      \"POST\",\n      `/api/database/tables/database/${databaseId}/order/`,\n      undefined,\n      snakeCasePayload,\n      finalHeaders\n    );\n  }\n\n  /**\n   * Starts a job to import data into an existing table asynchronously.\n   * @param tableId - The ID of the table to import data into.\n   * @param payload - The data and optional configuration for the import.\n   * @returns The job details for tracking the import process.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/import_data_database_table_async\n   */\n  async importDataAsync(\n    tableId: number,\n    payload: TableImportPayload\n  ): Promise<FileImportJobResponse> {\n    // Note: No specific headers mentioned for this endpoint in the provided spec snippet\n    return this.client._request<FileImportJobResponse>(\n      \"POST\",\n      `/api/database/tables/${tableId}/import/async/`,\n      undefined,\n      convertToSnakeCase(payload)\n    );\n  }\n\n  // --- Data Sync Operations ---\n\n  /**\n   * Retrieves a specific data sync configuration.\n   * @param dataSyncId - The ID of the data sync configuration.\n   * @returns The data sync configuration details.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/get_table_data_sync\n   */\n  async getDataSync(dataSyncId: number): Promise<DataSync> {\n    return this.client._request<DataSync>(\n      \"GET\",\n      `/api/database/data-sync/${dataSyncId}/`\n    );\n  }\n\n  /**\n   * Updates a data sync configuration.\n   * @param dataSyncId - The ID of the data sync configuration to update.\n   * @param payload - The partial data sync configuration with updated values.\n   * @returns The updated data sync configuration.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/update_table_data_sync\n   */\n  async updateDataSync(\n    dataSyncId: number,\n    payload: DataSyncUpdatePayload // Using the discriminated union type\n  ): Promise<DataSync> {\n    // Note: No specific headers mentioned for this endpoint in the provided spec snippet\n    return this.client._request<DataSync>(\n      \"PATCH\",\n      `/api/database/data-sync/${dataSyncId}/`,\n      undefined,\n      convertToSnakeCase(payload)\n    );\n  }\n\n  /**\n   * Lists the available properties (potential fields) for a specific data sync configuration.\n   * @param dataSyncId - The ID of the data sync configuration.\n   * @param options - Optional request parameters like ClientSessionId.\n   * @returns A list of available properties.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/get_table_data_sync_properties\n   */\n  async listDataSyncProperties(\n    dataSyncId: number,\n    options?: { clientSessionId?: string } // Only ClientSessionId mentioned\n  ): Promise<ListDataSyncPropertiesResponse> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<ListDataSyncPropertiesResponse>(\n      \"GET\",\n      `/api/database/data-sync/${dataSyncId}/properties/`,\n      undefined,\n      undefined,\n      finalHeaders\n    );\n  }\n\n  /**\n   * Starts an asynchronous job to sync data for a specific data sync configuration.\n   * @param dataSyncId - The ID of the data sync configuration to sync.\n   * @returns The job details for tracking the sync process.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/sync_data_sync_table_async\n   */\n  async syncDataSyncAsync(\n    dataSyncId: number\n  ): Promise<SyncDataSyncTableJobResponse> {\n    // Note: No specific headers mentioned for this endpoint in the provided spec snippet\n    return this.client._request<SyncDataSyncTableJobResponse>(\n      \"POST\",\n      `/api/database/data-sync/${dataSyncId}/sync/async/`\n    );\n  }\n\n  /**\n   * Creates a new table that is synchronized with an external data source.\n   * @param databaseId - The ID of the database to create the data sync table in.\n   * @param payload - The configuration for the data sync source.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @returns The newly created table.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/create_database_data_sync_table\n   */\n  async createDataSyncTable(\n    databaseId: number,\n    payload: DataSyncCreatePayload, // Using the discriminated union type\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<Table> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<Table>(\n      \"POST\",\n      `/api/database/data-sync/database/${databaseId}/`,\n      undefined,\n      convertToSnakeCase(payload),\n      finalHeaders\n    );\n  }\n\n  /**\n   * Fetches the potential properties (fields) for a given data sync type configuration *before* creating the data sync table.\n   * @param payload - The configuration details of the potential data sync source.\n   * @returns A list of available properties.\n   * @throws {BaserowApiError} If the request fails or the configuration is invalid.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-tables/operation/get_table_data_sync_type_properties\n   */\n  async getDataSyncTypeProperties(\n    payload: ListDataSyncPropertiesRequest // Using the discriminated union type\n  ): Promise<ListDataSyncPropertiesResponse> {\n    // Note: No specific headers mentioned for this endpoint in the provided spec snippet\n    return this.client._request<ListDataSyncPropertiesResponse>(\n      \"POST\",\n      `/api/database/data-sync/properties/`,\n      undefined,\n      convertToSnakeCase(payload)\n    );\n  }\n\n  // --- Export Operations --- (Belongs more logically with Tables)\n\n  /**\n   * Retrieves the status and details of a specific export job.\n   * @param jobId - The ID of the export job.\n   * @returns The export job details.\n   * @throws {BaserowApiError} If the request fails or the job doesn't exist.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-export/operation/get_export_job\n   */\n  async getExportJob(jobId: number): Promise<ExportJob> {\n    return this.client._request<ExportJob>(\n      \"GET\",\n      `/api/database/export/${jobId}/`\n    );\n  }\n\n  /**\n   * Creates and starts a new export job for a specific table.\n   * @param tableId - The ID of the table to export.\n   * @param payload - The export options, including type and format-specific settings.\n   * @returns The details of the newly created export job.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-export/operation/export_table\n   */\n  async exportTable(\n    tableId: number,\n    payload: ExportOptions // Using the discriminated union type\n  ): Promise<ExportJob> {\n    // Note: No specific headers mentioned for this endpoint in the provided spec snippet\n    return this.client._request<ExportJob>(\n      \"POST\",\n      `/api/database/export/table/${tableId}/`,\n      undefined,\n      convertToSnakeCase(payload)\n    );\n  }\n}",
    "import { BaserowClient } from \"./baserow-client\";\nimport type {\n  Field,\n  FieldCreateRequest, \n  FieldUpdateRequest,\n  RelatedFields,\n  UniqueRowValues,\n  UniqueRowValuesParams,\n  DuplicateFieldJobResponse,\n  DuplicateFieldParams,\n  GenerateAIFieldValuesRequest\n} from \"../types/database\";\n\n/**\n * Converts camelCase parameters to snake_case for API compatibility\n */\nfunction convertToSnakeCase(params: Record<string, any>): Record<string, any> {\n  if (!params) return params;\n  \n  const converted: Record<string, any> = {};\n  for (const [key, value] of Object.entries(params)) {\n    const snakeKey = key.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);\n    converted[snakeKey] = value;\n  }\n  return converted;\n}\n\n/**\n * Operations for managing Baserow database fields.\n */\nexport class DatabaseFieldOperations {\n  constructor(private client: BaserowClient) {}\n  \n  /**\n   * Retrieves a specific field by its ID.\n   * @param fieldId - The ID of the field to retrieve.\n   * @returns The field object.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/get_database_table_field\n   */\n  async get(fieldId: number): Promise<Field> {\n    return this.client._request<Field>(\n      \"GET\",\n      `/api/database/fields/${fieldId}/`\n    );\n  }\n\n  /**\n   * Lists all fields in a specific table.\n   * @param tableId - The ID of the table to list fields from.\n   * @returns An array of field objects.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/list_database_table_fields\n   */\n  async list(tableId: number): Promise<Field[]> {\n    return this.client._request<Field[]>(\n      \"GET\",\n      `/api/database/fields/table/${tableId}/`\n    );\n  }\n\n  /**\n   * Creates a new field in a table.\n   * @param tableId - The ID of the table to create the field in.\n   * @param payload - The field creation details.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @returns The newly created field.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/create_database_table_field\n   */\n  async create(\n    tableId: number,\n    payload: FieldCreateRequest,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<Field> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<Field>(\n      \"POST\",\n      `/api/database/fields/table/${tableId}/`,\n      undefined,\n      convertToSnakeCase(payload),\n      finalHeaders\n    );\n  }\n\n  /**\n   * Updates an existing field.\n   * @param fieldId - The ID of the field to update.\n   * @param payload - The field update details.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @returns The updated field.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/update_database_table_field\n   */\n  async update(\n    fieldId: number,\n    payload: FieldUpdateRequest,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<Field> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<Field>(\n      \"PATCH\",\n      `/api/database/fields/${fieldId}/`,\n      undefined,\n      convertToSnakeCase(payload),\n      finalHeaders\n    );\n  }\n\n  /**\n   * Deletes a field.\n   * @param fieldId - The ID of the field to delete.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @returns Related fields that changed as a result of this operation.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/delete_database_table_field\n   */\n  async delete(\n    fieldId: number,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<RelatedFields> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<RelatedFields>(\n      \"DELETE\",\n      `/api/database/fields/${fieldId}/`,\n      undefined,\n      undefined,\n      finalHeaders\n    );\n  }\n\n  /**\n   * Retrieves unique row values for a specific field.\n   * @param fieldId - The ID of the field to get unique values from.\n   * @param params - Optional parameters like limit and whether to split comma-separated values.\n   * @returns An object containing an array of unique values.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/get_database_field_unique_row_values\n   */\n  async getUniqueRowValues(\n    fieldId: number,\n    params?: UniqueRowValuesParams\n  ): Promise<UniqueRowValues> {\n    return this.client._request<UniqueRowValues>(\n      \"GET\",\n      `/api/database/fields/${fieldId}/unique_row_values/`,\n      params ? convertToSnakeCase(params) : undefined\n    );\n  }\n\n  /**\n   * Starts a job to duplicate a field asynchronously.\n   * @param fieldId - The ID of the field to duplicate.\n   * @param params - Optional parameters for the duplication process.\n   * @returns The job details for tracking the duplication process.\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/duplicate_table_field\n   */\n  async duplicateAsync(\n    fieldId: number,\n    params?: DuplicateFieldParams\n  ): Promise<DuplicateFieldJobResponse> {\n    const headers: Record<string, string> = {};\n    if (params?.clientSessionId)\n      headers[\"ClientSessionId\"] = params.clientSessionId;\n    if (params?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        params.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    const payload = params ? { duplicate_data: params.duplicateData || false } : { duplicate_data: false };\n\n    return this.client._request<DuplicateFieldJobResponse>(\n      \"POST\",\n      `/api/database/fields/${fieldId}/duplicate/async/`,\n      undefined,\n      payload,\n      finalHeaders\n    );\n  }\n\n  /**\n   * Generates AI field values for specified rows using a configured AI field.\n   * This is a premium feature.\n   * @param fieldId - The ID of the AI field to generate values for.\n   * @param payload - The request payload containing row IDs.\n   * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n   * @returns A string response (job ID or confirmation).\n   * @throws {BaserowApiError} If the request fails.\n   * @see https://api.baserow.io/api/redoc/#tag/Database-table-fields/operation/generate_table_ai_field_value\n   */\n  async generateAIFieldValues(\n    fieldId: number,\n    payload: GenerateAIFieldValuesRequest,\n    options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n  ): Promise<string> {\n    const headers: Record<string, string> = {};\n    if (options?.clientSessionId)\n      headers[\"ClientSessionId\"] = options.clientSessionId;\n    if (options?.clientUndoRedoActionGroupId)\n      headers[\"ClientUndoRedoActionGroupId\"] =\n        options.clientUndoRedoActionGroupId;\n    const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n\n    return this.client._request<string>(\n      \"POST\",\n      `/api/database/fields/${fieldId}/generate-ai-field-values/`,\n      undefined,\n      convertToSnakeCase(payload),\n      finalHeaders\n    );\n  }\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow database views.\n */\nexport class DatabaseViewOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Database view methods will be implemented here\n} ",
    "import type {\n  BaserowRow,\n  ListRowsParams,\n  ListRowsResponse,\n  CreateRowParams,\n  UpdateRowParams,\n  DeleteRowParams,\n  MoveRowParams,\n  BatchCreateRowsPayload,\n  BatchUpdateRowsPayload,\n  BatchDeleteRowsPayload,\n  GetAdjacentRowParams,\n  ListRowHistoryParams,\n  ListRowHistoryResponse,\n  ListRowNamesParams,\n  ListRowNamesResponse,\n  ListRowCommentsParams,\n  ListRowCommentsResponse,\n  CreateRowCommentPayload,\n  UpdateRowCommentPayload,\n  RowComment,\n  UpdateRowCommentNotificationModePayload\n} from \"../types/database\";\n\nimport type { BaserowClient } from \"./baserow-client\";\nimport { BaserowApiError } from \"../types/error\";\n\n/**\n * Converts camelCase parameters to snake_case for API compatibility\n */\nfunction convertToSnakeCase(params: Record<string, any>): Record<string, any> {\n  if (!params) return params;\n  \n  const converted: Record<string, any> = {};\n  for (const [key, value] of Object.entries(params)) {\n    const snakeKey = key.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);\n    converted[snakeKey] = value;\n  }\n  return converted;\n}\n\nexport class DatabaseRowOperations {\n    constructor(private client: BaserowClient) {}\n  \n    /**\n     * Lists rows in a table, with support for pagination, filtering, sorting, and searching.\n     * @param tableId - The ID of the table to list rows from.\n     * @param params - Optional query parameters for pagination, filtering, sorting, etc.\n     * @returns A paginated list of rows.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/list_database_table_rows\n     */\n    async list<T extends BaserowRow = BaserowRow>(\n      tableId: number,\n      params?: ListRowsParams\n    ): Promise<ListRowsResponse<T>> {\n      const { filters, ...otherParams } = params || {};\n      const queryParams: Record<string, any> = convertToSnakeCase({ ...otherParams });\n      \n      if (filters) {\n        queryParams[\"filters\"] = JSON.stringify(filters);\n        // Remove individual filter params if structured filters are provided\n        Object.keys(queryParams).forEach((key) => {\n          if (key.startsWith(\"filter__\")) {\n            delete queryParams[key];\n          }\n        });\n        delete queryParams[\"filter_type\"];\n      }\n  \n      return this.client._request<ListRowsResponse<T>>(\n        \"GET\",\n        `/api/database/rows/table/${tableId}/`,\n        queryParams\n      );\n    }\n  \n    /**\n     * Fetches a single row from a table.\n     * @param tableId - The ID of the table.\n     * @param rowId - The ID of the row to fetch.\n     * @param params - Optional parameters like 'include' or 'user_field_names'.\n     * @returns The requested row.\n     * @throws {BaserowApiError} If the request fails or the row/table doesn't exist.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/get_database_table_row\n     */\n    async get<T extends BaserowRow = BaserowRow>(\n      tableId: number,\n      rowId: number,\n      params?: { include?: \"metadata\"; userFieldNames?: boolean }\n    ): Promise<T> {\n      return this.client._request<T>(\n        \"GET\",\n        `/api/database/rows/table/${tableId}/${rowId}/`,\n        params ? convertToSnakeCase(params) : undefined\n      );\n    }\n  \n    /**\n     * Creates a new row in a table.\n     * @param tableId - The ID of the table to create the row in.\n     * @param rowData - An object representing the row data. Keys should be `field_{id}` or field names if user_field_names is true.\n     * @param params - Optional query parameters like 'before', 'send_webhook_events', 'user_field_names'.\n     * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n     * @returns The newly created row.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/create_database_table_row\n     */\n    async create<\n      TRequest = Record<string, any>,\n      TResponse extends BaserowRow = BaserowRow\n    >(\n      tableId: number,\n      rowData: TRequest,\n      params?: CreateRowParams,\n      options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n    ): Promise<TResponse> {\n      const headers: Record<string, string> = {};\n      if (options?.clientSessionId)\n        headers[\"ClientSessionId\"] = options.clientSessionId;\n      if (options?.clientUndoRedoActionGroupId)\n        headers[\"ClientUndoRedoActionGroupId\"] =\n          options.clientUndoRedoActionGroupId;\n  \n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n  \n      return this.client._request<TResponse>(\n        \"POST\",\n        `/api/database/rows/table/${tableId}/`,\n        queryParams,\n        rowData,\n        finalHeaders\n      );\n    }\n  \n    /**\n     * Updates an existing row in a table.\n     * @param tableId - The ID of the table containing the row.\n     * @param rowId - The ID of the row to update.\n     * @param rowData - An object containing the fields to update. Keys should be `field_{id}` or field names if user_field_names is true.\n     * @param params - Optional query parameters like 'send_webhook_events', 'user_field_names'.\n     * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n     * @returns The updated row.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/update_database_table_row\n     */\n    async update<\n      TRequest = Record<string, any>,\n      TResponse extends BaserowRow = BaserowRow\n    >(\n      tableId: number,\n      rowId: number,\n      rowData: Partial<TRequest>, // Use Partial as we only send fields to update\n      params?: UpdateRowParams,\n      options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n    ): Promise<TResponse> {\n      const headers: Record<string, string> = {};\n      if (options?.clientSessionId)\n        headers[\"ClientSessionId\"] = options.clientSessionId;\n      if (options?.clientUndoRedoActionGroupId)\n        headers[\"ClientUndoRedoActionGroupId\"] =\n          options.clientUndoRedoActionGroupId;\n  \n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n  \n      return this.client._request<TResponse>(\n        \"PATCH\",\n        `/api/database/rows/table/${tableId}/${rowId}/`,\n        queryParams,\n        rowData,\n        finalHeaders\n      );\n    }\n  \n    /**\n     * Deletes a row from a table.\n     * @param tableId - The ID of the table containing the row.\n     * @param rowId - The ID of the row to delete.\n     * @param params - Optional query parameters like 'send_webhook_events'.\n     * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/delete_database_table_row\n     */\n    async delete(\n      tableId: number,\n      rowId: number,\n      params?: DeleteRowParams,\n      options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n    ): Promise<void> {\n      const headers: Record<string, string> = {};\n      if (options?.clientSessionId)\n        headers[\"ClientSessionId\"] = options.clientSessionId;\n      if (options?.clientUndoRedoActionGroupId)\n        headers[\"ClientUndoRedoActionGroupId\"] =\n          options.clientUndoRedoActionGroupId;\n  \n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n  \n      await this.client._request<void>(\n        \"DELETE\",\n        `/api/database/rows/table/${tableId}/${rowId}/`,\n        queryParams,\n        undefined,\n        finalHeaders\n      );\n    }\n  \n    /**\n     * Moves a row within a table.\n     * @param tableId - The ID of the table containing the row.\n     * @param rowId - The ID of the row to move.\n     * @param params - Query parameters specifying where to move the row ('before_id') and optionally 'user_field_names'.\n     * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n     * @returns The moved row with its potentially updated order.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/move_database_table_row\n     */\n    async move<TResponse extends BaserowRow = BaserowRow>(\n      tableId: number,\n      rowId: number,\n      params?: MoveRowParams,\n      options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n    ): Promise<TResponse> {\n      const headers: Record<string, string> = {};\n      if (options?.clientSessionId)\n        headers[\"ClientSessionId\"] = options.clientSessionId;\n      if (options?.clientUndoRedoActionGroupId)\n        headers[\"ClientUndoRedoActionGroupId\"] =\n          options.clientUndoRedoActionGroupId;\n  \n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n  \n      return this.client._request<TResponse>(\n        \"PATCH\",\n        `/api/database/rows/table/${tableId}/${rowId}/move/`,\n        queryParams,\n        {},\n        finalHeaders\n      );\n    }\n  \n    /**\n     * Creates multiple rows in a table in a single batch request.\n     * @param tableId - The ID of the table to create rows in.\n     * @param payload - An object containing an `items` array of row data objects.\n     * @param params - Optional query parameters like 'before', 'send_webhook_events', 'user_field_names'.\n     * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n     * @returns An object containing an `items` array with the newly created rows.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/batch_create_database_table_rows\n     */\n    async batchCreate<\n      TRequest = Record<string, any>,\n      TResponse extends BaserowRow = BaserowRow\n    >(\n      tableId: number,\n      payload: BatchCreateRowsPayload<TRequest>,\n      params?: Omit<CreateRowParams, \"before\"> & { before?: number | null }, // before can be null for batch\n      options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n    ): Promise<{ items: TResponse[] }> {\n      const headers: Record<string, string> = {};\n      if (options?.clientSessionId)\n        headers[\"ClientSessionId\"] = options.clientSessionId;\n      if (options?.clientUndoRedoActionGroupId)\n        headers[\"ClientUndoRedoActionGroupId\"] =\n          options.clientUndoRedoActionGroupId;\n      return this.client._request<{ items: TResponse[] }>(\n        \"POST\",\n        `/api/database/rows/table/${tableId}/batch/`,\n        params,\n        payload,\n        headers\n      );\n    }\n  \n    /**\n     * Updates multiple rows in a table in a single batch request.\n     * @param tableId - The ID of the table containing the rows.\n     * @param payload - An object containing an `items` array of row objects, each including its `id` and the fields to update.\n     * @param params - Optional query parameters like 'send_webhook_events', 'user_field_names'.\n     * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n     * @returns An object containing an `items` array with the updated rows.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/batch_update_database_table_rows\n     */\n    async batchUpdate<\n      TRequest extends { id: number } = { id: number } & Record<string, any>,\n      TResponse extends BaserowRow = BaserowRow\n    >(\n      tableId: number,\n      payload: BatchUpdateRowsPayload<Partial<TRequest> & { id: number }>, // Only need id and fields to update\n      params?: UpdateRowParams,\n      options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n    ): Promise<{ items: TResponse[] }> {\n      const headers: Record<string, string> = {};\n      if (options?.clientSessionId)\n        headers[\"ClientSessionId\"] = options.clientSessionId;\n      if (options?.clientUndoRedoActionGroupId)\n        headers[\"ClientUndoRedoActionGroupId\"] =\n          options.clientUndoRedoActionGroupId;\n  \n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n  \n      return this.client._request<{ items: TResponse[] }>(\n        \"PATCH\",\n        `/api/database/rows/table/${tableId}/batch/`,\n        queryParams,\n        payload,\n        finalHeaders\n      );\n    }\n  \n    /**\n     * Deletes multiple rows from a table in a single batch request.\n     * @param tableId - The ID of the table containing the rows.\n     * @param rowIds - An array of row IDs to delete.\n     * @param params - Optional query parameters like 'send_webhook_events'.\n     * @param options - Optional request parameters like ClientSessionId or ClientUndoRedoActionGroupId.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/batch_delete_database_table_rows\n     */\n    async batchDelete(\n      tableId: number,\n      rowIds: number[],\n      params?: DeleteRowParams,\n      options?: { clientSessionId?: string; clientUndoRedoActionGroupId?: string }\n    ): Promise<void> {\n      const headers: Record<string, string> = {};\n      if (options?.clientSessionId)\n        headers[\"ClientSessionId\"] = options.clientSessionId;\n      if (options?.clientUndoRedoActionGroupId)\n        headers[\"ClientUndoRedoActionGroupId\"] =\n          options.clientUndoRedoActionGroupId;\n  \n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      const finalHeaders = Object.keys(headers).length > 0 ? headers : undefined;\n  \n      const payload: BatchDeleteRowsPayload = { items: rowIds };\n      await this.client._request<void>(\n        \"POST\", // Note: The API uses POST for batch delete\n        `/api/database/rows/table/${tableId}/batch-delete/`,\n        queryParams,\n        payload,\n        finalHeaders\n      );\n    }\n  \n    /**\n     * Fetches the adjacent row (previous or next) to a given row within a table, optionally applying view filters/sorts.\n     * @param tableId - The ID of the table.\n     * @param rowId - The ID of the reference row.\n     * @param params - Optional parameters: 'previous' flag, 'view_id', 'search', 'user_field_names'.\n     * @returns The adjacent row or null if no adjacent row exists matching the criteria.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/get_adjacent_database_table_row\n     */\n    async getAdjacent<TResponse extends BaserowRow = BaserowRow>(\n      tableId: number,\n      rowId: number,\n      params?: GetAdjacentRowParams\n    ): Promise<TResponse | null> {\n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      try {\n        // The API returns 204 No Content if no adjacent row is found\n        const response = await this.client._request<TResponse | undefined>(\n          \"GET\",\n          `/api/database/rows/table/${tableId}/${rowId}/adjacent/`,\n          queryParams\n        );\n        return response ?? null; // Convert undefined (from 204) to null\n      } catch (error) {\n        // Specifically handle 204 which might not be thrown as error by _request depending on its logic\n        // However, our current _request throws for !response.ok, so 204 should be handled there.\n        // If _request is modified later, this catch might need adjustment.\n        if (error instanceof BaserowApiError && error.status === 204) {\n          return null;\n        }\n        throw error; // Re-throw other errors\n      }\n    }\n  \n    /**\n     * Fetches the change history for a specific row.\n     * @param tableId - The ID of the table.\n     * @param rowId - The ID of the row.\n     * @param params - Optional pagination parameters ('limit', 'offset').\n     * @returns A paginated list of row history entries.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/get_database_table_row_history\n     */\n    async getHistory(\n      tableId: number,\n      rowId: number,\n      params?: ListRowHistoryParams\n    ): Promise<ListRowHistoryResponse> {\n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      return this.client._request<ListRowHistoryResponse>(\n        \"GET\",\n        `/api/database/rows/table/${tableId}/${rowId}/history/`,\n        queryParams\n      );\n    }\n  \n    /**\n     * Fetches the primary field values (names) for specific rows across one or more tables.\n     * @param params - An object where keys are `table__<id>` and values are comma-separated row IDs.\n     * @returns An object mapping table IDs to row IDs to row names.\n     * @throws {BaserowApiError} If the request fails.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/list_database_table_row_names\n     */\n    async listNames(params: ListRowNamesParams): Promise<ListRowNamesResponse> {\n      // Query parameters are dynamic and structured, pass directly\n      return this.client._request<ListRowNamesResponse>(\n        \"GET\",\n        `/api/database/rows/names/`,\n        params as Record<string, string> // Cast needed due to dynamic keys\n      );\n    }\n  \n    // --- Row Comments ---\n  \n    /**\n     * Lists comments for a specific row. (Premium feature)\n     * @param tableId - The ID of the table.\n     * @param rowId - The ID of the row.\n     * @param params - Optional pagination parameters.\n     * @returns A paginated list of row comments.\n     * @throws {BaserowApiError} If the request fails or feature is unavailable.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/get_row_comments\n     */\n    async listComments(\n      tableId: number,\n      rowId: number,\n      params?: ListRowCommentsParams\n    ): Promise<ListRowCommentsResponse> {\n      const queryParams = params ? convertToSnakeCase(params) : undefined;\n      return this.client._request<ListRowCommentsResponse>(\n        \"GET\",\n        `/api/row_comments/${tableId}/${rowId}/`,\n        queryParams\n      );\n    }\n  \n    /**\n     * Creates a comment on a specific row. (Premium feature)\n     * @param tableId - The ID of the table.\n     * @param rowId - The ID of the row to comment on.\n     * @param payload - The comment content.\n     * @returns The newly created comment.\n     * @throws {BaserowApiError} If the request fails or feature is unavailable.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/create_row_comment\n     */\n    async createComment(\n      tableId: number,\n      rowId: number,\n      payload: CreateRowCommentPayload\n    ): Promise<RowComment> {\n      return this.client._request<RowComment>(\n        \"POST\",\n        `/api/row_comments/${tableId}/${rowId}/`,\n        undefined,\n        payload\n      );\n    }\n  \n    /**\n     * Updates an existing row comment. Only the author can update their comment. (Premium feature)\n     * @param tableId - The ID of the table containing the comment's row.\n     * @param commentId - The ID of the comment to update.\n     * @param payload - The updated comment content.\n     * @returns The updated comment.\n     * @throws {BaserowApiError} If the request fails, feature is unavailable, or user is not the author.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/update_row_comment\n     */\n    async updateComment(\n      tableId: number,\n      commentId: number,\n      payload: UpdateRowCommentPayload\n    ): Promise<RowComment> {\n      return this.client._request<RowComment>(\n        \"PATCH\",\n        `/api/row_comments/${tableId}/comment/${commentId}/`,\n        undefined,\n        payload\n      );\n    }\n  \n    /**\n     * Deletes a row comment. Only the author can delete their comment. (Premium feature)\n     * @param tableId - The ID of the table containing the comment's row.\n     * @param commentId - The ID of the comment to delete.\n     * @returns The deleted comment object (based on spec, confirm if it actually returns content or just 204).\n     * @throws {BaserowApiError} If the request fails, feature is unavailable, or user is not the author.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/delete_row_comment\n     */\n    async deleteComment(tableId: number, commentId: number): Promise<RowComment> {\n      // Spec shows 200 response with RowComment, but deletion often returns 204.\n      // The client._request handles 204 correctly, but we type hint based on spec.\n      return this.client._request<RowComment>(\n        \"DELETE\",\n        `/api/row_comments/${tableId}/comment/${commentId}/`\n      );\n    }\n  \n    /**\n     * Updates the user's notification preferences for comments on a specific row. (Premium feature)\n     * @param tableId - The ID of the table.\n     * @param rowId - The ID of the row.\n     * @param payload - The desired notification mode ('all' or 'mentions').\n     * @throws {BaserowApiError} If the request fails or feature is unavailable.\n     * @see https://api.baserow.io/api/redoc/#tag/Database-table-rows/operation/update_row_comment_notification_mode\n     */\n    async updateCommentNotificationMode(\n      tableId: number,\n      rowId: number,\n      payload: UpdateRowCommentNotificationModePayload\n    ): Promise<void> {\n      await this.client._request<void>(\n        \"PUT\",\n        `/api/row_comments/${tableId}/${rowId}/notification-mode/`,\n        undefined,\n        payload\n      );\n    }\n  }",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow database webhooks.\n */\nexport class DatabaseWebhookOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Database webhook methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow database tokens.\n */\nexport class DatabaseTokenOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Database token methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * User file response type\n */\nexport interface UserFile {\n  size: number;\n  mime_type: string;\n  is_image: boolean;\n  image_width: number | null;\n  image_height: number | null;\n  uploaded_at: string;\n  url: string;\n  thumbnails: Record<string, any>;\n  name: string;\n  original_name: string;\n}\n\n/**\n * Operations for managing Baserow user files.\n */\nexport class UserFileOperations {\n  constructor(private client: BaserowClient) {}\n  \n  /**\n   * Uploads a file to Baserow by uploading the file contents directly.\n   * @param fileOrFormData - The file to upload (File/Blob object) or FormData with 'file' field\n   * @returns Information about the uploaded file\n   * @throws {BaserowApiError} If file upload fails\n   */\n  async uploadFile(fileOrFormData: File | Blob | FormData): Promise<UserFile> {\n    let body: any;\n    \n    if (fileOrFormData instanceof FormData) {\n      body = fileOrFormData;\n    } else {\n      // In browser environments\n      body = new FormData();\n      // @ts-ignore - FormData.append exists in browser environments\n      body.append('file', fileOrFormData, fileOrFormData instanceof File ? fileOrFormData.name : 'file');\n    }\n\n    return this.client._request<UserFile>(\n      \"POST\",\n      \"/api/user-files/upload-file/\",\n      undefined,\n      body\n    );\n  }\n\n  /**\n   * Uploads a file to Baserow by downloading it from the provided URL.\n   * @param url - The URL to download the file from\n   * @returns Information about the uploaded file\n   * @throws {BaserowApiError} If file upload fails\n   */\n  async uploadViaUrl(url: string): Promise<UserFile> {\n    return this.client._request<UserFile>(\n      \"POST\",\n      \"/api/user-files/upload-via-url/\",\n      undefined,\n      { url }\n    );\n  }\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow secure files.\n */\nexport class SecureFileOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Secure file methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow jobs and background tasks.\n */\nexport class JobOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Job methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow licenses.\n */\nexport class LicenseOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // License methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow notifications.\n */\nexport class NotificationOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Notification methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow role assignments.\n */\nexport class RoleAssignmentOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Role assignment methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow teams.\n */\nexport class TeamOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Team methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow templates.\n */\nexport class TemplateOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Template methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow trash and restoration.\n */\nexport class TrashOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // Trash methods will be implemented here\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow users.\n */\nexport class UserOperations {\n  constructor(private client: BaserowClient) {}\n  \n  /**\n   * Authenticates a user with email and password.\n   * Returns JWT tokens and user information that can be used for subsequent API calls.\n   * @param email - User's email\n   * @param password - User's password\n   * @returns Object containing user information, access_token and refresh_token\n   * @throws {BaserowApiError} If authentication fails\n   */\n  async login(email: string, password: string): Promise<{\n    user: {\n      first_name: string;\n      username: string;\n      language: string;\n    };\n    access_token: string;\n    refresh_token: string;\n  }> {\n    return this.client._request<{\n      user: {\n        first_name: string;\n        username: string;\n        language: string;\n      };\n      access_token: string;\n      refresh_token: string;\n    }>(\n      \"POST\",\n      \"/api/user/token-auth/\",\n      undefined,\n      { email, password }\n    );\n  }\n\n  /**\n   * Refreshes an expired JWT token using a refresh token.\n   * @param refreshToken - The refresh token obtained during login\n   * @returns Object containing a new access_token and user information\n   * @throws {BaserowApiError} If the refresh token is invalid or expired\n   */\n  async refreshToken(refreshToken: string): Promise<{\n    user: {\n      first_name: string;\n      username: string;\n      language: string;\n    };\n    access_token: string;\n  }> {\n    return this.client._request<{\n      user: {\n        first_name: string;\n        username: string;\n        language: string;\n      };\n      access_token: string;\n    }>(\n      \"POST\",\n      \"/api/user/token-refresh/\",\n      undefined,\n      { refresh: refreshToken }\n    );\n  }\n\n  /**\n   * Verifies if a JWT token is valid and returns user information.\n   * @param token - The JWT token to verify\n   * @returns User information if token is valid\n   * @throws {BaserowApiError} If the token is invalid\n   */\n  async verifyToken(token: string): Promise<{ user: { first_name: string; username: string; language: string } }> {\n    return this.client._request<{ user: { first_name: string; username: string; language: string } }>(\n      \"POST\",\n      \"/api/user/token-verify/\",\n      undefined,\n      { token }\n    );\n  }\n\n  /**\n   * Logs out a user by blacklisting their refresh token.\n   * @param refreshToken - The refresh token to blacklist\n   * @throws {BaserowApiError} If the token blacklisting fails\n   */\n  async logout(refreshToken: string): Promise<void> {\n    await this.client._request<void>(\n      \"POST\",\n      \"/api/user/token-blacklist/\",\n      undefined,\n      { refresh: refreshToken }\n    );\n  }\n\n  /**\n   * Creates a new user based on the provided values.\n   * @param options - Object containing user registration fields:\n   *   - name: User's name\n   *   - email: User's email\n   *   - password: User's password\n   *   - language: Optional ISO 639 language code (default: \"en\")\n   *   - authenticate: Whether to generate authentication tokens (default: false)\n   *   - workspaceInvitationToken: Optional workspace invitation token\n   *   - templateId: Optional template ID to install after creating account\n   * @returns Object containing user information and possibly tokens if authenticate is true\n   * @throws {BaserowApiError} If user creation fails\n   */\n  async register(options: {\n    name: string;\n    email: string;\n    password: string;\n    language?: string;\n    authenticate?: boolean;\n    workspaceInvitationToken?: string;\n    templateId?: number;\n  }): Promise<{\n    user: {\n      first_name: string;\n      username: string;\n      language: string;\n    };\n    access_token?: string;\n    refresh_token?: string;\n  }> {\n    return this.client._request<{\n      user: {\n        first_name: string;\n        username: string;\n        language: string;\n      };\n      access_token?: string;\n      refresh_token?: string;\n    }>(\n      \"POST\",\n      \"/api/user/\",\n      undefined,\n      {\n        name: options.name,\n        email: options.email,\n        password: options.password,\n        language: options.language,\n        authenticate: options.authenticate,\n        workspace_invitation_token: options.workspaceInvitationToken,\n        template_id: options.templateId\n      }\n    );\n  }\n\n  /**\n   * Updates the account information of the authenticated user.\n   * @param options - Account fields to update\n   * @returns Updated account information\n   * @throws {BaserowApiError} If update fails\n   */\n  async updateAccount(options: {\n    firstName?: string;\n    language?: string;\n    emailNotificationFrequency?: 'instant' | 'daily' | 'weekly' | 'never';\n    completedOnboarding?: boolean;\n    completedGuidedTours?: string[];\n  }): Promise<{\n    first_name: string;\n    language: string;\n    email_notification_frequency: string;\n    completed_onboarding: boolean;\n    completed_guided_tours: string[];\n  }> {\n    return this.client._request<{\n      first_name: string;\n      language: string;\n      email_notification_frequency: string;\n      completed_onboarding: boolean;\n      completed_guided_tours: string[];\n    }>(\n      \"PATCH\",\n      \"/api/user/account/\",\n      undefined,\n      {\n        first_name: options.firstName,\n        language: options.language,\n        email_notification_frequency: options.emailNotificationFrequency,\n        completed_onboarding: options.completedOnboarding,\n        completed_guided_tours: options.completedGuidedTours\n      }\n    );\n  }\n\n  /**\n   * Changes the password of an authenticated user.\n   * @param oldPassword - Current password\n   * @param newPassword - New password\n   * @throws {BaserowApiError} If password change fails\n   */\n  async changePassword(oldPassword: string, newPassword: string): Promise<void> {\n    await this.client._request<void>(\n      \"POST\",\n      \"/api/user/change-password/\",\n      undefined,\n      { old_password: oldPassword, new_password: newPassword }\n    );\n  }\n\n  /**\n   * Lists all the relevant user information that could be shown on a dashboard.\n   * It will contain all the pending workspace invitations for that user.\n   * @returns Dashboard information including workspace invitations\n   * @throws {BaserowApiError} If request fails\n   */\n  async getDashboard(): Promise<{\n    workspace_invitations: Array<{\n      id: number;\n      invited_by: string;\n      workspace: string;\n      email: string;\n      message: string;\n      created_on: string;\n      email_exists: boolean;\n    }>;\n  }> {\n    return this.client._request<{\n      workspace_invitations: Array<{\n        id: number;\n        invited_by: string;\n        workspace: string;\n        email: string;\n        message: string;\n        created_on: string;\n        email_exists: boolean;\n      }>;\n    }>(\n      \"GET\",\n      \"/api/user/dashboard/\",\n      undefined,\n      undefined\n    );\n  }\n\n  /**\n   * Changes the password of a user if the reset token is valid.\n   * @param token - Password reset token\n   * @param password - New password\n   * @throws {BaserowApiError} If password reset fails\n   */\n  async resetPassword(token: string, password: string): Promise<void> {\n    await this.client._request<void>(\n      \"POST\",\n      \"/api/user/reset-password/\",\n      undefined,\n      { token, password }\n    );\n  }\n\n  /**\n   * Sends an email containing the password reset link to the user's email address.\n   * @param email - User's email address\n   * @param baseUrl - Base URL for the reset link\n   * @throws {BaserowApiError} If sending email fails\n   */\n  async sendPasswordResetEmail(email: string, baseUrl: string): Promise<void> {\n    await this.client._request<void>(\n      \"POST\",\n      \"/api/user/send-reset-password-email/\",\n      undefined,\n      { email, base_url: baseUrl }\n    );\n  }\n\n  /**\n   * Schedules the account deletion of the authenticated user.\n   * @throws {BaserowApiError} If scheduling deletion fails\n   */\n  async scheduleAccountDeletion(): Promise<void> {\n    await this.client._request<void>(\n      \"POST\",\n      \"/api/user/schedule-account-deletion/\",\n      undefined,\n      undefined\n    );\n  }\n\n  /**\n   * Sends an email to the user with an email verification link.\n   * @throws {BaserowApiError} If sending verification email fails\n   */\n  async sendVerifyEmail(): Promise<void> {\n    await this.client._request<void>(\n      \"POST\",\n      \"/api/user/send-verify-email/\",\n      undefined,\n      undefined\n    );\n  }\n\n  /**\n   * Verifies a user's email address with a verification token.\n   * @param token - Email verification token\n   * @returns User information and tokens if unauthenticated\n   * @throws {BaserowApiError} If email verification fails\n   */\n  async verifyEmail(token: string): Promise<{\n    user?: {\n      first_name: string;\n      username: string;\n      language: string;\n    };\n    access_token?: string;\n    refresh_token?: string;\n  }> {\n    return this.client._request<{\n      user?: {\n        first_name: string;\n        username: string;\n        language: string;\n      };\n      access_token?: string;\n      refresh_token?: string;\n    }>(\n      \"POST\",\n      \"/api/user/verify-email/\",\n      undefined,\n      { token }\n    );\n  }\n\n  /**\n   * Undoes the latest undoable action performed by the user.\n   * @param clientSessionId - Client session ID header\n   * @param scopes - Optional scopes to filter actions\n   * @returns Result of the undo operation\n   * @throws {BaserowApiError} If undo fails\n   */\n  async undo(clientSessionId: string, scopes?: {\n    root?: boolean;\n    workspace?: number;\n    application?: number;\n    table?: number;\n    view?: number;\n    teamsInWorkspace?: number;\n  }): Promise<{\n    actions: Array<{\n      action_type: string | null;\n      action_scope: string | null;\n    }>;\n    result_code: string;\n  }> {\n    return this.client._request<{\n      actions: Array<{\n        action_type: string | null;\n        action_scope: string | null;\n      }>;\n      result_code: string;\n    }>(\n      \"PATCH\",\n      \"/api/user/undo/\",\n      { ClientSessionId: clientSessionId },\n      { scopes }\n    );\n  }\n\n  /**\n   * Redoes the latest redoable action performed by the user.\n   * @param clientSessionId - Client session ID header\n   * @param scopes - Optional scopes to filter actions\n   * @returns Result of the redo operation\n   * @throws {BaserowApiError} If redo fails\n   */\n  async redo(clientSessionId: string, scopes?: {\n    root?: boolean;\n    workspace?: number;\n    application?: number;\n    table?: number;\n    view?: number;\n    teamsInWorkspace?: number;\n  }): Promise<{\n    actions: Array<{\n      action_type: string | null;\n      action_scope: string | null;\n    }>;\n    result_code: string;\n  }> {\n    return this.client._request<{\n      actions: Array<{\n        action_type: string | null;\n        action_scope: string | null;\n      }>;\n      result_code: string;\n    }>(\n      \"PATCH\",\n      \"/api/user/redo/\",\n      { ClientSessionId: clientSessionId },\n      { scopes }\n    );\n  }\n} ",
    "import { BaserowClient } from \"./baserow-client\";\n\n/**\n * Operations for managing Baserow SSO authentication.\n */\nexport class SsoOperations {\n  constructor(private client: BaserowClient) {}\n  \n  // SSO methods will be implemented here\n} ",
    "import { BaserowApiError } from \"../types/error\";\nimport type { BaserowClientConfig } from \"../types/client\";\n\n// Import operation classes\nimport { HealthOperations } from \"./health-operations\";\nimport { AdminOperations } from \"./admin-operations\";\nimport { WorkspaceOperations } from \"./workspace-operations\";\nimport { ApplicationOperations } from \"./application-operations\";\nimport { IntegrationOperations } from \"./integration-operations\";\nimport { UserSourceOperations } from \"./user-source-operations\";\nimport { BuilderOperations } from \"./builder-operations\";\nimport { DashboardOperations } from \"./dashboard-operations\";\nimport { DatabaseTableOperations } from \"./database-table-operations\";\nimport { DatabaseFieldOperations } from \"./database-field-operations\";\nimport { DatabaseViewOperations } from \"./database-view-operations\";\nimport { DatabaseRowOperations } from \"./database-row-operations\";\nimport { DatabaseWebhookOperations } from \"./database-webhook-operations\";\nimport { DatabaseTokenOperations } from \"./database-token-operations\";\nimport { UserFileOperations } from \"./user-file-operations\";\nimport { SecureFileOperations } from \"./secure-file-operations\";\nimport { JobOperations } from \"./job-operations\";\nimport { LicenseOperations } from \"./license-operations\";\nimport { NotificationOperations } from \"./notification-operations\";\nimport { RoleAssignmentOperations } from \"./role-assignment-operations\";\nimport { TeamOperations } from \"./team-operations\";\nimport { TemplateOperations } from \"./template-operations\";\nimport { TrashOperations } from \"./trash-operations\";\nimport { UserOperations } from \"./user-operations\";\nimport { SsoOperations } from \"./sso-operations\";\nimport { HeadersInit } from \"bun\";\n\n/**\n * Main Baserow API Client class.\n */\nexport class BaserowClient {\n  private readonly baseUrl: string;\n  private readonly token?: string;\n  private readonly tokenType: \"JWT\" | \"Token\";\n  private readonly defaultHeaders: Record<string, string>;\n\n  // --- API Resource Namespaces ---\n  public readonly health: HealthOperations;\n  public readonly admin: AdminOperations;\n  public readonly workspace: WorkspaceOperations;\n  public readonly applications: ApplicationOperations;\n  public readonly integrations: IntegrationOperations;\n  public readonly userSources: UserSourceOperations;\n  public readonly builder: BuilderOperations;\n  public readonly dashboard: DashboardOperations;\n  public readonly databaseTables: DatabaseTableOperations;\n  public readonly databaseFields: DatabaseFieldOperations;\n  public readonly databaseViews: DatabaseViewOperations;\n  public readonly databaseRows: DatabaseRowOperations;\n  public readonly databaseWebhooks: DatabaseWebhookOperations;\n  public readonly databaseTokens: DatabaseTokenOperations;\n  public readonly userFiles: UserFileOperations;\n  public readonly secureFiles: SecureFileOperations;\n  public readonly jobs: JobOperations;\n  public readonly licenses: LicenseOperations;\n  public readonly notifications: NotificationOperations;\n  public readonly roleAssignments: RoleAssignmentOperations;\n  public readonly teams: TeamOperations;\n  public readonly templates: TemplateOperations;\n  public readonly trash: TrashOperations;\n  public readonly user: UserOperations;\n  public readonly sso: SsoOperations;\n\n  constructor(config: BaserowClientConfig) {\n    if (!config.url) throw new Error(\"Baserow API URL is required.\");\n    this.baseUrl = config.url.endsWith(\"/\")\n      ? config.url.slice(0, -1)\n      : config.url;\n    this.token = config.token;\n    this.tokenType = config.tokenType || \"Token\";\n    this.defaultHeaders = config.defaultHeaders || {};\n\n    // Initialize namespaces\n    this.health = new HealthOperations(this);\n    this.admin = new AdminOperations(this);\n    this.workspace = new WorkspaceOperations(this);\n    this.applications = new ApplicationOperations(this);\n    this.integrations = new IntegrationOperations(this);\n    this.userSources = new UserSourceOperations(this);\n    this.builder = new BuilderOperations(this);\n    this.dashboard = new DashboardOperations(this);\n    this.databaseTables = new DatabaseTableOperations(this);\n    this.databaseFields = new DatabaseFieldOperations(this);\n    this.databaseViews = new DatabaseViewOperations(this);\n    this.databaseRows = new DatabaseRowOperations(this);\n    this.databaseWebhooks = new DatabaseWebhookOperations(this);\n    this.databaseTokens = new DatabaseTokenOperations(this);\n    this.userFiles = new UserFileOperations(this);\n    this.secureFiles = new SecureFileOperations(this);\n    this.jobs = new JobOperations(this);\n    this.licenses = new LicenseOperations(this);\n    this.notifications = new NotificationOperations(this);\n    this.roleAssignments = new RoleAssignmentOperations(this);\n    this.teams = new TeamOperations(this);\n    this.templates = new TemplateOperations(this);\n    this.trash = new TrashOperations(this);\n    this.user = new UserOperations(this);\n    this.sso = new SsoOperations(this);\n  }\n\n  /**\n   * Internal method to make authenticated requests to the Baserow API.\n   * @param method - HTTP method (GET, POST, PATCH, DELETE, PUT).\n   * @param path - API endpoint path (e.g., /api/database/rows/table/1/).\n   * @param queryParams - Optional object for URL query parameters.\n   * @param body - Optional request body for POST/PATCH/PUT requests.\n   * @param additionalHeaders - Optional additional headers.\n   * @returns The parsed JSON response or raw response for non-JSON types.\n   * @throws {BaserowApiError} If the API returns an error status.\n   */\n  async _request<T = any>(\n    method: \"GET\" | \"POST\" | \"PATCH\" | \"DELETE\" | \"PUT\",\n    path: string,\n    queryParams?: Record<\n      string,\n      string | number | boolean | string[] | undefined | null\n    >,\n    body?: any,\n    additionalHeaders?: Record<string, string>\n  ): Promise<T> {\n    const url = new URL(path.startsWith(\"/\") ? path : `/${path}`, this.baseUrl);\n\n    // Append query parameters\n    if (queryParams) {\n      Object.entries(queryParams).forEach(([key, value]) => {\n        if (value !== undefined && value !== null) {\n          if (Array.isArray(value)) {\n            // Handle array query parameters by appending multiple times\n            value.forEach((item) => url.searchParams.append(key, String(item)));\n          } else {\n            url.searchParams.set(key, String(value));\n          }\n        }\n      });\n    }\n\n    const headersObj: Record<string, string> = {\n      ...this.defaultHeaders,\n      ...additionalHeaders,\n    };\n    if (this.token) {\n      headersObj[\"Authorization\"] = `${this.tokenType} ${this.token}`;\n    }\n    const headers = new Headers(headersObj);\n\n    const options: RequestInit = {\n      method,\n      headers,\n    };\n\n    if (body) {\n      if (body instanceof FormData) {\n        options.body = body;\n      } else {\n        headers.set(\"Content-Type\", \"application/json\");\n        options.body = JSON.stringify(body);\n      }\n    }\n\n    try {\n      const response = await fetch(url.toString(), options);\n\n      if (!response.ok) {\n        let errorData: any = null;\n        let errorMessage = `API Error: ${response.status} ${response.statusText}`;\n        try {\n          // Try to parse JSON error response from Baserow\n          errorData = await response.json();\n          errorMessage = `Baserow API Error (${response.status}): ${\n            errorData?.error || response.statusText\n          }`;\n        } catch (e) {\n          // If response is not JSON, use the status text\n        }\n        throw new BaserowApiError(\n          errorMessage,\n          response.status,\n          errorData?.error,\n          errorData?.detail\n        );\n      }\n\n      // Handle different response types\n      const contentType = response.headers.get(\"content-type\");\n      if (response.status === 204) {\n        // No Content\n        return undefined as T;\n      } else if (contentType?.includes(\"application/json\")) {\n        return (await response.json()) as T;\n      } else if (contentType?.includes(\"text/calendar\")) {\n        return (await response.text()) as T; // For iCal feeds\n      } else if (contentType?.includes(\"application/octet-stream\")) {\n        // For file downloads, return the response object directly\n        // so the consumer can handle the stream/blob\n        return response as T;\n      } else {\n        // For other text-based types or unknown types, return text\n        return (await response.text()) as T;\n      }\n    } catch (error) {\n      if (error instanceof BaserowApiError) {\n        throw error;\n      }\n      // Network errors or other fetch issues\n      console.error(\"Network or fetch error:\", error);\n      throw new Error(\n        `Network request failed: ${\n          error instanceof Error ? error.message : String(error)\n        }`\n      );\n    }\n  }\n} ",
    "import { BaserowClient } from '../../client/baserow-client';\nimport type { Field, Table } from '../../types/database';\nimport { writeFileSync, mkdirSync, existsSync } from 'fs';\nimport { join, dirname } from 'path';\nimport type { ResolvedConfig } from '../config/types';\nimport { AuthError } from '../utils/client';\n\n/**\n * Represents a select option for a Baserow field.\n */\ninterface SelectOption {\n  value: string;\n  color: string;\n  id: number;\n}\n\n/**\n * Represents a Baserow field with select options.\n */\ninterface FieldWithOptions extends Field {\n  select_options?: SelectOption[];\n}\n\n/**\n * Maps a Baserow field to a TypeScript type.\n * @param field The field to map.\n * @returns The TypeScript type as a string.\n */\nfunction generateTypeForField(field: FieldWithOptions): string {\n  // Map Baserow field types to TypeScript types\n  switch (field.type) {\n    case 'text':\n    case 'long_text':\n    case 'url':\n    case 'email':\n    case 'phone_number':\n      return 'string';\n    case 'number':\n    case 'rating':\n      return 'number';\n    case 'boolean':\n      return 'boolean';\n    case 'date':\n      return 'Date';\n    case 'file':\n      return '{ url: string; name: string; }[]';\n    case 'single_select':\n      return field.select_options?.map((opt: SelectOption) => `'${opt.value}'`).join(' | ') || 'string';\n    case 'multiple_select':\n      return `Array<${field.select_options?.map((opt: SelectOption) => `'${opt.value}'`).join(' | ') || 'string'}>`;\n    case 'link_row':\n      return `number[]`; // Array of related row IDs\n    default:\n      return 'any';\n  }\n}\n\n/**\n * Sanitizes a field name for use as a TypeScript property\n * @param name The field name to sanitize\n * @returns A sanitized, properly quoted field name\n */\nfunction sanitizeFieldName(name: string): string {\n  // If the name contains spaces, special characters, or starts with a number,\n  // wrap it in quotes to make it a valid TypeScript property name\n  if (!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name)) {\n    // Escape any quotes in the name\n    const escapedName = name.replace(/'/g, \"\\\\'\");\n    return `'${escapedName}'`;\n  }\n  return name;\n}\n\n/**\n * Generates a TypeScript interface for a Baserow table.\n * @param table The table definition.\n * @param fields The fields of the table.\n * @returns The TypeScript interface as a string.\n */\nfunction generateInterfaceForTable(table: Table, fields: Field[]): string {\n  const fieldDefinitions = fields\n    .map(field => {\n      const isOptional = !field.primary && field.type !== 'formula';\n      const fieldName = sanitizeFieldName(field.name);\n      return `  ${fieldName}${isOptional ? '?' : ''}: ${generateTypeForField(field as FieldWithOptions)};`;\n    })\n    .join('\\n');\n\n  // Create a valid TypeScript interface name by removing non-alphanumeric characters\n  const interfaceName = table.name.replace(/[^a-zA-Z0-9]/g, '') + 'Row';\n\n  return `export interface ${interfaceName} {\n  id: number;\n  order: string;\n${fieldDefinitions}\n}`;\n}\n\n/**\n * Ensures a directory exists, creating it if necessary\n * @param path Directory path to ensure exists\n */\nfunction ensureDirectoryExists(path: string): void {\n  const dir = dirname(path);\n  if (!existsSync(dir)) {\n    // Create the directory recursively (like mkdir -p)\n    mkdirSync(dir, { recursive: true });\n  }\n}\n\n/**\n * Generates TypeScript types from a Baserow database.\n *\n * @param config The resolved configuration for Baserow connection and output.\n * @param options Optional settings: { writeToDisk?: boolean }.\n * @returns The generated type definitions as a string.\n * @throws If required configuration is missing or an error occurs during generation.\n */\nexport async function generateTypes(\n  config: ResolvedConfig,\n  options?: { writeToDisk?: boolean }\n): Promise<string> {\n  try {\n    if (!config.url || !config.token || !config.database) {\n      throw new Error('Missing required configuration: url, token, and database are required');\n    }\n\n    const client = new BaserowClient({\n      url: config.url,\n      token: config.token,\n      tokenType: config.tokenType\n    });\n\n    // Try to fetch tables\n    let tables;\n    try {\n      tables = await client.databaseTables.list(parseInt(config.database));\n    } catch (err: any) {\n      // Check for auth error\n      if (\n        err instanceof AuthError ||\n        (err && err.message && (\n          err.message.includes('401') ||\n          err.message.includes('403') ||\n          err.message.toLowerCase().includes('unauthorized') ||\n          err.message.toLowerCase().includes('jwt') ||\n          err.message.toLowerCase().includes('token')\n        ))\n      ) {\n        throw new Error(\n          'Authentication failed: Generating types requires a valid JWT token. ' +\n          'Please run `baserow login` to obtain a JWT token and try again.'\n        );\n      }\n      throw err;\n    }\n\n    let typeDefinitions = '// Generated by baserow-cli\\n\\n';\n\n    // Filter tables if specific ones are requested\n    const tablesToProcess = config.tables?.length\n      ? tables.filter(t => config.tables?.includes(t.name))\n      : tables;\n\n    // For each table, fetch its fields and generate an interface\n    for (const table of tablesToProcess) {\n      const fields = await client.databaseFields.list(table.id);\n      typeDefinitions += generateInterfaceForTable(table, fields) + '\\n\\n';\n    }\n\n    if (options?.writeToDisk !== false) {\n      // Determine output path\n      const outputPath = config.output?.startsWith('/')\n        ? config.output\n        : join(process.cwd(), config.output || 'baserow-types.ts');\n      \n      // Ensure the directory exists\n      ensureDirectoryExists(outputPath);\n      \n      // Write the type definitions file\n      writeFileSync(outputPath, typeDefinitions);\n    }\n\n    return typeDefinitions;\n  } catch (error) {\n    throw error;\n  }\n} ",
    "import * as fs from 'fs';\nimport * as path from 'path';\nimport * as os from 'os';\n\ninterface BaserowConfig {\n  projectName?: string;\n  url?: string;\n  token?: string;\n  tokenType?: 'JWT' | 'Token';\n  refreshToken?: string;\n  databaseId?: string;\n  outputPath?: string;\n  tables?: string[];\n}\n\nlet cachedConfig: BaserowConfig | null = null;\n\n/**\n * Parse JSONC content\n */\nasync function parseJsonc(filePath: string): Promise<any> {\n  // Check if running in Bun\n  if (typeof process.versions.bun !== 'undefined') {\n    try {\n      // Use Bun's native JSONC support\n      const module = await import(filePath);\n      return module.default;\n    } catch (error) {\n      // If dynamic import fails, fall back to reading the file\n      console.warn('Could not parse JSONC file at ' + filePath + ': ' + error);\n    }\n  }\n}\n\n/**\n * Get configuration from .baserowrc.jsonc file\n */\nexport async function getConfig(): Promise<BaserowConfig> {\n  if (cachedConfig) {\n    return cachedConfig;\n  }\n\n  try {\n    const configPath = path.join(process.cwd(), '.baserowrc.jsonc');\n    const homeConfigPath = path.join(os.homedir(), '.baserowrc.jsonc');\n\n    let config: BaserowConfig = {};\n    \n    // First load global config if it exists\n    if (fs.existsSync(homeConfigPath)) {\n      config = await parseJsonc(homeConfigPath);\n    }\n    \n    // Then load local config if it exists (overriding global config)\n    if (fs.existsSync(configPath)) {\n      const localConfig = await parseJsonc(configPath);\n      \n      // Merge configs with local taking priority\n      config = { ...config, ...localConfig };\n    }\n    \n    cachedConfig = config;\n    return config;\n  } catch (error) {\n    console.error('Error loading config:', error);\n    return {};\n  }\n}\n\n/**\n * Get a specific configuration value\n */\nexport async function getConfigValue(key: string): Promise<any> {\n  const config = await getConfig();\n  return config[key as keyof BaserowConfig];\n}\n\n/**\n * Set a configuration value\n */\nexport async function setConfigValue(key: string, value: any): Promise<void> {\n  const config = await getConfig();\n  config[key as keyof BaserowConfig] = value;\n  \n  const configPath = path.join(process.cwd(), '.baserowrc.jsonc');\n  fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');\n  \n  // Reset cache\n  cachedConfig = null;\n} ",
    "import { homedir } from 'os';\nimport { join } from 'path';\nimport { readFileSync, writeFileSync, existsSync } from 'fs';\nimport type { BaserowConfig, ProjectConfig, GlobalProjectConfig } from './types';\n\nexport class ConfigManager {\n  private static instance: ConfigManager;\n  private globalConfigPath: string;\n  private localConfigPath: string;\n\n  private constructor() {\n    this.globalConfigPath = join(homedir(), '.baserowrc.jsonc');\n    this.localConfigPath = '.baserowrc.jsonc';\n  }\n\n  public static getInstance(): ConfigManager {\n    if (!ConfigManager.instance) {\n      ConfigManager.instance = new ConfigManager();\n    }\n    return ConfigManager.instance;\n  }\n\n  private readJsonFile<T>(path: string): T | null {\n    try {\n      if (!existsSync(path)) return null;\n      const content = readFileSync(path, 'utf-8');\n      // Remove comments before parsing\n      const jsonContent = content.replace(/\\\\\"|\"(?:\\\\\"|[^\"])*\"|(\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\/)/g, (m, g) => g ? '' : m);\n      return JSON.parse(jsonContent) as T;\n    } catch (error) {\n      return null;\n    }\n  }\n\n  private writeJsonFile(path: string, data: any, template: boolean = false): void {\n    if (!template) {\n      writeFileSync(path, JSON.stringify(data, null, 2));\n      return;\n    }\n\n    // Create a well-documented template\n    const content = `{\n  // Project name - Used to identify this project in the global config\n  \"name\": \"${data.name}\",\n\n  // Baserow instance URL (required for API operations)\n  // Examples:\n  //   - Self-hosted: \"http://localhost:3000\"\n  //   - Cloud: \"https://api.baserow.io\"\n  // \"url\": \"https://api.baserow.io\",\n\n  // API token for authentication (required for API operations)\n  // Generate this in your Baserow account settings\n  // Example: \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...\"\n  // \"token\": \"\",\n\n  // Database ID to use for operations (required for table operations)\n  // Find this in the URL when viewing your database\n  // Example: \"12345\"\n  // \"database\": \"\",\n\n  // Output path for generated TypeScript types\n  // Relative to the project root or absolute path\n  \"output\": \"./types/baserow.ts\",\n\n  // Optional: Specific tables to include when generating types\n  // If not specified, all tables will be included\n  // \"tables\": [\n  //   \"Customers\",\n  //   \"Orders\",\n  //   \"Products\"\n  // ]\n}`;\n    writeFileSync(path, content);\n  }\n\n  public getGlobalConfig(): BaserowConfig {\n    return this.readJsonFile<BaserowConfig>(this.globalConfigPath) || { projects: {} };\n  }\n\n  public getLocalConfig(): ProjectConfig | null {\n    return this.readJsonFile<ProjectConfig>(this.localConfigPath);\n  }\n\n  public getCurrentProjectConfig(): ProjectConfig | null {\n    const localConfig = this.getLocalConfig();\n    if (localConfig) {\n      return localConfig;\n    }\n\n    // If no local config, try to find the current directory in global config\n    const globalConfig = this.getGlobalConfig();\n    const currentDir = process.cwd();\n    \n    const projects = Object.entries(globalConfig.projects || {});\n    for (const [, project] of projects) {\n      if (project.path === currentDir) {\n        const { path, ...projectConfig } = project;\n        return projectConfig;\n      }\n    }\n\n    return null;\n  }\n\n  public resolveConfig(cliOptions: Record<string, any> = {}): ProjectConfig {\n    // Start with any CLI options\n    let config: Partial<ProjectConfig> = { ...cliOptions };\n\n    // Add local config (takes precedence over global)\n    const localConfig = this.getLocalConfig();\n    if (localConfig) {\n      config = { ...config, ...localConfig };\n    }\n\n    // If no local config, try to find in global config\n    if (!localConfig) {\n      const currentDir = process.cwd();\n      const globalConfig = this.getGlobalConfig();\n      \n      const projects = Object.entries(globalConfig.projects || {});\n      for (const [, project] of projects) {\n        if (project.path === currentDir) {\n          const { path, ...projectConfig } = project;\n          config = { ...config, ...projectConfig };\n          break;\n        }\n      }\n    }\n\n    return config as ProjectConfig;\n  }\n\n  public saveGlobalConfig(config: BaserowConfig): void {\n    this.writeJsonFile(this.globalConfigPath, config);\n  }\n\n  public saveLocalConfig(config: ProjectConfig): void {\n    this.writeJsonFile(this.localConfigPath, config);\n  }\n\n  public async initializeProject(name?: string): Promise<void> {\n    const currentDir = process.cwd();\n    const projectName = name || currentDir.split('/').pop() || 'baserow-project';\n\n    // Create local config with template\n    const localConfig: ProjectConfig = {\n      name: projectName,\n      output: './types/baserow.ts'\n    };\n    this.writeJsonFile(this.localConfigPath, localConfig, true);\n\n    // Update global config\n    const globalConfig = this.getGlobalConfig();\n    const globalProjectConfig: GlobalProjectConfig = {\n      ...localConfig,\n      path: currentDir\n    };\n    \n    globalConfig.projects = globalConfig.projects || {};\n    globalConfig.projects[projectName] = globalProjectConfig;\n    this.saveGlobalConfig(globalConfig);\n  }\n}",
    "import { ConfigManager } from '../config/manager';\nimport type { OutputFormat } from '../utils/output';\nimport type { BaserowConfig, ProjectConfig } from '../config/types';\n\n/** @typedef {import('../utils/output').OutputFormat} OutputFormat */\n\n/**\n * @typedef {Object} ConfigSetOptions\n * @property {boolean} [global]\n * @property {OutputFormat} [format]\n */\n\nexport interface ConfigSetOptions {\n  global?: boolean;\n  format?: OutputFormat;\n}\n\n/**\n * Sets a configuration value.\n * @param key The configuration key\n * @param value The value to set\n * @param options Configuration options\n * @returns A message indicating the result\n */\nexport async function configSet(key: string, value: string, options: ConfigSetOptions = {}): Promise<string> {\n  const config = ConfigManager.getInstance();\n  if (options.global) {\n    const globalConfig = config.getGlobalConfig();\n    let current: any = globalConfig;\n    const keys = key.split('.');\n    if (keys.length === 0) {\n      throw new Error('Invalid key provided');\n    }\n    for (let i = 0; i < keys.length - 1; i++) {\n      const k = keys[i];\n      if (k && !(k in current)) {\n        current[k] = {};\n      }\n      if (k) {\n        current = current[k];\n      }\n    }\n    const lastKey = keys[keys.length - 1];\n    if (lastKey) {\n      current[lastKey] = value;\n    }\n    config.saveGlobalConfig(globalConfig);\n    return `Set global config ${key}=${value}`;\n  } else {\n    const localConfig = config.getLocalConfig() || {\n      name: process.cwd().split('/').pop() || 'baserow-project'\n    };\n    const validConfigKeys = [\n      'url', 'token', 'tokenType', 'refreshToken', 'database', \n      'output', 'tables', 'userEmail', 'userFirstName'\n    ];\n    if (key in localConfig || validConfigKeys.includes(key)) {\n      (localConfig as any)[key] = value;\n    } else {\n      throw new Error(`Invalid local config key: ${key}`);\n    }\n    config.saveLocalConfig(localConfig);\n    return `Set local config ${key}=${value}`;\n  }\n}\n\n/**\n * Gets a configuration value or the full config object.\n * @param key The configuration key (optional)\n * @param options Configuration options\n * @returns The config value, or the full config object if no key is provided\n */\nexport async function configGet(key?: string, options: ConfigSetOptions = {}): Promise<any> {\n  const config = ConfigManager.getInstance();\n  const currentConfig = options.global ? \n    config.getGlobalConfig() : \n    (config.getLocalConfig() || { name: process.cwd().split('/').pop() || 'baserow-project' });\n  console.log('Current config:', currentConfig);\n  if (!key) {\n    return currentConfig;\n  }\n  const keys = key.split('.');\n  let value: any = currentConfig;\n  for (const k of keys) {\n    if (value && typeof value === 'object' && k) {\n      value = value[k];\n    } else {\n      value = undefined;\n      break;\n    }\n  }\n  if (value === undefined) {\n    throw new Error(`Configuration key \"${key}\" not found`);\n  }\n  return value;\n}\n\n/**\n * Initializes a new project configuration.\n * @param name Optional project name\n * @returns A message indicating the result\n */\nexport async function configInit(name?: string): Promise<string> {\n  const config = ConfigManager.getInstance();\n  await config.initializeProject(name);\n  return 'Initialized project configuration';\n} ",
    "export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n    return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n        let code = p.charCodeAt(0).toString(16).toUpperCase();\n        if (code.length < 2) {\n            code = \"0\" + code;\n        }\n        return \"%\" + code;\n    }));\n}\nfunction base64UrlDecode(str) {\n    let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n    switch (output.length % 4) {\n        case 0:\n            break;\n        case 2:\n            output += \"==\";\n            break;\n        case 3:\n            output += \"=\";\n            break;\n        default:\n            throw new Error(\"base64 string is not of the correct length\");\n    }\n    try {\n        return b64DecodeUnicode(output);\n    }\n    catch (err) {\n        return atob(output);\n    }\n}\nexport function jwtDecode(token, options) {\n    if (typeof token !== \"string\") {\n        throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n    }\n    options || (options = {});\n    const pos = options.header === true ? 0 : 1;\n    const part = token.split(\".\")[pos];\n    if (typeof part !== \"string\") {\n        throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n    }\n    let decoded;\n    try {\n        decoded = base64UrlDecode(part);\n    }\n    catch (e) {\n        throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n    }\n    try {\n        return JSON.parse(decoded);\n    }\n    catch (e) {\n        throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n    }\n}\n",
    "import { BaserowClient } from '../../client';\nimport { getConfig } from './config';\nimport { configSet } from '../commands/config';\nimport { UserOperations } from '../../client/user-operations';\nimport { jwtDecode } from 'jwt-decode';\nimport { BaserowApiError } from '../../types/error';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as os from 'os';\n\nlet cachedClient: BaserowClient | null = null;\n\n// Track refresh token error state\nconst ERROR_STATE_FILE = path.join(os.homedir(), '.baserow_error_state');\n\n/**\n * Custom error class for authentication issues\n */\nexport class AuthError extends Error {\n  constructor(message: string) {\n    super(message);\n    this.name = 'AuthError';\n  }\n}\n\n/**\n * Save error state to remember refresh token failures\n */\nasync function saveErrorState(message: string): Promise<void> {\n  try {\n    fs.writeFileSync(ERROR_STATE_FILE, message);\n  } catch (err) {\n    // Silently fail if we can't write the error state\n  }\n}\n\n/**\n * Read error state if it exists\n */\nfunction readErrorState(): string | null {\n  try {\n    if (fs.existsSync(ERROR_STATE_FILE)) {\n      return fs.readFileSync(ERROR_STATE_FILE, 'utf8');\n    }\n  } catch (err) {\n    // Silently fail if we can't read the error state\n  }\n  return null;\n}\n\n/**\n * Clear error state if it exists\n */\nfunction clearErrorState(): void {\n  try {\n    if (fs.existsSync(ERROR_STATE_FILE)) {\n      fs.unlinkSync(ERROR_STATE_FILE);\n    }\n  } catch (err) {\n    // Silently fail if we can't delete the error state\n  }\n}\n\n/**\n * Decode JWT token to get expiration time\n */\nfunction getTokenExpiration(token: string): number | null {\n  try {\n    const decoded: any = jwtDecode(token);\n    return decoded.exp ? decoded.exp * 1000 : null; // Convert to milliseconds\n  } catch (err) {\n    // Don't log error, just return null\n    return null;\n  }\n}\n\n/**\n * Check if token is expired or about to expire (within 30 seconds)\n */\nfunction isTokenExpired(token: string): boolean {\n  const expiration = getTokenExpiration(token);\n  if (!expiration) return false;\n  \n  // Consider token expired if it expires within 30 seconds\n  return Date.now() > (expiration - 30000);\n}\n\n/**\n * Clear authentication credentials from config when token becomes invalid\n */\nasync function clearAuthCredentials(): Promise<void> {\n  // Clear tokens from config\n  await configSet('token', '', { global: true });\n  await configSet('refreshToken', '', { global: true });\n  cachedClient = null;\n}\n\n/**\n * Refresh the access token using refresh token\n */\nasync function refreshAccessToken(client: BaserowClient, refreshToken: string): Promise<string> {\n  try {\n    const userOperations = new UserOperations(client);\n    const response = await userOperations.refreshToken(refreshToken);\n    \n    // Update token in config\n    await configSet('token', response.access_token, { global: true });\n    \n    // Clear any previous error state since refresh succeeded\n    clearErrorState();\n    \n    return response.access_token;\n  } catch (err: unknown) {\n    // Specifically handle invalid refresh token error\n    if (err instanceof BaserowApiError && err.code === 'ERROR_INVALID_REFRESH_TOKEN') {\n      console.log('Refresh token is invalid or has expired.');\n      \n      // Clear invalid credentials\n      await clearAuthCredentials();\n      \n      // Save the error state to persist between runs\n      const errorMessage = 'Refresh token invalid or expired. Please login again.';\n      await saveErrorState(errorMessage);\n      \n      // Throw specific error for invalid refresh token\n      throw new AuthError(errorMessage);\n    }\n    \n    // Rethrow any other errors\n    if (err instanceof Error) {\n      throw new AuthError(`Authentication failed: ${err.message}`);\n    } else {\n      throw new AuthError('Authentication failed: An unknown error occurred');\n    }\n  }\n}\n\n/**\n * Create an enhanced Baserow client with auto token refresh\n */\nasync function createEnhancedClient(config: any): Promise<BaserowClient> {\n  const client = new BaserowClient({\n    url: config.url,\n    token: config.token,\n    tokenType: config.tokenType || 'JWT',\n  });\n\n  // Patch the _request method to handle automatic token refresh\n  const originalRequest = client._request.bind(client);\n  client._request = async function<T>(\n    method: any,\n    path: string,\n    queryParams?: any,\n    body?: any,\n    additionalHeaders?: any\n  ): Promise<T> {\n    try {\n      // Try the original request\n      return await originalRequest<T>(method, path, queryParams, body, additionalHeaders);\n    } catch (err) {\n      // If authentication error and we have a refresh token, try refreshing\n      if (\n        err instanceof BaserowApiError && \n        (err.status === 401 || err.status === 403) && \n        config.refreshToken\n      ) {\n        let newToken;\n        try {\n          newToken = await refreshAccessToken(client, config.refreshToken);\n          \n          // Update client token\n          (client as any).token = newToken;\n          \n          // Retry the request with the new token\n          return await originalRequest<T>(method, path, queryParams, body, additionalHeaders);\n        } catch (refreshErr) {\n          // If it's an AuthError with a specific message, preserve the error and save state\n          if (refreshErr instanceof AuthError) {\n            // Save the error state to persist between runs\n            await saveErrorState(refreshErr.message);\n            throw refreshErr;\n          }\n          \n          // For other errors, convert to AuthError and save state\n          const errorMessage = refreshErr instanceof Error \n            ? `Authentication failed: ${refreshErr.message}`\n            : 'Authentication failed. Please login again.';\n          \n          await saveErrorState(errorMessage);\n          throw new AuthError(errorMessage);\n        }\n      }\n      \n      // If it wasn't an auth error or no refresh token available, rethrow\n      throw err;\n    }\n  };\n\n  return client;\n}\n\n/**\n * Get or create a Baserow client instance using configuration\n */\nexport async function getClient(): Promise<BaserowClient> {\n  try {\n    // Check for saved error state first\n    const errorState = readErrorState();\n    if (errorState) {\n      throw new AuthError(errorState);\n    }\n    \n    const config = await getConfig();\n    if (!config.url || !config.token) {\n      throw new AuthError('Not authenticated. Please login first.');\n    }\n\n    // Clear error state when we have valid credentials\n    // This handles the case where user logged in again after error\n    clearErrorState();\n\n    // Check if token is expired and we have a refresh token\n    if (config.tokenType === 'JWT' && config.token && config.refreshToken && isTokenExpired(config.token)) {\n      console.log('Access token expired, attempting to refresh...');\n      \n      try {\n        // Create a temporary client just for refreshing the token\n        const tempClient = new BaserowClient({\n          url: config.url,\n          token: config.token,\n          tokenType: config.tokenType || 'JWT',\n        });\n        \n        // This will throw if refresh fails\n        const newToken = await refreshAccessToken(tempClient, config.refreshToken);\n        \n        // Update the token in the config\n        config.token = newToken;\n      } catch (refreshError) {\n        // Directly rethrow AuthErrors which will have the specific message\n        if (refreshError instanceof AuthError) {\n          throw refreshError;\n        }\n        \n        // Convert other errors to a generic auth error\n        if (refreshError instanceof Error) {\n          throw new AuthError(`Failed to refresh token: ${refreshError.message}`);\n        } else {\n          throw new AuthError('Failed to refresh token: An unknown error occurred');\n        }\n      }\n    }\n\n    // Create or update cached client with latest token\n    if (!cachedClient) {\n      // Create new enhanced client with auto-refresh capability\n      cachedClient = await createEnhancedClient(config);\n    } else if ((cachedClient as any).token !== config.token) {\n      // If token has changed, create a new client\n      cachedClient = await createEnhancedClient(config);\n    }\n\n    return cachedClient;\n  } catch (err) {\n    // Rethrow authentication errors\n    if (err instanceof AuthError) {\n      throw err;\n    }\n    \n    // Convert other errors to authentication errors\n    if (err instanceof Error) {\n      throw new AuthError(`Failed to create client: ${err.message}`);\n    } else {\n      throw new AuthError('Failed to create client: An unknown error occurred');\n    }\n  }\n}\n\n/**\n * A test function to simulate a refresh token error\n * This is just for debugging purposes\n */\nexport async function testRefreshTokenError(): Promise<void> {\n  try {\n    // Simulate a refresh token error\n    const fakeError = new BaserowApiError('Refresh token is invalid or expired', 401, 'ERROR_INVALID_REFRESH_TOKEN');\n    throw fakeError;\n  } catch (err) {\n    if (err instanceof BaserowApiError && err.code === 'ERROR_INVALID_REFRESH_TOKEN') {\n      // Clear invalid credentials\n      await clearAuthCredentials();\n      \n      // Throw specific error for invalid refresh token\n      throw new AuthError('Refresh token invalid or expired. Please login again.');\n    }\n    \n    throw err;\n  }\n} ",
    "import * as readline from 'readline';\nimport { BaserowClient } from '../../client/baserow-client';\nimport { UserOperations } from '../../client/user-operations';\nimport { ConfigManager } from '../config/manager';\nimport { configSet } from './config';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as os from 'os';\n\n// Define the error state file path (must match the one in client.ts)\nconst ERROR_STATE_FILE = path.join(os.homedir(), '.baserow_error_state');\n\n/**\n * Clear error state if it exists\n */\nfunction clearErrorState(): void {\n  try {\n    if (fs.existsSync(ERROR_STATE_FILE)) {\n      fs.unlinkSync(ERROR_STATE_FILE);\n    }\n  } catch (err) {\n    // Silently fail if we can't delete the error state\n  }\n}\n\n/**\n * Creates a readline interface for handling user input\n */\nfunction createReadlineInterface() {\n  return readline.createInterface({\n    input: process.stdin,\n    output: process.stdout\n  });\n}\n\n/**\n * Prompts the user for input with the given question\n */\nfunction prompt(rl: readline.Interface, question: string): Promise<string> {\n  return new Promise((resolve) => {\n    rl.question(question, (answer) => {\n      resolve(answer);\n    });\n  });\n}\n\n/**\n * Prompts the user for a password with masked input\n */\nfunction promptPassword(rl: readline.Interface, question: string): Promise<string> {\n  return new Promise((resolve) => {\n    // First output the prompt manually\n    process.stdout.write(question);\n    \n    // Configure stdin to disable automatic printing of user input\n    const stdin = process.stdin;\n    const isRaw = stdin.isRaw;\n    if (!isRaw) {\n      stdin.setRawMode && stdin.setRawMode(true);\n    }\n    \n    let password = '';\n    \n    // Handle keypress events\n    const onKeypress = (char: any, key: any) => {\n      // Ctrl+C or Ctrl+D\n      if ((key && key.ctrl && key.name === 'c') || \n          (key && key.ctrl && key.name === 'd') || \n          (key && key.name === 'return')) {\n        stdin.removeListener('data', onData);\n        stdin.setRawMode && stdin.setRawMode(isRaw);\n        process.stdout.write('\\n');\n        resolve(password);\n      } else if (key && key.name === 'backspace') {\n        if (password.length > 0) {\n          password = password.slice(0, -1);\n          process.stdout.write('\\b \\b'); // Erase last character\n        }\n      } else if (char) {\n        password += char;\n        process.stdout.write('*'); // Show asterisk for each character\n      }\n    };\n    \n    // Data event handler\n    const onData = (data: Buffer) => {\n      const char = data.toString();\n      // For each character in the buffer\n      for (let i = 0; i < char.length; i++) {\n        onKeypress(char[i], {\n          name: char[i] === '\\r' || char[i] === '\\n' ? 'return' : \n                char[i] === '\\u0008' || char[i] === '\\u007F' ? 'backspace' : 'other'\n        });\n      }\n    };\n    \n    stdin.on('data', onData);\n  });\n}\n\n/**\n * Handles user login to Baserow.\n * @param options Command options including local flag and optional URL\n * @param credentials Optionally provide credentials for programmatic use\n * @returns An object with user info and config location\n * @throws If authentication fails or required info is missing\n */\nexport async function login(\n  options?: { local?: boolean; url?: string },\n  credentials?: { email: string; password: string }\n): Promise<{\n  user: { username: string; first_name: string };\n  configLocation: string;\n  url: string;\n}> {\n  clearErrorState();\n  const config = ConfigManager.getInstance();\n  const resolvedConfig = config.resolveConfig({});\n  const useGlobalConfig = !options?.local;\n  let url = options?.url || resolvedConfig.url;\n  let email: string | undefined;\n  let password: string | undefined;\n  if (credentials) {\n    email = credentials.email;\n    password = credentials.password;\n  }\n  if (!url) {\n    throw new Error('URL is required');\n  }\n  if (!email || !password) {\n    throw new Error('Email and password are required');\n  }\n  const client = new BaserowClient({\n    url,\n  });\n  const userOperations = new UserOperations(client);\n  const authResponse = await userOperations.login(email, password);\n  const authConfigOptions = { global: useGlobalConfig };\n  const urlConfigOptions = { global: !options?.local };\n  await configSet('token', authResponse.access_token, authConfigOptions);\n  await configSet('refreshToken', authResponse.refresh_token, authConfigOptions);\n  await configSet('tokenType', 'JWT', authConfigOptions);\n  await configSet('userEmail', authResponse.user.username, authConfigOptions);\n  await configSet('userFirstName', authResponse.user.first_name, authConfigOptions);\n  await configSet('url', url, urlConfigOptions);\n  const configLocationMsg = useGlobalConfig\n    ? 'Authentication credentials stored in global config (~/.baserowrc.jsonc)'\n    : 'Authentication credentials stored in local project config (.baserowrc.jsonc)';\n  return {\n    user: {\n      username: authResponse.user.username,\n      first_name: authResponse.user.first_name\n    },\n    configLocation: configLocationMsg,\n    url\n  };\n} ",
    "import { BaserowClient } from '../../client/baserow-client';\nimport { UserOperations } from '../../client/user-operations';\nimport { ConfigManager } from '../config/manager';\nimport { configSet } from './config';\nimport type { GlobalProjectConfig } from '../config/types';\n\n/**\n * Handles user logout from Baserow.\n * @param options Command options including local flag\n * @returns An object with status and config location\n * @throws If logout fails\n */\nexport async function logout(options?: { local?: boolean }): Promise<{\n  status: 'success' | 'not_logged_in';\n  location: string;\n  message: string;\n}> {\n  const config = ConfigManager.getInstance();\n  const useGlobalConfig = !options?.local;\n  const configOptions = { global: useGlobalConfig };\n  let resolvedConfig;\n  if (useGlobalConfig) {\n    const globalConfig = config.getGlobalConfig();\n    const currentDir = process.cwd();\n    let projectConfig: GlobalProjectConfig | undefined;\n    const projects = Object.entries(globalConfig.projects || {});\n    for (const [, project] of projects) {\n      if (project.path === currentDir) {\n        projectConfig = project;\n        break;\n      }\n    }\n    resolvedConfig = projectConfig || {};\n  } else {\n    resolvedConfig = config.getLocalConfig() || {};\n  }\n  if (!resolvedConfig.token) {\n    const location = useGlobalConfig ? 'global' : 'local';\n    return {\n      status: 'not_logged_in',\n      location,\n      message: `Not currently logged in (no token found in ${location} config)`\n    };\n  }\n  const refreshToken = resolvedConfig.refreshToken;\n  const tokenType = resolvedConfig.tokenType;\n  try {\n    if (refreshToken && resolvedConfig.url && tokenType === 'JWT') {\n      const client = new BaserowClient({\n        url: resolvedConfig.url,\n        token: resolvedConfig.token,\n        tokenType: 'JWT'\n      });\n      const userOperations = new UserOperations(client);\n      try {\n        await userOperations.logout(refreshToken);\n      } catch (err) {\n        // If token blacklisting fails, just continue with local cleanup\n      }\n    }\n    await configSet('token', '', configOptions);\n    await configSet('refreshToken', '', configOptions);\n    await configSet('userEmail', '', configOptions);\n    await configSet('userFirstName', '', configOptions);\n    const location = useGlobalConfig ? 'global' : 'local';\n    return {\n      status: 'success',\n      location,\n      message: `Successfully logged out (removed credentials from ${location} config)`\n    };\n  } catch (err: unknown) {\n    if (err instanceof Error) {\n      throw new Error(`Logout failed: ${err.message}`);\n    } else {\n      throw new Error('Logout failed: An unknown error occurred');\n    }\n  }\n} ",
    "import { getClient, AuthError } from '../utils/client';\nimport { success } from '../utils/logger';\nimport Table from 'cli-table3';\nimport chalk from 'chalk';\nimport { formatJSON, formatNushell } from '../utils/formatter';\n\nexport interface ListRowsOptions {\n  limit?: number;\n  offset?: number;\n  search?: string;\n  filters?: string;\n  fieldNames?: boolean;\n  format?: 'table' | 'json' | 'nushell';\n}\n\nexport interface CreateRowOptions {\n  data: string;\n  fieldNames?: boolean;\n}\n\nexport interface UpdateRowOptions {\n  data: string;\n  fieldNames?: boolean;\n}\n\n/**\n * List rows from a Baserow table.\n * @param tableId The ID of the table.\n * @param options List options.\n * @returns The rows result object.\n */\nexport async function listRows(tableId: number, options: ListRowsOptions): Promise<any> {\n  const client = await getClient();\n  const params: Record<string, any> = {\n    user_field_names: options.fieldNames ?? false\n  };\n  if (options.limit) {\n    params.size = options.limit;\n  }\n  if (options.offset) {\n    params.offset = options.offset;\n  }\n  if (options.search) {\n    params.search = options.search;\n  }\n  if (options.filters) {\n    try {\n      const filtersObj = JSON.parse(options.filters);\n      if (Array.isArray(filtersObj)) {\n        params.filter_object = filtersObj.map(filter => ({\n          field: filter.field,\n          type: filter.type,\n          value: filter.value\n        }));\n      } else {\n        params.filter_object = [{\n          field: filtersObj.field,\n          type: filtersObj.type,\n          value: filtersObj.value\n        }];\n      }\n    } catch (err: unknown) {\n      if (err instanceof Error) {\n        throw new Error(`Invalid filter format: ${err.message}`);\n      } else {\n        throw new Error('Invalid filter format: An unknown error occurred');\n      }\n    }\n  }\n  const rows = await client.databaseRows.list(tableId, params);\n  return rows;\n}\n\n/**\n * Create a new row in a Baserow table.\n * @param tableId The ID of the table.\n * @param options Create options.\n * @returns The created row object.\n */\nexport async function createRow(tableId: number, options: CreateRowOptions): Promise<any> {\n  const client = await getClient();\n  let rowData: Record<string, any>;\n  try {\n    rowData = JSON.parse(options.data);\n  } catch (err: unknown) {\n    throw new Error(`Invalid JSON data: ${err instanceof Error ? err.message : 'An unknown error occurred'}`);\n  }\n  const params = {\n    userFieldNames: options.fieldNames ?? false\n  };\n  const newRow = await client.databaseRows.create(tableId, rowData, params);\n  return newRow;\n}\n\n/**\n * Updates an existing row in a Baserow table.\n * @param tableId The ID of the table.\n * @param rowId The ID of the row to update.\n * @param options Update options.\n * @returns The updated row object.\n */\nexport async function updateRow(tableId: number, rowId: number, options: UpdateRowOptions): Promise<any> {\n  const client = await getClient();\n  let rowData: Record<string, any>;\n  try {\n    rowData = JSON.parse(options.data);\n  } catch (err: unknown) {\n    throw new Error(`Invalid JSON data: ${err instanceof Error ? err.message : 'An unknown error occurred'}`);\n  }\n  const updatedRow = await client.databaseRows.update(\n    tableId,\n    rowId,\n    rowData,\n    {\n      userFieldNames: options.fieldNames ?? false\n    }\n  );\n  return updatedRow;\n} ",
    "import { getClient } from '../utils/client';\nimport { error, success } from '../utils/logger';\nimport Table from 'cli-table3';\nimport chalk from 'chalk';\nimport { formatJSON, formatNushell } from '../utils/formatter';\nimport { getConfigValue } from '../utils/config';\n\nexport interface ListTablesOptions {\n  format?: 'table' | 'json' | 'nushell';\n}\n\nexport interface CreateTableOptions {\n  data?: string;\n  firstRowHeader?: boolean;\n}\n\nexport interface UpdateTableOptions {\n  name: string;\n}\n\n/**\n * List tables from a Baserow database.\n * @param database The database ID (optional).\n * @param options List options.\n * @returns The list of tables.\n */\nexport async function listTables(database: number | undefined, options: ListTablesOptions = {}): Promise<any[]> {\n  const client = await getClient();\n  if (!database) {\n    const configDatabaseId = await getConfigValue('database');\n    if (!configDatabaseId) {\n      throw new Error('Database ID is required. Provide it as an argument or set it in your config.');\n    }\n    database = parseInt(configDatabaseId as string);\n  }\n  const tables = await client.databaseTables.list(database);\n  return tables;\n}\n\n/**\n * Get a specific table by ID.\n * @param tableId The table ID.\n * @param options List options.\n * @returns The table object.\n */\nexport async function getTable(tableId: number, options: ListTablesOptions = {}): Promise<any> {\n  const client = await getClient();\n  const table = await client.databaseTables.get(tableId);\n  return table;\n}\n\n/**\n * Create a new table in a Baserow database.\n * @param database The database ID (optional).\n * @param name The name of the new table.\n * @param options Create options.\n * @returns The created table object.\n */\nexport async function createTable(database: number | undefined, name: string, options: CreateTableOptions = {}): Promise<any> {\n  const client = await getClient();\n  if (!database) {\n    const configDatabaseId = await getConfigValue('database');\n    if (!configDatabaseId) {\n      throw new Error('Database ID is required. Provide it as an argument or set it in your config.');\n    }\n    database = parseInt(configDatabaseId as string);\n  }\n  const payload: any = { name };\n  if (options.data) {\n    try {\n      payload.data = JSON.parse(options.data);\n    } catch (err: unknown) {\n      if (err instanceof Error) {\n        throw new Error(`Invalid JSON data: ${err.message}`);\n      } else {\n        throw new Error('Invalid JSON data: An unknown error occurred');\n      }\n    }\n  }\n  if (options.firstRowHeader !== undefined) {\n    payload.first_row_header = options.firstRowHeader;\n  }\n  const newTable = await client.databaseTables.create(database, payload);\n  return newTable;\n}\n\n/**\n * Update an existing table in Baserow.\n * @param tableId The table ID.\n * @param options Update options.\n * @returns The updated table object.\n */\nexport async function updateTable(tableId: number, options: UpdateTableOptions): Promise<any> {\n  const client = await getClient();\n  const updatedTable = await client.databaseTables.update(tableId, { name: options.name });\n  return updatedTable;\n}\n\n/**\n * Delete a table from Baserow.\n * @param tableId The table ID.\n * @returns An object with status and message.\n */\nexport async function deleteTable(tableId: number): Promise<{ status: 'success'; message: string }> {\n  const client = await getClient();\n  await client.databaseTables.delete(tableId);\n  return { status: 'success', message: `Table ${tableId} successfully deleted` };\n} "
  ],
  "mappings": "68BAGO,MAAM,UAAwB,KAAM,CAIzB,OAKA,KAKA,OAEhB,WAAW,CAAC,EAAiB,EAAgB,EAAe,EAAiB,CAC3E,MAAM,CAAO,EACb,KAAK,KAAO,kBACZ,KAAK,OAAS,EACd,KAAK,KAAO,EACZ,KAAK,OAAS,EAGd,OAAO,eAAe,KAAM,EAAgB,SAAS,EAEzD,CCvBO,MAAM,CAAiB,CACR,OAApB,WAAW,CAAS,EAAuB,CAAvB,mBAKd,mBAAkB,EAA6B,CACnD,OAAO,KAAK,OAAO,SAA0B,MAAO,oBAAoB,OAMpE,UAAS,CAAC,EAA2D,CACzE,OAAO,KAAK,OAAO,SACjB,OACA,sBACA,CACF,OAMI,qBAAoB,CAAC,EAAmB,CAAC,SAAU,QAAQ,EAAkB,CACjF,IAAM,EAAc,EAAO,IAAI,KAAS,SAAS,GAAO,EAAE,KAAK,GAAG,EAClE,OAAO,KAAK,OAAO,SACjB,MACA,8BAA8B,GAChC,OAOI,eAAc,EAA6B,CAC/C,OAAO,KAAK,mBAAmB,OAM3B,gBAAe,EAAuD,CAE1E,OADA,QAAQ,KAAK,2EAA2E,EACjF,KAAK,OAAO,SACjB,MACA,+BACF,EAEJ,CC3BO,MAAM,CAAgB,CACL,OAApB,WAAW,CAAS,EAAuB,CAAvB,mBAWd,aAAY,CAAC,EAAoE,CACnF,IAAM,EAAc,EAAS,IAAK,CAAO,EAAI,OAE7C,OAAO,KAAK,OAAO,SACf,MACA,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