@classytic/arc 2.48.0 → 2.50.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-B18mcj_M.mjs} +2 -2
  2. package/dist/{HookSystem-B9x-Y_k7.mjs → HookSystem-FUBaLTRm.mjs} +2 -2
  3. package/dist/{QueryCache-DdvrGG8Q.d.mts → QueryCache-BE47tmlO.d.mts} +36 -1
  4. package/dist/{ResourceRegistry-BcvEJoZd.mjs → ResourceRegistry-C5NM07fZ.mjs} +2 -2
  5. package/dist/{acquire-D2yj6Zzl.mjs → acquire-MHCnbDtH.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-BD8K4jdQ.mjs} +4 -4
  13. package/dist/{boundedMap-o2KZDCWy.mjs → boundedMap-CuCwos_X.mjs} +1 -1
  14. package/dist/{buildHandler-G3k59KY2.mjs → buildHandler-BttjNkTM.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-CxUQLHfR.mjs} +3 -6
  18. package/dist/{claimed-D0A43wjT.mjs → claimed-CQ4ZpD8K.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-BZFsZwJh.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-DWA1-5IE.mjs} +3 -3
  34. package/dist/{createActionRouter-DTSVv1VK.mjs → createActionRouter-fP3l2xVF.mjs} +54 -18
  35. package/dist/{createAggregationRouter-zEasm-ax.mjs → createAggregationRouter-BJZeOmBa.mjs} +13 -11
  36. package/dist/{createApp-CjqhkX1x.mjs → createApp-Db9JRumw.mjs} +332 -40
  37. package/dist/{createMcpServer-hSFeqRUb.d.mts → createMcpServer-CS2KOVP6.d.mts} +1 -1
  38. package/dist/{defineAggregation-DH2L6_v9.mjs → defineAggregation-BskqRz8M.mjs} +1 -1
  39. package/dist/{defineResource-zYCrhNaN.mjs → defineResource-B2vTvKzW.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-XoY0C73T.mjs} +6 -9
  44. package/dist/encryption/index.mjs +3 -3
  45. package/dist/{errorHandler-3_3oN-Uc.mjs → errorHandler-BYI-JQMm.mjs} +4 -7
  46. package/dist/{errors-DyY48oRi.mjs → errors-3xaK0i9n.mjs} +1 -1
  47. package/dist/{eventPlugin-Co9sABCg.mjs → eventPlugin-CVQ9ddnL.mjs} +9 -13
  48. package/dist/{eventTypes-HmAFyJmJ.mjs → eventTypes-UPYg7gW1.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-CxRvCaaZ.mjs +80 -0
  58. package/dist/{fields-rfsl26Ov.mjs → fields-DLFcJiDe.mjs} +1 -1
  59. package/dist/{filter-merge-8glLr7Dk.mjs → filter-merge-Bvjk_8dV.mjs} +1 -1
  60. package/dist/{generate-BOfBueRt.mjs → generate-0OpCUjUv.mjs} +2 -2
  61. package/dist/{headers-CHSOqpcY.mjs → headers-BROW65-r.mjs} +2 -2
  62. package/dist/{health-ezwTHQh2.mjs → health-Cfh-kYI_.mjs} +1 -1
  63. package/dist/{health-DHvAIVmM.mjs → health-Cy6aOg1i.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-D7PQcvvL.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-C0oREwUc.mjs} +2 -2
  97. package/dist/{keys-CrMOZuk6.mjs → keys-CGlPoVSn.mjs} +1 -1
  98. package/dist/{loadResources-CVQvYUhN.mjs → loadResources-Oi47dogA.mjs} +3 -3
  99. package/dist/{loadResourcesFromEntry-D0naccV2.mjs → loadResourcesFromEntry-BW-LexBz.mjs} +2 -2
  100. package/dist/logger/index.mjs +2 -2
  101. package/dist/{logger-VyMcSmVG.mjs → logger-BagW7_YA.mjs} +1 -1
  102. package/dist/{mcpPlugin-DQACaqVu.mjs → mcpPlugin-C6-wFsOX.mjs} +29 -26
  103. package/dist/{memory-Lpfu8Hga.mjs → memory-Bl7kv6TS.mjs} +3 -3
  104. package/dist/{metrics-DjVj1sg5.mjs → metrics-CqnMJKrJ.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-lbEbHUfI.mjs} +1 -1
  109. package/dist/{multiTenant-KZj8j1uJ.d.mts → multiTenant-QtDzxx_K.d.mts} +1 -1
  110. package/dist/{multipartBody-BNgNv7r0.mjs → multipartBody-CqNezaB3.mjs} +1 -1
  111. package/dist/{observeSend-BKJHibJz.mjs → observeSend-BjilzlYl.mjs} +1 -1
  112. package/dist/{openapi-T90KrPR6.mjs → openapi-DXNbadgd.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-5Mnwcycy.d.mts → outbox-module-DzW6zwWJ.d.mts} +103 -10
  116. package/dist/{outbox-module-C874VgBr.mjs → outbox-module-k5rIszQ4.mjs} +197 -28
  117. package/dist/permissions/index.d.mts +2 -2
  118. package/dist/permissions/index.mjs +7 -7
  119. package/dist/{permissions-R9T2G1PH.mjs → permissions-BJylQopQ.mjs} +9 -9
  120. package/dist/{pipe-DzqbsZy-.mjs → pipe-D1cq8hET.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-iEgaS5_H.mjs} +1 -1
  124. package/dist/{plugin-BJcVOX5r.mjs → plugin-DsLr6L4O.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-CX4ZvwCa.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-D_suT4OY.mjs} +4 -4
  139. package/dist/{projection-CIUe8b59.mjs → projection-CmjGjFih.mjs} +2 -2
  140. package/dist/{purger.types-f83fTzGy.mjs → purger.types-CZwkTZ7B.mjs} +1 -1
  141. package/dist/{queryCachePlugin-B2jpwFcv.mjs → queryCachePlugin-BDOPEAmH.mjs} +114 -14
  142. package/dist/{queryCachePlugin-DYQUyeJ9.d.mts → queryCachePlugin-DrQNnGws.d.mts} +1 -1
  143. package/dist/{rateLimitKey-BWx-qep0.mjs → rateLimitKey-igF1x64n.mjs} +1 -1
  144. package/dist/{realtime-D2tqi3d2.mjs → realtime-Cq_ugiWw.mjs} +75 -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-DmF9Akvn.mjs} +2 -2
  148. package/dist/{relay-ZYvS4xyW.mjs → relay-DA89IhFt.mjs} +200 -99
  149. package/dist/{renewingLease-DT4yLb29.mjs → renewingLease-DBtGUt8T.mjs} +1 -1
  150. package/dist/{replyHelpers-BJFN5AW7.mjs → replyHelpers-CUbeUc5q.mjs} +2 -2
  151. package/dist/{requestContext-Ct5la-SA.mjs → requestContext-DO9Qv0gw.mjs} +1 -1
  152. package/dist/{requirement-CxDxjB6V.mjs → requirement-C3GaQmkR.mjs} +1 -1
  153. package/dist/{resourceRateLimit-DCWglD7V.d.mts → resourceRateLimit-BPiESPtG.d.mts} +4 -0
  154. package/dist/{resourceRateLimit-D1oH2obv.mjs → resourceRateLimit-KKn-sFhb.mjs} +19 -4
  155. package/dist/{rolldown-runtime-BdTN42uL.mjs → rolldown-runtime-Ck1Tj4Ax.mjs} +1 -1
  156. package/dist/{routeValidator-DclDl5WJ.mjs → routeValidator-BF7n34xV.mjs} +47 -5
  157. package/dist/{runtimeCapabilities-ClWr60El.mjs → runtimeCapabilities-D0A4kkrC.mjs} +1 -1
  158. package/dist/{schedules-gVkRcs-9.mjs → schedules-CLrQRSTt.mjs} +6 -9
  159. package/dist/{schemaConverter-CIwB5wPO.mjs → schemaConverter-JEmU21fu.mjs} +2 -2
  160. package/dist/{actionPermissions-Dha8sAz2.mjs → schemaIR-wOffQlbq.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-CcTMRd7s.mjs} +4 -4
  166. package/dist/{shutdown-Bi19vH0z.mjs → shutdown-BIR-QBYM.mjs} +1 -1
  167. package/dist/{simpleEqualityMatcher-CaCS09fh.mjs → simpleEqualityMatcher-DqqJqovq.mjs} +1 -1
  168. package/dist/{sse-BqM359f1.mjs → sse-OEuPpgss.mjs} +9 -35
  169. package/dist/sseStats-DQqNN385.d.mts +112 -0
  170. package/dist/sseStream-DknHE2K5.mjs +166 -0
  171. package/dist/{store-helpers-rx-F2ZGR.mjs → store-helpers-D4vtEXt2.mjs} +1 -1
  172. package/dist/{streaming-CPChx3A7.mjs → streaming-CcIpcx02.mjs} +1 -1
  173. package/dist/{subscriberIdentity-CYNYw8p_.mjs → subscriberIdentity-PO6kimAl.mjs} +1 -1
  174. package/dist/{tenancy-BoWImS3K.mjs → tenancy-CH2Kuksc.mjs} +2 -2
  175. package/dist/{tenantPreparation-oqKCZQZM.mjs → tenantPreparation-BTGpblQW.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-Dii5X7AP.mjs} +1 -1
  183. package/dist/{transactionContext-C1OgH-hW.mjs → transactionContext-DMPhYEOt.mjs} +1 -1
  184. package/dist/{typeGuards-DNlpASzd.mjs → typeGuards-C1o_XEyp.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-BuV_cFqT.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-D4m_pLSC.mjs} +1 -1
  193. package/dist/utils/index.d.mts +193 -34
  194. package/dist/utils/index.mjs +13 -13
  195. package/dist/{utils-C7w_RVlx.mjs → utils-CxLMXGn5.mjs} +761 -8
  196. package/dist/{validate-Brr4b_fH.mjs → validate-CZ975J8N.mjs} +3 -3
  197. package/dist/{versioning-S18y2-0C.d.mts → versioning-B07RgD27.d.mts} +2 -13
  198. package/dist/{versioning-CE5kdWOY.mjs → versioning-B2_8SBZo.mjs} +4 -7
  199. package/dist/{workScope-A3XBpYTa.mjs → workScope-B3W3r35s.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,23 +1,23 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { g as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-D-faL5SX.mjs";
3
- import { t as arcLog } from "./logger-VyMcSmVG.mjs";
4
- import { t as conjoinPolicyFilters } from "./filter-merge-8glLr7Dk.mjs";
5
- import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError, u as ValidationError } from "./errors-DyY48oRi.mjs";
6
- import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-CaCS09fh.mjs";
7
- import { n as requireSingleHeaderValue } from "./headers-CHSOqpcY.mjs";
8
- import { n as getUserRoles, t as getUserId } from "./userHelpers-N-k-8dNF.mjs";
9
- import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-HFFSwF_K.mjs";
10
- import { r as resolveTenancy } from "./tenancy-BoWImS3K.mjs";
11
- import { t as buildQueryKey } from "./keys-CrMOZuk6.mjs";
12
- import { t as transactionContext } from "./transactionContext-C1OgH-hW.mjs";
13
- import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-rfsl26Ov.mjs";
14
- import { E as ArcQueryParser, v as getDefaultCrudSchemas } from "./utils-C7w_RVlx.mjs";
15
- import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-CIwB5wPO.mjs";
16
- import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-CPChx3A7.mjs";
17
- import { _ as buildArcDecorator, a as resolveRouterPluginMw, b as createRequestContext, c as buildPipelineHandler, d as buildCrudPermissionMw, f as buildRouteHooks, h as buildAuthMiddleware, i as buildRouteConfig, l as resolvePipelineSteps, m as routeHookOptions, n as tryRegisterRoute, o as selectPluginMw, p as resolveRoutePreHandlers, r as buildRateLimitConfig, t as resolveActionPermission, v as createCrudHandlers, y as createFastifyHandler } from "./actionPermissions-Dha8sAz2.mjs";
18
- import { a as withoutTenantInjection } from "./tenantPreparation-oqKCZQZM.mjs";
19
- import { t as hasEvents } from "./typeGuards-DNlpASzd.mjs";
20
- import { n as idempotencyConfigProblem } from "./requirement-CxDxjB6V.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { g as SYSTEM_FIELDS, o as DEFAULT_TENANT_FIELD, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-BZFsZwJh.mjs";
3
+ import { t as arcLog } from "./logger-BagW7_YA.mjs";
4
+ import { t as conjoinPolicyFilters } from "./filter-merge-Bvjk_8dV.mjs";
5
+ import { d as createDomainError, f as createError, i as NotFoundError, p as isArcError, r as ForbiddenError, u as ValidationError } from "./errors-3xaK0i9n.mjs";
6
+ import { t as simpleEqualityMatcher } from "./simpleEqualityMatcher-DqqJqovq.mjs";
7
+ import { n as requireSingleHeaderValue } from "./headers-BROW65-r.mjs";
8
+ import { n as getUserRoles, t as getUserId } from "./userHelpers-D4m_pLSC.mjs";
9
+ import { b as isElevated, c as getOrgId, n as PUBLIC_SCOPE, x as isMember } from "./types-BuV_cFqT.mjs";
10
+ import { r as resolveTenancy } from "./tenancy-CH2Kuksc.mjs";
11
+ import { t as buildQueryKey } from "./keys-CGlPoVSn.mjs";
12
+ import { t as transactionContext } from "./transactionContext-DMPhYEOt.mjs";
13
+ import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-DLFcJiDe.mjs";
14
+ import { O as ArcQueryParser, b as getDefaultCrudSchemas } from "./utils-CxLMXGn5.mjs";
15
+ import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-JEmU21fu.mjs";
16
+ import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-CcIpcx02.mjs";
17
+ import { C as createFastifyHandler, S as createCrudHandlers, _ as resolveRoutePreHandlers, a as resolveActionPermission, c as buildRouteConfig, f as buildPipelineHandler, g as buildRouteHooks, h as buildCrudPermissionMw, l as resolveRouterPluginMw, n as normalizeSchemaIR, o as tryRegisterRoute, p as resolvePipelineSteps, s as buildRateLimitConfig, u as selectPluginMw, v as routeHookOptions, w as createRequestContext, x as buildArcDecorator, y as buildAuthMiddleware } from "./schemaIR-wOffQlbq.mjs";
18
+ import { a as withoutTenantInjection } from "./tenantPreparation-BTGpblQW.mjs";
19
+ import { t as hasEvents } from "./typeGuards-C1o_XEyp.mjs";
20
+ import { n as idempotencyConfigProblem } from "./requirement-C3GaQmkR.mjs";
21
21
  import { ARC_ERROR_CODES } from "@classytic/repo-core/errors";
22
22
  import { policyRecordToFilter } from "@classytic/repo-core/filter";
23
23
  import { retryingTransaction } from "@classytic/repo-core/repository";
@@ -1542,14 +1542,21 @@ var BaseCrudController = class {
1542
1542
  * `existing` is the document the request was AUTHORISED against — handed over
1543
1543
  * so the verb does not re-fetch and possibly observe a different document.
1544
1544
  * `id` is the REPOSITORY PRIMARY KEY (`resolveRepoId` output), never the route param.
1545
+ * `cas` (update only, from {@link expectedVersion}) becomes `expectedVersion` /
1546
+ * `expectedVersionSource` when the resource declares `concurrency` and the loaded
1547
+ * document has a numeric version.
1545
1548
  */
1546
- mutationWriteContext(req, id, existing, repo = this.repository, uow) {
1549
+ mutationWriteContext(req, id, existing, repo = this.repository, uow, cas) {
1547
1550
  return {
1548
1551
  req,
1549
1552
  repository: repo,
1550
1553
  id,
1551
1554
  existing,
1552
- ...uow !== void 0 ? { uow } : {}
1555
+ ...uow !== void 0 ? { uow } : {},
1556
+ ...cas?.version !== void 0 ? {
1557
+ expectedVersion: cas.version,
1558
+ expectedVersionSource: cas.fromClient ? "if-match" : "loaded"
1559
+ } : {}
1553
1560
  };
1554
1561
  }
1555
1562
  /**
@@ -1807,18 +1814,20 @@ var BaseCrudController = class {
1807
1814
  id,
1808
1815
  existing
1809
1816
  };
1810
- const cas = this._writes?.update ? { fromClient: false } : this.expectedVersion(req, existing);
1817
+ const cas = this.expectedVersion(req, existing);
1811
1818
  const item = await this.runHookedOpUntilResult(req, {
1812
1819
  op: "update",
1813
1820
  input: data,
1814
1821
  meta: hookMeta
1815
- }, async (processed) => this.runWritePersistence((repo, uow) => this._writes?.update ? this._writes.update(repoId, processed, this.mutationWriteContext(req, repoId, existing, repo, uow)) : repo.update(repoId, processed, {
1822
+ }, async (processed) => this.runWritePersistence((repo, uow) => this._writes?.update ? this._writes.update(repoId, processed, this.mutationWriteContext(req, repoId, existing, repo, uow, cas)) : repo.update(repoId, processed, {
1816
1823
  user,
1817
1824
  context: arcContext,
1818
1825
  ...this.tenantRepoOptions(req),
1819
1826
  ...cas.version !== void 0 ? { ifVersion: cas.version } : {}
1820
1827
  }))).catch((err) => {
1821
- if (cas.fromClient && err?.code === "version_conflict") throw createDomainError(ARC_ERROR_CODES.PRECONDITION_FAILED, "The resource changed since it was read — re-read and retry.", 412);
1828
+ const conflict = err;
1829
+ const onOtherDoc = this._writes?.update !== void 0 && conflict?.id !== void 0 && conflict.id !== null && String(conflict.id) !== String(repoId);
1830
+ if (cas.fromClient && conflict?.code === "version_conflict" && !onOtherDoc) throw createDomainError(ARC_ERROR_CODES.PRECONDITION_FAILED, "The resource changed since it was read — re-read and retry.", 412);
1822
1831
  throw err;
1823
1832
  });
1824
1833
  const resolved = this._writes?.update ? item ?? await this.repository.getById(repoId, {
@@ -2643,10 +2652,13 @@ function isParseable(schema) {
2643
2652
  return typeof schema === "object" && schema !== null && typeof schema.safeParse === "function";
2644
2653
  }
2645
2654
  /** Parse `value` with `schema`; zod issues become one `ValidationError` (400, `details[]`). */
2646
- function parseOrThrow(schema, value) {
2655
+ function parseOrThrow(schema, value, mapIssues) {
2647
2656
  const result = schema.safeParse(value);
2648
2657
  if (result.success) return result.data;
2649
- throw new ValidationError("Validation failed", (result.error?.issues ?? []).map((issue) => ({
2658
+ const issues = result.error?.issues ?? [];
2659
+ const mapped = mapIssues?.(issues);
2660
+ if (mapped) throw mapped;
2661
+ throw new ValidationError("Validation failed", issues.map((issue) => ({
2650
2662
  field: issue.path.map(String).join("."),
2651
2663
  message: issue.message
2652
2664
  })));
@@ -2655,7 +2667,8 @@ function parseOrThrow(schema, value) {
2655
2667
  * Spread into a route entry: `{ method, path, permissions, ...routeInput({ body }), handler }`.
2656
2668
  * `preHandler` is empty when no zod body/querystring/params slot is declared.
2657
2669
  */
2658
- function routeInput(slots) {
2670
+ function routeInput(slots, options = {}) {
2671
+ const { mapIssues } = options;
2659
2672
  const { body, querystring, params } = slots;
2660
2673
  const parseBody = isParseable(body) ? body : void 0;
2661
2674
  const parseQuery = isParseable(querystring) ? querystring : void 0;
@@ -2665,9 +2678,9 @@ function routeInput(slots) {
2665
2678
  preHandler: []
2666
2679
  };
2667
2680
  const parse = async (request) => {
2668
- if (parseParams) request.params = parseOrThrow(parseParams, request.params ?? {});
2669
- if (parseQuery) request.query = parseOrThrow(parseQuery, request.query ?? {});
2670
- if (parseBody) request.body = parseOrThrow(parseBody, request.body ?? {});
2681
+ if (parseParams) request.params = parseOrThrow(parseParams, request.params ?? {}, mapIssues);
2682
+ if (parseQuery) request.query = parseOrThrow(parseQuery, request.query ?? {}, mapIssues);
2683
+ if (parseBody) request.body = parseOrThrow(parseBody, request.body ?? {}, mapIssues);
2671
2684
  };
2672
2685
  return {
2673
2686
  schema: slots,
@@ -2700,30 +2713,56 @@ const noPayloadSchema = Object.freeze({
2700
2713
  function crudInput(input) {
2701
2714
  const { create, update } = input;
2702
2715
  const parseBody = (schema) => input.parse && isParseable(schema) ? [(async (request) => {
2703
- request.body = parseOrThrow(schema, request.body ?? {});
2716
+ request.body = parseOrThrow(schema, request.body ?? {}, input.mapIssues);
2704
2717
  })] : [];
2718
+ const customSchemas = {};
2719
+ const openApiSchemas = {};
2720
+ const middlewares = {};
2721
+ if (create) {
2722
+ customSchemas.create = { body: create };
2723
+ openApiSchemas.createBody = create;
2724
+ if (input.parse) middlewares.create = parseBody(create);
2725
+ }
2726
+ if (update) {
2727
+ customSchemas.update = { body: update };
2728
+ openApiSchemas.updateBody = update;
2729
+ if (input.parse) middlewares.update = parseBody(update);
2730
+ }
2705
2731
  return {
2706
- customSchemas: {
2707
- ...create ? { create: { body: create } } : {},
2708
- ...update ? { update: { body: update } } : {}
2709
- },
2710
- openApiSchemas: {
2711
- ...create ? { createBody: create } : {},
2712
- ...update ? { updateBody: update } : {}
2713
- },
2714
- middlewares: {
2715
- ...create && input.parse ? { create: parseBody(create) } : {},
2716
- ...update && input.parse ? { update: parseBody(update) } : {}
2717
- }
2732
+ customSchemas,
2733
+ openApiSchemas,
2734
+ middlewares
2718
2735
  };
2719
2736
  }
2737
+ /** True when the schema's object shape declares an `action` property. */
2738
+ function declaresAction(schema) {
2739
+ try {
2740
+ return "action" in normalizeSchemaIR(schema).properties;
2741
+ } catch {
2742
+ return false;
2743
+ }
2744
+ }
2720
2745
  /**
2721
2746
  * Wrap an action handler so `data` is the zod schema's OUTPUT. Used by `ActionDefinition.parse`
2722
2747
  * and `defineAction({ parse: true })`; a non-zod schema returns the handler unchanged.
2748
+ *
2749
+ * `data` never carries the `action` discriminator (arc owns it). A schema that DECLARES `action`
2750
+ * (`z.strictObject({ action: z.literal('issue'), ... })`, a contracts discriminated-union branch)
2751
+ * is parsed with `action: actionName` put back, so strictness and refinements that read it hold;
2752
+ * the handler still gets the output without `action`.
2723
2753
  */
2724
- function withParsedInput(handler, schema) {
2754
+ function withParsedInput(handler, schema, actionName) {
2725
2755
  if (!isParseable(schema)) return handler;
2726
- return (id, data, req) => handler(id, parseOrThrow(schema, data), req);
2756
+ if (actionName === void 0 || !declaresAction(schema)) return (id, data, req) => handler(id, parseOrThrow(schema, data), req);
2757
+ return (id, data, req) => {
2758
+ const out = parseOrThrow(schema, {
2759
+ ...data,
2760
+ action: actionName
2761
+ });
2762
+ if (out === null || typeof out !== "object" || Array.isArray(out)) return handler(id, out, req);
2763
+ const { action: _owned, ...rest } = out;
2764
+ return handler(id, rest, req);
2765
+ };
2727
2766
  }
2728
2767
  // src/core/defineResource/schemas.ts
2729
2768
  /**
@@ -3041,7 +3080,7 @@ function normalizeActionsToRouterConfig(actions, resourceActionPermissions, tag,
3041
3080
  if (typeof entry === "function") handlers[name] = entry;
3042
3081
  else {
3043
3082
  const def = entry;
3044
- handlers[name] = def.parse ? withParsedInput(def.handler, def.schema) : def.handler;
3083
+ handlers[name] = def.parse ? withParsedInput(def.handler, def.schema, name) : def.handler;
3045
3084
  if (def.schema) schemas[name] = def.schema;
3046
3085
  if (def.id === false) idLessActionNames.push(name);
3047
3086
  if (def.idempotency?.required === true) idempotentActionNames.push(name);
@@ -3177,7 +3216,7 @@ function buildResourcePlugin(resource) {
3177
3216
  extensions: resource.extensions
3178
3217
  });
3179
3218
  if (resource.actions && Object.keys(resource.actions).length > 0) {
3180
- const { createActionRouter } = await import("./createActionRouter-DTSVv1VK.mjs").then((n) => n.n);
3219
+ const { createActionRouter } = await import("./createActionRouter-fP3l2xVF.mjs").then((n) => n.n);
3181
3220
  const actionConfig = normalizeActionsToRouterConfig(resource.actions, resource.actionPermissions, resource.tag, resource.permissions, resource.name, typedInstance.log);
3182
3221
  const actionTarget = resolveActionTargetFence(resource, actionConfig);
3183
3222
  createActionRouter(typedInstance, {
@@ -3197,7 +3236,11 @@ function buildResourcePlugin(resource) {
3197
3236
  });
3198
3237
  }
3199
3238
  if (resource.aggregations && Object.keys(resource.aggregations).length > 0) {
3200
- const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-zEasm-ax.mjs"), import("./validate-Brr4b_fH.mjs").then((n) => n.r)]);
3239
+ const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }, { fieldTypesFromOpenApiSchemas }] = await Promise.all([
3240
+ import("./createAggregationRouter-BJZeOmBa.mjs"),
3241
+ import("./validate-CZ975J8N.mjs").then((n) => n.r),
3242
+ import("./fieldTypes-CxRvCaaZ.mjs").then((n) => n.r)
3243
+ ]);
3201
3244
  const repoForAgg = resource.controller?.repository ?? resource.repository;
3202
3245
  if (!adapterSupportsAggregate(repoForAgg)) {
3203
3246
  const undispatchable = Object.entries(resource.aggregations).filter(([, cfg]) => !cfg.materialized).map(([name]) => name);
@@ -3219,7 +3262,8 @@ function buildResourcePlugin(resource) {
3219
3262
  routeGuards: resource.routeGuards,
3220
3263
  repository: repoForAgg,
3221
3264
  buildOptions,
3222
- middlewares: resource.middlewares?.aggregations
3265
+ middlewares: resource.middlewares?.aggregations,
3266
+ fieldTypes: fieldTypesFromOpenApiSchemas(resource._registryMeta?.openApiSchemas)
3223
3267
  });
3224
3268
  }
3225
3269
  if (resource.events && Object.keys(resource.events).length > 0) typedInstance.log?.debug?.(`Resource '${resource.name}' defined ${Object.keys(resource.events).length} events`);
@@ -1,10 +1,11 @@
1
1
 
2
2
  import { t as AnyRecord } from "../base-HXNgPQww.mjs";
3
- import { Et as RouteDefinition, J as MiddlewareConfig, U as PresetHook, X as RouteSchemaOptions } from "../index-Cy2-QffW.mjs";
4
- import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler-B9r88jZV.mjs";
3
+ import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-baQc3MaO.mjs";
4
+ import { i as registerSseStats, n as SseConnectionGauge, r as createSseConnectionGauge, t as SSEStats } from "../sseStats-DQqNN385.mjs";
5
+ import { _ as _default$2, a as MetricsOptions, c as RealtimeOptions, d as _default$9, f as CachingOptions, g as ShutdownState, h as GracefulShutdownOptions, i as MetricsCollector, l as _default$6, m as _default$1, n as _default$10, o as _default$4, p as CachingRule, r as MetricEntry, s as ChangeOperation, t as VersioningOptions, u as SSEOptions } from "../versioning-B07RgD27.mjs";
6
+ import { J as MiddlewareConfig, Ot as RouteDefinition, U as PresetHook, X as RouteSchemaOptions } from "../index-DLCcLUQT.mjs";
5
7
  import { A as DailyLedger, C as ScheduleStats, D as DailyClock, E as DailyClaimInfo, F as HealthCheck, I as HealthOptions, L as _default$3, M as MemoryDailyLedger, N as createDailyGate, O as DailyGate, P as createMemoryDailyLedger, S as ScheduleRunContext, T as _default$8, b as DailyScheduleOptions, j as DailyRunOutcome, k as DailyGateOptions, w as SchedulesPluginOptions, x as ScheduleDefinition } from "../types-BeEJm-DV.mjs";
6
- import { i as _default, n as ArcCorePluginOptions, r as PluginMeta, t as ArcCore } from "../fastify-augmentation-bzkWPt1f.mjs";
7
- import { _ as ShutdownState, a as MetricsOptions, c as RealtimeOptions, d as SSEStats, f as _default$9, g as GracefulShutdownOptions, h as _default$1, i as MetricsCollector, l as _default$6, m as CachingRule, n as _default$10, o as _default$4, p as CachingOptions, r as MetricEntry, s as ChangeOperation, t as VersioningOptions, u as SSEOptions, v as _default$2 } from "../versioning-S18y2-0C.mjs";
8
+ import { i as errorHandlerPlugin, n as ErrorMapper, r as defaultIsDuplicateKeyError, t as ErrorHandlerOptions } from "../errorHandler-B9r88jZV.mjs";
8
9
  import { t as TracingOptions } from "../tracing-JSFiBl5r.mjs";
9
10
  import { PaginatedResult } from "@classytic/repo-core/pagination";
10
11
  import { FastifyInstance, FastifyPluginAsync } from "fastify";
@@ -218,4 +219,4 @@ export declare function createRequestIdGenerator(opts?: Pick<RequestIdOptions, "
218
219
  headers: Record<string, string | string[] | undefined>;
219
220
  }) => string;
220
221
  declare const _default$7: FastifyPluginAsync<RequestIdOptions>;
221
- export { type ArcCore, type ArcCorePluginOptions, type ArcPlugin, type CachingOptions, type CachingRule, type ChangeOperation, type CreatePluginDefinition, type DailyClaimInfo, type DailyClock, type DailyGate, type DailyGateOptions, type DailyLedger, type DailyRunOutcome, type DailyScheduleOptions, type ErrorHandlerOptions, type ErrorMapper, type GracefulShutdownOptions, type HealthCheck, type HealthOptions, type MemoryDailyLedger, type MetricEntry, type MetricsCollector, type MetricsOptions, type PluginMeta, type PluginResourceResult, type PressureApi, type PressureOptions, type PressureSignal, type PressureSnapshot, type PressureState, type PressureThresholds, type RealtimeOptions, type RequestIdOptions, type SSEOptions, type SSEStats, type ScheduleDefinition, type ScheduleRunContext, type ScheduleStats, type SchedulesPluginOptions, type ShutdownState, type TracingOptions, type VersioningOptions, _default as arcCorePlugin, _default$1 as cachingPlugin, createDailyGate, createMemoryDailyLedger, defaultIsDuplicateKeyError, errorHandlerPlugin, _default$2 as gracefulShutdownPlugin, _default$3 as healthPlugin, _default$4 as metricsPlugin, _default$5 as pressurePlugin, _default$6 as realtimePlugin, _default$7 as requestIdPlugin, _default$8 as schedulesPlugin, _default$9 as ssePlugin, _default$10 as versioningPlugin };
222
+ export { type ArcCore, type ArcCorePluginOptions, type ArcPlugin, type CachingOptions, type CachingRule, type ChangeOperation, type CreatePluginDefinition, type DailyClaimInfo, type DailyClock, type DailyGate, type DailyGateOptions, type DailyLedger, type DailyRunOutcome, type DailyScheduleOptions, type ErrorHandlerOptions, type ErrorMapper, type GracefulShutdownOptions, type HealthCheck, type HealthOptions, type MemoryDailyLedger, type MetricEntry, type MetricsCollector, type MetricsOptions, type PluginMeta, type PluginResourceResult, type PressureApi, type PressureOptions, type PressureSignal, type PressureSnapshot, type PressureState, type PressureThresholds, type RealtimeOptions, type RequestIdOptions, type SSEOptions, type SSEStats, type ScheduleDefinition, type ScheduleRunContext, type ScheduleStats, type SchedulesPluginOptions, type ShutdownState, type SseConnectionGauge, type TracingOptions, type VersioningOptions, _default as arcCorePlugin, _default$1 as cachingPlugin, createDailyGate, createMemoryDailyLedger, createSseConnectionGauge, defaultIsDuplicateKeyError, errorHandlerPlugin, _default$2 as gracefulShutdownPlugin, _default$3 as healthPlugin, _default$4 as metricsPlugin, _default$5 as pressurePlugin, _default$6 as realtimePlugin, registerSseStats, _default$7 as requestIdPlugin, _default$8 as schedulesPlugin, _default$9 as ssePlugin, _default$10 as versioningPlugin };
@@ -1,20 +1,21 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { m as MUTATION_OPERATIONS } from "../constants-D-faL5SX.mjs";
3
- import { t as arcLog } from "../logger-VyMcSmVG.mjs";
4
- import { c as getOrgId } from "../types-HFFSwF_K.mjs";
5
- import { n as requestContext } from "../requestContext-Ct5la-SA.mjs";
6
- import { t as hasEvents } from "../typeGuards-DNlpASzd.mjs";
7
- import { t as HookSystem } from "../HookSystem-B9x-Y_k7.mjs";
8
- import { t as ResourceRegistry } from "../ResourceRegistry-BcvEJoZd.mjs";
9
- import { c as createRequestIdGenerator, l as requestId_default, n as health_default, u as sanitizeRequestId } from "../health-ezwTHQh2.mjs";
10
- import { t as caching_default } from "../caching-CJIDPZOv.mjs";
11
- import { i as createMemoryDailyLedger, r as createDailyGate, t as schedules_default } from "../schedules-gVkRcs-9.mjs";
12
- import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-3_3oN-Uc.mjs";
13
- import { t as metrics_default } from "../metrics-DjVj1sg5.mjs";
14
- import { t as realtime_default } from "../realtime-D2tqi3d2.mjs";
15
- import { t as replyHelpersPlugin } from "../replyHelpers-BJFN5AW7.mjs";
16
- import { t as sse_default } from "../sse-BqM359f1.mjs";
17
- import { t as versioning_default } from "../versioning-CE5kdWOY.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { m as MUTATION_OPERATIONS } from "../constants-BZFsZwJh.mjs";
3
+ import { n as requestContext } from "../requestContext-DO9Qv0gw.mjs";
4
+ import { t as HookSystem } from "../HookSystem-FUBaLTRm.mjs";
5
+ import { t as ResourceRegistry } from "../ResourceRegistry-C5NM07fZ.mjs";
6
+ import { c as getOrgId } from "../types-BuV_cFqT.mjs";
7
+ import { t as hasEvents } from "../typeGuards-C1o_XEyp.mjs";
8
+ import { a as registerSseStats, i as createSseConnectionGauge } from "../sseStream-DknHE2K5.mjs";
9
+ import { t as caching_default } from "../caching-CxUQLHfR.mjs";
10
+ import { i as createMemoryDailyLedger, r as createDailyGate, t as schedules_default } from "../schedules-CLrQRSTt.mjs";
11
+ import { n as errorHandlerPlugin, t as defaultIsDuplicateKeyError } from "../errorHandler-BYI-JQMm.mjs";
12
+ import { c as createRequestIdGenerator, l as requestId_default, n as health_default, u as sanitizeRequestId } from "../health-Cfh-kYI_.mjs";
13
+ import { t as metrics_default } from "../metrics-CqnMJKrJ.mjs";
14
+ import { t as arcLog } from "../logger-BagW7_YA.mjs";
15
+ import { t as realtime_default } from "../realtime-Cq_ugiWw.mjs";
16
+ import { t as replyHelpersPlugin } from "../replyHelpers-CUbeUc5q.mjs";
17
+ import { t as sse_default } from "../sse-OEuPpgss.mjs";
18
+ import { t as versioning_default } from "../versioning-B2_8SBZo.mjs";
18
19
  import fp from "fastify-plugin";
19
20
  import { performance as performance$1 } from "node:perf_hooks";
20
21
  // src/core/arcCorePlugin.ts
@@ -386,4 +387,4 @@ var pressure_default = fp(pressurePlugin, {
386
387
  name: "arc-pressure",
387
388
  fastify: "5.x"
388
389
  });
389
- export { arcCorePlugin_default as arcCorePlugin, caching_default as cachingPlugin, createDailyGate, createMemoryDailyLedger, createPlugin, createRequestIdGenerator, defaultIsDuplicateKeyError, errorHandlerPlugin, gracefulShutdown_default as gracefulShutdownPlugin, health_default as healthPlugin, metrics_default as metricsPlugin, pressure_default as pressurePlugin, realtime_default as realtimePlugin, replyHelpersPlugin, requestId_default as requestIdPlugin, sanitizeRequestId, schedules_default as schedulesPlugin, sse_default as ssePlugin, versioning_default as versioningPlugin };
390
+ export { arcCorePlugin_default as arcCorePlugin, caching_default as cachingPlugin, createDailyGate, createMemoryDailyLedger, createPlugin, createRequestIdGenerator, createSseConnectionGauge, defaultIsDuplicateKeyError, errorHandlerPlugin, gracefulShutdown_default as gracefulShutdownPlugin, health_default as healthPlugin, metrics_default as metricsPlugin, pressure_default as pressurePlugin, realtime_default as realtimePlugin, registerSseStats, replyHelpersPlugin, requestId_default as requestIdPlugin, sanitizeRequestId, schedules_default as schedulesPlugin, sse_default as ssePlugin, versioning_default as versioningPlugin };
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { n as declareRuntimeCapability } from "../runtimeCapabilities-ClWr60El.mjs";
3
- import { t as hasEvents } from "../typeGuards-DNlpASzd.mjs";
4
- import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-o2KZDCWy.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { n as evictToSize, r as touch, t as assertCapacity } from "../boundedMap-CuCwos_X.mjs";
3
+ import { n as declareRuntimeCapability } from "../runtimeCapabilities-D0A4kkrC.mjs";
4
+ import { t as hasEvents } from "../typeGuards-C1o_XEyp.mjs";
5
5
  import fp from "fastify-plugin";
6
6
  // src/plugins/response-cache.ts
7
7
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
2
  import { createRequire } from "node:module";
3
3
  import fp from "fastify-plugin";
4
4
  // src/plugins/tracing.ts
@@ -59,7 +59,7 @@ try {
59
59
  function createTracerProvider(options) {
60
60
  if (!isAvailable || !NodeTracerProvider || !BatchSpanProcessor || !OTLPTraceExporter) return null;
61
61
  const { serviceName = "@classytic/arc", serviceVersion, exporterUrl = "http://localhost:4318/v1/traces" } = options;
62
- const resolvedVersion = serviceVersion ?? "2.48.0";
62
+ const resolvedVersion = serviceVersion ?? "2.50.0";
63
63
  const exporter = new OTLPTraceExporter({ url: exporterUrl });
64
64
  const provider = new NodeTracerProvider({ resource: { attributes: {
65
65
  "service.name": serviceName,
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
2
  // src/utils/pluralize.ts
3
3
  /**
4
4
  * Lightweight English pluralization for the Arc CLI.
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { i as RequestScope } from "../types-DnkIALZ8.mjs";
3
3
  import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
4
- import { W as PresetResult } from "../index-Cy2-QffW.mjs";
4
+ import { W as PresetResult } from "../index-DLCcLUQT.mjs";
5
5
  import { a as StorageReadResult, i as StorageReadRange, n as StorageContext, o as StorageUploadInput, r as StorageFile, t as Storage } from "../storage-odC5MNKN.mjs";
6
6
  export interface FilesUploadPresetRoutes {
7
7
  upload?: boolean;
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { i as NotFoundError, u as ValidationError } from "../errors-DyY48oRi.mjs";
3
- import { c as getOrgId, g as getUserId } from "../types-HFFSwF_K.mjs";
4
- import { B as requireAuth, F as allowPublic } from "../permissions-R9T2G1PH.mjs";
5
- import { t as multipartBody } from "../multipartBody-BNgNv7r0.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { t as multipartBody } from "../multipartBody-CqNezaB3.mjs";
3
+ import { B as requireAuth, F as allowPublic } from "../permissions-BJylQopQ.mjs";
4
+ import { c as getOrgId, g as getUserId } from "../types-BuV_cFqT.mjs";
5
+ import { i as NotFoundError, u as ValidationError } from "../errors-3xaK0i9n.mjs";
6
6
  // src/presets/filesUpload.ts
7
7
  const DEFAULT_FIELD_NAME = "file";
8
8
  const DEFAULT_MAX_FILE_SIZE = 10485760;
@@ -1,8 +1,8 @@
1
1
 
2
2
  import { t as AnyRecord } from "../base-HXNgPQww.mjs";
3
- import { Hn as IRequestContext, L as ResourceConfig, Vn as IControllerResponse, W as PresetResult, i as PaginationResult } from "../index-Cy2-QffW.mjs";
3
+ import { L as ResourceConfig, Un as IControllerResponse, W as PresetResult, Wn as IRequestContext, i as PaginationResult } from "../index-DLCcLUQT.mjs";
4
4
  import { FilesUploadPresetOptions, FilesUploadPresetPermissions, FilesUploadPresetRoutes, filesUploadPreset } from "./filesUpload.mjs";
5
- import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-KZj8j1uJ.mjs";
5
+ import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-QtDzxx_K.mjs";
6
6
  import { SearchHandler, SearchPresetOptions, SearchRouteConfig, searchPreset } from "./search.mjs";
7
7
  interface AuditedPresetOptions {
8
8
  /** Field name for creator (default: 'createdBy') */
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { a as treePreset, c as ownedByUserPreset, i as registerPreset, l as bulkPreset, n as getAvailablePresets, o as softDeletePreset, r as getPreset, s as slugLookupPreset, t as applyPresets, u as auditedPreset } from "../presets-CNDvNYsz.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { a as treePreset, c as ownedByUserPreset, i as registerPreset, l as bulkPreset, n as getAvailablePresets, o as softDeletePreset, r as getPreset, s as slugLookupPreset, t as applyPresets, u as auditedPreset } from "../presets-D_suT4OY.mjs";
3
3
  import { filesUploadPreset } from "./filesUpload.mjs";
4
4
  import { multiTenantPreset } from "./multiTenant.mjs";
5
5
  import { searchPreset } from "./search.mjs";
@@ -1,3 +1,3 @@
1
1
 
2
- import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-KZj8j1uJ.mjs";
2
+ import { n as multiTenantPreset, r as TenantFieldSpec, t as MultiTenantOptions } from "../multiTenant-QtDzxx_K.mjs";
3
3
  export { MultiTenantOptions, type TenantFieldSpec, multiTenantPreset };
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import "../constants-D-faL5SX.mjs";
3
- import { t as ArcError } from "../errors-DyY48oRi.mjs";
4
- import { u as getRequestScope } from "../types-HFFSwF_K.mjs";
5
- import { i as tagTenantPreparation, t as applyTenantPreparation } from "../tenantPreparation-oqKCZQZM.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import "../constants-BZFsZwJh.mjs";
3
+ import { i as tagTenantPreparation, t as applyTenantPreparation } from "../tenantPreparation-BTGpblQW.mjs";
4
+ import { u as getRequestScope } from "../types-BuV_cFqT.mjs";
5
+ import { t as ArcError } from "../errors-3xaK0i9n.mjs";
6
6
  // src/presets/multiTenant.ts
7
7
  function createTenantMiddleware(specs, mode) {
8
8
  const preparation = {
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { l as PermissionCheck } from "../base-HXNgPQww.mjs";
3
- import { Dt as RouteMcpConfig, Et as RouteDefinition, Ln as ControllerHandler, W as PresetResult } from "../index-Cy2-QffW.mjs";
3
+ import { Ot as RouteDefinition, W as PresetResult, kt as RouteMcpConfig, zn as ControllerHandler } from "../index-DLCcLUQT.mjs";
4
4
  /**
5
5
  * Search Preset — backend-agnostic search / vector / embed routes
6
6
  *
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { B as requireAuth, F as allowPublic } from "../permissions-R9T2G1PH.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { B as requireAuth, F as allowPublic } from "../permissions-BJylQopQ.mjs";
3
3
  // src/presets/search.ts
4
4
  const BUILTINS = [
5
5
  {
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { l as UnauthorizedError } from "./errors-DyY48oRi.mjs";
3
- import { b as isElevated, n as PUBLIC_SCOPE } from "./types-HFFSwF_K.mjs";
4
- import { B as requireAuth, F as allowPublic, U as requireRoles } from "./permissions-R9T2G1PH.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { B as requireAuth, F as allowPublic, U as requireRoles } from "./permissions-BJylQopQ.mjs";
5
3
  import { multiTenantPreset } from "./presets/multiTenant.mjs";
4
+ import { b as isElevated, n as PUBLIC_SCOPE } from "./types-BuV_cFqT.mjs";
5
+ import { l as UnauthorizedError } from "./errors-3xaK0i9n.mjs";
6
6
  // src/presets/audited.ts
7
7
  /**
8
8
  * Audited preset - adds createdBy/updatedBy tracking
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
2
- import { c as getOrgId, f as getScopeContextMap, g as getUserId, m as getTeamId, x as isMember } from "./types-HFFSwF_K.mjs";
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
+ import { c as getOrgId, f as getScopeContextMap, g as getUserId, m as getTeamId, x as isMember } from "./types-BuV_cFqT.mjs";
3
3
  // src/scope/projection.ts
4
4
  /**
5
5
  * Compute the request-scope projection. Returns `undefined` when no
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.48.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.50.0 | MIT | https://classytic.com */
2
2
  // src/http-cache/purgers/purger.types.ts
3
3
  /** A purge the CDN refused or never answered: a closed code plus the provider's own codes, never a credential. */
4
4
  var CachePurgeError = class extends Error {