arvo-core 2.3.0 → 2.3.3

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.
@@ -36,6 +36,7 @@ var generator = function (event, extensions, otelHeaders) {
36
36
  to: event.to ? encodeURI(event.to) : encodeURI(event.type),
37
37
  redirectto: event.redirectto ? encodeURI(event.redirectto) : null,
38
38
  dataschema: event.dataschema ? encodeURI(event.dataschema) : null,
39
+ parentid: event.parentid ? encodeURI(event.parentid) : null,
39
40
  }, event.data, extensions);
40
41
  };
41
42
  /**
@@ -50,6 +50,7 @@ export default class ArvoEvent<TData extends ArvoEventData = ArvoEventData, TExt
50
50
  accesscontrol: string | null;
51
51
  redirectto: string | null;
52
52
  executionunits: number | null;
53
+ parentid: string | null;
53
54
  } & {
54
55
  traceparent: string | null;
55
56
  tracestate: string | null;
@@ -93,6 +94,7 @@ export default class ArvoEvent<TData extends ArvoEventData = ArvoEventData, TExt
93
94
  'cloudevents.arvo.event_redirectto': string;
94
95
  'cloudevents.arvo.event_to': string;
95
96
  'cloudevents.arvo.event_executionunits': string | number;
97
+ 'cloudevents.arvo.event_parentid': string;
96
98
  };
97
99
  get to(): string | null;
98
100
  get accesscontrol(): string | null;
@@ -100,6 +102,7 @@ export default class ArvoEvent<TData extends ArvoEventData = ArvoEventData, TExt
100
102
  get executionunits(): number | null;
101
103
  get traceparent(): string | null;
102
104
  get tracestate(): string | null;
105
+ get parentid(): string | null;
103
106
  /**
104
107
  * Gets the custom extensions of the ArvoEvent.
105
108
  *
@@ -50,7 +50,7 @@ var ArvoEvent = /** @class */ (function () {
50
50
  this.data = schema_1.ArvoDataSchema.parse(data);
51
51
  var arvoExtension = schema_1.ArvoExtensionSchema.parse(context);
52
52
  var otelExtension = schema_1.OpenTelemetryExtensionSchema.parse(context);
53
- this._extensions = __assign(__assign({}, (extensions ? schema_1.CloudEventExtensionSchema.parse(extensions) : {})), { to: arvoExtension.to, accesscontrol: arvoExtension.accesscontrol, redirectto: arvoExtension.redirectto, executionunits: arvoExtension.executionunits, traceparent: otelExtension.traceparent, tracestate: otelExtension.tracestate });
53
+ this._extensions = __assign(__assign({}, (extensions ? schema_1.CloudEventExtensionSchema.parse(extensions) : {})), { to: arvoExtension.to, accesscontrol: arvoExtension.accesscontrol, redirectto: arvoExtension.redirectto, executionunits: arvoExtension.executionunits, traceparent: otelExtension.traceparent, tracestate: otelExtension.tracestate, parentid: arvoExtension.parentid });
54
54
  if (this.datacontenttype === schema_1.ArvoDataContentType) {
55
55
  if (!this._extensions.to) {
56
56
  throw new Error("The ArvoEvent must have a non-empty 'to' field");
@@ -121,7 +121,7 @@ var ArvoEvent = /** @class */ (function () {
121
121
  * as `cloudevents.arvo.event_*` fields.
122
122
  */
123
123
  get: function () {
124
- var _a, _b, _c, _d;
124
+ var _a, _b, _c, _d, _e;
125
125
  return {
126
126
  'cloudevents.event_id': this.id || OpenTelemetry_1.OTelNull,
127
127
  'cloudevents.event_source': this.source || OpenTelemetry_1.OTelNull,
@@ -134,6 +134,7 @@ var ArvoEvent = /** @class */ (function () {
134
134
  'cloudevents.arvo.event_redirectto': (_b = this._extensions.redirectto) !== null && _b !== void 0 ? _b : OpenTelemetry_1.OTelNull,
135
135
  'cloudevents.arvo.event_to': (_c = this._extensions.to) !== null && _c !== void 0 ? _c : OpenTelemetry_1.OTelNull,
136
136
  'cloudevents.arvo.event_executionunits': (_d = this._extensions.executionunits) !== null && _d !== void 0 ? _d : OpenTelemetry_1.OTelNull,
137
+ 'cloudevents.arvo.event_parentid': (_e = this._extensions.parentid) !== null && _e !== void 0 ? _e : OpenTelemetry_1.OTelNull,
137
138
  };
138
139
  },
139
140
  enumerable: false,
@@ -181,6 +182,13 @@ var ArvoEvent = /** @class */ (function () {
181
182
  enumerable: false,
182
183
  configurable: true
183
184
  });
185
+ Object.defineProperty(ArvoEvent.prototype, "parentid", {
186
+ get: function () {
187
+ return this._extensions.parentid;
188
+ },
189
+ enumerable: false,
190
+ configurable: true
191
+ });
184
192
  Object.defineProperty(ArvoEvent.prototype, "extensions", {
185
193
  /**
186
194
  * Gets the custom extensions of the ArvoEvent.
@@ -194,7 +202,7 @@ var ArvoEvent = /** @class */ (function () {
194
202
  */
195
203
  get: function () {
196
204
  var _a = this
197
- ._extensions, traceparent = _a.traceparent, tracestate = _a.tracestate, to = _a.to, redirectto = _a.redirectto, accesscontrol = _a.accesscontrol, executionunits = _a.executionunits, rest = __rest(_a, ["traceparent", "tracestate", "to", "redirectto", "accesscontrol", "executionunits"]);
205
+ ._extensions, traceparent = _a.traceparent, tracestate = _a.tracestate, to = _a.to, redirectto = _a.redirectto, accesscontrol = _a.accesscontrol, executionunits = _a.executionunits, parentid = _a.parentid, rest = __rest(_a, ["traceparent", "tracestate", "to", "redirectto", "accesscontrol", "executionunits", "parentid"]);
198
206
  return rest;
199
207
  },
200
208
  enumerable: false,
@@ -58,16 +58,19 @@ export declare const ArvoExtensionSchema: z.ZodObject<{
58
58
  accesscontrol: z.ZodNullable<z.ZodString>;
59
59
  redirectto: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
60
60
  executionunits: z.ZodNullable<z.ZodNumber>;
61
+ parentid: z.ZodNullable<z.ZodString>;
61
62
  }, "strip", z.ZodTypeAny, {
62
63
  to: string | null;
63
64
  accesscontrol: string | null;
64
65
  redirectto: string | null;
65
66
  executionunits: number | null;
67
+ parentid: string | null;
66
68
  }, {
67
69
  to: string | null;
68
70
  accesscontrol: string | null;
69
71
  redirectto: string | null;
70
72
  executionunits: number | null;
73
+ parentid: string | null;
71
74
  }>;
72
75
  /**
73
76
  * Zod schema for validating OpenTelemetry extensions to the CloudEvent.
@@ -101,6 +101,11 @@ exports.ArvoExtensionSchema = zod_1.z
101
101
  .number()
102
102
  .nullable()
103
103
  .describe((0, utils_1.cleanString)("\n This data field represents the cost associated with \n generating this specific cloudevent. It serves as a metric \n to track and measure the financial impact of event generation\n within cloud-based systems or applications.\n ")),
104
+ parentid: zod_1.z
105
+ .string()
106
+ .min(1, 'ID must be a non-empty string')
107
+ .nullable()
108
+ .describe((0, utils_1.cleanString)("\n The unique identifier of the event that directly triggered the creation \n of this event within the Arvo ecosystem. When set, it establishes a \n direct causal relationship for event lineage tracking and workflow \n orchestration. When null, it indicates this is an initiating event \n or was generated outside of direct event causation.\n ")),
104
109
  })
105
110
  .describe('Schema for Arvo-specific extensions to the CloudEvent.');
106
111
  /**
@@ -59,4 +59,6 @@ export type CreateArvoEvent<TData extends ArvoEventData, TType extends string> =
59
59
  traceparent?: string;
60
60
  /** Conveys vendor-specific trace information across service boundaries (OpenTelemetry). */
61
61
  tracestate?: string;
62
+ /** The unique identifier of the event that directly triggered the creation of this event within the Arvo ecosystem. */
63
+ parentid?: string;
62
64
  };
package/dist/index.d.ts CHANGED
@@ -74,16 +74,19 @@ declare const ArvoEventSchema: {
74
74
  accesscontrol: import("zod").ZodNullable<import("zod").ZodString>;
75
75
  redirectto: import("zod").ZodNullable<import("zod").ZodEffects<import("zod").ZodString, string, string>>;
76
76
  executionunits: import("zod").ZodNullable<import("zod").ZodNumber>;
77
+ parentid: import("zod").ZodNullable<import("zod").ZodString>;
77
78
  }, "strip", import("zod").ZodTypeAny, {
78
79
  to: string | null;
79
80
  accesscontrol: string | null;
80
81
  redirectto: string | null;
81
82
  executionunits: number | null;
83
+ parentid: string | null;
82
84
  }, {
83
85
  to: string | null;
84
86
  accesscontrol: string | null;
85
87
  redirectto: string | null;
86
88
  executionunits: number | null;
89
+ parentid: string | null;
87
90
  }>;
88
91
  OpenTelemetryExtensionSchema: import("zod").ZodObject<{
89
92
  traceparent: import("zod").ZodNullable<import("zod").ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arvo-core",
3
- "version": "2.3.0",
3
+ "version": "2.3.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": {