@accordproject/concerto-core 2.0.0 → 2.0.1-20220425112621

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.
package/changelog.txt CHANGED
@@ -24,6 +24,9 @@
24
24
  # Note that the latest public API is documented using JSDocs and is available in api.txt.
25
25
  #
26
26
 
27
+ Version 2.0.1 {62a8de0d35789bbe523269e4e29cd8e6} 2022-04-25
28
+ - Correct type for Concerto.getModelManager()
29
+
27
30
  Version 2.0.0-alpha.1 {292b93fc879d3b0c3969711b24312ffd} 2022-03-30
28
31
  - Remove custom instanceof and add methods to check runtime type
29
32
  - Remove support for Node 12
package/lib/concerto.js CHANGED
@@ -16,9 +16,17 @@
16
16
 
17
17
  const URIJS = require('urijs');
18
18
  const RESOURCE_SCHEME = 'resource';
19
- const TypedStack = require('@accordproject/concerto-util').TypedStack;
19
+ const { TypedStack } = require('@accordproject/concerto-util');
20
20
  const ObjectValidator = require('./serializer/objectvalidator');
21
21
 
22
+ // Types needed for TypeScript generation.
23
+ /* eslint-disable no-unused-vars */
24
+ /* istanbul ignore next */
25
+ if (global === undefined) {
26
+ const ModelManager = require('./modelmanager');
27
+ }
28
+ /* eslint-enable no-unused-vars */
29
+
22
30
  /**
23
31
  * Runtime API for Concerto.
24
32
  *
@@ -28,7 +36,7 @@ const ObjectValidator = require('./serializer/objectvalidator');
28
36
  class Concerto {
29
37
  /**
30
38
  * Create a Concerto instance.
31
- * @param {*} modelManager - The this.modelManager to use for validation etc.
39
+ * @param {ModelManager} modelManager - The this.modelManager to use for validation etc.
32
40
  */
33
41
  constructor(modelManager) {
34
42
  this.modelManager = modelManager;
@@ -50,7 +58,7 @@ class Concerto {
50
58
 
51
59
  /**
52
60
  * Returns the model manager
53
- * @returns {*} the model manager associated with this Concerto class
61
+ * @returns {ModelManager} the model manager associated with this Concerto class
54
62
  */
55
63
  getModelManager() {
56
64
  return this.modelManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accordproject/concerto-core",
3
- "version": "2.0.0",
3
+ "version": "2.0.1-20220425112621",
4
4
  "description": "Core Implementation for the Concerto Modeling Language",
5
5
  "homepage": "https://github.com/accordproject/concerto",
6
6
  "engines": {
@@ -65,9 +65,9 @@
65
65
  "yargs": "17.3.1"
66
66
  },
67
67
  "dependencies": {
68
- "@accordproject/concerto-cto": "2.0.0",
69
- "@accordproject/concerto-metamodel": "2.0.0",
70
- "@accordproject/concerto-util": "2.0.0",
68
+ "@accordproject/concerto-cto": "2.0.1-20220425112621",
69
+ "@accordproject/concerto-metamodel": "2.0.1-20220425112621",
70
+ "@accordproject/concerto-util": "2.0.1-20220425112621",
71
71
  "dayjs": "1.10.8",
72
72
  "debug": "4.3.1",
73
73
  "lorem-ipsum": "2.0.3",
@@ -8,10 +8,10 @@ export = Concerto;
8
8
  declare class Concerto {
9
9
  /**
10
10
  * Create a Concerto instance.
11
- * @param {*} modelManager - The this.modelManager to use for validation etc.
11
+ * @param {ModelManager} modelManager - The this.modelManager to use for validation etc.
12
12
  */
13
- constructor(modelManager: any);
14
- modelManager: any;
13
+ constructor(modelManager: ModelManager);
14
+ modelManager: ModelManager;
15
15
  /**
16
16
  * Validates the instance against its model.
17
17
  * @param {*} obj the input object
@@ -21,9 +21,9 @@ declare class Concerto {
21
21
  validate(obj: any, options?: any): void;
22
22
  /**
23
23
  * Returns the model manager
24
- * @returns {*} the model manager associated with this Concerto class
24
+ * @returns {ModelManager} the model manager associated with this Concerto class
25
25
  */
26
- getModelManager(): any;
26
+ getModelManager(): ModelManager;
27
27
  /**
28
28
  * Returns true if the input object is a Concerto object
29
29
  * @param {*} obj the input object
@@ -99,3 +99,4 @@ declare class Concerto {
99
99
  */
100
100
  getNamespace(obj: any): string;
101
101
  }
102
+ import ModelManager = require("./modelmanager");