@classytic/arc 2.40.0 → 2.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/{BaseController-BqJtbiUA.mjs → BaseController-CYEwjyjN.mjs} +20 -13
  2. package/dist/{EventTransport-BPOQsEer.d.mts → EventTransport-CbUKDzZZ.d.mts} +25 -0
  3. package/dist/{EventTransport-BUkTwY_x.mjs → EventTransport-DSqD_Xsg.mjs} +11 -2
  4. package/dist/{HookSystem-96nzZLmk.mjs → HookSystem-CMF94SEA.mjs} +2 -2
  5. package/dist/{ResourceRegistry-B9WnuG2Q.mjs → ResourceRegistry-MGpXoxHZ.mjs} +2 -2
  6. package/dist/{actionPermissions-4OGbe3Hf.mjs → actionPermissions-BoPGQ5-4.mjs} +7 -6
  7. package/dist/audit/index.d.mts +2 -2
  8. package/dist/audit/index.mjs +10 -3
  9. package/dist/auth/audit.mjs +1 -1
  10. package/dist/auth/index.d.mts +2 -2
  11. package/dist/auth/index.mjs +12 -6
  12. package/dist/auth/redis-session.mjs +1 -1
  13. package/dist/{authorizationDecision-D_LFvMlm.mjs → authorizationDecision-DawKGoXb.mjs} +2 -2
  14. package/dist/{base-C-NL2fTi.d.mts → base-CxrV1LmG.d.mts} +10 -0
  15. package/dist/{buildHandler-BG_CHXqQ.mjs → buildHandler-CvxKOc0m.mjs} +4 -4
  16. package/dist/cache/index.d.mts +4 -2
  17. package/dist/cache/index.mjs +4 -4
  18. package/dist/{caching-Bqcn3Brl.mjs → caching-DbCBxlgw.mjs} +2 -2
  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-BQ2FbhPB.mjs → constants-D5Ubn1fe.mjs} +1 -1
  30. package/dist/context/index.mjs +36 -11
  31. package/dist/core/index.d.mts +2 -2
  32. package/dist/core/index.mjs +7 -7
  33. package/dist/{core-CsZR037F.mjs → core-5lazhva9.mjs} +3 -3
  34. package/dist/{createActionRouter-BR93gCKg.mjs → createActionRouter-DNqoaK81.mjs} +7 -7
  35. package/dist/{createAggregationRouter-CF40Aw95.mjs → createAggregationRouter-BcbQJf10.mjs} +7 -7
  36. package/dist/{createMcpServer-BVTs2S5G.d.mts → createMcpServer-CbDWkZ1T.d.mts} +1 -1
  37. package/dist/{defineAggregation-BDA2Tw7v.mjs → defineAggregation-D_eJjm5A.mjs} +1 -1
  38. package/dist/{defineResource-DaIySrQr.mjs → defineResource-DxkMTjRn.mjs} +18 -18
  39. package/dist/discovery/index.mjs +1 -1
  40. package/dist/docs/index.d.mts +1 -1
  41. package/dist/docs/index.mjs +3 -3
  42. package/dist/{elevation-CZy6n50b.mjs → elevation-CkvG0LG2.mjs} +4 -4
  43. package/dist/encryption/index.mjs +3 -3
  44. package/dist/{errorHandler-By9keRvX.mjs → errorHandler-D1GHKGlV.mjs} +3 -3
  45. package/dist/{errors-BHD3L8of.mjs → errors-BH7YU_9O.mjs} +1 -1
  46. package/dist/{eventPlugin-DfHaKEWQ.d.mts → eventPlugin-B52abJ8W.d.mts} +1 -1
  47. package/dist/{eventPlugin-DB26V7uX.mjs → eventPlugin-zZY-unhr.mjs} +5 -5
  48. package/dist/events/index.d.mts +4 -4
  49. package/dist/events/index.mjs +5 -5
  50. package/dist/events/transports/redis-stream-entry.d.mts +1 -1
  51. package/dist/events/transports/redis-stream-entry.mjs +15 -6
  52. package/dist/events/transports/redis.d.mts +1 -1
  53. package/dist/events/transports/redis.mjs +2 -2
  54. package/dist/factory/index.d.mts +5 -5
  55. package/dist/factory/index.mjs +5 -5
  56. package/dist/{fastify-augmentation-HncZMmze.d.mts → fastify-augmentation-Cq2nHVaW.d.mts} +3 -3
  57. package/dist/{fields-fA-Dkou5.mjs → fields-BHrkoF5y.mjs} +1 -1
  58. package/dist/{generate-BSSdtiOy.mjs → generate-BLRf2m3y.mjs} +2 -2
  59. package/dist/{headers-BFEEshDS.mjs → headers-BIXWKrzQ.mjs} +2 -2
  60. package/dist/{health-BlGHjkqZ.mjs → health-ZRHeDHXH.mjs} +10 -2
  61. package/dist/hooks/index.d.mts +1 -1
  62. package/dist/hooks/index.mjs +2 -2
  63. package/dist/idempotency/index.d.mts +1 -1
  64. package/dist/idempotency/index.mjs +4 -4
  65. package/dist/idempotency/redis.d.mts +1 -1
  66. package/dist/idempotency/redis.mjs +1 -1
  67. package/dist/{index-BtYoMip1.d.mts → index-BHdZD8zK.d.mts} +10 -2
  68. package/dist/{index-DbMglURO.d.mts → index-CFfLKMH4.d.mts} +1 -1
  69. package/dist/{index-eyg5WEcy.d.mts → index-CbJiYrfv.d.mts} +1 -1
  70. package/dist/{index-SCsOJxWB.d.mts → index-D4u76eQW.d.mts} +3 -3
  71. package/dist/{index-D3sIPcD4.d.mts → index-DHbyPo5j.d.mts} +6 -2
  72. package/dist/index.d.mts +5 -5
  73. package/dist/index.mjs +11 -11
  74. package/dist/{init-pl88PHzb.mjs → init-CpLkjU18.mjs} +1 -1
  75. package/dist/integrations/event-gateway.d.mts +1 -1
  76. package/dist/integrations/event-gateway.mjs +2 -2
  77. package/dist/integrations/index.d.mts +2 -2
  78. package/dist/integrations/index.mjs +1 -1
  79. package/dist/integrations/jobs/index.d.mts +1 -1
  80. package/dist/integrations/jobs/index.mjs +2 -2
  81. package/dist/integrations/mcp/index.d.mts +4 -4
  82. package/dist/integrations/mcp/index.mjs +2 -2
  83. package/dist/integrations/mcp/testing.d.mts +2 -2
  84. package/dist/integrations/mcp/testing.mjs +2 -2
  85. package/dist/integrations/streamline.mjs +3 -3
  86. package/dist/integrations/webhooks.d.mts +2 -2
  87. package/dist/integrations/webhooks.mjs +3 -3
  88. package/dist/integrations/websocket-pushref-redis.d.mts +1 -1
  89. package/dist/integrations/websocket-pushref-redis.mjs +1 -1
  90. package/dist/integrations/websocket-redis.mjs +1 -1
  91. package/dist/integrations/websocket.mjs +12 -1
  92. package/dist/{interface-DjtFnZxH.mjs → interface-YzIbF7Ii.mjs} +1 -1
  93. package/dist/{jsonBody-Dx6jH_Nb.mjs → jsonBody-ELR9lfeU.mjs} +2 -2
  94. package/dist/{keys-Ds3ekBiu.mjs → keys-cpZCtcIE.mjs} +1 -1
  95. package/dist/{loadResources-E5UFlRrT.mjs → loadResources-BPfWiI5s.mjs} +2 -2
  96. package/dist/{loadResourcesFromEntry-C2jrJbWG.mjs → loadResourcesFromEntry-ixtfL3J2.mjs} +2 -2
  97. package/dist/logger/index.mjs +1 -1
  98. package/dist/{mcpPlugin-D-3OLxNz.mjs → mcpPlugin-BX5PujI0.mjs} +15 -15
  99. package/dist/{memory-CNvjxzB2.mjs → memory-Iotz0cCx.mjs} +2 -2
  100. package/dist/{metrics-P37sNV5H.mjs → metrics-NMsmpRmY.mjs} +2 -2
  101. package/dist/middleware/index.d.mts +1 -1
  102. package/dist/middleware/index.mjs +3 -3
  103. package/dist/migrations/index.mjs +2 -2
  104. package/dist/{module-CNcwCKUJ.mjs → module-DpLJG2_N.mjs} +1 -1
  105. package/dist/{multipartBody-Bl_gU3Wg.mjs → multipartBody-DtRWM6_U.mjs} +1 -1
  106. package/dist/{openapi-BYrL8zvY.mjs → openapi-CmFf3yq_.mjs} +6 -6
  107. package/dist/outbox-admin/index.d.mts +2 -2
  108. package/dist/outbox-admin/index.mjs +4 -4
  109. package/dist/{outbox-module-CzsKRBvO.d.mts → outbox-module-BHdUnuuK.d.mts} +6 -2
  110. package/dist/{outbox-module-6DMC_WNu.mjs → outbox-module-D2z5WkDY.mjs} +9 -6
  111. package/dist/permissions/index.d.mts +2 -2
  112. package/dist/permissions/index.mjs +5 -5
  113. package/dist/{permissions-C0GpDsB_.mjs → permissions-D8TBH44E.mjs} +12 -6
  114. package/dist/{pipe-4_XamfxI.mjs → pipe-FMWNheSO.mjs} +2 -2
  115. package/dist/pipeline/index.d.mts +1 -1
  116. package/dist/pipeline/index.mjs +2 -2
  117. package/dist/plugins/index.d.mts +6 -36
  118. package/dist/plugins/index.mjs +33 -22
  119. package/dist/plugins/response-cache.mjs +9 -2
  120. package/dist/plugins/tracing-entry.mjs +2 -2
  121. package/dist/{pluralize-BaQ62hOW.mjs → pluralize-CXWZIzTv.mjs} +1 -1
  122. package/dist/{preloadResources-DVgPCNcD.d.mts → preloadResources-CjS2OfpU.d.mts} +13 -8
  123. package/dist/{preloadResources-BAx5s9EF.mjs → preloadResources-f3boenVZ.mjs} +33 -26
  124. package/dist/presets/filesUpload.d.mts +2 -2
  125. package/dist/presets/filesUpload.mjs +5 -5
  126. package/dist/presets/index.d.mts +2 -2
  127. package/dist/presets/index.mjs +2 -2
  128. package/dist/presets/multiTenant.d.mts +38 -1
  129. package/dist/presets/multiTenant.mjs +24 -6
  130. package/dist/presets/search.d.mts +2 -2
  131. package/dist/presets/search.mjs +2 -2
  132. package/dist/{presets-CAaqVVcW.mjs → presets-ZJSPgmT2.mjs} +4 -4
  133. package/dist/{projection-qbCOEvsh.mjs → projection-BzIgzoKZ.mjs} +2 -2
  134. package/dist/{queryCachePlugin-2Pp9w-8D.mjs → queryCachePlugin-DZHPOm9p.mjs} +11 -5
  135. package/dist/{rateLimitKey-umrS6-vu.mjs → rateLimitKey-BvOvcBDi.mjs} +1 -1
  136. package/dist/{realtime-zzoNLDtj.mjs → realtime-8tIQWZz4.mjs} +9 -9
  137. package/dist/{redis-CduhKsJi.d.mts → redis-Bzi1y3F9.d.mts} +10 -2
  138. package/dist/{redis-stream-DSsPyYzd.d.mts → redis-stream-BPKscsTB.d.mts} +6 -6
  139. package/dist/{registerRoute-_6zHiz0x.mjs → registerRoute-Bsnk6NiZ.mjs} +6 -6
  140. package/dist/registry/index.d.mts +2 -2
  141. package/dist/registry/index.mjs +3 -3
  142. package/dist/{registry-CEpoRpLP.mjs → registry-DNkgGQcK.mjs} +2 -2
  143. package/dist/{renewingLease-B5Grm0pI.mjs → renewingLease-yF8BdW4b.mjs} +1 -1
  144. package/dist/{replyHelpers-9h-a592u.mjs → replyHelpers-CNdvMfM4.mjs} +2 -2
  145. package/dist/{requestContext-D4PuGhEw.mjs → requestContext-cDkAUr-P.mjs} +1 -1
  146. package/dist/{rolldown-runtime-DzE6ikSH.mjs → rolldown-runtime-eysyzFAF.mjs} +1 -1
  147. package/dist/{runtimeCapabilities-Bo7rSKjm.mjs → runtimeCapabilities-CkhS6jn6.mjs} +31 -5
  148. package/dist/{schedules-Dm21pqHU.mjs → schedules-j6uXXAeJ.mjs} +4 -4
  149. package/dist/{schemaConverter-DENbixyA.mjs → schemaConverter-BVA7cFRG.mjs} +1 -1
  150. package/dist/{schemaIR-C2qUNzC6.mjs → schemaIR-CTvPDoPB.mjs} +2 -2
  151. package/dist/schemas/index.mjs +1 -1
  152. package/dist/scim/index.mjs +2 -2
  153. package/dist/scope/index.mjs +5 -5
  154. package/dist/{scope-CdYxQVxt.mjs → scope-BUi1xV1I.mjs} +4 -4
  155. package/dist/{simpleEqualityMatcher-Cldubvul.mjs → simpleEqualityMatcher-C9bzq2gO.mjs} +1 -1
  156. package/dist/{sse-DbyXoQun.mjs → sse-BeqVKQKu.mjs} +5 -5
  157. package/dist/{sseStream-BfZtL5-m.mjs → sseStream-Ppzo-WUH.mjs} +2 -2
  158. package/dist/{store-helpers-BfyOd5i6.mjs → store-helpers-dW71XVWL.mjs} +1 -1
  159. package/dist/{streaming-CFwCzEvU.mjs → streaming-IcRFjWQU.mjs} +1 -1
  160. package/dist/{subscribe-helpers-KgVEcn8L.mjs → subscribe-helpers-DatDkcuG.mjs} +2 -2
  161. package/dist/sync/changelog.mjs +1 -1
  162. package/dist/testing/cleanupStoreContract.mjs +1 -1
  163. package/dist/testing/index.d.mts +5 -5
  164. package/dist/testing/index.mjs +10 -10
  165. package/dist/testing/outboxStoreContract.mjs +1 -1
  166. package/dist/testing/storageContract.mjs +1 -1
  167. package/dist/{transactionContext-46KyUADP.mjs → transactionContext-CPbdlnVw.mjs} +1 -1
  168. package/dist/{typeGuards-t_CVgRXN.mjs → typeGuards-BLjPgVBm.mjs} +1 -1
  169. package/dist/types/index.d.mts +2 -2
  170. package/dist/types/index.mjs +1 -1
  171. package/dist/types/storage.mjs +1 -1
  172. package/dist/{types-9rvxn5Ym.d.mts → types-CWQn9-IC.d.mts} +1 -1
  173. package/dist/{types-CNQyOrLk.mjs → types-CgenB1gv.mjs} +4 -4
  174. package/dist/{types-BVlowlm7.d.mts → types-DfVDvkdP.d.mts} +19 -1
  175. package/dist/usage/index.d.mts +58 -2
  176. package/dist/usage/index.mjs +55 -4
  177. package/dist/{userHelpers-DLueLQdQ.mjs → userHelpers-ChRvkuSZ.mjs} +1 -1
  178. package/dist/utils/index.d.mts +107 -5
  179. package/dist/utils/index.mjs +12 -12
  180. package/dist/{utils-CUFBrhq-.mjs → utils-CxcctrAh.mjs} +50 -9
  181. package/dist/{validate-DV3hRbsz.mjs → validate-DrYWnOzI.mjs} +2 -2
  182. package/dist/{versioning-P3V6ATyC.d.mts → versioning-D6JIK8Tk.d.mts} +58 -2
  183. package/dist/{versioning-BXwmj5SD.mjs → versioning-DKkT4hNJ.mjs} +3 -3
  184. package/dist/{workScope-CoGpuzDX.mjs → workScope-CxKqoIFn.mjs} +3 -4
  185. package/package.json +5 -5
  186. package/skills/arc/SKILL.md +8 -4
  187. package/skills/arc/references/production.md +94 -9
@@ -1,10 +1,10 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { n as evaluateAndApplyPermission } from "./authorizationDecision-D_LFvMlm.mjs";
3
- import { f as createError } from "./errors-BHD3L8of.mjs";
4
- import { u as getRequestScope } from "./types-CNQyOrLk.mjs";
5
- import { a as selectPluginMw, c as buildRouteHooks, d as buildAuthMiddleware, i as resolveRouterPluginMw, n as buildRateLimitConfig, p as buildArcDecorator, u as routeHookOptions } from "./registerRoute-_6zHiz0x.mjs";
6
- import { n as validateAggregations } from "./validate-DV3hRbsz.mjs";
7
- import { t as buildAggregationHandler } from "./buildHandler-BG_CHXqQ.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { n as evaluateAndApplyPermission } from "./authorizationDecision-DawKGoXb.mjs";
3
+ import { f as createError } from "./errors-BH7YU_9O.mjs";
4
+ import { u as getRequestScope } from "./types-CgenB1gv.mjs";
5
+ import { a as selectPluginMw, c as buildRouteHooks, d as buildAuthMiddleware, i as resolveRouterPluginMw, n as buildRateLimitConfig, p as buildArcDecorator, u as routeHookOptions } from "./registerRoute-Bsnk6NiZ.mjs";
6
+ import { n as validateAggregations } from "./validate-DrYWnOzI.mjs";
7
+ import { t as buildAggregationHandler } from "./buildHandler-CvxKOc0m.mjs";
8
8
  //#region src/core/aggregation/createAggregationRouter.ts
9
9
  /**
10
10
  * Register one Fastify route per aggregation. No-op when the map is
@@ -1,5 +1,5 @@
1
1
 
2
- import { _ as ToolDefinition, c as McpAuthResult, r as CreateMcpServerConfig } from "./types-9rvxn5Ym.mjs";
2
+ import { _ as ToolDefinition, c as McpAuthResult, r as CreateMcpServerConfig } from "./types-CWQn9-IC.mjs";
3
3
  //#region src/integrations/mcp/createMcpServer.d.ts
4
4
  /**
5
5
  * Mutable auth ref — updated per-request by mcpPlugin.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/core/aggregation/defineAggregation.ts
3
3
  /**
4
4
  * Declare a single resource aggregation. Exported configs flow into
@@ -1,20 +1,20 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { p as MUTATION_OPERATIONS, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-BQ2FbhPB.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { p as MUTATION_OPERATIONS, s as DEFAULT_UPDATE_METHOD, t as CRUD_OPERATIONS } from "./constants-D5Ubn1fe.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { r as ForbiddenError } from "./errors-BHD3L8of.mjs";
5
- import { n as getUserRoles } from "./userHelpers-DLueLQdQ.mjs";
6
- import { b as isElevated, n as PUBLIC_SCOPE, x as isMember } from "./types-CNQyOrLk.mjs";
7
- import { d as isWriteVerbCapable, p as DEFAULT_FIELD_WRITE_DENIAL_POLICY, t as BaseController, u as detectOverriddenWriteSlots } from "./BaseController-BqJtbiUA.mjs";
8
- import { v as getDefaultCrudSchemas } from "./utils-CUFBrhq-.mjs";
9
- import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-fA-Dkou5.mjs";
10
- import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-DENbixyA.mjs";
11
- import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-CFwCzEvU.mjs";
12
- import { a as createCrudHandlers, i as resolvePipelineSteps, o as createFastifyHandler, r as buildPipelineHandler, s as createRequestContext, t as resolveActionPermission } from "./actionPermissions-4OGbe3Hf.mjs";
13
- import { a as selectPluginMw, c as buildRouteHooks, d as buildAuthMiddleware, i as resolveRouterPluginMw, l as resolveRoutePreHandlers, n as buildRateLimitConfig, p as buildArcDecorator, r as buildRouteConfig, s as buildCrudPermissionMw, t as tryRegisterRoute, u as routeHookOptions } from "./registerRoute-_6zHiz0x.mjs";
14
- import { t as hasEvents } from "./typeGuards-t_CVgRXN.mjs";
15
- import { B as requireAuth } from "./permissions-C0GpDsB_.mjs";
16
- import { r as getAvailablePresets, t as applyPresets } from "./presets-CAaqVVcW.mjs";
17
- import { t as pluralize } from "./pluralize-BaQ62hOW.mjs";
4
+ import { r as ForbiddenError } from "./errors-BH7YU_9O.mjs";
5
+ import { n as getUserRoles } from "./userHelpers-ChRvkuSZ.mjs";
6
+ import { b as isElevated, n as PUBLIC_SCOPE, x as isMember } from "./types-CgenB1gv.mjs";
7
+ import { d as isWriteVerbCapable, p as DEFAULT_FIELD_WRITE_DENIAL_POLICY, t as BaseController, u as detectOverriddenWriteSlots } from "./BaseController-CYEwjyjN.mjs";
8
+ import { y as getDefaultCrudSchemas } from "./utils-CxcctrAh.mjs";
9
+ import { a as resolveEffectiveRoles, n as applyFieldWritePermissions } from "./fields-BHrkoF5y.mjs";
10
+ import { n as convertRouteSchema, r as ensureSchemaConverter, t as convertOpenApiSchemas } from "./schemaConverter-BVA7cFRG.mjs";
11
+ import { i as pipeUIMessageStreamToReply, r as isReadableStream } from "./streaming-IcRFjWQU.mjs";
12
+ import { a as createCrudHandlers, i as resolvePipelineSteps, o as createFastifyHandler, r as buildPipelineHandler, s as createRequestContext, t as resolveActionPermission } from "./actionPermissions-BoPGQ5-4.mjs";
13
+ import { a as selectPluginMw, c as buildRouteHooks, d as buildAuthMiddleware, i as resolveRouterPluginMw, l as resolveRoutePreHandlers, n as buildRateLimitConfig, p as buildArcDecorator, r as buildRouteConfig, s as buildCrudPermissionMw, t as tryRegisterRoute, u as routeHookOptions } from "./registerRoute-Bsnk6NiZ.mjs";
14
+ import { t as hasEvents } from "./typeGuards-BLjPgVBm.mjs";
15
+ import { B as requireAuth } from "./permissions-D8TBH44E.mjs";
16
+ import { r as getAvailablePresets, t as applyPresets } from "./presets-ZJSPgmT2.mjs";
17
+ import { t as pluralize } from "./pluralize-CXWZIzTv.mjs";
18
18
  import { isReadOnlyRepo } from "@classytic/repo-core/repository";
19
19
  //#region src/core/middlewares/fieldWrite.ts
20
20
  /**
@@ -1425,7 +1425,7 @@ function buildResourcePlugin(resource) {
1425
1425
  extensions: resource.extensions
1426
1426
  });
1427
1427
  if (resource.actions && Object.keys(resource.actions).length > 0) {
1428
- const { createActionRouter } = await import("./createActionRouter-BR93gCKg.mjs").then((n) => n.n);
1428
+ const { createActionRouter } = await import("./createActionRouter-DNqoaK81.mjs").then((n) => n.n);
1429
1429
  createActionRouter(typedInstance, {
1430
1430
  ...normalizeActionsToRouterConfig(resource.actions, resource.actionPermissions, resource.tag, resource.permissions, resource.name, typedInstance.log),
1431
1431
  resourceName: resource.name,
@@ -1440,7 +1440,7 @@ function buildResourcePlugin(resource) {
1440
1440
  });
1441
1441
  }
1442
1442
  if (resource.aggregations && Object.keys(resource.aggregations).length > 0) {
1443
- const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-CF40Aw95.mjs"), import("./validate-DV3hRbsz.mjs").then((n) => n.r)]);
1443
+ const [{ createAggregationRouter }, { adapterSupportsAggregate, ArcAggregationConfigError }] = await Promise.all([import("./createAggregationRouter-BcbQJf10.mjs"), import("./validate-DrYWnOzI.mjs").then((n) => n.r)]);
1444
1444
  const repoForAgg = resource.controller?.repository ?? resource.repository;
1445
1445
  if (!adapterSupportsAggregate(repoForAgg)) {
1446
1446
  const undispatchable = Object.entries(resource.aggregations).filter(([, cfg]) => !cfg.materialized).map(([name]) => name);
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { readdir } from "node:fs/promises";
3
3
  import { extname, join, resolve } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
@@ -1,5 +1,5 @@
1
1
 
2
- import { p as RegistryEntry } from "../index-D3sIPcD4.mjs";
2
+ import { p as RegistryEntry } from "../index-DHbyPo5j.mjs";
3
3
  import { t as ExternalOpenApiPaths } from "../externalPaths-CmGOxOtD.mjs";
4
4
  import { FastifyPluginAsync } from "fastify";
5
5
  //#region src/docs/openapi/types.d.ts
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { n as getUserRoles } from "../userHelpers-DLueLQdQ.mjs";
3
- import { n as openApiPlugin, r as openapi_default, t as buildOpenApiSpec } from "../openapi-BYrL8zvY.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { n as getUserRoles } from "../userHelpers-ChRvkuSZ.mjs";
3
+ import { n as openApiPlugin, r as openapi_default, t as buildOpenApiSpec } from "../openapi-CmFf3yq_.mjs";
4
4
  import fp from "fastify-plugin";
5
5
  //#region src/docs/scalar.ts
6
6
  const scalarPlugin = async (fastify, opts = {}) => {
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { n as requireSingleHeaderValue } from "./headers-BFEEshDS.mjs";
5
- import { n as getUserRoles } from "./userHelpers-DLueLQdQ.mjs";
4
+ import { n as requireSingleHeaderValue } from "./headers-BIXWKrzQ.mjs";
5
+ import { n as getUserRoles } from "./userHelpers-ChRvkuSZ.mjs";
6
6
  import fp from "fastify-plugin";
7
7
  //#region src/scope/elevation.ts
8
8
  var elevation_exports = /* @__PURE__ */ __exportAll({
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as ArcError } from "../errors-BHD3L8of.mjs";
3
- import { t as parseJsonBody } from "../jsonBody-Dx6jH_Nb.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as ArcError } from "../errors-BH7YU_9O.mjs";
3
+ import { t as parseJsonBody } from "../jsonBody-ELR9lfeU.mjs";
4
4
  import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
5
5
  import fp from "fastify-plugin";
6
6
  //#region src/encryption/fieldCipher.ts
@@ -1,6 +1,6 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
3
- import { m as statusToArcCode, p as isArcError } from "./errors-BHD3L8of.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
3
+ import { m as statusToArcCode, p as isArcError } from "./errors-BH7YU_9O.mjs";
4
4
  import { isProductionEnv } from "@classytic/primitives/environment";
5
5
  import { isHttpError, toErrorContract } from "@classytic/repo-core/errors";
6
6
  import fp from "fastify-plugin";
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/utils/errors.ts
3
3
  /**
4
4
  * Base Arc Error. Implements the canonical `HttpError` contract — `status`
@@ -1,5 +1,5 @@
1
1
 
2
- import { a as EventTransport, i as EventLogger, n as DomainEvent, r as EventHandler, s as MemoryEventTransportOptions } from "./EventTransport-BPOQsEer.mjs";
2
+ import { a as EventTransport, i as EventLogger, n as DomainEvent, r as EventHandler, s as MemoryEventTransportOptions } from "./EventTransport-CbUKDzZZ.mjs";
3
3
  import { FastifyPluginAsync } from "fastify";
4
4
  //#region src/events/defineEvent.d.ts
5
5
  interface EventSchema {
@@ -1,9 +1,9 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as __exportAll } from "./rolldown-runtime-DzE6ikSH.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as __exportAll } from "./rolldown-runtime-eysyzFAF.mjs";
3
3
  import { arcLog } from "./logger/index.mjs";
4
- import { d as createDomainError } from "./errors-BHD3L8of.mjs";
5
- import { n as requestContext } from "./requestContext-D4PuGhEw.mjs";
6
- import { n as MemoryEventTransport, r as createEvent, t as ARC_EVENT_TRANSPORT } from "./EventTransport-BUkTwY_x.mjs";
4
+ import { d as createDomainError } from "./errors-BH7YU_9O.mjs";
5
+ import { n as requestContext } from "./requestContext-cDkAUr-P.mjs";
6
+ import { n as MemoryEventTransport, r as createEvent, t as ARC_EVENT_TRANSPORT } from "./EventTransport-DSqD_Xsg.mjs";
7
7
  import { isProductionEnv } from "@classytic/primitives/environment";
8
8
  import fp from "fastify-plugin";
9
9
  //#region src/events/retry.ts
@@ -1,9 +1,9 @@
1
1
 
2
- import { i as EventLogger, n as DomainEvent, o as MemoryEventTransport, r as EventHandler, s as MemoryEventTransportOptions } from "../EventTransport-BPOQsEer.mjs";
3
- import { a as withRetry, c as EventDefinitionOutput, d as EventSchema, f as ValidationResult, i as createDeadLetterPublisher, l as EventRegistry, m as defineEvent, n as eventPlugin, o as CustomValidator, p as createEventRegistry, r as RetryOptions, s as EventDefinitionInput, t as EventPluginOptions, u as EventRegistryOptions } from "../eventPlugin-DfHaKEWQ.mjs";
4
- import { a as EventOutbox, c as OutboxRelayErrorKind, i as MemoryOutboxStore, l as RelayResult, n as OutboxModuleOptions, o as EventOutboxOptions, r as createOutboxModule, s as OutboxRelayErrorHandler, t as OutboxModuleExports } from "../outbox-module-CzsKRBvO.mjs";
2
+ import { i as EventLogger, n as DomainEvent, o as MemoryEventTransport, r as EventHandler, s as MemoryEventTransportOptions } from "../EventTransport-CbUKDzZZ.mjs";
3
+ import { a as withRetry, c as EventDefinitionOutput, d as EventSchema, f as ValidationResult, i as createDeadLetterPublisher, l as EventRegistry, m as defineEvent, n as eventPlugin, o as CustomValidator, p as createEventRegistry, r as RetryOptions, s as EventDefinitionInput, t as EventPluginOptions, u as EventRegistryOptions } from "../eventPlugin-B52abJ8W.mjs";
4
+ import { a as EventOutbox, c as OutboxRelayErrorKind, i as MemoryOutboxStore, l as RelayResult, n as OutboxModuleOptions, o as EventOutboxOptions, r as createOutboxModule, s as OutboxRelayErrorHandler, t as OutboxModuleExports } from "../outbox-module-BHdUnuuK.mjs";
5
5
  import { RedisEventTransportOptions, RedisLike } from "./transports/redis.mjs";
6
- import { r as RedisStreamTransportOptions, t as RedisStreamLike } from "../redis-stream-DSsPyYzd.mjs";
6
+ import { r as RedisStreamTransportOptions, t as RedisStreamLike } from "../redis-stream-BPKscsTB.mjs";
7
7
  import { OutboxStore } from "@classytic/primitives/outbox";
8
8
  import { RepositoryLike } from "@classytic/repo-core/adapter";
9
9
  //#region src/events/eventTypes.d.ts
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { n as MemoryEventTransport } from "../EventTransport-BUkTwY_x.mjs";
3
- import { a as createEventRegistry, i as wrapWithSchema, n as subscribeWithSchema, o as defineEvent, r as wrapWithBoundary, t as subscribeWithBoundary } from "../subscribe-helpers-KgVEcn8L.mjs";
4
- import { i as withRetry, r as createDeadLetterPublisher, t as eventPlugin } from "../eventPlugin-DB26V7uX.mjs";
5
- import { i as exponentialBackoff, n as EventOutbox, r as repositoryAsOutboxStore, t as createOutboxModule } from "../outbox-module-6DMC_WNu.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { n as MemoryEventTransport } from "../EventTransport-DSqD_Xsg.mjs";
3
+ import { a as createEventRegistry, i as wrapWithSchema, n as subscribeWithSchema, o as defineEvent, r as wrapWithBoundary, t as subscribeWithBoundary } from "../subscribe-helpers-DatDkcuG.mjs";
4
+ import { i as withRetry, r as createDeadLetterPublisher, t as eventPlugin } from "../eventPlugin-zZY-unhr.mjs";
5
+ import { i as exponentialBackoff, n as EventOutbox, r as repositoryAsOutboxStore, t as createOutboxModule } from "../outbox-module-D2z5WkDY.mjs";
6
6
  import { MemoryOutboxStore } from "@classytic/primitives/memory-outbox";
7
7
  //#region src/events/eventTypes.ts
8
8
  /**
@@ -1,3 +1,3 @@
1
1
 
2
- import { n as RedisStreamTransport, r as RedisStreamTransportOptions, t as RedisStreamLike } from "../../redis-stream-DSsPyYzd.mjs";
2
+ import { n as RedisStreamTransport, r as RedisStreamTransportOptions, t as RedisStreamLike } from "../../redis-stream-BPKscsTB.mjs";
3
3
  export { type RedisStreamLike, RedisStreamTransport, type RedisStreamTransportOptions };
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-CoGpuzDX.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-CxKqoIFn.mjs";
3
3
  import sjson from "secure-json-parse";
4
4
  import { matchEventPattern } from "@classytic/primitives/events";
5
5
  //#region src/events/transports/redis-stream.ts
@@ -234,14 +234,23 @@ var RedisStreamTransport = class {
234
234
  * still sequential inside `processEntry`.
235
235
  */
236
236
  async processEntries(entries) {
237
+ const live = [];
238
+ const ghostIds = [];
239
+ for (const [messageId, fields] of entries) if (fields) live.push([messageId, fields]);
240
+ else ghostIds.push(messageId);
241
+ if (ghostIds.length > 0) try {
242
+ await this.redis.xack(this.stream, this.group, ...ghostIds);
243
+ } catch (err) {
244
+ this.logger.error(`[RedisStreamTransport] Failed to ack ${ghostIds.length} trimmed entr(ies):`, err);
245
+ }
237
246
  if (this.processingConcurrency <= 1) {
238
- for (const [messageId, fields] of entries) await this.processEntry(messageId, fields);
247
+ for (const [messageId, fields] of live) await this.processEntry(messageId, fields);
239
248
  return;
240
249
  }
241
250
  let next = 0;
242
- const workers = Array.from({ length: Math.min(this.processingConcurrency, entries.length) }, async () => {
243
- while (next < entries.length) {
244
- const entry = entries[next++];
251
+ const workers = Array.from({ length: Math.min(this.processingConcurrency, live.length) }, async () => {
252
+ while (next < live.length) {
253
+ const entry = live[next++];
245
254
  if (entry) await this.processEntry(entry[0], entry[1]);
246
255
  }
247
256
  });
@@ -1,5 +1,5 @@
1
1
 
2
- import { a as EventTransport, i as EventLogger, n as DomainEvent, r as EventHandler } from "../../EventTransport-BPOQsEer.mjs";
2
+ import { a as EventTransport, i as EventLogger, n as DomainEvent, r as EventHandler } from "../../EventTransport-CbUKDzZZ.mjs";
3
3
  //#region src/events/transports/redis.d.ts
4
4
  interface RedisLike {
5
5
  publish(channel: string, message: string): Promise<number>;
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-CoGpuzDX.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { r as workSeedFromEvent, t as runWorkScope } from "../../workScope-CxKqoIFn.mjs";
3
3
  import sjson from "secure-json-parse";
4
4
  //#region src/events/transports/redis.ts
5
5
  /**
@@ -1,8 +1,8 @@
1
1
 
2
- import { _ as HealthCheck, a as ModuleContribution, c as LoadResourcesOptions, d as loadResources, i as EventHandlerDefinition, l as ResourceLike, n as ArcModuleInput, o as ModuleDisposer, r as ArcModuleRegistry, s as ModuleSetupContext, t as ArcModule, u as ResourceModule } from "../types-BVlowlm7.mjs";
3
- import { _ as collectModuleScheduledJobs, a as lazyModuleExports, c as getModuleState, d as resolveModule, f as orderModules, g as collectModuleHealthChecks, h as extendModule, i as hasModuleExports, l as hasModule, m as ModuleExtension, n as getModuleExports, o as lazyRequiredModuleExports, p as subscribeModuleEventHandlers, r as getOptionalModuleExports, s as ModuleState, t as defineModule, u as resolveContribution, v as collectModuleWorkflows } from "../index-DbMglURO.mjs";
4
- import { c as ResolvedResourceDescriptor, l as describeResolvedModule, o as ResolvedModuleDescriptor, s as ResolvedModuleLifecycle } from "../fastify-augmentation-HncZMmze.mjs";
5
- import { a as RawBodyOptions, c as BetterAuthOption, d as JwtAuthOption, i as MultipartOptions, l as CustomAuthenticatorOption, n as preloadResourcesAsync, o as UnderPressureOptions, r as CreateAppOptions, s as AuthOption, t as preloadResources, u as CustomPluginAuthOption } from "../preloadResources-DVgPCNcD.mjs";
2
+ import { _ as HealthCheck, a as ModuleContribution, c as LoadResourcesOptions, d as loadResources, i as EventHandlerDefinition, l as ResourceLike, n as ArcModuleInput, o as ModuleDisposer, r as ArcModuleRegistry, s as ModuleSetupContext, t as ArcModule, u as ResourceModule } from "../types-DfVDvkdP.mjs";
3
+ import { _ as collectModuleScheduledJobs, a as lazyModuleExports, c as getModuleState, d as resolveModule, f as orderModules, g as collectModuleHealthChecks, h as extendModule, i as hasModuleExports, l as hasModule, m as ModuleExtension, n as getModuleExports, o as lazyRequiredModuleExports, p as subscribeModuleEventHandlers, r as getOptionalModuleExports, s as ModuleState, t as defineModule, u as resolveContribution, v as collectModuleWorkflows } from "../index-CFfLKMH4.mjs";
4
+ import { c as ResolvedResourceDescriptor, l as describeResolvedModule, o as ResolvedModuleDescriptor, s as ResolvedModuleLifecycle } from "../fastify-augmentation-Cq2nHVaW.mjs";
5
+ import { a as RawBodyOptions, c as BetterAuthOption, d as JwtAuthOption, i as MultipartOptions, l as CustomAuthenticatorOption, n as preloadResourcesAsync, o as UnderPressureOptions, r as CreateAppOptions, s as AuthOption, t as preloadResources, u as CustomPluginAuthOption } from "../preloadResources-CjS2OfpU.mjs";
6
6
  import { FastifyInstance, FastifyServerOptions } from "fastify";
7
7
  //#region src/factory/createApp.d.ts
8
8
  /**
@@ -19,7 +19,7 @@ import { FastifyInstance, FastifyServerOptions } from "fastify";
19
19
  * their own `redact` and arc steps aside — this default never overrides
20
20
  * an explicit setting.
21
21
  */
22
- declare const DEFAULT_LOGGER_REDACT_PATHS: readonly ["req.headers.authorization", 'req.headers["x-api-key"]', 'req.headers["x-internal-api-key"]', "req.headers.cookie", 'req.headers["set-cookie"]', 'res.headers["set-cookie"]', "*.password", "*.passwordHash", "*.token", "*.accessToken", "*.refreshToken", "*.secret", "*.apiKey"];
22
+ declare const DEFAULT_LOGGER_REDACT_PATHS: readonly ["req.headers.authorization", 'req.headers["x-api-key"]', 'req.headers["x-internal-api-key"]', 'req.headers["x-device-token"]', "req.headers.cookie", 'req.headers["set-cookie"]', 'res.headers["set-cookie"]', "*.password", "*.passwordHash", "*.token", "*.accessToken", "*.refreshToken", "*.secret", "*.apiKey"];
23
23
  /**
24
24
  * Create a production-ready Fastify application with Arc framework.
25
25
  *
@@ -1,8 +1,8 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { r as mergeHealthChecks, t as healthPlugin } from "../health-BlGHjkqZ.mjs";
3
- import { S as resolveModule, _ as describeResolvedModule, a as createApp, b as collectModuleWorkflows, c as edgePreset, d as testingPreset, f as workerPreset, g as subscribeModuleEventHandlers, h as orderModules, i as DEFAULT_LOGGER_REDACT_PATHS, l as getPreset, m as hasModule, n as preloadResourcesAsync, p as getModuleState, r as ArcFactory, s as developmentPreset, t as preloadResources, u as productionPreset, v as collectModuleHealthChecks, x as resolveContribution, y as collectModuleScheduledJobs } from "../preloadResources-BAx5s9EF.mjs";
4
- import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-CNcwCKUJ.mjs";
5
- import { t as loadResources } from "../loadResources-E5UFlRrT.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { r as mergeHealthChecks, t as healthPlugin } from "../health-ZRHeDHXH.mjs";
3
+ import { S as resolveModule, _ as describeResolvedModule, a as createApp, b as collectModuleWorkflows, c as edgePreset, d as testingPreset, f as workerPreset, g as subscribeModuleEventHandlers, h as orderModules, i as DEFAULT_LOGGER_REDACT_PATHS, l as getPreset, m as hasModule, n as preloadResourcesAsync, p as getModuleState, r as ArcFactory, s as developmentPreset, t as preloadResources, u as productionPreset, v as collectModuleHealthChecks, x as resolveContribution, y as collectModuleScheduledJobs } from "../preloadResources-f3boenVZ.mjs";
4
+ import { a as lazyModuleExports, i as hasModuleExports, n as getModuleExports, o as lazyRequiredModuleExports, r as getOptionalModuleExports, t as defineModule } from "../module-DpLJG2_N.mjs";
5
+ import { t as loadResources } from "../loadResources-BPfWiI5s.mjs";
6
6
  //#region src/factory/module/extend.ts
7
7
  /** Concatenate two contributions, resolving factories only when arc asks. */
8
8
  function mergeContribution(own, extra) {
@@ -1,8 +1,8 @@
1
1
 
2
- import { on as HookSystem, z as ResourceRegistry } from "./index-D3sIPcD4.mjs";
2
+ import { on as HookSystem, z as ResourceRegistry } from "./index-DHbyPo5j.mjs";
3
3
  import { t as ExternalOpenApiPaths } from "./externalPaths-CmGOxOtD.mjs";
4
- import { _ as HealthCheck, f as ScheduleDefinition, r as ArcModuleRegistry, t as ArcModule } from "./types-BVlowlm7.mjs";
5
- import { s as ModuleState } from "./index-DbMglURO.mjs";
4
+ import { _ as HealthCheck, f as ScheduleDefinition, r as ArcModuleRegistry, t as ArcModule } from "./types-DfVDvkdP.mjs";
5
+ import { s as ModuleState } from "./index-CFfLKMH4.mjs";
6
6
  import { FastifyPluginAsync } from "fastify";
7
7
  //#region src/factory/module/descriptor.d.ts
8
8
  /**
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/permissions/fields.ts
3
3
  /**
4
4
  * Field-Level Permissions
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { t as pluralize } from "./pluralize-BaQ62hOW.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { t as pluralize } from "./pluralize-CXWZIzTv.mjs";
3
3
  import { join } from "node:path";
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  //#region src/cli/commands/generate/name-helpers.ts
@@ -1,5 +1,5 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { u as ValidationError } from "./errors-BHD3L8of.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { u as ValidationError } from "./errors-BH7YU_9O.mjs";
3
3
  //#region src/utils/headers.ts
4
4
  /**
5
5
  * Canonical header typing + accessor.
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  import { randomUUID } from "node:crypto";
3
3
  import fp from "fastify-plugin";
4
4
  //#region src/plugins/requestId.ts
@@ -252,7 +252,7 @@ const healthPlugin = async (fastify, opts = {}) => {
252
252
  properties: {
253
253
  status: {
254
254
  type: "string",
255
- enum: ["not_ready"]
255
+ enum: ["not_ready", "draining"]
256
256
  },
257
257
  timestamp: { type: "string" },
258
258
  checks: { type: "array" }
@@ -260,6 +260,14 @@ const healthPlugin = async (fastify, opts = {}) => {
260
260
  }
261
261
  }
262
262
  } }, async (_, reply) => {
263
+ if (fastify.hasDecorator("shutdownState") && fastify.shutdownState.draining) {
264
+ reply.code(503);
265
+ return {
266
+ status: "draining",
267
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
268
+ checks: []
269
+ };
270
+ }
263
271
  const results = await runChecks(readinessChecks);
264
272
  const criticalFailed = results.some((result, index) => !result.healthy && (readinessChecks[index]?.critical ?? true));
265
273
  const response = {
@@ -1,3 +1,3 @@
1
1
 
2
- import { an as HookRegistration, cn as afterCreate, dn as beforeCreate, en as DefineHookOptions, fn as beforeDelete, hn as defineHook, in as HookPhase, ln as afterDelete, mn as createHookSystem, nn as HookHandler, on as HookSystem, pn as beforeUpdate, rn as HookOperation, sn as HookSystemOptions, tn as HookContext, un as afterUpdate } from "../index-D3sIPcD4.mjs";
2
+ import { an as HookRegistration, cn as afterCreate, dn as beforeCreate, en as DefineHookOptions, fn as beforeDelete, hn as defineHook, in as HookPhase, ln as afterDelete, mn as createHookSystem, nn as HookHandler, on as HookSystem, pn as beforeUpdate, rn as HookOperation, sn as HookSystemOptions, tn as HookContext, un as afterUpdate } from "../index-DHbyPo5j.mjs";
3
3
  export { type DefineHookOptions, type HookContext, type HookHandler, type HookOperation, type HookPhase, type HookRegistration, HookSystem, type HookSystemOptions, afterCreate, afterDelete, afterUpdate, beforeCreate, beforeDelete, beforeUpdate, createHookSystem, defineHook };
@@ -1,3 +1,3 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { a as beforeCreate, c as createHookSystem, i as afterUpdate, l as defineHook, n as afterCreate, o as beforeDelete, r as afterDelete, s as beforeUpdate, t as HookSystem } from "../HookSystem-96nzZLmk.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { a as beforeCreate, c as createHookSystem, i as afterUpdate, l as defineHook, n as afterCreate, o as beforeDelete, r as afterDelete, s as beforeUpdate, t as HookSystem } from "../HookSystem-CMF94SEA.mjs";
3
3
  export { HookSystem, afterCreate, afterDelete, afterUpdate, beforeCreate, beforeDelete, beforeUpdate, createHookSystem, defineHook };
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { i as createIdempotencyResult, n as IdempotencyResult, r as IdempotencyStore, t as IdempotencyLock } from "../interface-DEWNOMza.mjs";
3
- import { i as RedisIdempotencyStoreOptions, n as RedisClient } from "../redis-CduhKsJi.mjs";
3
+ import { i as RedisIdempotencyStoreOptions, n as RedisClient } from "../redis-Bzi1y3F9.mjs";
4
4
  import { FastifyPluginAsync } from "fastify";
5
5
  import { RepositoryLike } from "@classytic/repo-core/adapter";
6
6
  //#region src/idempotency/idempotencyPlugin.d.ts
@@ -1,7 +1,7 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
2
- import { n as requireSingleHeaderValue } from "../headers-BFEEshDS.mjs";
3
- import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "../store-helpers-BfyOd5i6.mjs";
4
- import { t as createIdempotencyResult } from "../interface-DjtFnZxH.mjs";
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
+ import { n as requireSingleHeaderValue } from "../headers-BIXWKrzQ.mjs";
3
+ import { n as createSafeGetOne, t as createIsDuplicateKeyError } from "../store-helpers-dW71XVWL.mjs";
4
+ import { t as createIdempotencyResult } from "../interface-YzIbF7Ii.mjs";
5
5
  import { and, eq, exists, gt, lt, or, startsWith } from "@classytic/repo-core/filter";
6
6
  import { createHash } from "node:crypto";
7
7
  import fp from "fastify-plugin";
@@ -1,3 +1,3 @@
1
1
 
2
- import { a as UpstashRedisLike, i as RedisIdempotencyStoreOptions, n as RedisClient, o as ioredisAsIdempotencyClient, r as RedisIdempotencyStore, s as upstashAsIdempotencyClient, t as IoredisLike } from "../redis-CduhKsJi.mjs";
2
+ import { a as UpstashRedisLike, i as RedisIdempotencyStoreOptions, n as RedisClient, o as ioredisAsIdempotencyClient, r as RedisIdempotencyStore, s as upstashAsIdempotencyClient, t as IoredisLike } from "../redis-Bzi1y3F9.mjs";
3
3
  export { type IoredisLike, type RedisClient, RedisIdempotencyStore, type RedisIdempotencyStoreOptions, type UpstashRedisLike, ioredisAsIdempotencyClient, upstashAsIdempotencyClient };
@@ -1,4 +1,4 @@
1
- /*! @classytic/arc v2.40.0 | MIT | https://classytic.com */
1
+ /*! @classytic/arc v2.41.1 | MIT | https://classytic.com */
2
2
  //#region src/idempotency/stores/redis.ts
3
3
  var RedisIdempotencyStore = class {
4
4
  name = "redis";
@@ -1,8 +1,8 @@
1
1
 
2
2
  import { i as RequestScope, n as Mandate } from "./types-Ddl9OjmE.mjs";
3
- import { l as PermissionCheck, s as AuthorizationDecision, u as PermissionContext } from "./base-C-NL2fTi.mjs";
3
+ import { l as PermissionCheck, s as AuthorizationDecision, u as PermissionContext } from "./base-CxrV1LmG.mjs";
4
4
  import { r as CacheStore, t as CacheLogger } from "./interface-BOk3YnTz.mjs";
5
- import { FastifyReply, FastifyRequest } from "fastify";
5
+ import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
6
6
  //#region src/permissions/agent.d.ts
7
7
  /**
8
8
  * Require a sender-constrained credential — the inbound token MUST carry a
@@ -441,6 +441,14 @@ interface DynamicPermissionMatrixConfig {
441
441
  /** Hard entry cap for internal memory store (default: 1000) */
442
442
  maxEntries?: number;
443
443
  };
444
+ /**
445
+ * App to declare the cache to (`declareRuntimeCapability`). This is a pure
446
+ * factory with no Fastify handle of its own, so without it the internal
447
+ * memory cache is invisible to the `runtime: 'distributed'` audit — a
448
+ * revocation on one replica then leaves the others honouring the old
449
+ * roles until TTL. Pass the instance whenever one exists at construction.
450
+ */
451
+ fastify?: FastifyInstance;
444
452
  }
445
453
  /** Minimal publish/subscribe interface for cross-node cache invalidation. */
446
454
  interface PermissionEventBus {
@@ -1,5 +1,5 @@
1
1
 
2
- import { _ as HealthCheck, a as ModuleContribution, f as ScheduleDefinition, n as ArcModuleInput, r as ArcModuleRegistry, s as ModuleSetupContext, t as ArcModule } from "./types-BVlowlm7.mjs";
2
+ import { _ as HealthCheck, a as ModuleContribution, f as ScheduleDefinition, n as ArcModuleInput, r as ArcModuleRegistry, s as ModuleSetupContext, t as ArcModule } from "./types-DfVDvkdP.mjs";
3
3
  import { FastifyInstance } from "fastify";
4
4
  //#region src/factory/module/contributions.d.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
 
2
- import { l as PermissionCheck } from "./base-C-NL2fTi.mjs";
2
+ import { l as PermissionCheck } from "./base-CxrV1LmG.mjs";
3
3
  import { FastifyPluginAsync } from "fastify";
4
4
  //#region src/integrations/jobs/execution.d.ts
5
5
  /**
@@ -1,8 +1,8 @@
1
1
 
2
2
  import { i as RequestScope } from "./types-Ddl9OjmE.mjs";
3
- import { l as PermissionCheck, t as AnyRecord } from "./base-C-NL2fTi.mjs";
4
- import { C as RequestContext, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, H as CrudController, In as IRequestContext, L as RequestWithExtras, Pn as IController, T as CrudRouterOptions, U as ResourceConfig, V as ResourceDefinition, et as RouteSchemaOptions, jt as RouteMcpConfig, tt as ArcFieldRule, ut as AggregationConfig } from "./index-D3sIPcD4.mjs";
5
- import "./fastify-augmentation-HncZMmze.mjs";
3
+ import { l as PermissionCheck, t as AnyRecord } from "./base-CxrV1LmG.mjs";
4
+ import { C as RequestContext, Et as ActionDefinition, F as FastifyWithDecorators, Fn as IControllerResponse, H as CrudController, In as IRequestContext, L as RequestWithExtras, Pn as IController, T as CrudRouterOptions, U as ResourceConfig, V as ResourceDefinition, et as RouteSchemaOptions, jt as RouteMcpConfig, tt as ArcFieldRule, ut as AggregationConfig } from "./index-DHbyPo5j.mjs";
5
+ import "./fastify-augmentation-Cq2nHVaW.mjs";
6
6
  import { Filter } from "@classytic/repo-core/filter";
7
7
  import { FastifyReply, FastifyRequest, RouteHandlerMethod } from "fastify";
8
8
  import { z } from "zod";
@@ -1,11 +1,11 @@
1
1
 
2
2
  import { P as ArcHeaders, i as RequestScope } from "./types-Ddl9OjmE.mjs";
3
- import { d as UserBase, l as PermissionCheck, t as AnyRecord } from "./base-C-NL2fTi.mjs";
3
+ import { d as UserBase, l as PermissionCheck, t as AnyRecord } from "./base-CxrV1LmG.mjs";
4
4
  import { a as QueryCacheConfig } from "./QueryCache-DFA-QrU9.mjs";
5
5
  import "./elevation-BXCfVcNG.mjs";
6
6
  import { n as FieldPermissionMap } from "./fields-I_EeRWND.mjs";
7
7
  import { n as EncryptionDirective } from "./types-ByHn9rEO.mjs";
8
- import { n as DomainEvent } from "./EventTransport-BPOQsEer.mjs";
8
+ import { n as DomainEvent } from "./EventTransport-CbUKDzZZ.mjs";
9
9
  import { Filter } from "@classytic/repo-core/filter";
10
10
  import { AggDateBucket, AggMeasure, AggTopN, QueryOptions, StandardRepo, TenantPurgeStrategy, TransactionHandle } from "@classytic/repo-core/repository";
11
11
  import { KeysetPaginationResult, OffsetPaginationResult } from "@classytic/repo-core/pagination";
@@ -4071,6 +4071,8 @@ interface GracefulShutdownOptions {
4071
4071
  onShutdown?: () => Promise<void> | void;
4072
4072
  signals?: NodeJS.Signals[];
4073
4073
  logEvents?: boolean;
4074
+ /** Lame-duck window (ms) between failing readiness and closing. Default 0. */
4075
+ drainDelayMs?: number;
4074
4076
  }
4075
4077
  interface RequestIdOptions {
4076
4078
  headerName?: string;
@@ -4169,6 +4171,8 @@ interface ArcInternalMetadata extends RequestContext {
4169
4171
  _policyFilters?: Record<string, unknown>;
4170
4172
  /** Request scope from scope resolution */
4171
4173
  _scope?: RequestScope;
4174
+ /** This read is deliberately unscoped by tenant — see `_crossTenantRead` on FastifyRequest. */
4175
+ _crossTenantRead?: boolean;
4172
4176
  /** Ownership check config from ownedByUser preset */
4173
4177
  _ownershipCheck?: {
4174
4178
  field: string;
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
 
2
- import { c as DataPolicy, d as UserBase, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "./base-C-NL2fTi.mjs";
3
- import { A as RequestIdOptions, An as WriteVerbKey, B as defineResource, Bt as BaseController, C as RequestContext, Cn as ControllerConstructionOptions, D as HealthCheck, Dn as MutationWriteContext, E as GracefulShutdownOptions, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, Gt as SlugExt, H as CrudController, Ht as SoftDeleteMixin, In as IRequestContext, Jt as BulkMixin, Kt as SlugMixin, L as RequestWithExtras, Ln as RawRouteHandler, Mn as ControllerLike, N as FastifyRequestExtras, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, P as FastifyWithAuth, Pn as IController, Q as MiddlewareConfig, Rn as RouteHandler, S as QueryParserInterface, Sn as ControllerConfigurableOptions, T as CrudRouterOptions, U as ResourceConfig, Ut as TreeExt, V as ResourceDefinition, Vt as SoftDeleteExt, Wt as TreeMixin, X as CrudRouteKey, Y as PresetResult, Yt as BaseCrudController, Z as CrudSchemas, _n as ArcDeleteResult, a as InferAdapterDoc, bn as ArcUpdateResult, c as TypedController, ct as AggMeasureShorthand, d as PaginationResult, dt as AggregationDateRangeRequirement, et as RouteSchemaOptions, f as IntrospectionData, ft as AggregationIndexHint, g as ArcInternalMetadata, gn as ArcCreateResult, gt as AggregationsMap, h as ResourceMetadata, ht as AggregationRateLimit, i as ValidationResult, k as IntrospectionPluginOptions, kn as WriteContext, l as TypedRepository, lt as AggregationCacheConfig, m as RegistryStats, mt as AggregationMaterializedResult, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, pt as AggregationMaterializedContext, q as PresetFunction, qt as BulkExt, r as ValidateOptions, s as InferResourceDoc, st as AggMeasureInput, t as RouteHandlerMethod, u as TypedResourceConfig, ut as AggregationConfig, vn as ArcGetResult, w as ServiceContext, wn as ListResult, xn as BaseControllerOptions, y as OwnershipCheck, yn as ArcListResult } from "./index-D3sIPcD4.mjs";
2
+ import { c as DataPolicy, d as UserBase, l as PermissionCheck, n as ArcRequest, o as UserOrganization, r as JWTPayload, s as AuthorizationDecision, t as AnyRecord, u as PermissionContext } from "./base-CxrV1LmG.mjs";
3
+ import { A as RequestIdOptions, An as WriteVerbKey, B as defineResource, Bt as BaseController, C as RequestContext, Cn as ControllerConstructionOptions, D as HealthCheck, Dn as MutationWriteContext, E as GracefulShutdownOptions, F as FastifyWithDecorators, Fn as IControllerResponse, Ft as AuthPluginOptions, Gt as SlugExt, H as CrudController, Ht as SoftDeleteMixin, In as IRequestContext, Jt as BulkMixin, Kt as SlugMixin, L as RequestWithExtras, Ln as RawRouteHandler, Mn as ControllerLike, N as FastifyRequestExtras, Nt as RateLimitConfig, O as HealthOptions, On as ResourceWrites, P as FastifyWithAuth, Pn as IController, Q as MiddlewareConfig, Rn as RouteHandler, S as QueryParserInterface, Sn as ControllerConfigurableOptions, T as CrudRouterOptions, U as ResourceConfig, Ut as TreeExt, V as ResourceDefinition, Vt as SoftDeleteExt, Wt as TreeMixin, X as CrudRouteKey, Y as PresetResult, Yt as BaseCrudController, Z as CrudSchemas, _n as ArcDeleteResult, a as InferAdapterDoc, bn as ArcUpdateResult, c as TypedController, ct as AggMeasureShorthand, d as PaginationResult, dt as AggregationDateRangeRequirement, et as RouteSchemaOptions, f as IntrospectionData, ft as AggregationIndexHint, g as ArcInternalMetadata, gn as ArcCreateResult, gt as AggregationsMap, h as ResourceMetadata, ht as AggregationRateLimit, i as ValidationResult, k as IntrospectionPluginOptions, kn as WriteContext, l as TypedRepository, lt as AggregationCacheConfig, m as RegistryStats, mt as AggregationMaterializedResult, n as ConfigError, nt as FieldRule, o as InferDocType, ot as EventDefinition, p as RegistryEntry, pt as AggregationMaterializedContext, q as PresetFunction, qt as BulkExt, r as ValidateOptions, s as InferResourceDoc, st as AggMeasureInput, t as RouteHandlerMethod, u as TypedResourceConfig, ut as AggregationConfig, vn as ArcGetResult, w as ServiceContext, wn as ListResult, xn as BaseControllerOptions, y as OwnershipCheck, yn as ArcListResult } from "./index-DHbyPo5j.mjs";
4
4
  import { a as applyFieldWritePermissions, i as applyFieldReadPermissions, n as FieldPermissionMap, o as fields, t as FieldPermission } from "./fields-I_EeRWND.mjs";
5
- import "./fastify-augmentation-HncZMmze.mjs";
6
- import { A as CRUD_OPERATIONS, B as HookOperation, C as SeamedResourceConfig, E as defineAction, F as DEFAULT_SORT, G as MUTATION_OPERATIONS, H as MAX_FILTER_DEPTH, I as DEFAULT_TENANT_FIELD, J as SYSTEM_FIELDS, K as MutationOperation, L as DEFAULT_UPDATE_METHOD, M as DEFAULT_ID_FIELD, N as DEFAULT_LIMIT, P as DEFAULT_MAX_LIMIT, R as HOOK_OPERATIONS, S as ResourceSeams, U as MAX_REGEX_LENGTH, V as HookPhase, W as MAX_SEARCH_LENGTH, b as defineResourceVariants, c as nativePolicyFilter, h as getControllerScope, j as CrudOperation, k as defineAggregation, q as RESERVED_QUERY_PARAMS, s as NativePolicyFilter, w as mergeResourceConfig, x as AdapterLike, z as HOOK_PHASES } from "./index-SCsOJxWB.mjs";
7
- import { $ as requireAuth, C as requireServiceScope, G as createOrgPermissions, H as DynamicPermissionMatrixConfig, J as allowPublic, K as allOf, S as requireScopeContext, V as DynamicPermissionMatrix, W as createDynamicPermissionMatrix, Y as anyOf, Z as denyAll, _ as publicReadAdminWrite, b as requireOrgMembership, d as authenticated, et as requireOwnership, f as fullPublic, g as publicRead, h as presets_d_exports, it as when, nt as requireRoles, p as ownerWithAdminBypass, u as adminOnly, v as readOnly, w as requireTeamMembership, x as requireOrgRole, y as requireOrgInScope } from "./index-BtYoMip1.mjs";
5
+ import "./fastify-augmentation-Cq2nHVaW.mjs";
6
+ import { A as CRUD_OPERATIONS, B as HookOperation, C as SeamedResourceConfig, E as defineAction, F as DEFAULT_SORT, G as MUTATION_OPERATIONS, H as MAX_FILTER_DEPTH, I as DEFAULT_TENANT_FIELD, J as SYSTEM_FIELDS, K as MutationOperation, L as DEFAULT_UPDATE_METHOD, M as DEFAULT_ID_FIELD, N as DEFAULT_LIMIT, P as DEFAULT_MAX_LIMIT, R as HOOK_OPERATIONS, S as ResourceSeams, U as MAX_REGEX_LENGTH, V as HookPhase, W as MAX_SEARCH_LENGTH, b as defineResourceVariants, c as nativePolicyFilter, h as getControllerScope, j as CrudOperation, k as defineAggregation, q as RESERVED_QUERY_PARAMS, s as NativePolicyFilter, w as mergeResourceConfig, x as AdapterLike, z as HOOK_PHASES } from "./index-D4u76eQW.mjs";
7
+ import { $ as requireAuth, C as requireServiceScope, G as createOrgPermissions, H as DynamicPermissionMatrixConfig, J as allowPublic, K as allOf, S as requireScopeContext, V as DynamicPermissionMatrix, W as createDynamicPermissionMatrix, Y as anyOf, Z as denyAll, _ as publicReadAdminWrite, b as requireOrgMembership, d as authenticated, et as requireOwnership, f as fullPublic, g as publicRead, h as presets_d_exports, it as when, nt as requireRoles, p as ownerWithAdminBypass, u as adminOnly, v as readOnly, w as requireTeamMembership, x as requireOrgRole, y as requireOrgInScope } from "./index-BHdZD8zK.mjs";
8
8
  import { a as NotFoundError, d as ValidationError, f as createDomainError, i as ForbiddenError, t as ArcError, u as UnauthorizedError } from "./errors-BGdVwP25.mjs";
9
9
  //#region src/index.d.ts
10
10
  declare const version: string;