Skip to main content

SpaceClient

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

Constructors

new SpaceClient()

new SpaceClient(dart): SpaceClient

Parameters

ParameterType
dartany

Returns

SpaceClient

Source

src/dapi.ts:827

Properties

PropertyType
dartany

Accessors

children

get children(): SpaceChildrenClient

Returns a client for accessing children of this space

Returns

SpaceChildrenClient

Source

src/dapi.ts:870


files

get files(): SpaceFilesClient

Returns a client for accessing files in this space

Returns

SpaceFilesClient

Source

src/dapi.ts:875

Methods

addEntity()

addEntity(entityId, link): Promise<void>

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>

Source

src/dapi.ts:856


addSubspace()

addSubspace(childSpace, link): Promise <Project>

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>

Source

src/dapi.ts:840


removeEntity()

removeEntity(entityId): Promise<void>

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

Parameters

ParameterTypeDescription
entityIdstringEntity.id

Returns

Promise<void>

Source

src/dapi.ts:865


subspaceExists()

subspaceExists(name): Promise<boolean>

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

Parameters

ParameterType
namestring

Returns

Promise<boolean>

Source

src/dapi.ts:845