arvo-core 1.0.0 → 1.0.1
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.md +4 -0
- package/dist/ArvoContract/index.d.ts +11 -1
- package/dist/ArvoContract/index.js +10 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,3 +3,7 @@
|
|
3
3
|
## [1.0.0] - 2024-08-31
|
4
4
|
|
5
5
|
- Finalised the first release version of the core. This contains core class such as ArvoEvent, ArvoContract, and ArvoContractLibrary. Moreover, this release contains utility functions for string manipulation, validation and OpenTelemetry
|
6
|
+
## [1.0.1] - 2024-08-31
|
7
|
+
|
8
|
+
- Update ArvoContract description
|
9
|
+
|
@@ -19,17 +19,27 @@ export default class ArvoContract<T extends string = string, TAccepts extends Ar
|
|
19
19
|
private readonly _uri;
|
20
20
|
private readonly _accepts;
|
21
21
|
private readonly _emits;
|
22
|
+
/** (Optional) The Contract description */
|
22
23
|
readonly description: string | null;
|
23
24
|
/**
|
24
25
|
* Creates an instance of ArvoContract.
|
25
26
|
* @param {IArvoContract<T, TAccepts, TEmits>} params - The contract parameters.
|
26
27
|
*/
|
27
28
|
constructor(params: IArvoContract<T, TAccepts, TEmits>);
|
29
|
+
/**
|
30
|
+
* Gets the URI of the contract.
|
31
|
+
* @returns {T} The contract's URI.
|
32
|
+
*/
|
28
33
|
get uri(): T;
|
34
|
+
/**
|
35
|
+
* Gets the accepted record type and schema.
|
36
|
+
* @returns {Readonly<TAccepts>} The frozen accepts object.
|
37
|
+
*/
|
29
38
|
get accepts(): TAccepts;
|
30
39
|
/**
|
31
40
|
* Gets all emitted event types and schemas as a readonly record.
|
32
41
|
* Use this when you need to access all emitted events at once.
|
42
|
+
* @returns {Readonly<Record<ExtractEventType<TEmits>, TEmits>>} A frozen record of all emitted events.
|
33
43
|
*/
|
34
44
|
get emits(): Record<ExtractEventType<TEmits>, TEmits>;
|
35
45
|
/**
|
@@ -89,7 +99,7 @@ export default class ArvoContract<T extends string = string, TAccepts extends Ar
|
|
89
99
|
* This method provides a way to represent the contract's structure and validation rules
|
90
100
|
* in a format that conforms to the JSON Schema specification.
|
91
101
|
*
|
92
|
-
* @returns An object representing the contract in JSON Schema format, including:
|
102
|
+
* @returns {Object} An object representing the contract in JSON Schema format, including:
|
93
103
|
* - uri: The contract's URI
|
94
104
|
* - description: The contract's description (if available)
|
95
105
|
* - accepts: An object containing the accepted input type and its JSON Schema representation
|
@@ -24,6 +24,10 @@ var ArvoContract = /** @class */ (function () {
|
|
24
24
|
Object.freeze(this);
|
25
25
|
}
|
26
26
|
Object.defineProperty(ArvoContract.prototype, "uri", {
|
27
|
+
/**
|
28
|
+
* Gets the URI of the contract.
|
29
|
+
* @returns {T} The contract's URI.
|
30
|
+
*/
|
27
31
|
get: function () {
|
28
32
|
return this._uri;
|
29
33
|
},
|
@@ -31,6 +35,10 @@ var ArvoContract = /** @class */ (function () {
|
|
31
35
|
configurable: true
|
32
36
|
});
|
33
37
|
Object.defineProperty(ArvoContract.prototype, "accepts", {
|
38
|
+
/**
|
39
|
+
* Gets the accepted record type and schema.
|
40
|
+
* @returns {Readonly<TAccepts>} The frozen accepts object.
|
41
|
+
*/
|
34
42
|
get: function () {
|
35
43
|
return Object.freeze(this._accepts);
|
36
44
|
},
|
@@ -41,6 +49,7 @@ var ArvoContract = /** @class */ (function () {
|
|
41
49
|
/**
|
42
50
|
* Gets all emitted event types and schemas as a readonly record.
|
43
51
|
* Use this when you need to access all emitted events at once.
|
52
|
+
* @returns {Readonly<Record<ExtractEventType<TEmits>, TEmits>>} A frozen record of all emitted events.
|
44
53
|
*/
|
45
54
|
get: function () {
|
46
55
|
return Object.freeze(this._emits.reduce(function (acc, emit) {
|
@@ -145,7 +154,7 @@ var ArvoContract = /** @class */ (function () {
|
|
145
154
|
* This method provides a way to represent the contract's structure and validation rules
|
146
155
|
* in a format that conforms to the JSON Schema specification.
|
147
156
|
*
|
148
|
-
* @returns An object representing the contract in JSON Schema format, including:
|
157
|
+
* @returns {Object} An object representing the contract in JSON Schema format, including:
|
149
158
|
* - uri: The contract's URI
|
150
159
|
* - description: The contract's description (if available)
|
151
160
|
* - accepts: An object containing the accepted input type and its JSON Schema representation
|