Skip to content

Releases: accordproject/concerto

v3.11.1

18 Aug 12:47
3fa0135
Compare
Choose a tag to compare

What's Changed

  • chore(actions): publish v3.11.0 to npm by @github-actions in #687
  • feat(maps): patch concept serialization by @jonathan-casey in #688

Full Changelog: v3.11.0...v3.11.1

v3.11.0

16 Aug 13:47
b2469e4
Compare
Choose a tag to compare

What's Changed

Adds an extra validation step in the ModelManager to validate ModelFile object against the Metamodel definition. This is useful for catching errors when dynamically creating model files and to ensure internal consistency.

When opting into this feature:

  • In strict mode, invalid models will now throw an error.
  • In the default non-strict mode, a console warning is printed.

Turn on the feature with a parameter to the ModelManager constructor, e.g.

new ModelManager({ metamodelValidation: true });

Changelog

  • chore(actions): publish v3.10.0 to npm by @github-actions in #686
  • feat(core): add validation of model files against metamodel by @mttrbrts in #684

Full Changelog: v3.10.0...v3.11.0

v3.10.0

16 Aug 11:40
f8da8a9
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.9.1...v3.10.0

v3.9.1

10 Aug 09:12
b8ee62d
Compare
Choose a tag to compare

What's Changed

  • chore(actions): publish v3.9.0 to npm by @github-actions in #675
  • Stefanblaginov/update prod semver by @stefanblaginov in #680

Full Changelog: v3.9.0...v3.9.1

v3.9.0

25 Jul 14:01
1ba9c07
Compare
Choose a tag to compare

What's Changed

  1. Support for Multiple Terms per concept/property in Vocabularies #645.

Sample .voc file

locale: en
namespace: org.acme
declarations:
  - Color: A color
  - Vehicle: A road vehicle
    properties:
      - vin: Vehicle Identification Number
        tooltip: VIN
      - model: Model of the vehicle
  - Truck: A truck
    description: A vehicle capable of carrying cargo
    tooltip: Truck
    properties:
      - weight: The weight of the truck
        description: The weight of the truck in KG
        tooltip: Truck weight
      - horsePower: The horse power of the truck
        description: The horse power of the truck
        tooltip: Truck HP
  1. Experimental. Map Declaration. Prototype support for Map declarations with String keys and values. Enable by setting the environment variable ENABLE_MAP_TYPE=true. This feature is subject to change before release.
map Dictionary {
   o String
   o String
}

What's Changed

  • chore(actions): publish v3.8.2 to npm by @github-actions in #658
  • chore: upgrade deps by @mttrbrts in #660
  • chore: state node version support by @mttrbrts in #661
  • bug(vocabulary): fix for vocabulary management for ScalarDeclaration by @sanketshevkar in #662
  • feat(map): add serialisation for map<string, string> by @jonathan-casey in #654
  • chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 by @dependabot in #668
  • chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /packages/concerto-vocabulary by @dependabot in #669
  • chore(deps): bump semver from 7.3.5 to 7.5.2 by @dependabot in #673
  • chore(deps-dev): bump semver from 6.3.0 to 6.3.1 in /packages/concerto-util by @dependabot in #671
  • chore(deps-dev): bump semver from 6.3.0 to 6.3.1 in /packages/concerto-vocabulary by @dependabot in #672
  • feat(vocabulary) : support multiple terms per concept/property by @dselman in #664
  • feat(map): refactor map shape by @jonathan-casey in #674

Full Changelog: v3.8.2...v3.9.0

v3.8.2

07 Jun 20:12
9e000d6
Compare
Choose a tag to compare

What's Changed

  • chore(actions): publish v3.8.1 to npm by @github-actions in #652
  • fix(vocab): add imports for typescript generation by @mttrbrts in #657

Full Changelog: v3.8.1...v3.8.2

v3.8.1

23 May 09:31
da9a0c7
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.8.0...v3.8.1

v3.8.0

22 May 09:54
248a663
Compare
Choose a tag to compare

What's Changed

String length validation (from @ragi-dayananda):

String fields may also include an optional length expression, which is used to validate the number of characters in the string field. Both the minimum and maximum length bound are optional, however at least one must be specified. The maximum length must be greater than or equal to the minimum length.

  o String name length=[1,100]      // greater than or equal to 1 and less than or equal to 100
  o String description length=[1,]  // greater than or equal to 1
  o String comment length=[,100]    // less than or equal to 100

[PREVIEW] Map Declarations (from @jonathan-casey):

The feature flag ENABLE_MAP_TYPE is designed to control the availability of the new MapType in Concerto 3.8.0.

The feature flag can be activated by setting the environment variable ENABLE_MAP_TYPE=true, and deactivated setting the environment variable ENABLE_MAP_TYPE=false, or with the absence of the variable entirely.

Usage

model.cto

namespace com.map.preview@1.0.0

map AuthorsWorks {
  o String
  o String
}

concept Library {
  o String name
  o AuthorsWorks books
}

index.js

const map = modelManager.getMapDeclarations()?.pop() // take the first;

map.getName(); // AuthorsWorks

const key = map.getKey();
key.getType(); // String

const value = map.getValue();
value.getType(); // String

map.isMapDeclaration(); // true

map.getFullyQualifiedName(); // [email protected]

Change Log

New Contributors

Full Changelog: v3.7.0...v3.8.0

v3.7.0

09 Mar 11:42
a52af54
Compare
Choose a tag to compare

What's Changed

  1. #549 Improved support for Concerto model inference from OpenAPI v3 and JSON Schema files. Exposed on the concerto infer CLI command.
const {OpenAPIVisitor} = require("@accordproject/concerto-tools").CodeGen;
//...
const concertoModelJson = OpenApiVisitor
    .parse(myOpenApiSpecification)
    .accept(
        new OpenApiVisitor(), {
            metaModelNamespace: '[email protected]',
            namespace: '[email protected]',
        }
    );
    
 console.log(Printer.toCTO(
    concertoModelJson.models[0]
));

The generated model also includes types for request and response payloads and untyped "JSON" objects.

  1. Adds utilities to allow navigation of the dependency tree of a model as a graph. This allows for more advanced operations like "tree-shaking" of large models and finding unused imports.
const {ConcertoGraphVisitor, DirectedGraph} = require("@accordproject/concerto-tools").Common;
// ...
const visitor = new ConcertoGraphVisitor();
const graph = new DirectedGraph();
modelManager.accept(visitor, { graph });

// Find the maximal subgraph starting from 'ChangeOfAddress'
const connectedGraph = graph.findConnectedGraph('[email protected]');

const filteredModelManager = modelManager
  .filter(declaration => 
    connectedGraph.hasVertex(declaration.getFullyQualifiedName())
  );

Commits

  • feat(tools): add graph and graph search by @mttrbrts in #614
  • feat(tools): parse OpenAPI to Concerto Metamodel JSON by @stefanblaginov in #594
  • fix(tools): improve how plantuml namespaces are rendered by @dselman in #615
  • fix(tools): Fix for PlantUML relationships and aggregations by @dselman in #616
  • fix(metamodel): handle missing optional values in metamodel instance by @mttrbrts in #619
  • fix(tools): issue when converting a valid model to Protobuf by @stefanblaginov in #618
  • chore(actions): publish v3.6.0 to npm by @github-actions in #612

Full Changelog: v3.6.0...v3.7.0

v3.6.0

23 Feb 10:09
690ce26
Compare
Choose a tag to compare

What's Changed

  • Enhancements to C# Code Generation from Concerto Models.
    • Now includes a decorator, @DotNetType to allow overriding of the C# primitive type for a property.
    • Optional properties in Concerto now become nullable fields in C#
  • The @accordproject/concerto-util package contains a new module, Identifiers, which includes a utility for normalizing strings to valid Concerto identifiers so that they can be used for property names, namespaces, enum values etc.
import { Identifiers } from "@accordproject/concerto-util";

const myId = '1st Item';
const MAX_LENGTH = 200;
const validId = Identifiers.normalizeIdentifier(myId, MAX_LENGTH);

console.log(validId, Identifiers.ID_REGEX.test(validId));
// _1st_Item true

Commits

  • feat(tools): csharp codegen nullable type support by @ragi-dayananda in #604
  • feat(tools): Support for more dotnet built-in types by @ragi-dayananda in #605
  • feat(util): add normalizeIdentifier function by @mttrbrts in #606
  • fix(deps): upgrade to webpack 6.75.0 by @mttrbrts in #609
  • chore(actions): publish v3.5.0 to npm by @github-actions in #599

Full Changelog: v3.5.0...v3.6.0