TypeScript SDK
API reference
Reference for the generated DSPlaneCore, WsManager, and Deployments methods in @dsplane/core.
The SDK returns generated response data directly. Method names and parameter shapes below match the current generated sdk.gen.ts.
DSPlaneCore
const dsplane = new DSPlaneCore({ client });
| Property | Type | Description |
|---|---|---|
wsManager |
WsManager |
Dev Space, schema, environment type, and SSH-key operations. |
deployments |
Deployments |
AI deployment operations. |
WsManager
fetchEnvironments()
Fetch all development environments.
const environments = await dsplane.wsManager.fetchEnvironments();
Response data: EnvironmentConfig[].
fetchEnvironment()
Fetch one development environment by workspace ID.
const environment = await dsplane.wsManager.fetchEnvironment({
wsID: 'workspace-id',
});
| Parameter | Type | Required |
|---|---|---|
wsID |
string |
Yes |
Response data: EnvironmentConfig.
buildEnvironment()
Initiate a development environment build.
await dsplane.wsManager.buildEnvironment({
buildPayload: {
id: crypto.randomUUID(),
memoryLimitBytes: 0,
extensions: [],
annotations: {
pack: 'FULL_STACK',
packTagline: '',
optionalExtensions: '[]',
technicalExtensions: '[]',
},
workspaceDisplayName: 'MyDevSpace',
},
});
The buildPayload parameter has the generated BuildPayload type.
toggleEnvironment()
Start or stop a development environment.
await dsplane.wsManager.toggleEnvironment({
wsID: 'workspace-id',
environmentTogglePayload: {
Suspended: false,
WorkspaceDisplayName: 'MyDevSpace',
},
});
Set Suspended to false to start and true to stop.
deleteEnvironment()
Delete a development environment:
await dsplane.wsManager.deleteEnvironment({
wsID: 'workspace-id',
});
fetchEnvironmentSchema()
Fetch the extension and pack schema:
const schema = await dsplane.wsManager.fetchEnvironmentSchema();
Response data: EnvironmentSchema.
fetchEnvironmentTypes()
Fetch all development environment types:
const types = await dsplane.wsManager.fetchEnvironmentTypes();
Response data: EnvironmentType[].
fetchKey()
Fetch the Dev Space SSH private key:
const privateKey = await dsplane.wsManager.fetchKey();
Response data: a PEM-formatted string. Configure this call against the Dev Space startup URL with an explicit bearer header. See Client configuration.
Deployments
list()
List AI deployments:
const deployments = await dsplane.deployments.list({
'AI-Resource-Group': 'default',
});
The parameters object is optional. AI-Resource-Group is an optional request header.
The response data has this generated shape:
{
resources?: Array<Record<string, unknown>>;
}
Environment state
EnvironmentState is a generated constant enum:
enum EnvironmentState {
RUNNING = 'RUNNING',
STARTING = 'STARTING',
STOPPED = 'STOPPED',
STOPPING = 'STOPPING',
ERROR = 'ERROR',
SAFE_MODE = 'SAFE_MODE',
}
Generated types
The root export includes model and operation types such as:
BuildPayloadEnvironmentConfigEnvironmentCurrentStateEnvironmentSchemaEnvironmentTogglePayloadEnvironmentTypeEnvironmentState- operation
Data,Response, andResponsesaliases
Import types from @dsplane/core:
import type {
BuildPayload,
EnvironmentConfig,
EnvironmentSchema,
} from '@dsplane/core';