@classytic/arc 2.41.1 → 2.43.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 (230) hide show
  1. package/dist/{EventTransport-CbUKDzZZ.d.mts → EventTransport-CiicKz2Z.d.mts} +1 -1
  2. package/dist/{EventTransport-DSqD_Xsg.mjs → EventTransport-tzA7CAB4.mjs} +22 -17
  3. package/dist/{HookSystem-CMF94SEA.mjs → HookSystem-B6UaKRbF.mjs} +2 -2
  4. package/dist/{QueryCache-DFA-QrU9.d.mts → QueryCache--5uAuYPW.d.mts} +7 -3
  5. package/dist/{ResourceRegistry-MGpXoxHZ.mjs → ResourceRegistry-CuCARu2B.mjs} +44 -13
  6. package/dist/actionPermissions-BotX1YOa.mjs +776 -0
  7. package/dist/audit/index.d.mts +43 -5
  8. package/dist/audit/index.mjs +48 -26
  9. package/dist/auth/audit.mjs +1 -1
  10. package/dist/auth/index.d.mts +43 -13
  11. package/dist/auth/index.mjs +130 -155
  12. package/dist/auth/redis-session.mjs +1 -1
  13. package/dist/{authorizationDecision-DawKGoXb.mjs → authorizationDecision-DQYrkl5f.mjs} +7 -102
  14. package/dist/{base-CxrV1LmG.d.mts → base-CZyixEQR.d.mts} +27 -5
  15. package/dist/boundedMap-BULzfXYU.mjs +57 -0
  16. package/dist/{buildHandler-CvxKOc0m.mjs → buildHandler-CRQ8EcX5.mjs} +4 -4
  17. package/dist/cache/index.d.mts +22 -34
  18. package/dist/cache/index.mjs +4 -4
  19. package/dist/{caching-DbCBxlgw.mjs → caching-Cc2M1DwO.mjs} +3 -3
  20. package/dist/claimed-B10RTfkM.mjs +8 -0
  21. package/dist/cleanup/index.d.mts +6 -10
  22. package/dist/cleanup/index.mjs +27 -73
  23. package/dist/cli/commands/describe.d.mts +4 -2
  24. package/dist/cli/commands/describe.mjs +7 -4
  25. package/dist/cli/commands/docs.mjs +3 -3
  26. package/dist/cli/commands/doctor.mjs +1 -1
  27. package/dist/cli/commands/generate.mjs +2 -2
  28. package/dist/cli/commands/init.mjs +2 -2
  29. package/dist/cli/commands/introspect.mjs +2 -2
  30. package/dist/cli/index.mjs +3 -3
  31. package/dist/{constants-D5Ubn1fe.mjs → constants-Cu7Mx7_U.mjs} +4 -2
  32. package/dist/context/index.d.mts +2 -5
  33. package/dist/context/index.mjs +18 -38
  34. package/dist/core/index.d.mts +3 -3
  35. package/dist/core/index.mjs +8 -8
  36. package/dist/{core-5lazhva9.mjs → core-Cb0LjccA.mjs} +5 -4
  37. package/dist/{createActionRouter-DNqoaK81.mjs → createActionRouter-xjqonMRO.mjs} +87 -39
  38. package/dist/{createAggregationRouter-BcbQJf10.mjs → createAggregationRouter-zRYWw_5D.mjs} +11 -8
  39. package/dist/{preloadResources-f3boenVZ.mjs → createApp-D-953ZAq.mjs} +299 -390
  40. package/dist/{createMcpServer-CbDWkZ1T.d.mts → createMcpServer-C9cxS8zt.d.mts} +1 -1
  41. package/dist/{defineAggregation-D_eJjm5A.mjs → defineAggregation-Bm8RjMbq.mjs} +1 -1
  42. package/dist/{defineResource-DxkMTjRn.mjs → defineResource-DIC7JZGU.mjs} +118 -1024
  43. package/dist/discovery/index.mjs +1 -1
  44. package/dist/docs/index.d.mts +10 -4
  45. package/dist/docs/index.mjs +4 -4
  46. package/dist/{elevation-BXCfVcNG.d.mts → elevation-BW2J3tNj.d.mts} +1 -2
  47. package/dist/{elevation-CkvG0LG2.mjs → elevation-DG8SrLN-.mjs} +41 -12
  48. package/dist/encryption/index.mjs +3 -3
  49. package/dist/{errorHandler-D1GHKGlV.mjs → errorHandler-BnfDviL1.mjs} +26 -5
  50. package/dist/{errors-BH7YU_9O.mjs → errors-CtrywMHP.mjs} +58 -23
  51. package/dist/{errors-BGdVwP25.d.mts → errors-JYc9vwqE.d.mts} +9 -0
  52. package/dist/{eventPlugin-B52abJ8W.d.mts → eventPlugin-BtmA4-3P.d.mts} +65 -9
  53. package/dist/{eventPlugin-zZY-unhr.mjs → eventPlugin-Q6BhzHzs.mjs} +82 -21
  54. package/dist/{subscribe-helpers-DatDkcuG.mjs → eventTypes-Cdhm6ZlV.mjs} +151 -17
  55. package/dist/events/index.d.mts +33 -8
  56. package/dist/events/index.mjs +49 -53
  57. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  58. package/dist/events/transports/redis-stream-entry.mjs +139 -157
  59. package/dist/events/transports/redis.d.mts +1 -1
  60. package/dist/events/transports/redis.mjs +2 -2
  61. package/dist/factory/index.d.mts +32 -17
  62. package/dist/factory/index.mjs +213 -32
  63. package/dist/{fastify-augmentation-Cq2nHVaW.d.mts → fastify-augmentation-DhUJ-mvo.d.mts} +11 -25
  64. package/dist/{fields-I_EeRWND.d.mts → fields-BBSpf8pS.d.mts} +1 -1
  65. package/dist/{fields-BHrkoF5y.mjs → fields-ToPYpMqS.mjs} +1 -1
  66. package/dist/filter-merge-IpGywvym.mjs +99 -0
  67. package/dist/{generate-BLRf2m3y.mjs → generate-DRTkLlIl.mjs} +2 -2
  68. package/dist/{headers-BIXWKrzQ.mjs → headers-BbkIF6vA.mjs} +2 -2
  69. package/dist/health-D-Ft6JM6.mjs +22 -0
  70. package/dist/{health-ZRHeDHXH.mjs → health-DqbsG-_w.mjs} +115 -55
  71. package/dist/hooks/index.d.mts +2 -2
  72. package/dist/hooks/index.mjs +2 -2
  73. package/dist/idempotency/index.d.mts +31 -7
  74. package/dist/idempotency/index.mjs +155 -98
  75. package/dist/idempotency/redis.d.mts +1 -1
  76. package/dist/idempotency/redis.mjs +48 -11
  77. package/dist/{index-BHdZD8zK.d.mts → index-Bxriq3so.d.mts} +84 -21
  78. package/dist/{preloadResources-CjS2OfpU.d.mts → index-C8zVGYsk.d.mts} +37 -38
  79. package/dist/{index-D4u76eQW.d.mts → index-CRoPtISf.d.mts} +23 -73
  80. package/dist/{index-CbJiYrfv.d.mts → index-Chgz3d0i.d.mts} +1 -1
  81. package/dist/index-JdbZAIsm.d.mts +510 -0
  82. package/dist/{index-DHbyPo5j.d.mts → index-mqaqZNpe.d.mts} +253 -254
  83. package/dist/index.d.mts +8 -8
  84. package/dist/index.mjs +11 -11
  85. package/dist/{init-CpLkjU18.mjs → init-B_oUYDXI.mjs} +1 -1
  86. package/dist/integrations/event-gateway.d.mts +8 -3
  87. package/dist/integrations/event-gateway.mjs +4 -4
  88. package/dist/integrations/index.d.mts +3 -3
  89. package/dist/integrations/index.mjs +1 -1
  90. package/dist/integrations/jobs/index.d.mts +1 -1
  91. package/dist/integrations/jobs/index.mjs +18 -5
  92. package/dist/integrations/mcp/index.d.mts +72 -59
  93. package/dist/integrations/mcp/index.mjs +19 -4
  94. package/dist/integrations/mcp/testing.d.mts +2 -2
  95. package/dist/integrations/mcp/testing.mjs +2 -2
  96. package/dist/integrations/streamline.d.mts +78 -136
  97. package/dist/integrations/streamline.mjs +116 -54
  98. package/dist/integrations/webhooks.d.mts +60 -120
  99. package/dist/integrations/webhooks.mjs +36 -80
  100. package/dist/integrations/websocket-pushref-redis.d.mts +1 -1
  101. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  102. package/dist/integrations/websocket-redis.d.mts +1 -1
  103. package/dist/integrations/websocket-redis.mjs +1 -1
  104. package/dist/integrations/websocket.d.mts +3 -3
  105. package/dist/integrations/websocket.mjs +2 -2
  106. package/dist/{interface-DEWNOMza.d.mts → interface-C0395yUN.d.mts} +13 -1
  107. package/dist/{jsonBody-ELR9lfeU.mjs → jsonBody-B4YVGcql.mjs} +2 -2
  108. package/dist/{keys-cpZCtcIE.mjs → keys-B2KtgMLJ.mjs} +7 -18
  109. package/dist/{loadResources-BPfWiI5s.mjs → loadResources-Dn4lalw2.mjs} +3 -3
  110. package/dist/{loadResourcesFromEntry-ixtfL3J2.mjs → loadResourcesFromEntry-3sLYbuse.mjs} +2 -2
  111. package/dist/logger/index.d.mts +1 -8
  112. package/dist/logger/index.mjs +3 -153
  113. package/dist/logger-DXjfIqjV.mjs +160 -0
  114. package/dist/{mcpPlugin-BX5PujI0.mjs → mcpPlugin-C08HalN5.mjs} +433 -170
  115. package/dist/{memory-Iotz0cCx.mjs → memory-9Cp7611C.mjs} +36 -34
  116. package/dist/{metrics-NMsmpRmY.mjs → metrics-CWI11eRu.mjs} +39 -72
  117. package/dist/middleware/index.d.mts +2 -2
  118. package/dist/middleware/index.mjs +3 -3
  119. package/dist/migrations/index.mjs +2 -2
  120. package/dist/{module-DpLJG2_N.mjs → module-BSvOQC7E.mjs} +8 -8
  121. package/dist/multiTenant-cY0FkDiA.d.mts +104 -0
  122. package/dist/{multipartBody-DtRWM6_U.mjs → multipartBody-CXM2a-Dy.mjs} +46 -7
  123. package/dist/{openapi-CmFf3yq_.mjs → openapi-DT_G4VhY.mjs} +48 -10
  124. package/dist/outbox-admin/index.d.mts +3 -3
  125. package/dist/outbox-admin/index.mjs +6 -18
  126. package/dist/{outbox-module-D2z5WkDY.mjs → outbox-module-Bjgzl6tg.mjs} +203 -33
  127. package/dist/{outbox-module-BHdUnuuK.d.mts → outbox-module-gZCHoE4H.d.mts} +79 -6
  128. package/dist/permissions/index.d.mts +5 -4
  129. package/dist/permissions/index.mjs +8 -6
  130. package/dist/{permissions-D8TBH44E.mjs → permissions-Cm0uYHvd.mjs} +149 -33
  131. package/dist/{pipe-FMWNheSO.mjs → pipe-BqeGT6UO.mjs} +2 -2
  132. package/dist/pipeline/index.d.mts +2 -2
  133. package/dist/pipeline/index.mjs +2 -2
  134. package/dist/plan-FVR6LP59.mjs +565 -0
  135. package/dist/{BaseController-CYEwjyjN.mjs → plugin-BccET1tL.mjs} +1256 -345
  136. package/dist/plugins/index.d.mts +14 -11
  137. package/dist/plugins/index.mjs +44 -22
  138. package/dist/plugins/response-cache.mjs +8 -14
  139. package/dist/plugins/tracing-entry.mjs +2 -2
  140. package/dist/{pluralize-CXWZIzTv.mjs → pluralize-CVIOcgMF.mjs} +1 -1
  141. package/dist/presets/filesUpload.d.mts +2 -2
  142. package/dist/presets/filesUpload.mjs +5 -5
  143. package/dist/presets/index.d.mts +26 -31
  144. package/dist/presets/index.mjs +4 -4
  145. package/dist/presets/multiTenant.d.mts +2 -107
  146. package/dist/presets/multiTenant.mjs +22 -162
  147. package/dist/presets/search.d.mts +2 -2
  148. package/dist/presets/search.mjs +2 -2
  149. package/dist/{presets-ZJSPgmT2.mjs → presets-Cpvj6fGO.mjs} +99 -107
  150. package/dist/{projection-BzIgzoKZ.mjs → projection-Ce4aQhQk.mjs} +2 -2
  151. package/dist/{pushref-registry-Dov9l4qE.d.mts → pushref-registry-UxCkoA4C.d.mts} +1 -1
  152. package/dist/{queryCachePlugin-BzqxconG.d.mts → queryCachePlugin-C2lZjTxk.d.mts} +1 -1
  153. package/dist/{queryCachePlugin-DZHPOm9p.mjs → queryCachePlugin-CFWNH8aT.mjs} +12 -14
  154. package/dist/{rateLimitKey-BvOvcBDi.mjs → rateLimitKey-C4O-kPm0.mjs} +1 -1
  155. package/dist/{realtime-8tIQWZz4.mjs → realtime-DmPE9S54.mjs} +25 -21
  156. package/dist/redis-stream-BMk-bpQS.d.mts +219 -0
  157. package/dist/{redis-Bzi1y3F9.d.mts → redis-vLvtcGy_.d.mts} +13 -24
  158. package/dist/redisShapes-CQksY67q.d.mts +55 -0
  159. package/dist/registry/index.d.mts +9 -4
  160. package/dist/registry/index.mjs +4 -4
  161. package/dist/{registry-DNkgGQcK.mjs → registry-Bcz9G1bh.mjs} +10 -8
  162. package/dist/{renewingLease-yF8BdW4b.mjs → renewingLease-qODa7KJQ.mjs} +1 -1
  163. package/dist/{replyHelpers-CNdvMfM4.mjs → replyHelpers-CG_VtVgS.mjs} +2 -2
  164. package/dist/{requestContext-cDkAUr-P.mjs → requestContext-Dsu9P1bV.mjs} +1 -1
  165. package/dist/requirement-CbiLdQ1n.d.mts +22 -0
  166. package/dist/requirement-KDdoRcOP.mjs +35 -0
  167. package/dist/resourceRateLimit-Wf6d6FL9.d.mts +30 -0
  168. package/dist/resourceRateLimit-dSjVr1pk.mjs +180 -0
  169. package/dist/{rolldown-runtime-eysyzFAF.mjs → rolldown-runtime-D1w9Y1VJ.mjs} +1 -1
  170. package/dist/routeValidator-D36SW8qt.mjs +70 -0
  171. package/dist/{runtimeCapabilities-CkhS6jn6.mjs → runtimeCapabilities-0tccjRlj.mjs} +1 -1
  172. package/dist/{schedules-j6uXXAeJ.mjs → schedules-C-OpmHBq.mjs} +46 -37
  173. package/dist/{schemaConverter-BVA7cFRG.mjs → schemaConverter-BORek3O-.mjs} +2 -2
  174. package/dist/{schemaIR-CTvPDoPB.mjs → schemaIR-C7Vbp71I.mjs} +2 -2
  175. package/dist/schemas/index.d.mts +10 -0
  176. package/dist/schemas/index.mjs +8 -3
  177. package/dist/scim/index.mjs +2 -2
  178. package/dist/scope/index.d.mts +2 -2
  179. package/dist/scope/index.mjs +6 -6
  180. package/dist/{scope-BUi1xV1I.mjs → scope-DQthe88b.mjs} +4 -4
  181. package/dist/shutdown-MqA81z_P.mjs +59 -0
  182. package/dist/{simpleEqualityMatcher-C9bzq2gO.mjs → simpleEqualityMatcher-auW8QjXN.mjs} +1 -1
  183. package/dist/{sse-BeqVKQKu.mjs → sse-CYzQBVFe.mjs} +11 -15
  184. package/dist/{sseStream-Ppzo-WUH.mjs → sseStream-B5_Afiqn.mjs} +2 -2
  185. package/dist/{store-helpers-dW71XVWL.mjs → store-helpers-BOzk-CuX.mjs} +1 -1
  186. package/dist/{streaming-IcRFjWQU.mjs → streaming-DjTQhZrN.mjs} +1 -1
  187. package/dist/subscriberIdentity-CW39uA8G.mjs +28 -0
  188. package/dist/tenancy--ed9eH_z.mjs +43 -0
  189. package/dist/tenantPreparation-BKon6Yox.mjs +67 -0
  190. package/dist/testing/cleanupStoreContract.mjs +1 -1
  191. package/dist/testing/index.d.mts +193 -175
  192. package/dist/testing/index.mjs +286 -212
  193. package/dist/testing/outboxStoreContract.mjs +137 -2
  194. package/dist/testing/requiredPorts.d.mts +17 -0
  195. package/dist/testing/requiredPorts.mjs +65 -0
  196. package/dist/testing/storageContract.mjs +1 -1
  197. package/dist/timing-qczZ0YC-.mjs +46 -0
  198. package/dist/{transactionContext-CPbdlnVw.mjs → transactionContext-DjFkrNG6.mjs} +1 -1
  199. package/dist/{typeGuards-BLjPgVBm.mjs → typeGuards-CySF12G-.mjs} +1 -1
  200. package/dist/types/index.d.mts +4 -4
  201. package/dist/types/index.mjs +1 -1
  202. package/dist/types/storage.mjs +1 -1
  203. package/dist/{types-CWQn9-IC.d.mts → types-B4Aq4Sdj.d.mts} +22 -9
  204. package/dist/{types-DfVDvkdP.d.mts → types-BJ-2XqVF.d.mts} +189 -204
  205. package/dist/{types-CgenB1gv.mjs → types-Bk9NOgOC.mjs} +4 -4
  206. package/dist/usage/index.d.mts +2 -3
  207. package/dist/usage/index.mjs +5 -5
  208. package/dist/{userHelpers-ChRvkuSZ.mjs → userHelpers-aklawRaK.mjs} +1 -1
  209. package/dist/utils/index.d.mts +84 -223
  210. package/dist/utils/index.mjs +13 -12
  211. package/dist/{utils-CxcctrAh.mjs → utils-ec1oTo1n.mjs} +315 -404
  212. package/dist/{validate-DrYWnOzI.mjs → validate-9yzHC1e2.mjs} +6 -14
  213. package/dist/{versioning-D6JIK8Tk.d.mts → versioning-Bsb51gGT.d.mts} +28 -13
  214. package/dist/{versioning-DKkT4hNJ.mjs → versioning-fhhWHV74.mjs} +4 -4
  215. package/dist/{websocket-BOXVggMf.d.mts → websocket-Cs4awVyD.d.mts} +1 -1
  216. package/dist/{workScope-CxKqoIFn.mjs → workScope-zpPyge4t.mjs} +2 -2
  217. package/package.json +16 -12
  218. package/skills/arc/SKILL.md +13 -4
  219. package/skills/arc/references/auth.md +8 -5
  220. package/skills/arc/references/integrations.md +1 -1
  221. package/skills/arc/references/mcp.md +8 -6
  222. package/skills/arc/references/multi-tenancy.md +19 -14
  223. package/skills/arc/references/production.md +27 -10
  224. package/dist/actionPermissions-BoPGQ5-4.mjs +0 -350
  225. package/dist/index-CFfLKMH4.d.mts +0 -290
  226. package/dist/interface-YzIbF7Ii.mjs +0 -17
  227. package/dist/redis-stream-BPKscsTB.d.mts +0 -260
  228. package/dist/registerRoute-Bsnk6NiZ.mjs +0 -364
  229. package/dist/sync/changelog.d.mts +0 -3
  230. package/dist/sync/changelog.mjs +0 -3
@@ -1,42 +1,13 @@
1
1
 
2
2
  import { F as getHeader, I as requireSingleHeaderValue, P as ArcHeaders } from "../types-Ddl9OjmE.mjs";
3
- import { f as getUserId, m as normalizeRoles, p as getUserRoles, t as AnyRecord } from "../base-CxrV1LmG.mjs";
4
- import { $ as OpenApiSchemas, S as QueryParserInterface, b as ParsedQuery } from "../index-DHbyPo5j.mjs";
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";
5
5
  import { n as ErrorMapper } from "../errorHandler--4rSMMvq.mjs";
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-BGdVwP25.mjs";
7
- import { scheduleBackground } from "@classytic/repo-core/cache";
8
- import { errorContractSchema, errorDetailSchema } from "@classytic/repo-core/errors";
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
+ import { errorContractSchema } from "@classytic/repo-core/errors";
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
- /**
12
- * Circuit Breaker Pattern
13
- *
14
- * Wraps external service calls with failure protection.
15
- * Prevents cascading failures by "opening" the circuit when
16
- * a service is failing, allowing it time to recover.
17
- *
18
- * States:
19
- * - CLOSED: Normal operation, requests pass through
20
- * - OPEN: Too many failures, all requests fail fast
21
- * - HALF_OPEN: Testing if service recovered, limited requests
22
- *
23
- * @example
24
- * import { CircuitBreaker } from '@classytic/arc/utils';
25
- *
26
- * const paymentBreaker = new CircuitBreaker(async (amount) => {
27
- * return await stripe.charges.create({ amount });
28
- * }, {
29
- * failureThreshold: 5,
30
- * resetTimeout: 30000,
31
- * timeout: 5000,
32
- * });
33
- *
34
- * try {
35
- * const result = await paymentBreaker.call(100);
36
- * } catch (error) {
37
- * // Handle failure or circuit open
38
- * }
39
- */
40
11
  declare const CircuitState: {
41
12
  readonly CLOSED: "CLOSED";
42
13
  readonly OPEN: "OPEN";
@@ -187,9 +158,27 @@ interface CircuitBreakerStats {
187
158
  openedAt: number | null;
188
159
  lastCallAt: number | null;
189
160
  }
190
- declare class CircuitBreakerError extends Error {
191
- state: CircuitState;
192
- constructor(message: string, state: CircuitState);
161
+ /**
162
+ * Thrown when a call is refused because the circuit is OPEN (or HALF_OPEN with
163
+ * every probe slot taken).
164
+ *
165
+ * An `ArcError` with status **503**, code `arc.circuit_open`. It extended plain
166
+ * `Error` and carried no status, so an open circuit reaching arc's error
167
+ * handler was classified `arc.internal_error`: a 500, logged at error level
168
+ * with a stack trace, once per fast-failed call. That is the opposite of what
169
+ * a breaker is for — it turned deliberate, cheap load shedding into the
170
+ * loudest failure in the logs, during exactly the outage where it fires
171
+ * thousands of times a minute.
172
+ *
173
+ * `retryAfter` (seconds, rounded up) is when the circuit next probes; the
174
+ * error handler sends it as `Retry-After`, so well-behaved clients back off
175
+ * for as long as the breaker is actually going to refuse them.
176
+ */
177
+ declare class CircuitBreakerError extends ArcError {
178
+ readonly state: CircuitState;
179
+ /** Seconds until the circuit next probes, when known. */
180
+ readonly retryAfter?: number;
181
+ constructor(message: string, state: CircuitState, retryAfter?: number);
193
182
  }
194
183
  declare class CircuitBreaker<T extends AnyAsyncFn> {
195
184
  private state;
@@ -508,45 +497,16 @@ interface Guard<T> {
508
497
  declare function defineGuard<T>(config: GuardConfig<T>): Guard<T>;
509
498
  //#endregion
510
499
  //#region src/utils/filter-dialect.d.ts
511
- /**
512
- * Filter dialects — decouple `ArcQueryParser` from any single datastore's
513
- * operator vocabulary.
514
- *
515
- * The parser owns everything store-INDEPENDENT: URL parsing, field/operator
516
- * whitelisting, depth limits, value coercion, ReDoS-safe regex sanitisation.
517
- * A `FilterDialect` owns the ONLY store-specific part of the output — which
518
- * token each neutral operator (`gte`, `like`, `in`, …) is emitted as, and how a
519
- * case-insensitive text match is expressed. Swap the dialect (or the whole
520
- * parser via `QueryParserInterface`) to target a non-Mongo store; the default
521
- * stays Mongo, so existing hosts are unaffected.
522
- */
523
500
  interface FilterDialect {
524
- /**
525
- * Neutral operator name → emitted token. An operator absent from this map is
526
- * treated as unsupported (dropped), so a dialect also defines its operator set.
527
- */
528
- readonly operators: Readonly<Record<string, string>>;
529
- /**
530
- * Extra keys merged into a field-filter when a documented case-insensitive
531
- * text operator (`like` / `contains`) is used. Mongo expresses this as a
532
- * sibling `{ $options: 'i' }`; a dialect that encodes case-insensitivity in
533
- * the operator itself returns `{}`.
534
- */
535
- caseInsensitiveModifier(): Record<string, unknown>;
501
+ /** Emit the parsed clauses as one filter. Several clauses on a field are ANDed. */
502
+ emit(clauses: readonly FilterClause[]): Record<string, unknown>;
503
+ /** The operator tokens this dialect can emit — for audits and docs. */
504
+ readonly tokens: readonly string[];
536
505
  }
537
- /**
538
- * Default dialect — MongoDB / MongoKit operator shape. Emits `$`-prefixed
539
- * tokens and the `$options: 'i'` case-insensitive sibling. This is what
540
- * `ArcQueryParser` uses when no dialect is supplied, so behaviour is identical
541
- * to every prior arc version.
542
- */
543
506
  declare const MONGO_DIALECT: FilterDialect;
544
507
  /**
545
- * Store-neutral reference dialect — emits UN-prefixed operator tokens as a
546
- * translation AST (`?price[gte]=40` → `{ price: { gte: 40 } }`, with
547
- * `{ caseInsensitive: true }` for `like`/`contains`). A non-Mongo adapter can
548
- * consume this directly instead of writing a full `QueryParserInterface`. Use
549
- * as a starting point; adjust the token names to your store's vocabulary.
508
+ * Store-neutral: `{ field: { <op>: value } }` with the grammar's own operator names, for a host
509
+ * that compiles the canonical clauses itself.
550
510
  */
551
511
  declare const NEUTRAL_DIALECT: FilterDialect;
552
512
  //#endregion
@@ -558,194 +518,85 @@ declare const NEUTRAL_DIALECT: FilterDialect;
558
518
  * The return value is sent raw (no envelope). If it returns `undefined`,
559
519
  * the response body is empty (HTTP status only).
560
520
  * @param statusCode - HTTP status code for successful responses (default: 200)
521
+ * @returns The reply, so Fastify waits for it: resolving `undefined` after `reply.send()` while an
522
+ * async `preSerialization` hook (idempotency, encryption) is pending re-sends an empty body.
561
523
  */
562
- declare function handleRaw<T>(handler: (request: FastifyRequest, reply: FastifyReply) => Promise<T>, statusCode?: number): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
524
+ declare function handleRaw<T>(handler: (request: FastifyRequest, reply: FastifyReply) => Promise<T>, statusCode?: number): (request: FastifyRequest, reply: FastifyReply) => Promise<FastifyReply>;
563
525
  //#endregion
564
526
  //#region src/utils/queryParser.d.ts
565
527
  interface ArcQueryParserOptions {
566
- /** Maximum allowed limit value (default: 1000) */
528
+ /** Cap on `limit`; a larger request is clamped to it (default: 1000). */
567
529
  maxLimit?: number;
568
- /** Default limit for pagination (default: 20) */
530
+ /** Per-page count when the URL omits `limit` (default: 20). */
569
531
  defaultLimit?: number;
570
- /** Maximum regex pattern length (default: 500) */
532
+ /** Longest text-operator value or regex pattern (default: 200). */
571
533
  maxRegexLength?: number;
572
- /** Maximum search query length (default: 200) */
534
+ /** Longest `search` (default: 200). */
573
535
  maxSearchLength?: number;
574
- /** Maximum filter nesting depth (default: 10) */
575
- maxFilterDepth?: number;
576
- /**
577
- * Whitelist of fields that can be filtered on.
578
- * When set, only these fields are accepted as filters — all others are silently dropped.
579
- * Also used by MCP to auto-derive filterable fields in tool schemas.
580
- */
536
+ /** Filterable fields. Also used by MCP to derive filterable fields. */
581
537
  allowedFilterFields?: string[];
582
538
  /**
583
- * REFUSE a filter key that is not in {@link allowedFilterFields}, instead of
584
- * dropping it (default: `false` — today's drop behaviour, kept because arc
585
- * is published and an unconditional throw would reject requests that work).
586
- *
587
- * Dropping a filter does not fail, it **WIDENS**: the caller asked for a
588
- * narrower set and is silently answered with a broader one, HTTP 200. Two
589
- * live instances:
590
- *
591
- * `?filters[status]=pending` → 200, every row `status:"verified"`
592
- * `?productId=…` (the param is `skuRef`) → a different product's 75 units,
593
- * filed for weeks as "quant leakage"
594
- *
595
- * Turn this on per-parser, or fleet-wide via `ARC_STRICT_QUERY_PARAMS`.
596
- * Mirrors the `ARC_STRICT_PERMISSIONS` precedent: off by default here, and
597
- * the HOST opts in from its env-loader so a forgotten `.env` line cannot
598
- * silently disable enforcement.
599
- *
600
- * Only the FILTER whitelist is covered. `allowedSortFields` /
601
- * `allowedOperators` keep dropping: a rejected sort or operator degrades
602
- * ordering, it does not widen the row set.
539
+ * REFUSE (400) a field, operator or sort field outside its allowlist — a dropped filter silently
540
+ * WIDENS the read. Default `true`; `false` (or `ARC_STRICT_QUERY_PARAMS=false`) logs and drops
541
+ * those instead. Malformed or smuggled input (`$where`, `x[$ne]`) is refused either way.
603
542
  */
604
543
  strictFilterFields?: boolean;
605
- /**
606
- * Whitelist of fields that can be sorted on.
607
- * When set, sort fields not in this list are silently dropped.
608
- * Also used by MCP to describe available sort options.
609
- */
544
+ /** Sortable fields. Also used by MCP. */
610
545
  allowedSortFields?: string[];
611
- /**
612
- * Whitelist of filter operators (e.g. ['eq', 'ne', 'gt', 'lt', 'in']).
613
- * When set, only these operators are accepted — all others are dropped.
614
- * Also used by MCP to enrich list tool descriptions.
615
- */
546
+ /** URL operator names permitted in `field[op]` (e.g. `['in', 'gte']`). Also used by MCP. */
616
547
  allowedOperators?: string[];
617
- /**
618
- * Datastore dialect for the EMITTED filter shape (operator tokens +
619
- * case-insensitive expression). Defaults to `MONGO_DIALECT`. Pass
620
- * `NEUTRAL_DIALECT` (or a custom one) to retarget the operator vocabulary
621
- * without writing a full `QueryParserInterface`.
622
- */
548
+ /** The emitted filter shape. Default `MONGO_DIALECT`. */
623
549
  dialect?: FilterDialect;
624
550
  }
625
551
  /**
626
- * Arc's default query parser
627
- *
628
- * Converts URL query parameters to a structured query format:
629
- * - Pagination: ?page=1&limit=20
630
- * - Sorting: ?sort=-createdAt,name (- prefix = descending)
631
- * - Filtering — TWO supported forms (both produce identical output):
632
- * - Bare (default, terse): `?status=active&price[gte]=100&price[lte]=500`
633
- * - Bracket envelope: `?filter[status]=active&filter[price][gte]=100`
634
- * The envelope form matches the convention used by JSON:API / Stripe /
635
- * most modern REST style guides, and is the safe choice on busy URLs
636
- * that might otherwise collide with reserved meta keys (`page`, `sort`,
637
- * `select`, `populate`, etc.). Operator notation (`[gte]`, `[lte]`,
638
- * `[ne]`, `[in]`, ...) works inside either form.
639
- * - Search: ?search=keyword
640
- * - Populate: ?populate=author,category
641
- * - Field selection: ?select=name,price,status
642
- * - Keyset pagination: ?after=cursor_value
643
- *
644
- * **NOTE on parser portability.** `ArcQueryParser` accepts both filter
645
- * forms. Other parser implementations (`@classytic/mongokit`'s
646
- * `QueryParser`, custom hosts-side parsers) may accept only one form —
647
- * MongoKit historically only accepts the bare form. If your host swaps
648
- * `queryParser` to a different implementation, double-check which forms
649
- * it understands before publishing URLs that mix the two.
650
- *
651
- * For advanced MongoDB features ($lookup, aggregations), use MongoKit's QueryParser.
552
+ * Arc's default query parser:
553
+ * - Paging `?page=1&limit=20`, keyset `?after=cursor`; sort `?sort=-createdAt,name`
554
+ * - Filters bare (`?status=active&price[gte]=100`) or in the `?filter[...]` envelope, which
555
+ * avoids collisions with reserved keys (`page`, `sort`, ...)
556
+ * - Search `?search=`, populate `?populate=a,b`, select `?select=a,-b`
652
557
  */
653
558
  declare class ArcQueryParser implements QueryParserInterface {
654
559
  /**
655
- * PUBLIC, deliberately: `QueryResolver` reads it so it does not apply a second cap
656
- * on top of this one. Three layers capping independently, lowest winning silently,
657
- * is what made a 696-row chart of accounts render as 100.
560
+ * Public so `QueryResolver` reuses this cap instead of stacking its own
561
+ * (independent caps silently truncate to the lowest).
658
562
  */
659
563
  readonly maxLimit: number;
660
564
  private readonly defaultLimit;
661
565
  private readonly maxRegexLength;
662
566
  private readonly maxSearchLength;
663
- private readonly maxFilterDepth;
664
- private readonly _allowedFilterFields?;
665
- private readonly _allowedSortFields?;
666
- private readonly _allowedOperators?;
667
- private readonly strictFilterFields;
567
+ private readonly strict;
568
+ private readonly dialect;
668
569
  /** Allowed filter fields (used by MCP for auto-derive) */
669
570
  readonly allowedFilterFields?: readonly string[];
670
571
  /** Allowed sort fields (used by MCP for sort descriptions) */
671
572
  readonly allowedSortFields?: readonly string[];
672
573
  /** Allowed operators (used by MCP for operator descriptions) */
673
574
  readonly allowedOperators?: readonly string[];
674
- /**
675
- * Datastore dialect — owns the store-specific operator tokens + the
676
- * case-insensitive modifier. Defaults to Mongo (backward-compatible).
677
- */
678
- private readonly dialect;
679
- /** Supported filter operators (neutral name → emitted token), from the dialect. */
680
- private get operators();
681
575
  constructor(options?: ArcQueryParserOptions);
682
- /**
683
- * Parse URL query parameters into structured query options
684
- */
576
+ /** Parse URL query parameters into structured query options. Invalid input is a 400. */
685
577
  parse(query: Record<string, unknown> | null | undefined): ParsedQuery;
686
- private parseNumber;
687
- private parseString;
578
+ /** A grammar refusal is a 400 (`ValidationError`) — unless lenient and only an allowlist miss. */
579
+ private read;
580
+ private drop;
688
581
  /**
689
- * Parse populate parameter — handles both simple string and bracket notation.
690
- *
691
- * Simple: ?populate=author,category → { populate: 'author,category' }
692
- * Bracket: ?populate[author][select]=name,email → { populateOptions: [{ path: 'author', select: 'name email' }] }
582
+ * Simple `?populate=author,category`, or bracket `?populate[author][select]=name,email` and
583
+ * `?populate[author][match][field]=value` (field equality only).
693
584
  */
694
585
  private parsePopulate;
695
- private parseSort;
696
- private parseSearch;
697
- private parseSelect;
698
586
  /**
699
- * Check if a value exceeds the maximum nesting depth.
700
- * Prevents filter bombs where deeply nested objects consume excessive memory/CPU.
701
- */
702
- private exceedsDepth;
703
- /**
704
- * Parse all filter entries from the query, supporting BOTH the bare
705
- * top-level form and the bracket-wrapped `filter[...]` envelope.
706
- *
707
- * Two equivalent ways to express the same query:
708
- * - Bare (legacy, arc default): `?status=active&price[gte]=40`
709
- * - Bracket envelope (REST convention): `?filter[status]=active&filter[price][gte]=40`
710
- *
711
- * Both forms parse to the same `filters: { status: 'active', price: { $gte: 40 } }`.
712
- * The envelope form mirrors the convention used by most REST API style
713
- * guides (JSON:API, Stripe API, etc.) and disambiguates filter fields
714
- * from reserved meta params on busy URLs — a query string with a field
715
- * literally named `page` or `sort` can't collide with the framework's
716
- * meta keys when wrapped under `filter[...]`. The bare form stays as
717
- * the default since it's the shortest path for simple queries; expect
718
- * it to remain supported indefinitely.
719
- *
720
- * Precedence when the same key appears in both forms:
721
- * `?status=closed&filter[status]=active` → bare wins (`status: closed`).
722
- * Mixing should be rare; the deterministic rule avoids silent surprises.
723
- */
724
- private parseFilters;
725
- /**
726
- * Apply one filter entry — used by both the bracket-envelope branch and
727
- * the bare top-level branch of `parseFilters`. Centralising the field-
728
- * validation + operator-conversion logic keeps the two forms in
729
- * lockstep; a future regex/security tweak only changes one place.
730
- */
731
- private applyFilterEntry;
732
- private parseFilterValue;
733
- private coerceValue;
734
- /**
735
- * Generate OpenAPI-compatible JSON Schema for query parameters.
736
- * Arc's defineResource() auto-detects this method and uses it
737
- * to document list endpoint query parameters in OpenAPI/Swagger.
587
+ * A populate `match` is plain field EQUALITY in bracket form (`populate[p][match][f]=v`). A `$`
588
+ * key, a nested object or a non-object `match` (a JSON string) is refused, never passed to the
589
+ * driver or dropped — a dropped match populates every document.
738
590
  */
591
+ private parsePopulateMatch;
592
+ /** JSON Schema for list query parameters (auto-detected by `defineResource`). */
739
593
  getQuerySchema(): {
740
594
  type: "object";
741
595
  properties: Record<string, unknown>;
742
596
  required?: string[];
743
597
  };
744
- private sanitizeRegex;
745
598
  }
746
- /**
747
- * Create a new ArcQueryParser instance
748
- */
599
+ /** Create a new ArcQueryParser instance. */
749
600
  declare function createQueryParser(options?: ArcQueryParserOptions): ArcQueryParser;
750
601
  //#endregion
751
602
  //#region src/utils/responseSchemas.d.ts
@@ -1223,12 +1074,10 @@ declare function getListQueryParams(): AnyRecord;
1223
1074
  /**
1224
1075
  * Get default response schemas for all CRUD operations.
1225
1076
  *
1226
- * When routes have response schemas, Fastify compiles them with
1227
- * fast-json-stringify for 2-3x faster serialization and prevents
1228
- * accidental field disclosure.
1229
- *
1230
- * These defaults use `additionalProperties: true` so all fields pass through.
1231
- * Override with specific schemas for full serialization performance + safety.
1077
+ * The envelope is typed (its fields are known); rows and single documents
1078
+ * pass through as `{}` — see `genericItemSchema`. A resource that declares a
1079
+ * response schema with real `properties` gets typed row serialization, which
1080
+ * also drops undeclared fields.
1232
1081
  *
1233
1082
  * Note: `example` properties are stripped from defaults so they work with
1234
1083
  * any Fastify instance (not just createApp which adds `keywords: ['example']`).
@@ -1340,6 +1189,18 @@ declare function convertOpenApiSchemas(schemas: OpenApiSchemas, target?: JsonSch
1340
1189
  */
1341
1190
  declare function convertRouteSchema(schema: Record<string, unknown>, target?: JsonSchemaTarget): Record<string, unknown>;
1342
1191
  //#endregion
1192
+ //#region src/utils/shutdown.d.ts
1193
+ interface ShutdownParticipant {
1194
+ readonly name: string;
1195
+ readonly kind?: "producer" | "consumer";
1196
+ stop?(): void | Promise<void>;
1197
+ drain?(): void | Promise<void>;
1198
+ }
1199
+ /** Descendants of admitted work may finish their causal publications during shutdown. */
1200
+ declare function runAdmittedWork<T>(work: () => T | Promise<T>): Promise<T>;
1201
+ /** A participant's stop must prevent new work; drain waits for work already admitted. */
1202
+ declare function registerShutdownParticipant(fastify: FastifyInstance, participant: ShutdownParticipant): void;
1203
+ //#endregion
1343
1204
  //#region src/utils/simpleEqualityMatcher.d.ts
1344
1205
  /**
1345
1206
  * `simpleEqualityMatcher` — a minimal, dialect-agnostic flat-key equality
@@ -1642,4 +1503,4 @@ declare function hasEvents(instance: FastifyInstance): instance is FastifyInstan
1642
1503
  events: EventsDecorator;
1643
1504
  };
1644
1505
  //#endregion
1645
- export { 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 SseStream, type SseStreamOptions, type StateMachine, type TransitionConfig, UI_MESSAGE_STREAM_HEADERS, UnauthorizedError, ValidationError, aggregateListResponse, bareListResponse, convertOpenApiSchemas, convertRouteSchema, createCircuitBreaker, createCircuitBreakerRegistry, createDomainError, createError, createQueryParser, createStateMachine, declareRuntimeCapability, defineCompensation, defineErrorMapper, defineGuard, deleteResponse, errorContractSchema, errorDetailSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, requireSingleHeaderValue, responses, scheduleBackground, simpleEqualityMatcher, toJsonSchema, withCompensation };
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 };
@@ -1,12 +1,13 @@
1
- /*! @classytic/arc v2.41.1 | 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-BH7YU_9O.mjs";
3
- import { n as requireSingleHeaderValue, t as getHeader } from "../headers-BIXWKrzQ.mjs";
4
- import { n as getUserRoles, r as normalizeRoles, t as getUserId } from "../userHelpers-ChRvkuSZ.mjs";
5
- import { t as simpleEqualityMatcher } from "../simpleEqualityMatcher-C9bzq2gO.mjs";
6
- import { A as NEUTRAL_DIALECT, C as offsetListResponse, D as ArcQueryParser, E as responses, O as createQueryParser, S as listResponse, T as queryParams, _ as errorContractSchema, a as defineCompensation, b as getListQueryParams, c as CircuitBreaker, d as CircuitState, f as createCircuitBreaker, g as deleteResponse, h as bareListResponse, i as defineErrorMapper, j as scheduleBackground, k as MONGO_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 errorDetailSchema, w as paginationSchema, x as keysetListResponse, y as getDefaultCrudSchemas } from "../utils-CxcctrAh.mjs";
7
- import { a as isZodSchema, i as isJsonSchema, n as convertRouteSchema, o as toJsonSchema, t as convertOpenApiSchemas } from "../schemaConverter-BVA7cFRG.mjs";
8
- import { a as promoteStreamTokenToHeader, i as pipeUIMessageStreamToReply, n as forwardedStreamHeaders, r as isReadableStream, t as UI_MESSAGE_STREAM_HEADERS } from "../streaming-IcRFjWQU.mjs";
9
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-CkhS6jn6.mjs";
10
- import { t as openSseStream } from "../sseStream-Ppzo-WUH.mjs";
11
- import { t as hasEvents } from "../typeGuards-BLjPgVBm.mjs";
12
- 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, errorDetailSchema, forwardedStreamHeaders, getDefaultCrudSchemas, getHeader, getListQueryParams, getUserId, getUserRoles, handleRaw, hasEvents, isArcError, isJsonSchema, isReadableStream, isZodSchema, keysetListResponse, listResponse, normalizeRoles, offsetListResponse, openSseStream, paginationSchema, pipeUIMessageStreamToReply, promoteStreamTokenToHeader, queryParams, requireSingleHeaderValue, responses, scheduleBackground, simpleEqualityMatcher, toJsonSchema, withCompensation };
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";
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 };