@classytic/arc 2.43.0 → 2.45.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.
Files changed (214) hide show
  1. package/dist/{EventTransport-tzA7CAB4.mjs → EventTransport-Ci6hGO1Y.mjs} +2 -2
  2. package/dist/{HookSystem-B6UaKRbF.mjs → HookSystem-CtnnYHME.mjs} +2 -2
  3. package/dist/{ResourceRegistry-CuCARu2B.mjs → ResourceRegistry-BNoHOx-D.mjs} +2 -2
  4. package/dist/acquire-BW_2Dt60.mjs +35 -0
  5. package/dist/{actionPermissions-BotX1YOa.mjs → actionPermissions-TAc_6LCw.mjs} +13 -17
  6. package/dist/audit/index.d.mts +6 -6
  7. package/dist/audit/index.mjs +4 -4
  8. package/dist/auth/audit.d.mts +8 -8
  9. package/dist/auth/audit.mjs +1 -1
  10. package/dist/auth/index.d.mts +5 -5
  11. package/dist/auth/index.mjs +14 -12
  12. package/dist/auth/redis-session.d.mts +4 -5
  13. package/dist/auth/redis-session.mjs +1 -1
  14. package/dist/{authorizationDecision-DQYrkl5f.mjs → authorizationDecision-BixzgirP.mjs} +4 -4
  15. package/dist/{boundedMap-BULzfXYU.mjs → boundedMap-DQfXgxMo.mjs} +1 -1
  16. package/dist/{buildHandler-CRQ8EcX5.mjs → buildHandler-mEUmO2_u.mjs} +4 -4
  17. package/dist/cache/index.d.mts +9 -9
  18. package/dist/cache/index.mjs +4 -4
  19. package/dist/{caching-Cc2M1DwO.mjs → caching-TQfW2QX7.mjs} +2 -2
  20. package/dist/{claimed-B10RTfkM.mjs → claimed-CnEEOHuL.mjs} +1 -1
  21. package/dist/cleanup/index.d.mts +14 -14
  22. package/dist/cleanup/index.mjs +4 -4
  23. package/dist/cli/commands/describe.d.mts +5 -5
  24. package/dist/cli/commands/describe.mjs +3 -3
  25. package/dist/cli/commands/docs.d.mts +2 -3
  26. package/dist/cli/commands/docs.mjs +3 -3
  27. package/dist/cli/commands/doctor.d.mts +2 -3
  28. package/dist/cli/commands/doctor.mjs +1 -1
  29. package/dist/cli/commands/generate.mjs +2 -3
  30. package/dist/cli/commands/init.mjs +2 -3
  31. package/dist/cli/commands/introspect.d.mts +2 -3
  32. package/dist/cli/commands/introspect.mjs +2 -2
  33. package/dist/cli/index.mjs +3 -3
  34. package/dist/{constants-Cu7Mx7_U.mjs → constants-B90SnSQn.mjs} +1 -1
  35. package/dist/context/index.d.mts +9 -9
  36. package/dist/context/index.mjs +5 -5
  37. package/dist/core/index.d.mts +3 -3
  38. package/dist/core/index.mjs +8 -8
  39. package/dist/{core-Cb0LjccA.mjs → core-DV9PSXtr.mjs} +13 -4
  40. package/dist/{createActionRouter-xjqonMRO.mjs → createActionRouter-BgPCYU2U.mjs} +18 -8
  41. package/dist/{createAggregationRouter-zRYWw_5D.mjs → createAggregationRouter-lNCkDwKe.mjs} +7 -7
  42. package/dist/{createApp-D-953ZAq.mjs → createApp-BSBPntOQ.mjs} +34 -32
  43. package/dist/{createMcpServer-C9cxS8zt.d.mts → createMcpServer-DSztofa9.d.mts} +1 -1
  44. package/dist/{defineAggregation-Bm8RjMbq.mjs → defineAggregation-CwD8_XNd.mjs} +1 -1
  45. package/dist/{defineResource-DIC7JZGU.mjs → defineResource-CRkhRRSj.mjs} +7 -7
  46. package/dist/discovery/index.d.mts +6 -7
  47. package/dist/discovery/index.mjs +1 -1
  48. package/dist/docs/index.d.mts +3 -3
  49. package/dist/docs/index.mjs +3 -3
  50. package/dist/{elevation-DG8SrLN-.mjs → elevation-BAfsnnO0.mjs} +5 -5
  51. package/dist/encryption/index.d.mts +5 -5
  52. package/dist/encryption/index.mjs +3 -3
  53. package/dist/{errorHandler-BnfDviL1.mjs → errorHandler-DbHGwrQM.mjs} +3 -3
  54. package/dist/{errors-CtrywMHP.mjs → errors-C9G4A8cN.mjs} +1 -1
  55. package/dist/{eventPlugin-Q6BhzHzs.mjs → eventPlugin-Dghr7iL5.mjs} +8 -8
  56. package/dist/{eventTypes-Cdhm6ZlV.mjs → eventTypes-DDy7BMAn.mjs} +2 -2
  57. package/dist/events/index.d.mts +14 -14
  58. package/dist/events/index.mjs +7 -7
  59. package/dist/events/transports/redis-stream-entry.mjs +4 -4
  60. package/dist/events/transports/redis.d.mts +4 -5
  61. package/dist/events/transports/redis.mjs +2 -2
  62. package/dist/factory/index.d.mts +16 -16
  63. package/dist/factory/index.mjs +6 -6
  64. package/dist/{fastify-augmentation-DhUJ-mvo.d.mts → fastify-augmentation-DRlCIWE9.d.mts} +2 -2
  65. package/dist/{fields-ToPYpMqS.mjs → fields-Da--1DNS.mjs} +1 -1
  66. package/dist/{filter-merge-IpGywvym.mjs → filter-merge-BYKBa9b2.mjs} +1 -1
  67. package/dist/{generate-DRTkLlIl.mjs → generate-Cm5Ct81v.mjs} +2 -2
  68. package/dist/{headers-BbkIF6vA.mjs → headers-B6DRXXzT.mjs} +2 -2
  69. package/dist/{health-D-Ft6JM6.mjs → health-hRGgxnOC.mjs} +1 -1
  70. package/dist/{health-DqbsG-_w.mjs → health-pLbfckGB.mjs} +1 -1
  71. package/dist/hooks/index.d.mts +1 -1
  72. package/dist/hooks/index.mjs +2 -3
  73. package/dist/idempotency/index.d.mts +8 -6
  74. package/dist/idempotency/index.mjs +108 -46
  75. package/dist/idempotency/redis.d.mts +1 -1
  76. package/dist/idempotency/redis.mjs +30 -2
  77. package/dist/{index-CRoPtISf.d.mts → index-Beg3aNnK.d.mts} +3 -31
  78. package/dist/{index-JdbZAIsm.d.mts → index-CUJvoyw3.d.mts} +1 -1
  79. package/dist/{index-mqaqZNpe.d.mts → index-WH7xgvxS.d.mts} +52 -1
  80. package/dist/{index-C8zVGYsk.d.mts → index-uhkUA5-U.d.mts} +4 -4
  81. package/dist/index.d.mts +5 -5
  82. package/dist/index.mjs +11 -11
  83. package/dist/{init-B_oUYDXI.mjs → init-lpaUB-Ph.mjs} +1 -1
  84. package/dist/integrations/event-gateway.d.mts +3 -4
  85. package/dist/integrations/event-gateway.mjs +2 -2
  86. package/dist/integrations/index.d.mts +1 -1
  87. package/dist/integrations/index.mjs +1 -1
  88. package/dist/integrations/jobs/index.mjs +3 -3
  89. package/dist/integrations/mcp/index.d.mts +36 -36
  90. package/dist/integrations/mcp/index.mjs +2 -2
  91. package/dist/integrations/mcp/testing.d.mts +8 -9
  92. package/dist/integrations/mcp/testing.mjs +2 -2
  93. package/dist/integrations/streamline.d.mts +12 -13
  94. package/dist/integrations/streamline.mjs +18 -4
  95. package/dist/integrations/webhooks.d.mts +23 -23
  96. package/dist/integrations/webhooks.mjs +3 -3
  97. package/dist/integrations/websocket-pushref-redis.d.mts +4 -5
  98. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  99. package/dist/integrations/websocket-redis.d.mts +4 -5
  100. package/dist/integrations/websocket-redis.mjs +1 -1
  101. package/dist/integrations/websocket.mjs +2 -2
  102. package/dist/{interface-C0395yUN.d.mts → interface-JJzwH4Ro.d.mts} +22 -2
  103. package/dist/{jsonBody-B4YVGcql.mjs → jsonBody-CzKHE-Fg.mjs} +2 -2
  104. package/dist/{keys-B2KtgMLJ.mjs → keys-BoZKnBel.mjs} +1 -1
  105. package/dist/{loadResources-Dn4lalw2.mjs → loadResources-BEKG6bP9.mjs} +3 -3
  106. package/dist/{loadResourcesFromEntry-3sLYbuse.mjs → loadResourcesFromEntry-BEPA0ptL.mjs} +2 -2
  107. package/dist/logger/index.d.mts +9 -10
  108. package/dist/logger/index.mjs +2 -3
  109. package/dist/{logger-DXjfIqjV.mjs → logger-vxu0DXf_.mjs} +1 -1
  110. package/dist/{mcpPlugin-C08HalN5.mjs → mcpPlugin-DP_UB0LK.mjs} +42 -29
  111. package/dist/{memory-9Cp7611C.mjs → memory-DJN6kyC8.mjs} +3 -3
  112. package/dist/{metrics-CWI11eRu.mjs → metrics-wfr7XFE7.mjs} +3 -3
  113. package/dist/middleware/index.d.mts +5 -5
  114. package/dist/middleware/index.mjs +3 -3
  115. package/dist/migrations/index.d.mts +13 -13
  116. package/dist/migrations/index.mjs +2 -2
  117. package/dist/{module-BSvOQC7E.mjs → module-BtdcGn_E.mjs} +1 -1
  118. package/dist/mongodb-memory-server-Cn57YIsc.mjs +35539 -0
  119. package/dist/mongoose-DzFjTtBN.mjs +67451 -0
  120. package/dist/{multiTenant-cY0FkDiA.d.mts → multiTenant-CAtYlW6H.d.mts} +1 -1
  121. package/dist/{multipartBody-CXM2a-Dy.mjs → multipartBody-NHGOuUnG.mjs} +1 -1
  122. package/dist/node-C0HB_V6E.mjs +41236 -0
  123. package/dist/{openapi-DT_G4VhY.mjs → openapi-BCOaGAgE.mjs} +6 -6
  124. package/dist/outbox-admin/index.d.mts +2 -2
  125. package/dist/outbox-admin/index.mjs +5 -5
  126. package/dist/{outbox-module-Bjgzl6tg.mjs → outbox-module-BVDiMwXb.mjs} +9 -9
  127. package/dist/permissions/index.mjs +7 -7
  128. package/dist/{permissions-Cm0uYHvd.mjs → permissions-IdHJ0_5V.mjs} +9 -9
  129. package/dist/{pipe-BqeGT6UO.mjs → pipe-BPJPifhi.mjs} +2 -2
  130. package/dist/pipeline/index.d.mts +7 -7
  131. package/dist/pipeline/index.mjs +2 -2
  132. package/dist/{plan-FVR6LP59.mjs → plan-CEedaMlr.mjs} +1 -1
  133. package/dist/{plugin-BccET1tL.mjs → plugin-BDBOS3-c.mjs} +39 -27
  134. package/dist/plugins/index.d.mts +8 -8
  135. package/dist/plugins/index.mjs +17 -17
  136. package/dist/plugins/response-cache.d.mts +5 -6
  137. package/dist/plugins/response-cache.mjs +4 -4
  138. package/dist/plugins/tracing-entry.mjs +2 -2
  139. package/dist/{pluralize-CVIOcgMF.mjs → pluralize-B4FcZEyI.mjs} +1 -1
  140. package/dist/presets/filesUpload.d.mts +7 -7
  141. package/dist/presets/filesUpload.mjs +5 -5
  142. package/dist/presets/index.d.mts +14 -14
  143. package/dist/presets/index.mjs +2 -2
  144. package/dist/presets/multiTenant.d.mts +1 -1
  145. package/dist/presets/multiTenant.mjs +5 -5
  146. package/dist/presets/search.d.mts +8 -9
  147. package/dist/presets/search.mjs +2 -2
  148. package/dist/{presets-Cpvj6fGO.mjs → presets-BPjNc-Np.mjs} +4 -4
  149. package/dist/{projection-Ce4aQhQk.mjs → projection-BXUOYosj.mjs} +2 -2
  150. package/dist/{queryCachePlugin-CFWNH8aT.mjs → queryCachePlugin-s4pBvjFF.mjs} +6 -6
  151. package/dist/{rateLimitKey-C4O-kPm0.mjs → rateLimitKey-C4mkCwQ-.mjs} +1 -1
  152. package/dist/{realtime-DmPE9S54.mjs → realtime-MPj6eIoV.mjs} +11 -11
  153. package/dist/{redis-vLvtcGy_.d.mts → redis-BDgv9Glw.d.mts} +5 -1
  154. package/dist/registry/index.d.mts +9 -9
  155. package/dist/registry/index.mjs +3 -3
  156. package/dist/{registry-Bcz9G1bh.mjs → registry-DIdh6mWE.mjs} +5 -4
  157. package/dist/{renewingLease-qODa7KJQ.mjs → renewingLease-boGRXWCr.mjs} +1 -1
  158. package/dist/{replyHelpers-CG_VtVgS.mjs → replyHelpers-BW_p67QD.mjs} +2 -2
  159. package/dist/{requestContext-Dsu9P1bV.mjs → requestContext-B8JKbeb7.mjs} +1 -1
  160. package/dist/{requirement-KDdoRcOP.mjs → requirement-tXpcD56f.mjs} +1 -1
  161. package/dist/{resourceRateLimit-dSjVr1pk.mjs → resourceRateLimit-DWob9nQ8.mjs} +2 -2
  162. package/dist/rolldown-runtime-AD16t29l.mjs +45 -0
  163. package/dist/{routeValidator-D36SW8qt.mjs → routeValidator-CnmenC4Y.mjs} +1 -1
  164. package/dist/{runtimeCapabilities-0tccjRlj.mjs → runtimeCapabilities-C7gAbIxC.mjs} +1 -1
  165. package/dist/{schedules-C-OpmHBq.mjs → schedules-Dr9gNFzx.mjs} +5 -5
  166. package/dist/{schemaConverter-BORek3O-.mjs → schemaConverter-rzBovk00.mjs} +2 -2
  167. package/dist/{schemaIR-C7Vbp71I.mjs → schemaIR-GrOK1JO4.mjs} +2 -2
  168. package/dist/schemas/index.d.mts +10 -10
  169. package/dist/schemas/index.mjs +1 -1
  170. package/dist/scim/index.d.mts +13 -13
  171. package/dist/scim/index.mjs +2 -2
  172. package/dist/scope/index.d.mts +3 -3
  173. package/dist/scope/index.mjs +5 -5
  174. package/dist/{scope-DQthe88b.mjs → scope-DpOpxyHT.mjs} +4 -4
  175. package/dist/{shutdown-MqA81z_P.mjs → shutdown-BW8qwgpx.mjs} +1 -1
  176. package/dist/{simpleEqualityMatcher-auW8QjXN.mjs → simpleEqualityMatcher-WdZw6GOt.mjs} +1 -1
  177. package/dist/sse-D8AgoUN3.mjs +212 -0
  178. package/dist/{sseStream-B5_Afiqn.mjs → sseStream-B7rPhIQw.mjs} +2 -2
  179. package/dist/{store-helpers-BOzk-CuX.mjs → store-helpers-Bxk7TDgG.mjs} +1 -1
  180. package/dist/{streaming-DjTQhZrN.mjs → streaming-BLg1buwL.mjs} +1 -1
  181. package/dist/{subscriberIdentity-CW39uA8G.mjs → subscriberIdentity-Cxp19Ked.mjs} +1 -1
  182. package/dist/{tenancy--ed9eH_z.mjs → tenancy-D7jo78AP.mjs} +2 -2
  183. package/dist/{tenantPreparation-BKon6Yox.mjs → tenantPreparation-DqJnokDW.mjs} +4 -4
  184. package/dist/testing/cleanupStoreContract.d.mts +4 -5
  185. package/dist/testing/cleanupStoreContract.mjs +1 -1
  186. package/dist/testing/index.d.mts +35 -35
  187. package/dist/testing/index.mjs +16 -15
  188. package/dist/testing/outboxStoreContract.d.mts +4 -5
  189. package/dist/testing/outboxStoreContract.mjs +2 -2
  190. package/dist/testing/requiredPorts.d.mts +4 -5
  191. package/dist/testing/requiredPorts.mjs +2 -2
  192. package/dist/testing/storageContract.d.mts +4 -5
  193. package/dist/testing/storageContract.mjs +1 -1
  194. package/dist/{timing-qczZ0YC-.mjs → timing-Y6_ZpoYG.mjs} +1 -1
  195. package/dist/{transactionContext-DjFkrNG6.mjs → transactionContext-BWp0MBGL.mjs} +1 -1
  196. package/dist/{typeGuards-CySF12G-.mjs → typeGuards-CtZJypJO.mjs} +1 -1
  197. package/dist/types/index.d.mts +1 -1
  198. package/dist/types/index.mjs +1 -1
  199. package/dist/types/storage.mjs +1 -1
  200. package/dist/{types-Bk9NOgOC.mjs → types-4JKkSvds.mjs} +4 -4
  201. package/dist/{types-B4Aq4Sdj.d.mts → types-D3Ixsh00.d.mts} +1 -1
  202. package/dist/usage/index.d.mts +4 -4
  203. package/dist/usage/index.mjs +4 -4
  204. package/dist/{userHelpers-aklawRaK.mjs → userHelpers-Nc5ePCsf.mjs} +1 -1
  205. package/dist/utils/index.d.mts +47 -47
  206. package/dist/utils/index.mjs +12 -12
  207. package/dist/{utils-ec1oTo1n.mjs → utils-QWSIKqAk.mjs} +4 -4
  208. package/dist/{validate-9yzHC1e2.mjs → validate-CT4umNhp.mjs} +3 -3
  209. package/dist/{versioning-Bsb51gGT.d.mts → versioning-Bqm_57Qt.d.mts} +23 -1
  210. package/dist/{versioning-fhhWHV74.mjs → versioning-JIqxO64K.mjs} +3 -3
  211. package/dist/{workScope-zpPyge4t.mjs → workScope-BDjGXwU9.mjs} +2 -2
  212. package/package.json +47 -52
  213. package/dist/rolldown-runtime-D1w9Y1VJ.mjs +0 -15
  214. package/dist/sse-CYzQBVFe.mjs +0 -89
@@ -1,19 +1,19 @@
1
1
 
2
2
  import { F as getHeader, I as requireSingleHeaderValue, P as ArcHeaders } from "../types-Ddl9OjmE.mjs";
3
3
  import { f as getUserId, m as normalizeRoles, p as getUserRoles, t as AnyRecord } from "../base-CZyixEQR.mjs";
4
- import { Y as OpenApiSchemas, h as QueryParserInterface, p as ParsedQuery } from "../index-mqaqZNpe.mjs";
4
+ import { Y as OpenApiSchemas, h as QueryParserInterface, p as ParsedQuery } from "../index-WH7xgvxS.mjs";
5
5
  import { n as ErrorMapper } from "../errorHandler--4rSMMvq.mjs";
6
6
  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 ErrorOptions, s as OrgRequiredError, t as ArcError, u as UnauthorizedError } from "../errors-JYc9vwqE.mjs";
7
7
  import { errorContractSchema } from "@classytic/repo-core/errors";
8
8
  import { FilterClause } from "@classytic/repo-core/query-parser";
9
9
  import { FastifyInstance, FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
10
10
  //#region src/utils/circuitBreaker.d.ts
11
- declare const CircuitState: {
11
+ export declare const CircuitState: {
12
12
  readonly CLOSED: "CLOSED";
13
13
  readonly OPEN: "OPEN";
14
14
  readonly HALF_OPEN: "HALF_OPEN";
15
15
  };
16
- type CircuitState = (typeof CircuitState)[keyof typeof CircuitState];
16
+ export type CircuitState = (typeof CircuitState)[keyof typeof CircuitState];
17
17
  /**
18
18
  * Generic constraint for "any async function" that survives strict TS.
19
19
  *
@@ -174,13 +174,13 @@ interface CircuitBreakerStats {
174
174
  * error handler sends it as `Retry-After`, so well-behaved clients back off
175
175
  * for as long as the breaker is actually going to refuse them.
176
176
  */
177
- declare class CircuitBreakerError extends ArcError {
177
+ export declare class CircuitBreakerError extends ArcError {
178
178
  readonly state: CircuitState;
179
179
  /** Seconds until the circuit next probes, when known. */
180
180
  readonly retryAfter?: number;
181
181
  constructor(message: string, state: CircuitState, retryAfter?: number);
182
182
  }
183
- declare class CircuitBreaker<T extends AnyAsyncFn> {
183
+ export declare class CircuitBreaker<T extends AnyAsyncFn> {
184
184
  private state;
185
185
  private failures;
186
186
  private successes;
@@ -267,11 +267,11 @@ declare class CircuitBreaker<T extends AnyAsyncFn> {
267
267
  * { name: 'email-service' }
268
268
  * );
269
269
  */
270
- declare function createCircuitBreaker<T extends AnyAsyncFn>(fn: T, options?: CircuitBreakerOptions): CircuitBreaker<T>;
270
+ export declare function createCircuitBreaker<T extends AnyAsyncFn>(fn: T, options?: CircuitBreakerOptions): CircuitBreaker<T>;
271
271
  /**
272
272
  * Circuit breaker registry for managing multiple breakers
273
273
  */
274
- declare class CircuitBreakerRegistry {
274
+ export declare class CircuitBreakerRegistry {
275
275
  private breakers;
276
276
  /**
277
277
  * Register a circuit breaker
@@ -306,7 +306,7 @@ declare class CircuitBreakerRegistry {
306
306
  * Create a new CircuitBreakerRegistry instance.
307
307
  * Use this instead of a global singleton — attach to fastify.arc or pass explicitly.
308
308
  */
309
- declare function createCircuitBreakerRegistry(): CircuitBreakerRegistry;
309
+ export declare function createCircuitBreakerRegistry(): CircuitBreakerRegistry;
310
310
  //#endregion
311
311
  //#region src/utils/circuitBreakerRedis.d.ts
312
312
  /**
@@ -336,7 +336,7 @@ interface RedisCircuitBreakerStateOptions {
336
336
  windowMs?: number;
337
337
  }
338
338
  /** Fixed-window cluster failure counter. See the module header. */
339
- declare class RedisCircuitBreakerState implements CircuitBreakerSharedState {
339
+ export declare class RedisCircuitBreakerState implements CircuitBreakerSharedState {
340
340
  #private;
341
341
  readonly name = "redis";
342
342
  constructor(options: RedisCircuitBreakerStateOptions);
@@ -446,12 +446,12 @@ type CompensationResult = {
446
446
  *
447
447
  * @typeParam TCtx - Context type shared across steps (defaults to Record<string, unknown>)
448
448
  */
449
- declare function withCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(_name: string, steps: readonly CompensationStep<TCtx>[], initialContext?: TCtx, hooks?: CompensationHooks): Promise<CompensationResult>;
449
+ export declare function withCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(_name: string, steps: readonly CompensationStep<TCtx>[], initialContext?: TCtx, hooks?: CompensationHooks): Promise<CompensationResult>;
450
450
  interface CompensationDefinition<TCtx extends Record<string, unknown> = Record<string, unknown>> {
451
451
  readonly name: string;
452
452
  readonly execute: (initialContext?: TCtx, hooks?: CompensationHooks) => Promise<CompensationResult>;
453
453
  }
454
- declare function defineCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(name: string, steps: readonly CompensationStep<TCtx>[]): CompensationDefinition<TCtx>;
454
+ export declare function defineCompensation<TCtx extends Record<string, unknown> = Record<string, unknown>>(name: string, steps: readonly CompensationStep<TCtx>[]): CompensationDefinition<TCtx>;
455
455
  //#endregion
456
456
  //#region src/utils/defineErrorMapper.d.ts
457
457
  /**
@@ -467,7 +467,7 @@ declare function defineCompensation<TCtx extends Record<string, unknown> = Recor
467
467
  * called with a non-`T` error at runtime. This helper codifies that invariant
468
468
  * in one place.
469
469
  */
470
- declare function defineErrorMapper<T extends Error>(mapper: ErrorMapper<T>): ErrorMapper;
470
+ export declare function defineErrorMapper<T extends Error>(mapper: ErrorMapper<T>): ErrorMapper;
471
471
  //#endregion
472
472
  //#region src/utils/defineGuard.d.ts
473
473
  interface GuardConfig<T> {
@@ -494,7 +494,7 @@ interface Guard<T> {
494
494
  /**
495
495
  * Create a typed guard. See module JSDoc for usage.
496
496
  */
497
- declare function defineGuard<T>(config: GuardConfig<T>): Guard<T>;
497
+ export declare function defineGuard<T>(config: GuardConfig<T>): Guard<T>;
498
498
  //#endregion
499
499
  //#region src/utils/filter-dialect.d.ts
500
500
  interface FilterDialect {
@@ -503,12 +503,12 @@ interface FilterDialect {
503
503
  /** The operator tokens this dialect can emit — for audits and docs. */
504
504
  readonly tokens: readonly string[];
505
505
  }
506
- declare const MONGO_DIALECT: FilterDialect;
506
+ export declare const MONGO_DIALECT: FilterDialect;
507
507
  /**
508
508
  * Store-neutral: `{ field: { <op>: value } }` with the grammar's own operator names, for a host
509
509
  * that compiles the canonical clauses itself.
510
510
  */
511
- declare const NEUTRAL_DIALECT: FilterDialect;
511
+ export declare const NEUTRAL_DIALECT: FilterDialect;
512
512
  //#endregion
513
513
  //#region src/utils/handleRaw.d.ts
514
514
  /**
@@ -521,7 +521,7 @@ declare const NEUTRAL_DIALECT: FilterDialect;
521
521
  * @returns The reply, so Fastify waits for it: resolving `undefined` after `reply.send()` while an
522
522
  * async `preSerialization` hook (idempotency, encryption) is pending re-sends an empty body.
523
523
  */
524
- declare function handleRaw<T>(handler: (request: FastifyRequest, reply: FastifyReply) => Promise<T>, statusCode?: number): (request: FastifyRequest, reply: FastifyReply) => Promise<FastifyReply>;
524
+ export declare function handleRaw<T>(handler: (request: FastifyRequest, reply: FastifyReply) => Promise<T>, statusCode?: number): (request: FastifyRequest, reply: FastifyReply) => Promise<FastifyReply>;
525
525
  //#endregion
526
526
  //#region src/utils/queryParser.d.ts
527
527
  interface ArcQueryParserOptions {
@@ -555,7 +555,7 @@ interface ArcQueryParserOptions {
555
555
  * avoids collisions with reserved keys (`page`, `sort`, ...)
556
556
  * - Search `?search=`, populate `?populate=a,b`, select `?select=a,-b`
557
557
  */
558
- declare class ArcQueryParser implements QueryParserInterface {
558
+ export declare class ArcQueryParser implements QueryParserInterface {
559
559
  /**
560
560
  * Public so `QueryResolver` reuses this cap instead of stacking its own
561
561
  * (independent caps silently truncate to the lowest).
@@ -597,7 +597,7 @@ declare class ArcQueryParser implements QueryParserInterface {
597
597
  };
598
598
  }
599
599
  /** Create a new ArcQueryParser instance. */
600
- declare function createQueryParser(options?: ArcQueryParserOptions): ArcQueryParser;
600
+ export declare function createQueryParser(options?: ArcQueryParserOptions): ArcQueryParser;
601
601
  //#endregion
602
602
  //#region src/utils/responseSchemas.d.ts
603
603
  interface JsonSchema {
@@ -624,7 +624,7 @@ interface JsonSchema {
624
624
  * Runtime format (flat fields):
625
625
  * { page, limit, total, pages, hasNext, hasPrev }
626
626
  */
627
- declare const paginationSchema: JsonSchema;
627
+ export declare const paginationSchema: JsonSchema;
628
628
  /**
629
629
  * List response schema — accepts every wire shape `toCanonicalList` can
630
630
  * emit. Hosts who know their endpoint only ever produces one variant can
@@ -646,18 +646,18 @@ declare const paginationSchema: JsonSchema;
646
646
  * per-response branch validation. The list route also serves count, exists
647
647
  * and distinct dispatch verbs, so no field is common to every valid shape.
648
648
  */
649
- declare function listResponse(itemSchema: JsonSchema): JsonSchema;
649
+ export declare function listResponse(itemSchema: JsonSchema): JsonSchema;
650
650
  /** Offset variant — `{ method: 'offset', data, page, limit, total, pages, hasNext, hasPrev }`. */
651
- declare function offsetListResponse(itemSchema: JsonSchema): JsonSchema;
651
+ export declare function offsetListResponse(itemSchema: JsonSchema): JsonSchema;
652
652
  /** Keyset variant — `{ method: 'keyset', data, limit, hasMore, next: string | null }`. */
653
- declare function keysetListResponse(itemSchema: JsonSchema): JsonSchema;
653
+ export declare function keysetListResponse(itemSchema: JsonSchema): JsonSchema;
654
654
  /** Aggregate variant — same shape as offset, discriminated by `method: 'aggregate'`. */
655
- declare function aggregateListResponse(itemSchema: JsonSchema): JsonSchema;
655
+ export declare function aggregateListResponse(itemSchema: JsonSchema): JsonSchema;
656
656
  /** Bare variant — `{ data }`, no `method` discriminant. */
657
- declare function bareListResponse(itemSchema: JsonSchema): JsonSchema;
657
+ export declare function bareListResponse(itemSchema: JsonSchema): JsonSchema;
658
658
  /** Delete response — flat shape mirroring the canonical delete envelope. */
659
- declare function deleteResponse(): JsonSchema;
660
- declare const responses: {
659
+ export declare function deleteResponse(): JsonSchema;
660
+ export declare const responses: {
661
661
  200: (schema: JsonSchema) => {
662
662
  description: string;
663
663
  content: {
@@ -1033,7 +1033,7 @@ declare const responses: {
1033
1033
  };
1034
1034
  };
1035
1035
  };
1036
- declare const queryParams: {
1036
+ export declare const queryParams: {
1037
1037
  pagination: {
1038
1038
  page: {
1039
1039
  type: string;
@@ -1070,7 +1070,7 @@ declare const queryParams: {
1070
1070
  /**
1071
1071
  * Get standard list query parameters schema
1072
1072
  */
1073
- declare function getListQueryParams(): AnyRecord;
1073
+ export declare function getListQueryParams(): AnyRecord;
1074
1074
  /**
1075
1075
  * Get default response schemas for all CRUD operations.
1076
1076
  *
@@ -1082,7 +1082,7 @@ declare function getListQueryParams(): AnyRecord;
1082
1082
  * Note: `example` properties are stripped from defaults so they work with
1083
1083
  * any Fastify instance (not just createApp which adds `keywords: ['example']`).
1084
1084
  */
1085
- declare function getDefaultCrudSchemas(): Record<string, Record<string, unknown>>;
1085
+ export declare function getDefaultCrudSchemas(): Record<string, Record<string, unknown>>;
1086
1086
  //#endregion
1087
1087
  //#region src/utils/runtimeCapabilities.d.ts
1088
1088
  /** What a subsystem declares about the state it holds. */
@@ -1106,7 +1106,7 @@ interface RuntimeCapabilityDeclaration {
1106
1106
  * and encapsulated children of any of them — which is the point: the audit
1107
1107
  * sees what the constructor-time guard cannot.
1108
1108
  */
1109
- declare function declareRuntimeCapability(fastify: FastifyInstance, decl: RuntimeCapabilityDeclaration): void;
1109
+ export declare function declareRuntimeCapability(fastify: FastifyInstance, decl: RuntimeCapabilityDeclaration): void;
1110
1110
  //#endregion
1111
1111
  //#region src/utils/schemaConverter.d.ts
1112
1112
  /**
@@ -1127,11 +1127,11 @@ type SchemaIo = "input" | "output";
1127
1127
  * Returns true if it has JSON Schema markers (`type`, `properties`, `$ref`,
1128
1128
  * `allOf`, `anyOf`, `oneOf`, `items`, `enum`) and does NOT have Zod markers.
1129
1129
  */
1130
- declare function isJsonSchema(input: unknown): input is Record<string, unknown>;
1130
+ export declare function isJsonSchema(input: unknown): input is Record<string, unknown>;
1131
1131
  /**
1132
1132
  * Check if an object is a Zod schema (has `_zod` marker from Zod v4).
1133
1133
  */
1134
- declare function isZodSchema(input: unknown): boolean;
1134
+ export declare function isZodSchema(input: unknown): boolean;
1135
1135
  /**
1136
1136
  * How `toJsonSchema` reacts when a Zod schema CANNOT be converted (zod not
1137
1137
  * installed/loaded, zod v3, or `z.toJSONSchema()` threw):
@@ -1165,7 +1165,7 @@ type UnconvertibleMode = "warn" | "throw";
1165
1165
  * docblock. Defaults to `'output'`, matching Zod's own default;
1166
1166
  * arc's request-side call sites pass `'input'` explicitly.
1167
1167
  */
1168
- declare function toJsonSchema(input: unknown, target?: JsonSchemaTarget, mode?: UnconvertibleMode, io?: SchemaIo): Record<string, unknown> | undefined;
1168
+ export declare function toJsonSchema(input: unknown, target?: JsonSchemaTarget, mode?: UnconvertibleMode, io?: SchemaIo): Record<string, unknown> | undefined;
1169
1169
  /**
1170
1170
  * Convert all schema fields in an OpenApiSchemas object.
1171
1171
  * JSON Schema values pass through unchanged. Only Zod schemas are converted.
@@ -1173,7 +1173,7 @@ declare function toJsonSchema(input: unknown, target?: JsonSchemaTarget, mode?:
1173
1173
  * Defaults to the `openapi-3.0` target since this function feeds OpenAPI doc
1174
1174
  * generation, not Fastify route validation.
1175
1175
  */
1176
- declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSchemaTarget): OpenApiSchemas;
1176
+ export declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSchemaTarget): OpenApiSchemas;
1177
1177
  /**
1178
1178
  * Convert schema values in a Fastify route schema record.
1179
1179
  *
@@ -1187,7 +1187,7 @@ declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSch
1187
1187
  * Defaults to `draft-7` so Fastify v5's bundled AJV 8 accepts the output.
1188
1188
  * Pass `openapi-3.0` (or `openapi-3.1`) when generating OpenAPI documents.
1189
1189
  */
1190
- declare function convertRouteSchema(schema: Record<string, unknown>, target?: JsonSchemaTarget): Record<string, unknown>;
1190
+ export declare function convertRouteSchema(schema: Record<string, unknown>, target?: JsonSchemaTarget): Record<string, unknown>;
1191
1191
  //#endregion
1192
1192
  //#region src/utils/shutdown.d.ts
1193
1193
  interface ShutdownParticipant {
@@ -1197,9 +1197,9 @@ interface ShutdownParticipant {
1197
1197
  drain?(): void | Promise<void>;
1198
1198
  }
1199
1199
  /** Descendants of admitted work may finish their causal publications during shutdown. */
1200
- declare function runAdmittedWork<T>(work: () => T | Promise<T>): Promise<T>;
1200
+ export declare function runAdmittedWork<T>(work: () => T | Promise<T>): Promise<T>;
1201
1201
  /** A participant's stop must prevent new work; drain waits for work already admitted. */
1202
- declare function registerShutdownParticipant(fastify: FastifyInstance, participant: ShutdownParticipant): void;
1202
+ export declare function registerShutdownParticipant(fastify: FastifyInstance, participant: ShutdownParticipant): void;
1203
1203
  //#endregion
1204
1204
  //#region src/utils/simpleEqualityMatcher.d.ts
1205
1205
  /**
@@ -1226,7 +1226,7 @@ declare function registerShutdownParticipant(fastify: FastifyInstance, participa
1226
1226
  * matchesFilter: simpleEqualityMatcher };
1227
1227
  * ```
1228
1228
  */
1229
- declare function simpleEqualityMatcher(item: unknown, filters: Record<string, unknown>): boolean;
1229
+ export declare function simpleEqualityMatcher(item: unknown, filters: Record<string, unknown>): boolean;
1230
1230
  //#endregion
1231
1231
  //#region src/utils/sseStream.d.ts
1232
1232
  interface SseStreamOptions {
@@ -1258,7 +1258,7 @@ interface SseStream {
1258
1258
  * gate (auth, permissions, validation) has passed — after `hijack()` no
1259
1259
  * JSON error can be sent.
1260
1260
  */
1261
- declare function openSseStream(request: FastifyRequest, reply: FastifyReply, options?: SseStreamOptions): SseStream;
1261
+ export declare function openSseStream(request: FastifyRequest, reply: FastifyReply, options?: SseStreamOptions): SseStream;
1262
1262
  //#endregion
1263
1263
  //#region src/utils/stateMachine.d.ts
1264
1264
  /**
@@ -1369,7 +1369,7 @@ type TransitionConfig = Record<string, string[] | {
1369
1369
  * },
1370
1370
  * }, { trackHistory: true });
1371
1371
  */
1372
- declare function createStateMachine(name: string, transitions?: TransitionConfig, options?: {
1372
+ export declare function createStateMachine(name: string, transitions?: TransitionConfig, options?: {
1373
1373
  trackHistory?: boolean;
1374
1374
  }): StateMachine;
1375
1375
  //#endregion
@@ -1381,7 +1381,7 @@ declare function createStateMachine(name: string, transitions?: TransitionConfig
1381
1381
  * client uses to detect the v1 UI message stream protocol (vs the older
1382
1382
  * data stream protocol). Surfaced as a constant so hosts don't memorise it.
1383
1383
  */
1384
- declare const UI_MESSAGE_STREAM_HEADERS: {
1384
+ export declare const UI_MESSAGE_STREAM_HEADERS: {
1385
1385
  readonly "content-type": "text/event-stream";
1386
1386
  readonly "cache-control": "no-cache";
1387
1387
  readonly connection: "keep-alive";
@@ -1438,7 +1438,7 @@ interface PipeUIMessageStreamOptions {
1438
1438
  * });
1439
1439
  * ```
1440
1440
  */
1441
- declare function pipeUIMessageStreamToReply(reply: FastifyReply, stream: ReadableStream<unknown>, options?: PipeUIMessageStreamOptions): Promise<void>;
1441
+ export declare function pipeUIMessageStreamToReply(reply: FastifyReply, stream: ReadableStream<unknown>, options?: PipeUIMessageStreamOptions): Promise<void>;
1442
1442
  /**
1443
1443
  * Promote a stream auth token from the query string into the `Authorization`
1444
1444
  * header, in place, so the standard `fastify.authenticate` decorator can read it.
@@ -1462,7 +1462,7 @@ declare function pipeUIMessageStreamToReply(reply: FastifyReply, stream: Readabl
1462
1462
  *
1463
1463
  * @param queryParam name of the query parameter carrying the token (default `token`).
1464
1464
  */
1465
- declare function promoteStreamTokenToHeader(request: FastifyRequest, queryParam?: string): void;
1465
+ export declare function promoteStreamTokenToHeader(request: FastifyRequest, queryParam?: string): void;
1466
1466
  /**
1467
1467
  * Collect the CORS / `Vary` headers a plugin (e.g. `@fastify/cors`, whose default
1468
1468
  * `onRequest` hook runs BEFORE the route handler) has already set on the reply, so
@@ -1476,7 +1476,7 @@ declare function promoteStreamTokenToHeader(request: FastifyRequest, queryParam?
1476
1476
  * honors the host's configured policy (origin allowlist, credentials) rather than
1477
1477
  * re-deriving it. Returns lowercased header names suitable for `writeHead`.
1478
1478
  */
1479
- declare function forwardedStreamHeaders(reply: FastifyReply): Record<string, string>;
1479
+ export declare function forwardedStreamHeaders(reply: FastifyReply): Record<string, string>;
1480
1480
  /**
1481
1481
  * Heuristic — does this value look like a Web `ReadableStream`?
1482
1482
  *
@@ -1486,7 +1486,7 @@ declare function forwardedStreamHeaders(reply: FastifyReply): Record<string, str
1486
1486
  * the Streams spec mandates: `getReader`, `cancel`, and the `locked`
1487
1487
  * getter.
1488
1488
  */
1489
- declare function isReadableStream(value: unknown): value is ReadableStream<unknown>;
1489
+ export declare function isReadableStream(value: unknown): value is ReadableStream<unknown>;
1490
1490
  //#endregion
1491
1491
  //#region src/utils/typeGuards.d.ts
1492
1492
  interface EventsDecorator {
@@ -1499,8 +1499,8 @@ interface EventsDecorator {
1499
1499
  transportName: string;
1500
1500
  }
1501
1501
  /** Check if fastify has the events plugin registered */
1502
- declare function hasEvents(instance: FastifyInstance): instance is FastifyInstance & {
1502
+ export declare function hasEvents(instance: FastifyInstance): instance is FastifyInstance & {
1503
1503
  events: EventsDecorator;
1504
1504
  };
1505
1505
  //#endregion
1506
- export { type AnyAsyncFn, ArcError, type ArcHeaders, ArcQueryParser, type ArcQueryParserOptions, CircuitBreaker, CircuitBreakerError, type CircuitBreakerOptions, type CircuitBreakerRedisLike, CircuitBreakerRegistry, type CircuitBreakerSharedState, type CircuitBreakerStats, CircuitState, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorOptions, type EventsDecorator, type FilterDialect, ForbiddenError, type Guard, type GuardConfig, type JsonSchema, type JsonSchemaTarget, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, type PipeUIMessageStreamOptions, RateLimitError, RedisCircuitBreakerState, type RedisCircuitBreakerStateOptions, type RuntimeCapabilityDeclaration, type SchemaIo, ServiceUnavailableError, type ShutdownParticipant, type SseStream, type SseStreamOptions, type StateMachine, type TransitionConfig, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, type UnconvertibleMode, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, declareRuntimeCapability, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, registerShutdownParticipant, requireSingleHeaderValue, responses, runAdmittedWork, simpleEqualityMatcher, toJsonSchema, withCompensation };
1506
+ export { type AnyAsyncFn, ArcError, type ArcHeaders, type ArcQueryParserOptions, type CircuitBreakerOptions, type CircuitBreakerRedisLike, type CircuitBreakerSharedState, type CircuitBreakerStats, type CompensationDefinition, type CompensationError, type CompensationHooks, type CompensationResult, type CompensationStep, ConflictError, type ErrorOptions, type EventsDecorator, type FilterDialect, ForbiddenError, type Guard, type GuardConfig, type JsonSchema, type JsonSchemaTarget, NotFoundError, OrgAccessDeniedError, OrgRequiredError, type PipeUIMessageStreamOptions, RateLimitError, type RedisCircuitBreakerStateOptions, type RuntimeCapabilityDeclaration, type SchemaIo, ServiceUnavailableError, type ShutdownParticipant, type SseStream, type SseStreamOptions, type StateMachine, type TransitionConfig, UnauthorizedError, type UnconvertibleMode, ValidationError, createDomainError, createError, errorContractSchema, getHeader, getUserId, getUserRoles, isArcError, normalizeRoles, requireSingleHeaderValue };
@@ -1,13 +1,13 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-CtrywMHP.mjs";
3
- import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-auW8QjXN.mjs";
4
- import { n as requireSingleHeaderValue, t as getHeader } from "../headers-BbkIF6vA.mjs";
5
- import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-aklawRaK.mjs";
6
- import { C as paginationSchema, D as createQueryParser, E as ArcQueryParser, O as MONGO_DIALECT, S as offsetListResponse, T as responses, _ as errorContractSchema, a as defineCompensation, b as keysetListResponse, c as CircuitBreaker, d as CircuitState, f as createCircuitBreaker, g as deleteResponse, h as bareListResponse, i as defineErrorMapper, k as NEUTRAL_DIALECT, l as CircuitBreakerError, m as aggregateListResponse, n as handleRaw, o as withCompensation, p as createCircuitBreakerRegistry, r as defineGuard, s as RedisCircuitBreakerState, t as createStateMachine, u as CircuitBreakerRegistry, v as getDefaultCrudSchemas, w as queryParams, x as listResponse, y as getListQueryParams } from "../utils-ec1oTo1n.mjs";
7
- import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-BORek3O-.mjs";
8
- import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-DjTQhZrN.mjs";
9
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-0tccjRlj.mjs";
10
- import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-MqA81z_P.mjs";
11
- import { t as openSseStream } from "../sseStream-B5_Afiqn.mjs";
12
- import { t as hasEvents } from "../typeGuards-CySF12G-.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { a as OrgAccessDeniedError, c as ServiceUnavailableError, d as createDomainError, f as createError, i as NotFoundError, l as UnauthorizedError, n as ConflictError, o as OrgRequiredError, p as isArcError, r as ForbiddenError, s as RateLimitError, t as ArcError, u as ValidationError } from "../errors-C9G4A8cN.mjs";
3
+ import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-WdZw6GOt.mjs";
4
+ import { n as requireSingleHeaderValue, t as getHeader } from "../headers-B6DRXXzT.mjs";
5
+ import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-Nc5ePCsf.mjs";
6
+ import { C as paginationSchema, D as createQueryParser, E as ArcQueryParser, O as MONGO_DIALECT, S as offsetListResponse, T as responses, _ as errorContractSchema, a as defineCompensation, b as keysetListResponse, c as CircuitBreaker, d as CircuitState, f as createCircuitBreaker, g as deleteResponse, h as bareListResponse, i as defineErrorMapper, k as NEUTRAL_DIALECT, l as CircuitBreakerError, m as aggregateListResponse, n as handleRaw, o as withCompensation, p as createCircuitBreakerRegistry, r as defineGuard, s as RedisCircuitBreakerState, t as createStateMachine, u as CircuitBreakerRegistry, v as getDefaultCrudSchemas, w as queryParams, x as listResponse, y as getListQueryParams } from "../utils-QWSIKqAk.mjs";
7
+ import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-rzBovk00.mjs";
8
+ import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-BLg1buwL.mjs";
9
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-C7gAbIxC.mjs";
10
+ import { i as runAdmittedWork, r as registerShutdownParticipant } from "../shutdown-BW8qwgpx.mjs";
11
+ import { t as openSseStream } from "../sseStream-B7rPhIQw.mjs";
12
+ import { t as hasEvents } from "../typeGuards-CtZJypJO.mjs";
13
13
  export { ArcError, ArcQueryParser, CircuitBreaker, CircuitBreakerError, CircuitBreakerRegistry, CircuitState, ConflictError, ForbiddenError, MONGO_DIALECT, NEUTRAL_DIALECT, NotFoundError, OrgAccessDeniedError, OrgRequiredError, RateLimitError, RedisCircuitBreakerState, ServiceUnavailableError, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, declareRuntimeCapability, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, registerShutdownParticipant, requireSingleHeaderValue, responses, runAdmittedWork, simpleEqualityMatcher, toJsonSchema, withCompensation };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { h as RESERVED_QUERY_PARAMS } from "./constants-Cu7Mx7_U.mjs";
3
- import { t as arcLog } from "./logger-DXjfIqjV.mjs";
4
- import { t as ArcError, u as ValidationError } from "./errors-CtrywMHP.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { h as RESERVED_QUERY_PARAMS } from "./constants-B90SnSQn.mjs";
3
+ import { t as arcLog } from "./logger-vxu0DXf_.mjs";
4
+ import { t as ArcError, u as ValidationError } from "./errors-C9G4A8cN.mjs";
5
5
  import { errorContractSchema as errorContractSchema$1 } from "@classytic/repo-core/errors";
6
6
  import { readEnv } from "@classytic/primitives/environment";
7
7
  import { OPERATOR_DESCRIPTIONS, URL_OPERATORS, escapeRegex, isQueryGrammarError, readFilterClauses, readPageRequest, readSearch, readSelect, readSort } from "@classytic/repo-core/query-parser";
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-D1w9Y1VJ.mjs";
3
- import { _ as pathTouchesBlocked } from "./plugin-BccET1tL.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { r as __exportAll } from "./rolldown-runtime-AD16t29l.mjs";
3
+ import { _ as pathTouchesBlocked } from "./plugin-BDBOS3-c.mjs";
4
4
  //#region src/core/aggregation/normalize.ts
5
5
  /**
6
6
  * Framework cap on URL-driven aggregation limits when the host opts
@@ -119,6 +119,28 @@ interface SSEOptions {
119
119
  * Set `null` to disable promotion (e.g. cookie-only auth).
120
120
  */
121
121
  tokenQueryParam?: string | null;
122
+ /**
123
+ * Keyed delivery: the connection keys (user ids by default) an event is for.
124
+ * Delivery becomes one map lookup per key, and org-scoping + `filter` still run
125
+ * on those connections only. `null`/`undefined` = broadcast through the filter.
126
+ * Each replica resolves it against its own connections. Setting it switches the
127
+ * plugin to one shared subscription per pattern. See wiki/plugins.md.
128
+ */
129
+ audience?: (event: DomainEvent<unknown>) => readonly string[] | null | undefined;
130
+ /** Key a connection is indexed under for `audience` (default: scope user id; none = broadcasts only). */
131
+ connectionKey?: (request: FastifyRequest) => string | null | undefined;
132
+ }
133
+ /** Live connection gauge, summed across every `ssePlugin` registration on the instance. */
134
+ interface SSEStats {
135
+ /** Open SSE connections. */
136
+ connections: number;
137
+ /** Distinct `connectionKey`s indexed (0 without `audience`). */
138
+ keys: number;
139
+ }
140
+ declare module "fastify" {
141
+ interface FastifyInstance {
142
+ sseStats: () => SSEStats;
143
+ }
122
144
  }
123
145
  declare const _default$3: FastifyPluginAsync<SSEOptions>;
124
146
  //#endregion
@@ -243,4 +265,4 @@ declare module "fastify" {
243
265
  }
244
266
  declare const _default: FastifyPluginAsync<VersioningOptions>;
245
267
  //#endregion
246
- export { _default$5 as _, MetricsOptions as a, RealtimeOptions as c, _default$3 as d, CachingOptions as f, ShutdownState as g, GracefulShutdownOptions as h, MetricsCollector as i, _default$2 as l, _default$4 as m, _default as n, _default$1 as o, CachingRule as p, MetricEntry as r, ChangeOperation as s, VersioningOptions as t, SSEOptions as u };
268
+ export { ShutdownState as _, MetricsOptions as a, RealtimeOptions as c, SSEStats as d, _default$3 as f, GracefulShutdownOptions as g, _default$4 as h, MetricsCollector as i, _default$2 as l, CachingRule as m, _default as n, _default$1 as o, CachingOptions as p, MetricEntry as r, ChangeOperation as s, VersioningOptions as t, SSEOptions as u, _default$5 as v };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-D1w9Y1VJ.mjs";
3
- import { d as createDomainError } from "./errors-CtrywMHP.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { r as __exportAll } from "./rolldown-runtime-AD16t29l.mjs";
3
+ import { d as createDomainError } from "./errors-C9G4A8cN.mjs";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/plugins/versioning.ts
6
6
  var versioning_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import { n as requestContext } from "./requestContext-Dsu9P1bV.mjs";
1
+ /*! @classytic/arc v2.45.0 | MIT | https://classytic.com */
2
+ import { n as requestContext } from "./requestContext-B8JKbeb7.mjs";
3
3
  //#region src/context/workScope.ts
4
4
  /** Enter a scope for `fn`, or run it inside the active one. */
5
5
  function runWorkScope(seed, fn) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/arc",
3
- "version": "2.43.0",
3
+ "version": "2.45.0",
4
4
  "description": "Resource-oriented backend framework for Fastify - clean, minimal, powerful, tree-shakable",
5
5
  "type": "module",
6
6
  "exports": {
@@ -340,6 +340,7 @@
340
340
  "smoke:mcp": "node scripts/mcp-e2e.mjs",
341
341
  "bench:memory": "node --expose-gc scripts/bench-memory.mjs",
342
342
  "bench:http": "node --expose-gc scripts/bench-http.mjs",
343
+ "bench:sse": "node scripts/bench-sse-audience.mjs",
343
344
  "push": "classytic-push",
344
345
  "release:tag": "node -e \"require('child_process').execSync('npm run push -- v'+require('./package.json').version,{stdio:'inherit'})\"",
345
346
  "release": "npm run push -- main && npm run release:tag && npm publish",
@@ -486,59 +487,59 @@
486
487
  },
487
488
  "devDependencies": {
488
489
  "@arethetypeswrong/cli": "^0.18.5",
489
- "@better-auth/drizzle-adapter": "^1.6.19",
490
- "@better-auth/mongo-adapter": "^1.6.19",
491
- "@biomejs/biome": "^2.5.7",
492
- "@classytic/dev-tools": "^0.2.0",
493
- "@classytic/gitkit": ">=0.1.0",
494
- "@classytic/mongokit": "^3.40.1",
490
+ "@better-auth/drizzle-adapter": "^1.7.10",
491
+ "@better-auth/mongo-adapter": "^1.7.10",
492
+ "@biomejs/biome": "^2.5.15",
493
+ "@classytic/dev-tools": "^0.2.1",
494
+ "@classytic/gitkit": ">=0.3.0",
495
+ "@classytic/mongokit": "^3.43.0",
495
496
  "@classytic/pgkit": "^0.1.0",
496
- "@classytic/primitives": "^0.31.0",
497
- "@classytic/repo-core": "^0.31.0",
498
- "@classytic/sqlitekit": "^0.9.0",
499
- "@classytic/streamline": "^2.8.2",
500
- "@electric-sql/pglite": "^0.5.4",
501
- "@fastify/cors": "^11.2.0",
502
- "@fastify/helmet": "^13.0.2",
503
- "@fastify/jwt": "^10.1.0",
504
- "@fastify/multipart": "^10.0.0",
505
- "@fastify/rate-limit": "^11.0.0",
506
- "@fastify/sensible": "^6.0.4",
507
- "@fastify/static": "^10.1.2",
508
- "@fastify/type-provider-typebox": "^6.1.0",
509
- "@fastify/under-pressure": "^9.0.3",
510
- "@fastify/websocket": "^11.2.0",
511
- "@modelcontextprotocol/client": "^2.0.0",
512
- "@modelcontextprotocol/node": "^2.0.0",
513
- "@modelcontextprotocol/server": "^2.0.0",
497
+ "@classytic/primitives": "^0.34.0",
498
+ "@classytic/repo-core": "^0.31.1",
499
+ "@classytic/sqlitekit": "^0.10.0",
500
+ "@classytic/streamline": "^2.11.0",
501
+ "@electric-sql/pglite": "^0.5.10",
502
+ "@fastify/cors": "^11.3.1",
503
+ "@fastify/helmet": "^13.2.0",
504
+ "@fastify/jwt": "^10.2.5",
505
+ "@fastify/multipart": "^10.1.4",
506
+ "@fastify/rate-limit": "^11.2.1",
507
+ "@fastify/sensible": "^6.0.7",
508
+ "@fastify/static": "^10.1.6",
509
+ "@fastify/type-provider-typebox": "^6.3.0",
510
+ "@fastify/under-pressure": "^9.2.1",
511
+ "@fastify/websocket": "^11.3.4",
512
+ "@modelcontextprotocol/client": "^2.3.1",
513
+ "@modelcontextprotocol/node": "^2.1.1",
514
+ "@modelcontextprotocol/server": "^2.3.1",
514
515
  "@opentelemetry/api": "^1.9.1",
515
- "@types/node": "^22.19.21",
516
+ "@types/node": "^26.6.5",
516
517
  "@types/qs": "^6.15.1",
517
- "@vitest/coverage-v8": "^5.0.0",
518
+ "@vitest/coverage-v8": "^5.0.5",
518
519
  "ajv": "^8.20.0",
519
- "better-auth": "^1.7.3",
520
+ "better-auth": "^1.7.10",
520
521
  "better-sqlite3": "^13.0.3",
521
- "bullmq": "^6.1.2",
522
- "dotenv": "^17.4.2",
523
- "drizzle-orm": "^0.45.2",
524
- "fast-check": "^4.8.0",
525
- "fastify": "^5.12.1",
526
- "fastify-raw-body": "^6.0.1",
527
- "h3-js": "^4.4.0",
522
+ "bullmq": "^6.3.16",
523
+ "dotenv": "^18.0.8",
524
+ "drizzle-orm": "^0.45.4",
525
+ "fast-check": "^4.10.2",
526
+ "fastify": "^5.12.7",
527
+ "fastify-raw-body": "^6.0.3",
528
+ "h3-js": "^4.5.0",
528
529
  "ioredis": "^6.0.0",
529
- "jose": "^6.2.3",
530
+ "jose": "^6.2.12",
530
531
  "jsonwebtoken": "^9.0.3",
531
- "knip": "^6.31.0",
532
- "mongodb": "^7.3.0",
533
- "mongodb-memory-server": "^11.2.0",
534
- "mongoose": "^9.9.1",
535
- "publint": "^0.3.21",
536
- "tsdown": "^0.22.14",
537
- "typebox": "^1.3.6",
532
+ "knip": "^6.41.0",
533
+ "mongodb": "^7.7.0",
534
+ "mongodb-memory-server": "^11.3.0",
535
+ "mongoose": "^9.11.2",
536
+ "publint": "^0.3.25",
537
+ "tsdown": "^0.23.1",
538
+ "typebox": "^1.4.2",
538
539
  "typescript": "^7.0.2",
539
- "vitest": "^5.0.0",
540
- "ws": "^8.21.0",
541
- "zod": "^4.4.3"
540
+ "vitest": "^5.0.5",
541
+ "ws": "^8.22.0",
542
+ "zod": "^4.6.7"
542
543
  },
543
544
  "config": {
544
545
  "mongodbMemoryServer": {
@@ -568,11 +569,5 @@
568
569
  "repository": {
569
570
  "type": "git",
570
571
  "url": "git+https://github.com/classytic/arc.git"
571
- },
572
- "overrides": {
573
- "better-sqlite3": "$better-sqlite3",
574
- "better-auth": {
575
- "vitest": "$vitest"
576
- }
577
572
  }
578
573
  }
@@ -1,15 +0,0 @@
1
- /*! @classytic/arc v2.43.0 | MIT | https://classytic.com */
2
- import "node:module";
3
- //#region \0rolldown/runtime.js
4
- var __defProp = Object.defineProperty;
5
- var __exportAll = (all, no_symbols) => {
6
- let target = {};
7
- for (var name in all) __defProp(target, name, {
8
- get: all[name],
9
- enumerable: true
10
- });
11
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
12
- return target;
13
- };
14
- //#endregion
15
- export { __exportAll as t };