Skip to main content

ProjectStructure API

The projectStructure module of the @codebolt/plugin-sdk.

import plugin from '@codebolt/plugin-sdk';

Quick Reference

MethodDescription
addCommandAdd a run command to a package
addDependencyAdd a dependency to a package
addDeploymentAdd a deployment config to a package
addRouteAdd an API route to a package
addTableAdd a database table to a package
addUiRouteAdd a UI route to a package
createPackageCreate a new package
deleteCommandDelete a run command
deleteDependencyDelete a dependency
deleteDeploymentDelete a deployment config
deletePackageDelete a package
deleteRouteDelete an API route
deleteTableDelete a database table
deleteUiRouteDelete a UI route
getMetadataGet complete project metadata
getPackageGet a specific package by ID
getPackagesGet all packages in the workspace
updateCommandUpdate a run command
updateDependencyUpdate a dependency
updateDeploymentUpdate a deployment config
updateDesignGuidelinesUpdate design guidelines for a package
updateFrontendFrameworkUpdate frontend framework for a package
updateGitUpdate git information
updateMetadataUpdate workspace metadata
updatePackageUpdate a package
updateRouteUpdate an API route
updateSectionUpdate a specific section of a package
updateTableUpdate a database table
updateUiRouteUpdate a UI route

Methods


addCommand

plugin.projectStructure.addCommand(packageId: string, command: Omit<RunCommand, "id">, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Add a run command to a package

ParameterTypeRequiredDescription
packageIdstringYes
commandOmit<RunCommand, "id">Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


addDependency

plugin.projectStructure.addDependency(packageId: string, dependency: Omit<Dependency, "id">, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Add a dependency to a package

ParameterTypeRequiredDescription
packageIdstringYes
dependencyOmit<Dependency, "id">Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


addDeployment

plugin.projectStructure.addDeployment(packageId: string, config: Omit<DeploymentConfig, "id">, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Add a deployment config to a package

ParameterTypeRequiredDescription
packageIdstringYes
configOmit<DeploymentConfig, "id">Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


addRoute

plugin.projectStructure.addRoute(packageId: string, route: Omit<ApiRoute, "id">, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Add an API route to a package

ParameterTypeRequiredDescription
packageIdstringYes
routeOmit<ApiRoute, "id">Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


addTable

plugin.projectStructure.addTable(packageId: string, table: Omit<DatabaseTable, "id">, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Add a database table to a package

ParameterTypeRequiredDescription
packageIdstringYes
tableOmit<DatabaseTable, "id">Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


addUiRoute

plugin.projectStructure.addUiRoute(packageId: string, route: Omit<UiRoute, "id">, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Add a UI route to a package

ParameterTypeRequiredDescription
packageIdstringYes
routeOmit<UiRoute, "id">Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


createPackage

plugin.projectStructure.createPackage(data: CreatePackageData, workspacePath?: string): Promise<ProjectStructurePackageResponse>

Create a new package

ParameterTypeRequiredDescription
dataCreatePackageDataYes
workspacePathstringNo

Returns: Promise<ProjectStructurePackageResponse>

Full reference →


deleteCommand

plugin.projectStructure.deleteCommand(packageId: string, commandId: string, workspacePath?: string): Promise<ProjectStructureDeleteResponse>

Delete a run command

ParameterTypeRequiredDescription
packageIdstringYes
commandIdstringYes
workspacePathstringNo

Returns: Promise<ProjectStructureDeleteResponse>

Full reference →


deleteDependency

plugin.projectStructure.deleteDependency(packageId: string, dependencyId: string, workspacePath?: string): Promise<ProjectStructureDeleteResponse>

Delete a dependency

ParameterTypeRequiredDescription
packageIdstringYes
dependencyIdstringYes
workspacePathstringNo

Returns: Promise<ProjectStructureDeleteResponse>

Full reference →


deleteDeployment

plugin.projectStructure.deleteDeployment(packageId: string, configId: string, workspacePath?: string): Promise<ProjectStructureDeleteResponse>

Delete a deployment config

ParameterTypeRequiredDescription
packageIdstringYes
configIdstringYes
workspacePathstringNo

Returns: Promise<ProjectStructureDeleteResponse>

Full reference →


deletePackage

plugin.projectStructure.deletePackage(packageId: string, workspacePath?: string): Promise<ProjectStructureDeleteResponse>

Delete a package

ParameterTypeRequiredDescription
packageIdstringYes
workspacePathstringNo

Returns: Promise<ProjectStructureDeleteResponse>

Full reference →


deleteRoute

plugin.projectStructure.deleteRoute(packageId: string, routeId: string, workspacePath?: string): Promise<ProjectStructureDeleteResponse>

Delete an API route

ParameterTypeRequiredDescription
packageIdstringYes
routeIdstringYes
workspacePathstringNo

Returns: Promise<ProjectStructureDeleteResponse>

Full reference →


deleteTable

plugin.projectStructure.deleteTable(packageId: string, tableId: string, workspacePath?: string): Promise<ProjectStructureDeleteResponse>

Delete a database table

ParameterTypeRequiredDescription
packageIdstringYes
tableIdstringYes
workspacePathstringNo

Returns: Promise<ProjectStructureDeleteResponse>

Full reference →


deleteUiRoute

plugin.projectStructure.deleteUiRoute(packageId: string, routeId: string, workspacePath?: string): Promise<ProjectStructureDeleteResponse>

Delete a UI route

ParameterTypeRequiredDescription
packageIdstringYes
routeIdstringYes
workspacePathstringNo

Returns: Promise<ProjectStructureDeleteResponse>

Full reference →


getMetadata

plugin.projectStructure.getMetadata(workspacePath?: string): Promise<ProjectStructureMetadataResponse>

Get complete project metadata

ParameterTypeRequiredDescription
workspacePathstringNo

Returns: Promise<ProjectStructureMetadataResponse>

Full reference →


getPackage

plugin.projectStructure.getPackage(packageId: string, workspacePath?: string): Promise<ProjectStructurePackageResponse>

Get a specific package by ID

ParameterTypeRequiredDescription
packageIdstringYes
workspacePathstringNo

Returns: Promise<ProjectStructurePackageResponse>

Full reference →


getPackages

plugin.projectStructure.getPackages(workspacePath?: string): Promise<ProjectStructurePackagesResponse>

Get all packages in the workspace

ParameterTypeRequiredDescription
workspacePathstringNo

Returns: Promise<ProjectStructurePackagesResponse>

Full reference →


updateCommand

plugin.projectStructure.updateCommand(packageId: string, commandId: string, updates: Partial<RunCommand>, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update a run command

ParameterTypeRequiredDescription
packageIdstringYes
commandIdstringYes
updatesPartial<RunCommand>Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateDependency

plugin.projectStructure.updateDependency(packageId: string, dependencyId: string, updates: Partial<Dependency>, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update a dependency

ParameterTypeRequiredDescription
packageIdstringYes
dependencyIdstringYes
updatesPartial<Dependency>Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateDeployment

plugin.projectStructure.updateDeployment(packageId: string, configId: string, updates: Partial<DeploymentConfig>, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update a deployment config

ParameterTypeRequiredDescription
packageIdstringYes
configIdstringYes
updatesPartial<DeploymentConfig>Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateDesignGuidelines

plugin.projectStructure.updateDesignGuidelines(packageId: string, guidelines: DesignGuidelines, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update design guidelines for a package

ParameterTypeRequiredDescription
packageIdstringYes
guidelinesDesignGuidelinesYes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateFrontendFramework

plugin.projectStructure.updateFrontendFramework(packageId: string, framework: FrameworkInfo, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update frontend framework for a package

ParameterTypeRequiredDescription
packageIdstringYes
frameworkFrameworkInfoYes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateGit

plugin.projectStructure.updateGit(gitInfo: GitInfo, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update git information

ParameterTypeRequiredDescription
gitInfoGitInfoYes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateMetadata

plugin.projectStructure.updateMetadata(updates: Record<string, any>, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update workspace metadata

ParameterTypeRequiredDescription
updatesRecord<string, any>Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updatePackage

plugin.projectStructure.updatePackage(packageId: string, updates: UpdatePackageData, workspacePath?: string): Promise<ProjectStructurePackageResponse>

Update a package

ParameterTypeRequiredDescription
packageIdstringYes
updatesUpdatePackageDataYes
workspacePathstringNo

Returns: Promise<ProjectStructurePackageResponse>

Full reference →


updateRoute

plugin.projectStructure.updateRoute(packageId: string, routeId: string, updates: Partial<ApiRoute>, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update an API route

ParameterTypeRequiredDescription
packageIdstringYes
routeIdstringYes
updatesPartial<ApiRoute>Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateSection

plugin.projectStructure.updateSection(packageId: string, section: string, sectionData: any, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update a specific section of a package

ParameterTypeRequiredDescription
packageIdstringYes
sectionstringYes
sectionDataanyYes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateTable

plugin.projectStructure.updateTable(packageId: string, tableId: string, updates: Partial<DatabaseTable>, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update a database table

ParameterTypeRequiredDescription
packageIdstringYes
tableIdstringYes
updatesPartial<DatabaseTable>Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →


updateUiRoute

plugin.projectStructure.updateUiRoute(packageId: string, routeId: string, updates: Partial<UiRoute>, workspacePath?: string): Promise<ProjectStructureUpdateResponse>

Update a UI route

ParameterTypeRequiredDescription
packageIdstringYes
routeIdstringYes
updatesPartial<UiRoute>Yes
workspacePathstringNo

Returns: Promise<ProjectStructureUpdateResponse>

Full reference →