Package-level declarations

Types

Link copied to clipboard
interface BranchJS

JS-API for IBranch. Can be used to read and write model data.

Link copied to clipboard
typealias ChangeHandler = (ChangeJS) -> Unit
Link copied to clipboard
sealed interface ChangeJS

Represents a change in branch that can be handled by a ChangeHandler. See BranchJS.addListener

Link copied to clipboard
data class ChildrenChanged(val node: INodeJS, val role: String?) : ChangeJS

Represents moved, added or removed children.

Link copied to clipboard
interface ClientJS

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

Link copied to clipboard
data class ConceptChanged(val node: INodeJS) : ChangeJS

Represents the change of the concept of a node.

Link copied to clipboard
data class ContainmentChanged(val node: INodeJS) : ChangeJS

Represents the change of the parent of node changed.

Link copied to clipboard
interface IModelClientV2

This interface is meant exclusively for model client usage.

Link copied to clipboard

Should only be used by Modelix components.

Link copied to clipboard
class ModelClientV2(httpClient: HttpClient, val baseUrl: String, clientProvidedUserId: String?) : IModelClientV2, IModelClientV2Internal, Closable
Link copied to clipboard
abstract class ModelClientV2Builder
Link copied to clipboard
data class PropertyChanged(val node: INodeJS, val role: String) : ChangeJS

Represents a changed property value.

Link copied to clipboard
data class ReferenceChanged(val node: INodeJS, val role: String) : ChangeJS

Represents a changed reference target.

Link copied to clipboard
class ReplicatedModel(val client: IModelClientV2, val branchRef: BranchReference, providedScope: CoroutineScope? = null, initialRemoteVersion: CLVersion? = null)

Dispose should be called on this, as otherwise a regular polling will go on.

Link copied to clipboard

Represents a branch two-way live replicated to the model server.

Link copied to clipboard
data class VersionInformationJS(val author: String?, val time: Date?)

Contains a subset of version data like in CPVersion.

Link copied to clipboard
class VersionNotFoundException(val versionHash: String) : Exception

Functions

Link copied to clipboard
Link copied to clipboard
fun connectClient(url: String, bearerTokenProvider: () -> Promise<String?>? = null): Promise<ClientJS>

Create a client connected to the model server.

Link copied to clipboard
Link copied to clipboard
suspend fun IModelClientV2.lazyLoadVersion(branchRef: BranchReference, config: CacheConfiguration = CacheConfiguration()): IVersion

An overload of IModelClientV2.lazyLoadVersion that reads the current version hash of the branch from the server and then loads that version with lazy loading support.

fun IModelClientV2.lazyLoadVersion(repositoryId: RepositoryId, versionHash: String, config: CacheConfiguration = CacheConfiguration()): IVersion

This function loads parts of the model lazily while it is iterated and limits the amount of data that is cached on the client side.

Link copied to clipboard

Same as loadModelsFromJsonAsBranch but directly returns the BranchJS.rootNode of the created branch.

Link copied to clipboard

Load data from JSON strings into an in-memory branch.

Link copied to clipboard
suspend fun HttpResponse.readVersionDelta(): VersionDeltaStream
Link copied to clipboard
suspend fun <T> IModelClientV2.runWrite(branchRef: BranchReference, body: (INode) -> T): T

Performs a write transaction on the root node of the given branch.

Link copied to clipboard
suspend fun <T> IModelClientV2.runWriteOnBranch(branchRef: BranchReference, body: (IBranch) -> T): T

Performs a write transaction on the root node of the given branch.

Link copied to clipboard
fun HttpRequestBuilder.useVersionStreamFormat()