1.0.2

This release replaces all previous SDK versions as our API endpoints have been changed and finalized. Please run npm update mendixmodelsdk --save.

Story # Impact Description
585226 High All Model API infrastructure has been moved to Europe and the default endpoint of the API is updated.
602450 Low SDK now throttles requests to avoid spamming our servers. This might degrade performance a little.
606647 None SDK now handles EPIPE errors coming from AWS correctly.

1.0.0

Story # Impact Description
561960 High All constructors to create new model elements are removed, instead factory methods should be used. The migration is straight forward: var entity = new domainmodels.Entity() becomes: var entity = domainmodels.Entity.create(model). See the next paragraph for more details.
562069 Medium Versioning has been added explicitly, so usage of elements and properties is checked against the product (and hence meta model) version. As part of this, new ModelSdkClient(..) is no longer valid and has to be replaced with Model.createSdkClient(..) everywhere.
569299 Low Introduction / deprecation / deletion messages for structures / elements / properties are shown in the typescript documentation.
581572 Low Improved error-message when trying to use an unloaded element or property.
580561 Low An error-message will be returned, when using an out-dated Mendix Model SDK. Only Mendix Model SDK 1.0.0-rc.0 and up are supported now.
588942 Low Stability improvements when creating new project
561960 Low It is no longer possible to push null or items twice onto a properties that contain a list of elements.
561960 Low It is no longer possible to instantiate objects that are derived, such as LayoutParameter.
561960 Low All model elements expose a .model property that returns the model they belong to.
561960 Low Convenience methods to create elements and add them to a parent directly are introduced for all elements that are stored at a unique place (this holds for most elements except for utilities like texts.Text). See the next paragraph for more details.
553639 Low The Model API and SDK observe the same rules for setting properties to null as the Business Modeler does: (1) list properties cannot receive null at all, (2) non-list properties can only be set to null if they are are object-typed (i.e., not primitive or enum) and not required (see documentation).
561972 Low It is no longer possible to move a model element from one model to another. In other words: model elements can only exist within the model they were created in.
562069, 561977, 568908 None The SDK is now versioned in the sense that structures and properties can have lifecycles, moving from not yet introduced to introduced to deprecated to deleted depending on which version of the Mendix Business Modeler was used to create (the MPK for) the working copy. The SDK provides suitable warnings or errors (once per structure/property per connection) on the console whenever a structure or property is used that is either not yet introduced, deprecated or deleted.
463511* Low Finding images by qualified name now works, so e.g. pages.StaticImageViewer.image isn’t always null.
585563 Low Stability improvements when uploading large files.
583025 Low Structure#traverse now checks whether the structure has been loaded and fails if not. You have to pre-load traversed structures first if not done already.
585492 Low Updated the Model SDK for latest (RC-)version of Business Modeler, i.e.
590510 None Extended the Model SDK with file operations.
591741 None Improved build process.
564149 None The Model SDK now ships with a separate “mini-SDK” that is exclusively used for unit testing the SDK itself.
463511* None IStructure, IList, IAbstractUnit and IEnum are now (by request) exposed again on top-level.
463511* None Structure has a new method called traverse to (synchronously) traverse this structure and all contained (not referenced) structures - see its TypeDoc for more information.

(‘*’ means: fixed during this story, but not intrinsically related to this story)

Introducing structure factories

In this release we moved from argument less constructors to factory methods. This has a few advantages: 1. We can perform more consistency checks upfront, such as whether the type you are creating is available in the Mendix version of your project. 2. Factories can be overloaded in many more ways than constructors, this allows us to introduce even more convenience factories in the future.

So if you had:

<code>function newEntity(domainModel: domainmodels.DomainModel, name: string) {
	var entity = new domainmodels.Entity();
	domainModel.entities.push(entity);
	entity.name = name;

	return entity;
}</code>

This will become:

<code>function newEntity(domainModel: domainmodels.DomainModel, name: string) {
	var entity = domainmodels.Entity.create(domainModel.model); // all factories need to know about the owning model
	domainModel.entities.push(entity);
	entity.name = name;

	return entity;
}</code>

This seems to make it less convenient to make new structures. However, we introduced convenience factory methods that automatically create new elements and registers them on their parent. So from this release onward you can just write:

<code>function newEntity(domainModel: domainmodels.DomainModel, name: string) {
	var entity = domainmodels.Entity.createIn(domainModel); // pass the domainModel instead of a model
	entity.name = name;

	return entity;
}</code>

You will notice that this significantly reduces the amount of boilerplate code in application generators.