Skip to content

Releases: accordproject/concerto

Concerto v1.0.0-alpha.2

24 Jan 18:09

Choose a tag to compare

Introduction

This is a pre release of Concerto 1.0.

Concerto 1.0 delivers some fundamental improvements, whilst maintaining a high-degree (though not total!) of backwards compatibility.

Breaking Changes

  • Systems models are no longer supported
  • DateTime values do not preserve the timezone offset and are always converted to UTC
  • Validation has been made stricter, which means some previously allowed instances will now fail validation
  • The syntax and semantic of relationships has been changed

Removal of System Models

See: (#62) ✅

An advanced feature of prior versions of Concerto was the ability to add a system model to the ModelManager, which functioned as an implicit set of base types for concepts, assets, participants etc within the scope of the ModelManager. This feature complicated the APIs considerably, and it had the effect of making CTO models non-portable, in as far as they could only be loaded into a ModelManager that used the same set of system models.

System models have therefore been removed from Concerto v1 — any base types should now be imported and referenced explicitly into model files.

Strict Validation

See: (#158 #157 ) ✅

Prior to Concerto v1 validation suffered from some side-effects of JavaScript type-coercion. For example, "NaN" would be a valid value for a Double field. These edge cases have now been tightened up, so some instances that were valid prior to v1 may now fail validation.

Identifiers and Relationships

See: (#181) ✅

Prior to v1 a relationship could only be declared to an asset, participant, transaction or event (as these must be identified by). In v1 two new capabilities have been added:

  1. Concepts can now be declared to be identified by an identifying field, allowing them to be used with relationships
  2. Any type can be declared as identified — to automatically create a system $identifier field.

The model below is valid with Concerto v1.

namespace org.accordproject

concept Address {
   o String country
}

concept Product identified by sku {
   o String sku
}

concept Order identified {
   o Double ammount
   o Address address
   --> Product product
}

Root of Type Hierarchy

See: (#180) ✅

All declared types now have concerto.Concept as their super type, and the concerto namespace is reserved. Note that the super type for concerto.Concept is null.

Functional API (experimental)

See: (#188) ✅

A new streamlined Concerto API has been added, to replace some of the existing runtime APIs. Existing runtime APIs have been preserved, but will be progressively removed.

The Concerto API is much more functional in nature, and allows plain-old-JavaScript objects to be validated using a ModelManager — removing the need to use the Factory API to create JS objects prior to validation, or to use the Serializer to convert them back to plain-old-JavaScript objects. This should reduce the learning-curve for the library and improve performance.

const { ModelManager, Concerto } = require('@accordproject/concerto-core');
const modelManager = new ModelManager();

modelManager.addModelFile( `namespace org.acme.address
concept PostalAddress {
  o String streetAddress optional
  o String postalCode optional
  o String postOfficeBoxNumber optional
  o String addressRegion optional
  o String addressLocality optional
  o String addressCountry optional
}`, 'model.cto');

const postalAddress = {
   $class : 'org.acme.address.PostalAddress',
   streetAddress : '1 Maine Street'
};

const concerto = new Concerto(modelManager);
concerto.validate(postalAddress);

Concerto v0.82.11

23 Sep 13:54

Choose a tag to compare

🐛 This release fixes and issue with the new JSONSchema compilation target, when dealing with multiple model files.

Concerto v0.82.10

23 Sep 12:25

Choose a tag to compare

🗺️ This release includes a rewrite of the JSONSchemaVisitor class, used to convert a Concerto model to a JSON Schema.

It addresses the following:

  • Bug fix for Concerto models that contain recursive relationships #206
  • Concerto decorators are added to the JSON Schema #207
  • Concerto Integer, Double and Long fields now have their range validation expressions added to the JSON Schema
  • Concerto String fields now that their regex validation expressions added to the JSON Schema
  • Enforce correct $class names in the JSON Schema

By default the new code generates JSON Schema definitions for all types in a ModelManager and adds them to a top-level definitions attribute, and uses $ref to reference them. To expand non-recursive types inline you can use the inlineTypes parameter.

Use the rootType parameter to optionally expand a single class definition into the root of the generated schema document.

Concerto v0.82.9

09 Sep 21:23

Choose a tag to compare

This is a patch release, which allows users to control whether to resolve external models or not ("offline" mode) from the command line, and improves the build / testing process.

🏖️ Work offline with the CLI and ModelLoader class (#202)

  • Concerto CLI now supports an option --offline which can be used to disable external models resolution. This can be used when all models are local.
  • New offline option for the ModelLoader class, which disables external models resolution. This can improve performances when external model resolution is not needed.

🏗️ Build

  • Version checking for the changelog and API documentation generation does not fail anymore for the next available version (#204)

Concerto v0.82.8

28 Jul 21:02

Choose a tag to compare

🏗️ This is a patch release, with a more flexible configuration of the log directory for AWS lambda and a more robust handling of log directory creation failure. (Contribution: @frbrkoala and @dselman).

Concerto v0.82.7

26 Feb 16:16

Choose a tag to compare

🏠 This is a minor release, fixing an inconsistency in the model manager and adding a convenience function to the model loader.

Bug Fixes

  • Addresses inconsistency in API documentation for the model manager #170

API

  • Add ModelLoader.loadModelManagerFromModelFiles convenience function

Concerto v0.82.6

12 Nov 19:47

Choose a tag to compare

🏠 This is a minor improvement release, adding more stable support for instanceof over the Serializer and Factory objects (#47).

Concerto v0.82.5

11 Nov 19:48

Choose a tag to compare

🏠 This is a bug fix and performance improvements release.

Internal

  • The CTO parser now has a smaller footprint (#55) Contributed by @j4m3sb0mb

CLI

  • Clearer error messages in CLI when some parameters or files are missing (#151)

Concerto v0.82.4

29 Oct 14:06

Choose a tag to compare

🐛 This is a bug-fix release, addressing an issue with the compile command not passing the target for code generation properly #146

Concerto v0.82.3

26 Oct 15:19

Choose a tag to compare

🏗 This release adds a new simple class ModelLoader for creating a ModelManager.