arvo-core 2.0.1 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -72,3 +72,7 @@
72
72
 
73
73
  - Added version support for contracts and simplified orchestrator contracts
74
74
 
75
+ ## [2.0.3] - 2024-11-24
76
+
77
+ - Remove potential security bug of reading the file system
78
+
package/README.md CHANGED
@@ -64,7 +64,6 @@ At its core, Arvo has only three main data structures:
64
64
 
65
65
  - [ArvoEvent](src/ArvoEvent/README.md) aims to provide a extendible variant of the open-source CloudEvent spec-ed object to define all the event in the system.
66
66
  - [ArvoContract](src/ArvoContract/README.md) is a basic class to define and impose contracts between services, ensuring trust in decoupled systems during build and development.
67
- - [ArvoContractLibrary](src/ArvoContractLibrary/README.md) is a utility class designed to manage and access multiple ArvoContract instances efficiently.
68
67
  - `ArvoErrorSchema` is the recommeded zod schema for all the errors in the ArvoEvents
69
68
 
70
69
  ## Utilities
@@ -86,8 +85,9 @@ To start using Arvo in your project:
86
85
  import {
87
86
  createArvoEvent,
88
87
  createArvoContract,
89
- createArvoContractLibrary,
90
88
  createArvoEventFactory,
89
+ createSimpleArvoContract,
90
+ createArvoOrchestratorContract,
91
91
  } from 'arvo-core';
92
92
  ```
93
93
 
@@ -11,7 +11,6 @@ export type ArvoOrchestrationSubjectContent = {
11
11
  /**
12
12
  * The name of the orchestrator.
13
13
  *
14
- * @remark
15
14
  * Should be prefixed with a reverse-DNS name.
16
15
  * **Note**: The string must not contain ';'
17
16
  *
@@ -31,7 +30,6 @@ export type ArvoOrchestrationSubjectContent = {
31
30
  /**
32
31
  * A unique identifier for the execution.
33
32
  *
34
- * @remark
35
33
  * Should be a non-empty string. The recomendation
36
34
  * is to use uuid v4 to generate these ids.
37
35
  * **Note**: The string must not contain ';'
@@ -43,7 +41,6 @@ export type ArvoOrchestrationSubjectContent = {
43
41
  /**
44
42
  * The entity or process that initiated the execution.
45
43
  *
46
- * @remark
47
44
  * Should be prefixed with a reverse-DNS name.
48
45
  * **Note**: The string must not contain ';'
49
46
  *
@@ -14,14 +14,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.OTelNull = exports.exceptionToSpan = exports.logToSpan = exports.fetchOpenTelemetryTracer = void 0;
15
15
  exports.currentOpenTelemetryHeaders = currentOpenTelemetryHeaders;
16
16
  var api_1 = require("@opentelemetry/api");
17
- var utils_1 = require("./utils");
18
17
  var core_1 = require("@opentelemetry/core");
19
18
  /**
20
19
  * A tracer instance for the ArvoCore package.
21
20
  */
22
21
  var fetchOpenTelemetryTracer = function () {
23
- var pkg = (0, utils_1.getPackageInfo)('arvo-core');
24
- return api_1.trace.getTracer(pkg.name, pkg.version);
22
+ return api_1.trace.getTracer('arvo-instrumentation');
25
23
  };
26
24
  exports.fetchOpenTelemetryTracer = fetchOpenTelemetryTracer;
27
25
  /**
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ import ArvoEventHttp from './ArvoEventHttp';
23
23
  import { ArvoEventHttpConfig } from './ArvoEventHttp/types';
24
24
  import { InferArvoContract, InferArvoEvent, ArvoSemanticVersion, ArvoErrorType } from './types';
25
25
  import { createArvoOrchestratorContract } from './ArvoOrchestratorContract';
26
- import { ICreateArvoOrchestratorContract } from './ArvoOrchestratorContract/types';
26
+ import { ICreateArvoOrchestratorContract, ArvoOrchestratorContract } from './ArvoOrchestratorContract/types';
27
27
  import { ArvoOrchestratorEventTypeGen } from './ArvoOrchestratorContract/typegen';
28
28
  /**
29
29
  * Collection of Zod schemas for validating various aspects of Arvo events.
@@ -99,4 +99,4 @@ declare const ArvoEventSchema: {
99
99
  parentSubject$$: string | null;
100
100
  }>;
101
101
  };
102
- export { ArvoEventHttpConfig, ArvoEventHttp, ArvoEvent, createArvoEvent, ArvoDataContentType, ArvoEventData, CloudEventExtension, ArvoEventSchema, CloudEventContext, ArvoExtension, OpenTelemetryExtension, CreateArvoEvent, exceptionToSpan, logToSpan, OpenTelemetryHeaders, TelemetryLogLevel, OTelNull, validateURI, cleanString, ArvoContract, createArvoContract, ArvoContractValidators, ArvoContractRecord, IArvoContract, ResolveArvoContractRecord, ArvoEventFactory, createArvoEventFactory, currentOpenTelemetryHeaders, OpenInference, OpenInferenceSpanKind, ArvoExecution, ArvoExecutionSpanKind, ArvoContractJSONSchema, ArvoOrchestrationSubject, ArvoOrchestrationSubjectContent, ArvoSemanticVersion, InferArvoEvent, InferArvoContract, createArvoOrchestratorContract, ICreateArvoOrchestratorContract, ArvoOrchestratorEventTypeGen, ExecutionOpenTelemetryConfiguration, parseEventDataSchema, ArvoOrchestrationSubjectContentSchema, ArvoSemanticVersionSchema, ArvoErrorSchema, ArvoErrorType, compareSemanticVersions, parseSemanticVersion, createSimpleArvoContract, };
102
+ export { ArvoEventHttpConfig, ArvoEventHttp, ArvoEvent, createArvoEvent, ArvoDataContentType, ArvoEventData, CloudEventExtension, ArvoEventSchema, CloudEventContext, ArvoExtension, OpenTelemetryExtension, CreateArvoEvent, exceptionToSpan, logToSpan, OpenTelemetryHeaders, TelemetryLogLevel, OTelNull, validateURI, cleanString, ArvoContract, createArvoContract, ArvoContractValidators, ArvoContractRecord, IArvoContract, ResolveArvoContractRecord, ArvoEventFactory, createArvoEventFactory, currentOpenTelemetryHeaders, OpenInference, OpenInferenceSpanKind, ArvoExecution, ArvoExecutionSpanKind, ArvoContractJSONSchema, ArvoOrchestrationSubject, ArvoOrchestrationSubjectContent, ArvoSemanticVersion, InferArvoEvent, InferArvoContract, createArvoOrchestratorContract, ICreateArvoOrchestratorContract, ArvoOrchestratorEventTypeGen, ExecutionOpenTelemetryConfiguration, parseEventDataSchema, ArvoOrchestrationSubjectContentSchema, ArvoSemanticVersionSchema, ArvoErrorSchema, ArvoErrorType, compareSemanticVersions, parseSemanticVersion, createSimpleArvoContract, ArvoOrchestratorContract, };
package/dist/types.d.ts CHANGED
@@ -6,8 +6,11 @@ import { ArvoErrorSchema } from './schema';
6
6
  /**
7
7
  * Represents the version of Arvo components following Semantic Versioning (SemVer).
8
8
  *
9
- * @format MAJOR.MINOR.PATCH where each component is a non-negative integer
10
- * @restriction Must not contain semicolons (;)
9
+ * Format:
10
+ * MAJOR.MINOR.PATCH where each component is a non-negative integer
11
+ *
12
+ * Restrictions:
13
+ * Must not contain semicolons (;)
11
14
  *
12
15
  * @example
13
16
  * ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arvo-core",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
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,4 +0,0 @@
1
- export declare function getPackageInfo(defaultName: string): {
2
- name: string;
3
- version: string;
4
- };
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getPackageInfo = getPackageInfo;
27
- var fs = __importStar(require("fs"));
28
- var path = __importStar(require("path"));
29
- function getPackageInfo(defaultName) {
30
- try {
31
- // Read the package.json file
32
- var packageJsonPath = path.resolve(__dirname, '../../package.json');
33
- var packageJsonContent = fs.readFileSync(packageJsonPath, 'utf-8');
34
- // Parse the JSON content
35
- var packageJson = JSON.parse(packageJsonContent);
36
- // Extract name and version
37
- var name_1 = packageJson.name, version = packageJson.version;
38
- return { name: name_1, version: version };
39
- }
40
- catch (error) {
41
- console.error('Error reading package.json:', error);
42
- return { name: defaultName, version: 'Unknown' };
43
- }
44
- }