arvo-core 2.0.6 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,7 +60,7 @@ export default class ArvoContract<TUri extends string = string, TType extends st
60
60
  /**
61
61
  * Get the latest version of the contract
62
62
  */
63
- get latestVersion(): ArvoSemanticVersion | undefined;
63
+ get latestVersion(): ArvoSemanticVersion;
64
64
  /**
65
65
  * Gets the type and schema of the event that the contact
66
66
  * bound handler listens to.
@@ -35,6 +35,9 @@ var ArvoContract = /** @class */ (function () {
35
35
  this._type = params.type;
36
36
  this._versions = params.versions;
37
37
  this.description = (_a = params.description) !== null && _a !== void 0 ? _a : null;
38
+ if (!Object.keys(this._versions).length) {
39
+ throw new Error("A contract must have at least one version");
40
+ }
38
41
  }
39
42
  Object.defineProperty(ArvoContract.prototype, "uri", {
40
43
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arvo-core",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "This core package contains all the core classes and components of the Arvo Event Driven System",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {