@classytic/arc 2.10.8 → 2.11.1

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.
Files changed (136) hide show
  1. package/dist/{BaseController-DVNKvoX4.mjs → BaseController-JNV08qOT.mjs} +480 -442
  2. package/dist/{queryCachePlugin-Dumka73q.d.mts → QueryCache-DOBNHBE0.d.mts} +2 -32
  3. package/dist/adapters/index.d.mts +2 -2
  4. package/dist/adapters/index.mjs +1 -1
  5. package/dist/{adapters-BXY4i-hw.mjs → adapters-D0tT2Tyo.mjs} +54 -0
  6. package/dist/audit/index.d.mts +1 -1
  7. package/dist/auth/index.d.mts +1 -1
  8. package/dist/auth/index.mjs +5 -5
  9. package/dist/{betterAuthOpenApi--rdY15Ld.mjs → betterAuthOpenApi-DwxtK3uG.mjs} +1 -1
  10. package/dist/cache/index.d.mts +3 -2
  11. package/dist/cache/index.mjs +3 -3
  12. package/dist/cli/commands/docs.mjs +2 -2
  13. package/dist/cli/commands/generate.mjs +37 -27
  14. package/dist/cli/commands/init.mjs +46 -33
  15. package/dist/cli/commands/introspect.mjs +1 -1
  16. package/dist/context/index.mjs +1 -1
  17. package/dist/core/index.d.mts +3 -3
  18. package/dist/core/index.mjs +4 -3
  19. package/dist/core-DXdSSFW-.mjs +1037 -0
  20. package/dist/createActionRouter-BwaSM0No.mjs +166 -0
  21. package/dist/{createApp-BwnEAO2h.mjs → createApp-P1d6rjPy.mjs} +75 -27
  22. package/dist/docs/index.d.mts +1 -1
  23. package/dist/docs/index.mjs +2 -2
  24. package/dist/{elevation-Dci0AYLT.mjs → elevation-DOFoxoDs.mjs} +1 -1
  25. package/dist/{errorHandler-CSxe7KIM.mjs → errorHandler-BQm8ZxTK.mjs} +1 -1
  26. package/dist/{eventPlugin-ByU4Cv0e.mjs → eventPlugin--5HIkdPU.mjs} +1 -1
  27. package/dist/events/index.d.mts +3 -3
  28. package/dist/events/index.mjs +2 -2
  29. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  30. package/dist/factory/index.d.mts +2 -2
  31. package/dist/factory/index.mjs +2 -2
  32. package/dist/hooks/index.d.mts +1 -1
  33. package/dist/hooks/index.mjs +1 -1
  34. package/dist/idempotency/index.d.mts +3 -3
  35. package/dist/idempotency/index.mjs +1 -1
  36. package/dist/idempotency/redis.d.mts +1 -1
  37. package/dist/{index-C_Noptz-.d.mts → index-BYCqHCVu.d.mts} +2 -2
  38. package/dist/{index-BGbpGVyM.d.mts → index-C_bgx9o4.d.mts} +712 -500
  39. package/dist/{index-BziRPS4H.d.mts → index-CvM1e09j.d.mts} +29 -10
  40. package/dist/{index-EqQN6p0W.d.mts → index-pUczGjO0.d.mts} +11 -8
  41. package/dist/index-smCAoA5W.d.mts +1179 -0
  42. package/dist/index.d.mts +6 -38
  43. package/dist/index.mjs +9 -9
  44. package/dist/integrations/event-gateway.d.mts +1 -1
  45. package/dist/integrations/event-gateway.mjs +1 -1
  46. package/dist/integrations/index.d.mts +2 -2
  47. package/dist/integrations/mcp/index.d.mts +2 -2
  48. package/dist/integrations/mcp/index.mjs +1 -1
  49. package/dist/integrations/mcp/testing.d.mts +1 -1
  50. package/dist/integrations/mcp/testing.mjs +1 -1
  51. package/dist/integrations/streamline.d.mts +46 -5
  52. package/dist/integrations/streamline.mjs +50 -21
  53. package/dist/integrations/websocket-redis.d.mts +1 -1
  54. package/dist/integrations/websocket.d.mts +2 -154
  55. package/dist/integrations/websocket.mjs +292 -224
  56. package/dist/{keys-nWQGUTu1.mjs → keys-CARyUjiR.mjs} +2 -0
  57. package/dist/{loadResources-Bksk8ydA.mjs → loadResources-CPpkyKfM.mjs} +32 -8
  58. package/dist/middleware/index.d.mts +1 -1
  59. package/dist/middleware/index.mjs +1 -1
  60. package/dist/{openapi-DpNpqBmo.mjs → openapi-C0L9ar7m.mjs} +4 -4
  61. package/dist/org/index.d.mts +1 -1
  62. package/dist/permissions/index.d.mts +1 -1
  63. package/dist/permissions/index.mjs +2 -4
  64. package/dist/{permissions-wkqRwicB.mjs → permissions-B4vU9L0Q.mjs} +221 -3
  65. package/dist/{pipe-CGJxqDGx.mjs → pipe-DVoIheVC.mjs} +1 -1
  66. package/dist/pipeline/index.d.mts +1 -1
  67. package/dist/pipeline/index.mjs +1 -1
  68. package/dist/plugins/index.d.mts +4 -4
  69. package/dist/plugins/index.mjs +10 -10
  70. package/dist/plugins/response-cache.mjs +1 -1
  71. package/dist/plugins/tracing-entry.d.mts +1 -1
  72. package/dist/plugins/tracing-entry.mjs +42 -24
  73. package/dist/presets/filesUpload.d.mts +1 -1
  74. package/dist/presets/filesUpload.mjs +3 -3
  75. package/dist/presets/index.d.mts +1 -1
  76. package/dist/presets/index.mjs +1 -1
  77. package/dist/presets/multiTenant.d.mts +1 -1
  78. package/dist/presets/multiTenant.mjs +6 -0
  79. package/dist/presets/search.d.mts +1 -1
  80. package/dist/presets/search.mjs +1 -1
  81. package/dist/{presets-CrwOvuXI.mjs → presets-k604Lj99.mjs} +1 -1
  82. package/dist/queryCachePlugin-BUXBSm4F.d.mts +34 -0
  83. package/dist/{queryCachePlugin-ChLNZvFT.mjs → queryCachePlugin-Bq6bO6vc.mjs} +3 -3
  84. package/dist/{redis-MXLp1oOf.d.mts → redis-Cm1gnRDf.d.mts} +1 -1
  85. package/dist/registry/index.d.mts +1 -1
  86. package/dist/registry/index.mjs +2 -2
  87. package/dist/{resourceToTools-BhF3JV5p.mjs → resourceToTools--okX6QBr.mjs} +534 -420
  88. package/dist/routerShared-DeESFp4a.mjs +515 -0
  89. package/dist/schemaIR-BlG9bY7v.mjs +137 -0
  90. package/dist/scope/index.mjs +2 -2
  91. package/dist/testing/index.d.mts +367 -711
  92. package/dist/testing/index.mjs +637 -1434
  93. package/dist/{tracing-xqXzWeaf.d.mts → tracing-DokiEsuz.d.mts} +9 -4
  94. package/dist/types/index.d.mts +3 -3
  95. package/dist/types/index.mjs +1 -3
  96. package/dist/{types-CVdgPXBW.d.mts → types-BdA4uMBV.d.mts} +191 -28
  97. package/dist/{types-CVKBssX5.d.mts → types-Bh_gEJBi.d.mts} +1 -1
  98. package/dist/utils/index.d.mts +2 -968
  99. package/dist/utils/index.mjs +5 -6
  100. package/dist/utils-D3Yxnrwr.mjs +1639 -0
  101. package/dist/websocket-CyJ1VIFI.d.mts +186 -0
  102. package/package.json +7 -5
  103. package/skills/arc/SKILL.md +124 -39
  104. package/skills/arc/references/testing.md +212 -183
  105. package/dist/applyPermissionResult-QhV1Pa-g.mjs +0 -37
  106. package/dist/core-3MWJosCH.mjs +0 -1459
  107. package/dist/createActionRouter-C8UUB3Px.mjs +0 -249
  108. package/dist/errors-BI8kEKsO.d.mts +0 -140
  109. package/dist/fields-CTMWOUDt.mjs +0 -126
  110. package/dist/queryParser-NR__Qiju.mjs +0 -419
  111. package/dist/types-CDnTEpga.mjs +0 -27
  112. package/dist/utils-LMwVidKy.mjs +0 -947
  113. /package/dist/{HookSystem-BjFu7zf1.mjs → HookSystem-CGsMd6oK.mjs} +0 -0
  114. /package/dist/{ResourceRegistry-CcN2LVrc.mjs → ResourceRegistry-DkAeAuTX.mjs} +0 -0
  115. /package/dist/{actionPermissions-TUVR3uiZ.mjs → actionPermissions-C8YYU92K.mjs} +0 -0
  116. /package/dist/{caching-3h93rkJM.mjs → caching-CheW3m-S.mjs} +0 -0
  117. /package/dist/{errorHandler-2ii4RIYr.d.mts → errorHandler-Co3lnVmJ.d.mts} +0 -0
  118. /package/dist/{errors-BqdUDja_.mjs → errors-D5c-5BJL.mjs} +0 -0
  119. /package/dist/{eventPlugin-D1ThQ1Pp.d.mts → eventPlugin-CUNjYYRY.d.mts} +0 -0
  120. /package/dist/{interface-B-pe8fhj.d.mts → interface-CkkWm5uR.d.mts} +0 -0
  121. /package/dist/{interface-yhyb_pLY.d.mts → interface-Da0r7Lna.d.mts} +0 -0
  122. /package/dist/{memory-DqI-449b.mjs → memory-DikHSvWa.mjs} +0 -0
  123. /package/dist/{metrics-TuOmguhi.mjs → metrics-Csh4nsvv.mjs} +0 -0
  124. /package/dist/{multipartBody-CUQGVlM_.mjs → multipartBody-CvTR1Un6.mjs} +0 -0
  125. /package/dist/{pluralize-CWP6MB39.mjs → pluralize-BneOJkpi.mjs} +0 -0
  126. /package/dist/{redis-stream-bkO88VHx.d.mts → redis-stream-CM8TXTix.d.mts} +0 -0
  127. /package/dist/{registry-B0Wl7uVV.mjs → registry-D63ee7fl.mjs} +0 -0
  128. /package/dist/{replyHelpers-BLojtuvR.mjs → replyHelpers-ByllIXXV.mjs} +0 -0
  129. /package/dist/{requestContext-C38GskNt.mjs → requestContext-CfRkaxwf.mjs} +0 -0
  130. /package/dist/{schemaConverter-BxFDdtXu.mjs → schemaConverter-B0oKLuqI.mjs} +0 -0
  131. /package/dist/{sse-D8UeDwis.mjs → sse-V7aXc3bW.mjs} +0 -0
  132. /package/dist/{store-helpers-DYYUQbQN.mjs → store-helpers-BhrzxvyQ.mjs} +0 -0
  133. /package/dist/{typeGuards-Cj5Rgvlg.mjs → typeGuards-CcFZXgU7.mjs} +0 -0
  134. /package/dist/{types-D57iXYb8.mjs → types-DV9WDfeg.mjs} +0 -0
  135. /package/dist/{versioning-B6mimogM.mjs → versioning-CGPjkqAg.mjs} +0 -0
  136. /package/dist/{versioning-CeUXHfjw.d.mts → versioning-M9lNLhO8.d.mts} +0 -0
@@ -1,968 +1,2 @@
1
- import { S as QueryParserInterface, Yt as AnyRecord, b as ParsedQuery, mt as OpenApiSchemas } from "../index-BGbpGVyM.mjs";
2
- import { n as ErrorMapper } from "../errorHandler-2ii4RIYr.mjs";
3
- import { a as NotFoundError, c as RateLimitError, d as ValidationError, f as createDomainError, i as ForbiddenError, l as ServiceUnavailableError, m as isArcError, n as ConflictError, o as OrgAccessDeniedError, p as createError, r as ErrorDetails, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-BI8kEKsO.mjs";
4
- import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
5
-
6
- //#region src/utils/circuitBreaker.d.ts
7
- /**
8
- * Circuit Breaker Pattern
9
- *
10
- * Wraps external service calls with failure protection.
11
- * Prevents cascading failures by "opening" the circuit when
12
- * a service is failing, allowing it time to recover.
13
- *
14
- * States:
15
- * - CLOSED: Normal operation, requests pass through
16
- * - OPEN: Too many failures, all requests fail fast
17
- * - HALF_OPEN: Testing if service recovered, limited requests
18
- *
19
- * @example
20
- * import { CircuitBreaker } from '@classytic/arc/utils';
21
- *
22
- * const paymentBreaker = new CircuitBreaker(async (amount) => {
23
- * return await stripe.charges.create({ amount });
24
- * }, {
25
- * failureThreshold: 5,
26
- * resetTimeout: 30000,
27
- * timeout: 5000,
28
- * });
29
- *
30
- * try {
31
- * const result = await paymentBreaker.call(100);
32
- * } catch (error) {
33
- * // Handle failure or circuit open
34
- * }
35
- */
36
- declare const CircuitState: {
37
- readonly CLOSED: "CLOSED";
38
- readonly OPEN: "OPEN";
39
- readonly HALF_OPEN: "HALF_OPEN";
40
- };
41
- type CircuitState = (typeof CircuitState)[keyof typeof CircuitState];
42
- interface CircuitBreakerOptions {
43
- /**
44
- * Number of failures before opening circuit
45
- * @default 5
46
- */
47
- failureThreshold?: number;
48
- /**
49
- * Time in ms before attempting to close circuit
50
- * @default 60000 (60 seconds)
51
- */
52
- resetTimeout?: number;
53
- /**
54
- * Request timeout in ms
55
- * @default 10000 (10 seconds)
56
- */
57
- timeout?: number;
58
- /**
59
- * Number of successful requests in HALF_OPEN before closing
60
- * @default 1
61
- */
62
- successThreshold?: number;
63
- /**
64
- * Fallback function when circuit is open.
65
- * Receives the same arguments as the wrapped function.
66
- */
67
- fallback?: (...args: unknown[]) => Promise<unknown>;
68
- /**
69
- * Callback when state changes
70
- */
71
- onStateChange?: (from: CircuitState, to: CircuitState) => void;
72
- /**
73
- * Callback on error
74
- */
75
- onError?: (error: Error) => void;
76
- /**
77
- * Name for logging/monitoring
78
- */
79
- name?: string;
80
- }
81
- interface CircuitBreakerStats {
82
- name?: string;
83
- state: CircuitState;
84
- failures: number;
85
- successes: number;
86
- totalCalls: number;
87
- openedAt: number | null;
88
- lastCallAt: number | null;
89
- }
90
- declare class CircuitBreakerError extends Error {
91
- state: CircuitState;
92
- constructor(message: string, state: CircuitState);
93
- }
94
- declare class CircuitBreaker<T extends (...args: any[]) => Promise<any>> {
95
- private state;
96
- private failures;
97
- private successes;
98
- private totalCalls;
99
- private nextAttempt;
100
- private lastCallAt;
101
- private openedAt;
102
- private readonly failureThreshold;
103
- private readonly resetTimeout;
104
- private readonly timeout;
105
- private readonly successThreshold;
106
- private readonly fallback?;
107
- private readonly onStateChange?;
108
- private readonly onError?;
109
- private readonly name;
110
- private readonly fn;
111
- constructor(fn: T, options?: CircuitBreakerOptions);
112
- /**
113
- * Call the wrapped function with circuit breaker protection
114
- */
115
- call(...args: Parameters<T>): Promise<ReturnType<T>>;
116
- /**
117
- * Execute function with timeout
118
- */
119
- private executeWithTimeout;
120
- /**
121
- * Handle successful call
122
- */
123
- private onSuccess;
124
- /**
125
- * Handle failed call
126
- */
127
- private onFailure;
128
- /**
129
- * Change circuit state
130
- */
131
- private setState;
132
- /**
133
- * Manually open the circuit
134
- */
135
- open(): void;
136
- /**
137
- * Manually close the circuit
138
- */
139
- close(): void;
140
- /**
141
- * Get current statistics
142
- */
143
- getStats(): CircuitBreakerStats;
144
- /**
145
- * Get current state
146
- */
147
- getState(): CircuitState;
148
- /**
149
- * Check if circuit is open
150
- */
151
- isOpen(): boolean;
152
- /**
153
- * Check if circuit is closed
154
- */
155
- isClosed(): boolean;
156
- /**
157
- * Reset statistics
158
- */
159
- reset(): void;
160
- }
161
- /**
162
- * Create a circuit breaker with sensible defaults
163
- *
164
- * @example
165
- * const emailBreaker = createCircuitBreaker(
166
- * async (to, subject, body) => sendEmail(to, subject, body),
167
- * { name: 'email-service' }
168
- * );
169
- */
170
- declare function createCircuitBreaker<T extends (...args: any[]) => Promise<any>>(fn: T, options?: CircuitBreakerOptions): CircuitBreaker<T>;
171
- /**
172
- * Circuit breaker registry for managing multiple breakers
173
- */
174
- declare class CircuitBreakerRegistry {
175
- private breakers;
176
- /**
177
- * Register a circuit breaker
178
- */
179
- register<T extends (...args: any[]) => Promise<any>>(name: string, fn: T, options?: Omit<CircuitBreakerOptions, "name">): CircuitBreaker<T>;
180
- /**
181
- * Get a circuit breaker by name
182
- */
183
- get(name: string): CircuitBreaker<any> | undefined;
184
- /**
185
- * Get all breakers
186
- */
187
- getAll(): Map<string, CircuitBreaker<any>>;
188
- /**
189
- * Get statistics for all breakers
190
- */
191
- getAllStats(): Record<string, CircuitBreakerStats>;
192
- /**
193
- * Reset all breakers
194
- */
195
- resetAll(): void;
196
- /**
197
- * Open all breakers
198
- */
199
- openAll(): void;
200
- /**
201
- * Close all breakers
202
- */
203
- closeAll(): void;
204
- }
205
- /**
206
- * Create a new CircuitBreakerRegistry instance.
207
- * Use this instead of a global singleton — attach to fastify.arc or pass explicitly.
208
- */
209
- declare function createCircuitBreakerRegistry(): CircuitBreakerRegistry;
210
- //#endregion
211
- //#region src/utils/compensation.d.ts
212
- /**
213
- * Compensating Transaction — In-Process Rollback Primitive
214
- *
215
- * Runs steps in order. If any step fails, runs compensating actions
216
- * for already-completed steps in reverse. Zero dependencies.
217
- *
218
- * Type-safe: generic context type gives autocomplete across steps.
219
- * Discriminated union result: compiler enforces checking success before
220
- * accessing failedStep/error.
221
- *
222
- * For distributed sagas across services, use Temporal, Inngest, or Streamline.
223
- *
224
- * @example
225
- * ```typescript
226
- * interface CheckoutCtx {
227
- * orderId: string;
228
- * reservationId?: string;
229
- * }
230
- *
231
- * const result = await withCompensation<CheckoutCtx>('checkout', [
232
- * {
233
- * name: 'reserve',
234
- * execute: async (ctx) => {
235
- * const res = await inventoryService.reserve(ctx.orderId);
236
- * ctx.reservationId = res.id;
237
- * return res;
238
- * },
239
- * compensate: async (ctx) => {
240
- * await inventoryService.release(ctx.reservationId!);
241
- * },
242
- * },
243
- * { name: 'notify', execute: sendEmail, fireAndForget: true },
244
- * ], { orderId: 'ord-123' });
245
- *
246
- * if (result.success) {
247
- * // result.results available, no failedStep
248
- * } else {
249
- * // result.failedStep and result.error guaranteed
250
- * }
251
- * ```
252
- */
253
- /** Step definition with typed context and typed result */
254
- interface CompensationStep<TCtx = Record<string, unknown>, TResult = unknown> {
255
- /** Step name — used in results, logs, and hooks */
256
- readonly name: string;
257
- /** Execute the step — return value stored in results[name] */
258
- readonly execute: (ctx: TCtx) => Promise<TResult>;
259
- /** Rollback on failure — receives context and this step's own result */
260
- readonly compensate?: (ctx: TCtx, stepResult: TResult) => Promise<void>;
261
- /** Fire-and-forget — don't await, don't block, swallow errors, skip in rollback */
262
- readonly fireAndForget?: boolean;
263
- }
264
- /** Lifecycle hooks for observability — wire to Arc events, metrics, or logging */
265
- interface CompensationHooks {
266
- readonly onStepComplete?: (stepName: string, result: unknown) => void;
267
- readonly onStepFailed?: (stepName: string, error: Error) => void;
268
- readonly onCompensate?: (stepName: string) => void;
269
- }
270
- /** Error from a compensation action that failed during rollback */
271
- interface CompensationError {
272
- readonly step: string;
273
- readonly error: string;
274
- }
275
- /** Discriminated union — success and failure are mutually exclusive */
276
- type CompensationResult = {
277
- readonly success: true;
278
- readonly completedSteps: readonly string[];
279
- readonly results: Readonly<Record<string, unknown>>;
280
- } | {
281
- readonly success: false;
282
- readonly completedSteps: readonly string[];
283
- readonly results: Readonly<Record<string, unknown>>;
284
- readonly failedStep: string;
285
- readonly error: string;
286
- readonly compensationErrors?: readonly CompensationError[];
287
- };
288
- /**
289
- * Run steps in order with automatic compensation on failure.
290
- *
291
- * @typeParam TCtx - Context type shared across steps (defaults to Record<string, unknown>)
292
- */
293
- declare function withCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(_name: string, steps: readonly CompensationStep<TCtx>[], initialContext?: TCtx, hooks?: CompensationHooks): Promise<CompensationResult>;
294
- interface CompensationDefinition<TCtx extends Record<string, unknown> = Record<string, unknown>> {
295
- readonly name: string;
296
- readonly execute: (initialContext?: TCtx, hooks?: CompensationHooks) => Promise<CompensationResult>;
297
- }
298
- declare function defineCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(name: string, steps: readonly CompensationStep<TCtx>[]): CompensationDefinition<TCtx>;
299
- //#endregion
300
- //#region src/utils/defineErrorMapper.d.ts
301
- /**
302
- * Register an `ErrorMapper` with its domain-specific generic argument and
303
- * have it assign cleanly into `ErrorMapper[]` (no `as unknown as ErrorMapper`).
304
- *
305
- * The returned mapper is identical at runtime — `type` and `toResponse` are
306
- * passed through untouched. Only the declared type widens from
307
- * `ErrorMapper<T>` to `ErrorMapper` so the array inference works.
308
- *
309
- * Safety: the `errorHandlerPlugin` dispatches via `error instanceof mapper.type`
310
- * before invoking `toResponse`, so the widened callback signature is never
311
- * called with a non-`T` error at runtime. This helper codifies that invariant
312
- * in one place.
313
- */
314
- declare function defineErrorMapper<T extends Error>(mapper: ErrorMapper<T>): ErrorMapper;
315
- //#endregion
316
- //#region src/utils/defineGuard.d.ts
317
- interface GuardConfig<T> {
318
- /** Unique name — used as the storage key on the request. */
319
- readonly name: string;
320
- /**
321
- * Resolve the guard context from the request. Throw to abort the request
322
- * (Fastify's error handler will produce the appropriate HTTP response).
323
- * Return a value to stash it for `from()` extraction.
324
- */
325
- readonly resolve: (req: FastifyRequest, reply: FastifyReply) => T | Promise<T>;
326
- }
327
- interface Guard<T> {
328
- /** Use in `routeGuards` or per-route `preHandler` arrays. */
329
- readonly preHandler: RouteHandlerMethod;
330
- /**
331
- * Extract the resolved context from a request. Throws if the guard
332
- * hasn't run yet (i.e. not in the preHandler chain).
333
- */
334
- from(req: FastifyRequest): T;
335
- /** The guard name (for debugging). */
336
- readonly name: string;
337
- }
338
- /**
339
- * Create a typed guard. See module JSDoc for usage.
340
- */
341
- declare function defineGuard<T>(config: GuardConfig<T>): Guard<T>;
342
- //#endregion
343
- //#region src/utils/handleRaw.d.ts
344
- /**
345
- * Wrap a raw Fastify handler with Arc's response envelope and error handling.
346
- *
347
- * @param handler - Async function that receives `(request, reply)` and returns data.
348
- * The return value is sent as `{ success: true, data }`. If it returns
349
- * `undefined` or `null`, `{ success: true }` is sent (no `data` field).
350
- * @param statusCode - HTTP status code for successful responses (default: 200)
351
- */
352
- declare function handleRaw<T>(handler: (request: FastifyRequest, reply: FastifyReply) => Promise<T>, statusCode?: number): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
353
- //#endregion
354
- //#region src/utils/queryParser.d.ts
355
- interface ArcQueryParserOptions {
356
- /** Maximum allowed limit value (default: 1000) */
357
- maxLimit?: number;
358
- /** Default limit for pagination (default: 20) */
359
- defaultLimit?: number;
360
- /** Maximum regex pattern length (default: 500) */
361
- maxRegexLength?: number;
362
- /** Maximum search query length (default: 200) */
363
- maxSearchLength?: number;
364
- /** Maximum filter nesting depth (default: 10) */
365
- maxFilterDepth?: number;
366
- /**
367
- * Whitelist of fields that can be filtered on.
368
- * When set, only these fields are accepted as filters — all others are silently dropped.
369
- * Also used by MCP to auto-derive filterable fields in tool schemas.
370
- */
371
- allowedFilterFields?: string[];
372
- /**
373
- * Whitelist of fields that can be sorted on.
374
- * When set, sort fields not in this list are silently dropped.
375
- * Also used by MCP to describe available sort options.
376
- */
377
- allowedSortFields?: string[];
378
- /**
379
- * Whitelist of filter operators (e.g. ['eq', 'ne', 'gt', 'lt', 'in']).
380
- * When set, only these operators are accepted — all others are dropped.
381
- * Also used by MCP to enrich list tool descriptions.
382
- */
383
- allowedOperators?: string[];
384
- }
385
- /**
386
- * Arc's default query parser
387
- *
388
- * Converts URL query parameters to a structured query format:
389
- * - Pagination: ?page=1&limit=20
390
- * - Sorting: ?sort=-createdAt,name (- prefix = descending)
391
- * - Filtering: ?status=active&price[gte]=100&price[lte]=500
392
- * - Search: ?search=keyword
393
- * - Populate: ?populate=author,category
394
- * - Field selection: ?select=name,price,status
395
- * - Keyset pagination: ?after=cursor_value
396
- *
397
- * For advanced MongoDB features ($lookup, aggregations), use MongoKit's QueryParser.
398
- */
399
- declare class ArcQueryParser implements QueryParserInterface {
400
- private readonly maxLimit;
401
- private readonly defaultLimit;
402
- private readonly maxRegexLength;
403
- private readonly maxSearchLength;
404
- private readonly maxFilterDepth;
405
- private readonly _allowedFilterFields?;
406
- private readonly _allowedSortFields?;
407
- private readonly _allowedOperators?;
408
- /** Allowed filter fields (used by MCP for auto-derive) */
409
- readonly allowedFilterFields?: readonly string[];
410
- /** Allowed sort fields (used by MCP for sort descriptions) */
411
- readonly allowedSortFields?: readonly string[];
412
- /** Allowed operators (used by MCP for operator descriptions) */
413
- readonly allowedOperators?: readonly string[];
414
- /** Supported filter operators */
415
- private readonly operators;
416
- constructor(options?: ArcQueryParserOptions);
417
- /**
418
- * Parse URL query parameters into structured query options
419
- */
420
- parse(query: Record<string, unknown> | null | undefined): ParsedQuery;
421
- private parseNumber;
422
- private parseString;
423
- /**
424
- * Parse populate parameter — handles both simple string and bracket notation.
425
- *
426
- * Simple: ?populate=author,category → { populate: 'author,category' }
427
- * Bracket: ?populate[author][select]=name,email → { populateOptions: [{ path: 'author', select: 'name email' }] }
428
- */
429
- private parsePopulate;
430
- private parseSort;
431
- private parseSearch;
432
- private parseSelect;
433
- /**
434
- * Check if a value exceeds the maximum nesting depth.
435
- * Prevents filter bombs where deeply nested objects consume excessive memory/CPU.
436
- */
437
- private exceedsDepth;
438
- private parseFilters;
439
- private parseFilterValue;
440
- private coerceValue;
441
- /**
442
- * Generate OpenAPI-compatible JSON Schema for query parameters.
443
- * Arc's defineResource() auto-detects this method and uses it
444
- * to document list endpoint query parameters in OpenAPI/Swagger.
445
- */
446
- getQuerySchema(): {
447
- type: "object";
448
- properties: Record<string, unknown>;
449
- required?: string[];
450
- };
451
- private sanitizeRegex;
452
- }
453
- /**
454
- * Create a new ArcQueryParser instance
455
- */
456
- declare function createQueryParser(options?: ArcQueryParserOptions): ArcQueryParser;
457
- //#endregion
458
- //#region src/utils/responseSchemas.d.ts
459
- interface JsonSchema {
460
- type: string;
461
- properties?: Record<string, JsonSchema | AnyRecord>;
462
- required?: string[];
463
- items?: JsonSchema | AnyRecord;
464
- additionalProperties?: boolean | JsonSchema;
465
- description?: string;
466
- example?: unknown;
467
- [key: string]: unknown;
468
- }
469
- /**
470
- * Base success response schema
471
- */
472
- declare const successResponseSchema: JsonSchema;
473
- /**
474
- * Error response schema
475
- */
476
- declare const errorResponseSchema: JsonSchema;
477
- /**
478
- * Pagination schema - matches MongoKit/Arc runtime format
479
- *
480
- * Runtime format (flat fields):
481
- * { page, limit, total, pages, hasNext, hasPrev }
482
- */
483
- declare const paginationSchema: JsonSchema;
484
- /**
485
- * Wrap a data schema in a success response
486
- */
487
- declare function wrapResponse(dataSchema: JsonSchema): JsonSchema;
488
- /**
489
- * Create a list response schema with pagination - matches MongoKit/Arc runtime format
490
- *
491
- * Runtime format:
492
- * { success, docs: [...], page, limit, total, pages, hasNext, hasPrev }
493
- *
494
- * Note: Uses 'docs' array (not 'data') with flat pagination fields
495
- */
496
- declare function listResponse(itemSchema: JsonSchema): JsonSchema;
497
- /**
498
- * Create a single item response schema
499
- *
500
- * Runtime format: { success, data: {...} }
501
- */
502
- declare function itemResponse(itemSchema: JsonSchema): JsonSchema;
503
- /**
504
- * Create a create/update response schema
505
- */
506
- declare function mutationResponse(itemSchema: JsonSchema): JsonSchema;
507
- /**
508
- * Create a delete response schema
509
- *
510
- * Runtime format: { success, data: { message, id?, soft? } }
511
- */
512
- declare function deleteResponse(): JsonSchema;
513
- declare const responses: {
514
- 200: (schema: JsonSchema) => {
515
- description: string;
516
- content: {
517
- "application/json": {
518
- schema: JsonSchema;
519
- };
520
- };
521
- };
522
- 201: (schema: JsonSchema) => {
523
- description: string;
524
- content: {
525
- "application/json": {
526
- schema: JsonSchema;
527
- };
528
- };
529
- };
530
- 400: {
531
- description: string;
532
- content: {
533
- "application/json": {
534
- schema: {
535
- properties: {
536
- code: {
537
- type: string;
538
- example: string;
539
- };
540
- details: {
541
- type: string;
542
- properties: {
543
- errors: {
544
- type: string;
545
- items: {
546
- type: string;
547
- properties: {
548
- field: {
549
- type: string;
550
- };
551
- message: {
552
- type: string;
553
- };
554
- };
555
- };
556
- };
557
- };
558
- };
559
- };
560
- type: string;
561
- required?: string[];
562
- items?: JsonSchema | AnyRecord;
563
- additionalProperties?: boolean | JsonSchema;
564
- description?: string;
565
- example?: unknown;
566
- };
567
- };
568
- };
569
- };
570
- 401: {
571
- description: string;
572
- content: {
573
- "application/json": {
574
- schema: {
575
- properties: {
576
- code: {
577
- type: string;
578
- example: string;
579
- };
580
- };
581
- type: string;
582
- required?: string[];
583
- items?: JsonSchema | AnyRecord;
584
- additionalProperties?: boolean | JsonSchema;
585
- description?: string;
586
- example?: unknown;
587
- };
588
- };
589
- };
590
- };
591
- 403: {
592
- description: string;
593
- content: {
594
- "application/json": {
595
- schema: {
596
- properties: {
597
- code: {
598
- type: string;
599
- example: string;
600
- };
601
- };
602
- type: string;
603
- required?: string[];
604
- items?: JsonSchema | AnyRecord;
605
- additionalProperties?: boolean | JsonSchema;
606
- description?: string;
607
- example?: unknown;
608
- };
609
- };
610
- };
611
- };
612
- 404: {
613
- description: string;
614
- content: {
615
- "application/json": {
616
- schema: {
617
- properties: {
618
- code: {
619
- type: string;
620
- example: string;
621
- };
622
- };
623
- type: string;
624
- required?: string[];
625
- items?: JsonSchema | AnyRecord;
626
- additionalProperties?: boolean | JsonSchema;
627
- description?: string;
628
- example?: unknown;
629
- };
630
- };
631
- };
632
- };
633
- 409: {
634
- description: string;
635
- content: {
636
- "application/json": {
637
- schema: {
638
- properties: {
639
- code: {
640
- type: string;
641
- example: string;
642
- };
643
- };
644
- type: string;
645
- required?: string[];
646
- items?: JsonSchema | AnyRecord;
647
- additionalProperties?: boolean | JsonSchema;
648
- description?: string;
649
- example?: unknown;
650
- };
651
- };
652
- };
653
- };
654
- 500: {
655
- description: string;
656
- content: {
657
- "application/json": {
658
- schema: {
659
- properties: {
660
- code: {
661
- type: string;
662
- example: string;
663
- };
664
- };
665
- type: string;
666
- required?: string[];
667
- items?: JsonSchema | AnyRecord;
668
- additionalProperties?: boolean | JsonSchema;
669
- description?: string;
670
- example?: unknown;
671
- };
672
- };
673
- };
674
- };
675
- };
676
- declare const queryParams: {
677
- pagination: {
678
- page: {
679
- type: string;
680
- minimum: number;
681
- default: number;
682
- description: string;
683
- };
684
- limit: {
685
- type: string;
686
- minimum: number;
687
- maximum: number;
688
- default: number;
689
- description: string;
690
- };
691
- };
692
- sorting: {
693
- sort: {
694
- type: string;
695
- description: string;
696
- example: string;
697
- };
698
- };
699
- filtering: {
700
- select: {
701
- description: string;
702
- example: string;
703
- };
704
- populate: {
705
- description: string;
706
- example: string;
707
- };
708
- };
709
- };
710
- /**
711
- * Get standard list query parameters schema
712
- */
713
- declare function getListQueryParams(): AnyRecord;
714
- /**
715
- * Get default response schemas for all CRUD operations.
716
- *
717
- * When routes have response schemas, Fastify compiles them with
718
- * fast-json-stringify for 2-3x faster serialization and prevents
719
- * accidental field disclosure.
720
- *
721
- * These defaults use `additionalProperties: true` so all fields pass through.
722
- * Override with specific schemas for full serialization performance + safety.
723
- *
724
- * Note: `example` properties are stripped from defaults so they work with
725
- * any Fastify instance (not just createApp which adds `keywords: ['example']`).
726
- */
727
- declare function getDefaultCrudSchemas(): Record<string, Record<string, unknown>>;
728
- //#endregion
729
- //#region src/utils/schemaConverter.d.ts
730
- /**
731
- * Supported JSON Schema output targets for Zod v4's `toJSONSchema()`.
732
- * - `draft-7`: Fastify/AJV validation (default)
733
- * - `draft-2020-12`: AJV 2020 (opt-in, requires ajv/dist/2020)
734
- * - `openapi-3.0`: OpenAPI 3.0 document generation
735
- * - `openapi-3.1`: OpenAPI 3.1 document generation
736
- */
737
- type JsonSchemaTarget = "draft-7" | "draft-2020-12" | "openapi-3.0" | "openapi-3.1";
738
- /**
739
- * Check if an object is already a plain JSON Schema.
740
- * Returns true if it has JSON Schema markers (`type`, `properties`, `$ref`,
741
- * `allOf`, `anyOf`, `oneOf`, `items`, `enum`) and does NOT have Zod markers.
742
- */
743
- declare function isJsonSchema(input: unknown): input is Record<string, unknown>;
744
- /**
745
- * Check if an object is a Zod schema (has `_zod` marker from Zod v4).
746
- */
747
- declare function isZodSchema(input: unknown): boolean;
748
- /**
749
- * Convert any schema input to JSON Schema.
750
- *
751
- * Detection order:
752
- * 1. `null`/`undefined` → `undefined`
753
- * 2. Already JSON Schema → pass through as-is (zero overhead)
754
- * 3. Zod v4 schema → `z.toJSONSchema(schema, { target })`
755
- * 4. Unrecognized object → return as-is (treat as opaque schema)
756
- *
757
- * @param input Schema (Zod, plain JSON Schema, or opaque object)
758
- * @param target Output target — defaults to `draft-7` for Fastify compatibility.
759
- * Pass `openapi-3.0`/`openapi-3.1` for OpenAPI document generation.
760
- */
761
- declare function toJsonSchema(input: unknown, target?: JsonSchemaTarget): Record<string, unknown> | undefined;
762
- /**
763
- * Convert all schema fields in an OpenApiSchemas object.
764
- * JSON Schema values pass through unchanged. Only Zod schemas are converted.
765
- *
766
- * Defaults to the `openapi-3.0` target since this function feeds OpenAPI doc
767
- * generation, not Fastify route validation.
768
- */
769
- declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSchemaTarget): OpenApiSchemas;
770
- /**
771
- * Convert schema values in a Fastify route schema record.
772
- *
773
- * Handles `body`, `querystring`, `params`, `headers` (top-level conversion)
774
- * and `response` (iterates by status code — each value converted individually).
775
- *
776
- * JSON Schema values pass through unchanged. Only Zod schemas are converted.
777
- *
778
- * Used for both custom routes and customSchemas (CRUD overrides).
779
- *
780
- * Defaults to `draft-7` so Fastify v5's bundled AJV 8 accepts the output.
781
- * Pass `openapi-3.0` (or `openapi-3.1`) when generating OpenAPI documents.
782
- */
783
- declare function convertRouteSchema(schema: Record<string, unknown>, target?: JsonSchemaTarget): Record<string, unknown>;
784
- //#endregion
785
- //#region src/utils/simpleEqualityMatcher.d.ts
786
- /**
787
- * `simpleEqualityMatcher` — a minimal, dialect-agnostic flat-key equality
788
- * matcher for `DataAdapter.matchesFilter` / `BaseController({ matchesFilter })`.
789
- *
790
- * **What it does:** for each `[key, expected]` in the filter, compares
791
- * `item[key]` to `expected` via string coercion (so Mongo `ObjectId` values
792
- * match their string representation) and returns `true` only if every
793
- * filter entry matches. Array item values are matched implicitly (contains).
794
- *
795
- * **What it does NOT do:**
796
- * - No `$eq` / `$ne` / `$in` / `$nin` / `$gt` / `$lt` / `$regex` / `$exists`
797
- * - No `$and` / `$or`
798
- * - No dot-path traversal (`"owner.id"`)
799
- * - No schema-specific coercion
800
- *
801
- * **Why it exists:** 95%+ of arc's `_policyFilters` are produced by built-in
802
- * permission helpers and are shaped like `{ ownerId: "u1" }` or
803
- * `{ organizationId: "org_x" }` — flat equality. For that common shape,
804
- * this helper is a safe, tested, 15-line defense-in-depth matcher that
805
- * hosts using minimal repos (no `getOne(compoundFilter)` DB path) can opt
806
- * into without arc shipping a full Mongo-syntax engine.
807
- *
808
- * **When to use:**
809
- * - Your adapter/repo doesn't natively filter on `getOne(compoundFilter)`
810
- * - Your `_policyFilters` are flat equality (from arc's built-in permission helpers)
811
- * - You want defense-in-depth on `validateItemAccess` / `fetchDetailed`'s `getById` fallback
812
- *
813
- * **When NOT to use:**
814
- * - Your `_policyFilters` use operators (`$in`, `$ne`, etc.) — supply a
815
- * native matcher (mongokit's repo does the filter at the DB layer; for
816
- * custom repos, wrap the kit's own predicate engine).
817
- * - You're a mongokit / sqlitekit / Prisma user — the DB-level filter
818
- * applied by `getOne(compoundFilter)` already covers this.
819
- *
820
- * @example
821
- * ```ts
822
- * import { simpleEqualityMatcher } from '@classytic/arc/utils';
823
- *
824
- * // On a custom adapter
825
- * const adapter: DataAdapter = {
826
- * repository,
827
- * type: 'custom',
828
- * name: 'in-memory',
829
- * matchesFilter: simpleEqualityMatcher,
830
- * };
831
- *
832
- * // Or directly on BaseController for ad-hoc controllers
833
- * new BaseController(repo, { matchesFilter: simpleEqualityMatcher });
834
- * ```
835
- */
836
- declare function simpleEqualityMatcher(item: unknown, filters: Record<string, unknown>): boolean;
837
- //#endregion
838
- //#region src/utils/stateMachine.d.ts
839
- /**
840
- * State Machine Utility
841
- *
842
- * Pure utility for validating state transitions in workflow systems.
843
- * Zero dependencies, framework-agnostic.
844
- *
845
- * @example
846
- * const orderState = createStateMachine('Order', {
847
- * approve: ['pending', 'draft'],
848
- * cancel: ['pending', 'approved'],
849
- * fulfill: ['approved'],
850
- * });
851
- *
852
- * // Check if transition is allowed
853
- * if (orderState.can('approve', currentStatus)) {
854
- * // Perform approval
855
- * }
856
- *
857
- * // Assert transition (throws if invalid)
858
- * orderState.assert('approve', currentStatus, ValidationError);
859
- */
860
- interface StateMachine {
861
- /**
862
- * Synchronously check if action can be performed from current status.
863
- * Only checks the transition map — does NOT evaluate guards.
864
- * Use `canAsync()` when guards need to be evaluated.
865
- */
866
- can(action: string, status: string | null | undefined): boolean;
867
- /**
868
- * Asynchronously check if action can be performed, including guard evaluation.
869
- * Falls back to simple transition check when no guard is defined.
870
- */
871
- canAsync(action: string, status: string | null | undefined, context?: Record<string, unknown>): Promise<boolean>;
872
- /**
873
- * Assert action can be performed, throw error if invalid
874
- * @param action - Action to perform
875
- * @param status - Current status
876
- * @param errorFactory - Optional error constructor
877
- * @param message - Optional custom error message
878
- */
879
- assert(action: string, status: string | null | undefined, errorFactory?: (msg: string) => Error, message?: string): void;
880
- /**
881
- * Get transition history
882
- */
883
- getHistory?(): TransitionHistoryEntry[];
884
- /**
885
- * Record a transition
886
- */
887
- recordTransition?(from: string, to: string, action: string, metadata?: Record<string, unknown>): void;
888
- /**
889
- * Clear history
890
- */
891
- clearHistory?(): void;
892
- /**
893
- * Get available actions for current status
894
- */
895
- getAvailableActions?(status: string): string[];
896
- }
897
- interface TransitionHistoryEntry {
898
- from: string;
899
- to: string;
900
- action: string;
901
- timestamp: Date;
902
- metadata?: Record<string, unknown>;
903
- }
904
- /** Context passed to transition guards and actions */
905
- interface TransitionContext {
906
- from: string;
907
- to: string;
908
- action: string;
909
- data?: Record<string, unknown>;
910
- }
911
- type TransitionGuard = (context: TransitionContext) => boolean | Promise<boolean>;
912
- type TransitionAction = (context: TransitionContext) => void | Promise<void>;
913
- type TransitionConfig = Record<string, string[] | {
914
- from: string[];
915
- to?: string;
916
- guard?: TransitionGuard;
917
- before?: TransitionAction;
918
- after?: TransitionAction;
919
- }>;
920
- /**
921
- * Create a state machine for validating transitions
922
- *
923
- * @param name - Name of the state machine (used in error messages)
924
- * @param transitions - Map of actions to allowed source statuses
925
- * @param options - Additional options (history, guards, actions)
926
- * @returns State machine with can() and assert() methods
927
- *
928
- * @example
929
- * // Basic usage
930
- * const transferState = createStateMachine('Transfer', {
931
- * approve: ['draft'],
932
- * dispatch: ['approved'],
933
- * receive: ['dispatched', 'in_transit'],
934
- * cancel: ['draft', 'approved'],
935
- * });
936
- *
937
- * @example
938
- * // With guards and actions
939
- * const orderState = createStateMachine('Order', {
940
- * approve: {
941
- * from: ['pending'],
942
- * to: 'approved',
943
- * guard: ({ data }) => data.paymentConfirmed,
944
- * before: ({ from, to }) => console.log(`Approving order from ${from} to ${to}`),
945
- * after: ({ data }) => sendApprovalEmail(data.customerId),
946
- * },
947
- * }, { trackHistory: true });
948
- */
949
- declare function createStateMachine(name: string, transitions?: TransitionConfig, options?: {
950
- trackHistory?: boolean;
951
- }): StateMachine;
952
- //#endregion
953
- //#region src/utils/typeGuards.d.ts
954
- interface EventsDecorator {
955
- publish: <T>(type: string, payload: T, meta?: Record<string, unknown>) => Promise<void>;
956
- subscribe: (pattern: string, handler: (event: {
957
- type: string;
958
- payload: unknown;
959
- meta: Record<string, unknown>;
960
- }) => Promise<void>) => Promise<() => void>;
961
- transportName: string;
962
- }
963
- /** Check if fastify has the events plugin registered */
964
- declare function hasEvents(instance: FastifyInstance): instance is FastifyInstance & {
965
- events: EventsDecorator;
966
- };
967
- //#endregion
968
- export { ArcError, ArcQueryParser, type ArcQueryParserOptions, CircuitBreaker, CircuitBreakerError, type CircuitBreakerOptions, CircuitBreakerRegistry, type CircuitBreakerStats, CircuitState, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorDetails, type EventsDecorator, ForbiddenError, type Guard, type GuardConfig, type JsonSchema, type JsonSchemaTarget, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, type StateMachine, type TransitionConfig, UnauthorizedError, ValidationError, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorResponseSchema, getDefaultCrudSchemas, getListQueryParams, handleRaw, hasEvents, isArcError, isJsonSchema, isZodSchema, itemResponse, listResponse, mutationResponse, paginationSchema, queryParams, responses, simpleEqualityMatcher, successResponseSchema, toJsonSchema, withCompensation, wrapResponse };
1
+ import { $ as ValidationResult, A as handleRaw, B as CompensationStep, C as queryParams, D as ArcQueryParser, E as wrapResponse, F as defineErrorMapper, G as CircuitBreakerOptions, H as withCompensation, I as CompensationDefinition, J as CircuitState, K as CircuitBreakerRegistry, L as CompensationError, M as Guard, N as GuardConfig, O as ArcQueryParserOptions, P as defineGuard, Q as ValidateOptions, R as CompensationHooks, S as paginationSchema, T as successResponseSchema, U as CircuitBreaker, V as defineCompensation, W as CircuitBreakerError, X as createCircuitBreakerRegistry, Y as createCircuitBreaker, Z as ConfigError, _ as getDefaultCrudSchemas, a as TransitionConfig, at as ErrorDetails, b as listResponse, c as JsonSchemaTarget, ct as OrgAccessDeniedError, d as isJsonSchema, dt as ServiceUnavailableError, et as assertValidConfig, f as isZodSchema, ft as UnauthorizedError, g as errorResponseSchema, gt as isArcError, h as deleteResponse, ht as createError, i as StateMachine, it as ConflictError, j as envelope, k as createQueryParser, l as convertOpenApiSchemas, lt as OrgRequiredError, m as JsonSchema, mt as createDomainError, n as EventsDecorator, nt as validateResourceConfig, o as createStateMachine, ot as ForbiddenError, p as toJsonSchema, pt as ValidationError, q as CircuitBreakerStats, r as hasEvents, rt as ArcError, s as simpleEqualityMatcher, st as NotFoundError, t as getUserId, tt as formatValidationErrors, u as convertRouteSchema, ut as RateLimitError, v as getListQueryParams, w as responses, x as mutationResponse, y as itemResponse, z as CompensationResult } from "../index-smCAoA5W.mjs";
2
+ export { ArcError, ArcQueryParser, ArcQueryParserOptions, CircuitBreaker, CircuitBreakerError, CircuitBreakerOptions, CircuitBreakerRegistry, CircuitBreakerStats, CircuitState, CompensationDefinition, CompensationError, CompensationHooks, CompensationResult, CompensationStep, ConfigError, ConflictError, ErrorDetails, EventsDecorator, ForbiddenError, Guard, GuardConfig, JsonSchema, JsonSchemaTarget, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, ServiceUnavailableError, StateMachine, TransitionConfig, UnauthorizedError, ValidateOptions, ValidationError, ValidationResult, assertValidConfig, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, envelope, errorResponseSchema, formatValidationErrors, getDefaultCrudSchemas, getListQueryParams, getUserId, handleRaw, hasEvents, isArcError, isJsonSchema, isZodSchema, itemResponse, listResponse, mutationResponse, paginationSchema, queryParams, responses, simpleEqualityMatcher, successResponseSchema, toJsonSchema, validateResourceConfig, withCompensation, wrapResponse };