arvo-core 1.1.9 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -38,6 +38,14 @@ export default class ArvoContractLibrary<T extends ArvoContract> {
|
|
38
38
|
get<U extends ExtractContractUri<T>>(uri: U): Extract<T, {
|
39
39
|
uri: U;
|
40
40
|
}>;
|
41
|
+
/**
|
42
|
+
* Get an object where keys are contract URIs and values are readonly contract instances.
|
43
|
+
*/
|
44
|
+
get contracts(): {
|
45
|
+
[K in ExtractContractUri<T>]: Extract<T, {
|
46
|
+
uri: K;
|
47
|
+
}>;
|
48
|
+
};
|
41
49
|
/**
|
42
50
|
* Checks if the library contains a contract with the given URI.
|
43
51
|
* @param {string} uri - The URI to check for.
|
@@ -50,6 +50,19 @@ var ArvoContractLibrary = /** @class */ (function () {
|
|
50
50
|
}
|
51
51
|
return Object.freeze(contract);
|
52
52
|
};
|
53
|
+
Object.defineProperty(ArvoContractLibrary.prototype, "contracts", {
|
54
|
+
/**
|
55
|
+
* Get an object where keys are contract URIs and values are readonly contract instances.
|
56
|
+
*/
|
57
|
+
get: function () {
|
58
|
+
return Object.freeze(Object.assign.apply(Object, __spreadArray([{}], this._contracts.map(function (item) {
|
59
|
+
var _a;
|
60
|
+
return (_a = {}, _a[item.uri] = Object.freeze(item), _a);
|
61
|
+
}), false)));
|
62
|
+
},
|
63
|
+
enumerable: false,
|
64
|
+
configurable: true
|
65
|
+
});
|
53
66
|
/**
|
54
67
|
* Checks if the library contains a contract with the given URI.
|
55
68
|
* @param {string} uri - The URI to check for.
|
@@ -52,7 +52,7 @@ function isLowerAlphanumeric(input) {
|
|
52
52
|
*/
|
53
53
|
var createArvoOrchestratorContract = function (param) {
|
54
54
|
if (!isLowerAlphanumeric(param.name)) {
|
55
|
-
throw new Error("Invalid 'name' = '".concat(param.name, "'. The 'name' must only contain alphanumeric characters."));
|
55
|
+
throw new Error("Invalid 'name' = '".concat(param.name, "'. The 'name' must only contain alphanumeric characters. e.g. test.orchestrator"));
|
56
56
|
}
|
57
57
|
return new _1.default({
|
58
58
|
uri: param.uri,
|