@accordproject/concerto-core 3.14.2 → 3.14.3-20231107125331

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Concerto v3.14.2
2
+ * Concerto v3.14.3-20231107125331
3
3
  * Licensed under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License.
5
5
  * You may obtain a copy of the License at
@@ -439,7 +439,7 @@ class DecoratorManager {
439
439
  this.applyDecorator(declaration.value, type, decorator);
440
440
  }
441
441
  }
442
- } else if (!target.property && !target.type) {
442
+ } else if (!(target.property || target.properties || target.type)) {
443
443
  this.applyDecorator(declaration, type, decorator);
444
444
  } else {
445
445
  // scalars are declarations but do not have properties
@@ -71,7 +71,8 @@ class MapKeyType extends Decorated {
71
71
  validate() {
72
72
 
73
73
  if (!ModelUtil.isPrimitiveType(this.type)) {
74
- const decl = ModelUtil.getTypeDeclaration(this.ast.type.name, this.modelFile);
74
+
75
+ const decl = this.modelFile.getType(this.ast.type.name);
75
76
 
76
77
  if (!ModelUtil.isValidMapKeyScalar(decl)) {
77
78
  throw new IllegalModelException(
@@ -69,7 +69,8 @@ class MapValueType extends Decorated {
69
69
  */
70
70
  validate() {
71
71
  if (!ModelUtil.isPrimitiveType(this.type)) {
72
- const decl = ModelUtil.getTypeDeclaration(this.ast.type.name, this.modelFile);
72
+
73
+ const decl = this.modelFile.getType(this.ast.type.name);
73
74
 
74
75
  // All declarations, with the exception of MapDeclarations, are valid Values.
75
76
  if(decl.isMapDeclaration?.()) {
package/lib/modelutil.js CHANGED
@@ -338,21 +338,6 @@ class ModelUtil {
338
338
  `${MetaModelNamespace}.ObjectMapValueType`
339
339
  ].includes(value.$class);
340
340
  }
341
-
342
- /**
343
- * Returns the corresponding ClassDeclaration representation of the Map Type
344
- * @param {string} type - the Type of the Map Value
345
- * @param {ModelFile} modelFile - the ModelFile that owns the Property
346
- * @return {Object} the corresponding ClassDeclaration representation
347
- */
348
- static getTypeDeclaration(type, modelFile) {
349
- if (modelFile.isLocalType(type)) {
350
- return modelFile.getAllDeclarations().find(d => d.name === type);
351
- } else {
352
- const fqn = modelFile.resolveImport(type);
353
- return modelFile.getModelManager().getType(fqn);
354
- }
355
- }
356
341
  }
357
342
 
358
343
  module.exports = ModelUtil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accordproject/concerto-core",
3
- "version": "3.14.2",
3
+ "version": "3.14.3-20231107125331",
4
4
  "description": "Core Implementation for the Concerto Modeling Language",
5
5
  "homepage": "https://github.com/accordproject/concerto",
6
6
  "engines": {
@@ -71,9 +71,9 @@
71
71
  "yargs": "17.3.1"
72
72
  },
73
73
  "dependencies": {
74
- "@accordproject/concerto-cto": "3.14.2",
74
+ "@accordproject/concerto-cto": "3.14.3-20231107125331",
75
75
  "@accordproject/concerto-metamodel": "3.9.0",
76
- "@accordproject/concerto-util": "3.14.2",
76
+ "@accordproject/concerto-util": "3.14.3-20231107125331",
77
77
  "dayjs": "1.11.10",
78
78
  "debug": "4.3.4",
79
79
  "lorem-ipsum": "2.0.8",
@@ -162,12 +162,4 @@ declare class ModelUtil {
162
162
  * @return {boolean} true if the Value is a valid Map Value
163
163
  */
164
164
  static isValidMapValue(value: any): boolean;
165
- /**
166
- * Returns the corresponding ClassDeclaration representation of the Map Type
167
- * @param {string} type - the Type of the Map Value
168
- * @param {ModelFile} modelFile - the ModelFile that owns the Property
169
- * @return {Object} the corresponding ClassDeclaration representation
170
- */
171
- static getTypeDeclaration(type: string, modelFile: ModelFile): any;
172
165
  }
173
- import ModelFile = require("../lib/introspect/modelfile");