arvo-event-handler 2.1.5 → 2.1.7

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.
@@ -11,6 +11,10 @@ import { ArvoEventHandlerOpenTelemetryOptions } from '../types';
11
11
  * ```
12
12
  */
13
13
  export default abstract class AbstractArvoEventHandler {
14
+ /**
15
+ * Unique identifier for the event handler source system
16
+ */
17
+ abstract source: string;
14
18
  /**
15
19
  * Executes the event handling logic for a given Arvo event.
16
20
  *
package/dist/types.d.ts CHANGED
@@ -1,20 +1,31 @@
1
+ import AbstractArvoEventHandler from "./AbstractArvoEventHandler";
1
2
  /**
2
- * Creates a new type based on T where all properties are optional except for those specified in K.
3
- *
4
- * @template T - The original type.
5
- * @template K - A union of keys from T that should remain required.
6
- *
7
- * @example
8
- * interface User {
9
- * id: number;
10
- * name: string;
11
- * email: string;
12
- * }
13
- *
14
- * type PartialUserExceptId = PartialExcept<User, 'id'>;
15
- * // Equivalent to: { id: number; name?: string; email?: string; }
16
- */
3
+ * Makes properties optional except specified keys
4
+ *
5
+ * @template T - Original type
6
+ * @template K - Keys to keep required
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * interface User {
11
+ * id: number;
12
+ * name: string;
13
+ * }
14
+ *
15
+ * type PartialUser = PartialExcept<User, 'id'>;
16
+ * // Results in: { id: number; name?: string; }
17
+ * ```
18
+ */
17
19
  export type PartialExcept<T, K extends keyof T> = Partial<Omit<T, K>> & Pick<T, K>;
20
+ /**
21
+ * OpenTelemetry configuration for event handlers
22
+ */
18
23
  export type ArvoEventHandlerOpenTelemetryOptions = {
19
24
  inheritFrom: 'EVENT' | 'CONTEXT';
20
25
  };
26
+ /**
27
+ * Factory function type for creating event handlers
28
+ *
29
+ * @template T - Configuration parameter type
30
+ */
31
+ export type EventHandlerFactory<T> = (param: T) => AbstractArvoEventHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arvo-event-handler",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "description": "Type-safe event handler system with versioning, telemetry, and contract validation for distributed Arvo event-driven architectures, featuring routing and multi-handler support.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {