@cosmneo/onion-lasagna 0.2.0 → 0.3.0
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/dist/chunk-36IO4BM7.js +113 -0
- package/dist/chunk-36IO4BM7.js.map +1 -0
- package/dist/chunk-4BVOLXDJ.js +54 -0
- package/dist/chunk-4BVOLXDJ.js.map +1 -0
- package/dist/{chunk-GGSAAZPM.js → chunk-AUMHMWDD.js} +19 -20
- package/dist/chunk-AUMHMWDD.js.map +1 -0
- package/dist/chunk-CBTICRSM.js +34 -0
- package/dist/chunk-CBTICRSM.js.map +1 -0
- package/dist/chunk-H5TNDC5U.js +138 -0
- package/dist/chunk-H5TNDC5U.js.map +1 -0
- package/dist/chunk-KJ4JGZOE.js +96 -0
- package/dist/chunk-KJ4JGZOE.js.map +1 -0
- package/dist/chunk-MF2JDREK.js +168 -0
- package/dist/chunk-MF2JDREK.js.map +1 -0
- package/dist/chunk-RVSBIYY4.js +1 -0
- package/dist/chunk-RVSBIYY4.js.map +1 -0
- package/dist/{chunk-PUVAB3JX.js → chunk-XIRJ73IO.js} +38 -36
- package/dist/chunk-XIRJ73IO.js.map +1 -0
- package/dist/{chunk-DS7TE6KZ.js → chunk-XP6PLTV2.js} +11 -3
- package/dist/chunk-XP6PLTV2.js.map +1 -0
- package/dist/chunk-XWKHOLIP.js +191 -0
- package/dist/chunk-XWKHOLIP.js.map +1 -0
- package/dist/event-router-definition.type-CP9uTlux.d.cts +150 -0
- package/dist/event-router-definition.type-D8CG-kjZ.d.ts +150 -0
- package/dist/events/asyncapi/index.cjs +143 -0
- package/dist/events/asyncapi/index.cjs.map +1 -0
- package/dist/events/asyncapi/index.d.cts +184 -0
- package/dist/events/asyncapi/index.d.ts +184 -0
- package/dist/events/asyncapi/index.js +8 -0
- package/dist/events/asyncapi/index.js.map +1 -0
- package/dist/events/handler/index.cjs +171 -0
- package/dist/events/handler/index.cjs.map +1 -0
- package/dist/events/handler/index.d.cts +153 -0
- package/dist/events/handler/index.d.ts +153 -0
- package/dist/events/handler/index.js +21 -0
- package/dist/events/handler/index.js.map +1 -0
- package/dist/events/index.cjs +497 -0
- package/dist/events/index.cjs.map +1 -0
- package/dist/events/index.d.cts +9 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.js +41 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/server/index.cjs +291 -0
- package/dist/events/server/index.cjs.map +1 -0
- package/dist/events/server/index.d.cts +281 -0
- package/dist/events/server/index.d.ts +281 -0
- package/dist/events/server/index.js +16 -0
- package/dist/events/server/index.js.map +1 -0
- package/dist/events/shared/index.cjs +85 -0
- package/dist/events/shared/index.cjs.map +1 -0
- package/dist/events/shared/index.d.cts +35 -0
- package/dist/events/shared/index.d.ts +35 -0
- package/dist/events/shared/index.js +13 -0
- package/dist/events/shared/index.js.map +1 -0
- package/dist/global.js +3 -3
- package/dist/http/index.cjs +563 -93
- package/dist/http/index.cjs.map +1 -1
- package/dist/http/index.d.cts +5 -3
- package/dist/http/index.d.ts +5 -3
- package/dist/http/index.js +30 -12
- package/dist/http/openapi/index.cjs +43 -35
- package/dist/http/openapi/index.cjs.map +1 -1
- package/dist/http/openapi/index.d.cts +8 -34
- package/dist/http/openapi/index.d.ts +8 -34
- package/dist/http/openapi/index.js +2 -2
- package/dist/http/route/index.cjs +106 -9
- package/dist/http/route/index.cjs.map +1 -1
- package/dist/http/route/index.d.cts +133 -227
- package/dist/http/route/index.d.ts +133 -227
- package/dist/http/route/index.js +5 -2
- package/dist/http/server/index.cjs +24 -19
- package/dist/http/server/index.cjs.map +1 -1
- package/dist/http/server/index.d.cts +4 -261
- package/dist/http/server/index.d.ts +4 -261
- package/dist/http/server/index.js +2 -2
- package/dist/http/shared/index.cjs.map +1 -1
- package/dist/http/shared/index.d.cts +10 -14
- package/dist/http/shared/index.d.ts +10 -14
- package/dist/http/shared/index.js +11 -127
- package/dist/http/shared/index.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/{router-definition.type-ynBhT16T.d.cts → router-definition.type-BElX-Pl4.d.cts} +169 -256
- package/dist/{router-definition.type-DORVlLNk.d.ts → router-definition.type-DxG8ncJZ.d.ts} +169 -256
- package/dist/types-B6Q1iCgf.d.ts +262 -0
- package/dist/types-afYpL7Ap.d.cts +262 -0
- package/dist/types-cke61juH.d.cts +42 -0
- package/dist/types-cke61juH.d.ts +42 -0
- package/package.json +35 -2
- package/dist/chunk-BZULBF4N.js +0 -82
- package/dist/chunk-BZULBF4N.js.map +0 -1
- package/dist/chunk-DS7TE6KZ.js.map +0 -1
- package/dist/chunk-GGSAAZPM.js.map +0 -1
- package/dist/chunk-PUVAB3JX.js.map +0 -1
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { E as EventHandlerDefinition, c as EventRouterConfig, f as EventRouterKeys, e as EventRouterDefinition, G as GetEventHandler } from '../../event-router-definition.type-D8CG-kjZ.js';
|
|
2
|
+
import { E as EventResult } from '../../types-cke61juH.js';
|
|
3
|
+
export { U as UseCasePort } from '../../types-B6Q1iCgf.js';
|
|
4
|
+
import '../../http/schema/types.js';
|
|
5
|
+
import '../../router-definition.type-DxG8ncJZ.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Server types for the event handler system.
|
|
9
|
+
*
|
|
10
|
+
* @module events/server/types
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Event metadata provided by the messaging system.
|
|
15
|
+
*/
|
|
16
|
+
interface EventMetadata {
|
|
17
|
+
/** Unique event identifier for idempotency checks. */
|
|
18
|
+
readonly eventId: string;
|
|
19
|
+
/** ISO 8601 timestamp of when the event occurred. */
|
|
20
|
+
readonly timestamp: string;
|
|
21
|
+
/** Correlation ID for distributed tracing. */
|
|
22
|
+
readonly correlationId?: string;
|
|
23
|
+
/** Source system or bounded context that emitted the event. */
|
|
24
|
+
readonly source?: string;
|
|
25
|
+
/** Number of delivery attempts (1-based). */
|
|
26
|
+
readonly attemptCount?: number;
|
|
27
|
+
/** Additional metadata from the messaging system. */
|
|
28
|
+
readonly [key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Raw event from the messaging system.
|
|
32
|
+
* This is the input to event handlers before validation.
|
|
33
|
+
*/
|
|
34
|
+
interface RawEvent {
|
|
35
|
+
/** Event type string for routing. */
|
|
36
|
+
readonly type: string;
|
|
37
|
+
/** Event payload (unvalidated). */
|
|
38
|
+
readonly payload: unknown;
|
|
39
|
+
/** Event metadata from the messaging system. */
|
|
40
|
+
readonly metadata: EventMetadata;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A validated event with typed payload.
|
|
44
|
+
* This is what handlers receive after validation passes.
|
|
45
|
+
*/
|
|
46
|
+
interface ValidatedEvent<THandler extends EventHandlerDefinition> {
|
|
47
|
+
/** Validated event payload. */
|
|
48
|
+
readonly payload: THandler['_types']['payload'];
|
|
49
|
+
/** Raw event object for advanced use cases. */
|
|
50
|
+
readonly raw: RawEvent;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Typed event context based on handler definition.
|
|
54
|
+
* If the handler defines a context schema, this will be the validated type.
|
|
55
|
+
* Otherwise, it falls back to the generic EventMetadata.
|
|
56
|
+
*/
|
|
57
|
+
type TypedEventContext<THandler extends EventHandlerDefinition> = THandler['_types']['context'] extends undefined ? EventMetadata : THandler['_types']['context'];
|
|
58
|
+
/**
|
|
59
|
+
* Handler configuration using the use case pattern.
|
|
60
|
+
*
|
|
61
|
+
* @typeParam THandler - The event handler definition type
|
|
62
|
+
* @typeParam TInput - Use case input type
|
|
63
|
+
* @typeParam TOutput - Use case output type
|
|
64
|
+
*/
|
|
65
|
+
interface EventHandlerConfig<THandler extends EventHandlerDefinition, TInput = void, TOutput = void> {
|
|
66
|
+
/**
|
|
67
|
+
* Maps the validated event payload to use case input.
|
|
68
|
+
* Both `event` and `ctx` are fully typed based on handler schemas.
|
|
69
|
+
*/
|
|
70
|
+
readonly payloadMapper: (event: ValidatedEvent<THandler>, ctx: TypedEventContext<THandler>) => TInput;
|
|
71
|
+
/** The use case to execute. */
|
|
72
|
+
readonly useCase: {
|
|
73
|
+
execute(input?: TInput): Promise<TOutput>;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Maps the use case output to an EventResult.
|
|
77
|
+
* If omitted, defaults to `{ outcome: 'ack' }`.
|
|
78
|
+
*/
|
|
79
|
+
readonly resultMapper?: (output: TOutput) => EventResult;
|
|
80
|
+
/** Middleware to run before the handler. */
|
|
81
|
+
readonly middleware?: readonly EventMiddlewareFunction[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Simple handler function that directly returns an EventResult.
|
|
85
|
+
*/
|
|
86
|
+
type SimpleEventHandlerFn<THandler extends EventHandlerDefinition> = (event: ValidatedEvent<THandler>, ctx: TypedEventContext<THandler>) => Promise<EventResult> | EventResult;
|
|
87
|
+
/**
|
|
88
|
+
* Configuration for a simple handler (no use case).
|
|
89
|
+
*/
|
|
90
|
+
interface SimpleEventHandlerConfig<THandler extends EventHandlerDefinition> {
|
|
91
|
+
readonly handler: SimpleEventHandlerFn<THandler>;
|
|
92
|
+
readonly middleware?: readonly EventMiddlewareFunction[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Union of all event handler config types.
|
|
96
|
+
* Used internally to store handlers in the builder.
|
|
97
|
+
*/
|
|
98
|
+
type AnyEventHandlerConfig<THandler extends EventHandlerDefinition, TInput = unknown, TOutput = unknown> = EventHandlerConfig<THandler, TInput, TOutput> | SimpleEventHandlerConfig<THandler>;
|
|
99
|
+
/**
|
|
100
|
+
* Type guard to check if config is a simple event handler.
|
|
101
|
+
*/
|
|
102
|
+
declare function isSimpleEventHandlerConfig(config: AnyEventHandlerConfig<EventHandlerDefinition, unknown, unknown>): config is SimpleEventHandlerConfig<EventHandlerDefinition>;
|
|
103
|
+
/**
|
|
104
|
+
* Event middleware function type.
|
|
105
|
+
*/
|
|
106
|
+
type EventMiddlewareFunction = (event: RawEvent, next: () => Promise<EventResult>) => Promise<EventResult>;
|
|
107
|
+
/**
|
|
108
|
+
* Configuration mapping handler keys to handler configs.
|
|
109
|
+
*/
|
|
110
|
+
type EventRoutesConfig<T extends EventRouterConfig> = Record<EventRouterKeys<T>, EventHandlerConfig<any, any, any>>;
|
|
111
|
+
/**
|
|
112
|
+
* Options for creating event routes.
|
|
113
|
+
*/
|
|
114
|
+
interface CreateEventRoutesOptions {
|
|
115
|
+
/** Global middleware to run before all handlers. */
|
|
116
|
+
readonly middleware?: readonly EventMiddlewareFunction[];
|
|
117
|
+
/**
|
|
118
|
+
* Whether to validate incoming event payloads against handler schemas.
|
|
119
|
+
* When enabled, invalid payloads result in a `dlq` outcome.
|
|
120
|
+
* @default true
|
|
121
|
+
*/
|
|
122
|
+
readonly validatePayload?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Custom error mapper to override default error-to-EventResult mapping.
|
|
125
|
+
* If not provided, uses the built-in `mapErrorToEventResult`.
|
|
126
|
+
*/
|
|
127
|
+
readonly errorMapper?: (error: unknown) => EventResult;
|
|
128
|
+
/**
|
|
129
|
+
* Allow partial handler configuration (not all handlers need to be wired).
|
|
130
|
+
* @default false
|
|
131
|
+
* @internal Used by builder pattern's buildPartial()
|
|
132
|
+
*/
|
|
133
|
+
readonly allowPartial?: boolean;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Event input compatible with messaging adapters.
|
|
137
|
+
* This is the output of eventRoutes().build().
|
|
138
|
+
*/
|
|
139
|
+
interface UnifiedEventInput {
|
|
140
|
+
/** Event type string for routing. */
|
|
141
|
+
readonly eventType: string;
|
|
142
|
+
/** Handler function. */
|
|
143
|
+
readonly handler: (rawEvent: RawEvent) => Promise<EventResult>;
|
|
144
|
+
/** Handler metadata for documentation. */
|
|
145
|
+
readonly metadata: {
|
|
146
|
+
readonly handlerId?: string;
|
|
147
|
+
readonly summary?: string;
|
|
148
|
+
readonly description?: string;
|
|
149
|
+
readonly tags?: readonly string[];
|
|
150
|
+
readonly deprecated?: boolean;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @fileoverview Builder pattern for creating type-safe event routes.
|
|
156
|
+
*
|
|
157
|
+
* The `eventRoutes` function returns a builder that provides 100% type inference
|
|
158
|
+
* for all handler parameters — no manual type annotations required.
|
|
159
|
+
*
|
|
160
|
+
* @module events/server/event-routes-builder
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Error type displayed when attempting to build() with missing handlers.
|
|
165
|
+
* The `___missingHandlers` property shows which handlers are missing.
|
|
166
|
+
*/
|
|
167
|
+
interface MissingHandlersError<TMissing extends string> {
|
|
168
|
+
/**
|
|
169
|
+
* This error indicates that not all event handlers have been wired.
|
|
170
|
+
* Use buildPartial() to build with only the defined handlers,
|
|
171
|
+
* or add handlers for the missing events.
|
|
172
|
+
*/
|
|
173
|
+
(options?: never): never;
|
|
174
|
+
/** Event handlers that are missing. */
|
|
175
|
+
readonly ___missingHandlers: TMissing;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Handler configuration for the builder pattern.
|
|
179
|
+
*/
|
|
180
|
+
interface BuilderEventHandlerConfig<THandler extends EventHandlerDefinition, TInput, TOutput> {
|
|
181
|
+
/**
|
|
182
|
+
* Maps the validated event payload to use case input.
|
|
183
|
+
* Both `event` and `ctx` are fully typed based on handler schemas.
|
|
184
|
+
*/
|
|
185
|
+
readonly payloadMapper: (event: ValidatedEvent<THandler>, ctx: TypedEventContext<THandler>) => TInput;
|
|
186
|
+
/** The use case to execute. */
|
|
187
|
+
readonly useCase: {
|
|
188
|
+
execute(input?: TInput): Promise<TOutput>;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Maps the use case output to an EventResult.
|
|
192
|
+
* If omitted, defaults to `{ outcome: 'ack' }`.
|
|
193
|
+
*/
|
|
194
|
+
readonly resultMapper?: (output: TOutput) => EventResult;
|
|
195
|
+
/** Middleware to run before the handler. */
|
|
196
|
+
readonly middleware?: readonly EventMiddlewareFunction[];
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Builder interface for creating type-safe event routes.
|
|
200
|
+
*
|
|
201
|
+
* Each `.handle()` call captures the specific handler type and provides
|
|
202
|
+
* full type inference for payloadMapper and useCase.
|
|
203
|
+
*
|
|
204
|
+
* @typeParam T - The event router configuration type
|
|
205
|
+
* @typeParam THandled - Union of handler keys that have been wired (accumulates)
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* const routes = eventRoutes(ticketEvents)
|
|
210
|
+
* .handleWithUseCase('created', {
|
|
211
|
+
* payloadMapper: (event, ctx) => ({
|
|
212
|
+
* ticketId: event.payload.ticketId, // Fully typed!
|
|
213
|
+
* correlationId: ctx.correlationId, // Fully typed!
|
|
214
|
+
* }),
|
|
215
|
+
* useCase: sendNotificationUseCase,
|
|
216
|
+
* })
|
|
217
|
+
* .handle('assigned', async (event) => {
|
|
218
|
+
* await notifyAssignee(event.payload);
|
|
219
|
+
* return { outcome: 'ack' as const };
|
|
220
|
+
* })
|
|
221
|
+
* .build();
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
interface EventRoutesBuilder<T extends EventRouterConfig, THandled extends string = never> {
|
|
225
|
+
/**
|
|
226
|
+
* Register a simple handler for an event.
|
|
227
|
+
* The handler receives validated event and context, returns EventResult directly.
|
|
228
|
+
*/
|
|
229
|
+
handle<K extends Exclude<EventRouterKeys<T>, THandled>>(key: K, handlerOrConfig: SimpleEventHandlerFn<GetEventHandler<T, K>> | SimpleEventHandlerConfig<GetEventHandler<T, K>>): EventRoutesBuilder<T, THandled | K>;
|
|
230
|
+
/**
|
|
231
|
+
* Register a handler using the use case pattern.
|
|
232
|
+
* Follows: payloadMapper → useCase.execute() → resultMapper (or ack)
|
|
233
|
+
*/
|
|
234
|
+
handleWithUseCase<K extends Exclude<EventRouterKeys<T>, THandled>, TInput, TOutput>(key: K, config: BuilderEventHandlerConfig<GetEventHandler<T, K>, TInput, TOutput>): EventRoutesBuilder<T, THandled | K>;
|
|
235
|
+
/**
|
|
236
|
+
* Build the event routes array for messaging adapter registration.
|
|
237
|
+
*
|
|
238
|
+
* This method is only available when ALL handlers have been wired.
|
|
239
|
+
* If some handlers are missing, use `buildPartial()` instead.
|
|
240
|
+
*/
|
|
241
|
+
build: [Exclude<EventRouterKeys<T>, THandled>] extends [never] ? (options?: CreateEventRoutesOptions) => UnifiedEventInput[] : MissingHandlersError<Exclude<EventRouterKeys<T>, THandled>>;
|
|
242
|
+
/**
|
|
243
|
+
* Build event routes for only the defined handlers.
|
|
244
|
+
* No compile-time enforcement of completeness.
|
|
245
|
+
*/
|
|
246
|
+
buildPartial(options?: CreateEventRoutesOptions): UnifiedEventInput[];
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Creates a type-safe event routes builder for an event router.
|
|
250
|
+
*
|
|
251
|
+
* The builder pattern provides 100% type inference for all handler parameters:
|
|
252
|
+
* - `event.payload` is typed from the handler's payload schema
|
|
253
|
+
* - `ctx` is typed from the handler's context schema (or EventMetadata)
|
|
254
|
+
* - `output` in resultMapper is typed from the use case
|
|
255
|
+
*
|
|
256
|
+
* @param router - Event router definition or event router config
|
|
257
|
+
* @returns Builder for registering handlers
|
|
258
|
+
*
|
|
259
|
+
* @example Basic usage
|
|
260
|
+
* ```typescript
|
|
261
|
+
* import { eventRoutes } from '@cosmneo/onion-lasagna/events/server';
|
|
262
|
+
* import { ticketEvents } from './router';
|
|
263
|
+
*
|
|
264
|
+
* const routes = eventRoutes(ticketEvents)
|
|
265
|
+
* .handleWithUseCase('created', {
|
|
266
|
+
* payloadMapper: (event, ctx) => ({
|
|
267
|
+
* ticketId: event.payload.ticketId,
|
|
268
|
+
* correlationId: ctx.correlationId,
|
|
269
|
+
* }),
|
|
270
|
+
* useCase: sendNotificationUseCase,
|
|
271
|
+
* })
|
|
272
|
+
* .handle('assigned', async (event) => {
|
|
273
|
+
* await notifyAssignee(event.payload);
|
|
274
|
+
* return { outcome: 'ack' as const };
|
|
275
|
+
* })
|
|
276
|
+
* .build();
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
279
|
+
declare function eventRoutes<T extends EventRouterConfig>(router: T | EventRouterDefinition<T>): EventRoutesBuilder<T, never>;
|
|
280
|
+
|
|
281
|
+
export { type AnyEventHandlerConfig, type BuilderEventHandlerConfig, type CreateEventRoutesOptions, type EventHandlerConfig, type EventMetadata, type EventMiddlewareFunction, type EventRoutesBuilder, type EventRoutesConfig, type MissingHandlersError, type RawEvent, type SimpleEventHandlerConfig, type SimpleEventHandlerFn, type TypedEventContext, type UnifiedEventInput, type ValidatedEvent, eventRoutes, isSimpleEventHandlerConfig };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
eventRoutes,
|
|
3
|
+
isSimpleEventHandlerConfig
|
|
4
|
+
} from "../../chunk-XWKHOLIP.js";
|
|
5
|
+
import "../../chunk-4BVOLXDJ.js";
|
|
6
|
+
import "../../chunk-CBTICRSM.js";
|
|
7
|
+
import "../../chunk-H5TNDC5U.js";
|
|
8
|
+
import "../../chunk-2BVCU32G.js";
|
|
9
|
+
import "../../chunk-T7S574XQ.js";
|
|
10
|
+
import "../../chunk-3BY5RBF2.js";
|
|
11
|
+
import "../../chunk-A4JUAZK4.js";
|
|
12
|
+
export {
|
|
13
|
+
eventRoutes,
|
|
14
|
+
isSimpleEventHandlerConfig
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/presentation/events/shared/index.ts
|
|
21
|
+
var shared_exports = {};
|
|
22
|
+
__export(shared_exports, {
|
|
23
|
+
mapErrorToEventResult: () => mapErrorToEventResult
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(shared_exports);
|
|
26
|
+
|
|
27
|
+
// src/presentation/http/shared/error-mapping.ts
|
|
28
|
+
function isErrorType(error, typeName) {
|
|
29
|
+
if (!error || typeof error !== "object") return false;
|
|
30
|
+
const constructor = Object.prototype.hasOwnProperty.call(error, "constructor") ? error.constructor : Object.getPrototypeOf(error)?.constructor;
|
|
31
|
+
if (!constructor) return false;
|
|
32
|
+
const name = constructor.name;
|
|
33
|
+
return name === typeName || name === `_${typeName}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/presentation/events/shared/error-mapping.ts
|
|
37
|
+
var DLQ_ERROR_TYPES = [
|
|
38
|
+
"ObjectValidationError",
|
|
39
|
+
"InvalidRequestError",
|
|
40
|
+
"UseCaseError",
|
|
41
|
+
"DomainError",
|
|
42
|
+
"UnprocessableError",
|
|
43
|
+
"AccessDeniedError",
|
|
44
|
+
"ForbiddenError",
|
|
45
|
+
"UnauthorizedError",
|
|
46
|
+
"InvariantViolationError"
|
|
47
|
+
];
|
|
48
|
+
var RETRY_ERROR_TYPES = [
|
|
49
|
+
"NotFoundError",
|
|
50
|
+
"ConflictError",
|
|
51
|
+
"InfraError",
|
|
52
|
+
"DbError",
|
|
53
|
+
"NetworkError",
|
|
54
|
+
"TimeoutError",
|
|
55
|
+
"ExternalServiceError",
|
|
56
|
+
"PersistenceError"
|
|
57
|
+
];
|
|
58
|
+
function mapErrorToEventResult(error) {
|
|
59
|
+
for (const typeName of DLQ_ERROR_TYPES) {
|
|
60
|
+
if (isErrorType(error, typeName)) {
|
|
61
|
+
return {
|
|
62
|
+
outcome: "dlq",
|
|
63
|
+
reason: error.message
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
for (const typeName of RETRY_ERROR_TYPES) {
|
|
68
|
+
if (isErrorType(error, typeName)) {
|
|
69
|
+
return {
|
|
70
|
+
outcome: "retry",
|
|
71
|
+
reason: error.message
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const message = error instanceof Error ? error.message : "Unknown error occurred during event processing";
|
|
76
|
+
return {
|
|
77
|
+
outcome: "retry",
|
|
78
|
+
reason: message
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
mapErrorToEventResult
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/events/shared/index.ts","../../../src/presentation/http/shared/error-mapping.ts","../../../src/presentation/events/shared/error-mapping.ts"],"sourcesContent":["export type { EventResult } from './types';\nexport { mapErrorToEventResult } from './error-mapping';\n","/**\n * @fileoverview Centralized error mapping for HTTP frameworks.\n *\n * Provides a single source of truth for mapping onion-lasagna errors\n * to HTTP status codes and response bodies.\n *\n * @module http/shared/error-mapping\n */\n\nimport { CodedError } from '../../../global/exceptions/coded-error.error';\nimport { ObjectValidationError } from '../../../global/exceptions/object-validation.error';\nimport { DomainError } from '../../../domain/exceptions/domain.error';\nimport { UseCaseError } from '../../../app/exceptions/use-case.error';\nimport { NotFoundError } from '../../../app/exceptions/not-found.error';\nimport { ConflictError } from '../../../app/exceptions/conflict.error';\nimport { UnprocessableError } from '../../../app/exceptions/unprocessable.error';\nimport { ForbiddenError } from '../../../app/exceptions/forbidden.error';\nimport { UnauthorizedError } from '../../../app/exceptions/unauthorized.error';\nimport { InfraError } from '../../../infra/exceptions/infra.error';\nimport { ControllerError } from '../../exceptions/controller.error';\nimport { AccessDeniedError } from '../../exceptions/access-denied.error';\nimport { InvalidRequestError } from '../../exceptions/invalid-request.error';\nimport type { ErrorResponseBody, MappedErrorResponse } from './types';\n\n// ============================================================================\n// Constants and Interfaces\n// ============================================================================\n\n/**\n * Default masked error response for internal errors.\n */\nconst MASKED_ERROR_BODY: ErrorResponseBody = {\n message: 'An unexpected error occurred',\n errorCode: 'INTERNAL_ERROR',\n};\n\n/**\n * Known internal error type names that should be masked.\n */\nconst INTERNAL_ERROR_TYPES = [\n 'DomainError',\n 'InfraError',\n 'ControllerError',\n 'NetworkError',\n 'PersistenceError',\n 'ExternalServiceError',\n 'InvariantViolationError',\n];\n\n/**\n * Validation error item structure.\n */\ninterface ValidationErrorInput {\n field: string;\n message: string;\n}\n\n/**\n * Validation error structure for string-based checking.\n */\ninterface ValidationErrorItem {\n field: string;\n message: string;\n}\n\n/**\n * Interface for errors with validation items.\n */\ninterface ErrorWithValidation {\n message: string;\n code: string;\n validationErrors: ValidationErrorItem[];\n}\n\n/**\n * Interface for coded errors.\n */\ninterface CodedErrorLike {\n message: string;\n code: string;\n}\n\n// ============================================================================\n// String-based type checking helpers (for bundled code compatibility)\n// ============================================================================\n\n/**\n * Checks if error matches a specific error type by checking its constructor name.\n * This approach avoids issues with multiple class instances in bundled code.\n * Handles both original names and tsup's mangled names (prefixed with _).\n *\n * @param error - The error to check\n * @param typeName - The error type name to match\n * @returns True if error matches the type name\n */\nexport function isErrorType(error: unknown, typeName: string): error is CodedErrorLike {\n if (!error || typeof error !== 'object') return false;\n // Guard against objects without constructor (e.g., Object.create(null))\n const constructor = Object.prototype.hasOwnProperty.call(error, 'constructor')\n ? (error as { constructor?: { name?: string } }).constructor\n : Object.getPrototypeOf(error)?.constructor;\n if (!constructor) return false;\n const name = constructor.name;\n // Check both the original name and the mangled name (tsup prefixes with _)\n return name === typeName || name === `_${typeName}`;\n}\n\n/**\n * Checks if error has validation errors array.\n *\n * @param error - The error to check\n * @returns True if error has validationErrors property\n */\nexport function hasValidationErrors(error: unknown): error is ErrorWithValidation {\n if (!error || typeof error !== 'object') return false;\n return (\n 'validationErrors' in error && Array.isArray((error as ErrorWithValidation).validationErrors)\n );\n}\n\n// ============================================================================\n// Response body builders\n// ============================================================================\n\n/**\n * Builds a validation error response body from error details.\n *\n * @param message - The error message\n * @param code - The error code\n * @param validationErrors - Array of field validation errors\n * @returns Error response body with errorItems\n */\nfunction buildValidationErrorBody(\n message: string,\n code: string,\n validationErrors: readonly ValidationErrorInput[],\n): ErrorResponseBody {\n return {\n message,\n errorCode: code,\n errorItems: validationErrors.map((e) => ({\n item: e.field,\n message: e.message,\n })),\n };\n}\n\n/**\n * Builds a simple error response body from error details.\n *\n * @param message - The error message\n * @param code - The error code\n * @returns Error response body\n */\nfunction buildSimpleErrorBody(message: string, code: string): ErrorResponseBody {\n return {\n message,\n errorCode: code,\n };\n}\n\n// ============================================================================\n// Primary error mapping functions (with bundled code fallback)\n// ============================================================================\n\n/**\n * Maps an error to the appropriate HTTP status code.\n * Uses instanceof first, then falls back to name-based checking for bundled code.\n *\n * @param error - The error to map\n * @returns HTTP status code\n */\nexport function getHttpStatusCode(error: unknown): number {\n // Try instanceof first (faster)\n if (error instanceof ObjectValidationError) return 400;\n if (error instanceof InvalidRequestError) return 400;\n if (error instanceof UnauthorizedError) return 401;\n if (error instanceof ForbiddenError) return 403;\n if (error instanceof AccessDeniedError) return 403;\n if (error instanceof NotFoundError) return 404;\n if (error instanceof ConflictError) return 409;\n if (error instanceof UnprocessableError) return 422;\n if (error instanceof UseCaseError) return 400;\n\n // Fall back to name-based checking for bundled code (e.g., _NotFoundError)\n if (isErrorType(error, 'ObjectValidationError')) return 400;\n if (isErrorType(error, 'InvalidRequestError')) return 400;\n if (isErrorType(error, 'UnauthorizedError')) return 401;\n if (isErrorType(error, 'ForbiddenError')) return 403;\n if (isErrorType(error, 'AccessDeniedError')) return 403;\n if (isErrorType(error, 'NotFoundError')) return 404;\n if (isErrorType(error, 'ConflictError')) return 409;\n if (isErrorType(error, 'UnprocessableError')) return 422;\n if (isErrorType(error, 'UseCaseError')) return 400;\n\n return 500;\n}\n\n/**\n * Checks if an error should have its details masked in the response.\n *\n * Security-sensitive errors (domain, infrastructure, controller) are masked\n * to prevent leaking implementation details.\n * Uses instanceof first, then falls back to name-based checking for bundled code.\n *\n * @param error - The error to check\n * @returns True if error details should be hidden\n */\nexport function shouldMaskError(error: unknown): boolean {\n // Try instanceof first (faster)\n if (\n error instanceof DomainError ||\n error instanceof InfraError ||\n error instanceof ControllerError\n ) {\n return true;\n }\n\n // Fall back to name-based checking for bundled code\n for (const errorType of INTERNAL_ERROR_TYPES) {\n if (isErrorType(error, errorType)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Creates the response body for an error.\n * Uses instanceof first, then falls back to name-based checking for bundled code.\n *\n * @param error - The error to create body for\n * @returns Error response body\n */\nexport function createErrorResponseBody(error: unknown): ErrorResponseBody {\n // Masked errors - hide internal details\n if (shouldMaskError(error)) {\n return MASKED_ERROR_BODY;\n }\n\n // Validation errors - include field details (try instanceof first)\n if (error instanceof ObjectValidationError) {\n return buildValidationErrorBody(error.message, error.code, error.validationErrors);\n }\n if (error instanceof InvalidRequestError) {\n return buildValidationErrorBody(error.message, error.code, error.validationErrors);\n }\n\n // Validation errors - fall back to name-based checking for bundled code\n if (isErrorType(error, 'ObjectValidationError') && hasValidationErrors(error)) {\n return buildValidationErrorBody(error.message, error.code, error.validationErrors);\n }\n if (isErrorType(error, 'InvalidRequestError') && hasValidationErrors(error)) {\n return buildValidationErrorBody(error.message, error.code, error.validationErrors);\n }\n\n // Other coded errors - expose message and code (try instanceof first)\n if (error instanceof CodedError) {\n return buildSimpleErrorBody(error.message, error.code);\n }\n\n // Other coded errors - fall back to name-based checking\n if (isErrorType(error, 'CodedError')) {\n return buildSimpleErrorBody(error.message, error.code);\n }\n\n // Check for any error with message and code properties\n if (\n error &&\n typeof error === 'object' &&\n 'message' in error &&\n 'code' in error &&\n typeof (error as CodedErrorLike).message === 'string' &&\n typeof (error as CodedErrorLike).code === 'string'\n ) {\n return buildSimpleErrorBody((error as CodedErrorLike).message, (error as CodedErrorLike).code);\n }\n\n // Unknown errors - mask\n return MASKED_ERROR_BODY;\n}\n\n/**\n * Maps an error to a complete HTTP response structure.\n *\n * Mapping strategy (checked in order):\n * 1. `ObjectValidationError` / `InvalidRequestError` → 400 Bad Request (with field errors)\n * 2. `UseCaseError` → 400 Bad Request\n * 3. `UnauthorizedError` → 401 Unauthorized\n * 4. `ForbiddenError` / `AccessDeniedError` → 403 Forbidden\n * 5. `NotFoundError` → 404 Not Found\n * 6. `ConflictError` → 409 Conflict\n * 7. `UnprocessableError` → 422 Unprocessable Entity\n * 8. `DomainError` / `InfraError` / `ControllerError` → 500 Internal Server Error (masked)\n * 9. Unknown → 500 Internal Server Error (masked)\n *\n * @param error - The error to map\n * @returns Mapped error response with status and body\n */\nexport function mapErrorToHttpResponse(error: unknown): MappedErrorResponse {\n return {\n status: getHttpStatusCode(error),\n body: createErrorResponseBody(error),\n };\n}\n","/**\n * @fileoverview Error-to-EventResult mapping for event handlers.\n *\n * Maps caught errors to event processing outcomes (ack/retry/dlq).\n * Uses the same name-based type checking as the HTTP error mapper\n * for compatibility with bundled/minified code.\n *\n * @module events/shared/error-mapping\n */\n\nimport { isErrorType } from '../../http/shared/error-mapping';\nimport type { EventResult } from './types';\n\n// ============================================================================\n// Error Type Classifications\n// ============================================================================\n\n/**\n * Error types that indicate permanent failures (send to DLQ).\n * These errors will not resolve on retry.\n */\nconst DLQ_ERROR_TYPES = [\n 'ObjectValidationError',\n 'InvalidRequestError',\n 'UseCaseError',\n 'DomainError',\n 'UnprocessableError',\n 'AccessDeniedError',\n 'ForbiddenError',\n 'UnauthorizedError',\n 'InvariantViolationError',\n];\n\n/**\n * Error types that indicate transient failures (retry).\n * These errors may resolve on subsequent attempts.\n */\nconst RETRY_ERROR_TYPES = [\n 'NotFoundError',\n 'ConflictError',\n 'InfraError',\n 'DbError',\n 'NetworkError',\n 'TimeoutError',\n 'ExternalServiceError',\n 'PersistenceError',\n];\n\n// ============================================================================\n// Mapping Function\n// ============================================================================\n\n/**\n * Maps a caught error to an EventResult.\n *\n * Default mapping strategy:\n *\n * | Error Type | Outcome | Rationale |\n * |------------------------------------------------|---------|----------------------------------------|\n * | ObjectValidationError, InvalidRequestError | dlq | Bad payload — retrying won't help |\n * | UseCaseError | dlq | Business rule rejection — permanent |\n * | DomainError, InvariantViolationError | dlq | Domain invariant — permanent |\n * | UnprocessableError | dlq | Valid but not processable — permanent |\n * | AccessDeniedError, ForbiddenError, Unauthorized | dlq | Permission — permanent |\n * | NotFoundError | retry | Entity might not exist yet |\n * | ConflictError | retry | Concurrent write — may resolve |\n * | InfraError, DbError, NetworkError, TimeoutError | retry | Infrastructure/transient |\n * | Unknown | retry | Conservative — don't lose messages |\n *\n * @param error - The caught error\n * @returns An EventResult indicating how the message should be handled\n */\nexport function mapErrorToEventResult(error: unknown): EventResult {\n // Check DLQ errors first (permanent failures)\n for (const typeName of DLQ_ERROR_TYPES) {\n if (isErrorType(error, typeName)) {\n return {\n outcome: 'dlq',\n reason: (error as { message: string }).message,\n };\n }\n }\n\n // Check retry errors (transient failures)\n for (const typeName of RETRY_ERROR_TYPES) {\n if (isErrorType(error, typeName)) {\n return {\n outcome: 'retry',\n reason: (error as { message: string }).message,\n };\n }\n }\n\n // Unknown errors — retry conservatively to avoid losing messages\n const message =\n error instanceof Error ? error.message : 'Unknown error occurred during event processing';\n\n return {\n outcome: 'retry',\n reason: message,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC+FO,SAAS,YAAY,OAAgB,UAA2C;AACrF,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAEhD,QAAM,cAAc,OAAO,UAAU,eAAe,KAAK,OAAO,aAAa,IACxE,MAA8C,cAC/C,OAAO,eAAe,KAAK,GAAG;AAClC,MAAI,CAAC,YAAa,QAAO;AACzB,QAAM,OAAO,YAAY;AAEzB,SAAO,SAAS,YAAY,SAAS,IAAI,QAAQ;AACnD;;;ACpFA,IAAM,kBAAkB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMA,IAAM,oBAAoB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AA0BO,SAAS,sBAAsB,OAA6B;AAEjE,aAAW,YAAY,iBAAiB;AACtC,QAAI,YAAY,OAAO,QAAQ,GAAG;AAChC,aAAO;AAAA,QACL,SAAS;AAAA,QACT,QAAS,MAA8B;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AAGA,aAAW,YAAY,mBAAmB;AACxC,QAAI,YAAY,OAAO,QAAQ,GAAG;AAChC,aAAO;AAAA,QACL,SAAS;AAAA,QACT,QAAS,MAA8B;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AAGA,QAAM,UACJ,iBAAiB,QAAQ,MAAM,UAAU;AAE3C,SAAO;AAAA,IACL,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AACF;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { E as EventResult } from '../../types-cke61juH.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Error-to-EventResult mapping for event handlers.
|
|
5
|
+
*
|
|
6
|
+
* Maps caught errors to event processing outcomes (ack/retry/dlq).
|
|
7
|
+
* Uses the same name-based type checking as the HTTP error mapper
|
|
8
|
+
* for compatibility with bundled/minified code.
|
|
9
|
+
*
|
|
10
|
+
* @module events/shared/error-mapping
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Maps a caught error to an EventResult.
|
|
15
|
+
*
|
|
16
|
+
* Default mapping strategy:
|
|
17
|
+
*
|
|
18
|
+
* | Error Type | Outcome | Rationale |
|
|
19
|
+
* |------------------------------------------------|---------|----------------------------------------|
|
|
20
|
+
* | ObjectValidationError, InvalidRequestError | dlq | Bad payload — retrying won't help |
|
|
21
|
+
* | UseCaseError | dlq | Business rule rejection — permanent |
|
|
22
|
+
* | DomainError, InvariantViolationError | dlq | Domain invariant — permanent |
|
|
23
|
+
* | UnprocessableError | dlq | Valid but not processable — permanent |
|
|
24
|
+
* | AccessDeniedError, ForbiddenError, Unauthorized | dlq | Permission — permanent |
|
|
25
|
+
* | NotFoundError | retry | Entity might not exist yet |
|
|
26
|
+
* | ConflictError | retry | Concurrent write — may resolve |
|
|
27
|
+
* | InfraError, DbError, NetworkError, TimeoutError | retry | Infrastructure/transient |
|
|
28
|
+
* | Unknown | retry | Conservative — don't lose messages |
|
|
29
|
+
*
|
|
30
|
+
* @param error - The caught error
|
|
31
|
+
* @returns An EventResult indicating how the message should be handled
|
|
32
|
+
*/
|
|
33
|
+
declare function mapErrorToEventResult(error: unknown): EventResult;
|
|
34
|
+
|
|
35
|
+
export { EventResult, mapErrorToEventResult };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { E as EventResult } from '../../types-cke61juH.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Error-to-EventResult mapping for event handlers.
|
|
5
|
+
*
|
|
6
|
+
* Maps caught errors to event processing outcomes (ack/retry/dlq).
|
|
7
|
+
* Uses the same name-based type checking as the HTTP error mapper
|
|
8
|
+
* for compatibility with bundled/minified code.
|
|
9
|
+
*
|
|
10
|
+
* @module events/shared/error-mapping
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Maps a caught error to an EventResult.
|
|
15
|
+
*
|
|
16
|
+
* Default mapping strategy:
|
|
17
|
+
*
|
|
18
|
+
* | Error Type | Outcome | Rationale |
|
|
19
|
+
* |------------------------------------------------|---------|----------------------------------------|
|
|
20
|
+
* | ObjectValidationError, InvalidRequestError | dlq | Bad payload — retrying won't help |
|
|
21
|
+
* | UseCaseError | dlq | Business rule rejection — permanent |
|
|
22
|
+
* | DomainError, InvariantViolationError | dlq | Domain invariant — permanent |
|
|
23
|
+
* | UnprocessableError | dlq | Valid but not processable — permanent |
|
|
24
|
+
* | AccessDeniedError, ForbiddenError, Unauthorized | dlq | Permission — permanent |
|
|
25
|
+
* | NotFoundError | retry | Entity might not exist yet |
|
|
26
|
+
* | ConflictError | retry | Concurrent write — may resolve |
|
|
27
|
+
* | InfraError, DbError, NetworkError, TimeoutError | retry | Infrastructure/transient |
|
|
28
|
+
* | Unknown | retry | Conservative — don't lose messages |
|
|
29
|
+
*
|
|
30
|
+
* @param error - The caught error
|
|
31
|
+
* @returns An EventResult indicating how the message should be handled
|
|
32
|
+
*/
|
|
33
|
+
declare function mapErrorToEventResult(error: unknown): EventResult;
|
|
34
|
+
|
|
35
|
+
export { EventResult, mapErrorToEventResult };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../../chunk-RVSBIYY4.js";
|
|
2
|
+
import {
|
|
3
|
+
mapErrorToEventResult
|
|
4
|
+
} from "../../chunk-4BVOLXDJ.js";
|
|
5
|
+
import "../../chunk-H5TNDC5U.js";
|
|
6
|
+
import "../../chunk-2BVCU32G.js";
|
|
7
|
+
import "../../chunk-T7S574XQ.js";
|
|
8
|
+
import "../../chunk-3BY5RBF2.js";
|
|
9
|
+
import "../../chunk-A4JUAZK4.js";
|
|
10
|
+
export {
|
|
11
|
+
mapErrorToEventResult
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/global.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fieldChanged
|
|
3
3
|
} from "./chunk-3QKQCJSP.js";
|
|
4
|
-
import {
|
|
5
|
-
ObjectValidationError
|
|
6
|
-
} from "./chunk-3BY5RBF2.js";
|
|
7
4
|
import {
|
|
8
5
|
wrapError,
|
|
9
6
|
wrapErrorAsync,
|
|
10
7
|
wrapErrorUnless,
|
|
11
8
|
wrapErrorUnlessAsync
|
|
12
9
|
} from "./chunk-ZG26OQFN.js";
|
|
10
|
+
import {
|
|
11
|
+
ObjectValidationError
|
|
12
|
+
} from "./chunk-3BY5RBF2.js";
|
|
13
13
|
import {
|
|
14
14
|
CodedError,
|
|
15
15
|
ErrorCodes
|