arvo-core 0.0.2 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
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
+
package/README.md CHANGED
@@ -39,3 +39,10 @@ The package also includes utility functions for:
39
39
  - Creating ArvoEvents
40
40
  - Integrating with OpenTelemetry
41
41
  - TypeScript types for core components
42
+
43
+ ## License
44
+
45
+ This package is available under the MIT License. For more details, refer to the [LICENSE.md](LICENSE.md) file in the project repository.
46
+
47
+ ## Change Logs
48
+ See the package change logs [here](CHANGELOG.md).
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arvo-core",
3
- "version": "0.0.2",
3
+ "version": "1.0.1",
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": {
@@ -1,29 +0,0 @@
1
- #!/bin/bash
2
-
3
- # File name
4
- CHANGELOG_FILE="CHANGELOG.md"
5
-
6
- # Get current date
7
- CURRENT_DATE=$(date +"%Y-%m-%d")
8
-
9
- # Prompt for version
10
- read -p "Enter version number: " VERSION
11
-
12
- # Prompt for description
13
- read -p "Enter change description: " DESCRIPTION
14
-
15
- # Create or append to CHANGELOG.md
16
- if [ ! -f "$CHANGELOG_FILE" ]; then
17
- echo "# Changelog" > "$CHANGELOG_FILE"
18
- echo "" >> "$CHANGELOG_FILE"
19
- fi
20
-
21
- # Add new entry
22
- {
23
- echo "## [$VERSION] - $CURRENT_DATE"
24
- echo ""
25
- echo "- $DESCRIPTION"
26
- echo ""
27
- } >> "$CHANGELOG_FILE"
28
-
29
- echo "Changelog updated successfully!"