Skip to main content

SpaceClient

Defined in: src/dapi.ts:833

Client for working with a specific space. Provides methods for managing subspaces, entities (scripts, queries, connections), and files.

Constructors

Constructor

new SpaceClient(dart): SpaceClient

Defined in: src/dapi.ts:836

Parameters

ParameterType
dartany

Returns

SpaceClient

Properties

PropertyTypeDefined in
dartanysrc/dapi.ts:834

Accessors

children

Get Signature

get children(): SpaceChildrenClient

Defined in: src/dapi.ts:879

Returns a client for accessing children of this space

Returns

SpaceChildrenClient


files

Get Signature

get files(): SpaceFilesClient

Defined in: src/dapi.ts:884

Returns a client for accessing files in this space

Returns

SpaceFilesClient

Methods

addEntity()

addEntity(entityId, link?): Promise<void>

Defined in: src/dapi.ts:865

Adds an entity (script, query, connection, or another space) to this space. When link is false (default), the entity is moved from its current location to this space. When link is true, creates a reference without moving - the entity can appear in multiple spaces. Moving a space preserves all its files, nested subspaces, and contained entities.

Parameters

ParameterTypeDefault valueDescription
entityIdstringundefinedThe unique identifier of the entity to add
linkbooleanfalseIf true, creates a link reference instead of moving the entity (default: false)

Returns

Promise<void>


addSubspace()

addSubspace(childSpace, link?): Promise<Project>

Defined in: src/dapi.ts:849

Adds a child space (subspace) under this space. The subspace will have its own storage with a namespaced path derived from the parent hierarchy (e.g., 'ParentSpace:ChildSpace:'). You can provide existing space, then based on the link parameter the subspace will be moved or reference will be created.

Parameters

ParameterTypeDefault valueDescription
childSpacestring | ProjectundefinedThe subspace name or an existing space.
linkbooleanfalseIf true, creates a link reference instead of moving the subspace (default: false). When only the subspace name is provided, this parameter is ignored.

Returns

Promise<Project>


removeEntity()

removeEntity(entityId): Promise<void>

Defined in: src/dapi.ts:874

Removes an entity from this space. Note: If the entity is linked, only reference will be deleted.

Parameters

ParameterTypeDescription
entityIdstringEntity.id

Returns

Promise<void>


subspaceExists()

subspaceExists(name): Promise<boolean>

Defined in: src/dapi.ts:854

Checks if a subspace with the given name exists in the current space.

Parameters

ParameterType
namestring

Returns

Promise<boolean>