arvo-event-handler 2.1.6 → 2.1.8

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 CHANGED
@@ -35,4 +35,3 @@
35
35
  ## [2.1.4] - 2024-12-19
36
36
 
37
37
  - Updated the opentelemetry core version and arvo core versions
38
-
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
+ * Makes properties optional except specified keys
3
4
  *
4
- * @template T - The original type.
5
- * @template K - A union of keys from T that should remain required.
5
+ * @template T - Original type
6
+ * @template K - Keys to keep required
6
7
  *
7
8
  * @example
9
+ * ```typescript
8
10
  * interface User {
9
11
  * id: number;
10
12
  * name: string;
11
- * email: string;
12
13
  * }
13
14
  *
14
- * type PartialUserExceptId = PartialExcept<User, 'id'>;
15
- * // Equivalent to: { id: number; name?: string; email?: string; }
15
+ * type PartialUser = PartialExcept<User, 'id'>;
16
+ * // Results in: { id: number; name?: string; }
17
+ * ```
16
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 extends Record<string, any> = Record<string, any>> = (param: T) => AbstractArvoEventHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arvo-event-handler",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
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": {