Overview
Project server actions handle CRUD operations for VizBoard projects, including creation with database connections, updates, deletion, and schema management.createProjectWithConnections
Creates a new project with optional database connections. Supports both full project creation and draft mode.Parameters
Project title (1-100 characters, alphanumeric with spaces, dots, underscores, hyphens)
Project description (max 500 characters)
Whether the project is publicly accessible
ID of the user creating the project
Array of database connections. At least one required for non-draft projects.
Connection name (1-50 characters)
Database host (IP, localhost, or hostname)
Database port (1-65535)
Database name (1-60 characters, alphanumeric with hyphens/underscores)
Database username (1-50 characters)
Database password (min 1 character)
Response
Indicates if the project was created successfully
ID of the created project (only when success is true)
Error message (only when success is false)
Behavior
- Auto-validation: Connections are automatically validated after creation
- Auto-introspection: Valid connections are automatically introspected to extract schema
- Draft mode: Projects can be created without connections (draft mode)
- Encryption: Connection credentials are encrypted before storage
- Revalidation: Automatically revalidates the
/projectspath
Example
updateProject
Updates an existing project and its connections.Parameters
Project ID to update
New project title
New project description
New public visibility setting
Updated connections array
Connection ID (for existing connections)
Connection name
Database host
Database port
Database name
Database username
Database password or
"KEEP_CURRENT_PASSWORD" to preserve existing passwordWhether this is an existing connection (internal use)
Response
Indicates if the update was successful
Connection validation results after update
Error message (only when success is false)
Behavior
- Ownership verification: Only the project owner can update
- Connection management: Connections not in the update array are deleted
- Password handling: Use
"KEEP_CURRENT_PASSWORD"to preserve existing passwords - Auto-validation: Connections are validated after update
- Auto-introspection: Valid connections are re-introspected
- Public constraint: Projects without valid connections are automatically set to private
- Revalidation: Revalidates
/projectsand/projects/:idpaths
Example
Use
"KEEP_CURRENT_PASSWORD" to avoid requiring users to re-enter passwords when editing connections.deleteProject
Permanently deletes a project and all associated connections and widgets.Parameters
ID of the project to delete
ID of the user requesting deletion (must be owner)
Response
Indicates if deletion was successful
Success message with project title
Error message (only when success is false)Possible errors:
"Invalid project ID""Project not found""Unauthorized: You can only delete your own projects"
Behavior
- Cascade deletion: Deletes all widgets, connections, and the project
- Ownership verification: Only the project owner can delete
- Transaction: All deletions occur in a database transaction
- Revalidation: Revalidates the
/projectspath
Example
getProjectWithConnections
Retrieves a project with decrypted connection details.Parameters
ID of the project to retrieve
ID of the user requesting the project (must be owner)
Response
Indicates if retrieval was successful
Project data with decrypted connections
Project ID
Project title
Project description
Public visibility status
Public ID for sharing
Ordered array of widget IDs
Array of database connections
Connection ID
Connection name
Database host
Database port
Database name
Database username
Always empty string for security
Connection validation status
Always true for retrieved connections
Error message (only when success is false)
Example
Passwords are always returned as empty strings for security. Use
"KEEP_CURRENT_PASSWORD" when updating.getUserProjects
Retrieves all projects for a user with connection and widget statistics.Parameters
ID of the user whose projects to retrieve
Response
Indicates if retrieval was successful
Array of projects with statistics
Project ID
Project title
Project description
Public visibility status
Total number of connections
Number of valid connections
Whether any connections have been validated
Number of valid connections (same as validConnections)
Number of connections with introspected schemas
Whether any schemas have been introspected
Number of widgets in the project
Project creation timestamp
Last update timestamp
Error message (only when success is false)
Example
regenerateProjectSchemas
Re-introspects all valid database connections in a project to refresh schema data.Parameters
ID of the project to regenerate schemas for
ID of the user requesting regeneration (must be owner)
Response
Indicates if regeneration was successful
Regeneration results
Total connections processed
Number of successful regenerations
Number of failed regenerations
Error message (only when success is false)
Example
isProjectOwner
Checks if a user owns a specific project.Parameters
User ID to check
Project ID to check
Response
Indicates if the check was successful
Whether the user owns the project
Error message (only when success is false)
