Releases: accordproject/concerto
v3.11.1
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
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
What's Changed
- feat(map): Extend Type support by @jonathan-casey in #677
- fix(filter) : remove imports of filtered types by @dselman in #683
- Update Type Defs by @dselman in #685
Full Changelog: v3.9.1...v3.10.0
v3.9.1
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
What's Changed
- 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
- 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
v3.8.1
What's Changed
- fix(maps): patch types needed for Typescript generation by @jonathan-casey in #651
Full Changelog: v3.8.0...v3.8.1
v3.8.0
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
- feat(*): MapDeclaration Parse & Print by @jonathan-casey in #641
- feat(tools): enum, regex, referential type feature for csharp codegen by @ragi-dayananda in #607
- feat(*): monorepo migration - cleanup packages and references by @jonathan-casey in #639
- feat(*): Support string length validation by @ragi-dayananda in #647
- feat(map): Add Introspection for Map Type by @jonathan-casey in #646
- fix(tools): UUID format fix for jsonschema visitor by @ragi-dayananda in #635
- fix(concerto): fix bugs when id field has regex by @DianaLease in #630
- fix(core): disallow reserved fields in JSON serialization by @mttrbrts in #632
- chore(deps-dev): bump webpack from 5.64.2 to 5.76.0 by @dependabot in #625
- chore(actions): publish v3.7.0 to npm by @github-actions in #620
- chore(deps): bump webpack from 5.74.0 to 5.79.0 in /packages/concerto-util by @dependabot in #634
- chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 by @dependabot in #627
- chore(*) remove Ergo References from Concerto (#610) by @jamieshorten in #637
- chore(deps): bump yaml from 2.0.0-9 to 2.2.2 in /packages/concerto-vocabulary by @dependabot in #640
New Contributors
- @jamieshorten made their first contribution in #637
Full Changelog: v3.7.0...v3.8.0
v3.7.0
What's Changed
- #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.
- 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
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#
- Now includes a decorator,
- 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