Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,12 @@ class NodeAdapterJS(val node: INode) : INodeJS_ {
}

override fun setReferenceTargetNode(role: ReferenceRole, target: INodeJS?) {
val unwrappedTarget = if (target == null) null else (target as NodeAdapterJS).node
node.asWritableNode().setReferenceTarget(toReferenceLink(role), unwrappedTarget?.asWritableNode())
if (target is NodeAdapterJS) {
node.asWritableNode().setReferenceTarget(toReferenceLink(role), target.node.asWritableNode())
} else {
val targetRef = target?.getReference()
setReferenceTargetRef(role, targetRef)
}
}

override fun setReferenceTargetRef(role: ReferenceRole, target: INodeReferenceJS?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,16 @@ sealed class IdSchemeJS() {
}

@JsExport
data class VersionInformationWithModelTree(val version: VersionInformationJS, val tree: MutableModelTreeJs)
data class VersionInformationWithModelTree(
/**
* The version information.
*/
val version: VersionInformationJS,
/**
* The model tree associated with the version.
*/
val tree: MutableModelTreeJs,
)

/**
* JS-API for [ModelClientV2].
Expand All @@ -104,6 +113,7 @@ data class VersionInformationWithModelTree(val version: VersionInformationJS, va
* See https://issues.modelix.org/issue/MODELIX-962
*/
@JsExport
@Suppress("TooManyFunctions")
interface ClientJS {

/**
Expand Down Expand Up @@ -211,6 +221,10 @@ data class ReplicatedModelParameters(
val repositoryId: String,
val branchId: String,
val idScheme: IdSchemeJS,
/**
* Whether the model is read-only.
*/
val readonly: Boolean = false,
)

internal class ClientJSImpl(private val modelClient: ModelClientV2) : ClientJS {
Expand Down
Loading
Loading