ClientJS

interface ClientJS

JS-API for ModelClientV2. Can be used to perform operations on the model server and to read and write model data.

The full version data of an ModelClientV2 is not exposed because most parts model API are not exposed to JS yet. See https://issues.modelix.org/issue/MODELIX-962

Functions

Link copied to clipboard
abstract fun dispose()

Dispose the client by closing the underlying connection to the model server.

Link copied to clipboard
abstract fun fetchBranches(repositoryId: String): Promise<Array<String>>

Fetch existing branches for a given repository from the model server.

Link copied to clipboard

Fetch existing repositories from the model server.

Link copied to clipboard
abstract fun initRepository(repositoryId: String, useRoleIds: Boolean = true): Promise<Unit>

Create a repository

Link copied to clipboard
abstract fun setClientProvidedUserId(userId: String)

Provide a user ID to the model client. The user ID is used to set the author of newly created versions. See VersionInformationJS.author

Link copied to clipboard
abstract fun startReplicatedModel(repositoryId: String, branchId: String): Promise<ReplicatedModelJS>

Starts a replicated model for a given branch. ReplicatedModelJS.getBranch can then be used to access the replicated branch.