@classytic/arc 2.48.0 → 2.49.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 (213) hide show
  1. package/dist/{EventTransport-BWwg5YAU.mjs → EventTransport-DbHZK230.mjs} +2 -2
  2. package/dist/{HookSystem-B9x-Y_k7.mjs → HookSystem-DMoeJ6Do.mjs} +2 -2
  3. package/dist/{QueryCache-DdvrGG8Q.d.mts → QueryCache-BE47tmlO.d.mts} +36 -1
  4. package/dist/{ResourceRegistry-BcvEJoZd.mjs → ResourceRegistry-CP-iTcKy.mjs} +2 -2
  5. package/dist/{acquire-D2yj6Zzl.mjs → acquire-CB0va87C.mjs} +1 -1
  6. package/dist/audit/index.d.mts +1 -1
  7. package/dist/audit/index.mjs +4 -4
  8. package/dist/auth/audit.mjs +1 -1
  9. package/dist/auth/index.d.mts +2 -2
  10. package/dist/auth/index.mjs +53 -15
  11. package/dist/auth/redis-session.mjs +1 -1
  12. package/dist/{authorizationDecision-BZSJcPNE.mjs → authorizationDecision-DHO94aV2.mjs} +4 -4
  13. package/dist/{boundedMap-o2KZDCWy.mjs → boundedMap-C51EUUOm.mjs} +1 -1
  14. package/dist/{buildHandler-G3k59KY2.mjs → buildHandler-9DuwEKvr.mjs} +23 -16
  15. package/dist/cache/index.d.mts +2 -2
  16. package/dist/cache/index.mjs +4 -4
  17. package/dist/{caching-CJIDPZOv.mjs → caching-COTX3sDa.mjs} +3 -6
  18. package/dist/{claimed-D0A43wjT.mjs → claimed-C7T1nHlo.mjs} +1 -1
  19. package/dist/cleanup/index.d.mts +2 -2
  20. package/dist/cleanup/index.mjs +4 -4
  21. package/dist/cli/commands/describe.d.mts +1 -1
  22. package/dist/cli/commands/describe.mjs +3 -3
  23. package/dist/cli/commands/docs.mjs +3 -3
  24. package/dist/cli/commands/doctor.mjs +1 -1
  25. package/dist/cli/commands/generate.mjs +2 -2
  26. package/dist/cli/commands/init.mjs +2 -2
  27. package/dist/cli/commands/introspect.mjs +2 -2
  28. package/dist/cli/index.mjs +3 -3
  29. package/dist/{constants-D-faL5SX.mjs → constants-DOnfMd7i.mjs} +1 -1
  30. package/dist/context/index.mjs +5 -5
  31. package/dist/core/index.d.mts +3 -3
  32. package/dist/core/index.mjs +7 -7
  33. package/dist/{core-NSu1peyq.mjs → core-BoEdFDDw.mjs} +3 -3
  34. package/dist/{createActionRouter-DTSVv1VK.mjs → createActionRouter-CpTn15dm.mjs} +54 -18
  35. package/dist/{createAggregationRouter-zEasm-ax.mjs → createAggregationRouter-CD_Hydp0.mjs} +13 -11
  36. package/dist/{createApp-CjqhkX1x.mjs → createApp-Be6XTGD9.mjs} +332 -40
  37. package/dist/{createMcpServer-hSFeqRUb.d.mts → createMcpServer-CS2KOVP6.d.mts} +1 -1
  38. package/dist/{defineAggregation-DH2L6_v9.mjs → defineAggregation-BI5pRb8c.mjs} +1 -1
  39. package/dist/{defineResource-zYCrhNaN.mjs → defineResource-BAzNu5Um.mjs} +8 -8
  40. package/dist/discovery/index.mjs +1 -1
  41. package/dist/docs/index.d.mts +1 -1
  42. package/dist/docs/index.mjs +3 -3
  43. package/dist/{elevation-z--rFcZ5.mjs → elevation-DupGuM41.mjs} +6 -9
  44. package/dist/encryption/index.mjs +3 -3
  45. package/dist/{errorHandler-3_3oN-Uc.mjs → errorHandler-DA03vRqp.mjs} +4 -7
  46. package/dist/{errors-DyY48oRi.mjs → errors-BpYV859Y.mjs} +1 -1
  47. package/dist/{eventPlugin-Co9sABCg.mjs → eventPlugin-D7LYtYzL.mjs} +9 -13
  48. package/dist/{eventTypes-HmAFyJmJ.mjs → eventTypes-BqA-N-Uz.mjs} +2 -2
  49. package/dist/events/index.d.mts +18 -5
  50. package/dist/events/index.mjs +8 -8
  51. package/dist/events/transports/redis-stream-entry.mjs +4 -4
  52. package/dist/events/transports/redis.d.mts +35 -0
  53. package/dist/events/transports/redis.mjs +87 -11
  54. package/dist/factory/index.d.mts +4 -4
  55. package/dist/factory/index.mjs +6 -6
  56. package/dist/{fastify-augmentation-bzkWPt1f.d.mts → fastify-augmentation-baQc3MaO.d.mts} +2 -2
  57. package/dist/fieldTypes-EFWxCkZ5.mjs +80 -0
  58. package/dist/{fields-rfsl26Ov.mjs → fields-CT1Erg7o.mjs} +1 -1
  59. package/dist/{filter-merge-8glLr7Dk.mjs → filter-merge-B1eJ1pMx.mjs} +1 -1
  60. package/dist/{generate-BOfBueRt.mjs → generate-Cr0ULavs.mjs} +2 -2
  61. package/dist/{headers-CHSOqpcY.mjs → headers-D4bncIOf.mjs} +2 -2
  62. package/dist/{health-ezwTHQh2.mjs → health-BoFxrkJE.mjs} +1 -1
  63. package/dist/{health-DHvAIVmM.mjs → health-DN_pUVMX.mjs} +1 -1
  64. package/dist/hooks/index.d.mts +1 -1
  65. package/dist/hooks/index.mjs +2 -2
  66. package/dist/http-cache/index.d.mts +2 -2
  67. package/dist/http-cache/index.mjs +4 -4
  68. package/dist/http-cache/purgers/cloudflare.mjs +2 -2
  69. package/dist/http-cache/purgers/fastly.mjs +2 -2
  70. package/dist/http-cache/testing/index.mjs +1 -1
  71. package/dist/idempotency/index.d.mts +1 -1
  72. package/dist/idempotency/index.mjs +10 -8
  73. package/dist/idempotency/redis.mjs +2 -2
  74. package/dist/{index-B5i9-vuP.d.mts → index-CMNpMBtW.d.mts} +1 -1
  75. package/dist/{index-BxZS-8So.d.mts → index-DKM2p5w5.d.mts} +48 -23
  76. package/dist/{index-Cy2-QffW.d.mts → index-DLCcLUQT.d.mts} +69 -6
  77. package/dist/{index-DFCCQ9AE.d.mts → index-DexdFs1a.d.mts} +1 -1
  78. package/dist/{index-D1X_C_qz.d.mts → index-Dhrks-hM.d.mts} +60 -10
  79. package/dist/index.d.mts +4 -4
  80. package/dist/index.mjs +11 -11
  81. package/dist/{init-MoE3eZNR.mjs → init-C4a24wD2.mjs} +1 -1
  82. package/dist/integrations/event-gateway.mjs +2 -2
  83. package/dist/integrations/index.d.mts +2 -2
  84. package/dist/integrations/index.mjs +1 -1
  85. package/dist/integrations/jobs/index.mjs +3 -3
  86. package/dist/integrations/mcp/index.d.mts +5 -5
  87. package/dist/integrations/mcp/index.mjs +2 -2
  88. package/dist/integrations/mcp/testing.d.mts +2 -2
  89. package/dist/integrations/mcp/testing.mjs +2 -2
  90. package/dist/integrations/streamline.mjs +3 -3
  91. package/dist/integrations/webhooks.d.mts +1 -1
  92. package/dist/integrations/webhooks.mjs +4 -4
  93. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  94. package/dist/integrations/websocket-redis.mjs +1 -1
  95. package/dist/integrations/websocket.mjs +2 -2
  96. package/dist/{jsonBody-DZGiCawf.mjs → jsonBody-DoTt5BS6.mjs} +2 -2
  97. package/dist/{keys-CrMOZuk6.mjs → keys--l9n7aOC.mjs} +1 -1
  98. package/dist/{loadResources-CVQvYUhN.mjs → loadResources-rygByIQA.mjs} +3 -3
  99. package/dist/{loadResourcesFromEntry-D0naccV2.mjs → loadResourcesFromEntry-ItNBIQ5w.mjs} +2 -2
  100. package/dist/logger/index.mjs +2 -2
  101. package/dist/{logger-VyMcSmVG.mjs → logger-UbknHqHy.mjs} +1 -1
  102. package/dist/{mcpPlugin-DQACaqVu.mjs → mcpPlugin-CTkk4RP8.mjs} +29 -26
  103. package/dist/{memory-Lpfu8Hga.mjs → memory-C47xVsjX.mjs} +3 -3
  104. package/dist/{metrics-DjVj1sg5.mjs → metrics-TJyAb1Xk.mjs} +4 -7
  105. package/dist/middleware/index.d.mts +1 -1
  106. package/dist/middleware/index.mjs +3 -3
  107. package/dist/migrations/index.mjs +2 -2
  108. package/dist/{module-BqPJpZ_L.mjs → module-CWiqsXnh.mjs} +1 -1
  109. package/dist/{multiTenant-KZj8j1uJ.d.mts → multiTenant-QtDzxx_K.d.mts} +1 -1
  110. package/dist/{multipartBody-BNgNv7r0.mjs → multipartBody-BdG1qbn1.mjs} +1 -1
  111. package/dist/{observeSend-BKJHibJz.mjs → observeSend-DrA3ADFN.mjs} +1 -1
  112. package/dist/{openapi-T90KrPR6.mjs → openapi-D6MAbYpv.mjs} +7 -7
  113. package/dist/outbox-admin/index.d.mts +1 -1
  114. package/dist/outbox-admin/index.mjs +5 -5
  115. package/dist/{outbox-module-C874VgBr.mjs → outbox-module-D5QABFQW.mjs} +197 -28
  116. package/dist/{outbox-module-5Mnwcycy.d.mts → outbox-module-DzW6zwWJ.d.mts} +103 -10
  117. package/dist/permissions/index.d.mts +2 -2
  118. package/dist/permissions/index.mjs +7 -7
  119. package/dist/{permissions-R9T2G1PH.mjs → permissions-CFsmdYUt.mjs} +9 -9
  120. package/dist/{pipe-DzqbsZy-.mjs → pipe-B_05AgGt.mjs} +2 -2
  121. package/dist/pipeline/index.d.mts +1 -1
  122. package/dist/pipeline/index.mjs +2 -2
  123. package/dist/{plan-C0gkeABY.mjs → plan-BnlNJhrj.mjs} +1 -1
  124. package/dist/{plugin-BJcVOX5r.mjs → plugin-CrMPYbdj.mjs} +94 -50
  125. package/dist/plugins/index.d.mts +6 -5
  126. package/dist/plugins/index.mjs +19 -18
  127. package/dist/plugins/response-cache.mjs +4 -4
  128. package/dist/plugins/tracing-entry.mjs +2 -2
  129. package/dist/{pluralize-CrCpyoZs.mjs → pluralize-oVIxJ4CY.mjs} +1 -1
  130. package/dist/presets/filesUpload.d.mts +1 -1
  131. package/dist/presets/filesUpload.mjs +5 -5
  132. package/dist/presets/index.d.mts +2 -2
  133. package/dist/presets/index.mjs +2 -2
  134. package/dist/presets/multiTenant.d.mts +1 -1
  135. package/dist/presets/multiTenant.mjs +5 -5
  136. package/dist/presets/search.d.mts +1 -1
  137. package/dist/presets/search.mjs +2 -2
  138. package/dist/{presets-CNDvNYsz.mjs → presets-CUd3L7v6.mjs} +4 -4
  139. package/dist/{projection-CIUe8b59.mjs → projection-DowJlIto.mjs} +2 -2
  140. package/dist/{purger.types-f83fTzGy.mjs → purger.types-BjKy8869.mjs} +1 -1
  141. package/dist/{queryCachePlugin-B2jpwFcv.mjs → queryCachePlugin-BvB3k_Fh.mjs} +114 -14
  142. package/dist/{queryCachePlugin-DYQUyeJ9.d.mts → queryCachePlugin-DrQNnGws.d.mts} +1 -1
  143. package/dist/{rateLimitKey-BWx-qep0.mjs → rateLimitKey-56nH1cWN.mjs} +1 -1
  144. package/dist/{realtime-D2tqi3d2.mjs → realtime-DXGBPtYK.mjs} +19 -22
  145. package/dist/registry/index.d.mts +2 -2
  146. package/dist/registry/index.mjs +3 -3
  147. package/dist/{registry-Dl0k6UXy.mjs → registry-Biz-6sEZ.mjs} +2 -2
  148. package/dist/{relay-ZYvS4xyW.mjs → relay-DEIoMntZ.mjs} +200 -99
  149. package/dist/{renewingLease-DT4yLb29.mjs → renewingLease-BCJpW9-u.mjs} +1 -1
  150. package/dist/{replyHelpers-BJFN5AW7.mjs → replyHelpers-DliJNb0-.mjs} +2 -2
  151. package/dist/{requestContext-Ct5la-SA.mjs → requestContext-tUgLt9Ky.mjs} +1 -1
  152. package/dist/{requirement-CxDxjB6V.mjs → requirement-0l2DApiQ.mjs} +1 -1
  153. package/dist/{resourceRateLimit-DCWglD7V.d.mts → resourceRateLimit-BPiESPtG.d.mts} +4 -0
  154. package/dist/{resourceRateLimit-D1oH2obv.mjs → resourceRateLimit-iSXF8rLH.mjs} +19 -4
  155. package/dist/{rolldown-runtime-BdTN42uL.mjs → rolldown-runtime-gKJR3o-6.mjs} +1 -1
  156. package/dist/{routeValidator-DclDl5WJ.mjs → routeValidator-xNYA4rr1.mjs} +47 -5
  157. package/dist/{runtimeCapabilities-ClWr60El.mjs → runtimeCapabilities-BQK-GrYe.mjs} +1 -1
  158. package/dist/{schedules-gVkRcs-9.mjs → schedules-D9iMVFhF.mjs} +6 -9
  159. package/dist/{schemaConverter-CIwB5wPO.mjs → schemaConverter-cIh4oX9a.mjs} +2 -2
  160. package/dist/{actionPermissions-Dha8sAz2.mjs → schemaIR-BsY4y9VP.mjs} +184 -16
  161. package/dist/schemas/index.mjs +1 -1
  162. package/dist/scim/index.mjs +2 -2
  163. package/dist/scope/index.d.mts +1 -1
  164. package/dist/scope/index.mjs +5 -5
  165. package/dist/{scope-VMZhdkbT.mjs → scope-QyhM9w8z.mjs} +4 -4
  166. package/dist/{shutdown-Bi19vH0z.mjs → shutdown-BM7Q0h4B.mjs} +1 -1
  167. package/dist/{sse-BqM359f1.mjs → sse-ofvlcTQQ.mjs} +9 -35
  168. package/dist/sseStats-DQqNN385.d.mts +112 -0
  169. package/dist/sseStream-BxQW7hPq.mjs +166 -0
  170. package/dist/{store-helpers-rx-F2ZGR.mjs → store-helpers-_FRhHDyv.mjs} +1 -1
  171. package/dist/{simpleEqualityMatcher-CaCS09fh.mjs → streamFrames-B3ZJfI02.mjs} +19 -2
  172. package/dist/{streaming-CPChx3A7.mjs → streaming-HZr63UiM.mjs} +1 -1
  173. package/dist/{subscriberIdentity-CYNYw8p_.mjs → subscriberIdentity-DSgnoT_D.mjs} +1 -1
  174. package/dist/{tenancy-BoWImS3K.mjs → tenancy-_ukT0oBt.mjs} +2 -2
  175. package/dist/{tenantPreparation-oqKCZQZM.mjs → tenantPreparation-DSlQI53c.mjs} +4 -4
  176. package/dist/testing/cleanupStoreContract.mjs +1 -1
  177. package/dist/testing/index.d.mts +4 -4
  178. package/dist/testing/index.mjs +324 -17
  179. package/dist/testing/outboxStoreContract.mjs +2 -2
  180. package/dist/testing/requiredPorts.mjs +2 -2
  181. package/dist/testing/storageContract.mjs +1 -1
  182. package/dist/{timing-Dsteq59c.mjs → timing-Z8p-Zlw1.mjs} +1 -1
  183. package/dist/{transactionContext-C1OgH-hW.mjs → transactionContext-DBbSTfY3.mjs} +1 -1
  184. package/dist/{typeGuards-DNlpASzd.mjs → typeGuards-_6nNQqgq.mjs} +1 -1
  185. package/dist/types/index.d.mts +1 -1
  186. package/dist/types/index.mjs +1 -1
  187. package/dist/types/storage.mjs +1 -1
  188. package/dist/{types-DduBiYaI.d.mts → types-B4E0sc6D.d.mts} +2 -2
  189. package/dist/{types-HFFSwF_K.mjs → types-CrOlZ4rY.mjs} +4 -4
  190. package/dist/usage/index.d.mts +1 -1
  191. package/dist/usage/index.mjs +7 -7
  192. package/dist/{userHelpers-N-k-8dNF.mjs → userHelpers-CBKx3XJN.mjs} +1 -1
  193. package/dist/utils/index.d.mts +239 -34
  194. package/dist/utils/index.mjs +13 -13
  195. package/dist/{utils-C7w_RVlx.mjs → utils--HE8R8sH.mjs} +761 -8
  196. package/dist/{validate-Brr4b_fH.mjs → validate-BUeE2MLR.mjs} +3 -3
  197. package/dist/{versioning-S18y2-0C.d.mts → versioning-B07RgD27.d.mts} +2 -13
  198. package/dist/{versioning-CE5kdWOY.mjs → versioning-qYgqwOhL.mjs} +4 -7
  199. package/dist/{workScope-A3XBpYTa.mjs → workScope-C-1QHNmV.mjs} +2 -2
  200. package/llms.txt +2 -2
  201. package/package.json +34 -34
  202. package/skills/arc/references/api-reference.md +2 -2
  203. package/skills/arc/references/auth-better-auth.md +1 -0
  204. package/skills/arc/references/events-outbox.md +7 -4
  205. package/skills/arc/references/events.md +2 -2
  206. package/skills/arc/references/production-api.md +4 -0
  207. package/skills/arc/references/production-boot.md +2 -0
  208. package/skills/arc/references/production-idempotency.md +1 -1
  209. package/skills/arc/references/production-realtime.md +28 -2
  210. package/skills/arc/references/validation.md +4 -0
  211. package/skills/arc/references/writes-hooks-errors.md +1 -0
  212. package/dist/schemaIR-A0IoD05P.mjs +0 -108
  213. package/dist/sseStream-qSa-F2Qm.mjs +0 -57
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { r as workSeedFromEvent, t as runWorkScope } from "./workScope-A3XBpYTa.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { r as workSeedFromEvent, t as runWorkScope } from "./workScope-C-1QHNmV.mjs";
3
3
  import { createEvent as createEvent$1, createEventRouter } from "@classytic/primitives/events";
4
4
  // src/events/EventTransport.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as buildRequestScopeProjection } from "./projection-CIUe8b59.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as buildRequestScopeProjection } from "./projection-DowJlIto.mjs";
3
3
  // src/hooks/HookSystem.ts
4
4
  /**
5
5
  * Hook System
@@ -34,9 +34,25 @@ type CacheResult<T> = {
34
34
  status: "fresh" | "stale";
35
35
  data: T;
36
36
  };
37
+ /** `QueryCache` options. */
38
+ interface QueryCacheOptions {
39
+ /**
40
+ * Called once per store outage (the first failed operation after a success) with the
41
+ * error and the operation. While the store fails, reads miss (the source answers), writes
42
+ * are skipped, and invalidations are remembered and replayed when it answers again.
43
+ */
44
+ onStoreError?: (err: unknown, operation: string) => void;
45
+ }
37
46
  declare class QueryCache {
38
47
  private readonly store;
39
- constructor(store: CacheStore);
48
+ private readonly onStoreError;
49
+ /** Entry deletes the store refused: read as a miss here until replayed. */
50
+ private readonly pendingDeletes;
51
+ /** Version keys whose bump the store refused: bumped once each when it answers again. */
52
+ private readonly pendingBumps;
53
+ private failing;
54
+ private flushing;
55
+ constructor(store: CacheStore, options?: QueryCacheOptions);
40
56
  get<T>(key: string): Promise<CacheResult<T>>;
41
57
  set<T>(key: string, data: T, config: QueryCacheConfig): Promise<void>;
42
58
  invalidate(key: string): Promise<void>;
@@ -48,6 +64,14 @@ declare class QueryCache {
48
64
  getTagVersion(tag: string): Promise<number>;
49
65
  /** Bump tag version — orphans all cached queries tagged with this tag */
50
66
  bumpTagVersion(tag: string): Promise<void>;
67
+ /** The store is failing, or holds invalidations it refused: reads go to the source. */
68
+ get degraded(): boolean;
69
+ /**
70
+ * A version the store cannot give is 0: entries are not read while it fails either, and
71
+ * a version bump it refused is replayed before any version is read again (`recovered`),
72
+ * so an entry cached before the outage is never served past an invalidation.
73
+ */
74
+ private readVersion;
51
75
  /**
52
76
  * Version-bump semantics:
53
77
  *
@@ -69,7 +93,18 @@ declare class QueryCache {
69
93
  * outlive that reset and entry TTLs are minutes-scale (staleTime +
70
94
  * gcTime). The read-modify-write fallback uses plain `set`, which
71
95
  * refreshes the TTL per bump — strictly longer-lived, equally safe.
96
+ *
97
+ * A bump the store refuses is remembered and replayed once it answers.
72
98
  */
73
99
  private bumpVersion;
100
+ private rawBump;
101
+ /**
102
+ * Replay refused invalidations before a read; `false` while the store still refuses a
103
+ * version bump (the caller then answers from the source). One replay at a time.
104
+ */
105
+ private recovered;
106
+ private flush;
107
+ private ok;
108
+ private failed;
74
109
  }
75
110
  export { QueryCacheConfig as a, QueryCache as i, CacheResult as n, CacheStatus as r, CacheEnvelope as t };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import "./constants-D-faL5SX.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import "./constants-DOnfMd7i.mjs";
3
3
  // src/registry/ResourceRegistry.ts
4
4
  /**
5
5
  * Resource Registry
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/idempotency/acquire.ts
3
3
  async function acquireIdempotencyKey(store, key, requestId, lockTtlMs) {
4
4
  if (typeof store.acquire === "function") return store.acquire(key, requestId, lockTtlMs);
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { d as UserBase } from "../base-HXNgPQww.mjs";
3
- import "../index-Cy2-QffW.mjs";
3
+ import "../index-DLCcLUQT.mjs";
4
4
  import { FastifyPluginAsync } from "fastify";
5
5
  import { RepositoryLike } from "@classytic/repo-core/adapter";
6
6
  type AuditAction = "create" | "update" | "delete" | "restore" | "custom";
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { g as getUserId, i as getClientId } from "../types-HFFSwF_K.mjs";
3
- import { t as transactionContext } from "../transactionContext-C1OgH-hW.mjs";
4
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-ClWr60El.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as transactionContext } from "../transactionContext-DBbSTfY3.mjs";
3
+ import { g as getUserId, i as getClientId } from "../types-CrOlZ4rY.mjs";
4
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-BQK-GrYe.mjs";
5
5
  import { and, anyOf, eq, gte, lt, lte } from "@classytic/repo-core/filter";
6
6
  import fp from "fastify-plugin";
7
7
  // src/audit/repository-audit-adapter.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/auth/audit.ts
3
3
  function compileGlobs(patterns) {
4
4
  if (patterns.length === 0) return () => false;
@@ -1,8 +1,8 @@
1
1
 
2
- import { i as RequestScope } from "../types-DnkIALZ8.mjs";
2
+ import { Mt as AuthHelpers, Nt as AuthPluginOptions } from "../index-DLCcLUQT.mjs";
3
3
  import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
4
- import { At as AuthHelpers, jt as AuthPluginOptions } from "../index-Cy2-QffW.mjs";
5
4
  import { t as ExternalOpenApiPaths } from "../externalPaths-BOqdq5wr.mjs";
5
+ import { i as RequestScope } from "../types-DnkIALZ8.mjs";
6
6
  import { a as SessionManagerOptions, c as createSessionManager, i as SessionData, n as MemorySessionStoreOptions, o as SessionManagerResult, r as SessionCookieOptions, s as SessionStore, t as MemorySessionStore } from "../sessionManager-CdvDF04x.mjs";
7
7
  import { FastifyPluginAsync, FastifyReply as FastifyReply$1, FastifyRequest } from "fastify";
8
8
  declare module "fastify" {
@@ -1,10 +1,10 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-DyY48oRi.mjs";
3
- import { n as requireSingleHeaderValue } from "../headers-CHSOqpcY.mjs";
4
- import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-N-k-8dNF.mjs";
5
- import { o as toJsonSchema } from "../schemaConverter-CIwB5wPO.mjs";
6
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-ClWr60El.mjs";
7
- import { E as requireOrgRole, T as requireOrgMembership, k as requireTeamMembership } from "../permissions-R9T2G1PH.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { n as getUserRoles, r as normalizeRoles } from "../userHelpers-CBKx3XJN.mjs";
3
+ import { d as createDomainError, l as UnauthorizedError, p as isArcError, t as ArcError } from "../errors-BpYV859Y.mjs";
4
+ import { E as requireOrgRole, T as requireOrgMembership, k as requireTeamMembership } from "../permissions-CFsmdYUt.mjs";
5
+ import { n as requireSingleHeaderValue } from "../headers-D4bncIOf.mjs";
6
+ import { o as toJsonSchema } from "../schemaConverter-cIh4oX9a.mjs";
7
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-BQK-GrYe.mjs";
8
8
  import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
9
9
  import { isProductionEnv } from "@classytic/primitives/environment";
10
10
  import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
@@ -608,19 +608,57 @@ function toFetchRequest(request) {
608
608
  *
609
609
  * Transfers status code, all response headers, and the body.
610
610
  * Handles both buffered (JSON) and streaming (SSE) responses.
611
+ *
612
+ * A buffered JSON error (status >= 400, body a plain object) gains arc's
613
+ * envelope fields when absent: `status` and `correlationId` (`request.id`),
614
+ * the same two the error handler stamps on arc's own refusals. Anything else
615
+ * is passed through byte-identical.
611
616
  */
612
- async function sendFetchResponse(response, reply) {
617
+ async function sendFetchResponse(response, reply, request) {
613
618
  reply.status(response.status);
619
+ const contentType = response.headers.get("content-type") ?? "";
620
+ const streamed = response.body !== null && (contentType.includes("text/event-stream") || contentType.includes("application/octet-stream"));
621
+ let body;
622
+ let rewritten = false;
623
+ if (!streamed) {
624
+ body = await response.text();
625
+ const enveloped = request ? withErrorEnvelope(body, response.status, contentType, request.id) : void 0;
626
+ if (enveloped !== void 0) {
627
+ body = enveloped;
628
+ rewritten = true;
629
+ }
630
+ }
614
631
  response.headers.forEach((value, key) => {
615
- if (key.toLowerCase() === "transfer-encoding") return;
632
+ const lower = key.toLowerCase();
633
+ if (lower === "transfer-encoding") return;
634
+ if (rewritten && lower === "content-length") return;
616
635
  reply.header(key, value);
617
636
  });
618
- const contentType = response.headers.get("content-type") ?? "";
619
- if (response.body && (contentType.includes("text/event-stream") || contentType.includes("application/octet-stream"))) await reply.send(response.body);
620
- else {
621
- const body = await response.text();
622
- await reply.send(body);
637
+ await reply.send(streamed ? response.body : body);
638
+ }
639
+ /**
640
+ * The enveloped JSON text for a Better Auth error body, or `undefined` to
641
+ * send the original bytes (not an error, not JSON, not a plain object, or
642
+ * nothing to add).
643
+ */
644
+ function withErrorEnvelope(text, status, contentType, correlationId) {
645
+ if (status < 400 || !contentType.toLowerCase().includes("json")) return void 0;
646
+ let parsed;
647
+ try {
648
+ parsed = JSON.parse(text);
649
+ } catch {
650
+ return;
623
651
  }
652
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return void 0;
653
+ const obj = parsed;
654
+ const addStatus = obj.status === void 0;
655
+ const addCorrelation = obj.correlationId === void 0 && correlationId !== void 0;
656
+ if (!addStatus && !addCorrelation) return void 0;
657
+ return JSON.stringify({
658
+ ...obj,
659
+ ...addStatus ? { status } : {},
660
+ ...addCorrelation ? { correlationId } : {}
661
+ });
624
662
  }
625
663
  /**
626
664
  * Resolve the current session via `auth.api.getSession`. Throws
@@ -914,7 +952,7 @@ function createBetterAuthAdapter(options) {
914
952
  fastify.all(`${normalizedBase}/*`, routeOpts, async (request, reply) => {
915
953
  try {
916
954
  const fetchRequest = toFetchRequest(request);
917
- await sendFetchResponse(await auth.handler(fetchRequest), reply);
955
+ await sendFetchResponse(await auth.handler(fetchRequest), reply, request);
918
956
  } catch (err) {
919
957
  throw new ArcError("Authentication service error", {
920
958
  code: ARC_ERROR_CODES.AUTH_SERVICE_ERROR,
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  import sjson from "secure-json-parse";
3
3
  // src/auth/redis-session.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as arcLog } from "./logger-VyMcSmVG.mjs";
3
- import { t as conjoinPolicyFilters } from "./filter-merge-8glLr7Dk.mjs";
4
- import { t as ArcError } from "./errors-DyY48oRi.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as arcLog } from "./logger-UbknHqHy.mjs";
3
+ import { t as ArcError } from "./errors-BpYV859Y.mjs";
4
+ import { t as conjoinPolicyFilters } from "./filter-merge-B1eJ1pMx.mjs";
5
5
  // src/permissions/authorizationDecision.ts
6
6
  const log = arcLog("permissions:enforce");
7
7
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/collections/boundedMap.ts
3
3
  /**
4
4
  * Insertion-order LRU on a plain `Map` — the two moves, written once.
@@ -1,7 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as conjoinPolicyFilters } from "./filter-merge-8glLr7Dk.mjs";
3
- import { D as toRepositoryFilter } from "./plugin-BJcVOX5r.mjs";
4
- import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-Brr4b_fH.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as conjoinPolicyFilters } from "./filter-merge-B1eJ1pMx.mjs";
3
+ import { D as toRepositoryFilter } from "./plugin-CrMPYbdj.mjs";
4
+ import { i as guessDate, t as coerceByType } from "./fieldTypes-EFWxCkZ5.mjs";
5
+ import { i as compileAggRequest, t as adapterSupportsAggregate } from "./validate-BUeE2MLR.mjs";
5
6
  // src/core/aggregation/buildHandler.ts
6
7
  /**
7
8
  * Framework-agnostic aggregation execution. Runs safety guards,
@@ -27,7 +28,11 @@ async function executeAggregation(normalized, deps, ctx) {
27
28
  status: 400,
28
29
  body: guardError
29
30
  };
30
- const callerFilter = conjoinPolicyFilters(extractCallerFilter(query), policyFilter);
31
+ const fieldTypes = config.fieldTypes || deps.fieldTypes ? {
32
+ ...deps.fieldTypes,
33
+ ...config.fieldTypes
34
+ } : void 0;
35
+ const callerFilter = conjoinPolicyFilters(extractCallerFilter(query, fieldTypes), policyFilter);
31
36
  const aggReq = compileAggRequest(normalized, callerFilter, tenantOptions, query);
32
37
  if (config.materialized) {
33
38
  const matCtx = {
@@ -225,20 +230,19 @@ function toOperandList(value) {
225
230
  if (typeof value === "string") return value.split(",").map((v) => v.trim()).filter((v) => v.length > 0);
226
231
  return [value];
227
232
  }
228
- const ISO_DATE_RE = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)?$/;
229
- function tryCoerceDate(v) {
230
- if (typeof v !== "string" || !ISO_DATE_RE.test(v)) return v;
231
- const d = new Date(v);
232
- return Number.isNaN(d.getTime()) ? v : d;
233
- }
234
233
  /**
235
234
  * Translate a qs-parsed nested-operator object (`{ field: { gte, lte } }`)
236
235
  * into Mongo-shape (`{ field: { $gte: Date, $lte: Date } }`). Only fires
237
236
  * when EVERY key is a known shorthand operator — leaves user-data
238
237
  * objects untouched so callers can still equality-match on a stored
239
238
  * sub-document.
239
+ *
240
+ * With a declared `type` for the field, comparison operands (`eq`, `ne`, ranges, each `in` /
241
+ * `nin` item) are coerced by that type (`coerceByType`). Without one, only range operands are
242
+ * touched, by the legacy ISO-date shape guess.
240
243
  */
241
- function expandShorthandOperators(value) {
244
+ function expandShorthandOperators(value, type) {
245
+ if (type && typeof value === "string") return coerceByType(value, type);
242
246
  if (!value || typeof value !== "object" || Array.isArray(value)) return value;
243
247
  const nested = value;
244
248
  const keys = Object.keys(nested);
@@ -248,8 +252,11 @@ function expandShorthandOperators(value) {
248
252
  for (const [op, opVal] of Object.entries(nested)) {
249
253
  const mongoOp = OPERATOR_SHORTHAND[op];
250
254
  if (!mongoOp) continue;
251
- if (SHORTHAND_RANGE_OPS.has(op)) expanded[mongoOp] = tryCoerceDate(opVal);
252
- else if (SHORTHAND_LIST_OPS.has(op)) expanded[mongoOp] = toOperandList(opVal);
255
+ if (SHORTHAND_RANGE_OPS.has(op)) expanded[mongoOp] = type ? coerceByType(opVal, type) : guessDate(opVal);
256
+ else if (SHORTHAND_LIST_OPS.has(op)) {
257
+ const list = toOperandList(opVal);
258
+ expanded[mongoOp] = type ? list.map((v) => coerceByType(v, type)) : list;
259
+ } else if (type && (op === "eq" || op === "ne")) expanded[mongoOp] = coerceByType(opVal, type);
253
260
  else expanded[mongoOp] = opVal;
254
261
  }
255
262
  return expanded;
@@ -265,7 +272,7 @@ function expandShorthandOperators(value) {
265
272
  * The resulting record is shallow-merged into the AggRequest filter
266
273
  * via `compileAggRequest`.
267
274
  */
268
- function extractCallerFilter(query) {
275
+ function extractCallerFilter(query, fieldTypes) {
269
276
  const out = {};
270
277
  const reserved = /* @__PURE__ */ new Set([
271
278
  "page",
@@ -282,7 +289,7 @@ function extractCallerFilter(query) {
282
289
  for (const [key, value] of Object.entries(query)) {
283
290
  if (reserved.has(key)) continue;
284
291
  if (value === void 0 || value === "") continue;
285
- out[key] = expandShorthandOperators(value);
292
+ out[key] = expandShorthandOperators(value, fieldTypes?.[key]);
286
293
  }
287
294
  return out;
288
295
  }
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { n as CacheStats, r as CacheStore, t as CacheLogger } from "../interface-WR1U0K7t.mjs";
3
- import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache-DdvrGG8Q.mjs";
4
- import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-DYQUyeJ9.mjs";
3
+ import { a as QueryCacheConfig, i as QueryCache, n as CacheResult, r as CacheStatus, t as CacheEnvelope } from "../QueryCache-BE47tmlO.mjs";
4
+ import { i as queryCachePlugin, n as QueryCacheDefaults, r as QueryCachePluginOptions, t as CrossResourceRule } from "../queryCachePlugin-DrQNnGws.mjs";
5
5
  import { n as UpstashKeyValueCommands, t as IoredisKeyValueCommands } from "../redisShapes-CqBXTn_s.mjs";
6
6
  /**
7
7
  * Cache Key Utilities
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys-CrMOZuk6.mjs";
3
- import { t as MemoryCacheStore } from "../memory-Lpfu8Hga.mjs";
4
- import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-B2jpwFcv.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { i as versionKey, n as hashParams, r as tagVersionKey, t as buildQueryKey } from "../keys--l9n7aOC.mjs";
3
+ import { t as MemoryCacheStore } from "../memory-C47xVsjX.mjs";
4
+ import { r as QueryCache, t as queryCachePlugin } from "../queryCachePlugin-BvB3k_Fh.mjs";
5
5
  // src/cache/redis.ts
6
6
  /**
7
7
  * Redis-backed cache store.
@@ -1,11 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-BdTN42uL.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-gKJR3o-6.mjs";
3
3
  import fp from "fastify-plugin";
4
4
  // src/plugins/caching.ts
5
- var caching_exports = /* @__PURE__ */ __exportAll({
6
- cachingPlugin: () => cachingPlugin,
7
- default: () => caching_default
8
- });
5
+ var caching_exports = /* @__PURE__ */ __exportAll({ default: () => caching_default });
9
6
  const FNV_OFFSET = 2166136261;
10
7
  const FNV_PRIME = 16777619;
11
8
  /** Fast non-cryptographic hash for ETag generation */
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/events/outbox/claimed.ts
3
3
  function claimedAttempts(claimed) {
4
4
  const value = claimed.attempts;
@@ -1,8 +1,8 @@
1
1
 
2
- import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
3
- import { A as RequestWithExtras } from "../index-Cy2-QffW.mjs";
4
2
  import { A as CleanupStepResult, B as VerificationResult, C as CleanupResult, D as CleanupRunStore, E as CleanupRunStatus, F as PurgeEvidence, I as PurgeResourceResult, L as PurgeStrategyKind, M as CleanupWriteFence, N as DEFAULT_CLEANUP_LIMITS, O as CleanupRunTransitionPatch, P as PurgeActor, R as PurgeVerificationSummary, S as CleanupRecipe, T as CleanupRunCreateResult, _ as CleanupPermissions, a as CleanupEvidenceStore, b as CleanupPlanItem, c as CleanupInput, d as CleanupLease, f as CleanupLimits, g as CleanupPermissionCheck, h as CleanupOutcomeStatus, i as CleanupContext, j as CleanupStepRunStatus, k as CleanupStepProgress, l as CleanupJob, m as CleanupManifest, n as CLEANUP_TERMINAL_STATUSES, o as CleanupExecutionContext, p as CleanupLogger, r as CleanupCancelRequest, s as CleanupFinalizationPayload, t as Availability, u as CleanupJobQueue, v as CleanupPlan, w as CleanupRun, x as CleanupProgressSummary, y as CleanupPlanDraft, z as VerificationCheck } from "../types-C0YJAiL0.mjs";
5
3
  import { n as ArcModule } from "../types-BeEJm-DV.mjs";
4
+ import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
5
+ import { A as RequestWithExtras } from "../index-DLCcLUQT.mjs";
6
6
  import { PurgeStrategyKind as PurgeStrategyKind$1 } from "@classytic/primitives/retention";
7
7
  import { CleanupStep } from "@classytic/repo-core/cleanup";
8
8
  /** Metadata + steps for {@link recipeFromSteps}. */
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { g as getUserId } from "../types-HFFSwF_K.mjs";
3
- import { t as defineResource } from "../defineResource-zYCrhNaN.mjs";
4
- import { t as defineModule } from "../module-BqPJpZ_L.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as defineResource } from "../defineResource-BAzNu5Um.mjs";
3
+ import { t as defineModule } from "../module-CWiqsXnh.mjs";
4
+ import { g as getUserId } from "../types-CrOlZ4rY.mjs";
5
5
  import { createPurgeEvidence } from "@classytic/primitives/retention";
6
6
  import { canonicalJson, sha256Hex } from "@classytic/primitives/canonical";
7
7
  // src/cleanup/errors.ts
@@ -1,5 +1,5 @@
1
1
 
2
- import { F as ResourceDefinition, X as RouteSchemaOptions, kt as RateLimitConfig } from "../../index-Cy2-QffW.mjs";
2
+ import { F as ResourceDefinition, X as RouteSchemaOptions, jt as RateLimitConfig } from "../../index-DLCcLUQT.mjs";
3
3
  export interface DescribedResource {
4
4
  name: string;
5
5
  displayName: string;
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as CRUD_OPERATIONS } from "../../constants-D-faL5SX.mjs";
3
- import { n as stringifyMeasureMap } from "../../ResourceRegistry-BcvEJoZd.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as CRUD_OPERATIONS } from "../../constants-DOnfMd7i.mjs";
3
+ import { n as stringifyMeasureMap } from "../../ResourceRegistry-CP-iTcKy.mjs";
4
4
  import { resolve } from "node:path";
5
5
  import { pathToFileURL } from "node:url";
6
6
  // src/cli/commands/describe.ts
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as buildOpenApiSpec } from "../../openapi-T90KrPR6.mjs";
3
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-D0naccV2.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as buildOpenApiSpec } from "../../openapi-D6MAbYpv.mjs";
3
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-ItNBIQ5w.mjs";
4
4
  import { dirname, resolve } from "node:path";
5
5
  import { mkdirSync, writeFileSync } from "node:fs";
6
6
  // src/cli/commands/docs.ts
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  import { dirname, join, parse, resolve } from "node:path";
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  // src/cli/commands/doctor.ts
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- export { t as generate } from "../../generate-BOfBueRt.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ export { t as generate } from "../../generate-Cr0ULavs.mjs";
@@ -1,2 +1,2 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- export { t as init } from "../../init-MoE3eZNR.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ export { t as init } from "../../init-C4a24wD2.mjs";
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-D0naccV2.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { t as loadResourcesFromEntry } from "../../loadResourcesFromEntry-ItNBIQ5w.mjs";
3
3
  // src/cli/commands/introspect.ts
4
4
  function describePermission(value) {
5
5
  if (!value) return "none";
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  import { describe } from "./commands/describe.mjs";
3
3
  import { exportDocs } from "./commands/docs.mjs";
4
4
  import { doctor } from "./commands/doctor.mjs";
5
- import { t as generate } from "../generate-BOfBueRt.mjs";
6
- import { t as init } from "../init-MoE3eZNR.mjs";
5
+ import { t as generate } from "../generate-Cr0ULavs.mjs";
6
+ import { t as init } from "../init-C4a24wD2.mjs";
7
7
  import { introspect } from "./commands/introspect.mjs";
8
8
  export { describe, doctor, exportDocs, generate, init, introspect };
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
2
  // src/constants.ts
3
3
  /**
4
4
  * Arc Framework Constants — Single Source of Truth
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { t as transactionContext } from "../transactionContext-C1OgH-hW.mjs";
3
- import { n as requestContext, t as getTraceHeaders } from "../requestContext-Ct5la-SA.mjs";
4
- import { n as evictToSize, r as touch } from "../boundedMap-o2KZDCWy.mjs";
5
- import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-A3XBpYTa.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { n as requestContext, t as getTraceHeaders } from "../requestContext-tUgLt9Ky.mjs";
3
+ import { n as evictToSize, r as touch } from "../boundedMap-C51EUUOm.mjs";
4
+ import { n as scopedValue, r as workSeedFromEvent, t as runWorkScope } from "../workScope-C-1QHNmV.mjs";
5
+ import { t as transactionContext } from "../transactionContext-DBbSTfY3.mjs";
6
6
  // src/context/requestScopedCache.ts
7
7
  /** The memo slot the per-scope store hangs off. */
8
8
  const SLOT = Symbol.for("arc.requestScopedCache");
@@ -1,4 +1,4 @@
1
1
 
2
- import { $t as AccessControl, An as MixinConstructor, Bt as TreeMixin, Dn as ControllerConfigurableOptions, En as BaseControllerOptions, F as ResourceDefinition, Gt as BaseCrudController, Ht as SlugMixin, It as BaseController, Jt as ActionTargetCheck, Kt as QueryResolver, Lt as SoftDeleteExt, Mn as BodySanitizerConfig, On as ControllerConstructionOptions, P as defineResource, Qt as getEntityQuery, Rt as SoftDeleteMixin, Ut as BulkExt, Vt as SlugExt, Wt as BulkMixin, Xt as getEntityId, Yt as getActionTarget, Zt as getEntityIdField, at as AggregationCacheConfig, ct as AggregationIndexHint, dt as AggregationRateLimit, en as AccessControlConfig, ft as AggregationsMap, it as AggMeasureShorthand, jn as BodySanitizer, kn as ListResult, lt as AggregationMaterializedContext, nn as FetchDenialReason, ot as AggregationConfig, qt as QueryResolverConfig, rn as FetchResult, rt as AggMeasureInput, st as AggregationDateRangeRequirement, tn as AccessControlRepository, ut as AggregationMaterializedResult, zt as TreeExt } from "../index-Cy2-QffW.mjs";
3
- import { $ as RESERVED_QUERY_PARAMS, A as DefineActionConfig, B as DEFAULT_SORT, C as VariantsMap, D as ResourceSeams, E as AdapterLike, F as CRUD_OPERATIONS, G as HOOK_PHASES, H as DEFAULT_UPDATE_METHOD, I as CrudOperation, J as MAX_FILTER_DEPTH, K as HookOperation, L as DEFAULT_ID_FIELD, M as createCrudRouter, N as createPermissionMiddleware, O as SeamedResourceConfig, P as defineAggregation, Q as MutationOperation, R as DEFAULT_LIMIT, S as VariantOverride, T as defineResourceVariants, U as DEFAULT_VERSION_FIELD, V as DEFAULT_TENANT_FIELD, W as HOOK_OPERATIONS, X as MAX_SEARCH_LENGTH, Y as MAX_REGEX_LENGTH, Z as MUTATION_OPERATIONS, _ as createFastifyHandler, a as formatValidationErrors, b as getControllerScope, c as RouteInputSlots, d as parsed, et as SYSTEM_FIELDS, f as routeInput, g as isFieldReadable, h as collectReadBlockedFields, i as assertValidConfig, j as defineAction, k as mergeResourceConfig, l as crudInput, m as nativePolicyFilter, n as ValidateOptions, o as validateResourceConfig, p as NativePolicyFilter, q as HookPhase, r as ValidationResult, s as InputSchema, t as ConfigError, u as noPayloadSchema, v as createRequestContext, w as VariantsResult, x as sendControllerResponse, y as getControllerContext, z as DEFAULT_MAX_LIMIT } from "../index-BxZS-8So.mjs";
4
- export { AccessControl, type AccessControlConfig, type AccessControlRepository, type ActionTargetCheck, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, DEFAULT_VERSION_FIELD, type DefineActionConfig, type FetchDenialReason, type FetchResult, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type InputSchema, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MixinConstructor, MutationOperation, type NativePolicyFilter, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, type RouteInputSlots, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, type VariantOverride, type VariantsMap, type VariantsResult, assertValidConfig, collectReadBlockedFields, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, crudInput, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getActionTarget, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, noPayloadSchema, parsed, routeInput, sendControllerResponse, validateResourceConfig };
2
+ import { $t as getEntityIdField, An as ControllerConstructionOptions, Bt as SoftDeleteMixin, F as ResourceDefinition, Gt as BulkExt, Ht as TreeMixin, Jt as QueryResolver, Kt as BulkMixin, Mn as MixinConstructor, Nn as BodySanitizer, On as BaseControllerOptions, P as defineResource, Pn as BodySanitizerConfig, Qt as getEntityId, Rt as BaseController, Ut as SlugExt, Vt as TreeExt, Wt as SlugMixin, Xt as ActionTargetCheck, Yt as QueryResolverConfig, Zt as getActionTarget, an as FetchResult, at as AggregationCacheConfig, ct as AggregationIndexHint, dt as AggregationRateLimit, en as getEntityQuery, ft as AggregationsMap, in as FetchDenialReason, it as AggMeasureShorthand, jn as ListResult, kn as ControllerConfigurableOptions, lt as AggregationMaterializedContext, mt as AggregationFieldTypes, nn as AccessControlConfig, ot as AggregationConfig, pt as AggregationFieldType, qt as BaseCrudController, rn as AccessControlRepository, rt as AggMeasureInput, st as AggregationDateRangeRequirement, tn as AccessControl, ut as AggregationMaterializedResult, zt as SoftDeleteExt } from "../index-DLCcLUQT.mjs";
3
+ import { $ as MAX_SEARCH_LENGTH, A as ResourceSeams, B as DEFAULT_ID_FIELD, C as getControllerScope, D as VariantsResult, E as VariantsMap, F as createCrudRouter, G as DEFAULT_UPDATE_METHOD, H as DEFAULT_MAX_LIMIT, I as createPermissionMiddleware, J as HOOK_PHASES, K as DEFAULT_VERSION_FIELD, L as defineAggregation, M as mergeResourceConfig, N as DefineActionConfig, O as defineResourceVariants, P as defineAction, Q as MAX_REGEX_LENGTH, R as CRUD_OPERATIONS, S as getControllerContext, T as VariantOverride, U as DEFAULT_SORT, V as DEFAULT_LIMIT, W as DEFAULT_TENANT_FIELD, X as HookPhase, Y as HookOperation, Z as MAX_FILTER_DEPTH, _ as nativePolicyFilter, a as formatValidationErrors, b as createFastifyHandler, c as InputSchema, d as RouteInputSlots, et as MUTATION_OPERATIONS, f as crudInput, g as NativePolicyFilter, h as routeInput, i as assertValidConfig, j as SeamedResourceConfig, k as AdapterLike, l as RouteInputIssue, m as parsed, n as ValidateOptions, nt as RESERVED_QUERY_PARAMS, o as validateResourceConfig, p as noPayloadSchema, q as HOOK_OPERATIONS, r as ValidationResult, rt as SYSTEM_FIELDS, s as CrudInput, t as ConfigError, tt as MutationOperation, u as RouteInputOptions, v as collectReadBlockedFields, w as sendControllerResponse, x as createRequestContext, y as isFieldReadable, z as CrudOperation } from "../index-DKM2p5w5.mjs";
4
+ export { AccessControl, type AccessControlConfig, type AccessControlRepository, type ActionTargetCheck, type AdapterLike, type AggMeasureInput, type AggMeasureShorthand, type AggregationCacheConfig, type AggregationConfig, type AggregationDateRangeRequirement, type AggregationFieldType, type AggregationFieldTypes, type AggregationIndexHint, type AggregationMaterializedContext, type AggregationMaterializedResult, type AggregationRateLimit, type AggregationsMap, BaseController, type BaseControllerOptions, BaseCrudController, BodySanitizer, type BodySanitizerConfig, type BulkExt, BulkMixin, CRUD_OPERATIONS, type ConfigError, type ControllerConfigurableOptions, type ControllerConstructionOptions, type CrudInput, CrudOperation, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, DEFAULT_VERSION_FIELD, type DefineActionConfig, type FetchDenialReason, type FetchResult, HOOK_OPERATIONS, HOOK_PHASES, HookOperation, HookPhase, type InputSchema, type ListResult, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, type MixinConstructor, MutationOperation, type NativePolicyFilter, QueryResolver, type QueryResolverConfig, RESERVED_QUERY_PARAMS, ResourceDefinition, type ResourceSeams, type RouteInputIssue, type RouteInputOptions, type RouteInputSlots, SYSTEM_FIELDS, type SeamedResourceConfig, type SlugExt, SlugMixin, type SoftDeleteExt, SoftDeleteMixin, type TreeExt, TreeMixin, type ValidateOptions, type ValidationResult, type VariantOverride, type VariantsMap, type VariantsResult, assertValidConfig, collectReadBlockedFields, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, crudInput, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getActionTarget, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, noPayloadSchema, parsed, routeInput, sendControllerResponse, validateResourceConfig };
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { a as DEFAULT_SORT, c as DEFAULT_VERSION_FIELD, d as MAX_FILTER_DEPTH, f as MAX_REGEX_LENGTH, g as SYSTEM_FIELDS, h as RESERVED_QUERY_PARAMS, i as DEFAULT_MAX_LIMIT, l as HOOK_OPERATIONS, m as MUTATION_OPERATIONS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MAX_SEARCH_LENGTH, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as HOOK_PHASES } from "../constants-D-faL5SX.mjs";
3
- import { E as nativePolicyFilter, T as AccessControl, _ as BaseCrudController, a as crudInput, b as isFieldReadable, c as routeInput, d as createPermissionMiddleware, f as BaseController, g as BulkMixin, h as SlugMixin, m as SoftDeleteMixin, o as noPayloadSchema, p as TreeMixin, s as parsed, u as createCrudRouter, v as QueryResolver, w as BodySanitizer, y as collectReadBlockedFields } from "../plugin-BJcVOX5r.mjs";
4
- import { t as defineAggregation } from "../defineAggregation-DH2L6_v9.mjs";
5
- import { C as sendControllerResponse, S as getControllerScope, b as createRequestContext, x as getControllerContext, y as createFastifyHandler } from "../actionPermissions-Dha8sAz2.mjs";
6
- import { a as defineResourceVariants, i as getEntityQuery, n as getEntityId, o as mergeResourceConfig, r as getEntityIdField, s as defineAction, t as getActionTarget } from "../core-NSu1peyq.mjs";
7
- import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, r as formatValidationErrors, t as defineResource } from "../defineResource-zYCrhNaN.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import { a as DEFAULT_SORT, c as DEFAULT_VERSION_FIELD, d as MAX_FILTER_DEPTH, f as MAX_REGEX_LENGTH, g as SYSTEM_FIELDS, h as RESERVED_QUERY_PARAMS, i as DEFAULT_MAX_LIMIT, l as HOOK_OPERATIONS, m as MUTATION_OPERATIONS, n as DEFAULT_ID_FIELD, o as DEFAULT_TENANT_FIELD, p as MAX_SEARCH_LENGTH, r as DEFAULT_LIMIT, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS, u as HOOK_PHASES } from "../constants-DOnfMd7i.mjs";
3
+ import { E as nativePolicyFilter, T as AccessControl, _ as BaseCrudController, a as crudInput, b as isFieldReadable, c as routeInput, d as createPermissionMiddleware, f as BaseController, g as BulkMixin, h as SlugMixin, m as SoftDeleteMixin, o as noPayloadSchema, p as TreeMixin, s as parsed, u as createCrudRouter, v as QueryResolver, w as BodySanitizer, y as collectReadBlockedFields } from "../plugin-CrMPYbdj.mjs";
4
+ import { t as defineAggregation } from "../defineAggregation-BI5pRb8c.mjs";
5
+ import { C as createFastifyHandler, D as sendControllerResponse, E as getControllerScope, T as getControllerContext, w as createRequestContext } from "../schemaIR-BsY4y9VP.mjs";
6
+ import { a as defineResourceVariants, i as getEntityQuery, n as getEntityId, o as mergeResourceConfig, r as getEntityIdField, s as defineAction, t as getActionTarget } from "../core-BoEdFDDw.mjs";
7
+ import { a as ResourceDefinition, i as validateResourceConfig, n as assertValidConfig, r as formatValidationErrors, t as defineResource } from "../defineResource-BAzNu5Um.mjs";
8
8
  export { AccessControl, BaseController, BaseCrudController, BodySanitizer, BulkMixin, CRUD_OPERATIONS, DEFAULT_ID_FIELD, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_SORT, DEFAULT_TENANT_FIELD, DEFAULT_UPDATE_METHOD, DEFAULT_VERSION_FIELD, HOOK_OPERATIONS, HOOK_PHASES, MAX_FILTER_DEPTH, MAX_REGEX_LENGTH, MAX_SEARCH_LENGTH, MUTATION_OPERATIONS, QueryResolver, RESERVED_QUERY_PARAMS, ResourceDefinition, SYSTEM_FIELDS, SlugMixin, SoftDeleteMixin, TreeMixin, assertValidConfig, collectReadBlockedFields, createCrudRouter, createFastifyHandler, createPermissionMiddleware, createRequestContext, crudInput, defineAction, defineAggregation, defineResource, defineResourceVariants, formatValidationErrors, getActionTarget, getControllerContext, getControllerScope, getEntityId, getEntityIdField, getEntityQuery, isFieldReadable, mergeResourceConfig, nativePolicyFilter, noPayloadSchema, parsed, routeInput, sendControllerResponse, validateResourceConfig };
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import "./constants-D-faL5SX.mjs";
3
- import { t as defineResource } from "./defineResource-zYCrhNaN.mjs";
1
+ /*! @classytic/arc v2.49.0 | MIT | https://classytic.com */
2
+ import "./constants-DOnfMd7i.mjs";
3
+ import { t as defineResource } from "./defineResource-BAzNu5Um.mjs";
4
4
  // src/core/defineAction.ts
5
5
  /**
6
6
  * Build an `ActionDefinition` with a typed handler. The literal schema