@signaltree/events 7.3.3 → 7.3.5
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/index.esm.js +10 -1
- package/package.json +15 -7
- package/src/index.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -91,6 +91,15 @@ function createEventSchema(eventType, dataSchema) {
|
|
|
91
91
|
data: z.object(dataSchema)
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Create event schema from existing Zod object
|
|
96
|
+
*/
|
|
97
|
+
function createEventSchemaFromZod(eventType, dataSchema) {
|
|
98
|
+
return BaseEventSchema.extend({
|
|
99
|
+
type: z.literal(eventType),
|
|
100
|
+
data: dataSchema
|
|
101
|
+
});
|
|
102
|
+
}
|
|
94
103
|
// ============================================================================
|
|
95
104
|
// Validation Functions
|
|
96
105
|
// ============================================================================
|
|
@@ -164,4 +173,4 @@ function parseEvent(schema, event) {
|
|
|
164
173
|
return schema.safeParse(event);
|
|
165
174
|
}
|
|
166
175
|
|
|
167
|
-
export { BaseEventSchema, EventActorSchema, EventMetadataSchema, EventValidationError, EventVersionSchema, createEventSchema, isValidEvent, parseEvent, validateEvent };
|
|
176
|
+
export { BaseEventSchema, EventActorSchema, EventMetadataSchema, EventValidationError, EventVersionSchema, createEventSchema, createEventSchemaFromZod, isValidEvent, parseEvent, validateEvent };
|
package/package.json
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaltree/events",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.5",
|
|
4
4
|
"description": "Event-driven architecture infrastructure for SignalTree - event bus, subscribers, validation, and real-time sync",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
8
|
-
"main": "./index.
|
|
8
|
+
"main": "./index.cjs.js",
|
|
9
9
|
"module": "./index.esm.js",
|
|
10
10
|
"types": "./index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"types": "./index.d.ts",
|
|
13
14
|
"import": "./index.esm.js",
|
|
14
|
-
"
|
|
15
|
+
"require": "./index.cjs.js",
|
|
16
|
+
"default": "./index.esm.js"
|
|
15
17
|
},
|
|
16
18
|
"./nestjs": {
|
|
19
|
+
"types": "./nestjs.d.ts",
|
|
17
20
|
"import": "./nestjs.esm.js",
|
|
18
|
-
"
|
|
21
|
+
"require": "./nestjs.cjs.js",
|
|
22
|
+
"default": "./nestjs.esm.js"
|
|
19
23
|
},
|
|
20
24
|
"./angular": {
|
|
25
|
+
"types": "./angular.d.ts",
|
|
21
26
|
"import": "./angular.esm.js",
|
|
22
|
-
"
|
|
27
|
+
"require": "./angular.cjs.js",
|
|
28
|
+
"default": "./angular.esm.js"
|
|
23
29
|
},
|
|
24
30
|
"./testing": {
|
|
31
|
+
"types": "./testing.d.ts",
|
|
25
32
|
"import": "./testing.esm.js",
|
|
26
|
-
"
|
|
33
|
+
"require": "./testing.cjs.js",
|
|
34
|
+
"default": "./testing.esm.js"
|
|
27
35
|
},
|
|
28
36
|
"./package.json": "./package.json"
|
|
29
37
|
},
|
|
@@ -107,4 +115,4 @@
|
|
|
107
115
|
"url": "https://github.com/JBorgia/signaltree/issues"
|
|
108
116
|
},
|
|
109
117
|
"homepage": "https://github.com/JBorgia/signaltree/tree/main/packages/events#readme"
|
|
110
|
-
}
|
|
118
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
*/
|
|
49
49
|
export type { BaseEvent, EventMetadata, EventActor, EventPriority, EventVersion, } from './core/types';
|
|
50
50
|
export { EVENT_PRIORITIES, DEFAULT_EVENT_VERSION } from './core/types';
|
|
51
|
-
export { createEventSchema, BaseEventSchema, EventMetadataSchema, EventActorSchema, EventVersionSchema, validateEvent, isValidEvent, parseEvent, EventValidationError, } from './core/validation';
|
|
51
|
+
export { createEventSchema, createEventSchemaFromZod, BaseEventSchema, EventMetadataSchema, EventActorSchema, EventVersionSchema, validateEvent, isValidEvent, parseEvent, EventValidationError, } from './core/validation';
|
|
52
52
|
export { EventRegistry, createEventRegistry, type RegisteredEvent, type EventRegistryConfig, type EventCatalog, type EventCatalogEntry, } from './core/registry';
|
|
53
53
|
export { createEvent, createEventFactory, generateEventId, generateCorrelationId, type EventFactory, type EventFactoryConfig, type CreateEventOptions, } from './core/factory';
|
|
54
54
|
export { classifyError, isRetryableError, createErrorClassifier, defaultErrorClassifier, DEFAULT_RETRY_CONFIGS, type ErrorClassification, type RetryConfig, type ClassificationResult, type ErrorClassifier, type ErrorClassifierConfig, } from './core/error-classification';
|